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

/***/ "../node_modules/@jupyterlab/services/lib/basemanager.js":
/*!***************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/basemanager.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BaseManager = void 0;\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst serverconnection_1 = __webpack_require__(/*! ./serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\nclass BaseManager {\n    constructor(options) {\n        var _a;\n        this._isDisposed = false;\n        this._disposed = new signaling_1.Signal(this);\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n    }\n    /**\n     * A signal emitted when the delegate is disposed.\n     */\n    get disposed() {\n        return this._disposed;\n    }\n    /**\n     * Test whether the delegate has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the delegate and invoke the callback function.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._disposed.emit(undefined);\n        signaling_1.Signal.clearData(this);\n    }\n}\nexports.BaseManager = BaseManager;\n//# sourceMappingURL=basemanager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/basemanager.js?");

/***/ }),

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

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.BuildManager = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\n/**\n * The url for the lab build service.\n */\nconst BUILD_SETTINGS_URL = 'api/build';\n/**\n * The build API service manager.\n */\nclass BuildManager {\n    /**\n     * Create a new setting manager.\n     */\n    constructor(options = {}) {\n        var _a;\n        this._url = '';\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n        const { baseUrl, appUrl } = this.serverSettings;\n        this._url = coreutils_1.URLExt.join(baseUrl, appUrl, BUILD_SETTINGS_URL);\n    }\n    /**\n     * Test whether the build service is available.\n     */\n    get isAvailable() {\n        return coreutils_1.PageConfig.getOption('buildAvailable').toLowerCase() === 'true';\n    }\n    /**\n     * Test whether to check build status automatically.\n     */\n    get shouldCheck() {\n        return coreutils_1.PageConfig.getOption('buildCheck').toLowerCase() === 'true';\n    }\n    /**\n     * Get whether the application should be built.\n     */\n    getStatus() {\n        const { _url, serverSettings } = this;\n        const promise = serverconnection_1.ServerConnection.makeRequest(_url, {}, serverSettings);\n        return promise\n            .then(response => {\n            if (response.status !== 200) {\n                throw new serverconnection_1.ServerConnection.ResponseError(response);\n            }\n            return response.json();\n        })\n            .then(data => {\n            if (typeof data.status !== 'string') {\n                throw new Error('Invalid data');\n            }\n            if (typeof data.message !== 'string') {\n                throw new Error('Invalid data');\n            }\n            return data;\n        });\n    }\n    /**\n     * Build the application.\n     */\n    build() {\n        const { _url, serverSettings } = this;\n        const init = { method: 'POST' };\n        const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);\n        return promise.then(response => {\n            if (response.status === 400) {\n                throw new serverconnection_1.ServerConnection.ResponseError(response, 'Build aborted');\n            }\n            if (response.status !== 200) {\n                const message = `Build failed with ${response.status}, please run 'jupyter lab build' on the server for full output`;\n                throw new serverconnection_1.ServerConnection.ResponseError(response, message);\n            }\n        });\n    }\n    /**\n     * Cancel an active build.\n     */\n    cancel() {\n        const { _url, serverSettings } = this;\n        const init = { method: 'DELETE' };\n        const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);\n        return promise.then(response => {\n            if (response.status !== 204) {\n                throw new serverconnection_1.ServerConnection.ResponseError(response);\n            }\n        });\n    }\n}\nexports.BuildManager = BuildManager;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/builder/index.js?");

/***/ }),

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

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ConfigWithDefaults = exports.ConfigSection = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\n/**\n * The url for the config service.\n */\nconst SERVICE_CONFIG_URL = 'api/config';\n/**\n * The namespace for ConfigSection statics.\n */\nvar ConfigSection;\n(function (ConfigSection) {\n    /**\n     * Create a config section.\n     *\n     * @returns A Promise that is fulfilled with the config section is loaded.\n     */\n    function create(options) {\n        const section = new DefaultConfigSection(options);\n        return section.load().then(() => {\n            return section;\n        });\n    }\n    ConfigSection.create = create;\n})(ConfigSection = exports.ConfigSection || (exports.ConfigSection = {}));\n/**\n * Implementation of the Configurable data section.\n */\nclass DefaultConfigSection {\n    /**\n     * Construct a new config section.\n     */\n    constructor(options) {\n        var _a;\n        this._url = 'unknown';\n        const settings = (this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings());\n        this._url = coreutils_1.URLExt.join(settings.baseUrl, SERVICE_CONFIG_URL, encodeURIComponent(options.name));\n    }\n    /**\n     * Get the data for this section.\n     */\n    get data() {\n        return this._data;\n    }\n    /**\n     * Load the initial data for this section.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/config).\n     *\n     * The promise is fulfilled on a valid response and rejected otherwise.\n     */\n    async load() {\n        const response = await __1.ServerConnection.makeRequest(this._url, {}, this.serverSettings);\n        if (response.status !== 200) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        this._data = await response.json();\n    }\n    /**\n     * Modify the stored config values.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/config).\n     *\n     * The promise is fulfilled on a valid response and rejected otherwise.\n     *\n     * Updates the local data immediately, sends the change to the server,\n     * and updates the local data with the response, and fulfils the promise\n     * with that data.\n     */\n    async update(newdata) {\n        this._data = Object.assign(Object.assign({}, this._data), newdata);\n        const init = {\n            method: 'PATCH',\n            body: JSON.stringify(newdata)\n        };\n        const response = await __1.ServerConnection.makeRequest(this._url, init, this.serverSettings);\n        if (response.status !== 200) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        this._data = await response.json();\n        return this._data;\n    }\n}\n/**\n * Configurable object with defaults.\n */\nclass ConfigWithDefaults {\n    /**\n     * Create a new config with defaults.\n     */\n    constructor(options) {\n        var _a, _b;\n        this._className = '';\n        this._section = options.section;\n        this._defaults = (_a = options.defaults) !== null && _a !== void 0 ? _a : {};\n        this._className = (_b = options.className) !== null && _b !== void 0 ? _b : '';\n    }\n    /**\n     * Get data from the config section or fall back to defaults.\n     */\n    get(key) {\n        const data = this._classData();\n        return key in data ? data[key] : this._defaults[key];\n    }\n    /**\n     * Set a config value.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/config).\n     *\n     * The promise is fulfilled on a valid response and rejected otherwise.\n     *\n     * Sends the update to the server, and changes our local copy of the data\n     * immediately.\n     */\n    set(key, value) {\n        const d = {};\n        d[key] = value;\n        if (this._className) {\n            const d2 = {};\n            d2[this._className] = d;\n            return this._section.update(d2);\n        }\n        else {\n            return this._section.update(d);\n        }\n    }\n    /**\n     * Get data from the Section with our classname, if available.\n     *\n     * #### Notes\n     * If we have no classname, get all of the data in the Section\n     */\n    _classData() {\n        const data = this._section.data;\n        if (this._className && this._className in data) {\n            return data[this._className];\n        }\n        return data;\n    }\n}\nexports.ConfigWithDefaults = ConfigWithDefaults;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/config/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/contents/index.js":
/*!******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/contents/index.js ***!
  \******************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Drive = exports.ContentsManager = exports.Contents = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst algorithm_1 = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\nconst validate = __importStar(__webpack_require__(/*! ./validate */ \"../node_modules/@jupyterlab/services/lib/contents/validate.js\"));\n/**\n * The url for the default drive service.\n */\nconst SERVICE_DRIVE_URL = 'api/contents';\n/**\n * The url for the file access.\n */\nconst FILES_URL = 'files';\n/**\n * A namespace for contents interfaces.\n */\nvar Contents;\n(function (Contents) {\n    /**\n     * Validates an IModel, throwing an error if it does not pass.\n     */\n    function validateContentsModel(contents) {\n        validate.validateContentsModel(contents);\n    }\n    Contents.validateContentsModel = validateContentsModel;\n    /**\n     * Validates an ICheckpointModel, throwing an error if it does not pass.\n     */\n    function validateCheckpointModel(checkpoint) {\n        validate.validateCheckpointModel(checkpoint);\n    }\n    Contents.validateCheckpointModel = validateCheckpointModel;\n})(Contents = exports.Contents || (exports.Contents = {}));\n/**\n * A contents manager that passes file operations to the server.\n * Multiple servers implementing the `IDrive` interface can be\n * attached to the contents manager, so that the same session can\n * perform file operations on multiple backends.\n *\n * This includes checkpointing with the normal file operations.\n */\nclass ContentsManager {\n    /**\n     * Construct a new contents manager object.\n     *\n     * @param options - The options used to initialize the object.\n     */\n    constructor(options = {}) {\n        var _a, _b;\n        this._isDisposed = false;\n        this._additionalDrives = new Map();\n        this._fileChanged = new signaling_1.Signal(this);\n        const serverSettings = (this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings());\n        this._defaultDrive = (_b = options.defaultDrive) !== null && _b !== void 0 ? _b : new Drive({ serverSettings });\n        this._defaultDrive.fileChanged.connect(this._onFileChanged, this);\n    }\n    /**\n     * A signal emitted when a file operation takes place.\n     */\n    get fileChanged() {\n        return this._fileChanged;\n    }\n    /**\n     * Test whether the manager has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources held by the manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        signaling_1.Signal.clearData(this);\n    }\n    /**\n     * Add an `IDrive` to the manager.\n     */\n    addDrive(drive) {\n        this._additionalDrives.set(drive.name, drive);\n        drive.fileChanged.connect(this._onFileChanged, this);\n    }\n    /**\n     * Given a path, get a ModelDB.IFactory from the\n     * relevant backend. Returns `undefined` if the backend\n     * does not provide one.\n     */\n    getModelDBFactory(path) {\n        var _a;\n        const [drive] = this._driveForPath(path);\n        return (_a = drive === null || drive === void 0 ? void 0 : drive.modelDBFactory) !== null && _a !== void 0 ? _a : null;\n    }\n    /**\n     * Given a path of the form `drive:local/portion/of/it.txt`\n     * get the local part of it.\n     *\n     * @param path: the path.\n     *\n     * @returns The local part of the path.\n     */\n    localPath(path) {\n        const parts = path.split('/');\n        const firstParts = parts[0].split(':');\n        if (firstParts.length === 1 || !this._additionalDrives.has(firstParts[0])) {\n            return coreutils_1.PathExt.removeSlash(path);\n        }\n        return coreutils_1.PathExt.join(firstParts.slice(1).join(':'), ...parts.slice(1));\n    }\n    /**\n     * Normalize a global path. Reduces '..' and '.' parts, and removes\n     * leading slashes from the local part of the path, while retaining\n     * the drive name if it exists.\n     *\n     * @param path: the path.\n     *\n     * @returns The normalized path.\n     */\n    normalize(path) {\n        const parts = path.split(':');\n        if (parts.length === 1) {\n            return coreutils_1.PathExt.normalize(path);\n        }\n        return `${parts[0]}:${coreutils_1.PathExt.normalize(parts.slice(1).join(':'))}`;\n    }\n    /**\n     * Resolve a global path, starting from the root path. Behaves like\n     * posix-path.resolve, with 3 differences:\n     *  - will never prepend cwd\n     *  - if root has a drive name, the result is prefixed with \"<drive>:\"\n     *  - before adding drive name, leading slashes are removed\n     *\n     * @param path: the path.\n     *\n     * @returns The normalized path.\n     */\n    resolvePath(root, path) {\n        const driveName = this.driveName(root);\n        const localPath = this.localPath(root);\n        const resolved = coreutils_1.PathExt.resolve('/', localPath, path);\n        return driveName ? `${driveName}:${resolved}` : resolved;\n    }\n    /**\n     * Given a path of the form `drive:local/portion/of/it.txt`\n     * get the name of the drive. If the path is missing\n     * a drive portion, returns an empty string.\n     *\n     * @param path: the path.\n     *\n     * @returns The drive name for the path, or the empty string.\n     */\n    driveName(path) {\n        const parts = path.split('/');\n        const firstParts = parts[0].split(':');\n        if (firstParts.length === 1) {\n            return '';\n        }\n        if (this._additionalDrives.has(firstParts[0])) {\n            return firstParts[0];\n        }\n        return '';\n    }\n    /**\n     * Get a file or directory.\n     *\n     * @param path: The path to the file.\n     *\n     * @param options: The options used to fetch the file.\n     *\n     * @returns A promise which resolves with the file content.\n     */\n    get(path, options) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.get(localPath, options).then(contentsModel => {\n            const listing = [];\n            if (contentsModel.type === 'directory' && contentsModel.content) {\n                algorithm_1.each(contentsModel.content, (item) => {\n                    listing.push(Object.assign(Object.assign({}, item), { path: this._toGlobalPath(drive, item.path) }));\n                });\n                return Object.assign(Object.assign({}, contentsModel), { path: this._toGlobalPath(drive, localPath), content: listing });\n            }\n            else {\n                return Object.assign(Object.assign({}, contentsModel), { path: this._toGlobalPath(drive, localPath) });\n            }\n        });\n    }\n    /**\n     * Get an encoded download url given a file path.\n     *\n     * @param path - An absolute POSIX file path on the server.\n     *\n     * #### Notes\n     * It is expected that the path contains no relative paths.\n     *\n     * The returned URL may include a query parameter.\n     */\n    getDownloadUrl(path) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.getDownloadUrl(localPath);\n    }\n    /**\n     * Create a new untitled file or directory in the specified directory path.\n     *\n     * @param options: The options used to create the file.\n     *\n     * @returns A promise which resolves with the created file content when the\n     *    file is created.\n     */\n    newUntitled(options = {}) {\n        if (options.path) {\n            const globalPath = this.normalize(options.path);\n            const [drive, localPath] = this._driveForPath(globalPath);\n            return drive\n                .newUntitled(Object.assign(Object.assign({}, options), { path: localPath }))\n                .then(contentsModel => {\n                return Object.assign(Object.assign({}, contentsModel), { path: coreutils_1.PathExt.join(globalPath, contentsModel.name) });\n            });\n        }\n        else {\n            return this._defaultDrive.newUntitled(options);\n        }\n    }\n    /**\n     * Delete a file.\n     *\n     * @param path - The path to the file.\n     *\n     * @returns A promise which resolves when the file is deleted.\n     */\n    delete(path) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.delete(localPath);\n    }\n    /**\n     * Rename a file or directory.\n     *\n     * @param path - The original file path.\n     *\n     * @param newPath - The new file path.\n     *\n     * @returns A promise which resolves with the new file contents model when\n     *   the file is renamed.\n     */\n    rename(path, newPath) {\n        const [drive1, path1] = this._driveForPath(path);\n        const [drive2, path2] = this._driveForPath(newPath);\n        if (drive1 !== drive2) {\n            throw Error('ContentsManager: renaming files must occur within a Drive');\n        }\n        return drive1.rename(path1, path2).then(contentsModel => {\n            return Object.assign(Object.assign({}, contentsModel), { path: this._toGlobalPath(drive1, path2) });\n        });\n    }\n    /**\n     * Save a file.\n     *\n     * @param path - The desired file path.\n     *\n     * @param options - Optional overrides to the model.\n     *\n     * @returns A promise which resolves with the file content model when the\n     *   file is saved.\n     *\n     * #### Notes\n     * Ensure that `model.content` is populated for the file.\n     */\n    save(path, options = {}) {\n        const globalPath = this.normalize(path);\n        const [drive, localPath] = this._driveForPath(path);\n        return drive\n            .save(localPath, Object.assign(Object.assign({}, options), { path: localPath }))\n            .then(contentsModel => {\n            return Object.assign(Object.assign({}, contentsModel), { path: globalPath });\n        });\n    }\n    /**\n     * Copy a file into a given directory.\n     *\n     * @param path - The original file path.\n     *\n     * @param toDir - The destination directory path.\n     *\n     * @returns A promise which resolves with the new contents model when the\n     *  file is copied.\n     *\n     * #### Notes\n     * The server will select the name of the copied file.\n     */\n    copy(fromFile, toDir) {\n        const [drive1, path1] = this._driveForPath(fromFile);\n        const [drive2, path2] = this._driveForPath(toDir);\n        if (drive1 === drive2) {\n            return drive1.copy(path1, path2).then(contentsModel => {\n                return Object.assign(Object.assign({}, contentsModel), { path: this._toGlobalPath(drive1, contentsModel.path) });\n            });\n        }\n        else {\n            throw Error('Copying files between drives is not currently implemented');\n        }\n    }\n    /**\n     * Create a checkpoint for a file.\n     *\n     * @param path - The path of the file.\n     *\n     * @returns A promise which resolves with the new checkpoint model when the\n     *   checkpoint is created.\n     */\n    createCheckpoint(path) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.createCheckpoint(localPath);\n    }\n    /**\n     * List available checkpoints for a file.\n     *\n     * @param path - The path of the file.\n     *\n     * @returns A promise which resolves with a list of checkpoint models for\n     *    the file.\n     */\n    listCheckpoints(path) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.listCheckpoints(localPath);\n    }\n    /**\n     * Restore a file to a known checkpoint state.\n     *\n     * @param path - The path of the file.\n     *\n     * @param checkpointID - The id of the checkpoint to restore.\n     *\n     * @returns A promise which resolves when the checkpoint is restored.\n     */\n    restoreCheckpoint(path, checkpointID) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.restoreCheckpoint(localPath, checkpointID);\n    }\n    /**\n     * Delete a checkpoint for a file.\n     *\n     * @param path - The path of the file.\n     *\n     * @param checkpointID - The id of the checkpoint to delete.\n     *\n     * @returns A promise which resolves when the checkpoint is deleted.\n     */\n    deleteCheckpoint(path, checkpointID) {\n        const [drive, localPath] = this._driveForPath(path);\n        return drive.deleteCheckpoint(localPath, checkpointID);\n    }\n    /**\n     * Given a drive and a local path, construct a fully qualified\n     * path. The inverse of `_driveForPath`.\n     *\n     * @param drive: an `IDrive`.\n     *\n     * @param localPath: the local path on the drive.\n     *\n     * @returns the fully qualified path.\n     */\n    _toGlobalPath(drive, localPath) {\n        if (drive === this._defaultDrive) {\n            return coreutils_1.PathExt.removeSlash(localPath);\n        }\n        else {\n            return `${drive.name}:${coreutils_1.PathExt.removeSlash(localPath)}`;\n        }\n    }\n    /**\n     * Given a path, get the `IDrive to which it refers,\n     * where the path satisfies the pattern\n     * `'driveName:path/to/file'`. If there is no `driveName`\n     * prepended to the path, it returns the default drive.\n     *\n     * @param path: a path to a file.\n     *\n     * @returns A tuple containing an `IDrive` object for the path,\n     * and a local path for that drive.\n     */\n    _driveForPath(path) {\n        const driveName = this.driveName(path);\n        const localPath = this.localPath(path);\n        if (driveName) {\n            return [this._additionalDrives.get(driveName), localPath];\n        }\n        else {\n            return [this._defaultDrive, localPath];\n        }\n    }\n    /**\n     * Respond to fileChanged signals from the drives attached to\n     * the manager. This prepends the drive name to the path if necessary,\n     * and then forwards the signal.\n     */\n    _onFileChanged(sender, args) {\n        var _a, _b;\n        if (sender === this._defaultDrive) {\n            this._fileChanged.emit(args);\n        }\n        else {\n            let newValue = null;\n            let oldValue = null;\n            if ((_a = args.newValue) === null || _a === void 0 ? void 0 : _a.path) {\n                newValue = Object.assign(Object.assign({}, args.newValue), { path: this._toGlobalPath(sender, args.newValue.path) });\n            }\n            if ((_b = args.oldValue) === null || _b === void 0 ? void 0 : _b.path) {\n                oldValue = Object.assign(Object.assign({}, args.oldValue), { path: this._toGlobalPath(sender, args.oldValue.path) });\n            }\n            this._fileChanged.emit({\n                type: args.type,\n                newValue,\n                oldValue\n            });\n        }\n    }\n}\nexports.ContentsManager = ContentsManager;\n/**\n * A default implementation for an `IDrive`, talking to the\n * server using the Jupyter REST API.\n */\nclass Drive {\n    /**\n     * Construct a new contents manager object.\n     *\n     * @param options - The options used to initialize the object.\n     */\n    constructor(options = {}) {\n        var _a, _b, _c;\n        this._isDisposed = false;\n        this._fileChanged = new signaling_1.Signal(this);\n        this.name = (_a = options.name) !== null && _a !== void 0 ? _a : 'Default';\n        this._apiEndpoint = (_b = options.apiEndpoint) !== null && _b !== void 0 ? _b : SERVICE_DRIVE_URL;\n        this.serverSettings = (_c = options.serverSettings) !== null && _c !== void 0 ? _c : __1.ServerConnection.makeSettings();\n    }\n    /**\n     * A signal emitted when a file operation takes place.\n     */\n    get fileChanged() {\n        return this._fileChanged;\n    }\n    /**\n     * Test whether the manager has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources held by the manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        signaling_1.Signal.clearData(this);\n    }\n    /**\n     * Get a file or directory.\n     *\n     * @param localPath: The path to the file.\n     *\n     * @param options: The options used to fetch the file.\n     *\n     * @returns A promise which resolves with the file content.\n     *\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async get(localPath, options) {\n        let url = this._getUrl(localPath);\n        if (options) {\n            // The notebook type cannot take an format option.\n            if (options.type === 'notebook') {\n                delete options['format'];\n            }\n            const content = options.content ? '1' : '0';\n            const params = Object.assign(Object.assign({}, options), { content });\n            url += coreutils_1.URLExt.objectToQueryString(params);\n        }\n        const settings = this.serverSettings;\n        const response = await __1.ServerConnection.makeRequest(url, {}, settings);\n        if (response.status !== 200) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        validate.validateContentsModel(data);\n        return data;\n    }\n    /**\n     * Get an encoded download url given a file path.\n     *\n     * @param localPath - An absolute POSIX file path on the server.\n     *\n     * #### Notes\n     * It is expected that the path contains no relative paths.\n     *\n     * The returned URL may include a query parameter.\n     */\n    getDownloadUrl(localPath) {\n        const baseUrl = this.serverSettings.baseUrl;\n        let url = coreutils_1.URLExt.join(baseUrl, FILES_URL, coreutils_1.URLExt.encodeParts(localPath));\n        const xsrfTokenMatch = document.cookie.match('\\\\b_xsrf=([^;]*)\\\\b');\n        if (xsrfTokenMatch) {\n            const fullUrl = new URL(url);\n            fullUrl.searchParams.append('_xsrf', xsrfTokenMatch[1]);\n            url = fullUrl.toString();\n        }\n        return Promise.resolve(url);\n    }\n    /**\n     * Create a new untitled file or directory in the specified directory path.\n     *\n     * @param options: The options used to create the file.\n     *\n     * @returns A promise which resolves with the created file content when the\n     *    file is created.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async newUntitled(options = {}) {\n        var _a;\n        let body = '{}';\n        if (options) {\n            if (options.ext) {\n                options.ext = Private.normalizeExtension(options.ext);\n            }\n            body = JSON.stringify(options);\n        }\n        const settings = this.serverSettings;\n        const url = this._getUrl((_a = options.path) !== null && _a !== void 0 ? _a : '');\n        const init = {\n            method: 'POST',\n            body\n        };\n        const response = await __1.ServerConnection.makeRequest(url, init, settings);\n        if (response.status !== 201) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        validate.validateContentsModel(data);\n        this._fileChanged.emit({\n            type: 'new',\n            oldValue: null,\n            newValue: data\n        });\n        return data;\n    }\n    /**\n     * Delete a file.\n     *\n     * @param localPath - The path to the file.\n     *\n     * @returns A promise which resolves when the file is deleted.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).\n     */\n    async delete(localPath) {\n        const url = this._getUrl(localPath);\n        const settings = this.serverSettings;\n        const init = { method: 'DELETE' };\n        const response = await __1.ServerConnection.makeRequest(url, init, settings);\n        // TODO: update IPEP27 to specify errors more precisely, so\n        // that error types can be detected here with certainty.\n        if (response.status !== 204) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        this._fileChanged.emit({\n            type: 'delete',\n            oldValue: { path: localPath },\n            newValue: null\n        });\n    }\n    /**\n     * Rename a file or directory.\n     *\n     * @param oldLocalPath - The original file path.\n     *\n     * @param newLocalPath - The new file path.\n     *\n     * @returns A promise which resolves with the new file contents model when\n     *   the file is renamed.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async rename(oldLocalPath, newLocalPath) {\n        const settings = this.serverSettings;\n        const url = this._getUrl(oldLocalPath);\n        const init = {\n            method: 'PATCH',\n            body: JSON.stringify({ path: newLocalPath })\n        };\n        const response = await __1.ServerConnection.makeRequest(url, init, settings);\n        if (response.status !== 200) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        validate.validateContentsModel(data);\n        this._fileChanged.emit({\n            type: 'rename',\n            oldValue: { path: oldLocalPath },\n            newValue: data\n        });\n        return data;\n    }\n    /**\n     * Save a file.\n     *\n     * @param localPath - The desired file path.\n     *\n     * @param options - Optional overrides to the model.\n     *\n     * @returns A promise which resolves with the file content model when the\n     *   file is saved.\n     *\n     * #### Notes\n     * Ensure that `model.content` is populated for the file.\n     *\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async save(localPath, options = {}) {\n        const settings = this.serverSettings;\n        const url = this._getUrl(localPath);\n        const init = {\n            method: 'PUT',\n            body: JSON.stringify(options)\n        };\n        const response = await __1.ServerConnection.makeRequest(url, init, settings);\n        // will return 200 for an existing file and 201 for a new file\n        if (response.status !== 200 && response.status !== 201) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        validate.validateContentsModel(data);\n        this._fileChanged.emit({\n            type: 'save',\n            oldValue: null,\n            newValue: data\n        });\n        return data;\n    }\n    /**\n     * Copy a file into a given directory.\n     *\n     * @param localPath - The original file path.\n     *\n     * @param toDir - The destination directory path.\n     *\n     * @returns A promise which resolves with the new contents model when the\n     *  file is copied.\n     *\n     * #### Notes\n     * The server will select the name of the copied file.\n     *\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async copy(fromFile, toDir) {\n        const settings = this.serverSettings;\n        const url = this._getUrl(toDir);\n        const init = {\n            method: 'POST',\n            body: JSON.stringify({ copy_from: fromFile })\n        };\n        const response = await __1.ServerConnection.makeRequest(url, init, settings);\n        if (response.status !== 201) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        validate.validateContentsModel(data);\n        this._fileChanged.emit({\n            type: 'new',\n            oldValue: null,\n            newValue: data\n        });\n        return data;\n    }\n    /**\n     * Create a checkpoint for a file.\n     *\n     * @param localPath - The path of the file.\n     *\n     * @returns A promise which resolves with the new checkpoint model when the\n     *   checkpoint is created.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async createCheckpoint(localPath) {\n        const url = this._getUrl(localPath, 'checkpoints');\n        const init = { method: 'POST' };\n        const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);\n        if (response.status !== 201) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        validate.validateCheckpointModel(data);\n        return data;\n    }\n    /**\n     * List available checkpoints for a file.\n     *\n     * @param localPath - The path of the file.\n     *\n     * @returns A promise which resolves with a list of checkpoint models for\n     *    the file.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.\n     */\n    async listCheckpoints(localPath) {\n        const url = this._getUrl(localPath, 'checkpoints');\n        const response = await __1.ServerConnection.makeRequest(url, {}, this.serverSettings);\n        if (response.status !== 200) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        if (!Array.isArray(data)) {\n            throw new Error('Invalid Checkpoint list');\n        }\n        for (let i = 0; i < data.length; i++) {\n            validate.validateCheckpointModel(data[i]);\n        }\n        return data;\n    }\n    /**\n     * Restore a file to a known checkpoint state.\n     *\n     * @param localPath - The path of the file.\n     *\n     * @param checkpointID - The id of the checkpoint to restore.\n     *\n     * @returns A promise which resolves when the checkpoint is restored.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).\n     */\n    async restoreCheckpoint(localPath, checkpointID) {\n        const url = this._getUrl(localPath, 'checkpoints', checkpointID);\n        const init = { method: 'POST' };\n        const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);\n        if (response.status !== 204) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n    }\n    /**\n     * Delete a checkpoint for a file.\n     *\n     * @param localPath - The path of the file.\n     *\n     * @param checkpointID - The id of the checkpoint to delete.\n     *\n     * @returns A promise which resolves when the checkpoint is deleted.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).\n     */\n    async deleteCheckpoint(localPath, checkpointID) {\n        const url = this._getUrl(localPath, 'checkpoints', checkpointID);\n        const init = { method: 'DELETE' };\n        const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);\n        if (response.status !== 204) {\n            const err = await __1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n    }\n    /**\n     * Get a REST url for a file given a path.\n     */\n    _getUrl(...args) {\n        const parts = args.map(path => coreutils_1.URLExt.encodeParts(path));\n        const baseUrl = this.serverSettings.baseUrl;\n        return coreutils_1.URLExt.join(baseUrl, this._apiEndpoint, ...parts);\n    }\n}\nexports.Drive = Drive;\n/**\n * A namespace for module private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Normalize a file extension to be of the type `'.foo'`.\n     *\n     * Adds a leading dot if not present and converts to lower case.\n     */\n    function normalizeExtension(extension) {\n        if (extension.length > 0 && extension.indexOf('.') !== 0) {\n            extension = `.${extension}`;\n        }\n        return extension;\n    }\n    Private.normalizeExtension = normalizeExtension;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/contents/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/contents/validate.js":
