<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
/** @var \Magento\LayeredNavigation\Block\Navigation\FilterRenderer $block */
/** @var \Magento\Framework\Escaper $escaper */
/** @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter */
/** @var \Magento\LayeredNavigation\ViewModel\Layer\Filter $viewModel */
$viewModel = $block->getData('product_layer_view_model');
?>

<ol class="items">
    <?php foreach ($filterItems as $filterItem): ?>
        <li class="item">
            <?php if ($filterItem->getCount() > 0): ?>
                <a href="<?= $block->escapeUrl($filterItem->getUrl()) ?>" rel="nofollow">
                    <?= /* @escapeNotVerified */ $filterItem->getLabel() ?>
                </a>
                <?php if ($viewModel->shouldDisplayProductCountOnLayer()): ?>
                    <span class="count"><?= /* @noEscape */ $localeFormatter->formatNumber((int) $filterItem->getCount()) ?><span class="filter-count-label">
                    <?php if ($filterItem->getCount() == 1):?> <?= /* @escapeNotVerified */ __('item') ?><?php else:?> <?= /* @escapeNotVerified */ __('items') ?><?php endif;?></span></span>
                <?php endif; ?>
            <?php else:?>
                <strong><?= /* @escapeNotVerified */ $filterItem->getLabel() ?></strong>
                <?php if ($viewModel->shouldDisplayProductCountOnLayer()): ?>
                    <span class="count"><?= /* @noEscape */ $localeFormatter->formatNumber((int) $filterItem->getCount()) ?><span class="filter-count-label">
                        <?php if ($filterItem->getCount() == 1):?><?= /* @escapeNotVerified */ __('item') ?><?php else:?><?= /* @escapeNotVerified */ __('items') ?><?php endif;?></span></span>
                <?php endif; ?>
            <?php endif; ?>
        </li>
    <?php endforeach ?>
</ol>
