'use client'
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var jsxRuntime = require('react/jsx-runtime');
var reactI18next = require('react-i18next');
require('@dynamic-labs/iconic');
require('@dynamic-labs/wallet-connector-core');
require('react');
var cautionTriangle = require('../../shared/assets/caution-triangle.cjs');
var exclamationCircle = require('../../shared/assets/exclamation-circle.cjs');
var exclamation = require('../../shared/assets/exclamation.cjs');
require('../../context/ViewContext/ViewContext.cjs');
var warningOrange = require('../../shared/assets/warning-orange.cjs');
var warningRed = require('../../shared/assets/warning-red.cjs');
require('../../shared/logger.cjs');
require('@dynamic-labs/wallet-book');
require('@dynamic-labs/utils');
require('../../utils/constants/colors.cjs');
require('../../utils/constants/values.cjs');
require('@dynamic-labs/sdk-api-core');
require('../../shared/consts/index.cjs');
var DynamicWidgetContext = require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
require('../../../../_virtual/_tslib.cjs');
require('../../components/Alert/Alert.cjs');
require('../../events/dynamicEvents.cjs');
require('../../context/DynamicContext/DynamicContext.cjs');
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
require('../../store/state/authMode/authMode.cjs');
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
require('../../context/CaptchaContext/CaptchaContext.cjs');
require('../../context/ErrorContext/ErrorContext.cjs');
require('@dynamic-labs/multi-wallet');
require('react-international-phone');
require('../../store/state/nonce/nonce.cjs');
require('@dynamic-labs-sdk/client/core');
require('../../client/client.cjs');
require('@dynamic-labs-sdk/client');
require('../../config/ApiEndpoint.cjs');
require('@dynamic-labs/locale');
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
require('../../store/state/primaryWalletId/primaryWalletId.cjs');
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
require('../../context/VerificationContext/VerificationContext.cjs');
require('react-dom');
require('../../utils/functions/compareChains/compareChains.cjs');
require('../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
require('../../context/ThemeContext/ThemeContext.cjs');
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
require('bs58');
require('@dynamic-labs/types');
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
require('../../context/LoadingContext/LoadingContext.cjs');
require('../../context/WalletContext/WalletContext.cjs');
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
require('yup');
require('../../context/MockContext/MockContext.cjs');
require('../CollectUserDataView/useFields.cjs');
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
require('@dynamic-labs/rpc-providers');
require('../../store/state/walletOptions/walletOptions.cjs');
var Typography = require('../../components/Typography/Typography.cjs');
require('../../context/FooterAnimationContext/index.cjs');
require('../../components/ShadowDOM/ShadowDOM.cjs');
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
require('react-focus-lock');
require('../../components/IconButton/IconButton.cjs');
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
require('../../components/MenuList/Dropdown/Dropdown.cjs');
require('formik');
require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
require('../../store/state/sendBalances.cjs');
require('../../components/Input/Input.cjs');
require('../../components/OverlayCard/OverlayCard.cjs');
require('../TransactionConfirmationView/TransactionConfirmationView.cjs');
require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
require('../../context/PasskeyContext/PasskeyContext.cjs');
require('../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
require('../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
require('../../context/OnrampContext/OnrampContext.cjs');
require('../../../index.cjs');
require('../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
require('qrcode');
require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
require('@hcaptcha/react-hcaptcha');
require('../ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
require('../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
require('../MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
require('../../store/state/tokenBalances.cjs');
require('../../store/state/multichainBalances.cjs');
require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
require('../../components/InlineWidget/InlineWidget.cjs');
require('../../components/IsBrowser/IsBrowser.cjs');
require('../../components/Popper/Popper/Popper.cjs');
require('../../components/Popper/PopperContext/PopperContext.cjs');

const GlobalWalletMaliciousView = ({ maliciousSiteInfo }) => {
    const { t } = reactI18next.useTranslation();
    const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
    const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
    const handleBack = () => {
        setDynamicWidgetView('global-wallet');
        setShowAuthFlow(false, {
            ignoreIfIsEmbeddedWidget: false,
            performMultiWalletChecks: false,
        });
    };
    const handleProceed = () => {
        var _a;
        (_a = maliciousSiteInfo.proceedFlow) === null || _a === void 0 ? void 0 : _a.call(maliciousSiteInfo);
    };
    return (jsxRuntime.jsx("div", { className: 'malicious-site-view', children: jsxRuntime.jsx("div", { className: 'popup-content', children: jsxRuntime.jsxs("div", { className: 'wallet-connection-view', children: [jsxRuntime.jsxs("div", { className: 'warning-icon-container', style: { position: 'relative' }, children: [maliciousSiteInfo.isDefinitelyMalicious ? (jsxRuntime.jsx(warningRed.ReactComponent, { className: 'warning-icon' })) : (jsxRuntime.jsx(warningOrange.ReactComponent, { className: 'warning-icon' })), jsxRuntime.jsx(exclamation.ReactComponent, { className: 'exclamation-icon', style: {
                                    left: '50%',
                                    position: 'absolute',
                                    top: '50%',
                                    transform: 'translate(-50%, -50%)',
                                } })] }), jsxRuntime.jsx(Typography.Typography, { className: 'connection-title', variant: 'title', font: 'bold', color: 'primary', children: maliciousSiteInfo.isDefinitelyMalicious
                            ? t('global_wallet.malicious_site.certain.title')
                            : t('global_wallet.malicious_site.unknown.title') }), jsxRuntime.jsxs("div", { className: `subtitle-container ${maliciousSiteInfo.isDefinitelyMalicious
                            ? 'definitely-malicious'
                            : 'unknown'}`, children: [jsxRuntime.jsxs("div", { className: 'subtitle-header-container', children: [maliciousSiteInfo.isDefinitelyMalicious ? (jsxRuntime.jsx(exclamationCircle.ReactComponent, { className: 'caution-icon' })) : (jsxRuntime.jsx(cautionTriangle.ReactComponent, { className: 'caution-icon' })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'subtitle-header', color: 'primary', children: maliciousSiteInfo.isDefinitelyMalicious
                                            ? t('global_wallet.malicious_site.certain.subtitle_header')
                                            : t('global_wallet.malicious_site.unknown.subtitle_header') })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'subtitle', color: 'secondary', children: maliciousSiteInfo.isDefinitelyMalicious
                                    ? t('global_wallet.malicious_site.certain.subtitle_text')
                                    : t('global_wallet.malicious_site.unknown.subtitle_text') })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'site-info', color: 'secondary', children: maliciousSiteInfo.url }), jsxRuntime.jsxs("div", { className: 'button-group', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'cancel-button', buttonVariant: 'primary', type: 'submit', buttonPadding: 'large', onClick: handleBack, copykey: 'global_wallet.malicious_site.go_back', children: maliciousSiteInfo.isDefinitelyMalicious
                                    ? t('global_wallet.malicious_site.certain.go_back')
                                    : t('global_wallet.malicious_site.unknown.go_back') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'proceed-button', buttonVariant: 'secondary', type: 'submit', buttonPadding: 'large', onClick: handleProceed, copykey: 'global_wallet.malicious_site.proceed', typographyProps: {
                                    color: 'error-1',
                                }, children: maliciousSiteInfo.isDefinitelyMalicious
                                    ? t('global_wallet.malicious_site.certain.proceed')
                                    : t('global_wallet.malicious_site.unknown.proceed') })] })] }) }) }));
};

exports.GlobalWalletMaliciousView = GlobalWalletMaliciousView;
exports["default"] = GlobalWalletMaliciousView;
