/**
 * Utility to normalize asset imports across different bundlers. Different bundlers transform image
 * imports differently:
 *
 * - Some return a string (the URL).
 * - Next.js returns `{ src: string, height: number, width: number }`
 * - Others might return `{ default: string }` or other structures.
 *
 * This utility extracts the URL string from whatever format the bundler uses.
 */
export function getAssetUrl(importedAsset) {
    // If it's already a string, return it
    if (typeof importedAsset === 'string') {
        return importedAsset;
    }
    // If it's an object, try common property names
    if (importedAsset && typeof importedAsset === 'object') {
        const asset = importedAsset;
        if (typeof asset.src === 'string') {
            return asset.src;
        }
        if (typeof asset.default === 'string') {
            return asset.default;
        }
        if (typeof asset.source === 'string') {
            return asset.source;
        }
        if (typeof asset.uri === 'string') {
            return asset.uri;
        }
        if (typeof asset.url === 'string') {
            return asset.url;
        }
        if (typeof asset.href === 'string') {
            return asset.href;
        }
        if (typeof asset.path === 'string') {
            return asset.path;
        }
    }
    // If we can't extract a URL, warn and return an empty string to allow graceful degradation
    // oxlint-disable-next-line no-console
    console.warn('[getAssetUrl] Failed to extract URL from asset import. Received:', importedAsset, '\nThis usually means your bundler is transforming asset imports in an unexpected way.');
    return '';
}
//# sourceMappingURL=getAssetUrl.js.map