"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");
/*
The config page for anonymous users.  An anonymous user *is* signed in using a full account.
This page does belong in configuration -- it's about taking the steps to convert their
anonymous account into a full account so they won't lose their work.  Most important
is an email address or SSO sign on link.

Non-anonymous users get the layout page.
*/
const site_name_1 = __importDefault(require("components/share/site-name"));
const antd_1 = require("antd");
const icon_1 = require("@cocalc/frontend/components/icon");
const post_1 = __importDefault(require("lib/api/post"));
const router_1 = require("next/router");
const upgrade_1 = __importDefault(require("./upgrade"));
function Anonymous() {
    const router = (0, router_1.useRouter)();
    return ((0, jsx_runtime_1.jsxs)("div", { style: {
            margin: "auto",
            padding: "50px 30px",
            maxWidth: "800px",
            background: "white",
        }, children: [(0, jsx_runtime_1.jsx)(antd_1.Popconfirm, { title: (0, jsx_runtime_1.jsxs)("div", { style: { maxWidth: "50ex" }, children: ["Are you sure you want to sign out ", (0, jsx_runtime_1.jsx)("b", { children: "losing everything" }), " you just did anonymously?"] }), onConfirm: async () => {
                    await (0, post_1.default)("/accounts/sign-out", { all: true });
                    router.push("/");
                }, okText: "Yes, discard everything", cancelText: "Cancel", children: (0, jsx_runtime_1.jsxs)(antd_1.Button, { danger: true, style: { float: "right" }, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "sign-out-alt" }), " Sign Out"] }) }), (0, jsx_runtime_1.jsxs)("h2", { children: ["Thank you for trying ", (0, jsx_runtime_1.jsx)(site_name_1.default, {}), " anonymously!"] }), "Signing up for an account will prevent losing your work, and unlock additional features.", (0, jsx_runtime_1.jsx)(upgrade_1.default, { style: { margin: "15px 0px" } })] }));
}
exports.default = Anonymous;
//# sourceMappingURL=index.js.map