/*!*********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/contents/validate.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateCheckpointModel = exports.validateContentsModel = void 0;\nconst validate_1 = __webpack_require__(/*! ../validate */ \"../node_modules/@jupyterlab/services/lib/validate.js\");\n/**\n * Validate an `Contents.IModel` object.\n */\nfunction validateContentsModel(model) {\n    validate_1.validateProperty(model, 'name', 'string');\n    validate_1.validateProperty(model, 'path', 'string');\n    validate_1.validateProperty(model, 'type', 'string');\n    validate_1.validateProperty(model, 'created', 'string');\n    validate_1.validateProperty(model, 'last_modified', 'string');\n    validate_1.validateProperty(model, 'mimetype', 'object');\n    validate_1.validateProperty(model, 'content', 'object');\n    validate_1.validateProperty(model, 'format', 'object');\n}\nexports.validateContentsModel = validateContentsModel;\n/**\n * Validate an `Contents.ICheckpointModel` object.\n */\nfunction validateCheckpointModel(model) {\n    validate_1.validateProperty(model, 'id', 'string');\n    validate_1.validateProperty(model, 'last_modified', 'string');\n}\nexports.validateCheckpointModel = validateCheckpointModel;\n//# sourceMappingURL=validate.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/contents/validate.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/index.js":
/*!*********************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/index.js ***!
  \*********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module services\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./config */ \"../node_modules/@jupyterlab/services/lib/config/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./contents */ \"../node_modules/@jupyterlab/services/lib/contents/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./kernel */ \"../node_modules/@jupyterlab/services/lib/kernel/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./kernelspec */ \"../node_modules/@jupyterlab/services/lib/kernelspec/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./manager */ \"../node_modules/@jupyterlab/services/lib/manager.js\"), exports);\n__exportStar(__webpack_require__(/*! ./serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\"), exports);\n__exportStar(__webpack_require__(/*! ./session */ \"../node_modules/@jupyterlab/services/lib/session/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./setting */ \"../node_modules/@jupyterlab/services/lib/setting/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./terminal */ \"../node_modules/@jupyterlab/services/lib/terminal/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./workspace */ \"../node_modules/@jupyterlab/services/lib/workspace/index.js\"), exports);\n__exportStar(__webpack_require__(/*! ./nbconvert */ \"../node_modules/@jupyterlab/services/lib/nbconvert/index.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/comm.js":
/*!***************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/comm.js ***!
  \***************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CommHandler = void 0;\nconst disposable_1 = __webpack_require__(/*! @lumino/disposable */ \"webpack/sharing/consume/default/@lumino/disposable/@lumino/disposable\");\nconst KernelMessage = __importStar(__webpack_require__(/*! ./messages */ \"../node_modules/@jupyterlab/services/lib/kernel/messages.js\"));\n/**\n * Comm channel handler.\n */\nclass CommHandler extends disposable_1.DisposableDelegate {\n    /**\n     * Construct a new comm channel.\n     */\n    constructor(target, id, kernel, disposeCb) {\n        super(disposeCb);\n        this._target = '';\n        this._id = '';\n        this._id = id;\n        this._target = target;\n        this._kernel = kernel;\n    }\n    /**\n     * The unique id for the comm channel.\n     */\n    get commId() {\n        return this._id;\n    }\n    /**\n     * The target name for the comm channel.\n     */\n    get targetName() {\n        return this._target;\n    }\n    /**\n     * Get the callback for a comm close event.\n     *\n     * #### Notes\n     * This is called when the comm is closed from either the server or client.\n     *\n     * **See also:** [[ICommClose]], [[close]]\n     */\n    get onClose() {\n        return this._onClose;\n    }\n    /**\n     * Set the callback for a comm close event.\n     *\n     * #### Notes\n     * This is called when the comm is closed from either the server or client. If\n     * the function returns a promise, and the kernel was closed from the server,\n     * kernel message processing will pause until the returned promise is\n     * fulfilled.\n     *\n     * **See also:** [[close]]\n     */\n    set onClose(cb) {\n        this._onClose = cb;\n    }\n    /**\n     * Get the callback for a comm message received event.\n     */\n    get onMsg() {\n        return this._onMsg;\n    }\n    /**\n     * Set the callback for a comm message received event.\n     *\n     * #### Notes\n     * This is called when a comm message is received. If the function returns a\n     * promise, kernel message processing will pause until it is fulfilled.\n     */\n    set onMsg(cb) {\n        this._onMsg = cb;\n    }\n    /**\n     * Open a comm with optional data and metadata.\n     *\n     * #### Notes\n     * This sends a `comm_open` message to the server.\n     *\n     * **See also:** [[ICommOpen]]\n     */\n    open(data, metadata, buffers = []) {\n        if (this.isDisposed || this._kernel.isDisposed) {\n            throw new Error('Cannot open');\n        }\n        const msg = KernelMessage.createMessage({\n            msgType: 'comm_open',\n            channel: 'shell',\n            username: this._kernel.username,\n            session: this._kernel.clientId,\n            content: {\n                comm_id: this._id,\n                target_name: this._target,\n                data: data !== null && data !== void 0 ? data : {}\n            },\n            metadata,\n            buffers\n        });\n        return this._kernel.sendShellMessage(msg, false, true);\n    }\n    /**\n     * Send a `comm_msg` message to the kernel.\n     *\n     * #### Notes\n     * This is a no-op if the comm has been closed.\n     *\n     * **See also:** [[ICommMsg]]\n     */\n    send(data, metadata, buffers = [], disposeOnDone = true) {\n        if (this.isDisposed || this._kernel.isDisposed) {\n            throw new Error('Cannot send');\n        }\n        const msg = KernelMessage.createMessage({\n            msgType: 'comm_msg',\n            channel: 'shell',\n            username: this._kernel.username,\n            session: this._kernel.clientId,\n            content: {\n                comm_id: this._id,\n                data: data\n            },\n            metadata,\n            buffers\n        });\n        return this._kernel.sendShellMessage(msg, false, disposeOnDone);\n    }\n    /**\n     * Close the comm.\n     *\n     * #### Notes\n     * This will send a `comm_close` message to the kernel, and call the\n     * `onClose` callback if set.\n     *\n     * This is a no-op if the comm is already closed.\n     *\n     * **See also:** [[ICommClose]], [[onClose]]\n     */\n    close(data, metadata, buffers = []) {\n        if (this.isDisposed || this._kernel.isDisposed) {\n            throw new Error('Cannot close');\n        }\n        const msg = KernelMessage.createMessage({\n            msgType: 'comm_close',\n            channel: 'shell',\n            username: this._kernel.username,\n            session: this._kernel.clientId,\n            content: {\n                comm_id: this._id,\n                data: data !== null && data !== void 0 ? data : {}\n            },\n            metadata,\n            buffers\n        });\n        const future = this._kernel.sendShellMessage(msg, false, true);\n        const onClose = this._onClose;\n        if (onClose) {\n            const ioMsg = KernelMessage.createMessage({\n                msgType: 'comm_close',\n                channel: 'iopub',\n                username: this._kernel.username,\n                session: this._kernel.clientId,\n                content: {\n                    comm_id: this._id,\n                    data: data !== null && data !== void 0 ? data : {}\n                },\n                metadata,\n                buffers\n            });\n            // In the future, we may want to communicate back to the user the possible\n            // promise returned from onClose.\n            void onClose(ioMsg);\n        }\n        this.dispose();\n        return future;\n    }\n}\nexports.CommHandler = CommHandler;\n//# sourceMappingURL=comm.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/comm.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/default.js":
