"use strict";
exports.id = 6349;
exports.ids = [6349];
exports.modules = {

/***/ 377535:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ SanitizedMarkdown)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _cocalc_frontend_lib_file_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(732586);
/* harmony import */ var _cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(695379);
/* harmony import */ var _cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var components_misc_A__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(617637);

/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */ 


function SanitizedMarkdown({ value  }) {
    const ctx = {
        AnchorTagComponent: components_misc_A__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z,
        noSanitize: false
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_lib_file_context__WEBPACK_IMPORTED_MODULE_1__.FileContext.Provider, {
        value: ctx,
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((_cocalc_frontend_editors_slate_static_markdown__WEBPACK_IMPORTED_MODULE_2___default()), {
            value: value
        })
    });
};


/***/ }),

/***/ 306349:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ PublicPaths)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(920997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(545725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var components_misc_A__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(617637);
/* harmony import */ var components_misc_sanitized_markdown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(377535);
/* harmony import */ var _cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(807772);
/* harmony import */ var _cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(477389);
/* harmony import */ var _cocalc_util_misc__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _cocalc_util_consts_ui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(883996);

/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */ /*
A table of a list of public paths.
*/ 





function Description({ description , maxWidth  }) {
    if (!(description === null || description === void 0 ? void 0 : description.trim())) return null;
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        style: {
            maxWidth,
            maxHeight: "4em",
            overflow: "auto",
            border: "1px solid #eee",
            borderRadius: "3px",
            padding: "5px"
        },
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_sanitized_markdown__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
            value: description
        })
    });
}
function LastEdited({ last_edited  }) {
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: `${new Date(parseFloat(last_edited)).toLocaleString()}`
    });
}
function Title({ id , title  }) {
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_A__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
        href: `/share/public_paths/${id}`,
        children: (0,_cocalc_util_misc__WEBPACK_IMPORTED_MODULE_5__.trunc_middle)(title, 48)
    });
}
function Visibility({ disabled , unlisted , vhost , authenticated  }) {
    if (disabled) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
                    name: "lock"
                }),
                " Private"
            ]
        });
    }
    if (authenticated) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
                    name: _cocalc_util_consts_ui__WEBPACK_IMPORTED_MODULE_6__/* .SHARE_AUTHENTICATED_ICON */ .rD
                }),
                " Authenticated"
            ]
        });
    }
    if (unlisted) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
                    name: "eye-slash"
                }),
                " Unlisted"
            ]
        });
    }
    if (vhost) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                "Virtual Host: ",
                vhost
            ]
        });
    }
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
                name: "eye"
            }),
            " Listed"
        ]
    });
}
// I'm using any[]'s below since it's too much of a pain dealing with TS for this.
const COLUMNS0 = [
    {
        title: "Path",
        dataIndex: "path",
        key: "path",
        render: (title, record)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Title, {
                id: record.id,
                title: title
            })
        ,
        responsive: [
            "sm"
        ]
    },
    {
        title: "Description",
        dataIndex: "description",
        key: "description",
        render: (description)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Description, {
                description: description,
                maxWidth: "300px"
            })
        ,
        responsive: [
            "sm"
        ]
    },
    {
        title: "Date Modified",
        dataIndex: "last_edited",
        key: "last_edited",
        render: (last_edited)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(LastEdited, {
                last_edited: last_edited
            })
        ,
        responsive: [
            "sm"
        ]
    }, 
];
const COLUMNS = COLUMNS0.concat([
    {
        title: "Documents",
        responsive: [
            "xs"
        ],
        key: "path",
        render: (_, record)=>{
            const { path , last_edited , id , description  } = record;
            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_1__.Space, {
                direction: "vertical",
                style: {
                    width: "100%"
                },
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Title, {
                        title: path,
                        id: id
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Description, {
                        description: description
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(LastEdited, {
                        last_edited: last_edited
                    })
                ]
            });
        }
    }, 
]);
const COLUMNS_WITH_VISIBILITY = COLUMNS0.concat([
    {
        title: "Visibility",
        dataIndex: "disabled",
        key: "disabled",
        render: (_, record)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Visibility, {
                disabled: record.disabled,
                unlisted: record.unlisted,
                authenticated: record.authenticated,
                vhost: record.vhost
            })
        ,
        responsive: [
            "sm"
        ]
    },
    {
        title: "Documents",
        responsive: [
            "xs"
        ],
        key: "path",
        render: (_, record)=>{
            const { path , last_edited , id , description  } = record;
            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_1__.Space, {
                direction: "vertical",
                style: {
                    width: "100%"
                },
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Title, {
                        title: path,
                        id: id
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Description, {
                        description: description
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(LastEdited, {
                        last_edited: last_edited
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Visibility, {
                        disabled: record.disabled,
                        unlisted: record.unlisted,
                        authenticated: record.authenticated,
                        vhost: record.vhost
                    })
                ]
            });
        }
    }, 
]);
function PublicPaths({ publicPaths  }) {
    let showVisibility = false;
    if (publicPaths) {
        for (const path of publicPaths){
            const { disabled , unlisted , authenticated  } = path;
            if (disabled || unlisted || authenticated) {
                showVisibility = true;
                break;
            }
        }
    }
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Table, {
        pagination: false,
        rowKey: "id",
        loading: publicPaths == null,
        dataSource: publicPaths,
        columns: showVisibility ? COLUMNS_WITH_VISIBILITY : COLUMNS,
        style: {
            overflowX: "auto"
        }
    });
};


/***/ })

};
;