import{React as o,jsxRuntimeExports as e}from"./vendor-react.js";import{Root2$6 as b,Value as S,Trigger$5 as i,X as v,Icon as R,ChevronDown as m,Portal$3 as I,Content2$4 as p,Viewport$1 as $,Item$1 as f,ItemIndicator as D,Check as B,ItemText as P,ScrollUpButton as u,ChevronUp as T,ScrollDownButton as x,Label as h,Separator as g}from"./vendor-common.js";import{cn as r}from"./dialog.js";const q=b,A=S,V=o.forwardRef(({className:a,children:s,clearable:t=!1,hasValue:l=!1,onClear:n,disabled:d,...N},j)=>e.jsxs(i,{ref:j,className:r("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),disabled:d,...N,children:[s,e.jsxs("div",{className:"flex items-center gap-1",children:[t&&l&&!d?e.jsx("span",{role:"button","aria-label":"清除选择",className:"inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onPointerDown:c=>{c.preventDefault(),c.stopPropagation(),n==null||n()},children:e.jsx(v,{className:"h-3.5 w-3.5"})}):null,e.jsx(R,{asChild:!0,children:e.jsx(m,{className:"h-4 w-4 opacity-50"})})]})]}));V.displayName=i.displayName;const w=o.forwardRef(({className:a,...s},t)=>e.jsx(u,{ref:t,className:r("flex cursor-default items-center justify-center py-1",a),...s,children:e.jsx(T,{className:"h-4 w-4"})}));w.displayName=u.displayName;const y=o.forwardRef(({className:a,...s},t)=>e.jsx(x,{ref:t,className:r("flex cursor-default items-center justify-center py-1",a),...s,children:e.jsx(m,{className:"h-4 w-4"})}));y.displayName=x.displayName;const k=o.forwardRef(({className:a,children:s,position:t="popper",...l},n)=>e.jsx(I,{children:e.jsxs(p,{ref:n,className:r("relative z-[120] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:t,...l,children:[e.jsx(w,{}),e.jsx($,{className:r("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(y,{})]})}));k.displayName=p.displayName;const C=o.forwardRef(({className:a,...s},t)=>e.jsx(h,{ref:t,className:r("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s}));C.displayName=h.displayName;const U=o.forwardRef(({className:a,children:s,...t},l)=>e.jsxs(f,{ref:l,className:r("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(D,{children:e.jsx(B,{className:"h-4 w-4"})})}),e.jsx(P,{children:s})]}));U.displayName=f.displayName;const L=o.forwardRef(({className:a,...s},t)=>e.jsx(g,{ref:t,className:r("-mx-1 my-1 h-px bg-muted",a),...s}));L.displayName=g.displayName;export{q as Select,k as SelectContent,U as SelectItem,V as SelectTrigger,A as SelectValue};