/*!******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/default.js ***!
  \******************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.KernelConnection = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst coreutils_2 = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\nconst comm_1 = __webpack_require__(/*! ./comm */ \"../node_modules/@jupyterlab/services/lib/kernel/comm.js\");\nconst KernelMessage = __importStar(__webpack_require__(/*! ./messages */ \"../node_modules/@jupyterlab/services/lib/kernel/messages.js\"));\nconst future_1 = __webpack_require__(/*! ./future */ \"../node_modules/@jupyterlab/services/lib/kernel/future.js\");\nconst serialize = __importStar(__webpack_require__(/*! ./serialize */ \"../node_modules/@jupyterlab/services/lib/kernel/serialize.js\"));\nconst validate = __importStar(__webpack_require__(/*! ./validate */ \"../node_modules/@jupyterlab/services/lib/kernel/validate.js\"));\nconst kernelspec_1 = __webpack_require__(/*! ../kernelspec */ \"../node_modules/@jupyterlab/services/lib/kernelspec/index.js\");\nconst restapi = __importStar(__webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/kernel/restapi.js\"));\nconst KERNEL_INFO_TIMEOUT = 3000;\nconst RESTARTING_KERNEL_SESSION = '_RESTARTING_';\nconst STARTING_KERNEL_SESSION = '';\n/**\n * Implementation of the Kernel object.\n *\n * #### Notes\n * Messages from the server are handled in the order they were received and\n * asynchronously. Any message handler can return a promise, and message\n * handling will pause until the promise is fulfilled.\n */\nclass KernelConnection {\n    /**\n     * Construct a kernel object.\n     */\n    constructor(options) {\n        var _a, _b, _c, _d;\n        /**\n         * Create the kernel websocket connection and add socket status handlers.\n         */\n        this._createSocket = () => {\n            this._errorIfDisposed();\n            // Make sure the socket is clear\n            this._clearSocket();\n            // Update the connection status to reflect opening a new connection.\n            this._updateConnectionStatus('connecting');\n            const settings = this.serverSettings;\n            const partialUrl = coreutils_1.URLExt.join(settings.wsUrl, restapi.KERNEL_SERVICE_URL, encodeURIComponent(this._id));\n            // Strip any authentication from the display string.\n            const display = partialUrl.replace(/^((?:\\w+:)?\\/\\/)(?:[^@\\/]+@)/, '$1');\n            console.debug(`Starting WebSocket: ${display}`);\n            let url = coreutils_1.URLExt.join(partialUrl, 'channels?session_id=' + encodeURIComponent(this._clientId));\n            // If token authentication is in use.\n            const token = settings.token;\n            if (settings.appendToken && token !== '') {\n                url = url + `&token=${encodeURIComponent(token)}`;\n            }\n            this._ws = new settings.WebSocket(url);\n            // Ensure incoming binary messages are not Blobs\n            this._ws.binaryType = 'arraybuffer';\n            this._ws.onmessage = this._onWSMessage;\n            this._ws.onopen = this._onWSOpen;\n            this._ws.onclose = this._onWSClose;\n            this._ws.onerror = this._onWSClose;\n        };\n        // Make websocket callbacks arrow functions so they bind `this`.\n        /**\n         * Handle a websocket open event.\n         */\n        this._onWSOpen = (evt) => {\n            this._updateConnectionStatus('connected');\n        };\n        /**\n         * Handle a websocket message, validating and routing appropriately.\n         */\n        this._onWSMessage = (evt) => {\n            // Notify immediately if there is an error with the message.\n            let msg;\n            try {\n                msg = serialize.deserialize(evt.data);\n                validate.validateMessage(msg);\n            }\n            catch (error) {\n                error.message = `Kernel message validation error: ${error.message}`;\n                // We throw the error so that it bubbles up to the top, and displays the right stack.\n                throw error;\n            }\n            // Update the current kernel session id\n            this._kernelSession = msg.header.session;\n            // Handle the message asynchronously, in the order received.\n            this._msgChain = this._msgChain\n                .then(() => {\n                // Return so that any promises from handling a message are fulfilled\n                // before proceeding to the next message.\n                return this._handleMessage(msg);\n            })\n                .catch(error => {\n                // Log any errors in handling the message, thus resetting the _msgChain\n                // promise so we can process more messages.\n                // Ignore the \"Canceled\" errors that are thrown during kernel dispose.\n                if (error.message.startsWith('Canceled future for ')) {\n                    console.error(error);\n                }\n            });\n            // Emit the message receive signal\n            this._anyMessage.emit({ msg, direction: 'recv' });\n        };\n        /**\n         * Handle a websocket close event.\n         */\n        this._onWSClose = (evt) => {\n            if (!this.isDisposed) {\n                this._reconnect();\n            }\n        };\n        this._id = '';\n        this._name = '';\n        this._status = 'unknown';\n        this._connectionStatus = 'connecting';\n        this._kernelSession = '';\n        this._isDisposed = false;\n        /**\n         * Websocket to communicate with kernel.\n         */\n        this._ws = null;\n        this._username = '';\n        this._reconnectLimit = 7;\n        this._reconnectAttempt = 0;\n        this._reconnectTimeout = null;\n        this._futures = new Map();\n        this._comms = new Map();\n        this._targetRegistry = Object.create(null);\n        this._info = new coreutils_2.PromiseDelegate();\n        this._pendingMessages = [];\n        this._statusChanged = new signaling_1.Signal(this);\n        this._connectionStatusChanged = new signaling_1.Signal(this);\n        this._disposed = new signaling_1.Signal(this);\n        this._iopubMessage = new signaling_1.Signal(this);\n        this._anyMessage = new signaling_1.Signal(this);\n        this._unhandledMessage = new signaling_1.Signal(this);\n        this._displayIdToParentIds = new Map();\n        this._msgIdToDisplayIds = new Map();\n        this._msgChain = Promise.resolve();\n        this._noOp = () => {\n            /* no-op */\n        };\n        this._name = options.model.name;\n        this._id = options.model.id;\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();\n        this._clientId = (_b = options.clientId) !== null && _b !== void 0 ? _b : coreutils_2.UUID.uuid4();\n        this._username = (_c = options.username) !== null && _c !== void 0 ? _c : '';\n        this.handleComms = (_d = options.handleComms) !== null && _d !== void 0 ? _d : true;\n        this._createSocket();\n    }\n    get disposed() {\n        return this._disposed;\n    }\n    /**\n     * A signal emitted when the kernel status changes.\n     */\n    get statusChanged() {\n        return this._statusChanged;\n    }\n    /**\n     * A signal emitted when the kernel status changes.\n     */\n    get connectionStatusChanged() {\n        return this._connectionStatusChanged;\n    }\n    /**\n     * A signal emitted for iopub kernel messages.\n     *\n     * #### Notes\n     * This signal is emitted after the iopub message is handled asynchronously.\n     */\n    get iopubMessage() {\n        return this._iopubMessage;\n    }\n    /**\n     * A signal emitted for unhandled kernel message.\n     *\n     * #### Notes\n     * This signal is emitted for a message that was not handled. It is emitted\n     * during the asynchronous message handling code.\n     */\n    get unhandledMessage() {\n        return this._unhandledMessage;\n    }\n    /**\n     * The kernel model\n     */\n    get model() {\n        return {\n            id: this.id,\n            name: this.name\n        };\n    }\n    /**\n     * A signal emitted for any kernel message.\n     *\n     * #### Notes\n     * This signal is emitted when a message is received, before it is handled\n     * asynchronously.\n     *\n     * This message is emitted when a message is queued for sending (either in\n     * the websocket buffer, or our own pending message buffer). The message may\n     * actually be sent across the wire at a later time.\n     *\n     * The message emitted in this signal should not be modified in any way.\n     */\n    get anyMessage() {\n        return this._anyMessage;\n    }\n    /**\n     * The id of the server-side kernel.\n     */\n    get id() {\n        return this._id;\n    }\n    /**\n     * The name of the server-side kernel.\n     */\n    get name() {\n        return this._name;\n    }\n    /**\n     * The client username.\n     */\n    get username() {\n        return this._username;\n    }\n    /**\n     * The client unique id.\n     */\n    get clientId() {\n        return this._clientId;\n    }\n    /**\n     * The current status of the kernel.\n     */\n    get status() {\n        return this._status;\n    }\n    /**\n     * The current connection status of the kernel connection.\n     */\n    get connectionStatus() {\n        return this._connectionStatus;\n    }\n    /**\n     * Test whether the kernel has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * The cached kernel info.\n     *\n     * @returns A promise that resolves to the kernel info.\n     */\n    get info() {\n        return this._info.promise;\n    }\n    /**\n     * The kernel spec.\n     *\n     * @returns A promise that resolves to the kernel spec.\n     */\n    get spec() {\n        if (this._specPromise) {\n            return this._specPromise;\n        }\n        this._specPromise = kernelspec_1.KernelSpecAPI.getSpecs(this.serverSettings).then(specs => {\n            return specs.kernelspecs[this._name];\n        });\n        return this._specPromise;\n    }\n    /**\n     * Clone the current kernel with a new clientId.\n     */\n    clone(options = {}) {\n        return new KernelConnection(Object.assign({ model: this.model, username: this.username, serverSettings: this.serverSettings, \n            // handleComms defaults to false since that is safer\n            handleComms: false }, options));\n    }\n    /**\n     * Dispose of the resources held by the kernel.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        this._disposed.emit();\n        this._updateConnectionStatus('disconnected');\n        this._clearKernelState();\n        this._pendingMessages = [];\n        this._clearSocket();\n        // Clear Lumino signals\n        signaling_1.Signal.clearData(this);\n    }\n    /**\n     * Send a shell message to the kernel.\n     *\n     * #### Notes\n     * Send a message to the kernel's shell channel, yielding a future object\n     * for accepting replies.\n     *\n     * If `expectReply` is given and `true`, the future is disposed when both a\n     * shell reply and an idle status message are received. If `expectReply`\n     * is not given or is `false`, the future is resolved when an idle status\n     * message is received.\n     * If `disposeOnDone` is not given or is `true`, the Future is disposed at this point.\n     * If `disposeOnDone` is given and `false`, it is up to the caller to dispose of the Future.\n     *\n     * All replies are validated as valid kernel messages.\n     *\n     * If the kernel status is `dead`, this will throw an error.\n     */\n    sendShellMessage(msg, expectReply = false, disposeOnDone = true) {\n        return this._sendKernelShellControl(future_1.KernelShellFutureHandler, msg, expectReply, disposeOnDone);\n    }\n    /**\n     * Send a control message to the kernel.\n     *\n     * #### Notes\n     * Send a message to the kernel's control channel, yielding a future object\n     * for accepting replies.\n     *\n     * If `expectReply` is given and `true`, the future is disposed when both a\n     * control reply and an idle status message are received. If `expectReply`\n     * is not given or is `false`, the future is resolved when an idle status\n     * message is received.\n     * If `disposeOnDone` is not given or is `true`, the Future is disposed at this point.\n     * If `disposeOnDone` is given and `false`, it is up to the caller to dispose of the Future.\n     *\n     * All replies are validated as valid kernel messages.\n     *\n     * If the kernel status is `dead`, this will throw an error.\n     */\n    sendControlMessage(msg, expectReply = false, disposeOnDone = true) {\n        return this._sendKernelShellControl(future_1.KernelControlFutureHandler, msg, expectReply, disposeOnDone);\n    }\n    _sendKernelShellControl(ctor, msg, expectReply = false, disposeOnDone = true) {\n        this._sendMessage(msg);\n        this._anyMessage.emit({ msg, direction: 'send' });\n        const future = new ctor(() => {\n            const msgId = msg.header.msg_id;\n            this._futures.delete(msgId);\n            // Remove stored display id information.\n            const displayIds = this._msgIdToDisplayIds.get(msgId);\n            if (!displayIds) {\n                return;\n            }\n            displayIds.forEach(displayId => {\n                const msgIds = this._displayIdToParentIds.get(displayId);\n                if (msgIds) {\n                    const idx = msgIds.indexOf(msgId);\n                    if (idx === -1) {\n                        return;\n                    }\n                    if (msgIds.length === 1) {\n                        this._displayIdToParentIds.delete(displayId);\n                    }\n                    else {\n                        msgIds.splice(idx, 1);\n                        this._displayIdToParentIds.set(displayId, msgIds);\n                    }\n                }\n            });\n            this._msgIdToDisplayIds.delete(msgId);\n        }, msg, expectReply, disposeOnDone, this);\n        this._futures.set(msg.header.msg_id, future);\n        return future;\n    }\n    /**\n     * Send a message on the websocket.\n     *\n     * If queue is true, queue the message for later sending if we cannot send\n     * now. Otherwise throw an error.\n     *\n     * #### Notes\n     * As an exception to the queueing, if we are sending a kernel_info_request\n     * message while we think the kernel is restarting, we send the message\n     * immediately without queueing. This is so that we can trigger a message\n     * back, which will then clear the kernel restarting state.\n     */\n    _sendMessage(msg, queue = true) {\n        if (this.status === 'dead') {\n            throw new Error('Kernel is dead');\n        }\n        // If we have a kernel_info_request and we are starting or restarting, send the\n        // kernel_info_request immediately if we can, and if not throw an error so\n        // we can retry later. On restarting we do this because we must get at least one message\n        // from the kernel to reset the kernel session (thus clearing the restart\n        // status sentinel).\n        if ((this._kernelSession === STARTING_KERNEL_SESSION ||\n            this._kernelSession === RESTARTING_KERNEL_SESSION) &&\n            KernelMessage.isInfoRequestMsg(msg)) {\n            if (this.connectionStatus === 'connected') {\n                this._ws.send(serialize.serialize(msg));\n                return;\n            }\n            else {\n                throw new Error('Could not send message: status is not connected');\n            }\n        }\n        // If there are pending messages, add to the queue so we keep messages in order\n        if (queue && this._pendingMessages.length > 0) {\n            this._pendingMessages.push(msg);\n            return;\n        }\n        // Send if the ws allows it, otherwise queue the message.\n        if (this.connectionStatus === 'connected' &&\n            this._kernelSession !== RESTARTING_KERNEL_SESSION) {\n            this._ws.send(serialize.serialize(msg));\n        }\n        else if (queue) {\n            this._pendingMessages.push(msg);\n        }\n        else {\n            throw new Error('Could not send message');\n        }\n    }\n    /**\n     * Interrupt a kernel.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels).\n     *\n     * The promise is fulfilled on a valid response and rejected otherwise.\n     *\n     * It is assumed that the API call does not mutate the kernel id or name.\n     *\n     * The promise will be rejected if the kernel status is `Dead` or if the\n     * request fails or the response is invalid.\n     */\n    async interrupt() {\n        if (this.status === 'dead') {\n            throw new Error('Kernel is dead');\n        }\n        return restapi.interruptKernel(this.id, this.serverSettings);\n    }\n    /**\n     * Request a kernel restart.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels)\n     * and validates the response model.\n     *\n     * Any existing Future or Comm objects are cleared once the kernel has\n     * actually be restarted.\n     *\n     * The promise is fulfilled on a valid server response (after the kernel restarts)\n     * and rejected otherwise.\n     *\n     * It is assumed that the API call does not mutate the kernel id or name.\n     *\n     * The promise will be rejected if the request fails or the response is\n     * invalid.\n     */\n    async restart() {\n        if (this.status === 'dead') {\n            throw new Error('Kernel is dead');\n        }\n        this._updateStatus('restarting');\n        this._clearKernelState();\n        this._kernelSession = RESTARTING_KERNEL_SESSION;\n        await restapi.restartKernel(this.id, this.serverSettings);\n        // Reconnect to the kernel to address cases where kernel ports\n        // have changed during the restart.\n        await this.reconnect();\n    }\n    /**\n     * Reconnect to a kernel.\n     *\n     * #### Notes\n     * This may try multiple times to reconnect to a kernel, and will sever any\n     * existing connection.\n     */\n    reconnect() {\n        this._errorIfDisposed();\n        const result = new coreutils_2.PromiseDelegate();\n        // Set up a listener for the connection status changing, which accepts or\n        // rejects after the retries are done.\n        const fulfill = (sender, status) => {\n            if (status === 'connected') {\n                result.resolve();\n                this.connectionStatusChanged.disconnect(fulfill, this);\n            }\n            else if (status === 'disconnected') {\n                result.reject(new Error('Kernel connection disconnected'));\n                this.connectionStatusChanged.disconnect(fulfill, this);\n            }\n        };\n        this.connectionStatusChanged.connect(fulfill, this);\n        // Reset the reconnect limit so we start the connection attempts fresh\n        this._reconnectAttempt = 0;\n        // Start the reconnection process, which will also clear any existing\n        // connection.\n        this._reconnect();\n        // Return the promise that should resolve on connection or reject if the\n        // retries don't work.\n        return result.promise;\n    }\n    /**\n     * Shutdown a kernel.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels).\n     *\n     * The promise is fulfilled on a valid response and rejected otherwise.\n     *\n     * On a valid response, disposes this kernel connection.\n     *\n     * If the kernel is already `dead`, disposes this kernel connection without\n     * a server request.\n     */\n    async shutdown() {\n        if (this.status !== 'dead') {\n            await restapi.shutdownKernel(this.id, this.serverSettings);\n        }\n        this.handleShutdown();\n    }\n    /**\n     * Handles a kernel shutdown.\n     *\n     * #### Notes\n     * This method should be called if we know from outside information that a\n     * kernel is dead (for example, we cannot find the kernel model on the\n     * server).\n     */\n    handleShutdown() {\n        this._updateStatus('dead');\n        this.dispose();\n    }\n    /**\n     * Send a `kernel_info_request` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#kernel-info).\n     *\n     * Fulfills with the `kernel_info_response` content when the shell reply is\n     * received and validated.\n     */\n    async requestKernelInfo() {\n        const msg = KernelMessage.createMessage({\n            msgType: 'kernel_info_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content: {}\n        });\n        let reply;\n        try {\n            reply = (await Private.handleShellMessage(this, msg));\n        }\n        catch (e) {\n            // If we rejected because the future was disposed, ignore and return.\n            if (this.isDisposed) {\n                return;\n            }\n            else {\n                throw e;\n            }\n        }\n        this._errorIfDisposed();\n        if (!reply) {\n            return;\n        }\n        // Kernels sometimes do not include a status field on kernel_info_reply\n        // messages, so set a default for now.\n        // See https://github.com/jupyterlab/jupyterlab/issues/6760\n        if (reply.content.status === undefined) {\n            reply.content.status = 'ok';\n        }\n        if (reply.content.status !== 'ok') {\n            this._info.reject('Kernel info reply errored');\n            return reply;\n        }\n        this._info.resolve(reply.content);\n        this._kernelSession = reply.header.session;\n        return reply;\n    }\n    /**\n     * Send a `complete_request` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#completion).\n     *\n     * Fulfills with the `complete_reply` content when the shell reply is\n     * received and validated.\n     */\n    requestComplete(content) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'complete_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content\n        });\n        return Private.handleShellMessage(this, msg);\n    }\n    /**\n     * Send an `inspect_request` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#introspection).\n     *\n     * Fulfills with the `inspect_reply` content when the shell reply is\n     * received and validated.\n     */\n    requestInspect(content) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'inspect_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content: content\n        });\n        return Private.handleShellMessage(this, msg);\n    }\n    /**\n     * Send a `history_request` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#history).\n     *\n     * Fulfills with the `history_reply` content when the shell reply is\n     * received and validated.\n     */\n    requestHistory(content) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'history_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content\n        });\n        return Private.handleShellMessage(this, msg);\n    }\n    /**\n     * Send an `execute_request` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#execute).\n     *\n     * Future `onReply` is called with the `execute_reply` content when the\n     * shell reply is received and validated. The future will resolve when\n     * this message is received and the `idle` iopub status is received.\n     * The future will also be disposed at this point unless `disposeOnDone`\n     * is specified and `false`, in which case it is up to the caller to dispose\n     * of the future.\n     *\n     * **See also:** [[IExecuteReply]]\n     */\n    requestExecute(content, disposeOnDone = true, metadata) {\n        const defaults = {\n            silent: false,\n            store_history: true,\n            user_expressions: {},\n            allow_stdin: true,\n            stop_on_error: false\n        };\n        const msg = KernelMessage.createMessage({\n            msgType: 'execute_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content: Object.assign(Object.assign({}, defaults), content),\n            metadata\n        });\n        return this.sendShellMessage(msg, true, disposeOnDone);\n    }\n    /**\n     * Send an experimental `debug_request` message.\n     *\n     * @hidden\n     *\n     * #### Notes\n     * Debug messages are experimental messages that are not in the official\n     * kernel message specification. As such, this function is *NOT* considered\n     * part of the public API, and may change without notice.\n     */\n    requestDebug(content, disposeOnDone = true) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'debug_request',\n            channel: 'control',\n            username: this._username,\n            session: this._clientId,\n            content\n        });\n        return this.sendControlMessage(msg, true, disposeOnDone);\n    }\n    /**\n     * Send an `is_complete_request` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#code-completeness).\n     *\n     * Fulfills with the `is_complete_response` content when the shell reply is\n     * received and validated.\n     */\n    requestIsComplete(content) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'is_complete_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content\n        });\n        return Private.handleShellMessage(this, msg);\n    }\n    /**\n     * Send a `comm_info_request` message.\n     *\n     * #### Notes\n     * Fulfills with the `comm_info_reply` content when the shell reply is\n     * received and validated.\n     */\n    requestCommInfo(content) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'comm_info_request',\n            channel: 'shell',\n            username: this._username,\n            session: this._clientId,\n            content\n        });\n        return Private.handleShellMessage(this, msg);\n    }\n    /**\n     * Send an `input_reply` message.\n     *\n     * #### Notes\n     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#messages-on-the-stdin-router-dealer-sockets).\n     */\n    sendInputReply(content) {\n        const msg = KernelMessage.createMessage({\n            msgType: 'input_reply',\n            channel: 'stdin',\n            username: this._username,\n            session: this._clientId,\n            content\n        });\n        this._sendMessage(msg);\n        this._anyMessage.emit({ msg, direction: 'send' });\n    }\n    /**\n     * Create a new comm.\n     *\n     * #### Notes\n     * If a client-side comm already exists with the given commId, an error is thrown.\n     * If the kernel does not handle comms, an error is thrown.\n     */\n    createComm(targetName, commId = coreutils_2.UUID.uuid4()) {\n        if (!this.handleComms) {\n            throw new Error('Comms are disabled on this kernel connection');\n        }\n        if (this._comms.has(commId)) {\n            throw new Error('Comm is already created');\n        }\n        const comm = new comm_1.CommHandler(targetName, commId, this, () => {\n            this._unregisterComm(commId);\n        });\n        this._comms.set(commId, comm);\n        return comm;\n    }\n    /**\n     * Check if a comm exists.\n     */\n    hasComm(commId) {\n        return this._comms.has(commId);\n    }\n    /**\n     * Register a comm target handler.\n     *\n     * @param targetName - The name of the comm target.\n     *\n     * @param callback - The callback invoked for a comm open message.\n     *\n     * @returns A disposable used to unregister the comm target.\n     *\n     * #### Notes\n     * Only one comm target can be registered to a target name at a time, an\n     * existing callback for the same target name will be overridden.  A registered\n     * comm target handler will take precedence over a comm which specifies a\n     * `target_module`.\n     *\n     * If the callback returns a promise, kernel message processing will pause\n     * until the returned promise is fulfilled.\n     */\n    registerCommTarget(targetName, callback) {\n        if (!this.handleComms) {\n            return;\n        }\n        this._targetRegistry[targetName] = callback;\n    }\n    /**\n     * Remove a comm target handler.\n     *\n     * @param targetName - The name of the comm target to remove.\n     *\n     * @param callback - The callback to remove.\n     *\n     * #### Notes\n     * The comm target is only removed if the callback argument matches.\n     */\n    removeCommTarget(targetName, callback) {\n        if (!this.handleComms) {\n            return;\n        }\n        if (!this.isDisposed && this._targetRegistry[targetName] === callback) {\n            delete this._targetRegistry[targetName];\n        }\n    }\n    /**\n     * Register an IOPub message hook.\n     *\n     * @param msg_id - The parent_header message id the hook will intercept.\n     *\n     * @param hook - The callback invoked for the message.\n     *\n     * #### Notes\n     * The IOPub hook system allows you to preempt the handlers for IOPub\n     * messages that are responses to a given message id.\n     *\n     * The most recently registered hook is run first. A hook can return a\n     * boolean or a promise to a boolean, in which case all kernel message\n     * processing pauses until the promise is fulfilled. If a hook return value\n     * resolves to false, any later hooks will not run and the function will\n     * return a promise resolving to false. If a hook throws an error, the error\n     * is logged to the console and the next hook is run. If a hook is\n     * registered during the hook processing, it will not run until the next\n     * message. If a hook is removed during the hook processing, it will be\n     * deactivated immediately.\n     *\n     * See also [[IFuture.registerMessageHook]].\n     */\n    registerMessageHook(msgId, hook) {\n        var _a;\n        const future = (_a = this._futures) === null || _a === void 0 ? void 0 : _a.get(msgId);\n        if (future) {\n            future.registerMessageHook(hook);\n        }\n    }\n    /**\n     * Remove an IOPub message hook.\n     *\n     * @param msg_id - The parent_header message id the hook intercepted.\n     *\n     * @param hook - The callback invoked for the message.\n     *\n     */\n    removeMessageHook(msgId, hook) {\n        var _a;\n        const future = (_a = this._futures) === null || _a === void 0 ? void 0 : _a.get(msgId);\n        if (future) {\n            future.removeMessageHook(hook);\n        }\n    }\n    /**\n     * Handle a message with a display id.\n     *\n     * @returns Whether the message was handled.\n     */\n    async _handleDisplayId(displayId, msg) {\n        var _a, _b;\n        const msgId = msg.parent_header.msg_id;\n        let parentIds = this._displayIdToParentIds.get(displayId);\n        if (parentIds) {\n            // We've seen it before, update existing outputs with same display_id\n            // by handling display_data as update_display_data.\n            const updateMsg = {\n                header: coreutils_2.JSONExt.deepCopy(msg.header),\n                parent_header: coreutils_2.JSONExt.deepCopy(msg.parent_header),\n                metadata: coreutils_2.JSONExt.deepCopy(msg.metadata),\n                content: coreutils_2.JSONExt.deepCopy(msg.content),\n                channel: msg.channel,\n                buffers: msg.buffers ? msg.buffers.slice() : []\n            };\n            updateMsg.header.msg_type = 'update_display_data';\n            await Promise.all(parentIds.map(async (parentId) => {\n                const future = this._futures && this._futures.get(parentId);\n                if (future) {\n                    await future.handleMsg(updateMsg);\n                }\n            }));\n        }\n        // We're done here if it's update_display.\n        if (msg.header.msg_type === 'update_display_data') {\n            // It's an update, don't proceed to the normal display.\n            return true;\n        }\n        // Regular display_data with id, record it for future updating\n        // in _displayIdToParentIds for future lookup.\n        parentIds = (_a = this._displayIdToParentIds.get(displayId)) !== null && _a !== void 0 ? _a : [];\n        if (parentIds.indexOf(msgId) === -1) {\n            parentIds.push(msgId);\n        }\n        this._displayIdToParentIds.set(displayId, parentIds);\n        // Add to our map of display ids for this message.\n        const displayIds = (_b = this._msgIdToDisplayIds.get(msgId)) !== null && _b !== void 0 ? _b : [];\n        if (displayIds.indexOf(msgId) === -1) {\n            displayIds.push(msgId);\n        }\n        this._msgIdToDisplayIds.set(msgId, displayIds);\n        // Let the message propagate to the intended recipient.\n        return false;\n    }\n    /**\n     * Forcefully clear the socket state.\n     *\n     * #### Notes\n     * This will clear all socket state without calling any handlers and will\n     * not update the connection status. If you call this method, you are\n     * responsible for updating the connection status as needed and recreating\n     * the socket if you plan to reconnect.\n     */\n    _clearSocket() {\n        if (this._ws !== null) {\n            // Clear the websocket event handlers and the socket itself.\n            this._ws.onopen = this._noOp;\n            this._ws.onclose = this._noOp;\n            this._ws.onerror = this._noOp;\n            this._ws.onmessage = this._noOp;\n            this._ws.close();\n            this._ws = null;\n        }\n    }\n    /**\n     * Handle status iopub messages from the kernel.\n     */\n    _updateStatus(status) {\n        if (this._status === status || this._status === 'dead') {\n            return;\n        }\n        this._status = status;\n        Private.logKernelStatus(this);\n        this._statusChanged.emit(status);\n        if (status === 'dead') {\n            this.dispose();\n        }\n    }\n    /**\n     * Send pending messages to the kernel.\n     */\n    _sendPending() {\n        // We check to make sure we are still connected each time. For\n        // example, if a websocket buffer overflows, it may close, so we should\n        // stop sending messages.\n        while (this.connectionStatus === 'connected' &&\n            this._kernelSession !== RESTARTING_KERNEL_SESSION &&\n            this._pendingMessages.length > 0) {\n            this._sendMessage(this._pendingMessages[0], false);\n            // We shift the message off the queue after the message is sent so that\n            // if there is an exception, the message is still pending.\n            this._pendingMessages.shift();\n        }\n    }\n    /**\n     * Clear the internal state.\n     */\n    _clearKernelState() {\n        this._kernelSession = '';\n        this._pendingMessages = [];\n        this._futures.forEach(future => {\n            future.dispose();\n        });\n        this._comms.forEach(comm => {\n            comm.dispose();\n        });\n        this._msgChain = Promise.resolve();\n        this._futures = new Map();\n        this._comms = new Map();\n        this._displayIdToParentIds.clear();\n        this._msgIdToDisplayIds.clear();\n    }\n    /**\n     * Check to make sure it is okay to proceed to handle a message.\n     *\n     * #### Notes\n     * Because we handle messages asynchronously, before a message is handled the\n     * kernel might be disposed or restarted (and have a different session id).\n     * This function throws an error in each of these cases. This is meant to be\n     * called at the start of an asynchronous message handler to cancel message\n     * processing if the message no longer is valid.\n     */\n    _assertCurrentMessage(msg) {\n        this._errorIfDisposed();\n        if (msg.header.session !== this._kernelSession) {\n            throw new Error(`Canceling handling of old message: ${msg.header.msg_type}`);\n        }\n    }\n    /**\n     * Handle a `comm_open` kernel message.\n     */\n    async _handleCommOpen(msg) {\n        this._assertCurrentMessage(msg);\n        const content = msg.content;\n        const comm = new comm_1.CommHandler(content.target_name, content.comm_id, this, () => {\n            this._unregisterComm(content.comm_id);\n        });\n        this._comms.set(content.comm_id, comm);\n        try {\n            const target = await Private.loadObject(content.target_name, content.target_module, this._targetRegistry);\n            await target(comm, msg);\n        }\n        catch (e) {\n            // Close the comm asynchronously. We cannot block message processing on\n            // kernel messages to wait for another kernel message.\n            comm.close();\n            console.error('Exception opening new comm');\n            throw e;\n        }\n    }\n    /**\n     * Handle 'comm_close' kernel message.\n     */\n    async _handleCommClose(msg) {\n        this._assertCurrentMessage(msg);\n        const content = msg.content;\n        const comm = this._comms.get(content.comm_id);\n        if (!comm) {\n            console.error('Comm not found for comm id ' + content.comm_id);\n            return;\n        }\n        this._unregisterComm(comm.commId);\n        const onClose = comm.onClose;\n        if (onClose) {\n            // tslint:disable-next-line:await-promise\n            await onClose(msg);\n        }\n        comm.dispose();\n    }\n    /**\n     * Handle a 'comm_msg' kernel message.\n     */\n    async _handleCommMsg(msg) {\n        this._assertCurrentMessage(msg);\n        const content = msg.content;\n        const comm = this._comms.get(content.comm_id);\n        if (!comm) {\n            return;\n        }\n        const onMsg = comm.onMsg;\n        if (onMsg) {\n            // tslint:disable-next-line:await-promise\n            await onMsg(msg);\n        }\n    }\n    /**\n     * Unregister a comm instance.\n     */\n    _unregisterComm(commId) {\n        this._comms.delete(commId);\n    }\n    /**\n     * Handle connection status changes.\n     */\n    _updateConnectionStatus(connectionStatus) {\n        if (this._connectionStatus === connectionStatus) {\n            return;\n        }\n        this._connectionStatus = connectionStatus;\n        // If we are not 'connecting', reset any reconnection attempts.\n        if (connectionStatus !== 'connecting') {\n            this._reconnectAttempt = 0;\n            clearTimeout(this._reconnectTimeout);\n        }\n        if (this.status !== 'dead') {\n            if (connectionStatus === 'connected') {\n                let restarting = this._kernelSession === RESTARTING_KERNEL_SESSION;\n                // Send a kernel info request to make sure we send at least one\n                // message to get kernel status back. Always request kernel info\n                // first, to get kernel status back and ensure iopub is fully\n                // established. If we are restarting, this message will skip the queue\n                // and be sent immediately.\n                let p = this.requestKernelInfo();\n                // Send any pending messages after the kernelInfo resolves, or after a\n                // timeout as a failsafe.\n                let sendPendingCalled = false;\n                let sendPendingOnce = () => {\n                    if (sendPendingCalled) {\n                        return;\n                    }\n                    sendPendingCalled = true;\n                    if (restarting && this._kernelSession === RESTARTING_KERNEL_SESSION) {\n                        // We were restarting and a message didn't arrive to set the\n                        // session, but we just assume the restart succeeded and send any\n                        // pending messages.\n                        // FIXME: it would be better to retry the kernel_info_request here\n                        this._kernelSession = '';\n                    }\n                    clearTimeout(timeoutHandle);\n                    if (this._pendingMessages.length > 0) {\n                        this._sendPending();\n                    }\n                };\n                void p.then(sendPendingOnce);\n                // FIXME: if sent while zmq subscriptions are not established,\n                // kernelInfo may not resolve, so use a timeout to ensure we don't hang forever.\n                // It may be preferable to retry kernelInfo rather than give up after one timeout.\n                let timeoutHandle = setTimeout(sendPendingOnce, KERNEL_INFO_TIMEOUT);\n            }\n            else {\n                // If the connection is down, then we do not know what is happening\n                // with the kernel, so set the status to unknown.\n                this._updateStatus('unknown');\n            }\n        }\n        // Notify others that the connection status changed.\n        this._connectionStatusChanged.emit(connectionStatus);\n    }\n    async _handleMessage(msg) {\n        var _a, _b;\n        let handled = false;\n        // Check to see if we have a display_id we need to reroute.\n        if (msg.parent_header &&\n            msg.channel === 'iopub' &&\n            (KernelMessage.isDisplayDataMsg(msg) ||\n                KernelMessage.isUpdateDisplayDataMsg(msg) ||\n                KernelMessage.isExecuteResultMsg(msg))) {\n            // display_data messages may re-route based on their display_id.\n            const transient = ((_a = msg.content.transient) !== null && _a !== void 0 ? _a : {});\n            const displayId = transient['display_id'];\n            if (displayId) {\n                handled = await this._handleDisplayId(displayId, msg);\n                // The await above may make this message out of date, so check again.\n                this._assertCurrentMessage(msg);\n            }\n        }\n        if (!handled && msg.parent_header) {\n            const parentHeader = msg.parent_header;\n            const future = (_b = this._futures) === null || _b === void 0 ? void 0 : _b.get(parentHeader.msg_id);\n            if (future) {\n                await future.handleMsg(msg);\n                this._assertCurrentMessage(msg);\n            }\n            else {\n                // If the message was sent by us and was not iopub, it is orphaned.\n                const owned = parentHeader.session === this.clientId;\n                if (msg.channel !== 'iopub' && owned) {\n                    this._unhandledMessage.emit(msg);\n                }\n            }\n        }\n        if (msg.channel === 'iopub') {\n            switch (msg.header.msg_type) {\n                case 'status': {\n                    // Updating the status is synchronous, and we call no async user code\n                    const executionState = msg.content\n                        .execution_state;\n                    if (executionState === 'restarting') {\n                        // The kernel has been auto-restarted by the server. After\n                        // processing for this message is completely done, we want to\n                        // handle this restart, so we don't await, but instead schedule\n                        // the work as a microtask (i.e., in a promise resolution). We\n                        // schedule this here so that it comes before any microtasks that\n                        // might be scheduled in the status signal emission below.\n                        void Promise.resolve().then(async () => {\n                            this._updateStatus('autorestarting');\n                            this._clearKernelState();\n                            // We must reconnect since the kernel connection information may have\n                            // changed, and the server only refreshes its zmq connection when a new\n                            // websocket is opened.\n                            await this.reconnect();\n                        });\n                    }\n                    this._updateStatus(executionState);\n                    break;\n                }\n                case 'comm_open':\n                    if (this.handleComms) {\n                        await this._handleCommOpen(msg);\n                    }\n                    break;\n                case 'comm_msg':\n                    if (this.handleComms) {\n                        await this._handleCommMsg(msg);\n                    }\n                    break;\n                case 'comm_close':\n                    if (this.handleComms) {\n                        await this._handleCommClose(msg);\n                    }\n                    break;\n                default:\n                    break;\n            }\n            // If the message was a status dead message, we might have disposed ourselves.\n            if (!this.isDisposed) {\n                this._assertCurrentMessage(msg);\n                // the message wouldn't be emitted if we were disposed anyway.\n                this._iopubMessage.emit(msg);\n            }\n        }\n    }\n    /**\n     * Attempt a connection if we have not exhausted connection attempts.\n     */\n    _reconnect() {\n        this._errorIfDisposed();\n        // Clear any existing reconnection attempt\n        clearTimeout(this._reconnectTimeout);\n        // Update the connection status and schedule a possible reconnection.\n        if (this._reconnectAttempt < this._reconnectLimit) {\n            this._updateConnectionStatus('connecting');\n            // The first reconnect attempt should happen immediately, and subsequent\n            // attempts should pick a random number in a growing range so that we\n            // don't overload the server with synchronized reconnection attempts\n            // across multiple kernels.\n            const timeout = Private.getRandomIntInclusive(0, 1e3 * (Math.pow(2, this._reconnectAttempt) - 1));\n            console.warn(`Connection lost, reconnecting in ${Math.floor(timeout / 1000)} seconds.`);\n            this._reconnectTimeout = setTimeout(this._createSocket, timeout);\n            this._reconnectAttempt += 1;\n        }\n        else {\n            this._updateConnectionStatus('disconnected');\n        }\n        // Clear the websocket event handlers and the socket itself.\n        this._clearSocket();\n    }\n    /**\n     * Utility function to throw an error if this instance is disposed.\n     */\n    _errorIfDisposed() {\n        if (this.isDisposed) {\n            throw new Error('Kernel connection is disposed');\n        }\n    }\n}\nexports.KernelConnection = KernelConnection;\n/**\n * A private namespace for the Kernel.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Log the current kernel status.\n     */\n    function logKernelStatus(kernel) {\n        switch (kernel.status) {\n            case 'idle':\n            case 'busy':\n            case 'unknown':\n                return;\n            default:\n                console.debug(`Kernel: ${kernel.status} (${kernel.id})`);\n                break;\n        }\n    }\n    Private.logKernelStatus = logKernelStatus;\n    /**\n     * Send a kernel message to the kernel and resolve the reply message.\n     */\n    async function handleShellMessage(kernel, msg) {\n        const future = kernel.sendShellMessage(msg, true);\n        return future.done;\n    }\n    Private.handleShellMessage = handleShellMessage;\n    /**\n     * Try to load an object from a module or a registry.\n     *\n     * Try to load an object from a module asynchronously if a module\n     * is specified, otherwise tries to load an object from the global\n     * registry, if the global registry is provided.\n     *\n     * #### Notes\n     * Loading a module uses requirejs.\n     */\n    function loadObject(name, moduleName, registry) {\n        return new Promise((resolve, reject) => {\n            // Try loading the module using require.js\n            if (moduleName) {\n                if (typeof requirejs === 'undefined') {\n                    throw new Error('requirejs not found');\n                }\n                requirejs([moduleName], (mod) => {\n                    if (mod[name] === void 0) {\n                        const msg = `Object '${name}' not found in module '${moduleName}'`;\n                        reject(new Error(msg));\n                    }\n                    else {\n                        resolve(mod[name]);\n                    }\n                }, reject);\n            }\n            else {\n                if (registry === null || registry === void 0 ? void 0 : registry[name]) {\n                    resolve(registry[name]);\n                }\n                else {\n                    reject(new Error(`Object '${name}' not found in registry`));\n                }\n            }\n        });\n    }\n    Private.loadObject = loadObject;\n    /**\n     * Get a random integer between min and max, inclusive of both.\n     *\n     * #### Notes\n     * From\n     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive\n     *\n     * From the MDN page: It might be tempting to use Math.round() to accomplish\n     * that, but doing so would cause your random numbers to follow a non-uniform\n     * distribution, which may not be acceptable for your needs.\n     */\n    function getRandomIntInclusive(min, max) {\n        min = Math.ceil(min);\n        max = Math.floor(max);\n        return Math.floor(Math.random() * (max - min + 1)) + min;\n    }\n    Private.getRandomIntInclusive = getRandomIntInclusive;\n})(Private || (Private = {}));\n//# sourceMappingURL=default.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/default.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/future.js":
