//>>built
define("dojox/grid/enhanced/plugins/GridSource",["dojo/_base/declare","dojo/_base/array","dojo/_base/lang","dojo/dnd/Source","./DnD"],function(n,h,g,p,r){var l=function(b){for(var a=b[0],c=1;c<b.length;++c)a=a.concat(b[c]);return a},m=g.getObject("dojox.grid.enhanced.plugins.GridDnDSource");return n("dojox.grid.enhanced.plugins.GridSource",p,{accept:["grid/cells","grid/rows","grid/cols","text"],insertNodesForGrid:!1,markupFactory:function(b,a){cls=g.getObject("dojox.grid.enhanced.plugins.GridSource");
return new cls(a,b)},checkAcceptance:function(b,a){if(b instanceof m){if(a[0]){var c=b.getItem(a[0].id);if(c&&(0<=h.indexOf(c.type,"grid/rows")||0<=h.indexOf(c.type,"grid/cells"))&&!b.dndPlugin._allDnDItemsLoaded())return!1}this.sourcePlugin=b.dndPlugin}return this.inherited(arguments)},onDraggingOver:function(){this.sourcePlugin&&(this.sourcePlugin._isSource=!0)},onDraggingOut:function(){this.sourcePlugin&&(this.sourcePlugin._isSource=!1)},onDropExternal:function(b,a,c){if(b instanceof m){var d=
h.map(a,function(a){return b.getItem(a.id).data}),k=b.getItem(a[0].id),e=k.dndPlugin.grid,g=k.type[0],f;try{switch(g){case "grid/cells":a[0].innerHTML=this.getCellContent(e,d[0].min,d[0].max)||"";this.onDropGridCells(e,d[0].min,d[0].max);break;case "grid/rows":f=l(d);a[0].innerHTML=this.getRowContent(e,f)||"";this.onDropGridRows(e,f);break;case "grid/cols":f=l(d),a[0].innerHTML=this.getColumnContent(e,f)||"",this.onDropGridColumns(e,f)}this.insertNodesForGrid&&(this.selectNone(),this.insertNodes(!0,
[a[0]],this.before,this.current));k.dndPlugin.onDragOut(!c)}catch(q){console.warn("GridSource.onDropExternal() error:",q)}}else this.inherited(arguments)},getCellContent:function(b,a,c){},getRowContent:function(b,a){},getColumnContent:function(b,a){},onDropGridCells:function(b,a,c){},onDropGridRows:function(b,a){},onDropGridColumns:function(b,a){}})});