!function(){var moduleFactory=function($){var module=this,exports=function(){var getSetZero=function(v){return void 0!==v?this.array[0]=v:this.array[0]},getSetOne=function(v){return void 0!==v?this.array[1]=v:this.array[1]};$.Vector=function(){this.update($.makeArray(arguments))},$.Vector.prototype={app:function(f){var i,vec,newArr=[];for(i=0;i<this.array.length;i++)newArr.push(f(this.array[i]));return vec=new $.Vector,vec.update(newArr)},plus:function(){var i,args=arguments[0]instanceof $.Vector?arguments[0].array:$.makeArray(arguments),arr=this.array.slice(0),vec=new $.Vector;
for(i=0;i<args.length;i++)arr[i]=(arr[i]?arr[i]:0)+args[i];return vec.update(arr)},minus:function(){var i,args=arguments[0]instanceof $.Vector?arguments[0].array:$.makeArray(arguments),arr=this.array.slice(0),vec=new $.Vector;for(i=0;i<args.length;i++)arr[i]=(arr[i]?arr[i]:0)-args[i];return vec.update(arr)},equals:function(){var i,args=arguments[0]instanceof $.Vector?arguments[0].array:$.makeArray(arguments),arr=this.array.slice(0),vec=new $.Vector;for(i=0;i<args.length;i++)if(arr[i]!=args[i])return null;return vec.update(arr)
},x:getSetZero,left:getSetZero,width:getSetZero,y:getSetOne,top:getSetOne,height:getSetOne,toString:function(){return"("+this.array[0]+","+this.array[1]+")"},update:function(array){var i;if(this.array)for(i=0;i<this.array.length;i++)delete this.array[i];for(this.array=array,i=0;i<array.length;i++)this[i]=this.array[i];return this}},$.Event.prototype.vector=function(){if(this.originalEvent.synthetic){var doc=document.documentElement,body=document.body;return new $.Vector(this.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0),this.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0))
}return new $.Vector(this.pageX,this.pageY)},$.fn.offsetv=function(){if(this[0]==window)return new $.Vector(window.pageXOffset?window.pageXOffset:document.documentElement.scrollLeft,window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop);var offset=this.offset();return new $.Vector(offset.left,offset.top)},$.fn.dimensionsv=function(which){return this[0]!=window&&which?new $.Vector(this[which+"Width"](),this[which+"Height"]()):new $.Vector(this.width(),this.height())}};exports(),module.resolveWith(exports)
};dispatch("mvc/lang.vector").containing(moduleFactory).to("Foundry/2.1 Modules")}();