import { jsx as _jsx } from "@emotion/react/jsx-runtime";
import React from "react";
import { BrowserRouter } from "react-router-dom";
import { RuntimeContext } from "./RuntimeContext";
import RuntimePage from "./RuntimePage";
import { exposeGlobalRuntime } from "./utils/exposeGlobalRuntime";
import { normalizeApp } from "./utils/normalizeSchema";
const ClientRuntime = ({ basename, schema, router: Router = BrowserRouter, }) => {
    React.useEffect(exposeGlobalRuntime, []);
    const value = React.useMemo(() => normalizeApp(schema), [schema]);
    return (_jsx(Router, Object.assign({ basename: basename }, { children: _jsx(RuntimeContext.Provider, Object.assign({ value: value }, { children: _jsx(RuntimePage, {}) })) })));
};
export { exposeGlobalRuntime };
export default ClientRuntime;
//# sourceMappingURL=ClientRuntime.js.map