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