import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { DEFAULT_THEME } from "../../components/constants.js";
import { AnalyticsContext } from "../../context/analyticsContext/index.js";
import { PCEditorStoreProvider } from "../../context/editorStoreContext/index.js";
import { DEFAULT_FORMS_CONTEXT_VALUE, FormsContext, } from "../../context/formsContext/FormsContext.js";
import { ImageContext } from "../../context/imageContext/index.js";
import { LocaleContext } from "../../context/localeContext/index.js";
import { LocationContext } from "../../context/locationContext/index.js";
import { MapsContext, initialMapValue } from "../../context/mapsContext/mapsContext.js";
import { MobileContext } from "../../context/mobileContext/index.js";
import { ProjectSettingsContext, } from "../../context/projectSettingsContext/index.js";
import { SSRContext } from "../../context/ssrContext/index.js";
import { ThemeContext } from "../../context/theme/index.js";
export const PageConstructorProvider = (props) => {
    const { isMobile, mapsContext = initialMapValue, locale = {}, location = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, children, image = {}, forms = DEFAULT_FORMS_CONTEXT_VALUE, } = props;
    /* eslint-disable react/jsx-key */
    const context = [
        _jsx(ThemeContext.Provider, { value: { theme } }),
        _jsx(ProjectSettingsContext.Provider, { value: projectSettings }),
        _jsx(LocaleContext.Provider, { value: locale }),
        _jsx(ImageContext.Provider, { value: image }),
        _jsx(LocationContext.Provider, { value: location }),
        _jsx(MobileContext.Provider, { value: Boolean(isMobile) }),
        _jsx(MapsContext.Provider, { value: mapsContext }),
        _jsx(AnalyticsContext.Provider, { value: analytics }),
        _jsx(FormsContext.Provider, { value: forms }),
        _jsx(SSRContext.Provider, { value: { isServer: ssrConfig?.isServer } }),
        _jsx(PCEditorStoreProvider, {}),
    ].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);
    /* eslint-enable react/jsx-key */
    return _jsx(React.Fragment, { children: context });
};
//# sourceMappingURL=Provider.js.map
