'use client'
'use strict';

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

var client = require('@dynamic-labs-sdk/client');
var core = require('@dynamic-labs-sdk/client/core');
var version = require('../../../../../../version.cjs');
var isGlobalWalletPopup = require('../../../../../shared/utils/functions/isGlobalWalletPopup/isGlobalWalletPopup.cjs');
require('@dynamic-labs/sdk-api-core');
require('../../../../../utils/constants/values.cjs');
require('@dynamic-labs/utils');
require('../../../../../../../_virtual/_tslib.cjs');
require('@dynamic-labs/multi-wallet');
require('../../../../../shared/logger.cjs');
require('react-international-phone');
var getDeviceFingerprint = require('../../../../../utils/functions/getDeviceFingerprint/getDeviceFingerprint.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('../../../../../utils/constants/colors.cjs');
require('../../../../../shared/consts/index.cjs');
require('../../../../../store/state/nonce/nonce.cjs');
require('@dynamic-labs-wallet/browser-wallet-client');
require('eventemitter3');
require('../../../../../config/ApiEndpoint.cjs');
require('../../../../../events/dynamicEvents.cjs');
var randomString = require('../../../../../utils/functions/randomString/randomString.cjs');
require('@dynamic-labs/locale');
require('../../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
require('../../../../../store/state/primaryWalletId/primaryWalletId.cjs');
require('../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
require('../../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');

const getApiHeaders = () => {
    const apiHeaders = {
        'x-dyn-request-id': randomString.randomString(50),
    };
    const deviceFingerprint = getDeviceFingerprint.getDeviceFingerprint();
    if (deviceFingerprint) {
        apiHeaders['x-dyn-device-fingerprint'] = deviceFingerprint;
    }
    const sessionKeys = core.getSessionKeys(client.getDefaultClient());
    if (sessionKeys === null || sessionKeys === void 0 ? void 0 : sessionKeys.publicKey) {
        apiHeaders['x-dyn-session-public-key'] = sessionKeys.publicKey;
    }
    apiHeaders['x-dyn-version'] = `WalletKit/${version.VERSION}`;
    apiHeaders['x-dyn-api-version'] = `API/${version.API_VERSION}`;
    apiHeaders['x-dyn-is-global-wallet-popup'] = isGlobalWalletPopup.isGlobalWalletPopup()
        ? 'true'
        : 'false';
    return apiHeaders;
};

exports.getApiHeaders = getApiHeaders;
