//>>built
define("dojox/mvc/WidgetList","require dojo/_base/array dojo/_base/lang dojo/_base/declare dijit/_Container dijit/_WidgetBase ./Templated".split(" "),function(x,k,c,y,m,D,E){function r(b){return eval("({"+b+"})")}function z(b){for(var e=null;e=(b._handles||[]).pop();)e.unwatch()}function F(b){var e=[];k.forEach(b,function(f){[].push.apply(e,f)});return e}function A(b,e){if(this.childClz)e(this.childClz);else if(this.childType){var f=c.isFunction(this.childType)||c.isFunction(this.childMixins)?k.map(b,
function(a){var g=c.isFunction(this.childType)?this.childType.call(a,this):this.childType;a=c.isFunction(this.childMixins)?this.childMixins.call(a,this):this.childMixins;return g?[g].concat(c.isArray(a)?a:a?a.split(","):[]):["dojox/mvc/Templated"]},this):[[this.childType].concat(this.childMixins&&this.childMixins.split(",")||[])];x(k.filter(k.map(F(f),function(a){return c.getObject(a)?B:a}),function(a){return a!==B}),function(){e.apply(this,k.map(f,function(a){a=k.map(a,function(g){return c.getObject(g)||
x(g)});return 1<a.length?y(a,{}):a[0]}))})}else e(E)}var B;m=y("dojox.mvc.WidgetList",[D,m],{childClz:null,childType:"",childMixins:"",childParams:null,childBindings:null,children:null,partialRebuild:!1,_relTargetProp:"children",postMixInProperties:function(){this.inherited(arguments);this["data-mvc-child-type"]&&(this.childType=this["data-mvc-child-type"]);this["data-mvc-child-mixins"]&&(this.childMixins=this["data-mvc-child-mixins"])},startup:function(){this.inherited(arguments);this._setChildrenAttr(this.children)},
_setChildrenAttr:function(b){var e=this.children;this._set("children",b);if(this._started&&(!this._builtOnce||e!=b)&&(this._builtOnce=!0,this._buildChildren(b),c.isArray(b))){var f=this;b.watch!=={}.watch&&(this._handles=this._handles||[]).push(b.watch(function(a,g,t){isNaN(a)||(a=f.getChildren()[a-0])&&a.set(a._relTargetProp||"target",t)}))}},_buildChildren:function(b){function e(n){if(!(this._beingDestroyed||this._buildChildrenSeq>t)){var l=[].slice.call(arguments,1);n.clz=c.isFunction(this.childType)||
c.isFunction(this.childMixins)?l:l[0];for(var d=null;d=u.shift();){if(!d.clz){u.unshift(d);break}l=0;for(var G=(d.removals||[]).length;l<G;++l)this.removeChild(d.idx);k.forEach(k.map(d.adds,function(v,p){var h={ownerDocument:this.ownerDocument,parent:this,indexAtStartup:d.idx+p},q=c.isArray(d.clz)?d.clz[p]:d.clz;h[(c.isFunction(this.childParams)&&this.childParams.call(h,this)||this.childParams||this["data-mvc-child-props"]&&r.call(h,this["data-mvc-child-props"])||{})._relTargetProp||q.prototype._relTargetProp||
"target"]=v;var w=this.childParams||this["data-mvc-child-props"]&&r.call(h,this["data-mvc-child-props"]),C=this.childBindings||this["data-mvc-child-bindings"]&&r.call(h,this["data-mvc-child-bindings"]);!this.templateString||h.templateString||q.prototype.templateString||(h.templateString=this.templateString);!C||h.bindings||q.prototype.bindings||(h.bindings=C);return new q(c.delegate(c.isFunction(w)?w.call(h,this):w,h))},this),function(v,p){this.addChild(v,d.idx+p)},this)}}}z(this);for(var f=this.getChildren(),
a=null;a=f.pop();)this.removeChild(a),a.destroy();if(c.isArray(b)){var g=this,t=this._buildChildrenSeq=(this._buildChildrenSeq||0)+1;f={idx:0,removals:[],adds:[].concat(b)};var u=[f];c.isFunction(b.watchElements)&&(this._handles=this._handles||[]).push(b.watchElements(function(n,l,d){l&&d&&g.partialRebuild?(n={idx:n,removals:l,adds:d},u.push(n),A.call(g,d,c.hitch(g,e,n))):g._buildChildren(b)}));A.call(this,b,c.hitch(this,e,f))}},destroy:function(){z(this);this.inherited(arguments)}});m.prototype["data-mvc-child-type"]=
m.prototype["data-mvc-child-mixins"]=m.prototype["data-mvc-child-props"]=m.prototype["data-mvc-child-bindings"]="";return m});