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

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


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ Path)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(920997);
// EXTERNAL MODULE: external "antd"
var external_antd_ = __webpack_require__(545725);
// EXTERNAL MODULE: ./lib/base-path.ts
var base_path = __webpack_require__(621923);
// EXTERNAL MODULE: ./lib/share/edit-url.ts
var edit_url = __webpack_require__(682620);
// EXTERNAL MODULE: external "path"
var external_path_ = __webpack_require__(371017);
// EXTERNAL MODULE: ../frontend/dist/components/icon.js
var icon = __webpack_require__(807772);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(616689);
// EXTERNAL MODULE: ./components/share/site-name.tsx
var site_name = __webpack_require__(312899);
// EXTERNAL MODULE: ./components/misc/A.tsx
var A = __webpack_require__(617637);
// EXTERNAL MODULE: ../util/dist/misc.js
var misc = __webpack_require__(477389);
;// CONCATENATED MODULE: ./components/app/iframe.tsx







function IFrame({ src: src0 , appURL , path , style , fullscreen: fullscreen0 , description  }) {
    const { 0: fullscreen , 1: setFullscreen  } = (0,external_react_.useState)(!!fullscreen0);
    const { 0: reload , 1: setReload  } = (0,external_react_.useState)(0);
    const iframeRef = (0,external_react_.useRef)(null);
    const { 0: start , 1: setStart  } = (0,external_react_.useState)(false);
    const url = new URL("http://example.com" + src0);
    url.search += (url.search ? "&" : "") + `reload=${reload}`;
    const src = url.pathname + url.search + url.hash;
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        style: fullscreen ? {
            position: "fixed",
            top: 0,
            left: 0,
            width: "100vw",
            height: "100vh",
            zIndex: 1000,
            background: "white"
        } : {
            padding: "5px 15px",
            height: start ? "70vh" : undefined,
            border: "1px solid #ddd",
            borderRadius: "5px",
            boxShadow: "5px 5px 5px #eee",
            display: "flex",
            flexDirection: "column",
            background: "white",
            ...style
        },
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx("div", {
                children: start && /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    style: {
                        display: "flex"
                    },
                    children: [
                        /*#__PURE__*/ jsx_runtime_.jsx(external_antd_.Button, {
                            title: "Reload this",
                            size: "small",
                            type: "text",
                            onClick: ()=>{
                                setReload(reload + 1);
                            //iframeRef.current?.contentWindow.location.reload();
                            },
                            children: /*#__PURE__*/ jsx_runtime_.jsx(icon.Icon, {
                                name: "reload"
                            })
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx("div", {
                            style: {
                                flex: 1,
                                textAlign: "center",
                                paddingTop: "2.5px",
                                paddingLeft: fullscreen ? "15px" : undefined
                            },
                            children: appURL && /*#__PURE__*/ jsx_runtime_.jsx(external_antd_.Popover, {
                                title: "Open in the App",
                                content: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                                    style: {
                                        maxWidth: "350px"
                                    },
                                    children: [
                                        "Open ",
                                        path,
                                        " in the ",
                                        /*#__PURE__*/ jsx_runtime_.jsx(site_name/* default */.Z, {}),
                                        " app for more options and to see your other files..."
                                    ]
                                }),
                                children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)(A/* default */.Z, {
                                    href: appURL,
                                    external: true,
                                    children: [
                                        /*#__PURE__*/ jsx_runtime_.jsx(icon.Icon, {
                                            name: "external-link",
                                            style: {
                                                marginRight: "5px"
                                            }
                                        }),
                                        path ? (0,misc.trunc_middle)(path, 50) : ""
                                    ]
                                })
                            })
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx(external_antd_.Button, {
                            size: "small",
                            type: "text",
                            title: "Full screen",
                            onClick: ()=>{
                                if (!fullscreen) {
                                    document.documentElement.requestFullscreen();
                                } else {
                                    if (document.fullscreenElement) {
                                        document.exitFullscreen();
                                    }
                                }
                                setFullscreen(!fullscreen);
                            },
                            children: /*#__PURE__*/ jsx_runtime_.jsx(icon.Icon, {
                                name: fullscreen ? "compress" : "expand"
                            })
                        })
                    ]
                })
            }),
            start && /*#__PURE__*/ jsx_runtime_.jsx("hr", {
                style: {
                    width: "100%"
                }
            }),
            !start ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)(external_antd_.Button, {
                style: {
                    margin: "auto"
                },
                size: "large",
                type: "primary",
                shape: "round",
                onClick: ()=>setStart(true)
                ,
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx(icon.Icon, {
                        name: "run"
                    }),
                    " Start ",
                    description ?? "",
                    "..."
                ]
            }) : /*#__PURE__*/ jsx_runtime_.jsx("iframe", {
                ref: iframeRef,
                src: src,
                width: "100%",
                height: "100%",
                frameBorder: "0"
            })
        ]
    });
};

// EXTERNAL MODULE: ./lib/use-customize.ts
var use_customize = __webpack_require__(1198);
// EXTERNAL MODULE: ./components/auth/in-place-sign-in-or-up.tsx
var in_place_sign_in_or_up = __webpack_require__(886796);
// EXTERNAL MODULE: ./components/share/edit/open-anonymously.tsx
var open_anonymously = __webpack_require__(316269);
;// CONCATENATED MODULE: ./components/app/path.tsx

/*
Edit a file using the CoCalc app.
*/ 







