Liferay.Loader.define("segments-web@3.0.68/js/components/criteria_builder/DropZone.es",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","../../utils/drag-types.es"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=p(t("liferay!frontend-js-react-web$classnames")),o=(p(t("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}t.default=e,r&&r.set(e,t);return t}(t("liferay!frontend-js-react-web$react"))),a=t("liferay!frontend-js-react-web$react-dnd"),d=t("../../utils/drag-types.es");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function p(e){return e&&e.__esModule?e:{default:e}}const{CRITERIA_GROUP:e,CRITERIA_ROW:i,PROPERTY:f}=d.DragTypes,u=[e,i,f];class l extends o.Component{render(){const{before:e,canDrop:r,connectDropTarget:t,hover:a}=this.props,d=(0,n.default)("drop-zone-target",{"drop-zone-target-before":e});return o.default.createElement("div",{className:"drop-zone-root"},t(o.default.createElement("div",{className:d},r&&a&&o.default.createElement("div",{className:"drop-zone-indicator"}))))}}var s=(0,a.DropTarget)(u,{canDrop:function(r,t){const{dropIndex:n,groupId:o,propertyKey:a}=r,{childGroupIds:d=[],criterion:c,groupId:p,index:s,propertyKey:i}=t.getItem(),f=[c.groupId,...d];return!(t.getItemType()===e&&f.includes(o)||p===o&&(s===n||s===n-1))&&a===i},drop:function(r,t){const{dropIndex:n,groupId:o,onCriterionAdd:a,onMove:d}=r,{criterion:c,groupId:p,index:s}=t.getItem(),u=t.getItemType();u===f?a(n,c):u!==i&&u!==e||d(p,s,o,n,c)}},((e,r)=>({canDrop:r.canDrop(),connectDropTarget:e.dropTarget(),hover:r.isOver()})))(l);r.default=s}}));
//# sourceMappingURL=DropZone.es.js.map