llmtap 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +29 -0
  2. package/dist/dashboard/assets/CommandBar-CBRbPbgc.js +1 -0
  3. package/dist/dashboard/assets/Costs-B-TMvDlI.js +1 -0
  4. package/dist/dashboard/assets/Dashboard-CFNAMjdc.js +1 -0
  5. package/dist/dashboard/assets/DataTable-p1PD-dJj.js +1 -0
  6. package/dist/dashboard/assets/EmptyState-xDl-M9Rz.js +1 -0
  7. package/dist/dashboard/assets/GettingStartedPanel-Cn46fQ1w.js +18 -0
  8. package/dist/dashboard/assets/Models-BpMhGVp5.js +1 -0
  9. package/dist/dashboard/assets/ProviderBadge-Cs31007s.js +1 -0
  10. package/dist/dashboard/assets/Sessions-CiKyTRlP.js +3 -0
  11. package/dist/dashboard/assets/Settings-7wRfCPnB.js +6 -0
  12. package/dist/dashboard/assets/TraceDetail-CKDDbbEV.js +17 -0
  13. package/dist/dashboard/assets/Traces-BYWwPP14.js +1 -0
  14. package/dist/dashboard/assets/accordion-CC_sxDZ8.js +1 -0
  15. package/dist/dashboard/assets/content-DZmxO8bn.js +2 -0
  16. package/dist/dashboard/assets/format-zoXqpaOb.js +1 -0
  17. package/dist/dashboard/assets/icons-BOLUIAKd.js +1 -0
  18. package/dist/dashboard/assets/index-CtlcBMi-.css +1 -0
  19. package/dist/dashboard/assets/index-DG2eF3M2.js +14 -0
  20. package/dist/dashboard/assets/motion-CSeNjKbZ.js +17 -0
  21. package/dist/dashboard/assets/{number-ticker-C1hiu1bi.js → number-ticker-CjofSQ3s.js} +1 -1
  22. package/dist/dashboard/assets/provider-colors-CTiHNYHs.js +1 -0
  23. package/dist/dashboard/assets/query-DVWnIZNd.js +4 -0
  24. package/dist/dashboard/assets/select-BJEJvQo4.js +1 -0
  25. package/dist/dashboard/assets/statistics-with-status-grid-tcb9SpIY.js +1 -0
  26. package/dist/dashboard/assets/ui-BFiKdTjl.js +51 -0
  27. package/dist/dashboard/index.html +6 -6
  28. package/dist/index.js +332 -107
  29. package/dist/index.js.map +1 -1
  30. package/package.json +6 -4
  31. package/dist/dashboard/assets/Costs-DcNWZXjX.js +0 -1
  32. package/dist/dashboard/assets/Dashboard-Dkx38fyX.js +0 -9
  33. package/dist/dashboard/assets/DataTable-CBsuKoTx.js +0 -1
  34. package/dist/dashboard/assets/Models-CESHenJX.js +0 -1
  35. package/dist/dashboard/assets/Sessions-BcRE0OFh.js +0 -3
  36. package/dist/dashboard/assets/Settings-BUDP0ZDT.js +0 -12
  37. package/dist/dashboard/assets/StatusDot-BAf4TSfE.js +0 -1
  38. package/dist/dashboard/assets/TraceDetail-ByibqI-g.js +0 -17
  39. package/dist/dashboard/assets/Traces-D9kJG7O9.js +0 -1
  40. package/dist/dashboard/assets/charts-BXAtT8sy.js +0 -89
  41. package/dist/dashboard/assets/constants-OlSc-7iA.js +0 -1
  42. package/dist/dashboard/assets/content-BRoZVvRJ.js +0 -2
  43. package/dist/dashboard/assets/format-CgXokIEM.js +0 -1
  44. package/dist/dashboard/assets/icons-DhpK1vUv.js +0 -1
  45. package/dist/dashboard/assets/index-C7GMIuGj.css +0 -1
  46. package/dist/dashboard/assets/index-jVcSWGwX.js +0 -58
  47. package/dist/dashboard/assets/motion-Bw6xJyTE.js +0 -9
  48. package/dist/dashboard/assets/provider-colors-DcHYMgVv.js +0 -1
  49. package/dist/dashboard/assets/query-BSZkMKN4.js +0 -4
  50. package/dist/dashboard/assets/select-CbYE6Q0M.js +0 -1
