import{d as e,p as t,s as n}from"./hooks.module-BrXTvcfS.js";import{R as r,ht as i}from"./content_renderer-DOj8g78V.js";import{t as a}from"./jsxRuntime.module-Cao1NCKs.js";import{r as o}from"./react_utils-Bz0ffU2Y.js";import{$ as s,G as c}from"./hooks-ClTXKdUl.js";import{t as l}from"./ActionButton-DqIfNt93.js";e();function u({id:e,title:u,buttons:d,children:f,containerRef:p,contextMenuItems:m,grow:h,keepMounted:g}){let[_,v]=s(`rightPaneCollapsedItems`),[y,b]=n(!_.includes(e)),x=c(p,null),S=t(o);return S&&(S.initialized=Promise.resolve()),a(`div`,{ref:x,id:e,class:r(`card widget`,{collapsed:!y,grow:h}),children:[a(`div`,{class:`card-header`,onClick:()=>{let t=!y;b(t);let n=new Set(_);t?n.delete(e):n.add(e),v(Array.from(n))},children:[a(l,{icon:`bx bx-chevron-down`,text:``}),a(`div`,{class:`card-header-title`,children:u}),a(`div`,{class:`card-header-buttons`,onClick:e=>e.stopPropagation(),children:[d,m&&a(l,{icon:`bx bx-dots-vertical-rounded`,text:``,onClick:e=>{e.stopPropagation(),i.show({x:e.pageX,y:e.pageY,items:m,selectMenuItemHandler:()=>{}})}})]})]}),a(`div`,{id:S?.componentId,class:`body-wrapper`,children:(y||g)&&a(`div`,{class:`card-body`,style:y?void 0:{display:`none`},children:f})})]})}export{u as t};