/**
 * Suggestions UMD entry — seekora-react-sdk.suggestions.umd.js
 *
 * Exposes SearchInput, DropdownPanel, SuggestionList, CategoriesTabs,
 * ProductGrid (suggestions), TrendingList, RecentSearchesList, all 7
 * dropdown variants, and SearchBarWithSuggestions / ProductCard.
 *
 * At module load time, registers all suggestion primitives into the shared
 * window.SeekoraReact primitive registry so LayoutRenderer can resolve them.
 *
 * Load order: core UMD must be on window before this file executes.
 *
 * SCRUM-268
 */
import React from "react";
import { createRoot } from "react-dom/client";
// suggestions-primitives
import { SearchInput } from "./components/suggestions-primitives/SearchInput";
import { DropdownPanel } from "./components/suggestions-primitives/DropdownPanel";
import { RecentSearchesList } from "./components/suggestions-primitives/RecentSearchesList";
import { SuggestionList } from "./components/suggestions-primitives/SuggestionList";
import { SuggestionItem } from "./components/suggestions-primitives/SuggestionItem";
import { CategoriesTabs } from "./components/suggestions-primitives/CategoriesTabs";
import { ProductCard } from "./components/suggestions-primitives/ProductCard";
import { ProductGrid } from "./components/suggestions-primitives/ProductGrid";
import { TrendingList } from "./components/suggestions-primitives/TrendingList";
import { ItemCard } from "./components/suggestions-primitives/ItemCard";
import { ItemGrid } from "./components/suggestions-primitives/ItemGrid";
import { SuggestionsProvider } from "./components/suggestions-primitives/SuggestionsProvider";
import { SuggestionsDropdownComposition } from "./components/suggestions-primitives/SuggestionsDropdownComposition";
// High-level composition components
import { SearchBarWithSuggestions } from "./components/SearchBarWithSuggestions";
// 7 premium dropdown variants
import { AmazonDropdown } from "./components/suggestions/AmazonDropdown";
import { GoogleDropdown } from "./components/suggestions/GoogleDropdown";
import { PinterestDropdown } from "./components/suggestions/PinterestDropdown";
import { SpotlightDropdown } from "./components/suggestions/SpotlightDropdown";
import { ShopifyDropdown } from "./components/suggestions/ShopifyDropdown";
import { MobileSheetDropdown } from "./components/suggestions/MobileSheetDropdown";
import { MinimalDropdown } from "./components/suggestions/MinimalDropdown";
export { 
// suggestions-primitives
SearchInput, DropdownPanel, RecentSearchesList, SuggestionList, SuggestionItem, CategoriesTabs, ProductCard, ProductGrid, TrendingList, ItemCard, ItemGrid, SuggestionsProvider, SuggestionsDropdownComposition, 
// High-level
SearchBarWithSuggestions, 
// 7 dropdown variants
AmazonDropdown, GoogleDropdown, PinterestDropdown, SpotlightDropdown, ShopifyDropdown, MobileSheetDropdown, MinimalDropdown, };
// ---------------------------------------------------------------------------
// Mount helpers
// ---------------------------------------------------------------------------
export function mountProductCard(el, product, config, position, onSelect) {
    const root = createRoot(el);
    // ProductCard's onSelect is () => void (no args). Caller passes (p: any) => void
    // — wrap to drop the arg so it satisfies the narrower target signature.
    const select = onSelect ? () => onSelect(product) : () => { };
    root.render(React.createElement(ProductCard, {
        product,
        displayConfig: config,
        position: typeof position === "number" ? position : 0,
        onSelect: select,
    }));
    return { unmount: () => root.unmount() };
}
// ---------------------------------------------------------------------------
// Self-registration into core primitive registry at module load time.
// window.SeekoraReact.registerPrimitive must exist (loaded from core UMD).
// ---------------------------------------------------------------------------
(function registerSuggestionPrimitives() {
    if (typeof window !== "undefined" &&
        window.SeekoraReact &&
        typeof window.SeekoraReact.registerPrimitive === "function") {
        const reg = window.SeekoraReact.registerPrimitive;
        reg("SearchInput", SearchInput);
        reg("DropdownPanel", DropdownPanel);
        reg("RecentSearchesList", RecentSearchesList);
        reg("SuggestionList", SuggestionList);
        reg("CategoriesTabs", CategoriesTabs);
        reg("ProductCard", ProductCard);
        reg("ProductGrid", ProductGrid);
        reg("TrendingList", TrendingList);
        reg("SearchBarWithSuggestions", SearchBarWithSuggestions);
        reg("AmazonDropdown", AmazonDropdown);
        reg("GoogleDropdown", GoogleDropdown);
        reg("PinterestDropdown", PinterestDropdown);
        reg("SpotlightDropdown", SpotlightDropdown);
        reg("ShopifyDropdown", ShopifyDropdown);
        reg("MobileSheetDropdown", MobileSheetDropdown);
        reg("MinimalDropdown", MinimalDropdown);
    }
})();
