"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("react/jsx-runtime"),r=require("react"),i=require("react-draggable-list"),n=require("classnames"),o=require("@material-ui/core"),l=require("../../IconButton/index.js"),a=require("../../../icons/iconParkIcons.js"),u=require("./RealTimeBox.js"),s=require("../RealTimeSidebarContext.js"),c=require("../enums.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(e),p=d(i),f=d(n);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){m.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=o.makeStyles((function(){return{boxListVertical:{padding:"10px 0 16px",overflowX:"hidden"},rtBoxListHorizontal:{display:"flex",flexWrap:"wrap"},cTpRtBoxAddButtonContainer:{marginTop:8,textAlign:"center"}}})),b=r.memo((function(e){var i=e.sourceArray,n=e.findSource,o=e.classNames,d=x(),v=r.useContext(s),b=v.onAppSettingChange,g=v.appSettings,y=v.assetKey,O=v.orientation,T=v.realTimeTypes,S=v.setting,h=v.handleOpenCloseDialog;return t.jsx(t.Fragment,{children:O===c.ORIENTATIONS.vertical?t.jsxs("div",{className:f.default(d.boxListVertical,null==o?void 0:o.item),children:[t.jsx(p.default,{list:i,itemKey:function(e){return e.key},template:function(e){return t.jsx(u,j(j({},e),{},{classNames:{item:null==o?void 0:o.item,itemTitle:null==o?void 0:o.itemTitle,itemTitleBorder:null==o?void 0:o.itemTitleBorder,itemValue:null==o?void 0:o.itemValue,itemSeparator:null==o?void 0:o.itemSeparator}}))},padding:0,unsetZIndex:!0,container:function(){return document.body},onMoveEnd:function(e){var t=e.map((function(e){return e.key}));b("rtValuesSetting",j(j({},g.rtValuesSetting),{},m.default({},y,t)))}}),t.jsx("div",{className:f.default(d.cTpRtBoxAddButtonContainer,null==o?void 0:o.buttons),children:t.jsx(l,{"data-testid":"addRealTimeValuesButton",color:"primary",tooltipProps:{title:"Add"},onClick:function(){return h(!0)},children:t.jsx(a.PlusIcon,{})})})]}):t.jsx("div",{className:d.rtBoxListHorizontal,children:S.map((function(e){var r;return t.jsx(u,{isDraggable:!1,item:null!==(r=n(e,T))&&void 0!==r?r:void 0,classNames:{item:null==o?void 0:o.item,itemTitle:null==o?void 0:o.itemTitle,itemTitleBorder:null==o?void 0:o.itemTitleBorder,itemValue:null==o?void 0:o.itemValue,itemSeparator:null==o?void 0:o.itemSeparator}},"".concat(e))}))})})}));module.exports=b;
//# sourceMappingURL=RealTimeBoxList.js.map
