"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    getProductQuerySummaryI18nParameters: ()=>getProductQuerySummaryI18nParameters,
    getQuerySummaryI18nParameters: ()=>getQuerySummaryI18nParameters
});
const external_lit_namespaceObject = require("lit");
const renderWrapHighlight = ({ props })=>{
    const part = `highlight${props.part ? ` ${props.part}` : ''}`;
    return (0, external_lit_namespaceObject.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
    };
};
exports.getProductQuerySummaryI18nParameters = __webpack_exports__.getProductQuerySummaryI18nParameters;
exports.getQuerySummaryI18nParameters = __webpack_exports__.getQuerySummaryI18nParameters;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "getProductQuerySummaryI18nParameters",
    "getQuerySummaryI18nParameters"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
