text: /*! snabbt.js v0.5.0 built: 2015-03-29  (c)2015 Daniel Lundin @license MIT */
  !function(a,b){var c=b();"object"==typeof exports?module.exports=c:"function"==typeof define&&define.amd?define([],function(){return a.returnExportsGlobal=c}):a.snabbt=c}(this,function(){var a=[],b=[],c=[],d="transform",e=window.getComputedStyle(document.documentElement,""),f=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];"webkit"===f&&(d="webkitTransform");var g=function(a,b,c){var d=a;if(void 0!==d.length){for(var e={chainers:[],then:function(a){return console.log("DeprecationWarning: then() is renamed to snabbt()"),this.snabbt(a)},snabbt:function(a){var b=this.chainers.length;return this.chainers.forEach(function(c,d){c.snabbt(h(a,d,b))}),e},setValue:function(a){return this.chainers.forEach(function(b){b.setValue(a)}),e},finish:function(){return this.chainers.forEach(function(a){a.finish()}),e},rollback:function(){return this.chainers.forEach(function(a){a.rollback()}),e}},f=0,g=d.length;g>f;++f)e.chainers.push("string"==typeof b?i(d[f],b,h(c,f,g)):i(d[f],h(b,f,g),c));return e}return"string"==typeof b?i(d,b,h(c,0,1)):i(d,h(b,0,1),c)},h=function(a,b,c){if(!a)return a;var d=T(a);S(a.delay)&&(d.delay=a.delay(b,c)),S(a.callback)&&(console.log("DeprecationWarning: callback is renamed to complete"),d.complete=function(){a.callback(b,c)}),S(a.complete)&&(d.complete=function(){a.complete(b,c)}),S(a.valueFeeder)&&(d.valueFeeder=function(d,e){return a.valueFeeder(d,e,b,c)}),S(a.easing)&&(d.easing=function(d){return a.easing(d,b,c)});var e=["position","rotation","skew","rotationPost","scale","width","height","opacity","fromPosition","fromRotation","fromSkew","fromRotationPost","fromScale","fromWidth","fromHeight","fromOpacity","transformOrigin","duration","delay"];return e.forEach(function(e){S(a[e])&&(d[e]=a[e](b,c))}),d},i=function(a,c,d){function e(c){return s.tick(c),s.updateElement(a),s.isStopped()?void 0:s.completed()?void(f.loop>1&&!s.isStopped()?(f.loop-=1,s.restart(),r(e)):(f.complete&&f.complete(a),u.length&&(f=u.pop(),i=p(f,l,!0),l=p(f,T(l)),f=q(i,l,f),s=t(f),b.push([a,s]),s.tick(c),r(e)))):r(e)}if("attention"===c)return j(a,d);if("stop"===c)return k(a);var f=c;m();var g=o(a),i=g;i=p(f,i,!0);var l=T(g);l=p(f,l);var n=q(i,l,f),s=t(n);b.push([a,s]),s.updateElement(a);var u=[],v={snabbt:function(a){return u.unshift(h(a,0,1)),v},then:function(a){return console.log("DeprecationWarning: then() is renamed to snabbt()"),this.snabbt(a)}};return r(e),f.manual?s:v},j=function(a,c){function d(b){f.tick(b),f.updateElement(a),f.completed()?(c.callback&&c.callback(a),c.loop&&c.loop>1&&(c.loop--,f.restart(),r(d))):r(d)}var e=p(c);c.movement=e;var f=u(c);b.push([a,f]),r(d)},k=function(a){for(var c=0,d=b.length;d>c;++c){var e=b[c],f=e[0],g=e[1];f===a&&g.stop()}},l=function(a,b){for(var c=0,d=a.length;d>c;++c){var e=a[c],f=e[0],g=e[1];if(f===b){var h=g.getCurrentState();return g.stop(),h}}},m=function(){c=c.filter(function(a){return n(a[0]).body})},n=function(a){for(var b=a;b.parentNode;)b=b.parentNode;return b},o=function(a){var d=l(b,a);return d?d:l(c,a)},p=function(a,b,c){b||(b=M({}));var d="position",e="rotation",f="skew",g="rotationPost",h="scale",i="width",j="height",k="opacity";return c&&(d="fromPosition",e="fromRotation",f="fromSkew",g="fromRotationPost",h="fromScale",i="fromWidth",j="fromHeight",k="fromOpacity"),b.position=P(a[d],b.position),b.rotation=P(a[e],b.rotation),b.rotationPost=P(a[g],b.rotationPost),b.skew=P(a[f],b.skew),b.scale=P(a[h],b.scale),b.opacity=a[k],b.width=a[i],b.height=a[j],b},q=function(a,b,c){return c.startState=a,c.endState=b,c},r=function(b){0===a.length&&window.requestAnimationFrame(s),a.push(b)},s=function(d){for(var e=a.length,f=0;e>f;++f)a[f](d);a.splice(0,e);var g=b.filter(function(a){return a[1].completed()});c=c.filter(function(a){for(var b=0,c=g.length;c>b;++b)if(a[0]===g[b][0])return!1;return!0}),c=c.concat(g),b=b.filter(function(a){return!a[1].completed()}),0!==a.length&&window.requestAnimationFrame(s)},t=function(a){{var b=a.startState,c=a.endState,d=P(a.duration,500),e=P(a.delay,0),f=a.perspective,g=B(P(a.easing,"linear"),a),h=b.clone();a.transformOrigin}h.transformOrigin=a.transformOrigin;var i,j,k=0,l=0,m=!1,n=!1,o=a.manual,p=0,q=e/d;return j=a.valueFeeder?O(a.valueFeeder,b,c,h):N(b,c,h),{stop:function(){m=!0},isStopped:function(){return m},finish:function(a){o=!1;var b=d*p;k=l-b,i=a,g.resetFrom=p},rollback:function(a){o=!1,j.setReverse();var b=d*(1-p);k=l-b,i=a,g.resetFrom=p},restart:function(){k=void 0,g.resetFrom(0)},tick:function(a){if(!m){if(o)return l=a,void this.updateCurrentTransform();if(k||(k=a),a-k>e){n=!0,l=a-e;var b=Math.min(Math.max(0,l-k),d);g.tick(b/d),this.updateCurrentTransform(),this.completed()&&i&&i()}}},getCurrentState:function(){return h},setValue:function(a){n=!0,p=Math.min(Math.max(a,1e-4),1+q)},updateCurrentTransform:function(){var a=g.getValue();o&&(a=Math.max(1e-5,p-q)),j.tween(a)},completed:function(){return m?!0:0===k?!1:g.completed()},updateElement:function(a){if(n){var b=j.asMatrix(),c=j.getProperties();Q(a,b,f),R(a,c)}}}},u=function(a){var b=a.movement,c=M({});a.initialVelocity=.1,a.equilibriumPosition=0;var d=z(a),e=!1;return{stop:function(){e=!0},isStopped:function(){return e},tick:function(){e||d.equilibrium||(d.tick(),this.updateMovement())},updateMovement:function(){var a=d.getValue();c.position[0]=b.position[0]*a,c.position[1]=b.position[1]*a,c.position[2]=b.position[2]*a,c.rotation[0]=b.rotation[0]*a,c.rotation[1]=b.rotation[1]*a,c.rotation[2]=b.rotation[2]*a,c.rotationPost[0]=b.rotationPost[0]*a,c.rotationPost[1]=b.rotationPost[1]*a,c.rotationPost[2]=b.rotationPost[2]*a,1!==b.scale[0]&&1!==b.scale[1]&&(c.scale[0]=1+b.scale[0]*a,c.scale[1]=1+b.scale[1]*a),c.skew[0]=b.skew[0]*a,c.skew[1]=b.skew[1]*a},updateElement:function(a){Q(a,c.asMatrix()),R(a,c.getProperties())},getCurrentState:function(){return c},completed:function(){return d.equilibrium||e},restart:function(){d=z(a)}}},v=function(a){return a},w=function(a){return(Math.cos(a*Math.PI+Math.PI)+1)/2},x=function(a){return a*a},y=function(a){return-Math.pow(a-1,2)+1},z=function(a){var b=P(a.startPosition,0),c=P(a.equilibriumPosition,1),d=P(a.initialVelocity,0),e=P(a.springConstant,.8),f=P(a.springDeceleration,.9),g=P(a.springMass,10),h=!1;return{tick:function(a){if(0!==a&&!h){var i=-(b-c)*e,j=i/g;d+=j,b+=d,d*=f,Math.abs(b-c)<.001&&Math.abs(d)<.001&&(h=!0)}},resetFrom:function(a){b=a,d=0},getValue:function(){return h?c:b},completed:function(){return h}}},A={linear:v,ease:w,easeIn:x,easeOut:y},B=function(a,b){if("spring"==a)return z(b);var c=a;S(a)||(c=A[a]);var d,e=c,f=0;return{tick:function(a){f=e(a),d=a},resetFrom:function(){d=0},getValue:function(){return f},completed:function(){return d>=1?d:!1}}},C=function(a,b,c,d){a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=b,a[13]=c,a[14]=d,a[15]=1},D=function(a,b){a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=Math.cos(b),a[6]=-Math.sin(b),a[7]=0,a[8]=0,a[9]=Math.sin(b),a[10]=Math.cos(b),a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1},E=function(a,b){a[0]=Math.cos(b),a[1]=0,a[2]=Math.sin(b),a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=-Math.sin(b),a[9]=0,a[10]=Math.cos(b),a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1},F=function(a,b){a[0]=Math.cos(b),a[1]=-Math.sin(b),a[2]=0,a[3]=0,a[4]=Math.sin(b),a[5]=Math.cos(b),a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1},G=function(a,b,c){a[0]=1,a[1]=Math.tan(b),a[2]=0,a[3]=0,a[4]=Math.tan(c),a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1},H=function(a,b,c){a[0]=b,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1},I=function(a){a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1},J=function(a,b){b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]},K=function(){var a=new Float32Array(16),b=new Float32Array(16),c=new Float32Array(16);return I(a),{data:a,asCSS:function(){for(var b="matrix3d(",c=0;15>c;++c)b+=Math.abs(a[c])<1e-4?"0,":a[c].toFixed(10)+",";return b+=Math.abs(a[15])<1e-4?"0)":a[15].toFixed(10)+")"},clear:function(){I(a)},translate:function(d,e,f){return J(a,b),C(c,d,e,f),L(b,c,a),this},rotateX:function(d){return J(a,b),D(c,d),L(b,c,a),this},rotateY:function(d){return J(a,b),E(c,d),L(b,c,a),this},rotateZ:function(d){return J(a,b),F(c,d),L(b,c,a),this},scale:function(d,e){return J(a,b),H(c,d,e),L(b,c,a),this},skew:function(d,e){return J(a,b),G(c,d,e),L(b,c,a),this}}},L=function(a,b,c){return c[0]=a[0]*b[0]+a[1]*b[4]+a[2]*b[8]+a[3]*b[12],c[1]=a[0]*b[1]+a[1]*b[5]+a[2]*b[9]+a[3]*b[13],c[2]=a[0]*b[2]+a[1]*b[6]+a[2]*b[10]+a[3]*b[14],c[3]=a[0]*b[3]+a[1]*b[7]+a[2]*b[11]+a[3]*b[15],c[4]=a[4]*b[0]+a[5]*b[4]+a[6]*b[8]+a[7]*b[12],c[5]=a[4]*b[1]+a[5]*b[5]+a[6]*b[9]+a[7]*b[13],c[6]=a[4]*b[2]+a[5]*b[6]+a[6]*b[10]+a[7]*b[14],c[7]=a[4]*b[3]+a[5]*b[7]+a[6]*b[11]+a[7]*b[15],c[8]=a[8]*b[0]+a[9]*b[4]+a[10]*b[8]+a[11]*b[12],c[9]=a[8]*b[1]+a[9]*b[5]+a[10]*b[9]+a[11]*b[13],c[10]=a[8]*b[2]+a[9]*b[6]+a[10]*b[10]+a[11]*b[14],c[11]=a[8]*b[3]+a[9]*b[7]+a[10]*b[11]+a[11]*b[15],c[12]=a[12]*b[0]+a[13]*b[4]+a[14]*b[8]+a[15]*b[12],c[13]=a[12]*b[1]+a[13]*b[5]+a[14]*b[9]+a[15]*b[13],c[14]=a[12]*b[2]+a[13]*b[6]+a[14]*b[10]+a[15]*b[14],c[15]=a[12]*b[3]+a[13]*b[7]+a[14]*b[11]+a[15]*b[15],c},M=function(a){var b=K(),c={opacity:void 0,width:void 0,height:void 0};return{position:P(a.position,[0,0,0]),rotation:P(a.rotation,[0,0,0]),rotationPost:P(a.rotationPost,[0,0,0]),skew:P(a.skew,[0,0]),scale:P(a.scale,[1,1]),opacity:a.opacity,width:a.width,height:a.height,clone:function(){return M({position:this.position.slice(0),rotation:this.rotation.slice(0),rotationPost:this.rotationPost.slice(0),skew:this.skew.slice(0),scale:this.scale.slice(0),height:this.height,width:this.width,opacity:this.opacity})},asMatrix:function(){var a=b;return a.clear(),this.transformOrigin&&a.translate(-this.transformOrigin[0],-this.transformOrigin[1],-this.transformOrigin[2]),(1!==this.scale[0]||1!==this.scale[1])&&a.scale(this.scale[0],this.scale[1]),(0!==this.skew[0]||0!==this.skew[1])&&a.skew(this.skew[0],this.skew[1]),(0!==this.rotation[0]||0!==this.rotation[1]||0!==this.rotation[2])&&(a.rotateX(this.rotation[0]),a.rotateY(this.rotation[1]),a.rotateZ(this.rotation[2])),(0!==this.position[0]||0!==this.position[1]||0!==this.position[2])&&a.translate(this.position[0],this.position[1],this.position[2]),(0!==this.rotationPost[0]||0!==this.rotationPost[1]||0!==this.rotationPost[2])&&(a.rotateX(this.rotationPost[0]),a.rotateY(this.rotationPost[1]),a.rotateZ(this.rotationPost[2])),this.transformOrigin&&a.translate(this.transformOrigin[0],this.transformOrigin[1],this.transformOrigin[2]),a},getProperties:function(){return c.opacity=this.opacity,c.width=this.width+"px",c.height=this.height+"px",c}}},N=function(a,b,c){var d=a,e=b,f=c;return{tween:function(a){var b=e.position[0]-d.position[0],c=e.position[1]-d.position[1],g=e.position[2]-d.position[2],h=e.rotation[0]-d.rotation[0],i=e.rotation[1]-d.rotation[1],j=e.rotation[2]-d.rotation[2],k=e.rotationPost[0]-d.rotationPost[0],l=e.rotationPost[1]-d.rotationPost[1],m=e.rotationPost[2]-d.rotationPost[2],n=e.scale[0]-d.scale[0],o=e.scale[1]-d.scale[1],p=e.skew[0]-d.skew[0],q=e.skew[1]-d.skew[1],r=e.width-d.width,s=e.height-d.height,t=e.opacity-d.opacity;f.position[0]=d.position[0]+a*b,f.position[1]=d.position[1]+a*c,f.position[2]=d.position[2]+a*g,f.rotation[0]=d.rotation[0]+a*h,f.rotation[1]=d.rotation[1]+a*i,f.rotation[2]=d.rotation[2]+a*j,f.rotationPost[0]=d.rotationPost[0]+a*k,f.rotationPost[1]=d.rotationPost[1]+a*l,f.rotationPost[2]=d.rotationPost[2]+a*m,f.skew[0]=d.skew[0]+a*p,f.skew[1]=d.skew[1]+a*q,f.scale[0]=d.scale[0]+a*n,f.scale[1]=d.scale[1]+a*o,void 0!==e.width&&(f.width=d.width+a*r),void 0!==e.height&&(f.height=d.height+a*s),void 0!==e.opacity&&(f.opacity=d.opacity+a*t)},asMatrix:function(){return f.asMatrix()},getProperties:function(){return f.getProperties()},setReverse:function(){var a=d;d=e,e=a}}},O=function(a,b,c,d){var e=a(0,K()),f=b,g=c,h=d,i=!1;return{tween:function(b){i&&(b=1-b),e.clear(),e=a(b,e);var c=g.width-f.width,d=g.height-f.height,j=g.opacity-f.opacity;void 0!==g.width&&(h.width=f.width+b*c),void 0!==g.height&&(h.height=f.height+b*d),void 0!==g.opacity&&(h.opacity=f.opacity+b*j)},asMatrix:function(){return e},getProperties:function(){return h.getProperties()},setReverse:function(){i=!0}}},P=function(a,b){return"undefined"==typeof a?b:a},Q=function(a,b,c){var e="";c&&(e="perspective("+c+"px) ");var f=b.asCSS();a.style[d]=e+f},R=function(a,b){for(var c in b)a.style[c]=b[c]},S=function(a){return"function"==typeof a},T=function(a){if(!a)return a;var b={};for(var c in a)b[c]=a[c];return b};return window.jQuery&&!function(a){a.fn.snabbt=function(a,b){return g(this.get(),a,b)}}(jQuery),g.createMatrix=K,g.setElementTransform=Q,g});