if(!("js"in this))this.js={};js.util=js.util||{};js.util.arrayContainsAll=function(a,b){for(var c=0,d=0;d<b.length;d++){for(var e=0;e<a.length;e++)if(a[e]===b[d]){c++;break}if(c<d)return false}return c===b.length};js.util.objectMergeAll=function(a,b){for(var c,d,e=b.length-1;e>=0;e--){c=b[e];for(d in c)if(c.hasOwnProperty(d))a[d]=c[d]}};js.log=function(a){js.log.appendLog(a);js.settings.debug&&js.log._logger(a)};js.log._logItems=[];
js.log.appendLog=function(a){a={timestamp:Number(new Date),message:String(a)};js.log._logItems.push(a)};js.log._logger=function(a,b){if(a&&"log"in a)return function(c){a.log(c)};else if(b&&b.constructor===Function)return b;return function(){}}(this.console,this.print);js.lang=js.lang||{};js.lang.GlobalContext=function(){return this}();js.settings={debug:js.lang.GlobalContext.JS_DEBUG||false,globalClass:js.lang.GlobalContext.JS_GLOBAL_CLASS||false};
try{delete js.lang.GlobalContext.JS_DEBUG;delete js.lang.GlobalContext.JS_GLOBAL_CLASS;delete js.lang.GlobalContext.JS_GLOBAL_INTERFACE;delete js.lang.GlobalContext.JS_GLOBAL_NAMESPACE}catch(e$$5){}Function.prototype.Static=function(a){js.util.objectMergeAll(this,[a]);return this};js.lang.Class=function(){var a=js.lang.Class.generateClass(js.lang.Class.classInvokedWithGlobal);js.lang.Class.extend(a,Array.apply([],arguments));return a};js.lang.Class.STATIC_INIT_INVOKED_WITH_GLOBAL="Static method __init__ requires a context. nie: Parent.__init__.call( this );";
js.lang.Class.CLASS_INSTANTIATED_WITHOUT_BODY="Class requires a class body. ie:\nA = new Class()  ({\n\t__init__ : function ()  {}\n});";js.lang.Class._extending=false;js.lang.Class.generateClass=function(a){var b=function(){return js.lang.Class.__constructor__.call(this,b,a,arguments)};b.__init__=function(){return js.lang.Class.__init__.call(this,b,arguments)};return b};
js.lang.Class.__constructor__=function(a,b,c){if(this===js.lang.GlobalContext)return b.call(this,a,c);if(!a.__initialized__)throw new ReferenceError(js.lang.Class.CLASS_INSTANTIATED_WITHOUT_BODY);this.constructor=a;if(!js.lang.Class._extending)return js.lang.Class.invokeIfExists(this,this.__init__,c)};js.lang.Class.__init__=function(a,b){if(this instanceof Function)throw new TypeError(js.lang.Class.STATIC_INIT_INVOKED_WITH_GLOBAL);return js.lang.Class.invokeIfExists(this,a.prototype.__init__,b)};
js.lang.Class.extend=function(a,b){var c=b[0]||Object;js.lang.Class._extending=true;try{a.prototype=new c}finally{js.lang.Class._extending=false}b.length>1&&js.lang.Class.mergePrototypes(a,b);a.prototype.constructor=c;c===Object&&delete a.prototype.constructor.prototype};js.lang.Class.extendObjects=function(a,b){a.prototype=b[0]||{};b.length>1&&js.util.objectMergeAll(a.prototype,b)};js.lang.Class.invokeIfExists=function(a,b,c){if(b&&b.constructor===Function)return b.apply(a,c||[])};
js.lang.Class.mergePrototypes=function(a,b){for(var c=0;c<b.length;c++)b[c]=b[c].prototype;js.util.objectMergeAll(a.prototype,b)};js.lang.Class.classInvokedWithGlobal=function(a,b){js.util.objectMergeAll(a.prototype,b);a.__initialized__=true;return a};if(js.settings.globalClass)js.lang.GlobalContext.Class=js.lang.Class;js.events=js.events||{};
js.events.EventDispatcher=(new js.lang.Class)({__init__:function(){this._eventListeners=[]},addEventListener:function(a){this._eventListeners.push(a)},hasEventListener:function(a){return _.indexOf(this._eventListeners,a)!==-1},removeEventListener:function(a){a=_.indexOf(this._eventListeners,a);a!==-1&&this._eventListeners.splice(a,1)},dispatchEvent:function(a,b){var c=this,d=js.events.EventDispatcher.EVENT_HANDLE_PREFIX+js.events.EventDispatcher.EVENT_HANDLE_SEPARATOR+a;_.each(this._eventListeners,
function(e){e instanceof{}.constructor&&d in e&&e[d](c,b)})}});js.events.EventDispatcher.EVENT_HANDLE_PREFIX="handle";js.events.EventDispatcher.EVENT_HANDLE_SEPARATOR=":";
