/*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("base-core",function(a){var e=a.Object,i=a.Lang,h=".",l="initialized",d="destroyed",c="initializer",b=Object.prototype.constructor,j="deep",m="shallow",k="destructor",g=a.AttributeCore,f=function(t,q,o){var u;for(u in q){if(o[u]){t[u]=q[u];}}return t;};function n(o){if(!this._BaseInvoked){this._BaseInvoked=true;this._initBase(o);}}n._ATTR_CFG=g._ATTR_CFG.concat("cloneDefaultValue");n._ATTR_CFG_HASH=a.Array.hash(n._ATTR_CFG);n._NON_ATTRS_CFG=["plugins"];n.NAME="baseCore";n.ATTRS={initialized:{readOnly:true,value:false},destroyed:{readOnly:true,value:false}};n.prototype={_initBase:function(o){a.stamp(this);this._initAttribute(o);var p=a.Plugin&&a.Plugin.Host;if(this._initPlugins&&p){p.call(this);}if(this._lazyAddAttrs!==false){this._lazyAddAttrs=true;}this.name=this.constructor.NAME;this.init.apply(this,arguments);},_initAttribute:function(){g.apply(this);},init:function(o){this._baseInit(o);return this;},_baseInit:function(o){this._initHierarchy(o);if(this._initPlugins){this._initPlugins(o);}this._set(l,true);},destroy:function(){this._baseDestroy();return this;},_baseDestroy:function(){if(this._destroyPlugins){this._destroyPlugins();}this._destroyHierarchy();this._set(d,true);},_getClasses:function(){if(!this._classes){this._initHierarchyData();}return this._classes;},_getAttrCfgs:function(){if(!this._attrs){this._initHierarchyData();}return this._attrs;},_filterAttrCfgs:function(s,p){var q=null,o,r=s.ATTRS;if(r){for(o in r){if(p[o]){q=q||{};q[o]=p[o];p[o]=null;}}}return q;},_filterAdHocAttrs:function(r,p){var q,s=this._nonAttrs,o;if(p){q={};for(o in p){if(!r[o]&&!s[o]&&p.hasOwnProperty(o)){q[o]={value:p[o]};}}}return q;},_initHierarchyData:function(){var u=this.constructor,r,o,s,t=(this._allowAdHocAttrs)?{}:null,q=[],p=[];while(u){q[q.length]=u;if(u.ATTRS){p[p.length]=u.ATTRS;}if(this._allowAdHocAttrs){s=u._NON_ATTRS_CFG;if(s){for(r=0,o=s.length;r<o;r++){t[s[r]]=true;}}}u=u.superclass?u.superclass.constructor:null;}this._classes=q;this._nonAttrs=t;this._attrs=this._aggregateAttrs(p);},_attrCfgHash:function(){return n._ATTR_CFG_HASH;},_aggregateAttrs:function(v){var r,w,q,o,x,p,u,t=this._attrCfgHash(),s={};if(v){for(p=v.length-1;p>=0;--p){w=v[p];for(r in w){if(w.hasOwnProperty(r)){q=f({},w[r],t);o=q.value;u=q.cloneDefaultValue;if(o){if((u===undefined&&(b===o.constructor||i.isArray(o)))||u===j||u===true){q.value=a.clone(o);}else{if(u===m){q.value=a.merge(o);}}}x=null;if(r.indexOf(h)!==-1){x=r.split(h);r=x.shift();}if(x&&s[r]&&s[r].value){e.setValue(s[r].value,x,o);}else{if(!x){if(!s[r]){s[r]=q;}else{f(s[r],q,t);}}}}}}}return s;},_initHierarchy:function(u){var q=this._lazyAddAttrs,v,x,z,s,p,y,t,r=this._getClasses(),o=this._getAttrCfgs(),w=r.length-1;for(z=w;z>=0;z--){v=r[z];x=v.prototype;t=v._yuibuild&&v._yuibuild.exts;if(t){for(s=0,p=t.length;s<p;s++){t[s].apply(this,arguments);}}this.addAttrs(this._filterAttrCfgs(v,o),u,q);if(this._allowAdHocAttrs&&z===w){this.addAttrs(this._filterAdHocAttrs(o,u),u,q);}if(x.hasOwnProperty(c)){x.initializer.apply(this,arguments);}if(t){for(s=0;s<p;s++){y=t[s].prototype;if(y.hasOwnProperty(c)){y.initializer.apply(this,arguments);}}}}},_destroyHierarchy:function(){var s,t,w,u,q,o,r,v,p=this._getClasses();for(w=0,u=p.length;w<u;w++){s=p[w];t=s.prototype;r=s._yuibuild&&s._yuibuild.exts;if(r){for(q=0,o=r.length;q<o;q++){v=r[q].prototype;if(v.hasOwnProperty(k)){v.destructor.apply(this,arguments);}}}if(t.hasOwnProperty(k)){t.destructor.apply(this,arguments);}}},toString:function(){return this.name+"["+a.stamp(this,true)+"]";}};a.mix(n,g,false,null,1);n.prototype.constructor=n;a.BaseCore=n;},"3.5.1",{requires:["attribute-core"]});