"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const register_1 = __importDefault(require("../register"));
const antd_1 = require("antd");
const loading_1 = __importDefault(require("components/share/loading"));
const A_1 = __importDefault(require("components/misc/A"));
const edit_table_1 = __importDefault(require("lib/hooks/edit-table"));
const theme_1 = require("@cocalc/util/theme");
const desc = {
    jupyter_line_numbers: `Display line numbers to the left of input cells in Jupyter notebooks.`,
    ask_jupyter_kernel: `Each time you create a new Jupyter notebook, by default it will ask which kernel to use.
If you disable this option, then new notebooks will open using the kernel that you most recently explicitly
selected.  You can of course change the kernel of any notebook at any time in the Kernel dropdown menu.`,
    disable_jupyter_virtualization: `By default Jupyter notebooks are rendered using "virtualization" or "windowing", so only the visible cells are actually rendered.   If you select this option, then we instead render entire notebook. This is potentially much slower but may address some subtle issues.  You must close and open your notebook to see the change.`,
    jupyter_classic: `CoCalc includes a mode where it embeds
the classical Jupyter notebook in an iframe and installs a plugin to enable realtime collaboration.
However, collaboration does not work as well as in the default Jupyter editor.`,
};
(0, register_1.default)({
    path: "editor/jupyter",
    title: "Jupyter Notebooks",
    icon: "ipynb",
    desc: "Configuration options specific to Jupyter notebooks, e.g., line numbers for input cells or asking for the kernel for new notebooks.",
    search: desc,
    Component: () => {
        const { edited, original, Save, EditBoolean } = (0, edit_table_1.default)({
            accounts: { editor_settings: null },
        });
        if (original == null || edited == null) {
            return (0, jsx_runtime_1.jsx)(loading_1.default, {});
        }
        return ((0, jsx_runtime_1.jsxs)(antd_1.Space, { direction: "vertical", style: { width: "100%" }, children: [(0, jsx_runtime_1.jsx)(Save, {}), (0, jsx_runtime_1.jsx)(EditBoolean, { icon: "list-ol", path: "editor_settings.jupyter_line_numbers", title: "Line Numbers", desc: desc.jupyter_line_numbers, label: "Line numbers" }), (0, jsx_runtime_1.jsx)(EditBoolean, { icon: "question-circle", path: "editor_settings.ask_jupyter_kernel", title: "New Notebook Kernel", desc: desc.ask_jupyter_kernel, label: "Ask which kernel to use" }), " ", (0, jsx_runtime_1.jsx)(EditBoolean, { icon: "list", path: "editor_settings.disable_jupyter_virtualization", title: "Disable Jupyter Virtualization", desc: desc.disable_jupyter_virtualization, label: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["No virtualization -- render entire notebook rather than rendering just the visible part of it using", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://virtuoso.dev/", children: "react-virtuoso" }), "."] }) }), " ", (0, jsx_runtime_1.jsx)(EditBoolean, { icon: "ipynb", path: "editor_settings.jupyter_classic", title: "Jupyter Classic", desc: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [desc.jupyter_classic, " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: theme_1.JUPYTER_CLASSIC_MODERN, children: "(DANGER: this can cause trouble...)" }), " ", "You can also", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/jupyter.html#alternatives-plain-jupyter-server-and-jupyterlab-server", children: "very easily use a standard JupyterLab or Jupyter classic server" }), " ", "from any CoCalc project, without changing this setting."] }), label: "Use Jupyter classic" }), " "] }));
    },
});
//# sourceMappingURL=jupyter.js.map