import{j as s,d as a,g as C,B as S,dx as k,aN as I,y as h,u as f,b as w,r as b,o as T,q as g,s as B,c as m,c8 as H,bf as N,dy as v,dz as D,dA as M}from"./index-CK33qGU_.js";import{D as A,u as E}from"./Deprecated-D5xZ0QMJ.js";import{F}from"./FeatureGroupTypeBadge-CamLRb8D.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"}}}})},_=({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),G);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)))}),G={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:600,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.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(A,{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(F,{type:e.type,onlineEnabled:e.onlineEnabled})}),U=({value:e})=>s.jsx(m,{width:"32px",children:s.jsx(H,{firstName:e.firstName,lastName:e.lastName})}),$=({value:e})=>s.jsx(h,{bold:e.bold,gray:e.gray,children:e.title}),K=({value:e,boxProps:t})=>{const{id:o}=f(),r=N(),{isActiveFg:n,handleBasket:p}=E(),[l,i]=b.useState(void 0),j=async()=>{var u;const c=await r(M.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(v,{handleClick:j,mode:D.bulk,possible:!0,tooltipMainText:x?"Remove all features from basket":"Add all features to basket",tooltipSecondaryText:l?`${l.features.length} features`:"",inBasket:!!x})})};export{K as B,q as N,R as T,U,_ as W,$ as a,P as s};
