import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$h as t,Gy as n,Hy as r,Ly as i,m_ as a,v as o}from"./index-DDwwBb9e.js";var s=e(n()),c=e(t());function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function u(e,t){if(e==null)return{};var n=d(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function d(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var f=(0,s.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=u(e,[`color`,`size`]);return s.createElement(`svg`,l({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),s.createElement(`polygon`,{points:`22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3`}))});f.propTypes={color:c.default.string,size:c.default.oneOfType([c.default.string,c.default.number])},f.displayName=`Filter`;var p=r(),m=({children:e,fontSize:t=`sm`,hasBorder:n=!1})=>(0,p.jsxs)(a,{fontSize:t,width:`100%`,gap:2,paddingX:2,paddingY:1,border:n?`1px solid lightgray`:`none`,borderRadius:`md`,children:[(0,p.jsx)(i,{color:`fg.subtle`,children:(0,p.jsx)(f,{width:16,style:{minWidth:16}})}),e]}),h=({children:e})=>(0,p.jsx)(i,{padding:1,fontWeight:`500`,textTransform:`capitalize`,color:`fg.subtle`,children:String(e).split(`.`).filter((e,t)=>t!==0||e.toLowerCase()===`evaluations`).join(` `).replace(`_`,` `)}),g=({children:e})=>(0,p.jsx)(i,{padding:1,borderRightRadius:`md`,children:(0,p.jsx)(o,{lineClamp:1,expandable:!1,children:e})}),_=({filters:e,hasBorder:t=!1})=>(0,p.jsx)(p.Fragment,{children:(e=>{let n=typeof e==`string`?JSON.parse(e):e,r=[];for(let[e,i]of Object.entries(n))if(Array.isArray(i))r.push((0,p.jsxs)(m,{hasBorder:t,children:[(0,p.jsx)(h,{children:e}),(0,p.jsx)(g,{children:i.join(`, `)})]},e));else if(typeof i==`object`&&i){let n=[];for(let[e,t]of Object.entries(i))if(Array.isArray(t))n.push(`${e}: ${t.join(`, `)}`);else if(typeof t==`object`&&t)for(let[r,i]of Object.entries(t))Array.isArray(i)&&n.push(`${e} → ${r}: ${i.join(`, `)}`);else n.push(`${e}: ${String(t)}`);r.push((0,p.jsxs)(m,{hasBorder:t,children:[(0,p.jsx)(h,{children:e}),(0,p.jsx)(g,{children:n.join(`; `)})]},e))}else r.push((0,p.jsxs)(m,{fontSize:`xs`,hasBorder:t,children:[(0,p.jsx)(h,{children:e}),(0,p.jsx)(g,{children:String(i)})]},e));return r})(e)});export{f as n,_ as t};
//# sourceMappingURL=FilterDisplay-aNzbZYde.js.map