import{j as s,a,l as C,B as S,ep as k,b8 as I,c as h,u as f,b as w,r as b,s as T,t as g,C as B,L as m,cC as D,bI as v,eq as H,er as M,es as N}from"./index-_eM6l4Nf.js";import{D as E,u as F}from"./Deprecated-Cn0z8EIY.js";import{F as L}from"./FeatureGroupTypeBadge-CTMzMdrC.js";const P={wrapper:(e,t,o)=>({transition:"all 0.2s linear",color:"primary",cursor:"pointer",...t&&{cursor:"default"},...e&&{boxShadow:"0px 0px 2px 2px"},"&:hover":{boxShadow:"0px 0px 0 2px"},...o&&{bg:"primaryShade1",border:"1px solid",borderColor:"var(--quartz-colors-labels-orange-_light)",div:{bg:"grayShade2",color:"gray",button:{color:"grayShade1"}}}})},z=({children:e,highlights:t,isSelected:o=!1,isLocked:r=!1,onClick:n})=>s.jsxs(a,{flexDirection:"column",sx:P.wrapper(o,r),onClick:n,children:[e,t&&!C(t)&&s.jsx(a,{flexDirection:"column",sx:d.container,children:Object.entries(t).map(([p,l])=>{const i=S(y,k(l),A);return s.jsxs(a,{sx:{gap:"10px"},children:[s.jsx(I,{sx:d.title,value:p}),s.jsx(i,{value:l})]})})})]}),y=({value:e})=>s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:e}}),W=({value:e})=>s.jsx(a,{flexDirection:"column",sx:{gap:"5px"},children:e.map(t=>Object.entries(t).map(([o,r])=>s.jsxs(a,{children:[s.jsxs(h,{children:[o,":"]}),s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:r}})]},o)))}),A={String:y,Array:W},d={container:{bg:"white",borderTopWidth:"2px",borderTopStyle:"solid",borderTopColor:"labels.yellow",gap:"10px",p:"7px",fontFamily:"Inter"},title:{borderWidth:"1px",borderStyle:"solid",borderColor:"labels.yellow",backgroundColor:"labels.yellowShade2"},highlights:{color:"black",fontSize:"12px","> em":{color:"#272727",fontWeight:700,px:"2px",mx:"2px",fontStyle:"normal",backgroundColor:"labels.yellow"}}},q=({value:{data:e,hasMatchText:t}})=>{const{id:o}=f(),{data:r}=w(),n=r==null?void 0:r.map(({projectId:i})=>i),p=b.useMemo(()=>T(g.project.featureGroup.overview,g.project.value,{id:o,fgId:e.id,fsId:e.featurestoreId}),[e.featurestoreId,e.id,o]),l=i=>i.stopPropagation();return s.jsxs(a,{children:[e.deprecated&&s.jsx(E,{mr:"5px"}),s.jsx(B,{onClick:l,href:p,fontSize:"12px",fontWeight:"bold",color:n!=null&&n.includes(e.parentProjectId)&&t?"gray":"black",sx:{textDecoration:"none"},children:e.name})]})},R=({value:e})=>s.jsx(a,{pl:"5px",children:s.jsx(L,{type:e.type,onlineEnabled:e.onlineEnabled})}),U=({value:e})=>s.jsx(m,{width:"32px",children:s.jsx(D,{firstName:e.firstName,lastName:e.lastName})}),$=({value:e})=>s.jsx(h,{bold:e.bold,gray:e.gray,children:e.title}),Q=({value:e,boxProps:t})=>{const{id:o}=f(),r=v(),{isActiveFg:n,handleBasket:p}=F(),[l,i]=b.useState(void 0),j=async()=>{var u;const c=await r(N.getFeatureGroupById.initiate({pId:+o,fsId:e.featurestoreId,fgId:e.id}));i(c.data),p(((u=c.data)==null?void 0:u.features)??[],c.data)()},x=n(e.id);return s.jsx(m,{onClick:c=>c.stopPropagation(),...t,children:s.jsx(H,{handleClick:j,mode:M.bulk,possible:!0,tooltipMainText:x?"Remove all features from basket":"Add all features to basket",tooltipSecondaryText:l?`${l.features.length} features`:"",inBasket:!!x})})};export{Q as B,q as N,R as T,U,z as W,$ as a,P as s};
