/* anim8js 1.1.12 - anim8js - Anim8 Everything by Philip Diffenderfer */ !function(t,e){"function"==typeof define&&define.amd?define("anim8js",[],function(){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(global):(t.m8=t.anim8=t.anim8js=e(t),t.m8s=t.anim8s=t.anim8.anim8s)}(this,function(t){function e(){}function r(t){return"undefined"!=typeof t}function n(t){return!!(t&&t.constructor&&t.call&&t.apply)}function i(t){return"number"==typeof t}function a(t){return"boolean"==typeof t}function s(t){return"string"==typeof t}function o(t){return t instanceof Array}function u(t){return"object"==typeof t&&null!==t}function c(t){if(o(t)||s(t))return 0===t.length;if(null===t)return!0;if(u(t))for(var e in t)return!1;else if(i(t))return 0!==t;return!0}function h(t,e){if(s(t))return e?t.split(e):[t];if(o(t))return t;if(u(t)){var n=[];for(var i in t)n.push(i);return n}return r(t)?[t]:[]}function l(t){if(o(t)){for(var e=[],r=0;r=0;i--)n[i][0]===r&&n.splice(i,1)}function ot(t,e){t&&e in t&&delete t[e]}function ut(t,e,r,n){if(t&&e in t){for(var i=t[e],a=i.length,s=0;st){var r=t;t=e,e=r}for(;;){if(0===e)return t;if(t%=e,0===t)return e;e%=t}}function mt(t,e){var r,n=1,i=1;for(e>t/2&&(e=t-e);e>=1;)n*=t--,i*=e--,r=pt(n,i),n/=r,i/=r;return n}function dt(t,e,r){return tr?r:t}function gt(t,e){return function(r){return dt(r,t,e)}}function vt(t){return t*We}function yt(t){return t*Ke}function bt(t){return function(e){return e%t}}function xt(t,e,r){var n,i;if(e){var a=we(e),s=a.parse(r);n=function(t,e){return a},i=function(t,e,r){return a.parse(r,s,!0)}}else n=function(t,e){return e.getAttribute(t.attribute).calculator},i=function(t,e,r){return e.getAttribute(t.attribute).parse(r,!0)};return wt(n,i,function(e,r){return J(e,r,e.parameters[t],i)})}function wt(t,e,r){return f(r,Je),r.getCalculator=t,r.parseValue=e,Q(r)}function At(t,e,r){var n=t.getCalculator,i=t.parseValue;return r&&(r=we(r),n=function(t,e){return r},i=function(t,e,n){return r.parse(n,void 0,!0)}),wt(n,i,function(r,i){var a=n(r,i);return e(r,i,t,a)})}function Mt(t,e,r){var e=ye(e,p(r,er.options),er.cache,er.forObject),n=er.prefix+t,i=n.toLowerCase();e.name=n,tr[i]=e}function Tt(t,e){var i=l(er);if(s(t))er.prefix+=t;else if(u(t)){if(s(t.prefix)&&(er.prefix+=t.prefix),r(t.cache)&&(er.cache=t.cache),r(t.options)){var a=Pe(t.options,er.cache);a!==De.noOptions&&f(er.options,a)}if(r(t.forObject)&&(er.forObject=t.forObject),r(t.factory)){var o=Ne(t.factory);o&&(er.forObject=o)}}if(u(e))for(var c in e)Mt(c,e[c]);else n(e)&&e();er=i}function It(t,e,r,n,i){var a=ye(t,n,i),o=a.newAttrimators();for(var u in e){var c=e[u];o.get(u).attribute=c,o.rekey(u,c)}var h=new g(r,a.input,a.options,o);return s(r)&&Mt(r,h),h}function St(){this.createConstants()}function Nt(){this.createConstants()}function Ct(){this.createConstants()}function zt(){this.createConstants()}function Ot(){this.createConstants()}function Pt(){this.createConstants()}function Et(){this.createConstants()}function qt(){this.priority=0,this.attributes={}}function Ft(){}function Vt(){}function Rt(){}function $t(){}function kt(){}function Dt(){}function jt(){}function Ht(){}function Bt(){}function Lt(){}function Zt(){}function Gt(){}function _t(){}function Yt(){}function Ut(t,e,r,n){this.name=t,this.set(e,r,n)}function Xt(t,e,r,n,i,a,s){this.name=t,this.set(e,r,n,i,a,s)}function Qt(t,e,r,n){this.name=t,this.set(e,r,n)}function Wt(t,e,r,n){this.name=t,this.set(e,r,n)}function Kt(t,e,r,n){this.name=t,this.set(e,r,n)}function Jt(t,e,r,n){this.name=t,this.set(e,r,n)}function te(t,e,r){this.name=t,this.set(e,r)}function ee(t,e,r,n,i,a){this.name=t,this.set(e,r,n,i,a)}function re(t,e,r,n,i,a){this.name=t,this.set(e,r,n,i,a)}function ne(t,e,r){this.name=t,this.set(e,r)}function ie(t,e,r,n,i){this.name=t,this.set(e,r,n,i)}function ae(t,e,r){this.name=t,this.set(e,r)}function se(t,e,r){this.name=t,this.set(e,r)}function oe(t,e,r,n,i){this.name=t,this.set(e,r,n,i)}function ue(t,e,r,n,i){this.name=t,this.set(e,r,n,i)}function ce(t,e,r,n){this.name=t,this.set(e,r,n)}function he(t,e,r,n){this.name=t,this.set(e,r,n)}function le(t,e,r){this.name=t,this.set(e,r)}function fe(t,e,r,n){this.name=t,this.set(e,r,n)}function pe(t,e,r,n,i,a,s,o,u,c){this.set(t,e,n,r,o,u,c),this.distance=i,this.damping=a,this.stiffness=s,this.temp=null}function me(t,e,r,n,i,a,s,o,u){this.set(t,e,n,r,s,o,u),this.damping=i,this.stiffness=a,this.temp0=null,this.temp1=null}function de(t){this.name=t,this.currentTime=0,this.currentTimelines=[],this.sequenceDelay=0,this.sequenceEasing=Ge.linear,this.introduce=!1,this.timelines=new C,this.autoEnd=!1}function ge(t){this.speed=1,this.time=0,this.currentTime=0,this.playing=!1,this.movie=t,this.duration=t.duration(),this.run=this.runner(t,this)}function ve(t){this.animator=t,this.attrimators=new x,this.start=0}function ye(t,e,r,n){var e=Pe(e,r),i=!c(e);if(t instanceof g){if(i){var a=t.newAttrimators();return t.merge(e,a),new g((!1),t.input,e,a)}return t}if(s(t)){var o=t.toLowerCase();if(o in tr&&!i)return tr[o];var a=be(t,e,r);return o in tr&&!i?tr[o]:new g((!1),{},e,a)}if(u(t)){var a=be(t,e,r,n);return new g((!1),t,e,a)}return!1}function be(t,e,r,n){var i=Pe(e,r),a=!c(i),o=new x;if(t instanceof g)o.putMap(t.newAttrimators()),a&&t.merge(i,o);else if(u(t)){var h=new A(t,i,{},n);for(var l in t){var m=xe(l);m!==!1&&m.parse(t,i,o,h)}}else if(s(t)){var d=t.toLowerCase(),v=tr[d],y=p(r,De.cache);if(v)o.putMap(v.newAttrimators()),a&&v.merge(i,o);else{for(var b=t.split(/\s*,\s*/),w=0;w=2&&l in Ge&&f in Ze&&(a=Ze[f](Ge[l]))}if(null!==a&&isFinite(u)&&1!==u&&(a=Ge.scale(u,a)),null!==a)return a}if(o(t)&&4===t.length&&i(t[0])&&i(t[1])&&i(t[2])&&i(t[3]))return Ge.bezier.apply(null,t);if(!r(t))return Ie(De.easing);if(r(e))return e;throw t+" is not a valid easing"}function Se(t,e){if(n(t))return t;if(s(t)&&t in Ze)return Ze[t];if(e)return!1;throw t+" is not a valid easing type"}function Ne(t,e){if(t instanceof N)return t;if(s(t)&&t in sr)return sr[t];if(e){if(e instanceof N)return e;if(e instanceof E&&(e=e.animators),e instanceof y&&(e=e.$[0]),e instanceof v&&e.factory)return e.factory}return sr["default"]}function Ce(t,e){var r=!1;for(var n in sr){var i=sr[n];i.is(t)&&(r===!1||r.priority"===c){var l=lr(a.substring(1),!1);isNaN(l)||(t.outro=l)}else if("/"===c){var f=ze(a.substring(1),!1);f!==!1&&(t.granularity=f)}else if("^"===c){var m=lr(a.substring(1),!1);m!==!1&&(t.lookup=m)}else{var d=Ie(a,!1);d!==!1&&(t.easing=d);var g=lr(a,!1);g!==!1&&(t.time=g)}}}return u(t)?(t.time=lr(t.time,De.transitionTime),t.outro=lr(t.outro,De.transitionOutro),t.intro=lr(t.intro,De.transitionIntro),t.easing=Ie(p(t.easing,De.transitionEasing)),t.granularity=ze(t.granularity,De.transitionGranularity),t.lookup=lr(t.lookup,De.transitionLookup),s(r)&&p(e,De.cacheTransitions)&&(fr[r]=t),t):De.noTransition}var ke={superPrefix:"_",extend:function(t,e,r){function n(){}n.prototype=e.prototype,t.prototype=new n,u(r)&&this.define(t,r)},define:function(t,e){var r=t.prototype;for(var n in e)n in r&&this.defineProperty(r,this.superPrefix+n,r[n]),this.defineProperty(r,n,e[n])},defineProperty:function(t,e,r){Object.defineProperty?Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:r}):t[e]=r}},De={duration:1e3,easing:"ease",teasing:"linear",delay:0,sleep:0,repeat:1,scale:1,offset:0,transitionTime:500,transitionOutro:100,transitionIntro:100,transitionEasing:"linear",transitionGranularity:0,transitionLookup:10,cache:!1,cacheOptions:!1,cacheTransitions:!1,noOptions:{},noTransition:{},frameRate:16,pauseTime:5,comboPathUniformGranularity:100,calculatorNumber:0,calculator2d:{x:0,y:0},calculator3d:{x:0,y:0,z:0},calculatorQuaternion:{x:0,y:0,z:0,angle:0},calculatorRGB:{r:0,g:0,b:0},calculatorRGBA:{r:0,g:0,b:0,a:1},calculatorString:""},je={THIS:"this",RESULTS:"results",FIRST:"first",TRUE:"true"},He=function(){return Date.now?Date.now:function(){return(new Date).getTime()}}(),Be=function(){return String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^([\s]*)|([\s]*)$/g,"")}}(),Le=function(){var t=0;return function(){return++t}}();ke.define(g,{newAttrimators:function(){return this.attrimators.clone()},merge:function(t,e){var r=new A(this.input,this.options,t);for(var n in this.input){var i=xe(n);i!==!1&&i.merge&&i.merge(this.input,t,this.options,e,r)}return e}}),ke.define(v,{reset:function(t){return this.subject=t,this.attrimators=new x,this.attrimatorsAdded=[],this.frame={},this.updated={},this.finished=!1,this.factory=null,this.active=!1,this.cycleCurrent=0,this.cycleNext=0,this.cycleEnded=0,this},newCycle:function(t){return this.cycleNext++,t instanceof x?this.cycleNext=t.applyCycle(this.cycleNext):t instanceof b&&(t.cycle=this.cycleNext),this},applyCurrentCycle:function(){for(var t=this.cycleCurrent,e=this.attrimators.values,r=e.length-1;r>=0;r--){var n=e[r],i=n.attribute;n.cycle===t&&(this.updated[i]=n.startCycle(this.frame)!==!1||this.updated[i])}return this},endCurrentCycle:function(){this.cycleCurrent>this.cycleEnded&&(this.cycleEnded=this.cycleCurrent,this.trigger("cycleEnd:"+this.cycleCurrent,this.cycleCurrent))},getAttribute:function(t){return this.factory.attribute(t)},restore:function(){return this},applyInitialState:function(){var t=He();return this.preupdate(t),this.update(t),this.apply(),this},preupdate:function(t){var e=this.attrimatorsAdded;if(e.length){for(var r=0;r=0;n--){var i=e[n],a=i.attribute;this.updated[a]=i.setTime(t,this.frame),this.finished=this.finished&&i.isFinished(),r=Math.min(r,i.cycle)}if(this.cycleCurrent=0;e--){var r=t[e];r.isFinished()&&(r.next?this.placeAttrimator(r.next):this.attrimators.removeAt(e))}return!this.wasFinished&&this.finished&&this.trigger("finished",this),this},value:function(t){return this.frame[t]},activate:function(){return D(this),this},deactivate:function(){return this.trigger("deactivate",this),this},destroy:function(){return this.finished=!0,this.factory.destroy(this),this.trigger("destroyed"),this},spring:function(t){var t=Re(t);return t!==!1&&(this.newCycle(t),this.placeAttrimator(t),this.activate(),t)},play:function(t,e,r,n){var i=be(t,e,n,this);return this.newCycle(i),this.playAttrimators(i,r),this.activate()},playAttrimators:function(t,e){e&&this.attrimators.finishNotPresent(t,0);for(var r=t.values,n=r.length-1;n>=0;n--)this.placeAttrimator(r[n]);return this},unplay:function(t,e,r,n,i){var e=$e(e),a=be(t,r,i,this);return this.unplayAttrimators(a,e,n),this.activate()},unplayAttrimators:function(t,e,r){for(var n=new x,i=t.values,a={},s=0;s=0;s--){var o=t[s],u=r.get(o);u&&(i?a.push(u):e.call(this,u,o))}return i?a:this},stop:function(t){return this.attrimatorsFor(t,function(t,e){this.attrimators.remove(e)})},end:function(t){return this.attrimatorsFor(t,function(t){for(;t.next;)t=t.next;t.finish(this.frame)})},finish:function(t){return this.attrimatorsFor(t,function(t){t.finish(this.frame)})},nopeat:function(t){return this.attrimatorsFor(t,function(t){t.nopeat()})},pause:function(t){return this.attrimatorsFor(t,function(t){t.pause()})},resume:function(t){return this.attrimatorsFor(t,function(t){t.resume()})},set:function(t){for(var e in t)this.frame[e]=t[e],this.updated[e]=!0;return this.apply(),this},unset:function(t){for(var t=h(p(t,this.frame)," "),e=t.length-1;e>=0;e--){var r=t[e];this.attrimators.remove(r),delete this.frame[r]}return this},get:function(t){var e={};for(var r in t)e[r]=this.frame[r];return e},timeRemaining:function(){return this.attrimators.timeRemaining()},hasAttrimators:function(){return this.attrimators.size()>0},getSubject:function(t){var e=this.subject;return n(t)&&(e=t(e)),e},invoke:function(t,e,r){return n(t)&&t.apply(e||this,r||[]),this},defer:function(t,e,r){return new I(this,this,t,e,r)},onCycleStart:function(t,e){return this.once("cycleStart:"+this.cycleNext,t,e),this},onCycleEnd:function(t,e){return this.once("cycleEnd:"+this.cycleNext,t,e),this}}),it(v.prototype),ke.define(y,{push:function(t){return this.$.push(t),this},length:function(){return this.$.length},at:function(t){return this.$[t]},each:function(t,e){for(var r=this.$,n=0;nthis.stopTime?r=this.finish(e):n>=this.delay&&(r=this.update(n,e)),this.elapsed=n,r},update:function(t,e){throw"Attrimator.update not implemented"},getElapsed:function(){return this.elapsed},stopIn:function(t){return this.stopTime=this.getElapsed()+t,this},stopAt:function(t){var e=this.totalTime();return t>e?this.next&&this.next.stopAt(t-e):this.stopTime=t,this},nopeat:function(){return this},valueAt:function(t,e){return!1},valueAtSearch:function(t,e){var r=this.totalTime();return t>r?!!this.next&&this.next.valueAtSearch(t-r,e):this.valueAt(t,e)},attrimatorAt:function(t){var e=this.totalTime();return t>e?this.next?this.next.attrimatorAt(t-e):null:this},totalTime:function(){return this.stopTime},timeRemaining:function(){return this.totalTime()-this.elapsed+(this.next?this.next.timeRemaining():0)},clone:function(){throw"AttributeAnimator.clone not implemented"},hasComputed:function(){return!1},isInfinite:function(){return!isFinite(this.stopTime)},pause:function(){return this.paused||(this.pauseTime=He(),this.paused=!0),this},resume:function(){if(this.paused){for(var t=He()-this.pauseTime,e=this;e&&0!==e.startTime;)e.startTime+=t,e=e.next;this.paused=!1}return this},isPaused:function(){return this.paused},finish:function(t){return!1},isFinished:function(){return!1},getBuilder:function(){return this.builder},queue:function(t){return this.next?this.next.queue(t):(this.next=t,this.prestartNext()),this},nextAt:function(t,e){var r=this.totalTime();return e=0;i--){var a=n[i];do a.groupId&&!e||(a.groupId=t),a=a.next;while(r&&a)}},delay:function(t){for(var e=this.values,r=0;r=0;h--){var l=s[h],f=l.attribute,m=this.get(f);m?(m.isInfinite()?m.stopIn(l.delay+c):l.delay+=c-m.timeRemaining(),m.queue(l)):(l.delay+=c,this.put(f,l),o&&r.call(i||this,l))}return this},insertMap:function(t,e,r){for(var i=t.values,a=t.timeRemaining(),s=n(e),o=i.length-1;o>=0;o--){var u=i[o],c=u.attribute,h=this.get(c);this.put(c,u),h&&(u.isInfinite()?u.stopIn(a):h.delay+=a-u.timeRemaining(),u.queue(h)),s&&e.call(r||this,u)}return this},unqueueAt:function(t){var e=this.values[t];return e.next?this.values[t]=e.next:this.removeAt(t),this},playMapAt:function(t,e,r){e&&this.stopNotPresentAt(t,r);for(var n=t.values,i=0;i=0;h--){var l=c[h],f=l.attribute,p=this.get(f),m=n.call(u,f);if(p&&r(m)){var d=i.call(u,f),g=d.calculator,v=l.valueAt(0,g.create());if(v!==!1){var y=t.time,b=g.clone(m),x=!!t.outro&&s.call(u,p,t.outro,g.create()),w=!!t.intro&&l.valueAt(t.intro,g.create()),A=null;if(w!==!1&&t.intro<0&&t.lookup>0){var M=l.valueAt(t.lookup,g.create()),T=g.sub(M,v);if(T!==!1){var I=g.scale(T,t.intro/t.lookup),N=g.add(I,v);w=v,v=N}}if(A=x===!1&&w===!1?new fe(f,g,b,v):x===!1?new oe(f,g,b,v,w):w===!1?new oe(f,g,b,x,v):new ee(f,g,b,x,v,w),t.granularity>2&&t.lookup>0){var C=x===!1?0:t.outro,z=x===!1?b:x,O=s.call(u,p,C+t.lookup,g.create()),P=w===!1?0:t.intro,E=w===!1?v:w,q=l.valueAt(P+t.lookup,g.create());if(O!==!1&&q!==!1){for(var F=g.sub(g.clone(O),z),V=g.length(F)/t.lookup,R=g.sub(g.clone(q),E),$=g.length(R)/t.lookup,k=new te(f,A,t.granularity),D=k.points,j=D.length-1,H=0,B=[],L=0;L=0;h--)a.call(u,c[h]);return this},finishNotPresent:function(t,e){for(var r=this.values,n=e||0,i=r.length-1;i>=0;i--){var a=r[i];t.has(a.attribute)||a.stopIn(n)}return this},stopNotPresentAt:function(t,e){for(var r=this.values,n=r.length-1;n>=0;n--){var i=r[n];t.has(i.attribute)||i.stopAt(e); }return this},clone:function(){for(var t=this.values,e=this.keys,r=new x,n=t.length-1;n>=0;n--)r.values[n]=t[n].clone(),r.keys[n]=e[n],r.indices[e[n]]=n;return r},timeRemaining:function(t){for(var e=0,r=this.values,n=r.length-1;n>=0;n--){var i=r[n];if(i.isInfinite()){if(t)return Number.Infinity}else e=Math.max(e,i.timeRemaining())}return e},applyCycle:function(t){for(var e=this.values,r=null;e.length;){r=[];for(var n=e.length-1;n>=0;n--){var i=e[n];i.cycle=t,i.next&&r.push(i.next)}r.length&&t++,e=r}return t},iterate:function(t,e){for(var r=this.values,n=r.length-1;n>=0;n--)for(var i=r[n],a=null,s=0;i;)t.call(e||this,i,s++,a),i=(a=i).next;return this}}),w.nextMergeId=function(){var t=0;return function(){return t++}}(),ke.define(w,{parse:function(t,e,r,n){throw"Builder.parse not implemented"},merge:function(t,e,r,n,i){var a=this,s=Ne(t.factory,i.forObject);n.iterate(function(t){t.getBuilder()===a&&a.mergeAttrimator(t,t.attribute,i,s)})},mergeAttrimator:function(t,e,r,n){t.easing=r.mergeEasing(e,t.easing),t.repeat=r.mergeRepeat(e,t.repeat),t.delay=r.mergeDelay(e,t.delay),t.sleep=r.mergeSleep(e,t.sleep),t.duration=r.mergeDuration(e,t.duration),t.offset=r.mergeOffset(e,t.offset),t.scale=r.mergeScale(e,t.scale),t.scaleBase=r.mergeScaleBase(e,t.scaleBase,n),t.parameters=r.mergeParameters(t.parameters)},submerge:function(t,e,r,n){var i=new A(t,r,e,this.forObject);for(var a in t){var s=xe(a);s!==!1&&s.merge&&s.merge(t,e,r,n,i)}}}),ke.define(A,{prepareSpecifics:function(t){u(this.input[t])||(this.input[t]={})},parseEasing:function(t){return this.parseFirst(t,"easing","easings")},parseRepeat:function(t){return this.parseNumber(t,hr,hr,"repeat","repeatAdd","repeatScale","repeats")},parseDelay:function(t){return this.parseNumber(t,Ae,lr,"delay","delayAdd","delayScale","delays")},parseSleep:function(t){return this.parseNumber(t,Ve,lr,"sleep","sleepAdd","sleepScale","sleeps")},parseDuration:function(t){return this.parseNumber(t,Te,lr,"duration","durationAdd","durationScale","durations")},parseOffset:function(t){return this.parseNumber(t,Oe,lr,"offset","offsetAdd","offsetScale","offsets")},parseScale:function(t){return this.parseNumber(t,Fe,ze,"scale","scaleAdd","scaleScale","scales")},parseScaleBase:function(t){return this.parseFirst(t,"scaleBase","scaleBases")},parseFirst:function(t,e,r){return p(this.input[r][t],this.oldOptions[e])},parseEvent:function(t,e,r,n,i){var a=this.parseDuration(t),s=this.parseEasing(t),o=this.parseDelay(t),u=this.parseSleep(t),c=this.parseRepeat(t),h=this.parseOffset(t),l=this.parseScale(t),f=this.parseScaleBase(t),p=this.parseParameters(),m=new S(t,e,a,s,o,u,h,c,l,f,p,n,r,null,this.input);return m},parseNumber:function(t,e,r,n,i,a,s){var o=p(this.input[s][t],this.oldOptions[n]),u=e(o),c=r(this.oldOptions[i],0),h=p(this.oldOptions[a],1);return 0===c&&1===h?o:(u+c)*h},parseParameters:function(){return f({},this.input.parameters,this.oldOptions)},mergeEasing:function(t,e){return this.mergeFirst(t,e,Ie,"easing","easings")},mergeRepeat:function(t,e){return this.mergeNumber(t,e,hr,"repeat","repeatAdd","repeatScale","repeats")},mergeDelay:function(t,e){return this.mergeNumber(t,e,lr,"delay","delayAdd","delayScale","delays")},mergeSleep:function(t,e){return this.mergeNumber(t,e,lr,"sleep","sleepAdd","sleepScale","scales")},mergeDuration:function(t,e){return this.mergeNumber(t,e,lr,"duration","durationAdd","durationScale","durations")},mergeOffset:function(t,e){return this.mergeNumber(t,e,lr,"offset","offsetAdd","offsetScale","offsets")},mergeScale:function(t,e){return this.mergeNumber(t,e,ze,"scale","scaleAdd","scaleScale","scales")},mergeScaleBase:function(t,e,r){var n=r.attribute(t).calculator,i=function(t,e){return n.parse(t,e)};return this.mergeFirst(t,e,i,"scaleBase","scaleBases")},mergeParameters:function(t){return f({},this.newOptions.parameters,t)},mergeFirst:function(t,e,r,n,i){var a=this.input[i][t],s=p(a,this.newOptions[n],this.oldOptions[n]);return r(s,e)},mergeNumber:function(t,e,r,n,i,a,s){var o=p(this.input[s][t],this.newOptions[n],this.oldOptions[n]),u=r(o,e),c=r(p(this.newOptions[i],this.oldOptions[i]),0),h=p(this.newOptions[a],this.oldOptions[a],1);return(u+c)*h}}),ke.define(M,{createConstants:function(){this.ZERO=this.create(),this.ONE=this.parse(1,this.ZERO),this.INFINITY=this.parse(Number.POSITIVE_INFINITY,this.ZERO)},parse:function(t,e,r){throw"Calculator.parse not implemented"},parseArray:function(t,e,r){t.length!==e.length&&(e.length=t.length);for(var n=this.parse(r,this.ZERO),i=0;ir*r?this.scale(t,r/Math.sqrt(n)):t},setLength:function(t,e){var r=this.lengthSq(t);return 0!==r?this.scale(t,e/Math.sqrt(r)):t}}),ke.define(T,{$reset:function(t,e,r,n,i){this.$eventable=t,this.$previous=e,this.$eventType=r,this.$event=n,this.$callback=i,this.$calls=[],this.$next=[],this.$isRoot()&&this.$register()},$isRoot:function(){return this.$eventable===this.$previous},$register:function(){this.$eventable[this.$eventType](this.$event,this.$run,this)},$push:function(t){return function(){return this.$calls.push([t,arguments]),this}},$run:function(){n(this.$callback)&&this.$callback.call(this.$eventable,this);for(var t=0;t=s?(u=_e.FINISHED,c=1):(t-=l*h,t>i?(u=_e.SLEEPING,c=1):(u=_e.ANIMATING,c=t/i)),(u===_e.ANIMATING||u!==_e.ANIMATING&&o===_e.ANIMATING)&&(this.applyValue(e,e[this.attribute],c),r=!0),this.state=u,r},valueAt:function(t,e){if(t+=this.offset,t=this.delay){var n=this.duration+this.sleep,i=t-this.delay,a=Math.floor(i/n);r=a>=this.repeat?1:Math.min(1,i%n/this.duration)}return this.computeValue(e,r)},totalTime:function(){var t=this.sleep?(this.repeat-1)*this.sleep:0,e=this.repeat*this.duration;return Math.min(this.stopTime,this.delay+e+t-this.offset)},clone:function(){return new S(this.attribute,this.path,this.duration,this.easing,this.delay,this.sleep,this.offset,this.repeat,this.scale,this.scaleBase,this.parameters,this.hasInitialState,this.builder,this.next?this.next.clone():null,this.input)},hasComputed:function(){return this.path.computed},isInfinite:function(){return!isFinite(this.repeat)&&!isFinite(this.stopTime)},isFinished:function(){return this.state===_e.FINISHED}}),S.fromOptions=function(t,e,r){return new S(t,e,r.duration,r.easing,r.delay,r.sleep,r.offset,r.repeat,r.scale,r.scaleBase,r.parameters)},ke.define(N,{is:function(t){throw"Factory.is not implemented"},animatorFor:function(t){throw"Factory.animatorFor not implemented"},animatorsFor:function(t,e){e.push(this.animatorFor(t))},destroy:function(t){},attribute:function(t){throw"Factory.attribute not implemented"}}),ke.define(C,{reset:function(){return this.values=[],this.keys=[],this.indices={},this},put:function(t,e){return t in this.indices?this.values[this.indices[t]]=e:(this.indices[t]=this.values.length,this.values.push(e),this.keys.push(t)),this},rekey:function(t,e){if(t in this.indices){var r=this.indices[t];this.keys[r]=e,this.indices[e]=r,delete this.indices[t]}return this},putMap:function(t){for(var e=t.keys,r=t.values,n=0;n=this.delay&&this.finish(e)},valueAt:function(t,e){return!(t=0;s--)n[s].delay+=a;return r},reverse:function(){return this.animators.reverse(),this},play:function(t,e,r,n){var i=be(t,e,n,this),a=this;return this.animators.each(function(t,e){var n=a.createAttrimators(i,e);t.newCycle(n),t.playAttrimators(n,r)}),this.add()},queue:function(t,e,r){var n=be(t,e,r,this),i=this,a=0,s=[];return this.animators.each(function(t,e){s[e]=t.timeRemaining(),a=Math.max(a,s[e])}),this.animators.each(function(t,e){for(var r=a-s[e],o=i.createAttrimators(n,e),u=o.values,c=u.length-1;c>=0;c--)u[c].delay+=r;t.newCycle(o),t.queueAttrimators(o)}),this.add()},insert:function(t,e,r){var n=be(t,e,r,this),i=this;return this.animators.each(function(t,e){var r=i.createAttrimators(n,e);t.newCycle(r),t.insertAttrimators(r)}),this.add()},transition:function(t,e,r,n,i){var t=$e(t),a=be(e,r,i,this),s=this;return this.animators.each(function(e,r){var i=s.createAttrimators(a,r);e.newCycle(i),e.transitionAttrimators(t,i,n)}),this.add()},add:function(){return this.animators.activate(),this}}),ke.extend(q,b,{set:function(t,e,r,n,i,a,s){this.reset(t,null,null),this.calculator=e,this.rest=r,this.position=n,this.gravity=a,this.velocity=i,this.finishOnRest=s},resolveRest:function(){return d(this.rest)},updateVelocity:function(t){throw"Spring.updateVelocity not implemented"},start:function(t,e){this.prestart(t);var r=e.getAttribute(this.attribute),n=we(p(this.calculator,r.calculator));this.calculator=n,this.rest=this.parseValue(e,this.rest,r.defaultValue),this.position=this.parseValue(e,this.position,r.defaultValue),this.gravity=this.parseValue(e,this.gravity,n.ZERO),this.velocity=this.parseValue(e,this.velocity,n.ZERO)},hasComputed:function(){return K(this.rest)||K(this.position)||K(this.gravity)||K(this.velocity)},update:function(t,e){var r=this.calculator,n=Math.min(.001*(t-this.elapsed),q.MAX_DT),i=r.clone(this.position);this.updateVelocity(n),this.velocity=r.adds(this.velocity,this.gravity,n),this.position=r.adds(this.position,this.velocity,n);var a=!r.isEqual(i,this.position,q.EPSILON);return a?e[this.attribute]=this.position:this.finishOnRest&&r.isZero(this.velocity)&&(this.finished=!0),a},finish:function(t){return this.finished=!0,!0},isFinished:function(){return this.finished}}),q.MAX_DT=.1,q.EPSILON=1e-4,it(F);var Ye=!1,Ue=!1,Xe=new y,Qe=function(){for(var e=["ms","moz","webkit","o"],r=this.requestAnimationFrame||t.requestAnimationFrame,n=this.setTimeout||t.setTimeout||n,i=0;ir&&(i=r),i<0&&(i=0),i}},{names:{transparent:{r:255,g:255,b:255,a:0},aliceblue:{r:240,g:248,b:255,a:1},antiquewhite:{r:250,g:235,b:215,a:1},aqua:{r:0,g:255,b:255,a:1},aquamarine:{r:127,g:255,b:212,a:1},azure:{r:240,g:255,b:255,a:1},beige:{r:245,g:245,b:220,a:1},bisque:{r:255,g:228,b:196,a:1},black:{r:0,g:0,b:0,a:1},blanchedalmond:{r:255,g:235,b:205,a:1},blue:{r:0,g:0,b:255,a:1},blueviolet:{r:138,g:43,b:226,a:1},brown:{r:165,g:42,b:42,a:1},burlywood:{r:222,g:184,b:135,a:1},cadetblue:{r:95,g:158,b:160,a:1},chartreuse:{r:127,g:255,b:0,a:1},chocolate:{r:210,g:105,b:30,a:1},coral:{r:255,g:127,b:80,a:1},cornflowerblue:{r:100,g:149,b:237,a:1},cornsilk:{r:255,g:248,b:220,a:1},crimson:{r:220,g:20,b:60,a:1},cyan:{r:0,g:255,b:255,a:1},darkblue:{r:0,g:0,b:139,a:1},darkcyan:{r:0,g:139,b:139,a:1},darkgoldenrod:{r:184,g:134,b:11,a:1},darkgray:{r:169,g:169,b:169,a:1},darkgreen:{r:0,g:100,b:0,a:1},darkkhaki:{r:189,g:183,b:107,a:1},darkmagenta:{r:139,g:0,b:139,a:1},darkolivegreen:{r:85,g:107,b:47,a:1},darkorange:{r:255,g:140,b:0,a:1},darkorchid:{r:153,g:50,b:204,a:1},darkred:{r:139,g:0,b:0,a:1},darksalmon:{r:233,g:150,b:122,a:1},darkseagreen:{r:143,g:188,b:143,a:1},darkslateblue:{r:72,g:61,b:139,a:1},darkslategray:{r:47,g:79,b:79,a:1},darkturquoise:{r:0,g:206,b:209,a:1},darkviolet:{r:148,g:0,b:211,a:1},deeppink:{r:255,g:20,b:147,a:1},deepskyblue:{r:0,g:191,b:255,a:1},dimgray:{r:105,g:105,b:105,a:1},dodgerblue:{r:30,g:144,b:255,a:1},feldspar:{r:209,g:146,b:117,a:1},firebrick:{r:178,g:34,b:34,a:1},floralwhite:{r:255,g:250,b:240,a:1},forestgreen:{r:34,g:139,b:34,a:1},fuchsia:{r:255,g:0,b:255,a:1},gainsboro:{r:220,g:220,b:220,a:1},ghostwhite:{r:248,g:248,b:255,a:1},gold:{r:255,g:215,b:0,a:1},goldenrod:{r:218,g:165,b:32,a:1},gray:{r:128,g:128,b:128,a:1},green:{r:0,g:128,b:0,a:1},greenyellow:{r:173,g:255,b:47,a:1},honeydew:{r:240,g:255,b:240,a:1},hotpink:{r:255,g:105,b:180,a:1},indianred:{r:205,g:92,b:92,a:1},indigo:{r:75,g:0,b:130,a:1},ivory:{r:255,g:255,b:240,a:1},khaki:{r:240,g:230,b:140,a:1},lavender:{r:230,g:230,b:250,a:1},lavenderblush:{r:255,g:240,b:245,a:1},lawngreen:{r:124,g:252,b:0,a:1},lemonchiffon:{r:255,g:250,b:205,a:1},lightblue:{r:173,g:216,b:230,a:1},lightcoral:{r:240,g:128,b:128,a:1},lightcyan:{r:224,g:255,b:255,a:1},lightgoldenrodyellow:{r:250,g:250,b:210,a:1},lightgrey:{r:211,g:211,b:211,a:1},lightgreen:{r:144,g:238,b:144,a:1},lightpink:{r:255,g:182,b:193,a:1},lightsalmon:{r:255,g:160,b:122,a:1},lightseagreen:{r:32,g:178,b:170,a:1},lightskyblue:{r:135,g:206,b:250,a:1},lightslateblue:{r:132,g:112,b:255,a:1},lightslategray:{r:119,g:136,b:153,a:1},lightsteelblue:{r:176,g:196,b:222,a:1},lightyellow:{r:255,g:255,b:224,a:1},lime:{r:0,g:255,b:0,a:1},limegreen:{r:50,g:205,b:50,a:1},linen:{r:250,g:240,b:230,a:1},magenta:{r:255,g:0,b:255,a:1},maroon:{r:128,g:0,b:0,a:1},mediumaquamarine:{r:102,g:205,b:170,a:1},mediumblue:{r:0,g:0,b:205,a:1},mediumorchid:{r:186,g:85,b:211,a:1},mediumpurple:{r:147,g:112,b:216,a:1},mediumseagreen:{r:60,g:179,b:113,a:1},mediumslateblue:{r:123,g:104,b:238,a:1},mediumspringgreen:{r:0,g:250,b:154,a:1},mediumturquoise:{r:72,g:209,b:204,a:1},mediumvioletred:{r:199,g:21,b:133,a:1},midnightblue:{r:25,g:25,b:112,a:1},mintcream:{r:245,g:255,b:250,a:1},mistyrose:{r:255,g:228,b:225,a:1},moccasin:{r:255,g:228,b:181,a:1},navajowhite:{r:255,g:222,b:173,a:1},navy:{r:0,g:0,b:128,a:1},oldlace:{r:253,g:245,b:230,a:1},olive:{r:128,g:128,b:0,a:1},olivedrab:{r:107,g:142,b:35,a:1},orange:{r:255,g:165,b:0,a:1},orangered:{r:255,g:69,b:0,a:1},orchid:{r:218,g:112,b:214,a:1},palegoldenrod:{r:238,g:232,b:170,a:1},palegreen:{r:152,g:251,b:152,a:1},paleturquoise:{r:175,g:238,b:238,a:1},palevioletred:{r:216,g:112,b:147,a:1},papayawhip:{r:255,g:239,b:213,a:1},peachpuff:{r:255,g:218,b:185,a:1},peru:{r:205,g:133,b:63,a:1},pink:{r:255,g:192,b:203,a:1},plum:{r:221,g:160,b:221,a:1},powderblue:{r:176,g:224,b:230,a:1},purple:{r:128,g:0,b:128,a:1},red:{r:255,g:0,b:0,a:1},rosybrown:{r:188,g:143,b:143,a:1},royalblue:{r:65,g:105,b:225,a:1},saddlebrown:{r:139,g:69,b:19,a:1},salmon:{r:250,g:128,b:114,a:1},sandybrown:{r:244,g:164,b:96,a:1},seagreen:{r:46,g:139,b:87,a:1},seashell:{r:255,g:245,b:238,a:1},sienna:{r:160,g:82,b:45,a:1},silver:{r:192,g:192,b:192,a:1},skyblue:{r:135,g:206,b:235,a:1},slateblue:{r:106,g:90,b:205,a:1},slategray:{r:112,g:128,b:144,a:1},snow:{r:255,g:250,b:250,a:1},springgreen:{r:0,g:255,b:127,a:1},steelblue:{r:70,g:130,b:180,a:1},tan:{r:210,g:180,b:140,a:1},teal:{r:0,g:128,b:128,a:1},thistle:{r:216,g:191,b:216,a:1},tomato:{r:255,g:99,b:71,a:1},turquoise:{r:64,g:224,b:208,a:1},violet:{r:238,g:130,b:238,a:1},violetred:{r:208,g:32,b:144,a:1},wheat:{r:245,g:222,b:179,a:1},white:{r:255,g:255,b:255,a:1},whitesmoke:{r:245,g:245,b:245,a:1},yellow:{r:255,g:255,b:0,a:1},yellowgreen:{r:154,g:205,b:50,a:1}},parse:function(t){if("string"==typeof t&&(t=t.toLowerCase(),t in this.names)){var e=this.names[t];return{r:e.r,g:e.g,b:e.b,a:e.a}}return!1}},{regex:/^#?([0-9A-F])([0-9A-F])([0-9A-F])$/i,parse:function(t){var e=this.regex.exec(t);return null!==e&&{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}}},{regex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,parse:function(t){var e=this.regex.exec(t);return null!==e&&{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16),a:1}}},{regex:/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,parse:function(t){var e=this.regex.exec(t);return null!==e&&{r:Math.min(255,parseInt(e[1],10)),g:Math.min(255,parseInt(e[2],10)),b:Math.min(255,parseInt(e[3],10)),a:1}}},{regex:/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([01]?\.\d+|[01])\)$/i,parse:function(t){var e=this.regex.exec(t);return null!==e&&{r:Math.min(255,parseInt(e[1],10)),g:Math.min(255,parseInt(e[2],10)),b:Math.min(255,parseInt(e[3],10)),a:Math.min(1,parseFloat(e[4]))}}}],X.parse=function(t){for(var e=X.parsers,r=0;rr?e:r},dot:function(t,e){return t.length*e.length}}),ke.extend(qt,N,{is:function(t){return u(t)&&!o(t)},animatorFor:function(t){var e=t.$animator;return e||(e=new v(t),e.factory=this,t.$animator=e),e},destroy:function(t){delete t.subject.$animator},attribute:function(t){var e=this.attributes[t];if(!e){e=this.attributes[t]=rr.attribute(t);var r=e.calculator,n=we(r),i=n.parse(e.defaultValue,n.ZERO);e.calculatorName=r,e.calculator=n,e.defaultValue=i,e.name=t,e.parse=function(t,e){return this.calculator.parse(t,this.defaultValue,e)},e.cloneDefault=function(){return this.calculator.clone(this.defaultValue)}}return e}});var rr={};rr.attribute=function(t){return u(t)&&r(t.defaultValue)?t:s(t)&&t in rr.attribute?rr.attribute[t]:rr.attribute["default"]},rr.attribute["default"]={defaultValue:0},ke.extend(Ft,w,{parse:function(t,e,r,n){var i=t.and;i.factory=p(i.factory,t.factory),r.putMap(be(i,e,!1,n.forObject))},merge:function(t,e,r,n,i){this.submerge(t.and,e,r,n)}}),ke.extend(Vt,w,{parse:function(t,e,n,i){var a=w.nextMergeId(),s=Ne(t.factory,i.forObject),u=t.deltas,c=t.values;if(r(u)){if(o(u)){var h={};for(var l in c)h[l]=u;u=h}}else u={};for(var l in c){for(var f=c[l],p=f.length-1,m=u[l],d=s.attribute(l),g=0;g<=p;g++)f[g]=d.parse(f[g]);if(!o(m)){m=[];for(var v=0;v<=p;v++)m[v]=v/p}var y=new Ut(l,d.calculator,f,m),b=i.parseEvent(l,y,this,!0);b.mergeId=a,n.put(l,b)}}}),ke.extend(Rt,w,{parse:function(t,e,r,n){var i=Ne(t.factory,n.forObject),a=t["final"];for(var s in a){var o=i.attribute(s),u=o.parse(a[s]),c=Ae(n.parseDelay(s)),h=Te(n.parseDuration(s)),l=new z(s,u,c+h,(!1),this,null,t);r.put(s,l)}},mergeAttrimator:function(t,e,r,n){t.delay=r.mergeDelay(e,t.delay)+r.mergeDuration(e,t.duration)}}),ke.extend($t,w,{parse:function(t,e,r,n){var i=Ne(t.factory,n.forObject),a=t.initial;for(var s in a){var o=i.attribute(s),u=o.parse(a[s]),c=n.parseDelay(s),h=new z(s,u,c,(!0),this,null,t);r.put(s,h)}},mergeAttrimator:function(t,e,r,n){t.delay=r.mergeDelay(e,t.delay)}}),ke.extend(kt,w,{aliases:{from:"0",start:"0",initial:"0",first:"0",half:"50",middle:"50",to:"100",end:"100",last:"100"},parse:function(t,e,r,n){var i=Ne(t.factory,n.forObject),a=t.keyframe,s=t.easings||{},o=Ie(p(e.teasing,De.teasing)),u=!1;for(var c in a)if(c in this.aliases)a[this.aliases[c]]=a[c],delete a[c];else if(c.indexOf(",")!==-1){for(var h=c.split(","),l=0;l=0;o--)n[o]=n[o+1]*(1-e);t=r.zero(t);for(var o=0;or[r.length-1])return this.points[r.length-1];for(var i=0;r[i+1]s&&(l=(l-s)/a,n=r.interpolate(n,p,m,l*o+s),i=r.interpolate(i,m,d,l*o),p=n,m=i,l=.5*l),t=r.interpolate(t,p,m,l)},resolvePoint:function(t){var e=this.points,r=e.length,n=this.loops?(t+r)%r:dt(t,0,r-1);return d(e[n])},copy:function(){return new ue(this.name,this.calculator,l(this.points),this.midpoint,this.loop)},isLinear:function(){return!1}}),ke.extend(ce,O,{set:function(t,e,r){this.reset(t,e),this.series=r},between:function(t,e){var r=this.series[t],n=this.series[t+1];return e>=Math.min(r,n)&&e<=Math.max(r,n)},compute:function(t,e){for(var r=this.series,n=r.length-2,i=0;!this.between(i,e)&&i0)for(var i=r*this.sequenceDelay,a=this.sequenceEasing,s=0;s<=r;s++)t(e[s],n+a(s/r)*i);else for(var s=0;s<=r;s++)t(e[s],n);return this.sequenceDelay=0,this.introduce=!1,this.autoEnd&&this.end(),this},duration:function(){for(var t=this.timelines.values,e=0,r=0;r=s.start&&i.push(s)}for(var a=0;athis.duration&&(this.time=this.duration,this.playing=!1,this.trigger("end",[this]))),this},runner:function(t,e){return function(){var t=He(),r=t-e.currentTime;e.time+=r*e.speed,e.currentTime=t,e.apply(),e.evaluatePlaying(),e.playing&&Qe(e.run)}}}),it(ge.prototype),ke.define(ve,{playAttrimators:function(t,e,r,n){this.attrimators.size()?this.attrimators.playMapAt(t,e,r):(this.attrimators.putMap(t),this.attrimators.delay(r),n||(this.start=r))},queueAttrimators:function(t,e,r){e&&this.attrimators.stopNotPresentAt(t,r),this.attrimators.queueMap(t)},transitionAttrimators:function(t,e,r,n){e&&this.attrimators.stopNotPresentAt(t,r+n.time),this.attrimators.transitionMap(n,t,function(t){var e=this.attrimators.get(t),n=this.animator.getAttribute(t);return e?e.valueAtSearch(r,n.cloneDefault()):void 0},function(t){return this.animator.getAttribute(t)},function(t){this.attrimators.playAttrimatorAt(t,r)},function(t,e,n){return t.valueAtSearch(r+e,n)},function(t,e){t.stopAt(r+e)},this)},preupdate:function(t){for(var e=this.animator,r=this.attrimators.values,n=0;n