Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.156/page_editor/common/createDNDBackend",["module","exports","require","liferay!frontend-js-react-web$react-dnd-html5-backend"],(function(e,n,t){window;Object.defineProperty(n,"__esModule",{value:!0}),n.default=function createDNDBackend(e,n){const t=new Set,c=new Map,handleDragAndDropEvent=e=>(n,o,r)=>{t.forEach((t=>{if(t.document.body&&t.document.body.contains(o)){const a=c.get(t);a.nodes.get(n)!==o&&(a.nodes.set(n,o),a.backend[e](n,o,r))}}))};return{connectDragPreview:handleDragAndDropEvent("connectDragPreview"),connectDragSource:handleDragAndDropEvent("connectDragSource"),connectDropTarget:handleDragAndDropEvent("connectDropTarget"),setup(){t.add(n),Array.from(n.document.querySelectorAll("iframe")).forEach((e=>{e.contentWindow&&t.add(e.contentWindow)})),t.forEach((n=>{if(!c.has(n)){const t=(0,o.HTML5Backend)(e,n);t.setup(),c.set(n,{backend:t,nodes:new Map})}}))},teardown(){t.forEach((e=>{const n=c.get(e);n&&(n.backend.teardown(),c.delete(e))})),t.clear()}}};var o=t("liferay!frontend-js-react-web$react-dnd-html5-backend")}));
//# sourceMappingURL=createDNDBackend.js.map