'use client'
'use strict';

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

require('@dynamic-labs/sdk-api-core');
require('../../constants/values.cjs');
require('@dynamic-labs/utils');
require('../../../../../_virtual/_tslib.cjs');
require('@dynamic-labs/multi-wallet');
require('../../../shared/logger.cjs');
require('react-international-phone');
require('../../constants/colors.cjs');
require('@dynamic-labs/iconic');
require('@dynamic-labs/wallet-connector-core');
require('react');
require('react/jsx-runtime');
require('../../../context/ViewContext/ViewContext.cjs');
require('@dynamic-labs/wallet-book');
require('../../../shared/consts/index.cjs');
require('../../../store/state/nonce/nonce.cjs');
require('@dynamic-labs-wallet/browser-wallet-client');
require('@dynamic-labs-sdk/client/core');
require('eventemitter3');
require('@dynamic-labs-sdk/client');
require('../../../config/ApiEndpoint.cjs');
require('../../../events/dynamicEvents.cjs');
var getEnabledEmbeddedWalletProviders = require('../getEnabledEmbeddedWalletProviders/getEnabledEmbeddedWalletProviders.cjs');
require('@dynamic-labs/locale');
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
require('../getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');

const isAllowedToLinkWallet = (projectSettings, verifiedCredentials, multiWallet) => {
    if (multiWallet)
        return true;
    if (!projectSettings || !(verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.length))
        return false;
    // no embedded wallet providers are enabled and user doesn't have any wallet linked
    const canLinkOnSingleWallet = !getEnabledEmbeddedWalletProviders.getEnabledEmbeddedWalletProviders(projectSettings).length &&
        !verifiedCredentials.some((vc) => vc.walletProvider);
    return canLinkOnSingleWallet;
};

exports.isAllowedToLinkWallet = isAllowedToLinkWallet;
