import{s as b}from"./chunk-LvLJmgfZ.js";import{t as z}from"./react-Bj1aDYRI.js";import{Ir as S}from"./cells-CJLUCcQg.js";import{t as T}from"./compiler-runtime-B3qBwwSJ.js";import{g as B}from"./useEventListener-C0195JsF.js";import{t as x}from"./cn-DYvqRARy.js";import{t as V}from"./jsx-runtime-Blw4afVn.js";import{t as g}from"./tooltip-4bZlU7jl.js";import{t as k}from"./button-DDGiD1NW.js";import{t as _}from"./createLucideIcon-w-Qo9n0R.js";import{t as I}from"./chevron-right-BS_NcSch.js";import{n as P,t as R}from"./eye-off-BOZA7gbn.js";import{t as A}from"./refresh-cw-CYq4mK5a.js";var D=_("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);const j={keyBy(o,t){let e=new Map,a=new Set;for(let s of o){let r=t(s);e.has(r)&&a.add(r),e.set(r,s)}return a.size>0&&B.trace(`Duplicate keys: ${[...a].join(", ")}`),e},collect(o,t,e){return j.mapValues(j.keyBy(o,t),e)},filterMap(o,t){let e=new Map;for(let[a,s]of o)t(s,a)&&e.set(a,s);return e},mapValues(o,t){let e=new Map;for(let[a,s]of o)e.set(a,t(s,a));return e}};var v=T(),C=b(z(),1),m=b(V(),1);const E=o=>{let t=(0,v.c)(5),{isExpanded:e,className:a}=o,s=e&&"rotate-90",r;t[0]!==a||t[1]!==s?(r=x("shrink-0 transition-transform",s,a),t[0]=a,t[1]=s,t[2]=r):r=t[2];let i;return t[3]===r?i=t[4]:(i=(0,m.jsx)(I,{className:r}),t[3]=r,t[4]=i),i},$=({onClick:o,tooltip:t="Refresh",className:e,iconClassName:a})=>{let[s,r]=(0,C.useState)(!1);return(0,m.jsx)(g,{content:t,children:(0,m.jsx)(k,{variant:"text",size:"xs",className:e,onClick:(0,C.useCallback)(async i=>{r(!0);let l=new Promise(n=>setTimeout(n,500));try{await Promise.all([o(i),l])}finally{r(!1)}},[o]),children:(0,m.jsx)(A,{className:x("h-4 w-4",a,s&&"animate-[spin_0.5s]")})})})},q=o=>{let t=(0,v.c)(15),{isVisible:e,onToggle:a,showTooltip:s,hideTooltip:r,size:i,className:l,iconClassName:n,"data-testid":c}=o,u=i===void 0?"xs":i,y=e?S:R,w=e?r:s,N=e&&"text-primary",p;t[0]!==n||t[1]!==N?(p=x("h-4 w-4",N,n),t[0]=n,t[1]=N,t[2]=p):p=t[2];let f;t[3]!==y||t[4]!==p?(f=(0,m.jsx)(y,{className:p}),t[3]=y,t[4]=p,t[5]=f):f=t[5];let d;t[6]!==l||t[7]!==c||t[8]!==a||t[9]!==u||t[10]!==f?(d=(0,m.jsx)(k,{"data-testid":c,variant:"text",size:u,className:l,onClick:a,children:f}),t[6]=l,t[7]=c,t[8]=a,t[9]=u,t[10]=f,t[11]=d):d=t[11];let h;return t[12]!==w||t[13]!==d?(h=(0,m.jsx)(g,{content:w,children:d}),t[12]=w,t[13]=d,t[14]=h):h=t[14],h},M=C.forwardRef((o,t)=>{let e=(0,v.c)(15),a,s,r;e[0]===o?(a=e[1],s=e[2],r=e[3]):({className:a,iconClassName:s,...r}=o,e[0]=o,e[1]=a,e[2]=s,e[3]=r);let i;e[4]===a?i=e[5]:(i=x("mb-0 opacity-0 group-hover:opacity-100 transition-opacity",a),e[4]=a,e[5]=i);let l;e[6]===s?l=e[7]:(l=x("w-4 h-4",s),e[6]=s,e[7]=l);let n;e[8]===l?n=e[9]:(n=(0,m.jsx)(P,{className:l}),e[8]=l,e[9]=n);let c;return e[10]!==r||e[11]!==t||e[12]!==i||e[13]!==n?(c=(0,m.jsx)(k,{ref:t,variant:"text",tabIndex:-1,size:"xs",className:i,"aria-label":"More options",...r,children:n}),e[10]=r,e[11]=t,e[12]=i,e[13]=n,e[14]=c):c=e[14],c});M.displayName="MoreActionsButton";const F="h-3.5 w-3.5 mr-2";export{q as a,E as i,M as n,j as o,$ as r,D as s,F as t};