/*!*****************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/future.js ***!
  \*****************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.KernelShellFutureHandler = exports.KernelControlFutureHandler = exports.KernelFutureHandler = void 0;\nconst coreutils_1 = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\nconst disposable_1 = __webpack_require__(/*! @lumino/disposable */ \"webpack/sharing/consume/default/@lumino/disposable/@lumino/disposable\");\nconst KernelMessage = __importStar(__webpack_require__(/*! ./messages */ \"../node_modules/@jupyterlab/services/lib/kernel/messages.js\"));\n/**\n * Implementation of a kernel future.\n *\n * If a reply is expected, the Future is considered done when both a `reply`\n * message and an `idle` iopub status message have been received.  Otherwise, it\n * is considered done when the `idle` status is received.\n *\n */\nclass KernelFutureHandler extends disposable_1.DisposableDelegate {\n    /**\n     * Construct a new KernelFutureHandler.\n     */\n    constructor(cb, msg, expectReply, disposeOnDone, kernel) {\n        super(cb);\n        this._status = 0;\n        this._stdin = Private.noOp;\n        this._iopub = Private.noOp;\n        this._reply = Private.noOp;\n        this._done = new coreutils_1.PromiseDelegate();\n        this._hooks = new Private.HookList();\n        this._disposeOnDone = true;\n        this._msg = msg;\n        if (!expectReply) {\n            this._setFlag(Private.KernelFutureFlag.GotReply);\n        }\n        this._disposeOnDone = disposeOnDone;\n        this._kernel = kernel;\n    }\n    /**\n     * Get the original outgoing message.\n     */\n    get msg() {\n        return this._msg;\n    }\n    /**\n     * A promise that resolves when the future is done.\n     */\n    get done() {\n        return this._done.promise;\n    }\n    /**\n     * Get the reply handler.\n     */\n    get onReply() {\n        return this._reply;\n    }\n    /**\n     * Set the reply handler.\n     */\n    set onReply(cb) {\n        this._reply = cb;\n    }\n    /**\n     * Get the iopub handler.\n     */\n    get onIOPub() {\n        return this._iopub;\n    }\n    /**\n     * Set the iopub handler.\n     */\n    set onIOPub(cb) {\n        this._iopub = cb;\n    }\n    /**\n     * Get the stdin handler.\n     */\n    get onStdin() {\n        return this._stdin;\n    }\n    /**\n     * Set the stdin handler.\n     */\n    set onStdin(cb) {\n        this._stdin = cb;\n    }\n    /**\n     * Register hook for IOPub messages.\n     *\n     * @param hook - The callback invoked for an IOPub message.\n     *\n     * #### Notes\n     * The IOPub hook system allows you to preempt the handlers for IOPub\n     * messages handled by the future.\n     *\n     * The most recently registered hook is run first. A hook can return a\n     * boolean or a promise to a boolean, in which case all kernel message\n     * processing pauses until the promise is fulfilled. If a hook return value\n     * resolves to false, any later hooks will not run and the function will\n     * return a promise resolving to false. If a hook throws an error, the error\n     * is logged to the console and the next hook is run. If a hook is\n     * registered during the hook processing, it will not run until the next\n     * message. If a hook is removed during the hook processing, it will be\n     * deactivated immediately.\n     */\n    registerMessageHook(hook) {\n        if (this.isDisposed) {\n            throw new Error('Kernel future is disposed');\n        }\n        this._hooks.add(hook);\n    }\n    /**\n     * Remove a hook for IOPub messages.\n     *\n     * @param hook - The hook to remove.\n     *\n     * #### Notes\n     * If a hook is removed during the hook processing, it will be deactivated immediately.\n     */\n    removeMessageHook(hook) {\n        if (this.isDisposed) {\n            return;\n        }\n        this._hooks.remove(hook);\n    }\n    /**\n     * Send an `input_reply` message.\n     */\n    sendInputReply(content) {\n        this._kernel.sendInputReply(content);\n    }\n    /**\n     * Dispose and unregister the future.\n     */\n    dispose() {\n        this._stdin = Private.noOp;\n        this._iopub = Private.noOp;\n        this._reply = Private.noOp;\n        this._hooks = null;\n        if (!this._testFlag(Private.KernelFutureFlag.IsDone)) {\n            // TODO: Uncomment the following logging code, and check for any tests that trigger it.\n            // let status = [];\n            // if (!this._testFlag(Private.KernelFutureFlag.GotIdle)) {\n            //   status.push('idle');\n            // }\n            // if (!this._testFlag(Private.KernelFutureFlag.GotReply)) {\n            //   status.push('reply');\n            // }\n            // console.warn(\n            //   `*************** DISPOSED BEFORE DONE: K${this._kernel.id.slice(\n            //     0,\n            //     6\n            //   )} M${this._msg.header.msg_id.slice(0, 6)} missing ${status.join(' ')}`\n            // );\n            // Reject the `done` promise, but catch its error here in case no one else\n            // is waiting for the promise to resolve. This prevents the error from\n            // being displayed in the console, but does not prevent it from being\n            // caught by a client who is waiting for it.\n            this._done.promise.catch(() => {\n                /* no-op */\n            });\n            this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`));\n        }\n        super.dispose();\n    }\n    /**\n     * Handle an incoming kernel message.\n     */\n    async handleMsg(msg) {\n        switch (msg.channel) {\n            case 'control':\n            case 'shell':\n                if (msg.channel === this.msg.channel &&\n                    msg.parent_header.msg_id === this.msg.header.msg_id) {\n                    await this._handleReply(msg);\n                }\n                break;\n            case 'stdin':\n                await this._handleStdin(msg);\n                break;\n            case 'iopub':\n                await this._handleIOPub(msg);\n                break;\n            default:\n                break;\n        }\n    }\n    async _handleReply(msg) {\n        const reply = this._reply;\n        if (reply) {\n            // tslint:disable-next-line:await-promise\n            await reply(msg);\n        }\n        this._replyMsg = msg;\n        this._setFlag(Private.KernelFutureFlag.GotReply);\n        if (this._testFlag(Private.KernelFutureFlag.GotIdle)) {\n            this._handleDone();\n        }\n    }\n    async _handleStdin(msg) {\n        const stdin = this._stdin;\n        if (stdin) {\n            // tslint:disable-next-line:await-promise\n            await stdin(msg);\n        }\n    }\n    async _handleIOPub(msg) {\n        const process = await this._hooks.process(msg);\n        const iopub = this._iopub;\n        if (process && iopub) {\n            // tslint:disable-next-line:await-promise\n            await iopub(msg);\n        }\n        if (KernelMessage.isStatusMsg(msg) &&\n            msg.content.execution_state === 'idle') {\n            this._setFlag(Private.KernelFutureFlag.GotIdle);\n            if (this._testFlag(Private.KernelFutureFlag.GotReply)) {\n                this._handleDone();\n            }\n        }\n    }\n    _handleDone() {\n        if (this._testFlag(Private.KernelFutureFlag.IsDone)) {\n            return;\n        }\n        this._setFlag(Private.KernelFutureFlag.IsDone);\n        this._done.resolve(this._replyMsg);\n        if (this._disposeOnDone) {\n            this.dispose();\n        }\n    }\n    /**\n     * Test whether the given future flag is set.\n     */\n    _testFlag(flag) {\n        // tslint:disable-next-line\n        return (this._status & flag) !== 0;\n    }\n    /**\n     * Set the given future flag.\n     */\n    _setFlag(flag) {\n        // tslint:disable-next-line\n        this._status |= flag;\n    }\n}\nexports.KernelFutureHandler = KernelFutureHandler;\nclass KernelControlFutureHandler extends KernelFutureHandler {\n}\nexports.KernelControlFutureHandler = KernelControlFutureHandler;\nclass KernelShellFutureHandler extends KernelFutureHandler {\n}\nexports.KernelShellFutureHandler = KernelShellFutureHandler;\nvar Private;\n(function (Private) {\n    /**\n     * A no-op function.\n     */\n    Private.noOp = () => {\n        /* no-op */\n    };\n    /**\n     * Defer a computation.\n     *\n     * #### NOTES\n     * We can't just use requestAnimationFrame since it is not available in node.\n     * This implementation is from Phosphor:\n     * https://github.com/phosphorjs/phosphor/blob/e88e4321289bb1198f3098e7bda40736501f2ed8/tests/test-messaging/src/index.spec.ts#L63\n     */\n    const defer = (() => {\n        const ok = typeof requestAnimationFrame === 'function';\n        return ok ? requestAnimationFrame : setImmediate;\n    })();\n    class HookList {\n        constructor() {\n            this._hooks = [];\n        }\n        /**\n         * Register a hook.\n         *\n         * @param hook - The callback to register.\n         */\n        add(hook) {\n            this.remove(hook);\n            this._hooks.push(hook);\n        }\n        /**\n         * Remove a hook, if it exists in the hook list.\n         *\n         * @param hook - The callback to remove.\n         */\n        remove(hook) {\n            const index = this._hooks.indexOf(hook);\n            if (index >= 0) {\n                this._hooks[index] = null;\n                this._scheduleCompact();\n            }\n        }\n        /**\n         * Process a message through the hooks.\n         *\n         * @returns a promise resolving to false if any hook resolved as false,\n         * otherwise true\n         *\n         * #### Notes\n         * The most recently registered hook is run first. A hook can return a\n         * boolean or a promise to a boolean, in which case processing pauses until\n         * the promise is fulfilled. If a hook return value resolves to false, any\n         * later hooks will not run and the function will return a promise resolving\n         * to false. If a hook throws an error, the error is logged to the console\n         * and the next hook is run. If a hook is registered during the hook\n         * processing, it will not run until the next message. If a hook is removed\n         * during the hook processing, it will be deactivated immediately.\n         */\n        async process(msg) {\n            // Wait until we can start a new process run.\n            await this._processing;\n            // Start the next process run.\n            const processing = new coreutils_1.PromiseDelegate();\n            this._processing = processing.promise;\n            let continueHandling;\n            // Call the end hook (most recently-added) first. Starting at the end also\n            // guarantees that hooks added during the processing will not be run in\n            // this process run.\n            for (let i = this._hooks.length - 1; i >= 0; i--) {\n                const hook = this._hooks[i];\n                // If the hook has been removed, continue to the next one.\n                if (hook === null) {\n                    continue;\n                }\n                // Execute the hook and log any errors.\n                try {\n                    // tslint:disable-next-line:await-promise\n                    continueHandling = await hook(msg);\n                }\n                catch (err) {\n                    continueHandling = true;\n                    console.error(err);\n                }\n                // If the hook resolved to false, stop processing and return.\n                if (continueHandling === false) {\n                    processing.resolve(undefined);\n                    return false;\n                }\n            }\n            // All hooks returned true (or errored out), so return true.\n            processing.resolve(undefined);\n            return true;\n        }\n        /**\n         * Schedule a cleanup of the list, removing any hooks that have been nulled out.\n         */\n        _scheduleCompact() {\n            if (!this._compactScheduled) {\n                this._compactScheduled = true;\n                // Schedule a compaction in between processing runs. We do the\n                // scheduling in an animation frame to rate-limit our compactions. If we\n                // need to compact more frequently, we can change this to directly\n                // schedule the compaction.\n                defer(() => {\n                    this._processing = this._processing.then(() => {\n                        this._compactScheduled = false;\n                        this._compact();\n                    });\n                });\n            }\n        }\n        /**\n         * Compact the list, removing any nulls.\n         */\n        _compact() {\n            let numNulls = 0;\n            for (let i = 0, len = this._hooks.length; i < len; i++) {\n                const hook = this._hooks[i];\n                if (this._hooks[i] === null) {\n                    numNulls++;\n                }\n                else {\n                    this._hooks[i - numNulls] = hook;\n                }\n            }\n            this._hooks.length -= numNulls;\n        }\n    }\n    Private.HookList = HookList;\n    /**\n     * Bit flags for the kernel future state.\n     */\n    let KernelFutureFlag;\n    (function (KernelFutureFlag) {\n        KernelFutureFlag[KernelFutureFlag[\"GotReply\"] = 1] = \"GotReply\";\n        KernelFutureFlag[KernelFutureFlag[\"GotIdle\"] = 2] = \"GotIdle\";\n        KernelFutureFlag[KernelFutureFlag[\"IsDone\"] = 4] = \"IsDone\";\n        KernelFutureFlag[KernelFutureFlag[\"DisposeOnDone\"] = 8] = \"DisposeOnDone\";\n    })(KernelFutureFlag = Private.KernelFutureFlag || (Private.KernelFutureFlag = {}));\n})(Private || (Private = {}));\n//# sourceMappingURL=future.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/future.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/index.js":
/*!****************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/index.js ***!
  \****************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.KernelAPI = exports.KernelMessage = exports.Kernel = void 0;\n// Namespace some of our modules for convenience and backwards compatibility.\nconst Kernel = __importStar(__webpack_require__(/*! ./kernel */ \"../node_modules/@jupyterlab/services/lib/kernel/kernel.js\"));\nexports.Kernel = Kernel;\nconst KernelMessage = __importStar(__webpack_require__(/*! ./messages */ \"../node_modules/@jupyterlab/services/lib/kernel/messages.js\"));\nexports.KernelMessage = KernelMessage;\nconst KernelAPI = __importStar(__webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/kernel/restapi.js\"));\nexports.KernelAPI = KernelAPI;\n__exportStar(__webpack_require__(/*! ./manager */ \"../node_modules/@jupyterlab/services/lib/kernel/manager.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/kernel.js":