@@ -1 +0,0 @@
1
- import{r as n,j as r,R as ee}from"./query-BSZkMKN4.js";import{S as gt,c as K,w as Me,q as O,G as Se,H as Re,I as St,J as Ne,K as Y,M as A,N as je,V as wt,Q as Ct,s as R,U as yt,X as bt,Y as It,Z as Nt,_ as Tt,$ as Rt,a0 as Pt,a1 as _t}from"./index-jVcSWGwX.js";import{c as Et,a as Ae,h as Mt}from"./charts-BXAtT8sy.js";import{n as Oe,z as jt,m as At}from"./icons-DhpK1vUv.js";const Pe=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,_e=Et,Ot=(t,o)=>e=>{var l;if(o?.variants==null)return _e(t,e?.class,e?.className);const{variants:a,defaultVariants:u}=o,s=Object.keys(a).map(p=>{const v=e?.[p],g=u?.[p];if(v===null)return null;const w=Pe(v)||Pe(g);return a[p][w]}),c=e&&Object.entries(e).reduce((p,v)=>{let[g,w]=v;return w===void 0||(p[g]=w),p},{}),i=o==null||(l=o.compoundVariants)===null||l===void 0?void 0:l.reduce((p,v)=>{let{class:g,className:w,...y}=v;return Object.entries(y).every(C=>{let[d,m]=C;return Array.isArray(m)?m.includes({...u,...c}[d]):{...u,...c}[d]===m})?[...p,g,w]:p},[]);return _e(t,s,i,e?.class,e?.className)},Dt=Ot("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-2xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/50 focus-visible:ring-offset-2 focus-visible:ring-offset-slate-950 disabled:pointer-events-none disabled:opacity-50 cursor-pointer [&_svg]:pointer-events-none [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-emerald-500 text-slate-950 shadow-[0_0_20px_rgba(16,185,129,0.3)] hover:bg-emerald-400",destructive:"bg-rose-500/20 text-rose-300 border border-rose-400/20 hover:bg-rose-500/30",outline:"border border-white/10 bg-white/4 text-slate-200 hover:bg-white/8 hover:border-white/15",secondary:"bg-white/6 text-slate-200 border border-white/8 hover:bg-white/10",ghost:"text-slate-400 hover:bg-white/6 hover:text-slate-200",link:"text-emerald-400 underline-offset-4 hover:underline"},size:{default:"h-10 px-5 py-2",sm:"h-8 rounded-xl px-3.5 text-xs",lg:"h-12 rounded-2xl px-8 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Lt=n.forwardRef(({className:t,variant:o,size:e,asChild:l=!1,...a},u)=>{const s=l?gt:"button";return r.jsx(s,{className:K(Dt({variant:o,size:e,className:t})),ref:u,...a})});Lt.displayName="Button";function Ee(t,[o,e]){return Math.min(e,Math.max(o,t))}function Vt(t){const o=t+"CollectionProvider",[e,l]=Me(o),[a,u]=e(o,{collectionRef:{current:null},itemMap:new Map}),s=d=>{const{scope:m,children:S}=d,f=ee.useRef(null),x=ee.useRef(new Map).current;return r.jsx(a,{scope:m,itemMap:x,collectionRef:f,children:S})};s.displayName=o;const c=t+"CollectionSlot",i=Se(c),p=ee.forwardRef((d,m)=>{const{scope:S,children:f}=d,x=u(c,S),P=O(m,x.collectionRef);return r.jsx(i,{ref:P,children:f})});p.displayName=c;const v=t+"CollectionItemSlot",g="data-radix-collection-item",w=Se(v),y=ee.forwardRef((d,m)=>{const{scope:S,children:f,...x}=d,P=ee.useRef(null),E=O(m,P),L=u(v,S);return ee.useEffect(()=>(L.itemMap.set(P,{ref:P,...x}),()=>{L.itemMap.delete(P)})),r.jsx(w,{[g]:"",ref:E,children:f})});y.displayName=v;function C(d){const m=u(t+"CollectionConsumer",d);return ee.useCallback(()=>{const f=m.collectionRef.current;if(!f)return[];const x=Array.from(f.querySelectorAll(`[${g}]`));return Array.from(m.itemMap.values()).sort((L,_)=>x.indexOf(L.ref.current)-x.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:p,ItemSlot:y},C,l]}var kt=n.createContext(void 0);function Bt(t){const o=n.useContext(kt);return t||o||"ltr"}function Ht(t){const o=n.useRef({value:t,previous:t});return n.useMemo(()=>(o.current.value!==t&&(o.current.previous=o.current.value,o.current.value=t),o.current.previous),[t])}var Ut=[" ","Enter","ArrowUp","ArrowDown"],Ft=[" ","Enter"],te="Select",[de,ue,Wt]=Vt(te),[re]=Me(te,[Wt,je]),pe=je(),[Kt,q]=re(te),[$t,zt]=re(te),De=t=>{const{__scopeSelect:o,children:e,open:l,defaultOpen:a,onOpenChange:u,value:s,defaultValue:c,onValueChange:i,dir:p,name:v,autoComplete:g,disabled:w,required:y,form:C}=t,d=pe(o),[m,S]=n.useState(null),[f,x]=n.useState(null),[P,E]=n.useState(!1),L=Bt(p),[_,V]=Re({prop:l,defaultProp:a??!1,onChange:u,caller:te}),[$,Z]=Re({prop:s,defaultProp:c,onChange:i,caller:te}),B=n.useRef(null),H=m?C||!!m.closest("form"):!0,[z,U]=n.useState(new Set),F=Array.from(z).map(M=>M.props.value).join(";");return r.jsx(St,{...d,children:r.jsxs(Kt,{required:y,scope:o,trigger:m,onTriggerChange:S,valueNode:f,onValueNodeChange:x,valueNodeHasChildren:P,onValueNodeHasChildrenChange:E,contentId:Ne(),value:$,onValueChange:Z,open:_,onOpenChange:V,dir:L,triggerPointerDownPosRef:B,disabled:w,children:[r.jsx(de.Provider,{scope:o,children:r.jsx($t,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(M=>{U(k=>new Set(k).add(M))},[]),onNativeOptionRemove:n.useCallback(M=>{U(k=>{const W=new Set(k);return W.delete(M),W})},[]),children:e})}),H?r.jsxs(st,{"aria-hidden":!0,required:y,tabIndex:-1,name:v,autoComplete:g,value:$,onChange:M=>Z(M.target.value),disabled:w,form:C,children:[$===void 0?r.jsx("option",{value:""}):null,Array.from(z)]},F):null]})})};De.displayName=te;var Le="SelectTrigger",Ve=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:l=!1,...a}=t,u=pe(e),s=q(Le,e),c=s.disabled||l,i=O(o,s.onTriggerChange),p=ue(e),v=n.useRef("touch"),[g,w,y]=at(d=>{const m=p().filter(x=>!x.disabled),S=m.find(x=>x.value===s.value),f=ct(m,d,S);f!==void 0&&s.onValueChange(f.value)}),C=d=>{c||(s.onOpenChange(!0),y()),d&&(s.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(Ct,{asChild:!0,...u,children:r.jsx(A.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":lt(s.value)?"":void 0,...a,ref:i,onClick:R(a.onClick,d=>{d.currentTarget.focus(),v.current!=="mouse"&&C(d)}),onPointerDown:R(a.onPointerDown,d=>{v.current=d.pointerType;const m=d.target;m.hasPointerCapture(d.pointerId)&&m.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(C(d),d.preventDefault())}),onKeyDown:R(a.onKeyDown,d=>{const m=g.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&w(d.key),!(m&&d.key===" ")&&Ut.includes(d.key)&&(C(),d.preventDefault())})})})});Ve.displayName=Le;var ke="SelectValue",Be=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:l,style:a,children:u,placeholder:s="",...c}=t,i=q(ke,e),{onValueNodeHasChildrenChange:p}=i,v=u!==void 0,g=O(o,i.onValueNodeChange);return Y(()=>{p(v)},[p,v]),r.jsx(A.span,{...c,ref:g,style:{pointerEvents:"none"},children:lt(i.value)?r.jsx(r.Fragment,{children:s}):u})});Be.displayName=ke;var Gt="SelectIcon",He=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:l,...a}=t;return r.jsx(A.span,{"aria-hidden":!0,...a,ref:o,children:l||"▼"})});He.displayName=Gt;var Yt="SelectPortal",Ue=t=>r.jsx(yt,{asChild:!0,...t});Ue.displayName=Yt;var oe="SelectContent",Fe=n.forwardRef((t,o)=>{const e=q(oe,t.__scopeSelect),[l,a]=n.useState();if(Y(()=>{a(new DocumentFragment)},[]),!e.open){const u=l;return u?Ae.createPortal(r.jsx(We,{scope:t.__scopeSelect,children:r.jsx(de.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),u):null}return r.jsx(Ke,{...t,ref:o})});Fe.displayName=oe;var D=10,[We,X]=re(oe),qt="SelectContentImpl",Xt=Se("SelectContent.RemoveScroll"),Ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:l="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:u,onPointerDownOutside:s,side:c,sideOffset:i,align:p,alignOffset:v,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:C,hideWhenDetached:d,avoidCollisions:m,...S}=t,f=q(oe,e),[x,P]=n.useState(null),[E,L]=n.useState(null),_=O(o,h=>P(h)),[V,$]=n.useState(null),[Z,B]=n.useState(null),H=ue(e),[z,U]=n.useState(!1),F=n.useRef(!1);n.useEffect(()=>{if(x)return Mt(x)},[x]),It();const M=n.useCallback(h=>{const[N,...j]=H().map(T=>T.ref.current),[b]=j.slice(-1),I=document.activeElement;for(const T of h)if(T===I||(T?.scrollIntoView({block:"nearest"}),T===N&&E&&(E.scrollTop=0),T===b&&E&&(E.scrollTop=E.scrollHeight),T?.focus(),document.activeElement!==I))return},[H,E]),k=n.useCallback(()=>M([V,x]),[M,V,x]);n.useEffect(()=>{z&&k()},[z,k]);const{onOpenChange:W,triggerPointerDownPosRef:G}=f;n.useEffect(()=>{if(x){let h={x:0,y:0};const N=b=>{h={x:Math.abs(Math.round(b.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(G.current?.y??0))}},j=b=>{h.x<=10&&h.y<=10?b.preventDefault():x.contains(b.target)||W(!1),document.removeEventListener("pointermove",N),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",N),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",j,{capture:!0})}}},[x,W,G]),n.useEffect(()=>{const h=()=>W(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[W]);const[fe,ae]=at(h=>{const N=H().filter(I=>!I.disabled),j=N.find(I=>I.ref.current===document.activeElement),b=ct(N,h,j);b&&setTimeout(()=>b.ref.current.focus())}),me=n.useCallback((h,N,j)=>{const b=!F.current&&!j;(f.value!==void 0&&f.value===N||b)&&($(h),b&&(F.current=!0))},[f.value]),he=n.useCallback(()=>x?.focus(),[x]),ne=n.useCallback((h,N,j)=>{const b=!F.current&&!j;(f.value!==void 0&&f.value===N||b)&&B(h)},[f.value]),ce=l==="popper"?we:$e,se=ce===we?{side:c,sideOffset:i,align:p,alignOffset:v,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:C,hideWhenDetached:d,avoidCollisions:m}:{};return r.jsx(We,{scope:e,content:x,viewport:E,onViewportChange:L,itemRefCallback:me,selectedItem:V,onItemLeave:he,itemTextRefCallback:ne,focusSelectedItem:k,selectedItemText:Z,position:l,isPositioned:z,searchRef:fe,children:r.jsx(Nt,{as:Xt,allowPinchZoom:!0,children:r.jsx(Tt,{asChild:!0,trapped:f.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:R(a,h=>{f.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:r.jsx(Rt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:r.jsx(ce,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:h=>h.preventDefault(),...S,...se,onPlaced:()=>U(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:R(S.onKeyDown,h=>{const N=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!N&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let b=H().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(h.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const I=h.target,T=b.indexOf(I);b=b.slice(T+1)}setTimeout(()=>M(b)),h.preventDefault()}})})})})})})});Ke.displayName=qt;var Zt="SelectItemAlignedPosition",$e=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:l,...a}=t,u=q(oe,e),s=X(oe,e),[c,i]=n.useState(null),[p,v]=n.useState(null),g=O(o,_=>v(_)),w=ue(e),y=n.useRef(!1),C=n.useRef(!0),{viewport:d,selectedItem:m,selectedItemText:S,focusSelectedItem:f}=s,x=n.useCallback(()=>{if(u.trigger&&u.valueNode&&c&&p&&d&&m&&S){const _=u.trigger.getBoundingClientRect(),V=p.getBoundingClientRect(),$=u.valueNode.getBoundingClientRect(),Z=S.getBoundingClientRect();if(u.dir!=="rtl"){const I=Z.left-V.left,T=$.left-I,J=_.left-T,Q=_.width+J,ve=Math.max(Q,V.width),xe=window.innerWidth-D,ge=Ee(T,[D,Math.max(D,xe-ve)]);c.style.minWidth=Q+"px",c.style.left=ge+"px"}else{const I=V.right-Z.right,T=window.innerWidth-$.right-I,J=window.innerWidth-_.right-T,Q=_.width+J,ve=Math.max(Q,V.width),xe=window.innerWidth-D,ge=Ee(T,[D,Math.max(D,xe-ve)]);c.style.minWidth=Q+"px",c.style.right=ge+"px"}const B=w(),H=window.innerHeight-D*2,z=d.scrollHeight,U=window.getComputedStyle(p),F=parseInt(U.borderTopWidth,10),M=parseInt(U.paddingTop,10),k=parseInt(U.borderBottomWidth,10),W=parseInt(U.paddingBottom,10),G=F+M+z+W+k,fe=Math.min(m.offsetHeight*5,G),ae=window.getComputedStyle(d),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),ne=_.top+_.height/2-D,ce=H-ne,se=m.offsetHeight/2,h=m.offsetTop+se,N=F+M+h,j=G-N;if(N<=ne){const I=B.length>0&&m===B[B.length-1].ref.current;c.style.bottom="0px";const T=p.clientHeight-d.offsetTop-d.offsetHeight,J=Math.max(ce,se+(I?he:0)+T+k),Q=N+J;c.style.height=Q+"px"}else{const I=B.length>0&&m===B[0].ref.current;c.style.top="0px";const J=Math.max(ne,F+d.offsetTop+(I?me:0)+se)+j;c.style.height=J+"px",d.scrollTop=N-ne+d.offsetTop}c.style.margin=`${D}px 0`,c.style.minHeight=fe+"px",c.style.maxHeight=H+"px",l?.(),requestAnimationFrame(()=>y.current=!0)}},[w,u.trigger,u.valueNode,c,p,d,m,S,u.dir,l]);Y(()=>x(),[x]);const[P,E]=n.useState();Y(()=>{p&&E(window.getComputedStyle(p).zIndex)},[p]);const L=n.useCallback(_=>{_&&C.current===!0&&(x(),f?.(),C.current=!1)},[x,f]);return r.jsx(Qt,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:L,children:r.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:r.jsx(A.div,{...a,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});$e.displayName=Zt;var Jt="SelectPopperPosition",we=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:l="start",collisionPadding:a=D,...u}=t,s=pe(e);return r.jsx(Pt,{...s,...u,ref:o,align:l,collisionPadding:a,style:{boxSizing:"border-box",...u.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)"}})});we.displayName=Jt;var[Qt,Te]=re(oe,{}),Ce="SelectViewport",ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:l,...a}=t,u=X(Ce,e),s=Te(Ce,e),c=O(o,u.onViewportChange),i=n.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:l}),r.jsx(de.Slot,{scope:e,children:r.jsx(A.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:R(a.onScroll,p=>{const v=p.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(i.current-v.scrollTop);if(y>0){const C=window.innerHeight-D*2,d=parseFloat(g.style.minHeight),m=parseFloat(g.style.height),S=Math.max(d,m);if(S<C){const f=S+y,x=Math.min(C,f),P=f-x;g.style.height=x+"px",g.style.bottom==="0px"&&(v.scrollTop=P>0?P:0,g.style.justifyContent="flex-end")}}}i.current=v.scrollTop})})})]})});ze.displayName=Ce;var Ge="SelectGroup",[eo,to]=re(Ge),oo=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t,a=Ne();return r.jsx(eo,{scope:e,id:a,children:r.jsx(A.div,{role:"group","aria-labelledby":a,...l,ref:o})})});oo.displayName=Ge;var Ye="SelectLabel",qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t,a=to(Ye,e);return r.jsx(A.div,{id:a.id,...l,ref:o})});qe.displayName=Ye;var ie="SelectItem",[no,Xe]=re(ie),Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:l,disabled:a=!1,textValue:u,...s}=t,c=q(ie,e),i=X(ie,e),p=c.value===l,[v,g]=n.useState(u??""),[w,y]=n.useState(!1),C=O(o,f=>i.itemRefCallback?.(f,l,a)),d=Ne(),m=n.useRef("touch"),S=()=>{a||(c.onValueChange(l),c.onOpenChange(!1))};if(l==="")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(no,{scope:e,value:l,disabled:a,textId:d,isSelected:p,onItemTextChange:n.useCallback(f=>{g(x=>x||(f?.textContent??"").trim())},[]),children:r.jsx(de.ItemSlot,{scope:e,value:l,disabled:a,textValue:v,children:r.jsx(A.div,{role:"option","aria-labelledby":d,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:C,onFocus:R(s.onFocus,()=>y(!0)),onBlur:R(s.onBlur,()=>y(!1)),onClick:R(s.onClick,()=>{m.current!=="mouse"&&S()}),onPointerUp:R(s.onPointerUp,()=>{m.current==="mouse"&&S()}),onPointerDown:R(s.onPointerDown,f=>{m.current=f.pointerType}),onPointerMove:R(s.onPointerMove,f=>{m.current=f.pointerType,a?i.onItemLeave?.():m.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(s.onPointerLeave,f=>{f.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:R(s.onKeyDown,f=>{i.searchRef?.current!==""&&f.key===" "||(Ft.includes(f.key)&&S(),f.key===" "&&f.preventDefault())})})})})});Ze.displayName=ie;var le="SelectItemText",Je=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:l,style:a,...u}=t,s=q(le,e),c=X(le,e),i=Xe(le,e),p=zt(le,e),[v,g]=n.useState(null),w=O(o,S=>g(S),i.onItemTextChange,S=>c.itemTextRefCallback?.(S,i.value,i.disabled)),y=v?.textContent,C=n.useMemo(()=>r.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:d,onNativeOptionRemove:m}=p;return Y(()=>(d(C),()=>m(C)),[d,m,C]),r.jsxs(r.Fragment,{children:[r.jsx(A.span,{id:i.textId,...u,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ae.createPortal(u.children,s.valueNode):null]})});Je.displayName=le;var Qe="SelectItemIndicator",et=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t;return Xe(Qe,e).isSelected?r.jsx(A.span,{"aria-hidden":!0,...l,ref:o}):null});et.displayName=Qe;var ye="SelectScrollUpButton",tt=n.forwardRef((t,o)=>{const e=X(ye,t.__scopeSelect),l=Te(ye,t.__scopeSelect),[a,u]=n.useState(!1),s=O(o,l.onScrollButtonChange);return Y(()=>{if(e.viewport&&e.isPositioned){let c=function(){const p=i.scrollTop>0;u(p)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(nt,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop-i.offsetHeight)}}):null});tt.displayName=ye;var be="SelectScrollDownButton",ot=n.forwardRef((t,o)=>{const e=X(be,t.__scopeSelect),l=Te(be,t.__scopeSelect),[a,u]=n.useState(!1),s=O(o,l.onScrollButtonChange);return Y(()=>{if(e.viewport&&e.isPositioned){let c=function(){const p=i.scrollHeight-i.clientHeight,v=Math.ceil(i.scrollTop)<p;u(v)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(nt,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop+i.offsetHeight)}}):null});ot.displayName=be;var nt=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:l,...a}=t,u=X("SelectScrollButton",e),s=n.useRef(null),c=ue(e),i=n.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>i(),[i]),Y(()=>{c().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),r.jsx(A.div,{"aria-hidden":!0,...a,ref:o,style:{flexShrink:0,...a.style},onPointerDown:R(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(l,50))}),onPointerMove:R(a.onPointerMove,()=>{u.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(l,50))}),onPointerLeave:R(a.onPointerLeave,()=>{i()})})}),ro="SelectSeparator",rt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t;return r.jsx(A.div,{"aria-hidden":!0,...l,ref:o})});rt.displayName=ro;var Ie="SelectArrow",so=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t,a=pe(e),u=q(Ie,e),s=X(Ie,e);return u.open&&s.position==="popper"?r.jsx(_t,{...a,...l,ref:o}):null});so.displayName=Ie;var lo="SelectBubbleInput",st=n.forwardRef(({__scopeSelect:t,value:o,...e},l)=>{const a=n.useRef(null),u=O(l,a),s=Ht(o);return n.useEffect(()=>{const c=a.current;if(!c)return;const i=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==o&&v){const g=new Event("change",{bubbles:!0});v.call(c,o),c.dispatchEvent(g)}},[s,o]),r.jsx(A.select,{...e,style:{...wt,...e.style},ref:u,defaultValue:o})});st.displayName=lo;function lt(t){return t===""||t===void 0}function at(t){const o=bt(t),e=n.useRef(""),l=n.useRef(0),a=n.useCallback(s=>{const c=e.current+s;o(c),(function i(p){e.current=p,window.clearTimeout(l.current),p!==""&&(l.current=window.setTimeout(()=>i(""),1e3))})(c)},[o]),u=n.useCallback(()=>{e.current="",window.clearTimeout(l.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(l.current),[]),[e,a,u]}function ct(t,o,e){const a=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,u=e?t.indexOf(e):-1;let s=ao(t,Math.max(u,0));a.length===1&&(s=s.filter(p=>p!==e));const i=s.find(p=>p.textValue.toLowerCase().startsWith(a.toLowerCase()));return i!==e?i:void 0}function ao(t,o){return t.map((e,l)=>t[(o+l)%t.length])}var co=De,it=Ve,io=Be,uo=He,po=Ue,dt=Fe,fo=ze,ut=qe,pt=Ze,mo=Je,ho=et,ft=tt,mt=ot,ht=rt;const No=co,To=io,vo=n.forwardRef(({className:t,children:o,...e},l)=>r.jsxs(it,{ref:l,className:K("flex h-9 w-full items-center justify-between gap-2 rounded-xl border border-white/10 bg-white/4 px-3 py-2 text-sm text-slate-200 transition-colors placeholder:text-slate-500 hover:bg-white/8 focus:outline-none focus:ring-2 focus:ring-emerald-400/50 focus:ring-offset-2 focus:ring-offset-slate-950 disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer [&>span]:line-clamp-1",t),...e,children:[o,r.jsx(uo,{asChild:!0,children:r.jsx(Oe,{className:"h-4 w-4 opacity-50"})})]}));vo.displayName=it.displayName;const vt=n.forwardRef(({className:t,...o},e)=>r.jsx(ft,{ref:e,className:K("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(At,{className:"h-4 w-4"})}));vt.displayName=ft.displayName;const xt=n.forwardRef(({className:t,...o},e)=>r.jsx(mt,{ref:e,className:K("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(Oe,{className:"h-4 w-4"})}));xt.displayName=mt.displayName;const xo=n.forwardRef(({className:t,children:o,position:e="popper",...l},a)=>r.jsx(po,{children:r.jsxs(dt,{ref:a,className:K("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-xl border border-white/10 bg-slate-900/95 shadow-[0_16px_40px_rgba(0,0,0,0.5)] backdrop-blur-xl 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",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,...l,children:[r.jsx(vt,{}),r.jsx(fo,{className:K("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),r.jsx(xt,{})]})}));xo.displayName=dt.displayName;const go=n.forwardRef(({className:t,...o},e)=>r.jsx(ut,{ref:e,className:K("px-2 py-1.5 text-xs font-medium text-slate-500",t),...o}));go.displayName=ut.displayName;const So=n.forwardRef(({className:t,children:o,...e},l)=>r.jsxs(pt,{ref:l,className:K("relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm text-slate-300 outline-none transition-colors hover:bg-white/8 hover:text-white focus:bg-white/8 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(ho,{children:r.jsx(jt,{className:"h-4 w-4 text-emerald-400"})})}),r.jsx(mo,{children:o})]}));So.displayName=pt.displayName;const wo=n.forwardRef(({className:t,...o},e)=>r.jsx(ht,{ref:e,className:K("-mx-1 my-1 h-px bg-white/8",t),...o}));wo.displayName=ht.displayName;export{Lt as B,No as S,vo as a,To as b,xo as c,So as d,Ot as e,Dt as f};