"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __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__, {
    renderFacetHeader: ()=>renderFacetHeader
});
const external_lit_namespaceObject = require("lit");
const when_js_namespaceObject = require("lit/directives/when.js");
const arrow_bottom_rounded_cjs_namespaceObject = require("../../../../images/arrow-bottom-rounded.cjs");
var arrow_bottom_rounded_cjs_default = /*#__PURE__*/ __webpack_require__.n(arrow_bottom_rounded_cjs_namespaceObject);
const arrow_top_rounded_cjs_namespaceObject = require("../../../../images/arrow-top-rounded.cjs");
var arrow_top_rounded_cjs_default = /*#__PURE__*/ __webpack_require__.n(arrow_top_rounded_cjs_namespaceObject);
const close_cjs_namespaceObject = require("../../../../images/close.cjs");
var close_cjs_default = /*#__PURE__*/ __webpack_require__.n(close_cjs_namespaceObject);
require("../../atomic-icon/atomic-icon.cjs");
const external_button_cjs_namespaceObject = require("../../button.cjs");
const external_heading_cjs_namespaceObject = require("../../heading.cjs");
const renderFacetHeader = ({ props })=>{
    const label = props.i18n.t(props.label);
    const expandFacet = props.i18n.t('expand-facet', {
        label
    });
    const collapseFacet = props.i18n.t('collapse-facet', {
        label
    });
    const clearFilters = props.i18n.t('clear-filters', {
        count: props.numberOfActiveValues
    });
    const clearFiltersForFacet = props.i18n.t('clear-filters-for-facet', {
        count: props.numberOfActiveValues,
        label
    });
    return (0, external_lit_namespaceObject.html)`
    ${(0, external_button_cjs_namespaceObject.renderButton)({
        props: {
            part: 'label-button',
            style: 'text-transparent',
            class: 'flex w-full justify-between rounded-none px-2 py-1 text-lg font-bold',
            ariaLabel: props.isCollapsed ? expandFacet : collapseFacet,
            onClick: props.onToggleCollapse,
            ariaExpanded: props.isCollapsed ? 'false' : 'true',
            ref: (el)=>props.headerRef?.(el)
        }
    })((0, external_lit_namespaceObject.html)`${(0, external_heading_cjs_namespaceObject.renderHeading)({
        props: {
            level: props.headingLevel,
            class: 'truncate'
        }
    })((0, external_lit_namespaceObject.html)`${label}`)}
        <atomic-icon
          part="label-button-icon"
          class="ml-4 w-3 shrink-0 self-center"
          .icon=${props.isCollapsed ? arrow_bottom_rounded_cjs_default() : arrow_top_rounded_cjs_default()}
        ></atomic-icon>`)}
    ${(0, when_js_namespaceObject.when)(props.onClearFilters && props.numberOfActiveValues > 0, ()=>(0, external_lit_namespaceObject.html)`${(0, external_button_cjs_namespaceObject.renderButton)({
            props: {
                part: 'clear-button',
                style: 'text-primary',
                class: 'flex max-w-full items-baseline p-2 text-sm',
                ariaLabel: clearFiltersForFacet,
                onClick: props.onClearFilters
            }
        })((0, external_lit_namespaceObject.html)`<atomic-icon
              part="clear-button-icon"
              class="mr-1 h-2 w-2"
              .icon=${close_cjs_default()}
            ></atomic-icon>
            <span>${clearFilters}</span>`)}`, ()=>external_lit_namespaceObject.nothing)}
  `;
};
exports.renderFacetHeader = __webpack_exports__.renderFacetHeader;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderFacetHeader"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
