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