import{a as N}from"./chunk-A2V5HV2W.mjs";import{a as L}from"./chunk-53ZWLU5C.mjs";import{AvatarButton as W}from"@baseapp-frontend/design-system/components/web/buttons";import{LoadingState as z}from"@baseapp-frontend/design-system/components/web/displays";import{Box as $,Typography as q,useTheme as G}from"@mui/material";import{Virtuoso as J}from"react-virtuoso";import{jsx as i,Fragment as Q,jsxs as U}from"react/jsx-runtime";function a(t){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(t)}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,o)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?w(Object(r),!0).forEach(function(o){I(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}function I(t,e,r){return(e=K(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t){var e=R(t,"string");return a(e)=="symbol"?e:e+""}function R(t,e){if(a(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var o=r.call(t,e||"default");if(a(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var X=function(e){var r=e.searchValue,o=e.profiles,n=o===void 0?[]:o,c=e.isPending,A=e.isLoadingNext,C=e.hasNext,l=e.loadNext,m=e.renderItem,p=e.VirtuosoProps,F=p===void 0?{}:p,f=e.NormalListProps,T=f===void 0?{}:f,b=e.label,E=b===void 0?"Available connections":b,y=e.title,v=y===void 0?"Connections":y,g=e.EmptyProfilesListState,M=g===void 0?N:g,P=e.SearchNotFoundState,D=P===void 0?L:P,h=e.allowAddMember,V=h===void 0?!1:h,S=e.onAddMemberClick,k=S===void 0?function(){}:S,x=e.removeTitle,B=x===void 0?!1:x,j=G(),_=function(){return A?i(z,{sx:{paddingTop:3,paddingBottom:1},CircularProgressProps:{size:15},"aria-label":"loading more profiles"}):i($,{sx:{paddingTop:3}})},d=l,O=n.length===0;return!c&&r&&O&&d?i(D,{}):!c&&O&&d?i(M,{}):U(Q,{children:[i("menu",{"aria-label":E,children:!B&&i(q,{variant:"subtitle2",color:"text.primary",sx:{padding:v===""?0:j.spacing(2),borderBottom:"1px solid ".concat(j.palette.divider)},children:v})}),V&&i(W,{onClick:k,caption:"Add Member"}),d?i(J,u({data:n,itemContent:function(Y,H){return m(H)},style:{scrollbarWidth:"none",maxHeight:"250px"},components:{Footer:_},endReached:function(){C&&l?.(5)}},F)):i($,u(u({maxHeight:250,overflow:"auto",sx:{scrollbarWidth:"none"}},T),{},{children:n.map(function(s){return m(s,!0)})}))]})},ae=X;export{ae as a};
//# sourceMappingURL=chunk-K4H7DHEI.mjs.map