JS.Decorator=function(){var b=Array.from(arguments),a=b.shift(),c;var e=JS.Class(),f,d,g=arguments.callee;for(f in a.prototype){d=a.prototype[f];if(Function.is(d)&&d!=a)d=g.delegate(f);e.instanceMethod(f,d)}e.instanceMethod('initialize',g.initialize);e.instanceMethod('extend',g.extend);while(c=b.shift())e.include(c);return e};JS.extend(JS.Decorator,{delegate:function(b){return function(){return this.component[b].apply(this.component,arguments)}},initialize:function(b){this.component=b;this.klass=this.constructor=b.klass;var a,c;for(a in b){if(this[a])continue;c=b[a];if(Function.is(c))c=JS.Decorator.delegate(a);this[a]=c}},extend:function(b){this.component.extend(b);var a,c;for(a in b){c=b[a];if(Function.is(c))c=JS.Decorator.delegate(a);this[a]=c}}});