import { html } from "lit";
const renderWrapHighlight = ({ props })=>{
    const part = `highlight${props.part ? ` ${props.part}` : ''}`;
    return html`<span class="font-bold" part="${part}">${props.content}</span>`;
};
const getQuerySummaryI18nParameters = (props)=>getQuerySummaryData(props, {
        loadingStatus: 'loading-results',
        itemsForQuery: 'showing-results-of-with-query',
        allItems: 'showing-results-of'
    });
const getProductQuerySummaryI18nParameters = (props)=>getQuerySummaryData(props, {
        loadingStatus: 'loading-products',
        itemsForQuery: 'showing-products-of-with-query',
        allItems: 'showing-products-of'
    });
const getQuerySummaryData = ({ first, last, query, total, isLoading, i18n }, { allItems, itemsForQuery, loadingStatus })=>{
    const i18nKey = '' === query ? allItems : itemsForQuery;
    const locale = i18n.language;
    const params = {
        first: first.toLocaleString(locale),
        last: last.toLocaleString(locale),
        total: total.toLocaleString(locale),
        query: query,
        count: last
    };
    const highlights = {
        first: renderWrapHighlight({
            props: {
                content: params.first
            }
        }),
        last: renderWrapHighlight({
            props: {
                content: params.last
            }
        }),
        total: renderWrapHighlight({
            props: {
                content: params.total
            }
        }),
        query: renderWrapHighlight({
            props: {
                part: 'query',
                content: params.query
            }
        })
    };
    const ariaLiveMessage = isLoading ? i18n.t(loadingStatus) : `${i18n.t('results-loaded')} ${i18n.t(i18nKey, params)}`;
    return {
        i18nKey,
        highlights,
        ariaLiveMessage
    };
};
export { getProductQuerySummaryI18nParameters, getQuerySummaryI18nParameters };
