Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.115/designer/js/definition-builder/diagram-builder/components/sidebar/SidebarBody",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../DiagramBuilderContext","../nodes/utils"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=SidebarBody;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("liferay!frontend-js-react-web$prop-types")),a=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),i=r("../../DiagramBuilderContext"),o=r("../nodes/utils");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const _onDragStart=(e,t,r)=>{e.dataTransfer.setData("application/reactflow",t),e.dataTransfer.effectAllowed="move";const n=e.target.getBoundingClientRect();r({mouseXInRectangle:e.clientX-n.left,mouseYInRectangle:e.clientY-n.top,rectangleHeight:n.height,rectangleWidth:n.width})};function SidebarBody({children:e,displayDefaultContent:t=!0}){const{setCollidingElements:r,setElementRectangle:n}=(0,a.useContext)(i.DiagramBuilderContext);return a.default.createElement("div",{className:"sidebar-body"},t?Object.entries(o.nodeTypes).map((([e,t],i)=>a.default.createElement(t,{className:"btn-sm",descriptionSidebar:o.nodeDescription[e],draggable:!0,key:i,onDragEnd:()=>r(null),onDragLeave:()=>r(null),onDragStart:t=>_onDragStart(t,e,n)}))):e)}SidebarBody.protoTypes={children:n.default.any,displayDefaultContent:n.default.bool}}}));
//# sourceMappingURL=SidebarBody.js.map