import e from"@babel/runtime/helpers/defineProperty";import{jsx as i,jsxs as r}from"react/jsx-runtime";import{memo as t,useRef as o,useEffect as a}from"react";import l from"classnames";import{noop as n}from"lodash";import{withTheme as s}from"@material-ui/core";import d from"./RealTimeValuesBox/RealTimeBoxEditDialog.js";import{useStyles as m}from"./RealTimeSidebarStyles.js";import{ORIENTATIONS as u}from"./enums.js";import p from"./RealTimeSidebarContext.js";import c from"./SidebarFooter.js";import S from"./RealTimeValuesBox/RealTimeBoxList.js";import h from"./SidebarTitle.js";var f=s(t((function(t){var s,f,v=t.isSidebarOpen,b=t.handleOpenCloseSidebar,g=t.isResponsive,T=t.theme,C=t.sourceArray,H=t.findSource,y=t.onAppSettingChange,O=t.appSettings,j=t.assetKey,R=t.setting,x=t.realTimeTypes,z=t.isDialogOpen,B=t.paramToEdit,D=t.handleOpenCloseDialog,N=t.handleChangeParamToEdit,E=t.sidebarHorizontalHeight,V=void 0===E?400:E,A=t.onLayoutChange,P=void 0===A?n:A,F=t.classes,L=o(null),K=m({sidebarHorizontalHeight:V}),k=g?u.horizontal:u.vertical,w=l(null==F?void 0:F.wrapper,v&&"fullSize",(e(s={},K.rtSidebarWhiteTheme,T.isLightTheme),e(s,K.rtSidebarVertical,!g),e(s,K.rtSidebarHorizontal,g),s)),W=l(K.rtSidebarContent,k,null==F?void 0:F.content,e({},K.rtSidebarContentFullSize,v)),q=l([K.rtSidebarHandler],e({},K.rtSidebarHandlerFullSize,v));return a((function(){var e;null!==(e=L.current)&&void 0!==e&&e.clientHeight&&P(L.current.clientHeight)}),[null===(f=L.current)||void 0===f?void 0:f.clientHeight,v]),i(p.Provider,{value:{isSidebarOpen:v,onAppSettingChange:y,appSettings:O,assetKey:j,setting:R,realTimeTypes:x,orientation:k,handleOpenCloseSidebar:b,handleChangeParamToEdit:N,handleOpenCloseDialog:D},children:r("div",{className:w,ref:L,children:[i("div",{className:q,onClick:function(){return b(!0)}}),i(h,{className:null==F?void 0:F.contentTitle}),r("div",{className:W,children:[i(S,{sourceArray:C,findSource:H,classNames:{item:null==F?void 0:F.item,itemTitle:null==F?void 0:F.itemTitle,itemTitleBorder:null==F?void 0:F.itemTitleBorder,itemValue:null==F?void 0:F.itemValue,buttons:null==F?void 0:F.buttons,itemSeparator:null==F?void 0:F.itemSeparator}}),i(d,{isDialogOpen:z,paramToEdit:B,handleCloseRealTimeDialog:function(){return D(!1)}})]}),i(c,{className:null==F?void 0:F.footer,onSidebarOpened:function(){return b(!0)},onSidebarClosed:function(){return b(!1)}})]})})})));export{f as default};
//# sourceMappingURL=RealTimeSidebar.js.map
