'use client'
import '@dynamic-labs/sdk-api-core';
import '../../constants/values.js';
import '@dynamic-labs/utils';
import '../../../../../_virtual/_tslib.js';
import '@dynamic-labs/multi-wallet';
import '../../../shared/logger.js';
import { getActiveOauthCredential } from '../getActiveOauthCredential/getActiveOauthCredential.js';
import 'react-international-phone';
import '../../constants/colors.js';
import { shortenEmail } from '../../../shared/utils/functions/shortenEmail/shortenEmail.js';
import { formatPhone } from '../formatPhone/formatPhone.js';
import '@dynamic-labs/iconic';
import '@dynamic-labs/wallet-connector-core';
import 'react';
import 'react/jsx-runtime';
import '../../../context/ViewContext/ViewContext.js';
import '@dynamic-labs/wallet-book';
import '../../../shared/consts/index.js';
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 '../../../events/dynamicEvents.js';
import '@dynamic-labs/locale';
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../../store/state/primaryWalletId/primaryWalletId.js';
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import '../getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';

/**
 * This will return a string which we can present to the user as his identifier, such as
 * his email address or phone number.
 */
const getUserIdentifier = (user) => {
    const oauthCredential = getActiveOauthCredential(user);
    if (oauthCredential === null || oauthCredential === void 0 ? void 0 : oauthCredential.publicIdentifier) {
        return oauthCredential.publicIdentifier;
    }
    if (user === null || user === void 0 ? void 0 : user.email)
        return shortenEmail(user.email);
    if (user === null || user === void 0 ? void 0 : user.phoneNumber)
        return formatPhone(user.phoneNumber);
    return 'My Profile';
};

export { getUserIdentifier };
