"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
var loading_1 = __importDefault(require("components/share/loading"));
var register_1 = __importDefault(require("../register"));
var edit_table_1 = __importDefault(require("lib/hooks/edit-table"));
var desc = {
    confirm_close: "You can make CoCalc always ask for confirmation before closing a browser tab viewing a project.\nEnable this if you have issues with accidentally closing the CoCalc browser tab.\nThis shouldn't be necessary, since it's unlikely you will loose work if you close\nthe tab; also when you reopen CoCalc everything should be exactly as you left it.",
    katex: "\nThe default is to always attempt to render formulas with KaTeX if possible, but you can\nuncheck the box below to use MathJax version 2 by default when possible.  KaTeX is faster than\nMathJax v2, but there are edge cases that MathJax supports but KaTeX doesn't,\noften only for historical reasons; also, MathJax has a useful context menu.\n(Some parts of CoCalc only support KaTeX no matter what you select here.)\n",
    standby_timeout_m: "\nIf you are not active for several minutes, you may see the gray and blue CoCalc splash screen\nand your browser will minimize resource usage.  The time until the splash screen appears is the\nstandby timeout, which you can adjust below.  We use it to conserve resources, mainly network\nbandwidth and browser CPU cycles. Execution of your code is NOT paused during standby.\n",
    show_global_info2: "\nSometimes there are important announcements about CoCalc, e.g., if there is a major\nupdate available.  You can hide these if you do not want to see them at the top of\nthe screen for some reason.\n",
};
(0, register_1.default)({
    path: "system/behavior",
    title: "Behavior",
    icon: "circle",
    desc: "Configure general behavior of CoCalc, including idle timeout, math rendering, and whether to ask for confirmation before closing the browser window.",
    search: desc,
    Component: function () {
        var _a = (0, edit_table_1.default)({
            accounts: { other_settings: null },
        }), edited = _a.edited, original = _a.original, Save = _a.Save, EditBoolean = _a.EditBoolean, EditNumber = _a.EditNumber;
        if (original == null || edited == null) {
            return (0, jsx_runtime_1.jsx)(loading_1.default, {});
        }
        return ((0, jsx_runtime_1.jsxs)(antd_1.Space, __assign({ direction: "vertical" }, { children: [(0, jsx_runtime_1.jsx)(Save, {}), (0, jsx_runtime_1.jsx)(EditNumber, { icon: "ban", path: "other_settings.standby_timeout_m", title: "Standby Timeout", desc: desc.standby_timeout_m, min: 1, max: 180, units: "minutes" }), (0, jsx_runtime_1.jsx)(EditBoolean, { path: "other_settings.katex", icon: "tex", title: "Math Rendering: KaTeX versus MathJax", desc: desc.katex, label: "Attempt to use KaTeX if at all possible" }), (0, jsx_runtime_1.jsx)(EditBoolean, { icon: "times-circle", path: "other_settings.confirm_close", title: "Confirmation before closing browser tab", desc: desc.confirm_close, label: "Ask for confirmation" })] })));
    },
});
//# sourceMappingURL=behavior.js.map