function Path({ project_id , path , style , fullscreen , embed , description  }) {
    const { account , anonymousSignup  } = (0,use_customize/* default */.Z)();
    if (!account) {
        return /*#__PURE__*/ jsx_runtime_.jsx(external_antd_.Alert, {
            type: "success",
            style: style,
            message: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx(in_place_sign_in_or_up/* default */.Z, {
                        title: `To use ${description ?? "this"}...`
                    }),
                    anonymousSignup && /*#__PURE__*/ jsx_runtime_.jsx(open_anonymously/* default */.Z, {})
                ]
            })
        });
    }
    const appURL = (0,edit_url/* default */.Z)({
        type: "collaborator",
        project_id,
        path
    });
    const src = embed ? (0,external_path_.join)(base_path/* default */.Z, `static/embed.html?target=projects/${project_id}/files/${path ?? ""}`) : appURL + "?fullscreen=project&session=";
    return /*#__PURE__*/ jsx_runtime_.jsx(IFrame, {
        src: src,
        appURL: appURL,
        path: path,
        style: style,
        fullscreen: fullscreen,
        description: description
    });
};


/***/ }),

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

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ Content)
/* 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_landing_sign_in__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39646);
/* harmony import */ var components_misc_sanitized_markdown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(377535);
/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(77595);
/* harmony import */ var lib_use_customize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1198);
/* harmony import */ var components_app_path__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(827648);

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





function Logo({ logo , title  }) {
    if (!logo) return null;
    if (typeof logo == "string" || (logo === null || logo === void 0 ? void 0 : logo.src) != null) {
        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_image__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
            src: logo,
            style: {
                width: "200px"
            },
            alt: `${title} logo`
        });
    }
    return logo;
}
function Content(props) {
    const { title , alt , caption , description , image , aboveImage , indexInfo , logo , startup , subtitle , subtitleBelow =false ,  } = props;
    const { sandboxProjectId  } = (0,lib_use_customize__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)();
    function renderIndexInfo() {
        if (!indexInfo) return;
        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(antd__WEBPACK_IMPORTED_MODULE_1__.Col, {
                    xs: 24,
                    style: {
                        borderTop: "1px solid lightgrey",
                        marginTop: "20px",
                        marginBottom: "20px"
                    }
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Col, {
                    sm: {
                        span: 12,
                        offset: 6
                    },
                    xs: {
                        span: 24,
                        offset: 0
                    },
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_misc_sanitized_markdown__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                        value: indexInfo
                    })
                })
            ]
        });
    }
    function renderSubtitleTop() {
        if (subtitleBelow) return;
        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h2", {
            style: {
                color: "#333"
            },
            children: subtitle
        });
    }
    function renderSubtitleBelow() {
        if (!subtitleBelow) return;
        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(antd__WEBPACK_IMPORTED_MODULE_1__.Col, {
                    xs: 0,
                    sm: 4
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Col, {
                    xs: 24,
                    sm: 16,
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h2", {
                        style: {
                            color: "#333",
                            textAlign: "center",
                            marginTop: "30px"
                        },
                        children: subtitle
                    })
                })
            ]
        });
    }
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        style: {
            padding: "30px 0"
        },
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_1__.Row, {
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Col, {
                        sm: 10,
                        xs: 24,
                        style: {
                            display: "flex",
                            alignItems: "center",
                            paddingTop: "15px"
                        },
                        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            style: {
                                textAlign: "center",
                                margin: "auto",
                                padding: "0 10%"
                            },
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Logo, {
                                    logo: logo,
                                    title: title
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h1", {
                                    style: {
                                        color: "#333"
                                    },
                                    children: title
                                }),
                                renderSubtitleTop(),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h3", {
                                    style: {
                                        color: "#666"
                                    },
                                    children: description
                                })
                            ]
                        })
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_1__.Col, {
                        sm: 14,
                        xs: 24,
                        children: [
                            aboveImage != null ? aboveImage : sandboxProjectId && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                style: {
                                    margin: "15px"
                                },
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_app_path__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                                    style: {
                                        marginBottom: "15px"
                                    },
                                    project_id: sandboxProjectId,
                                    description: "Public Sandbox"
                                })
                            }),
                            image && /*#__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(_image__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                        src: image,
                                        priority: true,
                                        style: {
                                            padding: "15px"
                                        },
                                        alt: alt ?? `Image illustrating ${title}`
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        style: {
                                            textAlign: "center",
                                            color: "#333",
                                            fontSize: "12pt"
                                        },
                                        children: caption
                                    })
                                ]
                            })
                        ]
                    }),
                    renderSubtitleBelow(),
                    renderIndexInfo()
                ]
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_landing_sign_in__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                startup: startup ?? title,
                hideFree: true
            })
        ]
    });
};


/***/ }),

/***/ 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
        })
    });
};


/***/ }),

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

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ OpenAnonymously)
/* 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 next_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(371853);
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(545725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(807772);
/* harmony import */ var _cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var components_auth_try__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(123375);

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



function OpenAnonymously() {
    const router = (0,next_router__WEBPACK_IMPORTED_MODULE_1__.useRouter)();
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_2__.Divider, {
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cocalc_frontend_components_icon__WEBPACK_IMPORTED_MODULE_3__.Icon, {
                        name: "mask",
                        style: {
                            marginRight: "10px"
                        }
                    }),
                    " Anonymously"
                ]
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(components_auth_try__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                minimal: true,
                onSuccess: ()=>router.push({
                        pathname: router.asPath.split("?")[0],
                        query: {
                            edit: "true"
                        }
                    })
            })
        ]
    });
};


/***/ }),

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

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* binding */ SiteName)
/* 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 lib_use_customize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1198);


function SiteName({ full  }) {
    const { siteName , siteDescription  } = (0,lib_use_customize__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)();
    if (full) {
        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                siteName,
                ": ",
                siteDescription
            ]
        });
    }
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: siteName
    });
};


/***/ })

};
;