// seekora-ui-sdk/packages/react/src/layout/mount.tsx
import * as React from "react";
import { createRoot } from "react-dom/client";
import { LayoutRenderer } from "./LayoutRenderer";
import { ShopifyContextBridge } from "./ShopifyContextBridge";
export function mountLayout(host, opts) {
    const root = createRoot(host);
    root.render(React.createElement(ShopifyContextBridge, { shopDomain: opts.shopifyConfig?.shopDomain, storefrontToken: opts.shopifyConfig?.storefrontToken, storefrontApiVersion: opts.shopifyConfig?.storefrontApiVersion, countryCode: opts.shopifyConfig?.countryCode, languageCode: opts.shopifyConfig?.languageCode },
        React.createElement(LayoutRenderer, { config: opts.config, client: opts.client, pageContext: opts.pageContext, onStateManagerReady: opts.onStateManagerReady, initialResultsPromise: opts.initialResultsPromise, initialQuery: opts.initialQuery, trackContext: opts.trackContext, onReady: opts.onReady, themeHarvest: opts.themeHarvest?.cardTemplateHtml && opts.themeHarvest?.swapMap
                ? {
                    cardTemplateHtml: opts.themeHarvest.cardTemplateHtml,
                    swapMap: opts.themeHarvest.swapMap,
                    moneyFormat: opts.themeHarvest.moneyFormat,
                    predictiveCardTemplateHtml: opts.themeHarvest.predictiveCardTemplateHtml ?? null,
                    predictiveSwapMap: opts.themeHarvest.predictiveSwapMap ?? null,
                    predictiveListClass: opts.themeHarvest.predictiveListClass ?? null,
                    suggestionChipTemplateHtml: opts.themeHarvest.suggestionChipTemplateHtml ?? null,
                    suggestionListClass: opts.themeHarvest.suggestionListClass ?? null,
                    suggestionChipSwap: opts.themeHarvest.suggestionChipSwap ?? null,
                }
                : null })));
    return { unmount: () => root.unmount() };
}
