'use client'
import { jsx } from 'react/jsx-runtime';
import { createContext, useContext } from 'react';
import { WalletBookContextProvider } from '@dynamic-labs/wallet-book';
import { ErrorContextProvider } from '../ErrorContext/ErrorContext.js';
import { FooterAnimationContextProvider } from '../FooterAnimationContext/index.js';
import { ThemeContextProvider } from '../ThemeContext/ThemeContext.js';
import { ViewContext } from '../ViewContext/ViewContext.js';
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
import 'react-i18next';
import '@dynamic-labs/iconic';
import '../../../../_virtual/_tslib.js';
import '@dynamic-labs/utils';
import '@dynamic-labs/wallet-connector-core';
import '../../shared/logger.js';
import '../../utils/constants/colors.js';
import '../../utils/constants/values.js';
import '@dynamic-labs/sdk-api-core';
import '../../shared/consts/index.js';
import '../../components/Alert/Alert.js';
import '../../events/dynamicEvents.js';
import '../DynamicContext/useDynamicContext/useDynamicContext.js';
import '../DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
import '../CaptchaContext/CaptchaContext.js';
import '@dynamic-labs/multi-wallet';
import 'react-international-phone';
import '../../store/state/nonce/nonce.js';
import '@dynamic-labs-wallet/browser-wallet-client';
import '@dynamic-labs-sdk/client/core';
import 'eventemitter3';
import '@dynamic-labs-sdk/client';
import '../../config/ApiEndpoint.js';
import '@dynamic-labs/locale';
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../store/state/primaryWalletId/primaryWalletId.js';
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
import '../AccessDeniedContext/AccessDeniedContext.js';
import '../AccountExistsContext/AccountExistsContext.js';
import '../UserWalletsContext/UserWalletsContext.js';
import '../../store/state/authMode/authMode.js';
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
import '../VerificationContext/VerificationContext.js';
import 'react-dom';
import '../../utils/functions/compareChains/compareChains.js';
import '../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
import 'bs58';
import '@dynamic-labs/types';
import '../SocialRedirectContext/SocialRedirectContext.js';
import '../LoadingContext/LoadingContext.js';
import '../WalletContext/WalletContext.js';
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
import 'yup';
import '../../views/CollectUserDataView/useFields.js';
import '../FieldsStateContext/FieldsStateContext.js';
import '../UserFieldEditorContext/UserFieldEditorContext.js';
import '@dynamic-labs/rpc-providers';
import '../../store/state/walletOptions/walletOptions.js';
import { DynamicAuthModal } from '../../modals/DynamicAuthModal/DynamicAuthModal.js';
import '../../components/IconButton/IconButton.js';
import 'formik';
import '../../store/state/sendBalances.js';
import '../../components/Input/Input.js';
import '../../components/OverlayCard/OverlayCard.js';
import '../../components/MenuList/Dropdown/Dropdown.js';
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
import '../../views/TransactionConfirmationView/TransactionConfirmationView.js';
import '../PasskeyContext/PasskeyContext.js';
import '../../../index.js';
import '../../components/ShadowDOM/ShadowDOM.js';
import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
import '../WalletGroupContext/WalletGroupContext.js';
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
import '../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
import '../../utils/hooks/useWalletBackup/useWalletBackup.js';
import '../../utils/hooks/useWalletBackup/BackupError.js';
import '../../utils/hooks/useWalletBackup/types.js';
import '../../utils/hooks/useWalletBackup/cloudProviders.js';
import '@hcaptcha/react-hcaptcha';
import '@marsidev/react-turnstile';
import '../IpConfigurationContext/IpConfigurationContext.js';
import '../ConnectWithOtpContext/ConnectWithOtpContext.js';
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
import '../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
import '../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
import '../ErrorContext/hooks/useErrorText/useErrorText.js';
import '../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
import '../OnrampContext/OnrampContext.js';
import '../../utils/hooks/useWalletDelegation/DelegationError.js';
import '../../store/state/connectorsInitializing/connectorsInitializing.js';
import '../../store/state/tokenBalances.js';
import '../../store/state/multichainBalances.js';
import '@dynamic-labs/store';
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
import '../../components/InlineWidget/InlineWidget.js';
import '../../components/IsBrowser/IsBrowser.js';
import '../../components/Popper/Popper/Popper.js';
import { PopperProvider } from '../../components/Popper/PopperContext/PopperContext.js';
import 'react-focus-lock';
import 'qrcode';
import { walletBookMock } from './constants/index.js';

const MockContext = createContext(undefined);
const MockContextProvider = ({ children, view, customerTheme, dynamicLayoutClassName, }) => {
    const viewContextValue = {
        canGoBack: false,
        clearStackAndPush: () => { },
        clearStackAndPushInitialView: () => { },
        goBack: () => { },
        pushView: () => { },
        replaceView: () => { },
        stack: [],
        view,
    };
    return (jsx(MockContext.Provider, { value: { mockedSDK: true }, children: jsx(PopperProvider, { children: jsx(ViewContext.Provider, { value: viewContextValue, children: jsx(ErrorContextProvider, { children: jsx(ThemeContextProvider, { customerTheme: customerTheme, children: jsx(FooterAnimationContextProvider, { children: jsx(WalletBookContextProvider, { walletBook: walletBookMock, children: jsx(MockContextWrapper, { dynamicLayoutClassName: dynamicLayoutClassName, children: children }) }) }) }) }) }) }) }));
};
const MockContextWrapper = ({ dynamicLayoutClassName, children, }) => {
    /* istanbul ignore next */
    const onClose = () => new Promise(() => { });
    const mockProjectSettings = {
        chains: [],
        design: {},
        general: {},
        kyc: [],
        privacy: {},
        sdk: { walletConnect: { projectId: '', v2Enabled: false } },
        security: {},
    };
    return (jsx("div", { className: 'mock-ctx__container', style: { position: 'relative' }, children: jsx(DynamicAuthModal, { className: dynamicLayoutClassName, onClose: onClose, projectSettings: mockProjectSettings, transitionProps: {
                isShown: true,
            }, children: children }) }));
};
const useMockContext = () => {
    const context = useContext(MockContext);
    if (context === undefined) {
        return { mockedSDK: false };
    }
    return context;
};

export { MockContext, MockContextProvider, MockContextWrapper, useMockContext };
