"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServerSideProps = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const footer_1 = __importDefault(require("components/landing/footer"));
const header_1 = __importDefault(require("components/landing/header"));
const head_1 = __importDefault(require("components/landing/head"));
const antd_1 = require("antd");
const with_customize_1 = __importDefault(require("lib/with-customize"));
const customize_1 = require("lib/customize");
const A_1 = __importDefault(require("components/misc/A"));
const icon_1 = require("@cocalc/frontend/components/icon");
const index_list_1 = __importDefault(require("components/landing/index-list"));
const config_1 = require("lib/config");
const dataSource = [
    {
        link: "https://doc.cocalc.com/",
        title: "Browse the CoCalc Manual",
        logo: "book",
        image: "https://doc.cocalc.com/_static/cocalc-doc-logo.svg",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The reference manual explains the major functionality of CoCalc in depth. In particular, it contains the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/teaching-instructors.html", children: "Instructor Guide" }), ", which explains how to integrate CoCalc with teaching a course, it documents", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/project.html", children: "configuring and using projects in CoCalc" }), ", explains how to", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/howto/index.html", children: "install your own software," }), "and how to", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/api/", children: "embed and control CoCalc via the API" }), "."] })),
    },
    {
        landingPages: true,
        link: "https://github.com/sagemathinc/cocalc-desktop#readme",
        title: "Install the CoCalc Desktop Application",
        logo: "laptop",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["If you're having browser compatibility issues with CoCalc, you can try installing the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://github.com/sagemathinc/cocalc-desktop#readme", children: "CoCalc desktop application for Windows and MacOS" }), ". This is a lightweight application that connects to the main cocalc.com site, but is completely separate from your web browser."] })),
    },
    {
        landingPages: true,
        link: "/pricing/onprem",
        title: "Install CoCalc on Your Own Server or Cluster",
        logo: "server",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["It is possible to", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/pricing/onprem", children: "fully run your own commercially supported instance of CoCalc" }), " ", "on anything from your laptop to a large Kubernetes cluster."] })),
    },
];
function Help({ customize }) {
    const { contactEmail } = customize;
    let data = dataSource;
    if (contactEmail) {
        const link = `mailto:${contactEmail}`;
        data = [
            {
                logo: "envelope",
                link,
                title: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("b", { children: ["Email us at ", contactEmail] }) })),
                description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["If you have a question or problem, please send an email to", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: link, children: contactEmail }), ". Be as specific as you can. In particular, include URL's of relevant files!"] })),
            },
        ].concat(dataSource);
    }
    return ((0, jsx_runtime_1.jsxs)(customize_1.Customize, { value: customize, children: [(0, jsx_runtime_1.jsx)(head_1.default, { title: "CoCalc Documentation" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout, { children: [(0, jsx_runtime_1.jsx)(header_1.default, { page: "info", subPage: "doc" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout.Content, { style: {
                            backgroundColor: "white",
                        }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
                                    maxWidth: config_1.MAX_WIDTH,
                                    margin: "15px auto",
                                    padding: "15px",
                                    backgroundColor: "white",
                                }, children: (0, jsx_runtime_1.jsx)(index_list_1.default, { title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "life-saver", style: { marginRight: "30px" } }), "CoCalc - Documentation"] }), description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "There are many ways that you can connect with the broader CoCalc community." }), dataSource: data }) }), (0, jsx_runtime_1.jsx)(footer_1.default, {})] })] })] }));
}
exports.default = Help;
async function getServerSideProps(context) {
    return await (0, with_customize_1.default)({ context });
}
exports.getServerSideProps = getServerSideProps;
//# sourceMappingURL=doc.js.map