"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");
/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var antd_1 = require("antd");
var A_1 = __importDefault(require("components/misc/A"));
var base_path_1 = __importDefault(require("lib/base-path"));
var customize_1 = require("lib/customize");
var router_1 = require("next/router");
var path_1 = require("path");
var STYLE = {
    textAlign: "center",
    padding: "30px 15px 0 15px",
};
function SignIn(_a) {
    var startup = _a.startup, hideFree = _a.hideFree;
    var _b = (0, customize_1.useCustomize)(), anonymousSignup = _b.anonymousSignup, siteName = _b.siteName, account = _b.account;
    var router = (0, router_1.useRouter)();
    if (account != null) {
        return ((0, jsx_runtime_1.jsx)("div", __assign({ style: STYLE }, { children: (0, jsx_runtime_1.jsxs)(A_1.default, __assign({ className: "ant-btn", href: (0, path_1.join)(base_path_1.default, "projects"), external: true, style: { margin: "15px", fontSize: "14pt" }, title: "Open the ".concat(siteName, " app and view your projects") }, { children: ["View Your ", siteName, " Projects..."] })) })));
    }
    return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: STYLE }, { children: [anonymousSignup && ((0, jsx_runtime_1.jsxs)(antd_1.Button, __assign({ size: "large", type: "primary", style: { margin: "10px" }, title: "Try now without creating an account!", onClick: function () { return router.push("/auth/try"); } }, { children: ["Try\u00A0", startup !== null && startup !== void 0 ? startup : siteName, "\u00A0Now"] }))), (0, jsx_runtime_1.jsx)(antd_1.Button, __assign({ size: "large", style: { margin: "10px" }, title: "Either create a new account or sign into an existing account.", onClick: function () { return router.push("/auth/sign-in"); } }, { children: "Sign In" })), (0, jsx_runtime_1.jsx)(antd_1.Button, __assign({ size: "large", style: { margin: "10px" }, title: "Create a new account.", onClick: function () { return router.push("/auth/sign-up"); } }, { children: "Sign Up" })), !hideFree && ((0, jsx_runtime_1.jsx)("div", __assign({ style: { padding: "15px 0 30px 0" } }, { children: "Start free today. Upgrade later." })))] })));
}
exports.default = SignIn;
//# sourceMappingURL=sign-in.js.map