"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 © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
var edit_url_1 = __importDefault(require("lib/share/edit-url"));
var share_url_1 = __importDefault(require("lib/share/share-url"));
var A_1 = __importDefault(require("components/misc/A"));
var configure_public_path_1 = __importDefault(require("components/share/configure-public-path"));
var path_1 = __importDefault(require("components/app/path"));
var path_2 = require("path");
function OpenDirectly(_a) {
    var project_id = _a.project_id, path = _a.path, id = _a.id, relativePath = _a.relativePath;
    var url = (0, edit_url_1.default)({
        type: "collaborator",
        project_id: project_id,
        path: path,
        relativePath: relativePath,
    });
    return ((0, jsx_runtime_1.jsxs)("div", { children: ["You are signed in as a collaborator on", " ", (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: (0, edit_url_1.default)({ type: "collaborator", project_id: project_id }), external: true }, { children: "the project" })), " ", "that contains", " ", (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: url, external: true }, { children: "this shared document," })), " ", "so you can edit it below. Scroll further down to adjust the description and license, choose a nice URL, or stop sharing this.", (0, jsx_runtime_1.jsx)(path_1.default, { start: true, project_id: project_id, path: (0, path_2.join)(path, relativePath), style: {
                    margin: "30px 0",
                } }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("br", {}), !relativePath ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["You can adjust how this is shared below, or turn off sharing by selecting ", (0, jsx_runtime_1.jsx)("em", { children: "Private" }), ".", (0, jsx_runtime_1.jsx)(configure_public_path_1.default, { id: id, project_id: project_id, path: path })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("br", {}), "Go to the", " ", (0, jsx_runtime_1.jsx)(A_1.default, __assign({ href: (0, share_url_1.default)(id) }, { children: "containing directory that was shared" })), " to configure how this is shared or unshare it."] }))] }));
}
exports.default = OpenDirectly;
//# sourceMappingURL=open-directly.js.map