"use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("classnames"),a=require("lodash"),t=require("@material-ui/core"),n=require("./RealTimeValuesBox/RealTimeBoxEditDialog.js"),l=require("./RealTimeSidebarStyles.js"),o=require("./enums.js"),s=require("./RealTimeSidebarContext.js"),d=require("./SidebarFooter.js"),u=require("./RealTimeValuesBox/RealTimeBoxList.js"),c=require("./SidebarTitle.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=S(r);var m=t.withTheme(i.memo((function(r){var t,S,m,p,g=r.isSidebarOpen,T=r.handleOpenCloseSidebar,b=r.isResponsive,f=r.theme,v=r.sourceArray,j=r.findSource,x=r.onAppSettingChange,C=r.appSettings,O=r.assetKey,q=r.setting,R=r.realTimeTypes,y=r.isDialogOpen,H=r.paramToEdit,E=r.handleOpenCloseDialog,z=r.handleChangeParamToEdit,N=r.sidebarHorizontalHeight,A=void 0===N?400:N,D=r.onLayoutChange,B=void 0===D?a.noop:D,I=i.useRef(null),F=l.useStyles({sidebarHorizontalHeight:A}),L=b?o.ORIENTATIONS.horizontal:o.ORIENTATIONS.vertical,P=h.default(g&&"fullSize",((t={})[F.rtSidebarWhiteTheme]=f.isLightTheme,t[F.rtSidebarVertical]=!b,t[F.rtSidebarHorizontal]=b,t)),V=h.default(F.rtSidebarContent,L,((S={})[F.rtSidebarContentFullSize]=g,S)),K=h.default([F.rtSidebarHandler],((m={})[F.rtSidebarHandlerFullSize]=g,m));return i.useEffect((function(){var e;(null===(e=null==I?void 0:I.current)||void 0===e?void 0:e.clientHeight)&&B(I.current.clientHeight)}),[null===(p=null==I?void 0:I.current)||void 0===p?void 0:p.clientHeight,g]),e.jsx(s.Provider,{value:{isSidebarOpen:g,onAppSettingChange:x,appSettings:C,assetKey:O,setting:q,realTimeTypes:R,orientation:L,handleOpenCloseSidebar:T,handleChangeParamToEdit:z,handleOpenCloseDialog:E},children:e.jsxs("div",{className:P,ref:I,children:[e.jsx("div",{className:K,onClick:function(){return T(!0)}}),e.jsx(c,{}),e.jsxs("div",{className:V,children:[e.jsx(u,{sourceArray:v,findSource:j}),e.jsx(n,{isDialogOpen:y,paramToEdit:H,handleCloseRealTimeDialog:function(){return E(!1)}})]}),e.jsx(d,{onSidebarOpened:function(){return T(!0)},onSidebarClosed:function(){return T(!1)}})]})})})));module.exports=m;
