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