/*!*****************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/kernel.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=kernel.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/kernel.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/manager.js":
/*!******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/manager.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.KernelManager = void 0;\nconst algorithm_1 = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\nconst polling_1 = __webpack_require__(/*! @lumino/polling */ \"webpack/sharing/consume/default/@lumino/polling/@lumino/polling\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\nconst basemanager_1 = __webpack_require__(/*! ../basemanager */ \"../node_modules/@jupyterlab/services/lib/basemanager.js\");\nconst restapi_1 = __webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/kernel/restapi.js\");\nconst default_1 = __webpack_require__(/*! ./default */ \"../node_modules/@jupyterlab/services/lib/kernel/default.js\");\n/**\n * An implementation of a kernel manager.\n */\nclass KernelManager extends basemanager_1.BaseManager {\n    /**\n     * Construct a new kernel manager.\n     *\n     * @param options - The default options for kernel.\n     */\n    constructor(options = {}) {\n        var _a;\n        super(options);\n        this._isReady = false;\n        this._kernelConnections = new Set();\n        this._models = new Map();\n        this._runningChanged = new signaling_1.Signal(this);\n        this._connectionFailure = new signaling_1.Signal(this);\n        // Start model and specs polling with exponential backoff.\n        this._pollModels = new polling_1.Poll({\n            auto: false,\n            factory: () => this.requestRunning(),\n            frequency: {\n                interval: 10 * 1000,\n                backoff: true,\n                max: 300 * 1000\n            },\n            name: `@jupyterlab/services:KernelManager#models`,\n            standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n        });\n        // Initialize internal data.\n        this._ready = (async () => {\n            await this._pollModels.start();\n            await this._pollModels.tick;\n            this._isReady = true;\n        })();\n    }\n    /**\n     * Test whether the manager is ready.\n     */\n    get isReady() {\n        return this._isReady;\n    }\n    /**\n     * A promise that fulfills when the manager is ready.\n     */\n    get ready() {\n        return this._ready;\n    }\n    /**\n     * A signal emitted when the running kernels change.\n     */\n    get runningChanged() {\n        return this._runningChanged;\n    }\n    /**\n     * A signal emitted when there is a connection failure.\n     */\n    get connectionFailure() {\n        return this._connectionFailure;\n    }\n    /**\n     * Dispose of the resources used by the manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._models.clear();\n        this._kernelConnections.forEach(x => x.dispose());\n        this._pollModels.dispose();\n        super.dispose();\n    }\n    /**\n     * Connect to an existing kernel.\n     *\n     * @returns The new kernel connection.\n     *\n     * #### Notes\n     * This will use the manager's server settings and ignore any server\n     * settings passed in the options.\n     */\n    connectTo(options) {\n        var _a;\n        const { id } = options.model;\n        let handleComms = (_a = options.handleComms) !== null && _a !== void 0 ? _a : true;\n        // By default, handle comms only if no other kernel connection is.\n        if (options.handleComms === undefined) {\n            for (const kc of this._kernelConnections) {\n                if (kc.id === id && kc.handleComms) {\n                    handleComms = false;\n                    break;\n                }\n            }\n        }\n        const kernelConnection = new default_1.KernelConnection(Object.assign(Object.assign({ handleComms }, options), { serverSettings: this.serverSettings }));\n        this._onStarted(kernelConnection);\n        if (!this._models.has(id)) {\n            // We trust the user to connect to an existing kernel, but we verify\n            // asynchronously.\n            void this.refreshRunning().catch(() => {\n                /* no-op */\n            });\n        }\n        return kernelConnection;\n    }\n    /**\n     * Create an iterator over the most recent running kernels.\n     *\n     * @returns A new iterator over the running kernels.\n     */\n    running() {\n        return algorithm_1.iter([...this._models.values()]);\n    }\n    /**\n     * Force a refresh of the running kernels.\n     *\n     * @returns A promise that resolves when the running list has been refreshed.\n     *\n     * #### Notes\n     * This is not typically meant to be called by the user, since the\n     * manager maintains its own internal state.\n     */\n    async refreshRunning() {\n        await this._pollModels.refresh();\n        await this._pollModels.tick;\n    }\n    /**\n     * Start a new kernel.\n     *\n     * @param createOptions - The kernel creation options\n     *\n     * @param connectOptions - The kernel connection options\n     *\n     * @returns A promise that resolves with the kernel connection.\n     *\n     * #### Notes\n     * The manager `serverSettings` will be always be used.\n     */\n    async startNew(createOptions = {}, connectOptions = {}) {\n        const model = await restapi_1.startNew(createOptions, this.serverSettings);\n        return this.connectTo(Object.assign(Object.assign({}, connectOptions), { model }));\n    }\n    /**\n     * Shut down a kernel by id.\n     *\n     * @param id - The id of the target kernel.\n     *\n     * @returns A promise that resolves when the operation is complete.\n     */\n    async shutdown(id) {\n        await restapi_1.shutdownKernel(id, this.serverSettings);\n        await this.refreshRunning();\n    }\n    /**\n     * Shut down all kernels.\n     *\n     * @returns A promise that resolves when all of the kernels are shut down.\n     */\n    async shutdownAll() {\n        // Update the list of models to make sure our list is current.\n        await this.refreshRunning();\n        // Shut down all models.\n        await Promise.all([...this._models.keys()].map(id => restapi_1.shutdownKernel(id, this.serverSettings)));\n        // Update the list of models to clear out our state.\n        await this.refreshRunning();\n    }\n    /**\n     * Find a kernel by id.\n     *\n     * @param id - The id of the target kernel.\n     *\n     * @returns A promise that resolves with the kernel's model.\n     */\n    async findById(id) {\n        if (this._models.has(id)) {\n            return this._models.get(id);\n        }\n        await this.refreshRunning();\n        return this._models.get(id);\n    }\n    /**\n     * Execute a request to the server to poll running kernels and update state.\n     */\n    async requestRunning() {\n        var _a;\n        let models;\n        try {\n            models = await restapi_1.listRunning(this.serverSettings);\n        }\n        catch (err) {\n            // Check for a network error, or a 503 error, which is returned\n            // by a JupyterHub when a server is shut down.\n            if (err instanceof __1.ServerConnection.NetworkError ||\n                ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503) {\n                this._connectionFailure.emit(err);\n            }\n            throw err;\n        }\n        if (this.isDisposed) {\n            return;\n        }\n        if (this._models.size === models.length &&\n            algorithm_1.every(models, x => {\n                const existing = this._models.get(x.id);\n                if (!existing) {\n                    return false;\n                }\n                return existing.name === x.name;\n            })) {\n            // Identical models list (presuming models does not contain duplicate\n            // ids), so just return\n            return;\n        }\n        this._models = new Map(models.map(x => [x.id, x]));\n        // For any kernel connection to a kernel that doesn't exist, notify it of\n        // the shutdown.\n        this._kernelConnections.forEach(kc => {\n            if (!this._models.has(kc.id)) {\n                kc.handleShutdown();\n            }\n        });\n        this._runningChanged.emit(models);\n    }\n    /**\n     * Handle a kernel starting.\n     */\n    _onStarted(kernelConnection) {\n        this._kernelConnections.add(kernelConnection);\n        kernelConnection.statusChanged.connect(this._onStatusChanged, this);\n        kernelConnection.disposed.connect(this._onDisposed, this);\n    }\n    _onDisposed(kernelConnection) {\n        this._kernelConnections.delete(kernelConnection);\n        // A dispose emission could mean the server session is deleted, or that\n        // the kernel JS object is disposed and the kernel still exists on the\n        // server, so we refresh from the server to make sure we reflect the\n        // server state.\n        void this.refreshRunning().catch(() => {\n            /* no-op */\n        });\n    }\n    _onStatusChanged(kernelConnection, status) {\n        if (status === 'dead') {\n            // We asynchronously update our list of kernels, which asynchronously\n            // will dispose them. We do not want to immediately dispose them because\n            // there may be other signal handlers that want to be called.\n            void this.refreshRunning().catch(() => {\n                /* no-op */\n            });\n        }\n    }\n}\nexports.KernelManager = KernelManager;\n//# sourceMappingURL=manager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/manager.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/messages.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/messages.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isInputReplyMsg = exports.isInputRequestMsg = exports.isDebugReplyMsg = exports.isDebugRequestMsg = exports.isExecuteReplyMsg = exports.isInfoRequestMsg = exports.isCommMsgMsg = exports.isCommCloseMsg = exports.isCommOpenMsg = exports.isDebugEventMsg = exports.isClearOutputMsg = exports.isStatusMsg = exports.isErrorMsg = exports.isExecuteResultMsg = exports.isExecuteInputMsg = exports.isUpdateDisplayDataMsg = exports.isDisplayDataMsg = exports.isStreamMsg = exports.createMessage = void 0;\nconst coreutils_1 = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\nfunction createMessage(options) {\n    var _a, _b, _c, _d, _e;\n    return {\n        buffers: (_a = options.buffers) !== null && _a !== void 0 ? _a : [],\n        channel: options.channel,\n        content: options.content,\n        header: {\n            date: new Date().toISOString(),\n            msg_id: (_b = options.msgId) !== null && _b !== void 0 ? _b : coreutils_1.UUID.uuid4(),\n            msg_type: options.msgType,\n            session: options.session,\n            username: (_c = options.username) !== null && _c !== void 0 ? _c : '',\n            version: '5.2'\n        },\n        metadata: (_d = options.metadata) !== null && _d !== void 0 ? _d : {},\n        parent_header: (_e = options.parentHeader) !== null && _e !== void 0 ? _e : {}\n    };\n}\nexports.createMessage = createMessage;\n/**\n * Test whether a kernel message is a `'stream'` message.\n */\nfunction isStreamMsg(msg) {\n    return msg.header.msg_type === 'stream';\n}\nexports.isStreamMsg = isStreamMsg;\n/**\n * Test whether a kernel message is an `'display_data'` message.\n */\nfunction isDisplayDataMsg(msg) {\n    return msg.header.msg_type === 'display_data';\n}\nexports.isDisplayDataMsg = isDisplayDataMsg;\n/**\n * Test whether a kernel message is an `'update_display_data'` message.\n */\nfunction isUpdateDisplayDataMsg(msg) {\n    return msg.header.msg_type === 'update_display_data';\n}\nexports.isUpdateDisplayDataMsg = isUpdateDisplayDataMsg;\n/**\n * Test whether a kernel message is an `'execute_input'` message.\n */\nfunction isExecuteInputMsg(msg) {\n    return msg.header.msg_type === 'execute_input';\n}\nexports.isExecuteInputMsg = isExecuteInputMsg;\n/**\n * Test whether a kernel message is an `'execute_result'` message.\n */\nfunction isExecuteResultMsg(msg) {\n    return msg.header.msg_type === 'execute_result';\n}\nexports.isExecuteResultMsg = isExecuteResultMsg;\n/**\n * Test whether a kernel message is an `'error'` message.\n */\nfunction isErrorMsg(msg) {\n    return msg.header.msg_type === 'error';\n}\nexports.isErrorMsg = isErrorMsg;\n/**\n * Test whether a kernel message is a `'status'` message.\n */\nfunction isStatusMsg(msg) {\n    return msg.header.msg_type === 'status';\n}\nexports.isStatusMsg = isStatusMsg;\n/**\n * Test whether a kernel message is a `'clear_output'` message.\n */\nfunction isClearOutputMsg(msg) {\n    return msg.header.msg_type === 'clear_output';\n}\nexports.isClearOutputMsg = isClearOutputMsg;\n/**\n * Test whether a kernel message is an experimental `'debug_event'` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this is *NOT* considered\n * part of the public API, and may change without notice.\n */\nfunction isDebugEventMsg(msg) {\n    return msg.header.msg_type === 'debug_event';\n}\nexports.isDebugEventMsg = isDebugEventMsg;\n/**\n * Test whether a kernel message is a `'comm_open'` message.\n */\nfunction isCommOpenMsg(msg) {\n    return msg.header.msg_type === 'comm_open';\n}\nexports.isCommOpenMsg = isCommOpenMsg;\n/**\n * Test whether a kernel message is a `'comm_close'` message.\n */\nfunction isCommCloseMsg(msg) {\n    return msg.header.msg_type === 'comm_close';\n}\nexports.isCommCloseMsg = isCommCloseMsg;\n/**\n * Test whether a kernel message is a `'comm_msg'` message.\n */\nfunction isCommMsgMsg(msg) {\n    return msg.header.msg_type === 'comm_msg';\n}\nexports.isCommMsgMsg = isCommMsgMsg;\n/**\n * Test whether a kernel message is a `'kernel_info_request'` message.\n */\nfunction isInfoRequestMsg(msg) {\n    return msg.header.msg_type === 'kernel_info_request';\n}\nexports.isInfoRequestMsg = isInfoRequestMsg;\n/**\n * Test whether a kernel message is an `'execute_reply'` message.\n */\nfunction isExecuteReplyMsg(msg) {\n    return msg.header.msg_type === 'execute_reply';\n}\nexports.isExecuteReplyMsg = isExecuteReplyMsg;\n/**\n * Test whether a kernel message is an experimental `'debug_request'` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this is *NOT* considered\n * part of the public API, and may change without notice.\n */\nfunction isDebugRequestMsg(msg) {\n    return msg.header.msg_type === 'debug_request';\n}\nexports.isDebugRequestMsg = isDebugRequestMsg;\n/**\n * Test whether a kernel message is an experimental `'debug_reply'` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this is *NOT* considered\n * part of the public API, and may change without notice.\n */\nfunction isDebugReplyMsg(msg) {\n    return msg.header.msg_type === 'debug_reply';\n}\nexports.isDebugReplyMsg = isDebugReplyMsg;\n/**\n * Test whether a kernel message is an `'input_request'` message.\n */\nfunction isInputRequestMsg(msg) {\n    return msg.header.msg_type === 'input_request';\n}\nexports.isInputRequestMsg = isInputRequestMsg;\n/**\n * Test whether a kernel message is an `'input_reply'` message.\n */\nfunction isInputReplyMsg(msg) {\n    return msg.header.msg_type === 'input_reply';\n}\nexports.isInputReplyMsg = isInputReplyMsg;\n//# sourceMappingURL=messages.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/messages.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/restapi.js":
/*!******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/restapi.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getKernelModel = exports.shutdownKernel = exports.interruptKernel = exports.restartKernel = exports.startNew = exports.listRunning = exports.KERNEL_SERVICE_URL = void 0;\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst validate_1 = __webpack_require__(/*! ./validate */ \"../node_modules/@jupyterlab/services/lib/kernel/validate.js\");\n/**\n * The url for the kernel service.\n */\nexports.KERNEL_SERVICE_URL = 'api/kernels';\n/**\n * Fetch the running kernels.\n *\n * @param settings - The optional server settings.\n *\n * @returns A promise that resolves with the list of running kernels.\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL);\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.validateModels(data);\n    return data;\n}\nexports.listRunning = listRunning;\n/**\n * Start a new kernel.\n *\n * @param options - The options used to create the kernel.\n *\n * @returns A promise that resolves with a kernel connection object.\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function startNew(options = {}, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL);\n    const init = {\n        method: 'POST',\n        body: JSON.stringify(options)\n    };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status !== 201) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.validateModel(data);\n    return data;\n}\nexports.startNew = startNew;\n/**\n * Restart a kernel.\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response (and thus after a restart) and rejected otherwise.\n */\nasync function restartKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id), 'restart');\n    const init = { method: 'POST' };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.validateModel(data);\n}\nexports.restartKernel = restartKernel;\n/**\n * Interrupt a kernel.\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function interruptKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id), 'interrupt');\n    const init = { method: 'POST' };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status !== 204) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n}\nexports.interruptKernel = interruptKernel;\n/**\n * Shut down a kernel.\n *\n * @param id - The id of the running kernel.\n *\n * @param settings - The server settings for the request.\n *\n * @returns A promise that resolves when the kernel is shut down.\n *\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function shutdownKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id));\n    const init = { method: 'DELETE' };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status === 404) {\n        const msg = `The kernel \"${id}\" does not exist on the server`;\n        console.warn(msg);\n    }\n    else if (response.status !== 204) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n}\nexports.shutdownKernel = shutdownKernel;\n/**\n * Get a full kernel model from the server by kernel id string.\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function getKernelModel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id));\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n    if (response.status === 404) {\n        return undefined;\n    }\n    else if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.validateModel(data);\n    return data;\n}\nexports.getKernelModel = getKernelModel;\n//# sourceMappingURL=restapi.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/restapi.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/serialize.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/serialize.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.serialize = exports.deserialize = void 0;\n/**\n * Deserialize and return the unpacked message.\n *\n * #### Notes\n * Handles JSON blob strings and binary messages.\n */\nfunction deserialize(data) {\n    let value;\n    if (typeof data === 'string') {\n        value = JSON.parse(data);\n    }\n    else {\n        value = deserializeBinary(data);\n    }\n    return value;\n}\nexports.deserialize = deserialize;\n/**\n * Serialize a kernel message for transport.\n *\n * #### Notes\n * If there is binary content, an `ArrayBuffer` is returned,\n * otherwise the message is converted to a JSON string.\n */\nfunction serialize(msg) {\n    var _a;\n    let value;\n    if ((_a = msg.buffers) === null || _a === void 0 ? void 0 : _a.length) {\n        value = serializeBinary(msg);\n    }\n    else {\n        value = JSON.stringify(msg);\n    }\n    return value;\n}\nexports.serialize = serialize;\n/**\n * Deserialize a binary message to a Kernel Message.\n */\nfunction deserializeBinary(buf) {\n    const data = new DataView(buf);\n    // read the header: 1 + nbufs 32b integers\n    const nbufs = data.getUint32(0);\n    const offsets = [];\n    if (nbufs < 2) {\n        throw new Error('Invalid incoming Kernel Message');\n    }\n    for (let i = 1; i <= nbufs; i++) {\n        offsets.push(data.getUint32(i * 4));\n    }\n    const jsonBytes = new Uint8Array(buf.slice(offsets[0], offsets[1]));\n    const msg = JSON.parse(new TextDecoder('utf8').decode(jsonBytes));\n    // the remaining chunks are stored as DataViews in msg.buffers\n    msg.buffers = [];\n    for (let i = 1; i < nbufs; i++) {\n        const start = offsets[i];\n        const stop = offsets[i + 1] || buf.byteLength;\n        msg.buffers.push(new DataView(buf.slice(start, stop)));\n    }\n    return msg;\n}\n/**\n * Implement the binary serialization protocol.\n *\n * Serialize Kernel message to ArrayBuffer.\n */\nfunction serializeBinary(msg) {\n    const offsets = [];\n    const buffers = [];\n    const encoder = new TextEncoder();\n    let origBuffers = [];\n    if (msg.buffers !== undefined) {\n        origBuffers = msg.buffers;\n        delete msg['buffers'];\n    }\n    const jsonUtf8 = encoder.encode(JSON.stringify(msg));\n    buffers.push(jsonUtf8.buffer);\n    for (let i = 0; i < origBuffers.length; i++) {\n        // msg.buffers elements could be either views or ArrayBuffers\n        // buffers elements are ArrayBuffers\n        const b = origBuffers[i];\n        buffers.push(ArrayBuffer.isView(b) ? b.buffer : b);\n    }\n    const nbufs = buffers.length;\n    offsets.push(4 * (nbufs + 1));\n    for (let i = 0; i + 1 < buffers.length; i++) {\n        offsets.push(offsets[offsets.length - 1] + buffers[i].byteLength);\n    }\n    const msgBuf = new Uint8Array(offsets[offsets.length - 1] + buffers[buffers.length - 1].byteLength);\n    // use DataView.setUint32 for network byte-order\n    const view = new DataView(msgBuf.buffer);\n    // write nbufs to first 4 bytes\n    view.setUint32(0, nbufs);\n    // write offsets to next 4 * nbufs bytes\n    for (let i = 0; i < offsets.length; i++) {\n        view.setUint32(4 * (i + 1), offsets[i]);\n    }\n    // write all the buffers at their respective offsets\n    for (let i = 0; i < buffers.length; i++) {\n        msgBuf.set(new Uint8Array(buffers[i]), offsets[i]);\n    }\n    return msgBuf.buffer;\n}\n//# sourceMappingURL=serialize.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/serialize.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernel/validate.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernel/validate.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateModels = exports.validateModel = exports.validateMessage = void 0;\nconst validate_1 = __webpack_require__(/*! ../validate */ \"../node_modules/@jupyterlab/services/lib/validate.js\");\n/**\n * Required fields for `IKernelHeader`.\n */\nconst HEADER_FIELDS = ['username', 'version', 'session', 'msg_id', 'msg_type'];\n/**\n * Required fields and types for contents of various types of `kernel.IMessage`\n * messages on the iopub channel.\n */\nconst IOPUB_CONTENT_FIELDS = {\n    stream: { name: 'string', text: 'string' },\n    display_data: { data: 'object', metadata: 'object' },\n    execute_input: { code: 'string', execution_count: 'number' },\n    execute_result: {\n        execution_count: 'number',\n        data: 'object',\n        metadata: 'object'\n    },\n    error: { ename: 'string', evalue: 'string', traceback: 'object' },\n    status: {\n        execution_state: [\n            'string',\n            ['starting', 'idle', 'busy', 'restarting', 'dead']\n        ]\n    },\n    clear_output: { wait: 'boolean' },\n    comm_open: { comm_id: 'string', target_name: 'string', data: 'object' },\n    comm_msg: { comm_id: 'string', data: 'object' },\n    comm_close: { comm_id: 'string' },\n    shutdown_reply: { restart: 'boolean' } // Emitted by the IPython kernel.\n};\n/**\n * Validate the header of a kernel message.\n */\nfunction validateHeader(header) {\n    for (let i = 0; i < HEADER_FIELDS.length; i++) {\n        validate_1.validateProperty(header, HEADER_FIELDS[i], 'string');\n    }\n}\n/**\n * Validate a kernel message object.\n */\nfunction validateMessage(msg) {\n    validate_1.validateProperty(msg, 'metadata', 'object');\n    validate_1.validateProperty(msg, 'content', 'object');\n    validate_1.validateProperty(msg, 'channel', 'string');\n    validateHeader(msg.header);\n    if (msg.channel === 'iopub') {\n        validateIOPubContent(msg);\n    }\n}\nexports.validateMessage = validateMessage;\n/**\n * Validate content an kernel message on the iopub channel.\n */\nfunction validateIOPubContent(msg) {\n    if (msg.channel === 'iopub') {\n        const fields = IOPUB_CONTENT_FIELDS[msg.header.msg_type];\n        // Check for unknown message type.\n        if (fields === undefined) {\n            return;\n        }\n        const names = Object.keys(fields);\n        const content = msg.content;\n        for (let i = 0; i < names.length; i++) {\n            let args = fields[names[i]];\n            if (!Array.isArray(args)) {\n                args = [args];\n            }\n            validate_1.validateProperty(content, names[i], ...args);\n        }\n    }\n}\n/**\n * Validate a `Kernel.IModel` object.\n */\nfunction validateModel(model) {\n    validate_1.validateProperty(model, 'name', 'string');\n    validate_1.validateProperty(model, 'id', 'string');\n}\nexports.validateModel = validateModel;\n/**\n * Validate an array of `IModel` objects.\n */\nfunction validateModels(models) {\n    if (!Array.isArray(models)) {\n        throw new Error('Invalid kernel list');\n    }\n    models.forEach(d => validateModel(d));\n}\nexports.validateModels = validateModels;\n//# sourceMappingURL=validate.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernel/validate.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernelspec/index.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernelspec/index.js ***!
  \********************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.KernelSpecAPI = exports.KernelSpec = void 0;\nconst KernelSpec = __importStar(__webpack_require__(/*! ./kernelspec */ \"../node_modules/@jupyterlab/services/lib/kernelspec/kernelspec.js\"));\nexports.KernelSpec = KernelSpec;\nconst KernelSpecAPI = __importStar(__webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/kernelspec/restapi.js\"));\nexports.KernelSpecAPI = KernelSpecAPI;\n__exportStar(__webpack_require__(/*! ./manager */ \"../node_modules/@jupyterlab/services/lib/kernelspec/manager.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernelspec/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernelspec/kernelspec.js":
/*!*************************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernelspec/kernelspec.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=kernelspec.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernelspec/kernelspec.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernelspec/manager.js":
/*!**********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernelspec/manager.js ***!
  \**********************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.KernelSpecManager = void 0;\nconst coreutils_1 = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\nconst polling_1 = __webpack_require__(/*! @lumino/polling */ \"webpack/sharing/consume/default/@lumino/polling/@lumino/polling\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst restapi = __importStar(__webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/kernelspec/restapi.js\"));\nconst basemanager_1 = __webpack_require__(/*! ../basemanager */ \"../node_modules/@jupyterlab/services/lib/basemanager.js\");\n/**\n * An implementation of a kernel spec manager.\n */\nclass KernelSpecManager extends basemanager_1.BaseManager {\n    /**\n     * Construct a new kernel spec manager.\n     *\n     * @param options - The default options for kernel.\n     */\n    constructor(options = {}) {\n        var _a;\n        super(options);\n        this._isReady = false;\n        this._connectionFailure = new signaling_1.Signal(this);\n        this._specs = null;\n        this._specsChanged = new signaling_1.Signal(this);\n        // Initialize internal data.\n        this._ready = Promise.all([this.requestSpecs()])\n            .then(_ => undefined)\n            .catch(_ => undefined)\n            .then(() => {\n            if (this.isDisposed) {\n                return;\n            }\n            this._isReady = true;\n        });\n        this._pollSpecs = new polling_1.Poll({\n            auto: false,\n            factory: () => this.requestSpecs(),\n            frequency: {\n                interval: 61 * 1000,\n                backoff: true,\n                max: 300 * 1000\n            },\n            name: `@jupyterlab/services:KernelSpecManager#specs`,\n            standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n        });\n        void this.ready.then(() => {\n            void this._pollSpecs.start();\n        });\n    }\n    /**\n     * Test whether the manager is ready.\n     */\n    get isReady() {\n        return this._isReady;\n    }\n    /**\n     * A promise that fulfills when the manager is ready.\n     */\n    get ready() {\n        return this._ready;\n    }\n    /**\n     * Get the most recently fetched kernel specs.\n     */\n    get specs() {\n        return this._specs;\n    }\n    /**\n     * A signal emitted when the specs change.\n     */\n    get specsChanged() {\n        return this._specsChanged;\n    }\n    /**\n     * A signal emitted when there is a connection failure.\n     */\n    get connectionFailure() {\n        return this._connectionFailure;\n    }\n    /**\n     * Dispose of the resources used by the manager.\n     */\n    dispose() {\n        this._pollSpecs.dispose();\n        super.dispose();\n    }\n    /**\n     * Force a refresh of the specs from the server.\n     *\n     * @returns A promise that resolves when the specs are fetched.\n     *\n     * #### Notes\n     * This is intended to be called only in response to a user action,\n     * since the manager maintains its internal state.\n     */\n    async refreshSpecs() {\n        await this._pollSpecs.refresh();\n        await this._pollSpecs.tick;\n    }\n    /**\n     * Execute a request to the server to poll specs and update state.\n     */\n    async requestSpecs() {\n        const specs = await restapi.getSpecs(this.serverSettings);\n        if (this.isDisposed) {\n            return;\n        }\n        if (!coreutils_1.JSONExt.deepEqual(specs, this._specs)) {\n            this._specs = specs;\n            this._specsChanged.emit(specs);\n        }\n    }\n}\nexports.KernelSpecManager = KernelSpecManager;\n//# sourceMappingURL=manager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernelspec/manager.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernelspec/restapi.js":
/*!**********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernelspec/restapi.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getSpecs = void 0;\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\nconst validate_1 = __webpack_require__(/*! ./validate */ \"../node_modules/@jupyterlab/services/lib/kernelspec/validate.js\");\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/**\n * The url for the kernelspec service.\n */\nconst KERNELSPEC_SERVICE_URL = 'api/kernelspecs';\n/**\n * Fetch all of the kernel specs.\n *\n * @param settings - The optional server settings.\n * @param useCache - Whether to use the cache. If false, always request.\n *\n * @returns A promise that resolves with the kernel specs.\n *\n * #### Notes\n * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernelspecs).\n */\nasync function getSpecs(settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, KERNELSPEC_SERVICE_URL);\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    return validate_1.validateSpecModels(data);\n}\nexports.getSpecs = getSpecs;\n//# sourceMappingURL=restapi.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernelspec/restapi.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/kernelspec/validate.js":
/*!***********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/kernelspec/validate.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateSpecModels = exports.validateSpecModel = void 0;\nconst validate_1 = __webpack_require__(/*! ../validate */ \"../node_modules/@jupyterlab/services/lib/validate.js\");\n/**\n * Validate a server kernelspec model to a client side model.\n */\nfunction validateSpecModel(data) {\n    const spec = data.spec;\n    if (!spec) {\n        throw new Error('Invalid kernel spec');\n    }\n    validate_1.validateProperty(data, 'name', 'string');\n    validate_1.validateProperty(data, 'resources', 'object');\n    validate_1.validateProperty(spec, 'language', 'string');\n    validate_1.validateProperty(spec, 'display_name', 'string');\n    validate_1.validateProperty(spec, 'argv', 'array');\n    let metadata = null;\n    if (spec.hasOwnProperty('metadata')) {\n        validate_1.validateProperty(spec, 'metadata', 'object');\n        metadata = spec.metadata;\n    }\n    let env = null;\n    if (spec.hasOwnProperty('env')) {\n        validate_1.validateProperty(spec, 'env', 'object');\n        env = spec.env;\n    }\n    return {\n        name: data.name,\n        resources: data.resources,\n        language: spec.language,\n        display_name: spec.display_name,\n        argv: spec.argv,\n        metadata,\n        env\n    };\n}\nexports.validateSpecModel = validateSpecModel;\n/**\n * Validate a `Kernel.ISpecModels` object.\n */\nfunction validateSpecModels(data) {\n    if (!data.hasOwnProperty('kernelspecs')) {\n        throw new Error('No kernelspecs found');\n    }\n    let keys = Object.keys(data.kernelspecs);\n    const kernelspecs = Object.create(null);\n    let defaultSpec = data.default;\n    for (let i = 0; i < keys.length; i++) {\n        const ks = data.kernelspecs[keys[i]];\n        try {\n            kernelspecs[keys[i]] = validateSpecModel(ks);\n        }\n        catch (err) {\n            // Remove the errant kernel spec.\n            console.warn(`Removing errant kernel spec: ${keys[i]}`);\n        }\n    }\n    keys = Object.keys(kernelspecs);\n    if (!keys.length) {\n        throw new Error('No valid kernelspecs found');\n    }\n    if (!defaultSpec ||\n        typeof defaultSpec !== 'string' ||\n        !(defaultSpec in kernelspecs)) {\n        defaultSpec = keys[0];\n        console.warn(`Default kernel not found, using '${keys[0]}'`);\n    }\n    return {\n        default: defaultSpec,\n        kernelspecs\n    };\n}\nexports.validateSpecModels = validateSpecModels;\n//# sourceMappingURL=validate.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/kernelspec/validate.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/manager.js":
/*!***********************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/manager.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ServiceManager = void 0;\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst builder_1 = __webpack_require__(/*! ./builder */ \"../node_modules/@jupyterlab/services/lib/builder/index.js\");\nconst nbconvert_1 = __webpack_require__(/*! ./nbconvert */ \"../node_modules/@jupyterlab/services/lib/nbconvert/index.js\");\nconst contents_1 = __webpack_require__(/*! ./contents */ \"../node_modules/@jupyterlab/services/lib/contents/index.js\");\nconst kernelspec_1 = __webpack_require__(/*! ./kernelspec */ \"../node_modules/@jupyterlab/services/lib/kernelspec/index.js\");\nconst session_1 = __webpack_require__(/*! ./session */ \"../node_modules/@jupyterlab/services/lib/session/index.js\");\nconst setting_1 = __webpack_require__(/*! ./setting */ \"../node_modules/@jupyterlab/services/lib/setting/index.js\");\nconst terminal_1 = __webpack_require__(/*! ./terminal */ \"../node_modules/@jupyterlab/services/lib/terminal/index.js\");\nconst serverconnection_1 = __webpack_require__(/*! ./serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\nconst workspace_1 = __webpack_require__(/*! ./workspace */ \"../node_modules/@jupyterlab/services/lib/workspace/index.js\");\nconst kernel_1 = __webpack_require__(/*! ./kernel */ \"../node_modules/@jupyterlab/services/lib/kernel/index.js\");\n/**\n * A Jupyter services manager.\n */\nclass ServiceManager {\n    /**\n     * Construct a new services provider.\n     */\n    constructor(options = {}) {\n        var _a, _b;\n        this._isDisposed = false;\n        this._connectionFailure = new signaling_1.Signal(this);\n        this._isReady = false;\n        const defaultDrive = options.defaultDrive;\n        const serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n        const standby = (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden';\n        const normalized = { defaultDrive, serverSettings, standby };\n        const kernelManager = new kernel_1.KernelManager(normalized);\n        this.serverSettings = serverSettings;\n        this.contents = new contents_1.ContentsManager(normalized);\n        this.sessions = new session_1.SessionManager(Object.assign(Object.assign({}, normalized), { kernelManager: kernelManager }));\n        this.settings = new setting_1.SettingManager(normalized);\n        this.terminals = new terminal_1.TerminalManager(normalized);\n        this.builder = new builder_1.BuildManager(normalized);\n        this.workspaces = new workspace_1.WorkspaceManager(normalized);\n        this.nbconvert = new nbconvert_1.NbConvertManager(normalized);\n        this.kernelspecs = new kernelspec_1.KernelSpecManager(normalized);\n        // Relay connection failures from the service managers that poll\n        // the server for current information.\n        this.kernelspecs.connectionFailure.connect(this._onConnectionFailure, this);\n        this.sessions.connectionFailure.connect(this._onConnectionFailure, this);\n        this.terminals.connectionFailure.connect(this._onConnectionFailure, this);\n        const readyList = [this.sessions.ready, this.kernelspecs.ready];\n        if (this.terminals.isAvailable()) {\n            readyList.push(this.terminals.ready);\n        }\n        this._readyPromise = Promise.all(readyList).then(() => {\n            this._isReady = true;\n        });\n    }\n    /**\n     * A signal emitted when there is a connection failure with the kernel.\n     */\n    get connectionFailure() {\n        return this._connectionFailure;\n    }\n    /**\n     * Test whether the service manager is disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources used by the manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        signaling_1.Signal.clearData(this);\n        this.contents.dispose();\n        this.sessions.dispose();\n        this.terminals.dispose();\n    }\n    /**\n     * Test whether the manager is ready.\n     */\n    get isReady() {\n        return this._isReady;\n    }\n    /**\n     * A promise that fulfills when the manager is ready.\n     */\n    get ready() {\n        return this._readyPromise;\n    }\n    _onConnectionFailure(sender, err) {\n        this._connectionFailure.emit(err);\n    }\n}\nexports.ServiceManager = ServiceManager;\n//# sourceMappingURL=manager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/manager.js?");

/***/ }),

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

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NbConvertManager = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\n/**\n * The url for the lab nbconvert service.\n */\nconst NBCONVERT_SETTINGS_URL = 'api/nbconvert';\n/**\n * The nbconvert API service manager.\n */\nclass NbConvertManager {\n    /**\n     * Create a new nbconvert manager.\n     */\n    constructor(options = {}) {\n        var _a;\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n    }\n    /**\n     * Get whether the application should be built.\n     */\n    async getExportFormats() {\n        const base = this.serverSettings.baseUrl;\n        const url = coreutils_1.URLExt.join(base, NBCONVERT_SETTINGS_URL);\n        const { serverSettings } = this;\n        const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, serverSettings);\n        if (response.status !== 200) {\n            const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n            throw err;\n        }\n        const data = await response.json();\n        const exportList = {};\n        const keys = Object.keys(data);\n        keys.forEach(function (key) {\n            const mimeType = data[key].output_mimetype;\n            exportList[key] = { output_mimetype: mimeType };\n        });\n        return exportList;\n    }\n}\nexports.NbConvertManager = NbConvertManager;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/nbconvert/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/serverconnection.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/serverconnection.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("/* provided dependency */ var process = __webpack_require__(/*! process/browser */ \"../node_modules/process/browser.js\");\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar _a, _b, _c;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ServerConnection = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nlet FETCH;\nlet HEADERS;\nlet REQUEST;\nlet WEBSOCKET;\nif (typeof window === 'undefined') {\n    // Mangle the require statements so it does not get picked up in the\n    // browser assets.\n    /* tslint:disable */\n    const fetchMod = __webpack_require__(/*! node-fetch */ \"?6a83\");\n    FETCH = (_a = __webpack_require__.g.fetch) !== null && _a !== void 0 ? _a : fetchMod;\n    REQUEST = (_b = __webpack_require__.g.Request) !== null && _b !== void 0 ? _b : fetchMod.Request;\n    HEADERS = (_c = __webpack_require__.g.Headers) !== null && _c !== void 0 ? _c : fetchMod.Headers;\n    WEBSOCKET = __webpack_require__(/*! ws */ \"../node_modules/@jupyterlab/services/lib/shim/ws.js\");\n    /* tslint:enable */\n}\nelse {\n    FETCH = fetch;\n    REQUEST = Request;\n    HEADERS = Headers;\n    WEBSOCKET = WebSocket;\n}\n/**\n * The namespace for ServerConnection functions.\n *\n * #### Notes\n * This is only intended to manage communication with the Jupyter server.\n *\n * The default values can be used in a JupyterLab or Jupyter Notebook context.\n *\n * We use `token` authentication if available, falling back on an XSRF\n * cookie if one has been provided on the `document`.\n *\n * A content type of `'application/json'` is added when using authentication\n * and there is no body data to allow the server to prevent malicious forms.\n */\nvar ServerConnection;\n(function (ServerConnection) {\n    /**\n     * Create a settings object given a subset of options.\n     *\n     * @param options - An optional partial set of options.\n     *\n     * @returns The full settings object.\n     */\n    function makeSettings(options) {\n        return Private.makeSettings(options);\n    }\n    ServerConnection.makeSettings = makeSettings;\n    /**\n     * Make an request to the notebook server.\n     *\n     * @param url - The url for the request.\n     *\n     * @param init - The initialization options for the request.\n     *\n     * @param settings - The server settings to apply to the request.\n     *\n     * @returns a Promise that resolves with the response.\n     *\n     * @throws If the url of the request is not a notebook server url.\n     *\n     * #### Notes\n     * The `url` must start with `settings.baseUrl`.  The `init` settings are\n     * merged with `settings.init`, with `init` taking precedence.\n     * The headers in the two objects are not merged.\n     * If there is no body data, we set the content type to `application/json`\n     * because it is required by the Notebook server.\n     */\n    function makeRequest(url, init, settings) {\n        return Private.handleRequest(url, init, settings);\n    }\n    ServerConnection.makeRequest = makeRequest;\n    /**\n     * A wrapped error for a fetch response.\n     */\n    class ResponseError extends Error {\n        /**\n         * Create a new response error.\n         */\n        constructor(response, message = `Invalid response: ${response.status} ${response.statusText}`, traceback = '') {\n            super(message);\n            this.response = response;\n            this.traceback = traceback;\n        }\n        /**\n         * Create a ResponseError from a response, handling the traceback and message\n         * as appropriate.\n         *\n         * @param response The response object.\n         *\n         * @returns A promise that resolves with a `ResponseError` object.\n         */\n        static async create(response) {\n            try {\n                const data = await response.json();\n                if (data['traceback']) {\n                    console.error(data['traceback']);\n                }\n                if (data['message']) {\n                    return new ResponseError(response, data['message']);\n                }\n                return new ResponseError(response);\n            }\n            catch (e) {\n                console.debug(e);\n                return new ResponseError(response);\n            }\n        }\n    }\n    ServerConnection.ResponseError = ResponseError;\n    /**\n     * A wrapped error for a network error.\n     */\n    class NetworkError extends TypeError {\n        /**\n         * Create a new network error.\n         */\n        constructor(original) {\n            super(original.message);\n            this.stack = original.stack;\n        }\n    }\n    ServerConnection.NetworkError = NetworkError;\n})(ServerConnection = exports.ServerConnection || (exports.ServerConnection = {}));\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Handle the server connection settings, returning a new value.\n     */\n    function makeSettings(options = {}) {\n        const pageBaseUrl = coreutils_1.PageConfig.getBaseUrl();\n        const pageWsUrl = coreutils_1.PageConfig.getWsUrl();\n        const baseUrl = coreutils_1.URLExt.normalize(options.baseUrl) || pageBaseUrl;\n        let wsUrl = options.wsUrl;\n        // Prefer the default wsUrl if we are using the default baseUrl.\n        if (!wsUrl && baseUrl === pageBaseUrl) {\n            wsUrl = pageWsUrl;\n        }\n        // Otherwise convert the baseUrl to a wsUrl if possible.\n        if (!wsUrl && baseUrl.indexOf('http') === 0) {\n            wsUrl = 'ws' + baseUrl.slice(4);\n        }\n        // Otherwise fall back on the default wsUrl.\n        wsUrl = wsUrl !== null && wsUrl !== void 0 ? wsUrl : pageWsUrl;\n        return Object.assign(Object.assign({ init: { cache: 'no-store', credentials: 'same-origin' }, fetch: FETCH, Headers: HEADERS, Request: REQUEST, WebSocket: WEBSOCKET, token: coreutils_1.PageConfig.getToken(), appUrl: coreutils_1.PageConfig.getOption('appUrl'), appendToken: typeof window === 'undefined' ||\n                process.env.JEST_WORKER_ID !== undefined ||\n                coreutils_1.URLExt.getHostName(pageBaseUrl) !== coreutils_1.URLExt.getHostName(wsUrl) }, options), { baseUrl,\n            wsUrl });\n    }\n    Private.makeSettings = makeSettings;\n    /**\n     * Handle a request.\n     *\n     * @param url - The url for the request.\n     *\n     * @param init - The overrides for the request init.\n     *\n     * @param settings - The settings object for the request.\n     *\n     * #### Notes\n     * The `url` must start with `settings.baseUrl`.  The `init` settings\n     * take precedence over `settings.init`.\n     */\n    function handleRequest(url, init, settings) {\n        var _a;\n        // Handle notebook server requests.\n        if (url.indexOf(settings.baseUrl) !== 0) {\n            throw new Error('Can only be used for notebook server requests');\n        }\n        // Use explicit cache buster when `no-store` is set since\n        // not all browsers use it properly.\n        const cache = (_a = init.cache) !== null && _a !== void 0 ? _a : settings.init.cache;\n        if (cache === 'no-store') {\n            // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n            url += (/\\?/.test(url) ? '&' : '?') + new Date().getTime();\n        }\n        const request = new settings.Request(url, Object.assign(Object.assign({}, settings.init), init));\n        // Handle authentication. Authentication can be overdetermined by\n        // settings token and XSRF token.\n        let authenticated = false;\n        if (settings.token) {\n            authenticated = true;\n            request.headers.append('Authorization', `token ${settings.token}`);\n        }\n        if (typeof document !== 'undefined' && (document === null || document === void 0 ? void 0 : document.cookie)) {\n            const xsrfToken = getCookie('_xsrf');\n            if (xsrfToken !== undefined) {\n                authenticated = true;\n                request.headers.append('X-XSRFToken', xsrfToken);\n            }\n        }\n        // Set the content type if there is no given data and we are\n        // using an authenticated connection.\n        if (!request.headers.has('Content-Type') && authenticated) {\n            request.headers.set('Content-Type', 'application/json');\n        }\n        // Use `call` to avoid a `TypeError` in the browser.\n        return settings.fetch.call(null, request).catch((e) => {\n            // Convert the TypeError into a more specific error.\n            throw new ServerConnection.NetworkError(e);\n        });\n        // TODO: *this* is probably where we need a system-wide connectionFailure\n        // signal we can hook into.\n    }\n    Private.handleRequest = handleRequest;\n    /**\n     * Get a cookie from the document.\n     */\n    function getCookie(name) {\n        // From http://www.tornadoweb.org/en/stable/guide/security.html\n        const matches = document.cookie.match('\\\\b' + name + '=([^;]*)\\\\b');\n        return matches === null || matches === void 0 ? void 0 : matches[1];\n    }\n})(Private || (Private = {}));\n//# sourceMappingURL=serverconnection.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/serverconnection.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/session/default.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/session/default.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.SessionConnection = void 0;\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\nconst restapi_1 = __webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/session/restapi.js\");\nconst coreutils_1 = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/**\n * Session object for accessing the session REST api. The session\n * should be used to start kernels and then shut them down -- for\n * all other kernel operations, the kernel object should be used.\n */\nclass SessionConnection {\n    /**\n     * Construct a new session.\n     */\n    constructor(options) {\n        var _a, _b, _c, _d;\n        this._id = '';\n        this._path = '';\n        this._name = '';\n        this._type = '';\n        this._kernel = null;\n        this._isDisposed = false;\n        this._disposed = new signaling_1.Signal(this);\n        this._kernelChanged = new signaling_1.Signal(this);\n        this._statusChanged = new signaling_1.Signal(this);\n        this._connectionStatusChanged = new signaling_1.Signal(this);\n        this._iopubMessage = new signaling_1.Signal(this);\n        this._unhandledMessage = new signaling_1.Signal(this);\n        this._anyMessage = new signaling_1.Signal(this);\n        this._propertyChanged = new signaling_1.Signal(this);\n        this._id = options.model.id;\n        this._name = options.model.name;\n        this._path = options.model.path;\n        this._type = options.model.type;\n        this._username = (_a = options.username) !== null && _a !== void 0 ? _a : '';\n        this._clientId = (_b = options.clientId) !== null && _b !== void 0 ? _b : coreutils_1.UUID.uuid4();\n        this._connectToKernel = options.connectToKernel;\n        this._kernelConnectionOptions = (_c = options.kernelConnectionOptions) !== null && _c !== void 0 ? _c : {};\n        this.serverSettings = (_d = options.serverSettings) !== null && _d !== void 0 ? _d : __1.ServerConnection.makeSettings();\n        this.setupKernel(options.model.kernel);\n    }\n    /**\n     * A signal emitted when the session is disposed.\n     */\n    get disposed() {\n        return this._disposed;\n    }\n    /**\n     * A signal emitted when the kernel changes.\n     */\n    get kernelChanged() {\n        return this._kernelChanged;\n    }\n    /**\n     * A signal proxied from the connection about the kernel status.\n     */\n    get statusChanged() {\n        return this._statusChanged;\n    }\n    /**\n     * A signal proxied from the kernel about the connection status.\n     */\n    get connectionStatusChanged() {\n        return this._connectionStatusChanged;\n    }\n    /**\n     * A signal proxied from the kernel about iopub kernel messages.\n     */\n    get iopubMessage() {\n        return this._iopubMessage;\n    }\n    /**\n     * A signal proxied from the kernel for an unhandled kernel message.\n     */\n    get unhandledMessage() {\n        return this._unhandledMessage;\n    }\n    /**\n     * A signal proxied from the kernel emitted for any kernel message.\n     *\n     * #### Notes\n     * The behavior is undefined if the message is modified during message\n     * handling. As such, it should be treated as read-only.\n     */\n    get anyMessage() {\n        return this._anyMessage;\n    }\n    /**\n     * A signal emitted when a session property changes.\n     */\n    get propertyChanged() {\n        return this._propertyChanged;\n    }\n    /**\n     * Get the session id.\n     */\n    get id() {\n        return this._id;\n    }\n    /**\n     * Get the session kernel connection object.\n     *\n     * #### Notes\n     * This is a read-only property, and can be altered by [changeKernel].\n     */\n    get kernel() {\n        return this._kernel;\n    }\n    /**\n     * Get the session path.\n     */\n    get path() {\n        return this._path;\n    }\n    /**\n     * Get the session type.\n     */\n    get type() {\n        return this._type;\n    }\n    /**\n     * Get the session name.\n     */\n    get name() {\n        return this._name;\n    }\n    /**\n     * Get the model associated with the session.\n     */\n    get model() {\n        return {\n            id: this.id,\n            kernel: this.kernel && { id: this.kernel.id, name: this.kernel.name },\n            path: this._path,\n            type: this._type,\n            name: this._name\n        };\n    }\n    /**\n     * Test whether the session has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Update the session based on a session model from the server.\n     *\n     * #### Notes\n     * This only updates this session connection instance. Use `setPath`,\n     * `setName`, `setType`, and `changeKernel` to change the session values on\n     * the server.\n     */\n    update(model) {\n        const oldModel = this.model;\n        this._path = model.path;\n        this._name = model.name;\n        this._type = model.type;\n        if ((this._kernel === null && model.kernel !== null) ||\n            (this._kernel !== null && model.kernel === null) ||\n            (this._kernel !== null &&\n                model.kernel !== null &&\n                this._kernel.id !== model.kernel.id)) {\n            if (this._kernel !== null) {\n                this._kernel.dispose();\n            }\n            const oldValue = this._kernel || null;\n            this.setupKernel(model.kernel);\n            const newValue = this._kernel || null;\n            this._kernelChanged.emit({ name: 'kernel', oldValue, newValue });\n        }\n        this._handleModelChange(oldModel);\n    }\n    /**\n     * Dispose of the resources held by the session.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        this._disposed.emit();\n        if (this._kernel) {\n            this._kernel.dispose();\n            const oldValue = this._kernel;\n            this._kernel = null;\n            const newValue = this._kernel;\n            this._kernelChanged.emit({ name: 'kernel', oldValue, newValue });\n        }\n        signaling_1.Signal.clearData(this);\n    }\n    /**\n     * Change the session path.\n     *\n     * @param path - The new session path.\n     *\n     * @returns A promise that resolves when the session has renamed.\n     *\n     * #### Notes\n     * This uses the Jupyter REST API, and the response is validated.\n     * The promise is fulfilled on a valid response and rejected otherwise.\n     */\n    async setPath(path) {\n        if (this.isDisposed) {\n            throw new Error('Session is disposed');\n        }\n        await this._patch({ path });\n    }\n    /**\n     * Change the session name.\n     */\n    async setName(name) {\n        if (this.isDisposed) {\n            throw new Error('Session is disposed');\n        }\n        await this._patch({ name });\n    }\n    /**\n     * Change the session type.\n     */\n    async setType(type) {\n        if (this.isDisposed) {\n            throw new Error('Session is disposed');\n        }\n        await this._patch({ type });\n    }\n    /**\n     * Change the kernel.\n     *\n     * @params options - The name or id of the new kernel.\n     *\n     * #### Notes\n     * This shuts down the existing kernel and creates a new kernel,\n     * keeping the existing session ID and session path.\n     */\n    async changeKernel(options) {\n        if (this.isDisposed) {\n            throw new Error('Session is disposed');\n        }\n        await this._patch({ kernel: options });\n        return this.kernel;\n    }\n    /**\n     * Kill the kernel and shutdown the session.\n     *\n     * @returns - The promise fulfilled on a valid response from the server.\n     *\n     * #### Notes\n     * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/sessions), and validates the response.\n     * Disposes of the session and emits a [sessionDied] signal on success.\n     */\n    async shutdown() {\n        if (this.isDisposed) {\n            throw new Error('Session is disposed');\n        }\n        await restapi_1.shutdownSession(this.id, this.serverSettings);\n        this.dispose();\n    }\n    /**\n     * Create a new kernel connection and connect to its signals.\n     *\n     * #### Notes\n     * This method is not meant to be subclassed.\n     */\n    setupKernel(model) {\n        if (model === null) {\n            this._kernel = null;\n            return;\n        }\n        const kc = this._connectToKernel(Object.assign(Object.assign({}, this._kernelConnectionOptions), { model, username: this._username, clientId: this._clientId, serverSettings: this.serverSettings }));\n        this._kernel = kc;\n        kc.statusChanged.connect(this.onKernelStatus, this);\n        kc.connectionStatusChanged.connect(this.onKernelConnectionStatus, this);\n        kc.unhandledMessage.connect(this.onUnhandledMessage, this);\n        kc.iopubMessage.connect(this.onIOPubMessage, this);\n        kc.anyMessage.connect(this.onAnyMessage, this);\n    }\n    /**\n     * Handle to changes in the Kernel status.\n     */\n    onKernelStatus(sender, state) {\n        this._statusChanged.emit(state);\n    }\n    /**\n     * Handle to changes in the Kernel status.\n     */\n    onKernelConnectionStatus(sender, state) {\n        this._connectionStatusChanged.emit(state);\n    }\n    /**\n     * Handle iopub kernel messages.\n     */\n    onIOPubMessage(sender, msg) {\n        this._iopubMessage.emit(msg);\n    }\n    /**\n     * Handle unhandled kernel messages.\n     */\n    onUnhandledMessage(sender, msg) {\n        this._unhandledMessage.emit(msg);\n    }\n    /**\n     * Handle any kernel messages.\n     */\n    onAnyMessage(sender, args) {\n        this._anyMessage.emit(args);\n    }\n    /**\n     * Send a PATCH to the server, updating the session path or the kernel.\n     */\n    async _patch(body) {\n        const model = await restapi_1.updateSession(Object.assign(Object.assign({}, body), { id: this._id }), this.serverSettings);\n        this.update(model);\n        return model;\n    }\n    /**\n     * Handle a change to the model.\n     */\n    _handleModelChange(oldModel) {\n        if (oldModel.name !== this._name) {\n            this._propertyChanged.emit('name');\n        }\n        if (oldModel.type !== this._type) {\n            this._propertyChanged.emit('type');\n        }\n        if (oldModel.path !== this._path) {\n            this._propertyChanged.emit('path');\n        }\n    }\n}\nexports.SessionConnection = SessionConnection;\n//# sourceMappingURL=default.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/session/default.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/session/index.js":
/*!*****************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/session/index.js ***!
  \*****************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.SessionAPI = exports.Session = void 0;\nconst Session = __importStar(__webpack_require__(/*! ./session */ \"../node_modules/@jupyterlab/services/lib/session/session.js\"));\nexports.Session = Session;\nconst SessionAPI = __importStar(__webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/session/restapi.js\"));\nexports.SessionAPI = SessionAPI;\n__exportStar(__webpack_require__(/*! ./manager */ \"../node_modules/@jupyterlab/services/lib/session/manager.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/session/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/session/manager.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/session/manager.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.SessionManager = void 0;\nconst algorithm_1 = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\nconst polling_1 = __webpack_require__(/*! @lumino/polling */ \"webpack/sharing/consume/default/@lumino/polling/@lumino/polling\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\nconst basemanager_1 = __webpack_require__(/*! ../basemanager */ \"../node_modules/@jupyterlab/services/lib/basemanager.js\");\nconst default_1 = __webpack_require__(/*! ./default */ \"../node_modules/@jupyterlab/services/lib/session/default.js\");\nconst restapi_1 = __webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/session/restapi.js\");\n/**\n * An implementation of a session manager.\n */\nclass SessionManager extends basemanager_1.BaseManager {\n    /**\n     * Construct a new session manager.\n     *\n     * @param options - The default options for each session.\n     */\n    constructor(options) {\n        var _a;\n        super(options);\n        this._isReady = false;\n        this._sessionConnections = new Set();\n        this._models = new Map();\n        this._runningChanged = new signaling_1.Signal(this);\n        this._connectionFailure = new signaling_1.Signal(this);\n        // We define these here so they bind `this` correctly\n        this._connectToKernel = (options) => {\n            return this._kernelManager.connectTo(options);\n        };\n        this._kernelManager = options.kernelManager;\n        // Start model polling with exponential backoff.\n        this._pollModels = new polling_1.Poll({\n            auto: false,\n            factory: () => this.requestRunning(),\n            frequency: {\n                interval: 10 * 1000,\n                backoff: true,\n                max: 300 * 1000\n            },\n            name: `@jupyterlab/services:SessionManager#models`,\n            standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n        });\n        // Initialize internal data.\n        this._ready = (async () => {\n            await this._pollModels.start();\n            await this._pollModels.tick;\n            await this._kernelManager.ready;\n            this._isReady = true;\n        })();\n    }\n    /**\n     * Test whether the manager is ready.\n     */\n    get isReady() {\n        return this._isReady;\n    }\n    /**\n     * A promise that fulfills when the manager is ready.\n     */\n    get ready() {\n        return this._ready;\n    }\n    /**\n     * A signal emitted when the running sessions change.\n     */\n    get runningChanged() {\n        return this._runningChanged;\n    }\n    /**\n     * A signal emitted when there is a connection failure.\n     */\n    get connectionFailure() {\n        return this._connectionFailure;\n    }\n    /**\n     * Dispose of the resources used by the manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._models.clear();\n        this._sessionConnections.forEach(x => x.dispose());\n        this._pollModels.dispose();\n        super.dispose();\n    }\n    /*\n     * Connect to a running session.  See also [[connectToSession]].\n     */\n    connectTo(options) {\n        const sessionConnection = new default_1.SessionConnection(Object.assign(Object.assign({}, options), { connectToKernel: this._connectToKernel, serverSettings: this.serverSettings }));\n        this._onStarted(sessionConnection);\n        if (!this._models.has(options.model.id)) {\n            // We trust the user to connect to an existing session, but we verify\n            // asynchronously.\n            void this.refreshRunning().catch(() => {\n                /* no-op */\n            });\n        }\n        return sessionConnection;\n    }\n    /**\n     * Create an iterator over the most recent running sessions.\n     *\n     * @returns A new iterator over the running sessions.\n     */\n    running() {\n        return algorithm_1.iter([...this._models.values()]);\n    }\n    /**\n     * Force a refresh of the running sessions.\n     *\n     * @returns A promise that with the list of running sessions.\n     *\n     * #### Notes\n     * This is not typically meant to be called by the user, since the\n     * manager maintains its own internal state.\n     */\n    async refreshRunning() {\n        await this._pollModels.refresh();\n        await this._pollModels.tick;\n    }\n    /**\n     * Start a new session.  See also [[startNewSession]].\n     *\n     * @param createOptions - Options for creating the session\n     *\n     * @param connectOptions - Options for connecting to the session\n     */\n    async startNew(createOptions, connectOptions = {}) {\n        const model = await restapi_1.startSession(createOptions, this.serverSettings);\n        await this.refreshRunning();\n        return this.connectTo(Object.assign(Object.assign({}, connectOptions), { model }));\n    }\n    /**\n     * Shut down a session by id.\n     */\n    async shutdown(id) {\n        await restapi_1.shutdownSession(id, this.serverSettings);\n        await this.refreshRunning();\n    }\n    /**\n     * Shut down all sessions.\n     *\n     * @returns A promise that resolves when all of the kernels are shut down.\n     */\n    async shutdownAll() {\n        // Update the list of models to make sure our list is current.\n        await this.refreshRunning();\n        // Shut down all models.\n        await Promise.all([...this._models.keys()].map(id => restapi_1.shutdownSession(id, this.serverSettings)));\n        // Update the list of models to clear out our state.\n        await this.refreshRunning();\n    }\n    /**\n     * Find a session associated with a path and stop it if it is the only session\n     * using that kernel.\n     *\n     * @param path - The path in question.\n     *\n     * @returns A promise that resolves when the relevant sessions are stopped.\n     */\n    async stopIfNeeded(path) {\n        try {\n            const sessions = await restapi_1.listRunning(this.serverSettings);\n            const matches = sessions.filter(value => value.path === path);\n            if (matches.length === 1) {\n                const id = matches[0].id;\n                await this.shutdown(id);\n            }\n        }\n        catch (error) {\n            /* Always succeed. */\n        }\n    }\n    /**\n     * Find a session by id.\n     */\n    async findById(id) {\n        if (this._models.has(id)) {\n            return this._models.get(id);\n        }\n        await this.refreshRunning();\n        return this._models.get(id);\n    }\n    /**\n     * Find a session by path.\n     */\n    async findByPath(path) {\n        for (const m of this._models.values()) {\n            if (m.path === path) {\n                return m;\n            }\n        }\n        await this.refreshRunning();\n        for (const m of this._models.values()) {\n            if (m.path === path) {\n                return m;\n            }\n        }\n        return undefined;\n    }\n    /**\n     * Execute a request to the server to poll running kernels and update state.\n     */\n    async requestRunning() {\n        var _a;\n        let models;\n        try {\n            models = await restapi_1.listRunning(this.serverSettings);\n        }\n        catch (err) {\n            // Check for a network error, or a 503 error, which is returned\n            // by a JupyterHub when a server is shut down.\n            if (err instanceof serverconnection_1.ServerConnection.NetworkError ||\n                ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503) {\n                this._connectionFailure.emit(err);\n            }\n            throw err;\n        }\n        if (this.isDisposed) {\n            return;\n        }\n        if (this._models.size === models.length &&\n            algorithm_1.every(models, x => {\n                var _a, _b, _c, _d;\n                const existing = this._models.get(x.id);\n                if (!existing) {\n                    return false;\n                }\n                return (((_a = existing.kernel) === null || _a === void 0 ? void 0 : _a.id) === ((_b = x.kernel) === null || _b === void 0 ? void 0 : _b.id) &&\n                    ((_c = existing.kernel) === null || _c === void 0 ? void 0 : _c.name) === ((_d = x.kernel) === null || _d === void 0 ? void 0 : _d.name) &&\n                    existing.name === x.name &&\n                    existing.path === x.path &&\n                    existing.type === x.type);\n            })) {\n            // Identical models list (presuming models does not contain duplicate\n            // ids), so just return\n            return;\n        }\n        this._models = new Map(models.map(x => [x.id, x]));\n        this._sessionConnections.forEach(sc => {\n            if (this._models.has(sc.id)) {\n                sc.update(this._models.get(sc.id));\n            }\n            else {\n                sc.dispose();\n            }\n        });\n        this._runningChanged.emit(models);\n    }\n    /**\n     * Handle a session starting.\n     */\n    _onStarted(sessionConnection) {\n        this._sessionConnections.add(sessionConnection);\n        sessionConnection.disposed.connect(this._onDisposed, this);\n        sessionConnection.propertyChanged.connect(this._onChanged, this);\n        sessionConnection.kernelChanged.connect(this._onChanged, this);\n    }\n    _onDisposed(sessionConnection) {\n        this._sessionConnections.delete(sessionConnection);\n        // A session termination emission could mean the server session is deleted,\n        // or that the session JS object is disposed and the session still exists on\n        // the server, so we refresh from the server to make sure we reflect the\n        // server state.\n        void this.refreshRunning().catch(() => {\n            /* no-op */\n        });\n    }\n    _onChanged() {\n        void this.refreshRunning().catch(() => {\n            /* no-op */\n        });\n    }\n}\nexports.SessionManager = SessionManager;\n//# sourceMappingURL=manager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/session/manager.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/session/restapi.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/session/restapi.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.updateSession = exports.startSession = exports.getSessionModel = exports.shutdownSession = exports.getSessionUrl = exports.listRunning = exports.SESSION_SERVICE_URL = void 0;\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst validate_1 = __webpack_require__(/*! ./validate */ \"../node_modules/@jupyterlab/services/lib/session/validate.js\");\n/**\n * The url for the session service.\n */\nexports.SESSION_SERVICE_URL = 'api/sessions';\n/**\n * List the running sessions.\n */\nasync function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.SESSION_SERVICE_URL);\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    if (!Array.isArray(data)) {\n        throw new Error('Invalid Session list');\n    }\n    data.forEach(m => {\n        validate_1.updateLegacySessionModel(m);\n        validate_1.validateModel(m);\n    });\n    return data;\n}\nexports.listRunning = listRunning;\n/**\n * Get a session url.\n */\nfunction getSessionUrl(baseUrl, id) {\n    return coreutils_1.URLExt.join(baseUrl, exports.SESSION_SERVICE_URL, id);\n}\nexports.getSessionUrl = getSessionUrl;\n/**\n * Shut down a session by id.\n */\nasync function shutdownSession(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    var _a;\n    const url = getSessionUrl(settings.baseUrl, id);\n    const init = { method: 'DELETE' };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status === 404) {\n        const data = await response.json();\n        const msg = (_a = data.message) !== null && _a !== void 0 ? _a : `The session \"${id}\"\" does not exist on the server`;\n        console.warn(msg);\n    }\n    else if (response.status === 410) {\n        throw new serverconnection_1.ServerConnection.ResponseError(response, 'The kernel was deleted but the session was not');\n    }\n    else if (response.status !== 204) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n}\nexports.shutdownSession = shutdownSession;\n/**\n * Get a full session model from the server by session id string.\n */\nasync function getSessionModel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = getSessionUrl(settings.baseUrl, id);\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.updateLegacySessionModel(data);\n    validate_1.validateModel(data);\n    return data;\n}\nexports.getSessionModel = getSessionModel;\n/**\n * Create a new session, or return an existing session if the session path\n * already exists.\n */\nasync function startSession(options, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.SESSION_SERVICE_URL);\n    const init = {\n        method: 'POST',\n        body: JSON.stringify(options)\n    };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status !== 201) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.updateLegacySessionModel(data);\n    validate_1.validateModel(data);\n    return data;\n}\nexports.startSession = startSession;\n/**\n * Send a PATCH to the server, updating the session path or the kernel.\n */\nasync function updateSession(model, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    const url = getSessionUrl(settings.baseUrl, model.id);\n    const init = {\n        method: 'PATCH',\n        body: JSON.stringify(model)\n    };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    validate_1.updateLegacySessionModel(data);\n    validate_1.validateModel(data);\n    return data;\n}\nexports.updateSession = updateSession;\n//# sourceMappingURL=restapi.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/session/restapi.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/session/session.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/session/session.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=session.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/session/session.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/session/validate.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/session/validate.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateModels = exports.updateLegacySessionModel = exports.validateModel = void 0;\nconst validate_1 = __webpack_require__(/*! ../kernel/validate */ \"../node_modules/@jupyterlab/services/lib/kernel/validate.js\");\nconst validate_2 = __webpack_require__(/*! ../validate */ \"../node_modules/@jupyterlab/services/lib/validate.js\");\n/**\n * Validate an `Session.IModel` object.\n */\nfunction validateModel(data) {\n    validate_2.validateProperty(data, 'id', 'string');\n    validate_2.validateProperty(data, 'type', 'string');\n    validate_2.validateProperty(data, 'name', 'string');\n    validate_2.validateProperty(data, 'path', 'string');\n    validate_2.validateProperty(data, 'kernel', 'object');\n    validate_1.validateModel(data.kernel);\n}\nexports.validateModel = validateModel;\n/**\n * Update model from legacy session data.\n */\nfunction updateLegacySessionModel(data) {\n    if (data.path === undefined && data.notebook !== undefined) {\n        data.path = data.notebook.path;\n        data.type = 'notebook';\n        data.name = '';\n    }\n}\nexports.updateLegacySessionModel = updateLegacySessionModel;\n/**\n * Validate an array of `Session.IModel` objects.\n */\nfunction validateModels(models) {\n    if (!Array.isArray(models)) {\n        throw new Error('Invalid session list');\n    }\n    models.forEach(d => validateModel(d));\n}\nexports.validateModels = validateModels;\n//# sourceMappingURL=validate.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/session/validate.js?");

