import React__default, { useEffect } from 'react';
import { messages } from '../../messages/en.mjs';
import { readB2CInternals } from '../../utils/internal.mjs';
import { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper.mjs';
import { IDPContextProvider } from '../components/organisms/IDPContextProvider.mjs';
import { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig.mjs';
import { GlobalContextProvider, DEFAULT_STATE } from './GlobalContextProvider.mjs';
import { IDPConsentScreen } from './screens/IdentityProvider/IDPConsent.mjs';

const IDPContainer = ({ client, presentation, callbacks, strings, styles, getIDPConsentManifest, authTokenParams })=>{
    const presentationValue = usePresentationWithDefault(presentation, false, {
        products: []
    });
    useEffect(()=>{
        readB2CInternals(client).bootstrap.getAsync().then((data)=>{
            readB2CInternals(client).networkClient.logEvent({
                name: 'render_idp_screen',
                details: {
                    bootstrap: data
                }
            });
        });
    }, [
        client
    ]);
    return /*#__PURE__*/ React__default.createElement(GlobalContextProvider, {
        client: client,
        config: {},
        callbacks: callbacks,
        initialState: DEFAULT_STATE
    }, /*#__PURE__*/ React__default.createElement(IDPContextProvider, {
        consentManifestGenerator: getIDPConsentManifest,
        authTokenParams: authTokenParams
    }, /*#__PURE__*/ React__default.createElement(PresentationContext.Provider, {
        value: presentationValue
    }, /*#__PURE__*/ React__default.createElement(I18nProviderWrapper, {
        messages: messages,
        overrides: strings
    }, /*#__PURE__*/ React__default.createElement(IDPConsentScreen, null)))));
};

export { IDPContainer };
//# sourceMappingURL=IDPContainer.mjs.map
