(function(){if(window.jsDD)return;jsDD={arObjects:[],arDestinations:[],arDestinationsPriority:[],arContainers:[],arContainersPos:[],current_dest_index:false,current_node:null,wndSize:null,bStarted:false,bDisable:false,bDisableDestRefresh:false,bEscPressed:false,bScrollWindow:false,scrollViewTimer:null,scrollViewConfig:{checkerTimeout:30,scrollZone:25,scrollBy:25,scrollContainer:null,bScrollH:true,bScrollV:true,pos:null},setScrollWindow:function(s){jsDD.bScrollWindow=!!s;if(BX.type.isDomNode(s)){jsDD.scrollViewConfig.scrollContainer=s;jsDD.scrollViewConfig.pos=BX.pos(s);var e=BX.style(s,"overflow")||"visible",D=BX.style(s,"overflow-x")||"visible",r=BX.style(s,"overflow-y")||"visible";jsDD.scrollViewConfig.bScrollH=e!="visible"||D!="visible";jsDD.scrollViewConfig.bScrollV=e!="visible"||r!="visible"}},Reset:function(){jsDD.arObjects=[];jsDD.arDestinations=[];jsDD.arDestinationsPriority=[];jsDD.bStarted=false;jsDD.current_node=null;jsDD.current_dest_index=false;jsDD.bDisableDestRefresh=false;jsDD.bDisable=false;jsDD.x=null;jsDD.y=null;jsDD.start_x=null;jsDD.start_y=null;jsDD.wndSize=null;jsDD.bEscPressed=false;clearInterval(jsDD.scrollViewTimer);jsDD.bScrollWindow=false;jsDD.scrollViewTimer=null;jsDD.scrollViewConfig.scrollContainer=null},registerObject:function(s){BX.bind(s,"mousedown",jsDD.startDrag);BX.Event.bind(s,"touchstart",jsDD.startDrag,{passive:true});s.__bxddid=jsDD.arObjects.length;jsDD.arObjects[s.__bxddid]=s},unregisterObject:function(s){if(typeof s["__bxddid"]==="undefined"){return}delete jsDD.arObjects[s.__bxddid];delete s.__bxddid;BX.unbind(s,"mousedown",jsDD.startDrag);BX.unbind(s,"touchstart",jsDD.startDrag)},registerDest:function(s,e){if(!e)e=100;s.__bxddeid=jsDD.arDestinations.length;s.__bxddpriority=e;jsDD.arDestinations[s.__bxddeid]=s;if(!jsDD.arDestinationsPriority[e])jsDD.arDestinationsPriority[e]=[s.__bxddeid];else jsDD.arDestinationsPriority[e].push(s.__bxddeid);jsDD.refreshDestArea(s.__bxddeid)},unregisterDest:function(s){if(typeof s["__bxddeid"]==="undefined"){return}delete jsDD.arDestinations[s.__bxddeid];delete s.__bxddeid;delete s.__bxddpriority;jsDD.refreshDestArea()},disableDest:function(s){if(typeof s.__bxddeid!=="undefined"){s.__bxdddisabled=true}},enableDest:function(s){if(typeof s.__bxddeid!=="undefined"){s.__bxdddisabled=false}},registerContainer:function(s){jsDD.arContainers[jsDD.arContainers.length]=s},getContainersScrollPos:function(s,e){var D={left:0,top:0};for(var r=0,n=jsDD.arContainers.length;r=jsDD.arContainersPos[r]["left"]&&s<=jsDD.arContainersPos[r]["right"]&&e>=jsDD.arContainersPos[r]["top"]&&e<=jsDD.arContainersPos[r]["bottom"]){D.left=jsDD.arContainers[r].scrollLeft;D.top=jsDD.arContainers[r].scrollTop}}return D},setContainersPos:function(){for(var s=0,e=jsDD.arContainers.length;s0){window.scrollBy(0,-jsDD.scrollViewConfig.scrollBy);e=true}if(s.clientY>jsDD.wndSize.innerHeight-D&&jsDD.wndSize.scrollTop0){window.scrollBy(-jsDD.scrollViewConfig.scrollBy,0);e=true}if(s.clientX>jsDD.wndSize.innerWidth-D&&jsDD.wndSize.scrollLeft0){r.scrollLeft-=jsDD.scrollViewConfig.scrollBy;e=true}if(s.clientX+jsDD.wndSize.scrollLeft>jsDD.scrollViewConfig.pos.right-D&&r.scrollLeft0){r.scrollTop-=jsDD.scrollViewConfig.scrollBy;e=true}if(s.clientY+jsDD.wndSize.scrollTop>jsDD.scrollViewConfig.pos.bottom-D&&r.scrollTop=jsDD.start_x-e&&jsDD.x<=jsDD.start_x+e&&jsDD.y>=jsDD.start_y-e&&jsDD.y<=jsDD.start_y+e)return true;jsDD.start()}if(jsDD.current_node.onbxdrag){jsDD.current_node.onbxdrag(jsDD.x,jsDD.y,s)}var D=jsDD.getContainersScrollPos(jsDD.x,jsDD.y);var r=jsDD.searchDest(jsDD.x+D.left,jsDD.y+D.top);if(r!==jsDD.current_dest_index){if(jsDD.current_dest_index!==false){if(jsDD.current_node.onbxdraghout)jsDD.current_node.onbxdraghout(jsDD.arDestinations[jsDD.current_dest_index],jsDD.x,jsDD.y);if(jsDD.arDestinations[jsDD.current_dest_index].onbxdestdraghout)jsDD.arDestinations[jsDD.current_dest_index].onbxdestdraghout(jsDD.current_node,jsDD.x,jsDD.y)}if(r!==false){if(jsDD.current_node.onbxdraghover)jsDD.current_node.onbxdraghover(jsDD.arDestinations[r],jsDD.x,jsDD.y);if(jsDD.arDestinations[r].onbxdestdraghover)jsDD.arDestinations[r].onbxdestdraghover(jsDD.current_node,jsDD.x,jsDD.y)}}jsDD.current_dest_index=r},stopDrag:function(s){BX.unbind(document,"keypress",jsDD._checkEsc);s=s||window.event;jsDD.bPreStarted=false;if(jsDD.bStarted){if(!jsDD.bEscPressed){jsDD.x=s.clientX+jsDD.wndSize.scrollLeft;jsDD.y=s.clientY+jsDD.wndSize.scrollTop}if(null!=jsDD.current_node.onbxdragstop)jsDD.current_node.onbxdragstop(jsDD.x,jsDD.y,s);var e=jsDD.getContainersScrollPos(jsDD.x,jsDD.y);var D=jsDD.searchDest(jsDD.x+e.left,jsDD.y+e.top);if(false!==D){if(jsDD.bEscPressed){if(null!=jsDD.arDestinations[D].onbxdestdraghout){if(!jsDD.arDestinations[D].onbxdestdraghout(jsDD.current_node,jsDD.x,jsDD.y))D=false;else{if(null!=jsDD.current_node.onbxdragfinish)jsDD.current_node.onbxdragfinish(jsDD.arDestinations[D],jsDD.x,jsDD.y)}}}else{if(null!=jsDD.arDestinations[D].onbxdestdragfinish){if(!jsDD.arDestinations[D].onbxdestdragfinish(jsDD.current_node,jsDD.x,jsDD.y,s))D=false;else{if(null!=jsDD.current_node.onbxdragfinish)jsDD.current_node.onbxdragfinish(jsDD.arDestinations[D],jsDD.x,jsDD.y)}}}}if(false===D){if(null!=jsDD.current_node.onbxdragrelease)jsDD.current_node.onbxdragrelease(jsDD.x,jsDD.y)}else{for(var r=0,n=jsDD.arDestinations.length;r=s&&jsDD.arDestinations[o].__bxpos[1]<=e&&jsDD.arDestinations[o].__bxpos[3]>=e){return o}}}}}return false},allowSelection:function(){document.onmousedown=document.ontouchstart=null;var s=document.body;s.ondrag=null;s.onselectstart=null;s.style.MozUserSelect="";if(jsDD.current_node){jsDD.current_node.ondrag=null;jsDD.current_node.onselectstart=null;jsDD.current_node.style.MozUserSelect=""}},denySelection:function(){document.onmousedown=document.ontouchstart=BX.False;var s=document.body;s.ondrag=BX.False;s.onselectstart=BX.False;s.style.MozUserSelect="none";if(jsDD.current_node){jsDD.current_node.ondrag=BX.False;jsDD.current_node.onselectstart=BX.False;jsDD.current_node.style.MozUserSelect="none"}},Disable:function(){jsDD.bDisable=true},Enable:function(){jsDD.bDisable=false}}})(); //# sourceMappingURL=dd.map.js