/***/ }),

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

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.SettingManager = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst statedb_1 = __webpack_require__(/*! @jupyterlab/statedb */ \"webpack/sharing/consume/default/@jupyterlab/statedb/@jupyterlab/statedb\");\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\n/**\n * The url for the lab settings service.\n */\nconst SERVICE_SETTINGS_URL = 'api/settings';\n/**\n * The settings API service manager.\n */\nclass SettingManager extends statedb_1.DataConnector {\n    /**\n     * Create a new setting manager.\n     */\n    constructor(options = {}) {\n        var _a;\n        super();\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n    }\n    /**\n     * Fetch a plugin's settings.\n     *\n     * @param id - The plugin's ID.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async fetch(id) {\n        if (!id) {\n            throw new Error('Plugin `id` parameter is required for settings fetch.');\n        }\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, id);\n        const response = await makeRequest(url, {}, serverSettings);\n        if (response.status !== 200) {\n            const err = await ResponseError.create(response);\n            throw err;\n        }\n        // Assert what type the server response is returning.\n        return response.json();\n    }\n    /**\n     * Fetch the list of all plugin setting bundles.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async list() {\n        var _a, _b;\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, '');\n        const response = await makeRequest(url, {}, serverSettings);\n        if (response.status !== 200) {\n            throw new ResponseError(response);\n        }\n        const json = await response.json();\n        const values = (_b = (_a = json === null || json === void 0 ? void 0 : json['settings']) === null || _a === void 0 ? void 0 : _a.map((plugin) => {\n            plugin.data = { composite: {}, user: {} };\n            return plugin;\n        })) !== null && _b !== void 0 ? _b : [];\n        const ids = values.map(plugin => plugin.id);\n        return { ids, values };\n    }\n    /**\n     * Save a plugin's settings.\n     *\n     * @param id - The plugin's ID.\n     *\n     * @param raw - The user setting values as a raw string of JSON with comments.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async save(id, raw) {\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, id);\n        // NOTE: 'raw' is JSON5 (not valid JSON), so we encode it as a string in a valid JSON body\n        const init = { body: JSON.stringify({ raw }), method: 'PUT' };\n        const response = await makeRequest(url, init, serverSettings);\n        if (response.status !== 204) {\n            throw new ResponseError(response);\n        }\n    }\n}\nexports.SettingManager = SettingManager;\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Get the url for a plugin's settings.\n     */\n    function url(base, id) {\n        return coreutils_1.URLExt.join(base, SERVICE_SETTINGS_URL, id);\n    }\n    Private.url = url;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/setting/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/shim/ws.js":
/*!***********************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/shim/ws.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.default = WebSocket;\n//# sourceMappingURL=ws.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/shim/ws.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/terminal/default.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/terminal/default.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TerminalConnection = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst coreutils_2 = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\nconst restapi_1 = __webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/terminal/restapi.js\");\n/**\n * An implementation of a terminal interface.\n */\nclass TerminalConnection {\n    /**\n     * Construct a new terminal session.\n     */\n    constructor(options) {\n        var _a;\n        /**\n         * Create the terminal websocket connection and add socket status handlers.\n         *\n         * #### Notes\n         * You are responsible for updating the connection status as appropriate.\n         */\n        this._createSocket = () => {\n            this._errorIfDisposed();\n            // Make sure the socket is clear\n            this._clearSocket();\n            // Update the connection status to reflect opening a new connection.\n            this._updateConnectionStatus('connecting');\n            const name = this._name;\n            const settings = this.serverSettings;\n            let url = coreutils_1.URLExt.join(settings.wsUrl, 'terminals', 'websocket', encodeURIComponent(name));\n            // If token authentication is in use.\n            const token = settings.token;\n            if (settings.appendToken && token !== '') {\n                url = url + `?token=${encodeURIComponent(token)}`;\n            }\n            this._ws = new settings.WebSocket(url);\n            this._ws.onmessage = this._onWSMessage;\n            this._ws.onclose = this._onWSClose;\n            this._ws.onerror = this._onWSClose;\n        };\n        // Websocket messages events are defined as variables to bind `this`\n        this._onWSMessage = (event) => {\n            if (this._isDisposed) {\n                return;\n            }\n            const data = JSON.parse(event.data);\n            // Handle a disconnect message.\n            if (data[0] === 'disconnect') {\n                this.dispose();\n            }\n            if (this._connectionStatus === 'connecting') {\n                // After reconnection, ignore all messages until a 'setup' message\n                // before we are truly connected. Setting the connection status to\n                // connected only then means that if we do not get a setup message\n                // before our retry timeout, we will delete the websocket and try again.\n                if (data[0] === 'setup') {\n                    this._updateConnectionStatus('connected');\n                }\n                return;\n            }\n            this._messageReceived.emit({\n                type: data[0],\n                content: data.slice(1)\n            });\n        };\n        this._onWSClose = (event) => {\n            console.warn(`Terminal websocket closed: ${event.code}`);\n            if (!this.isDisposed) {\n                this._reconnect();\n            }\n        };\n        this._connectionStatus = 'connecting';\n        this._connectionStatusChanged = new signaling_1.Signal(this);\n        this._isDisposed = false;\n        this._disposed = new signaling_1.Signal(this);\n        this._messageReceived = new signaling_1.Signal(this);\n        this._reconnectTimeout = null;\n        this._ws = null;\n        this._noOp = () => {\n            /* no-op */\n        };\n        this._reconnectLimit = 7;\n        this._reconnectAttempt = 0;\n        this._pendingMessages = [];\n        this._name = options.model.name;\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();\n        this._createSocket();\n    }\n    /**\n     * A signal emitted when the session is disposed.\n     */\n    get disposed() {\n        return this._disposed;\n    }\n    /**\n     * A signal emitted when a message is received from the server.\n     */\n    get messageReceived() {\n        return this._messageReceived;\n    }\n    /**\n     * Get the name of the terminal session.\n     */\n    get name() {\n        return this._name;\n    }\n    /**\n     * Get the model for the terminal session.\n     */\n    get model() {\n        return { name: this._name };\n    }\n    /**\n     * Test whether the session is disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources held by the session.\n     */\n    dispose() {\n        if (this._isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        this._disposed.emit();\n        this._updateConnectionStatus('disconnected');\n        this._clearSocket();\n        signaling_1.Signal.clearData(this);\n    }\n    /**\n     * Send a message to the terminal session.\n     *\n     * #### Notes\n     * If the connection is down, the message will be queued for sending when\n     * the connection comes back up.\n     */\n    send(message) {\n        this._sendMessage(message);\n    }\n    /**\n     * Send a message on the websocket, or possibly queue for later sending.\n     *\n     * @param queue - whether to queue the message if it cannot be sent\n     */\n    _sendMessage(message, queue = true) {\n        if (this._isDisposed || !message.content) {\n            return;\n        }\n        if (this.connectionStatus === 'connected' && this._ws) {\n            const msg = [message.type, ...message.content];\n            this._ws.send(JSON.stringify(msg));\n        }\n        else if (queue) {\n            this._pendingMessages.push(message);\n        }\n        else {\n            throw new Error(`Could not send message: ${JSON.stringify(message)}`);\n        }\n    }\n    /**\n     * Send pending messages to the kernel.\n     */\n    _sendPending() {\n        // We check to make sure we are still connected each time. For\n        // example, if a websocket buffer overflows, it may close, so we should\n        // stop sending messages.\n        while (this.connectionStatus === 'connected' &&\n            this._pendingMessages.length > 0) {\n            this._sendMessage(this._pendingMessages[0], false);\n            // We shift the message off the queue after the message is sent so that\n            // if there is an exception, the message is still pending.\n            this._pendingMessages.shift();\n        }\n    }\n    /**\n     * Reconnect to a terminal.\n     *\n     * #### Notes\n     * This may try multiple times to reconnect to a terminal, and will sever\n     * any existing connection.\n     */\n    reconnect() {\n        this._errorIfDisposed();\n        const result = new coreutils_2.PromiseDelegate();\n        // Set up a listener for the connection status changing, which accepts or\n        // rejects after the retries are done.\n        const fulfill = (sender, status) => {\n            if (status === 'connected') {\n                result.resolve();\n                this.connectionStatusChanged.disconnect(fulfill, this);\n            }\n            else if (status === 'disconnected') {\n                result.reject(new Error('Terminal connection disconnected'));\n                this.connectionStatusChanged.disconnect(fulfill, this);\n            }\n        };\n        this.connectionStatusChanged.connect(fulfill, this);\n        // Reset the reconnect limit so we start the connection attempts fresh\n        this._reconnectAttempt = 0;\n        // Start the reconnection process, which will also clear any existing\n        // connection.\n        this._reconnect();\n        // Return the promise that should resolve on connection or reject if the\n        // retries don't work.\n        return result.promise;\n    }\n    /**\n     * Attempt a connection if we have not exhausted connection attempts.\n     */\n    _reconnect() {\n        this._errorIfDisposed();\n        // Clear any existing reconnection attempt\n        clearTimeout(this._reconnectTimeout);\n        // Update the connection status and schedule a possible reconnection.\n        if (this._reconnectAttempt < this._reconnectLimit) {\n            this._updateConnectionStatus('connecting');\n            // The first reconnect attempt should happen immediately, and subsequent\n            // attempts should pick a random number in a growing range so that we\n            // don't overload the server with synchronized reconnection attempts\n            // across multiple kernels.\n            const timeout = Private.getRandomIntInclusive(0, 1e3 * (Math.pow(2, this._reconnectAttempt) - 1));\n            console.error(`Connection lost, reconnecting in ${Math.floor(timeout / 1000)} seconds.`);\n            this._reconnectTimeout = setTimeout(this._createSocket, timeout);\n            this._reconnectAttempt += 1;\n        }\n        else {\n            this._updateConnectionStatus('disconnected');\n        }\n        // Clear the websocket event handlers and the socket itself.\n        this._clearSocket();\n    }\n    /**\n     * Forcefully clear the socket state.\n     *\n     * #### Notes\n     * This will clear all socket state without calling any handlers and will\n     * not update the connection status. If you call this method, you are\n     * responsible for updating the connection status as needed and recreating\n     * the socket if you plan to reconnect.\n     */\n    _clearSocket() {\n        if (this._ws !== null) {\n            // Clear the websocket event handlers and the socket itself.\n            this._ws.onopen = this._noOp;\n            this._ws.onclose = this._noOp;\n            this._ws.onerror = this._noOp;\n            this._ws.onmessage = this._noOp;\n            this._ws.close();\n            this._ws = null;\n        }\n    }\n    /**\n     * Shut down the terminal session.\n     */\n    async shutdown() {\n        await restapi_1.shutdownTerminal(this.name, this.serverSettings);\n        this.dispose();\n    }\n    /**\n     * Clone the current terminal connection.\n     */\n    clone() {\n        return new TerminalConnection(this);\n    }\n    /**\n     * Handle connection status changes.\n     */\n    _updateConnectionStatus(connectionStatus) {\n        if (this._connectionStatus === connectionStatus) {\n            return;\n        }\n        this._connectionStatus = connectionStatus;\n        // If we are not 'connecting', stop any reconnection attempts.\n        if (connectionStatus !== 'connecting') {\n            this._reconnectAttempt = 0;\n            clearTimeout(this._reconnectTimeout);\n        }\n        // Send the pending messages if we just connected.\n        if (connectionStatus === 'connected') {\n            this._sendPending();\n        }\n        // Notify others that the connection status changed.\n        this._connectionStatusChanged.emit(connectionStatus);\n    }\n    /**\n     * Utility function to throw an error if this instance is disposed.\n     */\n    _errorIfDisposed() {\n        if (this.isDisposed) {\n            throw new Error('Terminal connection is disposed');\n        }\n    }\n    /**\n     * A signal emitted when the terminal connection status changes.\n     */\n    get connectionStatusChanged() {\n        return this._connectionStatusChanged;\n    }\n    /**\n     * The current connection status of the terminal connection.\n     */\n    get connectionStatus() {\n        return this._connectionStatus;\n    }\n}\nexports.TerminalConnection = TerminalConnection;\nvar Private;\n(function (Private) {\n    /**\n     * Get the url for a terminal.\n     */\n    function getTermUrl(baseUrl, name) {\n        return coreutils_1.URLExt.join(baseUrl, restapi_1.TERMINAL_SERVICE_URL, encodeURIComponent(name));\n    }\n    Private.getTermUrl = getTermUrl;\n    /**\n     * Get a random integer between min and max, inclusive of both.\n     *\n     * #### Notes\n     * From\n     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive\n     *\n     * From the MDN page: It might be tempting to use Math.round() to accomplish\n     * that, but doing so would cause your random numbers to follow a non-uniform\n     * distribution, which may not be acceptable for your needs.\n     */\n    function getRandomIntInclusive(min, max) {\n        min = Math.ceil(min);\n        max = Math.floor(max);\n        return Math.floor(Math.random() * (max - min + 1)) + min;\n    }\n    Private.getRandomIntInclusive = getRandomIntInclusive;\n})(Private || (Private = {}));\n//# sourceMappingURL=default.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/terminal/default.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/terminal/index.js":
/*!******************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/terminal/index.js ***!
  \******************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TerminalAPI = exports.Terminal = void 0;\nconst Terminal = __importStar(__webpack_require__(/*! ./terminal */ \"../node_modules/@jupyterlab/services/lib/terminal/terminal.js\"));\nexports.Terminal = Terminal;\nconst TerminalAPI = __importStar(__webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/terminal/restapi.js\"));\nexports.TerminalAPI = TerminalAPI;\n__exportStar(__webpack_require__(/*! ./manager */ \"../node_modules/@jupyterlab/services/lib/terminal/manager.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/terminal/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/terminal/manager.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/terminal/manager.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TerminalManager = void 0;\nconst algorithm_1 = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\nconst polling_1 = __webpack_require__(/*! @lumino/polling */ \"webpack/sharing/consume/default/@lumino/polling/@lumino/polling\");\nconst signaling_1 = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\nconst __1 = __webpack_require__(/*! .. */ \"../node_modules/@jupyterlab/services/lib/index.js\");\nconst basemanager_1 = __webpack_require__(/*! ../basemanager */ \"../node_modules/@jupyterlab/services/lib/basemanager.js\");\nconst restapi_1 = __webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/terminal/restapi.js\");\nconst default_1 = __webpack_require__(/*! ./default */ \"../node_modules/@jupyterlab/services/lib/terminal/default.js\");\n/**\n * A terminal session manager.\n */\nclass TerminalManager extends basemanager_1.BaseManager {\n    /**\n     * Construct a new terminal manager.\n     */\n    constructor(options = {}) {\n        var _a;\n        super(options);\n        this._isReady = false;\n        // As an optimization, we unwrap the models to just store the names.\n        this._names = [];\n        this._terminalConnections = new Set();\n        this._runningChanged = new signaling_1.Signal(this);\n        this._connectionFailure = new signaling_1.Signal(this);\n        // Check if terminals are available\n        if (!this.isAvailable()) {\n            this._ready = Promise.reject('Terminals unavailable');\n            this._ready.catch(_ => undefined);\n            return;\n        }\n        // Start polling with exponential backoff.\n        this._pollModels = new polling_1.Poll({\n            auto: false,\n            factory: () => this.requestRunning(),\n            frequency: {\n                interval: 10 * 1000,\n                backoff: true,\n                max: 300 * 1000\n            },\n            name: `@jupyterlab/services:TerminalManager#models`,\n            standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n        });\n        // Initialize internal data.\n        this._ready = (async () => {\n            await this._pollModels.start();\n            await this._pollModels.tick;\n            this._isReady = true;\n        })();\n    }\n    /**\n     * Test whether the manager is ready.\n     */\n    get isReady() {\n        return this._isReady;\n    }\n    /**\n     * A promise that fulfills when the manager is ready.\n     */\n    get ready() {\n        return this._ready;\n    }\n    /**\n     * A signal emitted when the running terminals change.\n     */\n    get runningChanged() {\n        return this._runningChanged;\n    }\n    /**\n     * A signal emitted when there is a connection failure.\n     */\n    get connectionFailure() {\n        return this._connectionFailure;\n    }\n    /**\n     * Dispose of the resources used by the manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._names.length = 0;\n        this._terminalConnections.forEach(x => x.dispose());\n        this._pollModels.dispose();\n        super.dispose();\n    }\n    /**\n     * Whether the terminal service is available.\n     */\n    isAvailable() {\n        return restapi_1.isAvailable();\n    }\n    /*\n     * Connect to a running terminal.\n     *\n     * @param name - The name of the target terminal.\n     *\n     * @param options - The options used to connect to the terminal.\n     *\n     * @returns A promise that resolves to the new terminal connection instance.\n     *\n     * #### Notes\n     * The manager `serverSettings` will be used.\n     */\n    connectTo(options) {\n        const terminalConnection = new default_1.TerminalConnection(Object.assign(Object.assign({}, options), { serverSettings: this.serverSettings }));\n        this._onStarted(terminalConnection);\n        if (!this._names.includes(options.model.name)) {\n            // We trust the user to connect to an existing session, but we verify\n            // asynchronously.\n            void this.refreshRunning().catch(() => {\n                /* no-op */\n            });\n        }\n        return terminalConnection;\n    }\n    /**\n     * Create an iterator over the most recent running terminals.\n     *\n     * @returns A new iterator over the running terminals.\n     */\n    running() {\n        return algorithm_1.iter(this._models);\n    }\n    /**\n     * Force a refresh of the running terminals.\n     *\n     * @returns A promise that with the list of running terminals.\n     *\n     * #### Notes\n     * This is intended to be called only in response to a user action,\n     * since the manager maintains its internal state.\n     */\n    async refreshRunning() {\n        await this._pollModels.refresh();\n        await this._pollModels.tick;\n    }\n    /**\n     * Create a new terminal session.\n     *\n     * @returns A promise that resolves with the terminal instance.\n     *\n     * #### Notes\n     * The manager `serverSettings` will be used unless overridden in the\n     * options.\n     */\n    async startNew() {\n        const model = await restapi_1.startNew(this.serverSettings);\n        await this.refreshRunning();\n        return this.connectTo({ model });\n    }\n    /**\n     * Shut down a terminal session by name.\n     */\n    async shutdown(name) {\n        await restapi_1.shutdownTerminal(name, this.serverSettings);\n        await this.refreshRunning();\n    }\n    /**\n     * Shut down all terminal sessions.\n     *\n     * @returns A promise that resolves when all of the sessions are shut down.\n     */\n    async shutdownAll() {\n        // Update the list of models to make sure our list is current.\n        await this.refreshRunning();\n        // Shut down all models.\n        await Promise.all(this._names.map(name => restapi_1.shutdownTerminal(name, this.serverSettings)));\n        // Update the list of models to clear out our state.\n        await this.refreshRunning();\n    }\n    /**\n     * Execute a request to the server to poll running terminals and update state.\n     */\n    async requestRunning() {\n        var _a;\n        let models;\n        try {\n            models = await restapi_1.listRunning(this.serverSettings);\n        }\n        catch (err) {\n            // Check for a network error, or a 503 error, which is returned\n            // by a JupyterHub when a server is shut down.\n            if (err instanceof __1.ServerConnection.NetworkError ||\n                ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503) {\n                this._connectionFailure.emit(err);\n            }\n            throw err;\n        }\n        if (this.isDisposed) {\n            return;\n        }\n        const names = models.map(({ name }) => name).sort();\n        if (names === this._names) {\n            // Identical models list, so just return\n            return;\n        }\n        this._names = names;\n        this._terminalConnections.forEach(tc => {\n            if (!names.includes(tc.name)) {\n                tc.dispose();\n            }\n        });\n        this._runningChanged.emit(this._models);\n    }\n    /**\n     * Handle a session starting.\n     */\n    _onStarted(terminalConnection) {\n        this._terminalConnections.add(terminalConnection);\n        terminalConnection.disposed.connect(this._onDisposed, this);\n    }\n    /**\n     * Handle a session terminating.\n     */\n    _onDisposed(terminalConnection) {\n        this._terminalConnections.delete(terminalConnection);\n        // Update the running models to make sure we reflect the server state\n        void this.refreshRunning().catch(() => {\n            /* no-op */\n        });\n    }\n    get _models() {\n        return this._names.map(name => {\n            return { name };\n        });\n    }\n}\nexports.TerminalManager = TerminalManager;\n//# sourceMappingURL=manager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/terminal/manager.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/terminal/restapi.js":
/*!********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/terminal/restapi.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.shutdownTerminal = exports.listRunning = exports.startNew = exports.isAvailable = exports.TERMINAL_SERVICE_URL = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\n/**\n * The url for the terminal service.\n */\nexports.TERMINAL_SERVICE_URL = 'api/terminals';\n/**\n * Whether the terminal service is available.\n */\nfunction isAvailable() {\n    const available = String(coreutils_1.PageConfig.getOption('terminalsAvailable'));\n    return available.toLowerCase() === 'true';\n}\nexports.isAvailable = isAvailable;\n/**\n * Start a new terminal session.\n *\n * @param options - The session options to use.\n *\n * @returns A promise that resolves with the session instance.\n */\nasync function startNew(settings = serverconnection_1.ServerConnection.makeSettings()) {\n    Private.errorIfNotAvailable();\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);\n    const init = { method: 'POST' };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    // TODO: Validate model\n    return data;\n}\nexports.startNew = startNew;\n/**\n * List the running terminal sessions.\n *\n * @param settings - The server settings to use.\n *\n * @returns A promise that resolves with the list of running session models.\n */\nasync function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {\n    Private.errorIfNotAvailable();\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n    if (response.status !== 200) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n    const data = await response.json();\n    if (!Array.isArray(data)) {\n        throw new Error('Invalid terminal list');\n    }\n    // TODO: validate each model\n    return data;\n}\nexports.listRunning = listRunning;\n/**\n * Shut down a terminal session by name.\n *\n * @param name - The name of the target session.\n *\n * @param settings - The server settings to use.\n *\n * @returns A promise that resolves when the session is shut down.\n */\nasync function shutdownTerminal(name, settings = serverconnection_1.ServerConnection.makeSettings()) {\n    var _a;\n    Private.errorIfNotAvailable();\n    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL, name);\n    const init = { method: 'DELETE' };\n    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n    if (response.status === 404) {\n        const data = await response.json();\n        const msg = (_a = data.message) !== null && _a !== void 0 ? _a : `The terminal session \"${name}\"\" does not exist on the server`;\n        console.warn(msg);\n    }\n    else if (response.status !== 204) {\n        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n        throw err;\n    }\n}\nexports.shutdownTerminal = shutdownTerminal;\nvar Private;\n(function (Private) {\n    /**\n     * Throw an error if terminals are not available.\n     */\n    function errorIfNotAvailable() {\n        if (!isAvailable()) {\n            throw new Error('Terminals Unavailable');\n        }\n    }\n    Private.errorIfNotAvailable = errorIfNotAvailable;\n})(Private || (Private = {}));\n//# sourceMappingURL=restapi.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/terminal/restapi.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/terminal/terminal.js":
/*!*********************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/terminal/terminal.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isAvailable = void 0;\nconst restapi_1 = __webpack_require__(/*! ./restapi */ \"../node_modules/@jupyterlab/services/lib/terminal/restapi.js\");\nObject.defineProperty(exports, \"isAvailable\", ({ enumerable: true, get: function () { return restapi_1.isAvailable; } }));\n//# sourceMappingURL=terminal.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/terminal/terminal.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/services/lib/validate.js":
/*!************************************************************!*\
  !*** ../node_modules/@jupyterlab/services/lib/validate.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateProperty = void 0;\n/**\n * Validate a property as being on an object, and optionally\n * of a given type and among a given set of values.\n */\nfunction validateProperty(object, name, typeName, values = []) {\n    if (!object.hasOwnProperty(name)) {\n        throw Error(`Missing property '${name}'`);\n    }\n    const value = object[name];\n    if (typeName !== void 0) {\n        let valid = true;\n        switch (typeName) {\n            case 'array':\n                valid = Array.isArray(value);\n                break;\n            case 'object':\n                valid = typeof value !== 'undefined';\n                break;\n            default:\n                valid = typeof value === typeName;\n        }\n        if (!valid) {\n            throw new Error(`Property '${name}' is not of type '${typeName}'`);\n        }\n        if (values.length > 0) {\n            let valid = true;\n            switch (typeName) {\n                case 'string':\n                case 'number':\n                case 'boolean':\n                    valid = values.includes(value);\n                    break;\n                default:\n                    valid = values.findIndex(v => v === value) >= 0;\n                    break;\n            }\n            if (!valid) {\n                throw new Error(`Property '${name}' is not one of the valid values ${JSON.stringify(values)}`);\n            }\n        }\n    }\n}\nexports.validateProperty = validateProperty;\n//# sourceMappingURL=validate.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/validate.js?");

/***/ }),

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

"use strict";
eval("\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.WorkspaceManager = void 0;\nconst coreutils_1 = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\nconst statedb_1 = __webpack_require__(/*! @jupyterlab/statedb */ \"webpack/sharing/consume/default/@jupyterlab/statedb/@jupyterlab/statedb\");\nconst serverconnection_1 = __webpack_require__(/*! ../serverconnection */ \"../node_modules/@jupyterlab/services/lib/serverconnection.js\");\n/**\n * The url for the lab workspaces service.\n */\nconst SERVICE_WORKSPACES_URL = 'api/workspaces';\n/**\n * The workspaces API service manager.\n */\nclass WorkspaceManager extends statedb_1.DataConnector {\n    /**\n     * Create a new workspace manager.\n     */\n    constructor(options = {}) {\n        var _a;\n        super();\n        this.serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n    }\n    /**\n     * Fetch a workspace.\n     *\n     * @param id - The workspace's ID.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async fetch(id) {\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, id);\n        const response = await makeRequest(url, {}, serverSettings);\n        if (response.status !== 200) {\n            const err = await ResponseError.create(response);\n            throw err;\n        }\n        return response.json();\n    }\n    /**\n     * Fetch the list of workspace IDs that exist on the server.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async list() {\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, '');\n        const response = await makeRequest(url, {}, serverSettings);\n        if (response.status !== 200) {\n            const err = await ResponseError.create(response);\n            throw err;\n        }\n        const result = await response.json();\n        return result.workspaces;\n    }\n    /**\n     * Remove a workspace from the server.\n     *\n     * @param id - The workspaces's ID.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async remove(id) {\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, id);\n        const init = { method: 'DELETE' };\n        const response = await makeRequest(url, init, serverSettings);\n        if (response.status !== 204) {\n            const err = await ResponseError.create(response);\n            throw err;\n        }\n    }\n    /**\n     * Save a workspace.\n     *\n     * @param id - The workspace's ID.\n     *\n     * @param workspace - The workspace being saved.\n     *\n     * @returns A promise that resolves if successful.\n     */\n    async save(id, workspace) {\n        const { serverSettings } = this;\n        const { baseUrl, appUrl } = serverSettings;\n        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n        const base = baseUrl + appUrl;\n        const url = Private.url(base, id);\n        const init = { body: JSON.stringify(workspace), method: 'PUT' };\n        const response = await makeRequest(url, init, serverSettings);\n        if (response.status !== 204) {\n            const err = await ResponseError.create(response);\n            throw err;\n        }\n    }\n}\nexports.WorkspaceManager = WorkspaceManager;\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Get the url for a workspace.\n     */\n    function url(base, id) {\n        return coreutils_1.URLExt.join(base, SERVICE_WORKSPACES_URL, id);\n    }\n    Private.url = url;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/services/lib/workspace/index.js?");

/***/ }),

/***/ "../node_modules/process/browser.js":
/*!******************************************!*\
  !*** ../node_modules/process/browser.js ***!
  \******************************************/
/***/ ((module) => {

eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/process/browser.js?");

/***/ })

}]);