diff --git a/ajax/libs/bonsai/0.4.4/bonsai.min.js b/ajax/libs/bonsai/0.4.4/bonsai.min.js new file mode 100644 index 000000000..fc30f7a33 --- /dev/null +++ b/ajax/libs/bonsai/0.4.4/bonsai.min.js @@ -0,0 +1,308 @@ +/* +(The MIT License) + +Copyright 2012 uxebu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + +External libraries (each with their own license): + + - requirejs: https://github.com/jrburke/requirejs/blob/master/LICENSE + - jasmine: https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE + - phantom-jasmine: Apache 2 - https://github.com/jcarver989/phantom-jasmine/issues/8 + - closure: http://code.google.com/p/closure-compiler/source/browse/trunk/COPYING + - qc.js: https://github.com/darrint/qc.js/blob/master/COPYING + - calc_box: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html + +External resources (each with their own license): + + - cinematicBoomNorm(ogg/mp3/m4a): http://creativecommons.org/licenses/by/3.0/ + http://www.freesound.org/people/HerbertBoland/sounds/33637/ + +*/ +(function __bonsaiRunnerCode__(){function wa(a){if(!(this instanceof wa))return new wa(a);this.name="ParserError";this.message=a[0]}function ca(a,b){this.x=a||0;this.y=b||0}function Q(a,b,c,d,e){this.type=a;this.charCode=c;this.keyCode=b;this.inputValue=e;this.altKey=!!(d&fc);this.ctrlKey=!!(d&gc);this.metaKey=!!(d&hc);this.shiftKey=!!(d&ic)}function ma(a,b,c,d,e){this.type=a;this.stageX=this.x=b;this.stageY=this.y=c;this.clientX=d;this.clientY=e;this.deltaX=this.deltaY=this.diffX=this.diffY=this.isLeft= +this.isRight=this.isMiddle=this.touchId=void 0}function Od(a,b,c){this.translationData={};this.numericStartValues=c?c.toNumeric.call(this.translationData,a,!1):[a];this.numericEndValues=c?c.toNumeric.call(this.translationData,b,!0):[b];this.length=this.numericStartValues.length;this.translator=c}function vg(){var a=this.movies=[];this.add=function(b){-1===a.indexOf(b)&&a.push(b)};this.remove=function(b){b=a.indexOf(b);delete a[b]}}function wg(a){var b=this.type,c=xg[b];do a.emit(b,this),a=a.parent; +while(c&&!this._isStopped&&a)}function yg(){this._isStopped=!0}function Pd(a,b){var c,d,e,f=[],g=!0,h=[],i=a&&a.length||0,b=b||R;if(0===i)return[];for(var j,o,m=0;m>24&255,a>>16&255,a>>8&255,(a>>0&255)/255)}function jc(a,b,c,d){var e,f,g;e=a/255;f=b/255;g=c/255;var h,i,j,o,m=W(e,f,g);i=X(e,f,g);j=(i+m)/2;if(m==i)h=i=0;else{o=m-i;i=0.5c?c+1:16*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function Qd(a,b,c){var b=0.5>=c?c*(b+1):c+b-c*b,d=2*c-b,c=255*Qc(d,b,a+1/3),e=255*Qc(d,b,a),a=255*Qc(d,b,a-1/3);return oa(c)<<24|oa(e)<<16|oa(a)<<8}function Rc(a,b,c){this.context=a;this.listener=b;this.times=c||Infinity}function Rd(a){this.pendingAssets=a}function Sd(a,b){this.disconnect=b;this.notifyRenderer=a}function Td(a,b){this.runnerUrl=a;this.doc=b}function kc(a){return(a=a&&a.nodeType===Ud&&a.getAttribute("data-bs-id"))? ++a:-1}function Sc(a){for(;a&&(a.nodeType!==Ud||!a.hasAttribute("data-bs-id"));)a=a.parentNode;return a}function Tc(a,b,c,d,e){a.emit("userevent",b,c,d,e);lc||a.emit("userevent",b.clone("multi:"+b.type),c,d,e)}function Vd(a,b,c,d,e){var f=b.type;b.type="multi:"+f;a.emit("userevent",b,c,null,e);d||a.emit("userevent",b.clone(f),c,null,e)}function t(a,b,c){a=document.createElementNS("http://www.w3.org/2000/svg",a);if(b)for(var d in b)a.setAttribute(d,b[d]);c&&c.appendChild(a);return a}function Wd(a){for(var a= +a||[],b,c=0,d=a.length;ca?b:a}function Fg(a){if(Wa(a)){var a=+a%(2*Gg)||0,b=this._matrix,c=b.transformPoint(this.origin),d=c.x,c=c.y;b.tx-=d;b.ty-= +c;b.rotate(a-this.rotation);b.tx+=d;b.ty+=c;this._owner._mutatedAttributes.matrix=!0}}function Hg(){var a,b=this._matrix.clone(),c=this._scaleX,d=this._scaleY;if(1!==c||1!==d)a=b.transformPoint(this._origin),b.tx-=a.x,b.ty-=a.y,b.scale(c,d),b.tx+=a.x,b.ty+=a.y;return b}function Ig(a){var b=this._scaleX=be(a.a*a.a+a.b*a.b),c=this._scaleY=be(a.d*a.d+a.c*a.c),d=this._matrix;d.a=a.a;d.b=a.b;d.c=a.c;d.d=a.d;d.tx=a.tx;d.ty=a.ty;if(1!==b||1!==c)a=d.transformPoint(this._origin),d.tx-=a.x,d.ty-=a.y,d.scale(1/ +b||1,1/c||1),d.tx+=a.x,d.ty+=a.y}function Jg(){return this.matrix.tx}function Kg(a){Wa(a)&&(this._matrix.tx=1===this._scaleX?a:this._matrix.tx+(a-this.matrix.tx),this._owner._mutatedAttributes.matrix=!0)}function Lg(){return this.matrix.ty}function Mg(a){Wa(a)&&(this._matrix.ty=1===this._scaleY?a:this._matrix.ty+(a-this.matrix.ty),this._owner._mutatedAttributes.matrix=!0)}function Ng(){return this._scaleX}function Og(a){Wa(a)&&(this._scaleX=+a,this._owner._mutatedAttributes.matrix=!0)}function Pg(){return this._scaleY} +function Qg(a){Wa(a)&&(this._scaleY=+a,this._owner._mutatedAttributes.matrix=!0)}function Rg(){return(this.scaleX+this.scaleY)/2}function Sg(a){this.scaleX=this.scaleY=a}function Tg(a){this._opacity=1a?0:+a}function Ug(){return this._origin.clone()}function Vg(a){var b=this._origin;b.x=a.x;b.y=a.y}function Wg(){return this._cursor}function Xg(a){a?/^(?:default|pointer|wait|progress)$/.test(a)&&(this._cursor=a):this._cursor=null}function Yg(){return this._filters.slice(0)}function Zg(a){a?(a= +[].concat(a),this._filters=a=a.map(function(a){return a instanceof ce.BaseFilter?a:new ce[a]})):this._filters.length=0}function $g(a){var b=this._owner;b._mutatedAttributes.clipId=!0;if(a){if(a.stage&&!a._isOffStage)throw Error("You cannot set a clip that has been previously added to the stage");if(!("composeRenderMessage"in a))throw Error("Not a valid clip element");b.stage&&G.registerOffStageObj(b,a,b.stage,"clip");this._clipId=a.id;this._clip=a}else this._clip&&G.unregisterOffStageObj(b,this._clip), +this._clipId=this._clip=null}function ah(){return this._clip}function bh(a){var b=this._owner;b._mutatedAttributes.maskId=!0;if(a){if(a.stage&&!a._isOffStage)throw Error("You cannot set a mask that has been previously added to the stage");if(!("composeRenderMessage"in a))throw Error("Not a valid mask");b.stage&&G.registerOffStageObj(b,a,b.stage,"mask");this._maskId=a.id;this._mask=a}else this._mask&&G.unregisterOffStageObj(b,this._mask),this._maskId=this._mask=null}function ch(){return this._mask} +function G(){Object.defineProperty(this,"id",{value:dh++});this._attributes=Object.create(null,{_owner:C(this),_matrix:C(new eh),matrix:H(Hg,Ig,!0),_filters:C([],!0),filters:H(Yg,Zg,!0),interactive:C(!0,!0),_opacity:C(1,!0),opacity:H(fh,Tg,!0),_origin:C(new gh),origin:H(Ug,Vg,!0),rotation:H(Eg,Fg,!0),_scaleX:C(1,!0),_scaleY:C(1,!0),scale:H(Rg,Sg,!0),scaleX:H(Ng,Og,!0),scaleY:H(Pg,Qg,!0),x:H(Jg,Kg,!0),y:H(Lg,Mg,!0),clip:H(ah,$g,!0),_clip:C(null,!0),_clipId:C(null,!0),mask:H(ch,bh,!0),_mask:C(null, +!0),_maskId:C(null,!0),cursor:H(Wg,Xg,!0),_cursor:C(null,!0),fillRule:C("inherit",!0),visible:C(!0,!0)});this._isOffStage=!1;this._renderAttributes={matrix:"matrix",filters:"_filters",opacity:"_opacity",clipId:"_clipId",maskId:"_maskId",cursor:"_cursor",fillRule:"fillRule",visible:"visible",interactive:"interactive"};this._mutatedAttributes=xa.mixin({},this._renderAttributes)}function hh(a){return-1!==this.indexOf(a)}function de(a){this.children=[];this.owner=a}function ee(a){Wc.prototype._activate.call(this, +a);for(var b=this.displayList.children,c=0,d=b.length;ce?(c/=d,e=q+p/K(c,2),d=za(e),c*=d,ya=f=0):(p=(f===g?-1:1)*za(e),f=p*c*ya/d,ya=-p*d*n/c);n=f*o-ya*j+(a+h)/2;o=f*j+ya*o+(b+i)/2;b=je((b-o)/d);i=je((i-o)/d);b=ab&&(b=2*ea+b);0>i&&(i=2*ea+i);g&&b>i&&(b-=2*ea);!g&&i>b&&(i-=2*ea);return{cx:n,cy:o,rx:c,ry:d,startAngle:b,endAngle:i}}function ke(a,b,c,d,e){if(0==e)return{left:[a,a,a,a],right:[a,b,c,d]};if(1==e)return{left:[a, +b,c,d],right:[d,d,d,d]};var f=w.lerp(a,b,e),g=w.lerp(b,c,e),c=w.lerp(c,d,e),b=w.lerp(f,g,e),g=w.lerp(g,c,e),e=w.lerp(b,g,e);return{left:[a,f,b,e],right:[e,g,c,d]}}function jh(){return this._textFillColor}function kh(a){this._textFillColor=le(a,this._textFillColor)}function lh(){return this._textFillGradient}function mh(a){a&&(this._textFillGradient=nh(a))}function oh(){return this._fontFamily}function ph(a){this._fontFamily=a?a.fontId||a:null}function qh(){return this._glyphx}function rh(a){Xa.isArray(a)&& +(this._glyphx=a);a||(this._glyphx=null)}function sh(){return this._glyphy}function th(a){Xa.isArray(a)&&(this._glyphy=a);a||(this._glyphy=null)}function uh(a){this._textStrokeColor=le(a,this._textStrokeColor)}function me(a){ne.call(this);a=""+a;Object.defineProperties(this._attributes,{text:F("",!0,!0),fontSize:F(null,!0,!0),fontFamily:Aa(oh,ph,!0),_fontFamily:F(null,!0),fontStyle:F(null,!0,!0),fontWeight:F(null,!0,!0),_textFillColor:F(null,!0),textFillColor:Aa(jh,kh,!0),_textFillGradient:F(null, +!0),textFillGradient:Aa(lh,mh,!0),textFillOpacity:F(1,!0,!0),_glyphx:F(null,!0),_glyphy:F(null,!0),glyphx:Aa(qh,rh,!0),glyphy:Aa(sh,th,!0),textLineOpacity:F(1,!0,!0),_textStrokeColor:F(null,!0),textStrokeColor:Aa(vh,uh,!0),textStrokeWidth:F(null,!0,!0),selectable:F(!0,!0,!0)});this._renderAttributes={fontSize:"fontSize",fontFamily:"_fontFamily",fontStyle:"fontStyle",fontWeight:"fontWeight",fillColor:"_textFillColor",fillGradient:"_textFillGradient",fillOpacity:"textFillOpacity",filters:"_filters", +glyphx:"_glyphx",glyphy:"_glyphy",strokeOpacity:"textLineOpacity",strokeColor:"_textStrokeColor",strokeWidth:"textStrokeWidth",opacity:"_opacity",text:"text",selectable:"selectable"};null!=a&&this.attr("text",a)}function wh(){return this._textFillColor}function xh(a){this._textFillColor=oe(a,this._textFillColor)}function yh(){return this._textFillGradient}function zh(a){a&&(this._textFillGradient=Ah(a))}function Bh(){return this._fontFamily}function Ch(a){this._fontFamily=a?a.fontId||a:null}function Dh(a){this._textStrokeColor= +oe(a,this._textStrokeColor)}function Eh(a){if("butt"===a||"round"===a||"square"===a)this._cap=""+a}function Fh(a){if("miter"===a||"round"===a||"bevel"===a)this._join=""+a}function Gh(a){1<=a&&(this._miterLimit=+a)}function Hh(a){this._owner.clear();this._owner.addChild(new $c(a))}function Ih(){for(var a=this._owner.children(),b=[],c=0,d=a.length;cd.status||304==d.status?b(this.responseText):c(d.status+" ("+d.statusText+")")};d.onerror=c;d.send(null)}var db={module$exports:function(a){return{isLoading:!1,isWaiting:0,waitingCallbacks:[],queue:[],load:function(b,c){var d=this,e=this.queue,f=this.waitingCallbacks;this.isLoading||this.isWaiting?e.push([b,c]):(this.isLoading=!0,a(b,function(a){a? +c(a):(c&&(d.isWaiting?f.push(c):c(null)),d.isLoading=!1,e.length&&d.load.apply(d,e.shift()))}))},wait:function(){this.isWaiting++},done:function(){this.isWaiting--;if(!this.isWaiting)for(var a=0,c=this.waitingCallbacks.length;aa?Math.pow(a,2)/2:-1*(--a*(a-2)-1)/2},cubicIn:function(a){return Math.pow(a,3)},cubicOut:function(a){return Math.pow(a-1,3)+1},cubicInOut:function(a){a*=2;return 1>a?Math.pow(a,3)/2:(Math.pow(a-2,3)+2)/2},quartIn:function(a){return Math.pow(a,4)},quartOut:function(a){return-1*(Math.pow(a-1,4)-1)},quartInOut:function(a){a*=2;return 1>a?Math.pow(a,4)/2:-0.5*(Math.pow(a-2,4)-2)},quintIn:function(a){return Math.pow(a,5)},quintOut:function(a){return Math.pow(a- +1,5)+1},quintInOut:function(a){a*=2;return 1>a?Math.pow(a,5)/2:(Math.pow(a-2,5)+2)/2},sineIn:function(a){return-1*Math.cos(a*(Math.PI/2))+1},sineOut:function(a){return Math.sin(a*(Math.PI/2))},sineInOut:function(a){return-1*(Math.cos(Math.PI*a)-1)/2},expoIn:function(a){return 0===a?0:Math.pow(2,10*(a-1))},expoOut:function(a){return 1===a?1:-1*Math.pow(2,-10*a)+1},expoInOut:function(a){if(0===a)return 0;if(1===a)return 1;a*=2;if(1>a)return Math.pow(2,10*(a-1))/2;--a;return(-1*Math.pow(2,-10*a)+2)/ +2},circIn:function(a){return-1*(Math.sqrt(1-Math.pow(a,2))-1)},circOut:function(a){return Math.sqrt(1-Math.pow(a-1,2))},circInOut:function(a){a*=2;return 1>a?-0.5*(Math.sqrt(1-Math.pow(a,2))-1):0.5*(Math.sqrt(1-Math.pow(a-2,2))+1)},backIn:function(a){return Math.pow(a,2)*(2.70158*a-1.70158)},backOut:function(a){a-=1;return Math.pow(a,2)*(2.70158*a+1.70158)+1},backInOut:function(a){a*=2;if(1>a)return Math.pow(a,2)*(3.5949095*a-2.5949095)/2;a-=2;return(Math.pow(a,2)*(3.5949095*a+2.5949095)+2)/2},elasticIn:function(a){if(0=== +a||1===a)return a;a-=1;return-1*Math.pow(2,10*a)*Math.sin(2*(a-0.075)*Math.PI/0.3)},elasticOut:function(a){return 0===a||1===a?a:Math.pow(2,-10*a)*Math.sin(2*(a-0.075)*Math.PI/0.3)+1},elasticInOut:function(a){if(0===a)return 0;a*=2;if(2===a)return 1;var b=0.3*1.5,c=b/4;if(1>a)return a-=1,-0.5*Math.pow(2,10*a)*Math.sin(2*(a-c)*Math.PI/b);a-=1;return 0.5*Math.pow(2,-10*a)*Math.sin(2*(a-c)*Math.PI/b)+1},bounceIn:function(a){return 1-uc.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*Math.pow(a, +2):a<2/2.75?7.5625*Math.pow(a-1.5/2.75,2)+0.75:a<2.5/2.75?7.5625*Math.pow(a-2.25/2.75,2)+0.9375:7.5625*Math.pow(a-2.625/2.75,2)+0.984375},bounceInOut:function(a){return 0.5>a?uc.bounceIn(2*a)/2:uc.bounceOut(2*a-1)/2+0.5}};Fa.module$exports=uc;Fa.module$exports&&(Fa=Fa.module$exports);var kb={};Od.prototype.at=function(a){for(var b=this.numericStartValues,c=this.numericEndValues,d=[],e=0,f=this.length;earguments.length,e=a.length;d&&(c=a[0]);for(d=d?1:0;d>24&255;d.g=c>>16&255;d.b=c>>8&255;break;default:throw Error("No support for setting: "+a);}return this};s.get=function(a){var b=this._properties; +switch(a){case "r":case "g":case "b":return oa(b[a]);case "a":return b[a];case "h":case "s":case "l":return b[a];default:throw Error("No support for getting: "+a);}};s.lighter=function(a){var b=this.clone();b.set("l",b.get("l")+(null==a?0.01:a));return b};s.darker=function(a){var b=this.clone();b.set("l",b.get("l")-(null==a?0.01:a));return b};s.midpoint=function(a){a=da(a);return new jc((this.r()+a.r())/2,(this.g()+a.g())/2,(this.b()+a.b())/2,(this.a()+a.a())/2)};s.setColorMatrix=function(a){for(var b= +[],c=this._properties,d=c.r,e=c.g,f=c.b,c=c.a,g=a.length;g--;)b[g]=+a[g];this.set("r",X(255,W(0,d*b[0]+e*b[1]+f*b[2]+c*b[3]+255*b[4])));this.set("g",X(255,W(0,d*b[5]+e*b[6]+f*b[7]+c*b[8]+255*b[9])));this.set("b",X(255,W(0,d*b[10]+e*b[11]+f*b[12]+c*b[13]+255*b[14])));this.set("a",X(1,W(0,d*b[15]+e*b[16]+f*b[17]+c*b[18]+b[19])));return this};s._setPointAlongRange=function(a,b,c){var a=a.charAt(0),d=this[a]();switch(a){case "r":case "g":case "b":this.set(a,c?W(0,X(255,b*c+(d-c/2))):255*b);break;default:this.set(a, +c?W(0,X(1,b*c+d-c/2)):b)}return this};s.randomize=function(a,b){if(!a||"string"==typeof a)a=a?[a]:["r","g","b"];for(var c=this.clone(),d=a.length;d--;)c._setPointAlongRange(a[d],Hi(),b);return c};s.clone=function(a){return a?da(+this).set(a):da(+this)};s.rgba=function(){return"rgba("+[this.r(),this.g(),this.b(),this.a()].join()+")"};s.rgb=function(){return"rgb("+[this.r(),this.g(),this.b()].join()+")"};s.hsla=function(){return"hsla("+[oa(360*this.h()),oa(100*this.s())+"%",oa(100*this.l())+"%",this.a()].join()+ +")"};s.int32=function(){return((this.r()&255)<<24|(this.g()&255)<<16|(this.b()&255)<<8|255*this.a()&255)>>>0};s.toString=function(){return"0x"+("0000000"+(((this.r()&255)<<24|(this.g()&255)<<16|(this.b()&255)<<8|255*this.a()&255)>>>0).toString(16)).slice(-8)};da.parse=function(a,b){var c,a=""+a;a in hf&&(a=hf[a]);if(/^#[0-9a-f]{6}$/i.test(a))a=(parseInt(a.slice(1),16)<<8|255)>>>0;else if(/^#[0-9a-f]{8}$/i.test(a))a=parseInt(a.slice(1),16)>>>0;else if(/^#[0-9a-f]{3}$/i.test(a))var a=parseInt(a.slice(1), +16),d=a&3840,e=a&240,f=a&15,a=(d<<20|d<<16|e<<16|e<<12|f<<12|f<<8|255)>>>0;if(!isNaN(a))return+a;a=a.split("(");if(2==a.length)switch(d=a[1].slice(0,-1).split(","),e=d.length,a[0]){case "rgb":c=255;case "rgba":if(4==e||3==e&&c)return((d[0]&255)<<24|(d[1]&255)<<16|(d[2]&255)<<8|(c||255*X(1,W(0,d[3]))&255))>>>0;break;case "hsl":c=255;case "hsla":if(4==e||3==e&&c)return a=Qd(d[0]%360/360,parseInt(d[1])/100,parseInt(d[2])/100),a|(c||255*d[3]&255)}return null==b?null:da.parse(b)};B.module$exports=da;B.module$exports&& +(B=B.module$exports);var z={},Ii=n,td="".split,ud={addListener:function(a,b,c){2===arguments.length&&(c=b,b=null);var d=c instanceof Rc,e=typeof c;if("function"!=e&&"string"!=e&&!d)throw TypeError("Expected function or string, instead got "+e+".");d||(c=new Rc(b,c));for(var d=this._events||(this._events={}),e=-1,f=td.call(a," "),g=f.length;++e=g&&this.removeListener(a,c,d.listener);return this},listeners:function(a){var b=this._events||(this._events={}),a=":"+a;return b[a]||(b[a]=[])},once:function(a,b,c){2===arguments.length&&(c=b,b=null);return this.addListener(a, +new Rc(b,c,1))},removeListener:function(a,b,c){2===arguments.length&&(c=b,b=null);for(var d,e,f,g,h=this._events||{},i=-1,j=td.call(a," "),o=j.length;++i"+a+"<\/script>")):c.write('