"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),N=require("react"),o=require("../../utils/cn/cn.cjs.js"),e=require("../../src/components/FilterMenu/filterMenu.module.css"),r=require("../Typography/Typography.cjs.js"),x=require("../Icon/Icon.cjs.js"),d=require("../Icon/constants.cjs.js");function _({label:m,open:u=!1,multiple:p,options:h,selectedValue:a,headerNode:l,onSelect:g}){const[t,y]=N.useState(u),b=()=>y(s=>!s);return n.jsxs("div",{className:e.root,children:[n.jsxs("button",{className:e.toggleButton,onClick:b,children:[n.jsx(r.Typography,{defaultVariant:"labelLg",emphasis:!0,children:m}),n.jsx(x.Icon,{name:t?d.EIconName.REMOVE:d.EIconName.PLUS,className:e.toggleIcon})]}),n.jsx("div",{className:o.cn(e.menu,t&&e.isOpen),role:"menu",children:n.jsxs("div",{className:e.menuContent,children:[l,h.map((s,i)=>n.jsxs("ul",{className:e.subOptions,children:[s.label&&n.jsx("li",{className:o.cn(e.divider,{[e.dividerLine]:!!(l||i!==0)}),children:n.jsx(r.Typography,{as:"div",defaultVariant:"bodyMd",weight:"medium",className:e.dividerLabel,children:s.label})},i),s.values.map(({value:c,label:j})=>n.jsx("li",{className:e.option,onClick:()=>g(c,s),children:n.jsx(r.Typography,{as:"div",defaultVariant:"bodyMd",className:o.cn(e.optionLabel,{[e.selected]:p?a==null?void 0:a.includes(c):c===a}),children:j})},c))]},`${s.label}_${i}`))]})})]})}exports.FilterMenu=_;
