import{c as l,j as e,a as h,o as f,B as u}from"./main-C5rJoLCl.js";import{C as p,a as v,b as g,c as y,d as m,e as x,f as j}from"./command-dpeRkPW7.js";import{P as b,a as C,b as N}from"./popover-Bp_kD6bA.js";import{S as k}from"./separator-CJhMgss0.js";import{C as w}from"./FetchWrapper-DZ79aYT8.js";/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A=l("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const I=l("CircleOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.35 2.69A10 10 0 0 1 21.3 15.65",key:"1pfsoa"}],["path",{d:"M19.08 19.08A10 10 0 1 1 4.92 4.92",key:"1ablyi"}]]);/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F=l("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),z=f("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i({className:r,variant:t,...n}){return e.jsx("div",{className:h(z({variant:t}),r),...n})}function L({column:r,title:t,options:n}){const d=r==null?void 0:r.getFacetedUniqueValues(),s=new Set(r==null?void 0:r.getFilterValue());return e.jsxs(b,{children:[e.jsx(C,{asChild:!0,children:e.jsxs(u,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(F,{}),t,(s==null?void 0:s.size)>0&&e.jsxs(e.Fragment,{children:[e.jsx(k,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(i,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:s.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:s.size>2?e.jsxs(i,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[s.size," selected"]}):n.filter(a=>s.has(a.value)).map(a=>e.jsx(i,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:a.label},a.value))})]})]})}),e.jsx(N,{className:"w-[200px] p-0",align:"start",children:e.jsxs(p,{children:[e.jsx(v,{placeholder:t}),e.jsxs(g,{children:[e.jsx(y,{children:"No results found."}),e.jsx(m,{children:n.map(a=>{const o=s.has(a.value);return e.jsxs(x,{onSelect:()=>{o?s.delete(a.value):s.add(a.value);const c=Array.from(s);r==null||r.setFilterValue(c.length?c:void 0)},children:[e.jsx("div",{className:h("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(w,{})}),a.icon&&e.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:a.label}),(d==null?void 0:d.get(a.value))&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:d.get(a.value)})]},a.value)})}),s.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(j,{}),e.jsx(m,{children:e.jsx(x,{onSelect:()=>r==null?void 0:r.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}export{i as B,A as C,L as D,I as a};
//# sourceMappingURL=data-table-faceted-filter-3oMq9jOA.js.map
