import{r as o,j as r}from"./app-CffHYkHW.js";import{P as j,r as _e}from"./index-DPkgfxsD.js";import{a as be,c as nt,u as Ie,b as _,f as $,d as rt,e as st,h as at,g as lt,R as ct,F as it,D as dt}from"./index-Cy5bElus.js";import{c as Ne,u as ut,R as pt,b as ft,A as mt,C as ht,a as vt}from"./index-C9NeyPdJ.js";import{u as k,e as gt,a as te}from"./utils-C8zp8JNC.js";import{u as xt,V as St}from"./index-CjqRk3xD.js";import{C as Ee}from"./chevron-down-C5A3yn87.js";import{c as Re}from"./createLucideIcon-DAR-hy5d.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yt=Re("Check",wt);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ct=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],It=Re("ChevronUp",Ct);function Pe(t,[n,e]){return Math.min(e,Math.max(n,t))}var Tt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[ie,de,Pt]=ft(J),[oe,vo]=nt(J,[Pt,Ne]),ue=Ne(),[_t,G]=oe(J),[Nt,Et]=oe(J),je=t=>{const{__scopeSelect:n,children:e,open:i,defaultOpen:c,onOpenChange:p,value:a,defaultValue:l,onValueChange:s,dir:f,name:g,autoComplete:w,disabled:b,required:P,form:T}=t,d=ue(n),[v,y]=o.useState(null),[u,h]=o.useState(null),[M,A]=o.useState(!1),ne=ut(f),[N,O]=be({prop:i,defaultProp:c??!1,onChange:p,caller:J}),[W,q]=be({prop:a,defaultProp:l,onChange:s,caller:J}),B=o.useRef(null),V=v?T||!!v.closest("form"):!0,[z,H]=o.useState(new Set),U=Array.from(z).map(E=>E.props.value).join(";");return r.jsx(pt,{...d,children:r.jsxs(_t,{required:P,scope:n,trigger:v,onTriggerChange:y,valueNode:u,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:W,onValueChange:q,open:N,onOpenChange:O,dir:ne,triggerPointerDownPosRef:B,disabled:b,children:[r.jsx(ie.Provider,{scope:n,children:r.jsx(Nt,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:o.useCallback(E=>{H(L=>{const F=new Set(L);return F.delete(E),F})},[]),children:e})}),V?r.jsxs(Qe,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:E=>q(E.target.value),disabled:b,form:T,children:[W===void 0?r.jsx("option",{value:""}):null,Array.from(z)]},U):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=o.forwardRef((t,n)=>{const{__scopeSelect:e,disabled:i=!1,...c}=t,p=ue(e),a=G(Me,e),l=a.disabled||i,s=k(n,a.onTriggerChange),f=de(e),g=o.useRef("touch"),[w,b,P]=tt(d=>{const v=f().filter(h=>!h.disabled),y=v.find(h=>h.value===a.value),u=ot(v,d,y);u!==void 0&&a.onValueChange(u.value)}),T=d=>{l||(a.onOpenChange(!0),P()),d&&(a.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(mt,{asChild:!0,...p,children:r.jsx(j.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(a.value)?"":void 0,...c,ref:s,onClick:_(c.onClick,d=>{d.currentTarget.focus(),g.current!=="mouse"&&T(d)}),onPointerDown:_(c.onPointerDown,d=>{g.current=d.pointerType;const v=d.target;v.hasPointerCapture(d.pointerId)&&v.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(T(d),d.preventDefault())}),onKeyDown:_(c.onKeyDown,d=>{const v=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&b(d.key),!(v&&d.key===" ")&&Tt.includes(d.key)&&(T(),d.preventDefault())})})})});Ae.displayName=Me;var De="SelectValue",Oe=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:i,style:c,children:p,placeholder:a="",...l}=t,s=G(De,e),{onValueNodeHasChildrenChange:f}=s,g=p!==void 0,w=k(n,s.onValueNodeChange);return $(()=>{f(g)},[f,g]),r.jsx(j.span,{...l,ref:w,style:{pointerEvents:"none"},children:et(s.value)?r.jsx(r.Fragment,{children:a}):p})});Oe.displayName=De;var Rt="SelectIcon",Le=o.forwardRef((t,n)=>{const{__scopeSelect:e,children:i,...c}=t;return r.jsx(j.span,{"aria-hidden":!0,...c,ref:n,children:i||"▼"})});Le.displayName=Rt;var jt="SelectPortal",ke=t=>r.jsx(rt,{asChild:!0,...t});ke.displayName=jt;var Q="SelectContent",Be=o.forwardRef((t,n)=>{const e=G(Q,t.__scopeSelect),[i,c]=o.useState();if($(()=>{c(new DocumentFragment)},[]),!e.open){const p=i;return p?_e.createPortal(r.jsx(Ve,{scope:t.__scopeSelect,children:r.jsx(ie.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),p):null}return r.jsx(He,{...t,ref:n})});Be.displayName=Q;var D=10,[Ve,Y]=oe(Q),Mt="SelectContentImpl",At=gt("SelectContent.RemoveScroll"),He=o.forwardRef((t,n)=>{const{__scopeSelect:e,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:p,onPointerDownOutside:a,side:l,sideOffset:s,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:b,collisionPadding:P,sticky:T,hideWhenDetached:d,avoidCollisions:v,...y}=t,u=G(Q,e),[h,M]=o.useState(null),[A,ne]=o.useState(null),N=k(n,m=>M(m)),[O,W]=o.useState(null),[q,B]=o.useState(null),V=de(e),[z,H]=o.useState(!1),U=o.useRef(!1);o.useEffect(()=>{if(h)return at(h)},[h]),lt();const E=o.useCallback(m=>{const[I,...R]=V().map(S=>S.ref.current),[C]=R.slice(-1),x=document.activeElement;for(const S of m)if(S===x||(S==null||S.scrollIntoView({block:"nearest"}),S===I&&A&&(A.scrollTop=0),S===C&&A&&(A.scrollTop=A.scrollHeight),S==null||S.focus(),document.activeElement!==x))return},[V,A]),L=o.useCallback(()=>E([O,h]),[E,O,h]);o.useEffect(()=>{z&&L()},[z,L]);const{onOpenChange:F,triggerPointerDownPosRef:K}=u;o.useEffect(()=>{if(h){let m={x:0,y:0};const I=C=>{var x,S;m={x:Math.abs(Math.round(C.pageX)-(((x=K.current)==null?void 0:x.x)??0)),y:Math.abs(Math.round(C.pageY)-(((S=K.current)==null?void 0:S.y)??0))}},R=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||F(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",R,{capture:!0})}}},[h,F,K]),o.useEffect(()=>{const m=()=>F(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[F]);const[pe,ae]=tt(m=>{const I=V().filter(x=>!x.disabled),R=I.find(x=>x.ref.current===document.activeElement),C=ot(I,m,R);C&&setTimeout(()=>C.ref.current.focus())}),fe=o.useCallback((m,I,R)=>{const C=!U.current&&!R;(u.value!==void 0&&u.value===I||C)&&(W(m),C&&(U.current=!0))},[u.value]),me=o.useCallback(()=>h==null?void 0:h.focus(),[h]),ee=o.useCallback((m,I,R)=>{const C=!U.current&&!R;(u.value!==void 0&&u.value===I||C)&&B(m)},[u.value]),le=i==="popper"?xe:Ue,re=le===xe?{side:l,sideOffset:s,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:b,collisionPadding:P,sticky:T,hideWhenDetached:d,avoidCollisions:v}:{};return r.jsx(Ve,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:L,selectedItemText:q,position:i,isPositioned:z,searchRef:pe,children:r.jsx(ct,{as:At,allowPinchZoom:!0,children:r.jsx(it,{asChild:!0,trapped:u.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:_(c,m=>{var I;(I=u.trigger)==null||I.focus({preventScroll:!0}),m.preventDefault()}),children:r.jsx(dt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:r.jsx(le,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_(y.onKeyDown,m=>{const I=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!I&&m.key.length===1&&ae(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let C=V().filter(x=>!x.disabled).map(x=>x.ref.current);if(["ArrowUp","End"].includes(m.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const x=m.target,S=C.indexOf(x);C=C.slice(S+1)}setTimeout(()=>E(C)),m.preventDefault()}})})})})})})});He.displayName=Mt;var Dt="SelectItemAlignedPosition",Ue=o.forwardRef((t,n)=>{const{__scopeSelect:e,onPlaced:i,...c}=t,p=G(Q,e),a=Y(Q,e),[l,s]=o.useState(null),[f,g]=o.useState(null),w=k(n,N=>g(N)),b=de(e),P=o.useRef(!1),T=o.useRef(!0),{viewport:d,selectedItem:v,selectedItemText:y,focusSelectedItem:u}=a,h=o.useCallback(()=>{if(p.trigger&&p.valueNode&&l&&f&&d&&v&&y){const N=p.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),W=p.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(p.dir!=="rtl"){const x=q.left-O.left,S=W.left-x,X=N.left-S,Z=N.width+X,he=Math.max(Z,O.width),ve=window.innerWidth-D,ge=Pe(S,[D,Math.max(D,ve-he)]);l.style.minWidth=Z+"px",l.style.left=ge+"px"}else{const x=O.right-q.right,S=window.innerWidth-W.right-x,X=window.innerWidth-N.right-S,Z=N.width+X,he=Math.max(Z,O.width),ve=window.innerWidth-D,ge=Pe(S,[D,Math.max(D,ve-he)]);l.style.minWidth=Z+"px",l.style.right=ge+"px"}const B=b(),V=window.innerHeight-D*2,z=d.scrollHeight,H=window.getComputedStyle(f),U=parseInt(H.borderTopWidth,10),E=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),K=U+E+z+F+L,pe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(d),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),ee=N.top+N.height/2-D,le=V-ee,re=v.offsetHeight/2,m=v.offsetTop+re,I=U+E+m,R=K-I;if(I<=ee){const x=B.length>0&&v===B[B.length-1].ref.current;l.style.bottom="0px";const S=f.clientHeight-d.offsetTop-d.offsetHeight,X=Math.max(le,re+(x?me:0)+S+L),Z=I+X;l.style.height=Z+"px"}else{const x=B.length>0&&v===B[0].ref.current;l.style.top="0px";const X=Math.max(ee,U+d.offsetTop+(x?fe:0)+re)+R;l.style.height=X+"px",d.scrollTop=I-ee+d.offsetTop}l.style.margin=`${D}px 0`,l.style.minHeight=pe+"px",l.style.maxHeight=V+"px",i==null||i(),requestAnimationFrame(()=>P.current=!0)}},[b,p.trigger,p.valueNode,l,f,d,v,y,p.dir,i]);$(()=>h(),[h]);const[M,A]=o.useState();$(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const ne=o.useCallback(N=>{N&&T.current===!0&&(h(),u==null||u(),T.current=!1)},[h,u]);return r.jsx(Lt,{scope:e,contentWrapper:l,shouldExpandOnScrollRef:P,onScrollButtonChange:ne,children:r.jsx("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:r.jsx(j.div,{...c,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Ue.displayName=Dt;var Ot="SelectPopperPosition",xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,align:i="start",collisionPadding:c=D,...p}=t,a=ue(e);return r.jsx(ht,{...a,...p,ref:n,align:i,collisionPadding:c,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=Ot;var[Lt,Te]=oe(Q,{}),Se="SelectViewport",Fe=o.forwardRef((t,n)=>{const{__scopeSelect:e,nonce:i,...c}=t,p=Y(Se,e),a=Te(Se,e),l=k(n,p.onViewportChange),s=o.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),r.jsx(ie.Slot,{scope:e,children:r.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:_(c.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:b}=a;if(b!=null&&b.current&&w){const P=Math.abs(s.current-g.scrollTop);if(P>0){const T=window.innerHeight-D*2,d=parseFloat(w.style.minHeight),v=parseFloat(w.style.height),y=Math.max(d,v);if(y<T){const u=y+P,h=Math.min(T,u),M=u-h;w.style.height=h+"px",w.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,w.style.justifyContent="flex-end")}}}s.current=g.scrollTop})})})]})});Fe.displayName=Se;var We="SelectGroup",[kt,Bt]=oe(We),Vt=o.forwardRef((t,n)=>{const{__scopeSelect:e,...i}=t,c=Ie();return r.jsx(kt,{scope:e,id:c,children:r.jsx(j.div,{role:"group","aria-labelledby":c,...i,ref:n})})});Vt.displayName=We;var ze="SelectLabel",Ht=o.forwardRef((t,n)=>{const{__scopeSelect:e,...i}=t,c=Bt(ze,e);return r.jsx(j.div,{id:c.id,...i,ref:n})});Ht.displayName=ze;var ce="SelectItem",[Ut,Ke]=oe(ce),$e=o.forwardRef((t,n)=>{const{__scopeSelect:e,value:i,disabled:c=!1,textValue:p,...a}=t,l=G(ce,e),s=Y(ce,e),f=l.value===i,[g,w]=o.useState(p??""),[b,P]=o.useState(!1),T=k(n,u=>{var h;return(h=s.itemRefCallback)==null?void 0:h.call(s,u,i,c)}),d=Ie(),v=o.useRef("touch"),y=()=>{c||(l.onValueChange(i),l.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(Ut,{scope:e,value:i,disabled:c,textId:d,isSelected:f,onItemTextChange:o.useCallback(u=>{w(h=>h||((u==null?void 0:u.textContent)??"").trim())},[]),children:r.jsx(ie.ItemSlot,{scope:e,value:i,disabled:c,textValue:g,children:r.jsx(j.div,{role:"option","aria-labelledby":d,"data-highlighted":b?"":void 0,"aria-selected":f&&b,"data-state":f?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...a,ref:T,onFocus:_(a.onFocus,()=>P(!0)),onBlur:_(a.onBlur,()=>P(!1)),onClick:_(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:_(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:_(a.onPointerDown,u=>{v.current=u.pointerType}),onPointerMove:_(a.onPointerMove,u=>{var h;v.current=u.pointerType,c?(h=s.onItemLeave)==null||h.call(s):v.current==="mouse"&&u.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(a.onPointerLeave,u=>{var h;u.currentTarget===document.activeElement&&((h=s.onItemLeave)==null||h.call(s))}),onKeyDown:_(a.onKeyDown,u=>{var M;((M=s.searchRef)==null?void 0:M.current)!==""&&u.key===" "||(bt.includes(u.key)&&y(),u.key===" "&&u.preventDefault())})})})})});$e.displayName=ce;var se="SelectItemText",Ge=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:i,style:c,...p}=t,a=G(se,e),l=Y(se,e),s=Ke(se,e),f=Et(se,e),[g,w]=o.useState(null),b=k(n,y=>w(y),s.onItemTextChange,y=>{var u;return(u=l.itemTextRefCallback)==null?void 0:u.call(l,y,s.value,s.disabled)}),P=g==null?void 0:g.textContent,T=o.useMemo(()=>r.jsx("option",{value:s.value,disabled:s.disabled,children:P},s.value),[s.disabled,s.value,P]),{onNativeOptionAdd:d,onNativeOptionRemove:v}=f;return $(()=>(d(T),()=>v(T)),[d,v,T]),r.jsxs(r.Fragment,{children:[r.jsx(j.span,{id:s.textId,...p,ref:b}),s.isSelected&&a.valueNode&&!a.valueNodeHasChildren?_e.createPortal(p.children,a.valueNode):null]})});Ge.displayName=se;var Ye="SelectItemIndicator",qe=o.forwardRef((t,n)=>{const{__scopeSelect:e,...i}=t;return Ke(Ye,e).isSelected?r.jsx(j.span,{"aria-hidden":!0,...i,ref:n}):null});qe.displayName=Ye;var we="SelectScrollUpButton",Xe=o.forwardRef((t,n)=>{const e=Y(we,t.__scopeSelect),i=Te(we,t.__scopeSelect),[c,p]=o.useState(!1),a=k(n,i.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let l=function(){const f=s.scrollTop>0;p(f)};const s=e.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[e.viewport,e.isPositioned]),c?r.jsx(Je,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:s}=e;l&&s&&(l.scrollTop=l.scrollTop-s.offsetHeight)}}):null});Xe.displayName=we;var ye="SelectScrollDownButton",Ze=o.forwardRef((t,n)=>{const e=Y(ye,t.__scopeSelect),i=Te(ye,t.__scopeSelect),[c,p]=o.useState(!1),a=k(n,i.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let l=function(){const f=s.scrollHeight-s.clientHeight,g=Math.ceil(s.scrollTop)<f;p(g)};const s=e.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[e.viewport,e.isPositioned]),c?r.jsx(Je,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:s}=e;l&&s&&(l.scrollTop=l.scrollTop+s.offsetHeight)}}):null});Ze.displayName=ye;var Je=o.forwardRef((t,n)=>{const{__scopeSelect:e,onAutoScroll:i,...c}=t,p=Y("SelectScrollButton",e),a=o.useRef(null),l=de(e),s=o.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return o.useEffect(()=>()=>s(),[s]),$(()=>{var g;const f=l().find(w=>w.ref.current===document.activeElement);(g=f==null?void 0:f.ref.current)==null||g.scrollIntoView({block:"nearest"})},[l]),r.jsx(j.div,{"aria-hidden":!0,...c,ref:n,style:{flexShrink:0,...c.style},onPointerDown:_(c.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(i,50))}),onPointerMove:_(c.onPointerMove,()=>{var f;(f=p.onItemLeave)==null||f.call(p),a.current===null&&(a.current=window.setInterval(i,50))}),onPointerLeave:_(c.onPointerLeave,()=>{s()})})}),Ft="SelectSeparator",Wt=o.forwardRef((t,n)=>{const{__scopeSelect:e,...i}=t;return r.jsx(j.div,{"aria-hidden":!0,...i,ref:n})});Wt.displayName=Ft;var Ce="SelectArrow",zt=o.forwardRef((t,n)=>{const{__scopeSelect:e,...i}=t,c=ue(e),p=G(Ce,e),a=Y(Ce,e);return p.open&&a.position==="popper"?r.jsx(vt,{...c,...i,ref:n}):null});zt.displayName=Ce;var Kt="SelectBubbleInput",Qe=o.forwardRef(({__scopeSelect:t,value:n,...e},i)=>{const c=o.useRef(null),p=k(i,c),a=xt(n);return o.useEffect(()=>{const l=c.current;if(!l)return;const s=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(s,"value").set;if(a!==n&&g){const w=new Event("change",{bubbles:!0});g.call(l,n),l.dispatchEvent(w)}},[a,n]),r.jsx(j.select,{...e,style:{...St,...e.style},ref:p,defaultValue:n})});Qe.displayName=Kt;function et(t){return t===""||t===void 0}function tt(t){const n=st(t),e=o.useRef(""),i=o.useRef(0),c=o.useCallback(a=>{const l=e.current+a;n(l),function s(f){e.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>s(""),1e3))}(l)},[n]),p=o.useCallback(()=>{e.current="",window.clearTimeout(i.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(i.current),[]),[e,c,p]}function ot(t,n,e){const c=n.length>1&&Array.from(n).every(f=>f===n[0])?n[0]:n,p=e?t.indexOf(e):-1;let a=$t(t,Math.max(p,0));c.length===1&&(a=a.filter(f=>f!==e));const s=a.find(f=>f.textValue.toLowerCase().startsWith(c.toLowerCase()));return s!==e?s:void 0}function $t(t,n){return t.map((e,i)=>t[(n+i)%t.length])}var Gt=je,Yt=Ae,qt=Oe,Xt=Le,Zt=ke,Jt=Be,Qt=Fe,eo=$e,to=Ge,oo=qe,no=Xe,ro=Ze;function go({...t}){return r.jsx(Gt,{"data-slot":"select",...t})}function xo({...t}){return r.jsx(qt,{"data-slot":"select-value",...t})}function So({className:t,children:n,...e}){return r.jsxs(Yt,{"data-slot":"select-trigger",className:te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>span]:line-clamp-1",t),...e,children:[n,r.jsx(Xt,{asChild:!0,children:r.jsx(Ee,{className:"size-4 opacity-50"})})]})}function wo({className:t,children:n,position:e="popper",...i}){return r.jsx(Zt,{children:r.jsxs(Jt,{"data-slot":"select-content",className:te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",e==="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",t),position:e,...i,children:[r.jsx(so,{}),r.jsx(Qt,{className:te("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),r.jsx(ao,{})]})})}function yo({className:t,children:n,...e}){return r.jsxs(eo,{"data-slot":"select-item",className:te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...e,children:[r.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r.jsx(oo,{children:r.jsx(yt,{className:"size-4"})})}),r.jsx(to,{children:n})]})}function so({className:t,...n}){return r.jsx(no,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(It,{className:"size-4"})})}function ao({className:t,...n}){return r.jsx(ro,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(Ee,{className:"size-4"})})}export{yt as C,go as S,So as a,xo as b,wo as c,yo as d};
