import { useEffect as e, useState as t } from "react";
import n from "prop-types";
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
import { SplitPane as o } from "react-collapse-pane";
//#region src/plugins/layout/components/Layout/Layout.jsx
var s = ({ getComponent: e, useSwaggerEditorReactModal: t, useSplashScreen: n }) => {
	let s = e("EditorPane", !0), c = e("EditorPreviewPane", !0), l = e("TopBar", !0), u = e("Container"), d = e("Dropzone", !0), f = e("SplashScreen", !0), p = t(), [m, h] = n();
	return /* @__PURE__ */ a("div", {
		className: "swagger-editor__layout",
		ref: p,
		children: [/* @__PURE__ */ i(f, { isOpen: m }), h && /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(l, {}), /* @__PURE__ */ i(u, {
			className: "container",
			children: /* @__PURE__ */ i(d, { children: /* @__PURE__ */ a(o, {
				split: "vertical",
				children: [/* @__PURE__ */ i(s, {}), /* @__PURE__ */ i(c, {})]
			}) })
		})] })]
	});
};
s.propTypes = {
	getComponent: n.func.isRequired,
	useSwaggerEditorReactModal: n.func.isRequired,
	useSplashScreen: n.func.isRequired
};
//#endregion
//#region src/plugins/layout/hooks.js
var c = (n) => () => {
	let [r, i] = t(!0), [a, o] = t(!1), { fn: s } = n();
	return e(() => {
		let e = s.requestIdleCallback(() => {
			o(!0);
		});
		return () => {
			s.cancelIdleCallback(e);
		};
	}, []), e(() => {
		if (a) {
			let e, t = globalThis.setTimeout(() => {
				e = s.requestIdleCallback(() => {
					i(!1);
				});
			}, 1e3);
			return () => {
				globalThis.clearTimeout(t), s.cancelIdleCallback(e);
			};
		}
	}, [a]), [r, a];
}, l = ({ getSystem: e }) => ({
	rootInjects: { useSplashScreen: c(e) },
	components: { SwaggerEditorLayout: s }
});
//#endregion
export { l as default };

//# sourceMappingURL=index.js.map