import { shouldUpdateFacetSearchComponent } from "./facet-search-utils.js";
function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n) {
    let prevState = facet.state.facetSearch;
    facet.subscribe(()=>{
        if (shouldUpdateFacetSearchComponent(facet.state.facetSearch, prevState) && facet.state.facetSearch.query) {
            prevState = facet.state.facetSearch;
            setAriaLive(i18n.t('facet-search-results-count', {
                count: facet.state.facetSearch.values.length,
                label
            }));
        }
    });
}
export { announceFacetSearchResultsWithAriaLive };
