exports.id = 541;
exports.ids = [541];
exports.modules = {

/***/ 9525:
/***/ ((module) => {

// Exports
module.exports = {
	"PluginPage": "PluginPage_PluginPage__QRXgB"
};


/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2322);
/* harmony import */ var _cromwell_core_frontend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4536);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _PluginPage_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9525);
/* harmony import */ var _PluginPage_module_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_PluginPage_module_scss__WEBPACK_IMPORTED_MODULE_3__);




const pluginsSettings = {};
const pluginInfos = {};
const PluginPage = ()=>{
    const urlParams = new URLSearchParams(window.location?.search);
    const pluginName = urlParams.get("pluginName");
    const apiClient = (0,_cromwell_core_frontend__WEBPACK_IMPORTED_MODULE_1__.getRestApiClient)();
    const [canShow, setCanShow] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        if (!pluginName) return;
        const getInfos = async ()=>{
            try {
                const allInfos = await (0,_cromwell_core_frontend__WEBPACK_IMPORTED_MODULE_1__.getRestApiClient)()?.getPluginList() || [];
                const info = allInfos.find((inf)=>inf.name === pluginName);
                if (info && pluginName) {
                    pluginInfos[pluginName] = info;
                }
            } catch (e) {
                console.error(e);
            }
        };
        const getSettings = async ()=>{
            try {
                const settings = await apiClient?.getPluginSettings(pluginName);
                if (settings) {
                    pluginsSettings[pluginName] = settings;
                }
            } catch (e) {
                console.error(e);
            }
        };
        (async ()=>{
            await Promise.all([
                getInfos(),
                getSettings()
            ]);
            setCanShow(true);
        })();
    }, []);
    if (!canShow) return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cromwell_core_frontend__WEBPACK_IMPORTED_MODULE_1__.LoadBox, {});
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_PluginPage_module_scss__WEBPACK_IMPORTED_MODULE_3___default().PluginPage),
        children: pluginName && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_cromwell_core_frontend__WEBPACK_IMPORTED_MODULE_1__.AdminPanelWidgetPlace, {
            widgetName: "PluginSettings",
            pluginName: pluginName,
            widgetProps: {
                pluginName,
                pluginSettings: pluginsSettings[pluginName] ?? {},
                pluginInfo: pluginInfos[pluginName] ?? {}
            }
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginPage);


/***/ })

};
;