//>>built
require({cache:{"url:dojox/grid/resources/Expando.html":'\x3cdiv class\x3d"dojoxGridExpando"\n\t\x3e\x3cdiv class\x3d"dojoxGridExpandoNode" dojoAttachEvent\x3d"onclick:onToggle"\n\t\t\x3e\x3cdiv class\x3d"dojoxGridExpandoNodeInner" dojoAttachPoint\x3d"expandoInner"\x3e\x3c/div\n\t\x3e\x3c/div\n\x3e\x3c/div\x3e\n'}});
define("dojox/grid/_TreeView","dijit/registry ../main dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/event dojo/dom-attr dojo/dom-class dojo/dom-style dojo/dom-construct dojo/query dojo/parser dojo/text!./resources/Expando.html dijit/_Widget dijit/_TemplatedMixin ./_View ./_Builder ./util".split(" "),function(N,H,I,C,O,R,y,n,P,S,p,T,J,U,V,W,X,Y){I("dojox.grid._Expando",[U,V],{open:!1,toggleClass:"",itemId:"",cellIdx:-1,view:null,rowNode:null,rowIdx:-1,expandoCell:null,level:0,templateString:J,
_toggleRows:function(a,c){if(a&&this.rowNode)if(p("table.dojoxGridRowTableNeedsRowUpdate").length)this._initialized&&this.view.grid.updateRow(this.rowIdx);else{var b=this;if(this.view.grid.treeModel){var e=this._tableRow?y.get(this._tableRow,"dojoxTreeGridPath"):"";e&&p('tr[dojoxTreeGridPath^\x3d"'+e+'/"]',this.rowNode).forEach(function(f){var d=p(".dojoxGridExpando",f)[0];d&&d.parentNode&&d.parentNode.parentNode&&!n.contains(d.parentNode.parentNode,"dojoxGridNoChildren")&&(d=N.byNode(d))&&d._toggleRows(a,
d.open&&c);f.style.display=c?"":"none"})}else p("tr."+a,this.rowNode).forEach(function(f){if(n.contains(f,"dojoxGridExpandoRow")){var d=p(".dojoxGridExpando",f)[0];if(d){var g=N.byNode(d),l=g?g.toggleClass:d.getAttribute("toggleClass");d=g?g.open:b.expandoCell.getOpenState(d.getAttribute("itemId"));b._toggleRows(l,d&&c)}}f.style.display=c?"":"none"})}},setOpen:function(a){a&&n.contains(this.domNode,"dojoxGridExpandoLoading")&&(a=!1);var c=this.view.grid,b=c.store,e=c.treeModel,f=this;if(c._by_idx[this.rowIdx])if(e&&
!this._loadedChildren)if(a){var d=c.getItem(y.get(this._tableRow,"dojoxTreeGridPath"));d?(this.expandoInner.innerHTML="o",n.add(this.domNode,"dojoxGridExpandoLoading"),e.getChildren(d,function(g){f._loadedChildren=!0;f._setOpen(a)})):this._setOpen(a)}else this._setOpen(a);else!e&&b?a?(e=c._by_idx[this.rowIdx])&&!b.isItemLoaded(e.item)?(this.expandoInner.innerHTML="o",n.add(this.domNode,"dojoxGridExpandoLoading"),b.loadItem({item:e.item,onItem:O.hitch(this,function(g){var l=b.getIdentity(g);c._by_idty[l]=
c._by_idx[this.rowIdx]={idty:l,item:g};this._setOpen(a)})})):this._setOpen(a):this._setOpen(a):this._setOpen(a)},_setOpen:function(a){if(a&&this._tableRow&&n.contains(this._tableRow,"dojoxGridNoChildren"))this._setOpen(!1);else{this.expandoInner.innerHTML=a?"-":"+";n.remove(this.domNode,"dojoxGridExpandoLoading");n.toggle(this.domNode,"dojoxGridExpandoOpened",a);if(this._tableRow){n.toggle(this._tableRow,"dojoxGridRowCollapsed",!a);var c=y.get(this._tableRow,"dojoxTreeGridBaseClasses"),b="";b=a?O.trim((" "+
c+" ").replace(" dojoxGridRowCollapsed "," ")):0>(" "+c+" ").indexOf(" dojoxGridRowCollapsed ")?c+(c?" ":"")+"dojoxGridRowCollapsed":c;y.set(this._tableRow,"dojoxTreeGridBaseClasses",b)}c=this.open!==a;this.open=a;this.expandoCell&&this.itemId&&(this.expandoCell.openStates[this.itemId]=a);b=this.view;var e=b.grid;this.toggleClass&&c&&(this._tableRow&&this._tableRow.style.display||this._toggleRows(this.toggleClass,a));b&&this._initialized&&0<=this.rowIdx&&(e.rowHeightChanged(this.rowIdx),e.postresize(),
b.hasVScrollbar(!0));this._initialized=!0}},onToggle:function(a){this.setOpen(!this.open);R.stop(a)},setRowNode:function(a,c,b){if(0>this.cellIdx||!this.itemId)return!1;this._initialized=!1;this.view=b;this.rowNode=c;this.rowIdx=a;this.expandoCell=b.structure.cells[0][this.cellIdx];(a=this.domNode)&&a.parentNode&&a.parentNode.parentNode&&(this._tableRow=a.parentNode.parentNode);this.open=this.expandoCell.getOpenState(this.itemId);b.grid.treeModel&&(P.set(this.domNode,"marginLeft",18*this.level+"px"),
this.domNode.parentNode&&P.set(this.domNode.parentNode,"backgroundPosition",18*this.level+3+"px"));this.setOpen(this.open);return!0}});J=I("dojox.grid._TreeContentBuilder",X._ContentBuilder,{generateHtml:function(a,c){var b=this.getTableArray(),e=this.view,f=e.structure.cells[0],d=this.grid.getItem(c),g=this.grid,l=this.grid.store;Y.fire(this.view,"onBeforeRow",[c,[f]]);var x=function(k,m,h,r,q,z){if(z){var D=b.length;r=r||[];var K=r.join("|"),E=r[r.length-1],t=E+(h?" dojoxGridSummaryRow":"");g.treeModel&&
m&&!g.treeModel.mayHaveChildren(m)&&(t+=" dojoxGridNoChildren");b.push('\x3ctr style\x3d"" class\x3d"'+t+'" dojoxTreeGridPath\x3d"'+q.join("/")+'" dojoxTreeGridBaseClasses\x3d"'+t+'"\x3e');var L=k+1;t=null;for(var A=0,v;v=f[A];A++){var F=v.markup,Q=v.customClasses=[],Z=v.customStyles=[];F[5]=v.formatAtLevel(q,m,k,h,E,Q);F[1]=Q.join(" ");F[3]=Z.join(";");b.push.apply(b,F);!t&&v.level===L&&v.parentCell&&(t=v.parentCell)}b.push("\x3c/tr\x3e");m&&l&&l.isItem(m)&&(A=l.getIdentity(m),"undefined"==typeof g._by_idty_paths[A]&&
(g._by_idty_paths[A]=q.join("/")));var w=q.concat([]);if(g.treeModel&&m){if(g.treeModel.mayHaveChildren(m)){h=e.structure.cells[0][g.expandoCell||0];var G=h.getOpenState(m)&&z;h=new H.grid.TreePath(q.join("/"),g);h=h.children(!0)||[];C.forEach(h,function(M,B){var u=K.split("|");u.push(u[u.length-1]+"-"+B);w.push(B);x(L,M,!1,u,w,G);w.pop()})}}else m&&t&&!h?(h=e.structure.cells[0][t.level],G=h.getOpenState(m)&&z,l.hasAttribute(m,t.field)?(z=K.split("|"),z.pop(),h=new H.grid.TreePath(q.join("/"),g),
h=h.children(!0)||[],h.length?(b[D]='\x3ctr class\x3d"'+z.join(" ")+' dojoxGridExpandoRow" dojoxTreeGridPath\x3d"'+q.join("/")+'"\x3e',C.forEach(h,function(M,B){var u=K.split("|");u.push(u[u.length-1]+"-"+B);w.push(B);x(L,M,!1,u,w,G);w.pop()}),w.push(h.length),x(k,m,!0,r,w,G)):b[D]='\x3ctr class\x3d"'+E+' dojoxGridNoChildren" dojoxTreeGridPath\x3d"'+q.join("/")+'"\x3e'):l.isItemLoaded(m)?b[D]='\x3ctr class\x3d"'+E+' dojoxGridNoChildren" dojoxTreeGridPath\x3d"'+q.join("/")+'"\x3e':b[0]=b[0].replace("dojoxGridRowTable",
"dojoxGridRowTable dojoxGridRowTableNeedsRowUpdate")):m&&!h&&1<r.length&&(b[D]='\x3ctr class\x3d"'+r[r.length-2]+'" dojoxTreeGridPath\x3d"'+q.join("/")+'"\x3e')}else-1==b[0].indexOf("dojoxGridRowTableNeedsRowUpdate")&&(b[0]=b[0].replace("dojoxGridRowTable","dojoxGridRowTable dojoxGridRowTableNeedsRowUpdate"))};x(0,d,!1,["dojoxGridRowToggle-"+c],[c],!0);b.push("\x3c/table\x3e");return b.join("")},findTarget:function(a,c){for(var b=a;b&&b!=this.domNode&&(!b.tagName||"tr"!=b.tagName.toLowerCase());)b=
b.parentNode;return b!=this.domNode?b:null},getCellNode:function(a,c){var b=p("td[idx\x3d'"+c+"']",a)[0];if(b&&b.parentNode&&!n.contains(b.parentNode,"dojoxGridSummaryRow"))return b},decorateEvent:function(a){a.rowNode=this.findRowTarget(a.target);if(!a.rowNode)return!1;a.rowIndex=y.get(a.rowNode,"dojoxTreeGridPath");this.baseDecorateEvent(a);a.cell=this.grid.getCell(a.cellIndex);return!0}});return I("dojox.grid._TreeView",W,{_contentBuilderClass:J,_onDndDrop:function(a,c,b){this.grid&&this.grid.aggregator&&
this.grid.aggregator.clearSubtotalCache();this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.grid,"_cleanupExpandoCache","_cleanupExpandoCache")},_cleanupExpandoCache:function(a,c,b){if(-1!=a)if(C.forEach(this.grid.layout.cells,function(d){"undefined"!=typeof d.openStates&&c in d.openStates&&delete d.openStates[c]}),"string"==typeof a&&-1<a.indexOf("/")){var e=new H.grid.TreePath(a,this.grid);for(a=e.parent();a;)e=a,a=e.parent();if(e=e.item())if(e=this.grid.store.getIdentity(e),
"undefined"!=typeof this._expandos[e]){for(var f in this._expandos[e])(a=this._expandos[e][f])&&a.destroy(),delete this._expandos[e][f];delete this._expandos[e]}}else{for(f in this._expandos)if("undefined"!=typeof this._expandos[f])for(e in this._expandos[f])(a=this._expandos[f][e])&&a.destroy();this._expandos={}}},postMixInProperties:function(){this.inherited(arguments);this._expandos={}},onBeforeRow:function(a,c){var b=this.grid;b._by_idx&&b._by_idx[a]&&b._by_idx[a].idty&&(b=b._by_idx[a].idty,this._expandos[b]=
this._expandos[b]||{});this.inherited(arguments)},onAfterRow:function(a,c,b){C.forEach(p("span.dojoxGridExpando",b),function(d){if(d&&d.parentNode){var g=d.getAttribute("toggleClass"),l=this.grid;if(l._by_idx&&l._by_idx[a]&&l._by_idx[a].idty){var x=l._by_idx[a].idty;var k=this._expandos[x][g]}k?(S.place(k.domNode,d,"replace"),k.itemId=d.getAttribute("itemId"),k.cellIdx=parseInt(d.getAttribute("cellIdx"),10),isNaN(k.cellIdx)&&(k.cellIdx=-1)):x&&(k=T.parse(d.parentNode)[0],this._expandos[x][g]=k);k&&
!k.setRowNode(a,b,this)&&k.domNode.parentNode.removeChild(k.domNode)}},this);var e=!1,f=this;p("tr[dojoxTreeGridPath]",b).forEach(function(d){n.toggle(d,"dojoxGridSubRowAlt",e);y.set(d,"dojoxTreeGridBaseClasses",d.className);e=!e;f.grid.rows.styleRowNode(y.get(d,"dojoxTreeGridPath"),d)});this.inherited(arguments)},updateRowStyles:function(a){var c=p("tr[dojoxTreeGridPath\x3d'"+a+"']",this.domNode);c.length&&this.styleRowNode(a,c[0])},getCellNode:function(a,c){var b=p("tr[dojoxTreeGridPath\x3d'"+a+
"']",this.domNode)[0];if(b)return this.content.getCellNode(b,c)},destroy:function(){this._cleanupExpandoCache();this.inherited(arguments)}})});