clarity-animation
Advanced tools
Comparing version 1.0.20 to 1.0.21
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.clarityAnimation=e():t.clarityAnimation=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){var n,a;n=[r,e,r(3),r(7),r(8),r(2),r(9),r(10),r(11),r(6)],a=function(t,e,r,n,a,o,i,s,u,l){"use strict";e.Animation=r.default,e.Timeline=n.default,e.PercentageTimeline=a.default,e.ElementAnimation=o.default,e.ElementPathAnimation=i.default,e.CssAnimation=s.default,e.CustomRenderAnimation=u.default,e.easings=l.default}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3)],a=function(t,e,r){"use strict";var n=/^(\-?\d*\.?\d+)+(.*?)$/i,a=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,i=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+|\d\.\d+)\s*\)$/i,s={transparent:"rgba(0,0,0,0)"},u=function(t){if(0!==t.indexOf("#"))throw new Error("Invalid Hex.");var e={red:0,green:0,blue:0,alpha:1};return 4===t.length?(e.red=parseInt(t.charAt(1)+t.charAt(1),16),e.green=parseInt(t.charAt(2)+t.charAt(2),16),e.blue=parseInt(t.charAt(3)+t.charAt(3),16)):(e.red=parseInt(t.substr(1,2),16),e.green=parseInt(t.substr(3,2),16),e.blue=parseInt(t.substr(5,2),16)),e},l=function(t){var e=u(t);return"rgb("+e.red+","+e.green+","+e.blue+")"},c=function(t){return t=t<0?0:t,t=t>255?255:t},p=function(t){function e(e){var r=t.call(this,e)||this;return r.element=null,e.target instanceof Element&&(r.element=e.target,e.target=e.target.style,r.prepareTransformValues()),r.currentValues={},r.mapping={width:{handler:"numberUnitHandler",alias:"width"},height:{handler:"numberUnitHandler",alias:"height"},lineHeight:{handler:"numberUnitHandler",alias:"line-height"},top:{handler:"numberUnitHandler",alias:"top"},right:{handler:"numberUnitHandler",alias:"right"},bottom:{handler:"numberUnitHandler",alias:"bottom"},left:{handler:"numberUnitHandler",alias:"left"},fontSize:{handler:"numberUnitHandler",alias:"font-size"},borderTopWidth:{handler:"numberUnitHandler",alias:"border-top-width"},borderBottomWidth:{handler:"numberUnitHandler",alias:"border-bottom-width"},borderRightWidth:{handler:"numberUnitHandler",alias:"border-right-width"},borderLeftWidth:{handler:"numberUnitHandler",alias:"border-left-width"},borderTopColor:{handler:"colorHandler",alias:"border-top-color"},borderBottomColor:{handler:"colorHandler",alias:"border-bottom-color"},borderLeftColor:{handler:"colorHandler",alias:"border-left-color"},borderRightColor:{handler:"colorHandler",alias:"border-right-color"},marginTop:{handler:"numberUnitHandler",alias:"margin-top"},marginBottom:{handler:"numberUnitHandler",alias:"margin-bottom"},marginLeft:{handler:"numberUnitHandler",alias:"margin-left"},marginRight:{handler:"numberUnitHandler",alias:"margin-right"},paddingTop:{handler:"numberUnitHandler",alias:"padding-top"},paddingBottom:{handler:"numberUnitHandler",alias:"padding-bottom"},paddingLeft:{handler:"numberUnitHandler",alias:"padding-left"},paddingRight:{handler:"numberUnitHandler",alias:"padding-right"},opacity:{handler:"decimalHandler",alias:"opacity"},color:{handler:"colorHandler",alias:"color"},backgroundColor:{handler:"colorHandler",alias:"background-color"},rotateX:{handler:"rotateXHandler",alias:"rotateX"},rotateY:{handler:"rotateYHandler",alias:"rotateY"},rotateZ:{handler:"rotateZHandler",alias:"rotateX"},scaleX:{handler:"scaleXHandler",alias:"scaleX"},scaleY:{handler:"scaleYHandler",alias:"scaleY"},scaleZ:{handler:"scaleZHandler",alias:"scaleZ"},translateX:{handler:"translateXHandler",alias:"translateX"},translateY:{handler:"translateYHandler",alias:"translateY"},translateZ:{handler:"translateZHandler",alias:"translateZ"}},r.scaleYHandler=r.scaleXHandler,r.scaleZHandler=r.scaleXHandler,r.rotateXHandler=r.rotateXHandler.bind(r),r.rotateYHandler=r.rotateXHandler.bind(r),r.rotateZHandler=r.rotateXHandler.bind(r),r.translateXHandler=r.rotateXHandler.bind(r),r.translateYHandler=r.rotateXHandler.bind(r),r.translateZHandler=r.rotateXHandler.bind(r),r}return o(e,t),e.prototype.setCssText=function(){var t=this.element,e=this.currentValues;Object.keys(e).forEach(function(r){return t.style[r]=e[r]})},e.prototype.setElement=function(t){this.element=t,this.prepareTransformValues()},e.prototype.render=function(){var t,e,r=this.progress,n=this.properties;for(e in n){t=this.mapping[e].handler;var a=this[t];if("function"!=typeof a)throw new Error("Doesn't support '"+e+"' style animations.");this[t](e,r)}return this.setCssText(),this},e.prototype.getEndingValue=function(t){var e=this.properties[t];return"object"==typeof e&&null!==e&&(e=e.to),e},e.prototype.getBeginningValue=function(t){var e=this.beginningValues[t],r=this.properties;if("undefined"==typeof e){if(e="undefined"!=typeof r[t].from?r[t].from:this.target[t],""===e||"undefined"==typeof e)throw new Error("Couldn't find beginning value for property '"+t+"'.");this.beginningValues[t]=e}if("undefined"==typeof e)throw new Error("Couldn't find beginning value for property: "+t+". Try setting a 'from' value in the configuration of the aniimation.");return e},e.prototype.rgbaHandler=function(t,e,r,n,a){var o,s=t.match(i),u=e.match(i);if(null===s||null===u)throw new Error("Cannot parse rgb, rgba isn't supported yet.");var l=parseInt(s[1],10),p=parseInt(u[1],10),f=parseInt(s[2],10),d=parseInt(u[2],10),h=parseInt(s[3],10),m=parseInt(u[3],10),y=parseInt(this.numberHandler(l,p,r,n,a),10),g=parseInt(this.numberHandler(f,d,r,n,a),10),b=parseInt(this.numberHandler(h,m,r,n,a),10);return y=c(y),g=c(g),b=c(b),o="rgb("+y+","+g+","+b+")"},e.prototype.rgbHandler=function(t,e,r,n,o){var s,u,l,p,f,d,h,m,y,g,b,v,w,I=t.match(a),_=e.match(a);if(null===I||null===_){if(I=I||t.match(i),_=_||e.match(i),null===I||null===_)throw new Error("Couldn't parse rgb or rgba from values from one or both: "+t+", "+e);return u=parseInt(I[1],10),l=parseInt(_[1],10),p=parseInt(I[2],10),f=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),m=parseFloat(I[4]||1),y=parseFloat(_[4]||1),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(p,f,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),w=this.numberHandler(m,y,r,n,o),g=c(g),b=c(b),v=c(v),s="rgba("+g+","+b+","+v+", "+w+")"}return u=parseInt(I[1],10),l=parseInt(_[1],10),p=parseInt(I[2],10),f=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(p,f,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),g=c(g),b=c(b),v=c(v),s="rgb("+g+","+b+","+v+")"},e.prototype.prepareTransformValues=function(){var t=this.element;t.scaleX=t.scaleX||"1",t.scaleY=t.scaleY||"1",t.scaleZ=t.scaleZ||"1",t.rotateX=t.rotateX||"0deg",t.rotateY=t.rotateY||"0deg",t.rotateZ=t.rotateZ||"0deg",t.translateX=t.translateX||"0",t.translateY=t.translateY||"0",t.translateZ=t.translateZ||"0"},e.prototype.applyTransform=function(){var t=this.element,e="scaleX("+t.scaleX+") scaleY("+t.scaleY+") scaleZ("+t.scaleZ+")";e+=" rotateX("+t.rotateX+") rotateY("+t.rotateY+") rotateZ("+t.rotateZ+")",e+=" translateX("+t.translateX+") translateY("+t.translateY+") translateZ("+t.translateZ+")",this.currentValues.webkitTransform=e,this.currentValues.mozTransform=e,this.currentValues.msTransform=e,this.currentValues.transform=e},e.prototype.scaleXHandler=function(t,e){var r=this.element,n=parseFloat(this.getBeginningValue(t)),a=parseFloat(this.getEndingValue(t)),o=this.duration,i=this.easingFunction,s=this.numberHandler(n,a,e,o,i);r[t]=s,this.applyTransform()},e.prototype.rotateXHandler=function(t,e){var r,n=this.element;r=this.calculateNumberUnit(t,e),n[t]=r,this.applyTransform()},e.prototype.calculateColor=function(t,e){var r=this.getBeginningValue(t),n=this.getEndingValue(t),a=this.duration,o=this.easingFunction;return r=s[r.toLowerCase()]||r,n=s[n.toLowerCase()]||n,0===r.indexOf("#")&&(r=l(r)),0===n.indexOf("#")&&(n=l(n)),this.rgbHandler(r,n,e,a,o)},e.prototype.colorHandler=function(t,e){var r=this.calculateColor(t,e);r=this.properties[t].isImportant?r+" !important":r,this.currentValues[t]=r},e.prototype.numberHandler=function(t,e,r,n,a){var o,i=e-t,s=r*n;return o=0!==i?a(s,t,i,n):e,o.toFixed(5)},e.prototype.calculateNumberUnit=function(t,e){var r=this.getBeginningValue(t),a=this.getEndingValue(t),o=this.duration,i=this.easingFunction,s=n.exec(r),u=n.exec(a),l=s[2];if("undefined"==typeof l)throw new Error("Please use units for the '"+t+"', e.g. 10px, or 10%, 10em");var c=Math.round(100*parseFloat(s[1]))/100,p=Math.round(100*parseFloat(u[1]))/100,f=this.numberHandler(c,p,e,o,i);return f+=l},e.prototype.numberUnitHandler=function(t,e){var r=this.calculateNumberUnit(t,e);r=this.properties[t].isImportant?r+" !important":r,this.currentValues[t]=r},e.prototype.caclulateDecimal=function(t,e){var r=this.getBeginningValue(t),n=this.getEndingValue(t),a=this.duration,o=this.easingFunction;return r=parseFloat(r),n=parseFloat(n),this.numberHandler(r,n,e,a,o)},e.prototype.decimalHandler=function(t,e){var r=this.caclulateDecimal(t,e);r=this.properties[t].isImportant?r+" !important":r,this.currentValues[t]=r},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=p}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e,r(4),r(5),r(6)],a=function(t,e,r,n,a){"use strict";var o=function(t){return new Promise(function(e,r){setTimeout(e,t)})},i=function(t){for(var e=0;e<=100;e++)t[e]=[]},s=new n.default,u=function(){function t(t,e){this._callback=t,this._isStopped=!1,this._isDisposed=!1,this._unbind=e||function(){}}return t.prototype.stop=function(){this._isStopped=!0},t.prototype.start=function(){this._isStopped=!1},t.prototype.callback=function(t){this._isStopped||this._isDisposed||this._callback(t)},t.prototype.dispose=function(){return this._unbind()},t}(),l=function(){function t(t){t=t||{},this.target=t.target||{},this.currentTime=0,this.timeScale=1,this.duration=t.duration||1e-4,this.progress=0,this.properties=t.properties||{},this.beginningValues={},this.startTime=0,this.currentRequestAnimationFrameId=null,this.currentState=r.default.stoppedState,this.animationManager=s,this.iterations=0,this.repeat=1,this.repeatDirection=0,this.observers={play:[],stop:[],pause:[],restart:[],reverse:[],seek:[],tick:[],end:[],start:[]},i(this.observers),"string"==typeof t.easing?this.easingFunction=a.default[t.easing]:"function"==typeof t.easing?this.easingFunction=t.easing:this.easingFunction=a.default.linear}return t.prototype._saveBeginningValues=function(){var t=this.target,e=this.beginningValues,r=this.properties;Object.keys(r).forEach(function(r){e[r]=t[r]})},t.prototype.play=function(){return this.currentState.play(this)},t.prototype.stop=function(){return this.currentState.stop(this),this},t.prototype.observeAtTick=function(t,e){var r=100*t;if("number"==typeof r&&r>=0&&r<=100)return r=parseInt(r),this.observe(r.toString(),e);throw new Error("Invalid Argument Exception: percentage must be a decimal, and with in 0-1")},t.prototype.playToEndAsync=function(t){return"number"==typeof t&&t>=0&&t<=1&&(this.progress=t),this.playToPercentageAsync(100)},t.prototype.playToPercentageAsync=function(t){var e=this,r=t/100;if(t=parseInt(t,10),r<this.progress)throw new Error("Cannot play to a point less than the current progress.");if("number"!=typeof t||t<0||t>100)throw new Error("Expected fraction to be a number within range (0-100).");return new Promise(function(t,n){e.stop();var a=function(){s.dispose(),o.dispose(),i.dispose(),e.seek(e.progress).render()},o=e.observeAtTick(r,function(){a(),e.stop(),t()}),i=e.observe("stop",function(t){a()}),s=e.observe("reverse",function(t){a()});e.play()}).then(function(){return o(0)})},t.prototype.reverseToStartAsync=function(t){return"number"==typeof t&&t>=0&&t<=1&&(this.progress=t),this.reverseToPercentageAsync(0)},t.prototype.reverseToPercentageAsync=function(t){var e=this,r=t/100;if(t=parseInt(t,10),r>this.progress)throw new Error("Cannot reverse to a point greater than the current progress.");if("number"!=typeof t||t<0||t>100)throw new Error("Expected fraction to be a number within range (0-100).");return new Promise(function(t,n){e.stop();var a=function(){s.dispose(),o.dispose(),i.dispose(),e.seek(e.progress).render()},o=e.observeAtTick(r,function(){a(),e.stop(),t()}),i=e.observe("stop",function(t){a()}),s=e.observe("play",function(t){a()});e.reverse()}).then(function(){return o(0)})},t.prototype.pause=function(){return this.currentState.pause(this)},t.prototype.restart=function(){return this.currentState.restart(this)},t.prototype.reverse=function(){return this.currentState.reverse(this)},t.prototype.notify=function(t){var e=t.type;Array.isArray(this.observers[e])&&this.observers[e].forEach(function(e){e.callback(t)})},t.prototype.tick=function(t){var e=this.currentState.tick(this,t);return e},t.prototype.invalidate=function(){return this.progress=0,this.currentState=r.default.pausedState,this},t.prototype.getProgress=function(){return this.progress},t.prototype.setTimeScale=function(t){this.timeScale=t},t.prototype.getTimeScale=function(){return this.timeScale},t.prototype.seek=function(t,e){return this.currentState.seek(this,t,e),this},t.prototype.observe=function(t,e){if("string"!=typeof t)throw new Error("Need to supply a type.");var r=this.observers[t];if("undefined"==typeof r)throw new Error("Unknown type to observe to. Here is a list of types to observe to: play, stop, pause, restart, reverse, seek, tick, end, start");var n=new u(e,function(){var t=r.indexOf(n);t>=0&&r.splice(t,1)});return r.push(n),n},t.prototype.render=function(){var t,e,r,n,a=this.progress,o=this.beginningValues,i=this.properties,s=this.duration,u=this.easingFunction,l=this.target,c=this.properties;c.length;for(r in c){var t=o[r],e=i[r];if("object"==typeof e&&null!==e&&(t=e.from,e=e.to),"undefined"==typeof t&&(o[r]=l[r],t=l[r]),"number"!=typeof t||"number"!=typeof e)throw new Error("Default renderer is only able to animate integers. Set the renderer in the config to handle custom values.");var p=e-t,f=a*s;n=0!==p?u(f,t,p,s):e,l[r]!==n&&(l[r]=n)}return this},Object.defineProperty(t,"REPEAT_DEFAULT",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t,"REPEAT_ALTERNATE",{get:function(){return 1},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e],a=function(t,e){"use strict";var r={},n=function(t){return t},a=function(t){return t.notify({type:"pause",progress:t.progress}),t.currentState=r.forwardPausedState,t.animationManager.unregister(t),t},o=function(t){return t.notify({type:"pause",progress:t.progress}),t.currentState=r.reversePausedState,t.animationManager.unregister(t),t},i=function(t){t.notify({type:"play",progress:t.progress});var e=t.animationManager.now();return t.currentTime=e,t.currentState=r.forwardState,t.animationManager.register(t),t.render(),t},s=function(t){var e=t.animationManager.now();return t.currentTime=e,t.currentState=r.stoppedState,t.animationManager.unregister(t),t},u=function(t){return t.notify({type:"stop",progress:t.progress}),s(t)},l=function(t){t.notify({type:"reverse",progress:t.progress});var e=t.animationManager.now();return t.currentTime=e,t.currentState=r.reverseState,t.animationManager.register(t),t},c=function(t){return t.notify({type:"restart",progress:0}),t.seek(0),t.play(),t},p=function(t){return t.notify({type:"restart",progress:1}),t.seek(1),t},f=function(t){return t>1&&(t=1),t<0&&(t=0),t},d=function(t,e,r){var n=parseInt(100*e),a=parseInt(100*r);0===n&&n!==a&&t.notify({type:n}),n===a&&t.notify({type:a});for(var o=n+1;o<=a;o++)t.notify({type:o})},h=function(t,e,r){var n,a=parseInt(100*e),o=parseInt(100*r);for(100===a&&a!==o&&t.notify({type:a}),a===o&&t.notify({type:o}),n=a-1;n>=o;n--)t.notify({type:n})},m=function(t,e,r){var n=t.progress;r=f(r),t.currentTime="number"!=typeof e?t.animationManager.now():e,t.progress=r,t.render(),t.notify({type:"tick",progress:r,lastProgress:n})};r.forwardPausedState={seek:function(t,e,n){var a=t.progress;return a>e?(t.currentState=r.reversePausedState,t.currentState.seek(t,e,n),void(t.currentState=r.forwardPausedState)):void(t.progress>1||(t.progress<=0&&t.notify({type:"start",progress:0}),m(t,n,e),d(t,a,e),e>=1&&t.notify({type:"end",progress:1})))},play:i,stop:u,pause:n,reverse:l,tick:n,restart:c},r.reversePausedState={seek:function(t,e,n){var a=t.progress;return a<e?(t.currentState=r.forwardPausedState,t.currentState.seek(t,e,n),void(t.currentState=r.reversePausedState)):void(t.progress<0||(t.progress>=1&&t.notify({type:"end"}),m(t,n,e),h(t,a,e),e<=0&&t.notify({type:"start"})))},play:i,stop:u,pause:n,reverse:l,tick:n,restart:p},r.forwardState={seek:r.forwardPausedState.seek,play:n,stop:u,pause:a,reverse:l,tick:function(t,e){var r=t.currentTime;if(e>r){var n=(e-r)*t.timeScale,a=t.progress+n/t.duration;a>=1?(a=1,t.iterations++,t.iterations>=t.repeat?(this.seek(t,a,e),u(t)):(this.seek(t,a,e),0===t.repeatDirection?this.restart(t):this.reverse(t))):this.seek(t,a,e)}return t},restart:c},r.reverseState={seek:r.reversePausedState.seek,play:i,stop:u,pause:o,reverse:n,tick:function(t,e){var r=t.currentTime;if(e>r){var n=(e-r)*t.timeScale,a=t.progress-n/t.duration;a<=0?(a=0,t.iterations++,t.iterations>=t.repeat?(this.seek(t,a,e),u(t)):(this.seek(t,a,e),0===t.repeatDirection?this.restart(t):this.play(t))):this.seek(t,a,e)}return t},restart:p},r.stoppedState={seek:function(t,e,r){return e>1&&(e=1),e<0&&(e=0),t.progress=e,t.currentTime=r,t},play:i,stop:n,pause:a,reverse:l,tick:n,restart:c},Object.defineProperty(e,"__esModule",{value:!0}),e.default=r}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e],a=function(t,e){"use strict";!function(){for(var t=0,e=["ms","moz","webkit","o"],r=0;r<e.length&&!window.requestAnimationFrame;++r)window.requestAnimationFrame=window[e[r]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[r]+"CancelAnimationFrame"]||window[e[r]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,r){var n=(new Date).getTime(),a=Math.max(0,16-(n-t)),o=window.setTimeout(function(){e(n+a)},a);return t=n+a,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var r=function(){function t(t){this._currentRequestAnimationFrame=null,this._animations=[],this._lastTime=0,this._fps=100,this._refreshRateInMilliseconds=1e3/this._fps,this._timer=t||Date,this._requestCallback=function(t){this.tick(this._timer.now())},this._requestCallback=this._requestCallback.bind(this),this.setFramesPerSecond(this._fps)}return t.prototype.setFramesPerSecond=function(t){this._fps=t,this._refreshRateInMilliseconds=1e3/t},t.prototype.getFramesPerSecond=function(){return this._fps},t.prototype.checkRequestToStartOrStop=function(){var t=this._animations;null===this._currentRequestAnimationFrame&&t.length>0&&(this._currentRequestAnimationFrame=requestAnimationFrame(this._requestCallback))},t.prototype.tick=function(t){var e,r=this._animations,n=r.length,a=t-this._lastTime;a>=this._refreshRateInMilliseconds?(this._lastTime=t,n>0?(e=r.slice(0),e.forEach(function(e){e.tick(t)}),this._currentRequestAnimationFrame=requestAnimationFrame(this._requestCallback)):this._currentRequestAnimationFrame=null):this._currentRequestAnimationFrame=requestAnimationFrame(this._requestCallback)},t.prototype.now=function(){return this._timer.now()},t.prototype.register=function(t){var e=this._animations.indexOf(t);e===-1&&(this._animations.push(t),this.checkRequestToStartOrStop())},t.prototype.unregister=function(t){var e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1)},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=r}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e],a=function(t,e){"use strict";var r={easeInQuad:function(t,e,r,n){return r*(t/=n)*t+e},easeOutQuad:function(t,e,r,n){return-r*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,r,n){return r*(t/=n)*t*t+e},easeOutCubic:function(t,e,r,n){return r*((t=t/n-1)*t*t+1)+e},easeInOutCubic:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,r,n){return r*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,r,n){return-r*((t=t/n-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,r,n){return r*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,r,n){return r*((t=t/n-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,r,n){return-r*Math.cos(t/n*(Math.PI/2))+r+e},easeOutSine:function(t,e,r,n){return r*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,r,n){return-r/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,r,n){return 0==t?e:r*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,r,n){return t==n?e+r:r*(-Math.pow(2,-10*t/n)+1)+e},easeInOutExpo:function(t,e,r,n){return 0==t?e:t==n?e+r:(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:r/2*(-Math.pow(2,-10*--t)+2)+e},easeInCirc:function(t,e,r,n){return-r*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOutCirc:function(t,e,r,n){return r*Math.sqrt(1-(t=t/n-1)*t)+e},easeInOutCirc:function(t,e,r,n){return(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,r,n){var a=1.70158,o=0,i=r;if(0==t)return e;if(1==(t/=n))return e+r;if(o||(o=.3*n),i<Math.abs(r)){i=r;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(r/i);return-(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-a)*(2*Math.PI)/o))+e},easeOutElastic:function(t,e,r,n){var a=1.70158,o=0,i=r;if(0==t)return e;if(1==(t/=n))return e+r;if(o||(o=.3*n),i<Math.abs(r)){i=r;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(r/i);return i*Math.pow(2,-10*t)*Math.sin((t*n-a)*(2*Math.PI)/o)+r+e},easeInOutElastic:function(t,e,r,n){var a=1.70158,o=0,i=r;if(0==t)return e;if(2==(t/=n/2))return e+r;if(o||(o=n*(.3*1.5)),i<Math.abs(r)){i=r;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(r/i);return t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-a)*(2*Math.PI)/o))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*n-a)*(2*Math.PI)/o)*.5+r+e},easeInBack:function(t,e,r,n,a){return void 0==a&&(a=1.70158),r*(t/=n)*t*((a+1)*t-a)+e},easeOutBack:function(t,e,r,n,a){return void 0==a&&(a=1.70158),r*((t=t/n-1)*t*((a+1)*t+a)+1)+e},easeInOutBack:function(t,e,r,n,a){return void 0==a&&(a=1.70158),(t/=n/2)<1?r/2*(t*t*(((a*=1.525)+1)*t-a))+e:r/2*((t-=2)*t*(((a*=1.525)+1)*t+a)+2)+e},easeInBounce:function(t,e,n,a){return n-r.easeOutBounce(a-t,0,n,a)+e},easeOutBounce:function(t,e,r,n){return(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,n,a){return t<a/2?.5*r.easeInBounce(2*t,0,n,a)+e:.5*r.easeOutBounce(2*t-a,0,n,a)+.5*n+e},linear:function(t,e,r,n){return r*t/n+e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3),r(4)],a=function(t,e,r,n){"use strict";var a=function(t,e){return t.sort(function(t,r){var n=e(t),a=e(r);return n instanceof Date&&(n=n.getTime()),a instanceof Date&&(a=a.getTime()),"string"==typeof n&&(n=n.toLowerCase()),"string"==typeof a&&(a=a.toLowerCase()),"number"==typeof n&&isNaN(n)&&"number"==typeof a&&isNaN(a)?0:n===a?0:n<a?-1:n>a?1:void 0})},i=function(t,e){return t.sort(function(t,r){var n=e(t),a=e(r);return n instanceof Date&&(n=n.getTime()),a instanceof Date&&(a=a.getTime()),"string"==typeof n&&(n=n.toLowerCase()),"string"==typeof a&&(a=a.toLowerCase()),"number"==typeof n&&isNaN(n)&&"number"==typeof a&&isNaN(a)?0:n===a?0:n>a?-1:n<a?1:void 0})},s=function(t){return t.offset},u=function(t){return t.offset+t.animation.duration},l=function(t){function e(e){var r=t.call(this,e)||this;return r.animationItems=new Map,r.iterationCount=1,r.lastCurrentTime=0,r._duration=0,Object.defineProperty(r,"duration",{get:function(){return r._duration},set:function(t){var e=r._duration;r.animationItems.forEach(function(r){var n=r.offset/e,a=r.animation.duration/e;r.offset=n*t,r.animation.duration=a*t}),r._duration=t}}),r}return o(e,t),e.prototype.calculateDuration=function(){return Array.from(this.animationItems.values()).reduce(function(t,e){var r=e.offset+e.animation.duration;return r>t?r:t},0)},e.prototype.add=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Array.prototype.slice.call(arguments,0),o=this;n.forEach(function(t){if("number"!=typeof t.offset)throw new Error("animationItem needs to have an offset property set.");if(!(t.animation instanceof r.default))throw new Error("animationItem needs to have an animation property set thats an instanceof Animation.");o.animationItems.set(t,t)}),this._duration=this.calculateDuration(),this.forwardArrayAnimations=Array.from(this.animationItems.values()),this.reverseArrayAnimations=this.forwardArrayAnimations.slice(0),a(this.forwardArrayAnimations,s),i(this.reverseArrayAnimations,u)},e.prototype.remove=function(t){this.animationItems.delete(t),this.forwardArrayAnimations=Array.from(this.animationItems.values()),this.reverseArrayAnimations=this.forwardArrayAnimations.slice(0),a(this.forwardArrayAnimations,s),i(this.reverseArrayAnimations,u)},e.prototype.render=function(){var t,e=this.progress,r=this._duration,a=e*r,o=this.timeScale,i=Date.now(),s=this.currentState;return t=this.currentState===n.default.reverseState||this.currentState===n.default.reversePausedState?this.reverseArrayAnimations:this.forwardArrayAnimations,t.forEach(function(t){var e=t.animation.duration,r=t.offset,u=t.animation;if(s===n.default.reverseState?u.currentState=n.default.reversePausedState:u.currentState=n.default.forwardPausedState,u.setTimeScale(o),a>=r&&a<=r+e){var l=a-r,c=l/e;u.seek(c,i)}a>r+e&&1!==u.progress&&(u.progress<1?(u.seek(1),u.stop()):(u.stop(),u.seek(1))),a<r&&0!==u.progress&&(u.progress>0?(u.seek(0),u.stop()):(u.stop(),u.seek(0)))}),this},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(7),r(3)],a=function(t,e,r,n){"use strict";var a=function(t){function e(e){var r=t.call(this)||this;return r._duration=e,Object.defineProperty(r,"duration",{get:function(){return r._duration},set:function(t){r._duration=t,r._calculateAnimations()}}),r}return o(e,t),e.prototype._calculateAnimations=function(){var t=this;this.animationItems.forEach(function(e){var r=e.startAt*t._duration,n=e.endAt*t._duration-r;e.offset=r,e.animation.duration=n})},e.prototype.add=function(){var e=this,r=this,a=Array.prototype.slice.call(arguments,0);a.forEach(function(a){if("number"!=typeof a.startAt)throw new Error("animationItem needs to have an startAt percentage property set.");if("number"!=typeof a.endAt)throw new Error("animationItem needs to have an endAt percentage property set.");if(!(a.animation instanceof n.default))throw new Error("animationItem needs to have an animation property set thats an instanceof Animation.");if(a.startAt<0&&a.startAt>1||a.endAt<0&&a.endAt>1)throw new Error("startAt and endAt need to be within 0-1.");if(a.startAt>a.endAt)throw new Error("endAt needs to be greater than startAt.");var o=a.startAt*r.duration,i=a.endAt*r.duration-o;a.offset=o,a.animation.duration=i,t.prototype.add.call(e,a)})},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3)],a=function(t,e,r){"use strict";var n=function(t){return"number"==typeof t.x||"number"==typeof t.y||"number"==typeof t.z},a=function(t){var e;if(!n(t)){try{e=JSON.stringify(t)}catch(t){e="Couldn't stringify the vector because of recursive objects."}throw new Error("Invalid vector: "+e)}},i=function(t){if(!Array.isArray(t))throw new Error("The animations controls need to be an array of vectors.");var e=t.every(n);if(!e)throw new Error("Invalid control vectors.")},s=function(t){"number"!=typeof t.x&&(t.x=0),"number"!=typeof t.y&&(t.y=0),"number"!=typeof t.z&&(t.z=0)},u=function(t,e,r){return(e-t)*r+t},l=function(t){function e(e){var r=t.call(this,e)||this;if(e=e||{},r.target=e.target,r.duration=e.duration,r.unit=e.unit,r.from=e.from,r.to=e.to,r.controls=e.controls||[],r.points=[],r.calculationMatrix=[],!(r.target instanceof Element))throw new Error("The target must be an Element.");if("number"!=typeof r.duration)throw new Error("The animation's duration must be a number.");if("string"!=typeof r.unit)throw new Error("The animation's unit should be a string");return a(r.from),a(r.to),i(r.controls),r.change={x:r.to.x-r.from.x,y:r.to.y-r.from.y,z:r.to.z-r.from.z},r.points=r.controls.slice(0),r.points.unshift(r.from),r.points.push(r.to),r.points.forEach(s),r.prepareTransformValues(r.target),r}return o(e,t),e.prototype.prepareTransformValues=function(t){"undefined"==typeof t.style.scaleX&&(t._scaleX="1",t._scaleY="1",t._scaleZ="1",t._rotateX="0deg",t._rotateY="0deg",t._rotateZ="0deg",t._translateX="0",t._translateY="0",t._translateZ="0")},e.prototype.applyTransform=function(){var t=this.target,e="scaleX("+t._scaleX+") scaleY("+t._scaleY+") scaleZ("+t._scaleZ+")";e+=" rotateX("+t._rotateX+") rotateY("+t._rotateY+") rotateZ("+t._rotateZ+")",e+=" translateX("+t._translateX+") translateY("+t._translateY+") translateZ("+t._translateZ+")",t.style.webkitTransform=e,t.style.mozTransform=e,t.style.msTransform=e,t.style.transform=e},e.prototype.reduce=function(t,e,r,n){"undefined"==typeof r&&(r=0);var a=n(this.progress*this.duration,0,1,this.duration);this.calculationMatrix[r]=t;var o=this.calculationMatrix[r+1]||[];return t.reduce(function(e,r,n){if(n!==t.length-1){var o=e[n]=e[n]||{x:0,y:0,z:0};o.x=u(r.x,t[n+1].x,a),o.y=u(r.y,t[n+1].y,a),o.z=u(r.z,t[n+1].z,a)}return e},o),o.length>1?this.reduce(o,e,r+1,n):o},e.prototype.render=function(){var t=this.target,e=this.unit,r=this.progress,n=this.easingFunction,a=this.reduce(this.points,r,0,n);return t._translateX=a[0].x+e,t._translateY=a[0].y+e,t._translateZ=a[0].z+"px",this.applyTransform(),this},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(11)],a=function(t,e,r){"use strict";var n={scaleX:!0,scaleY:!0,scaleZ:!0,rotateX:!0,rotateY:!0,rotateZ:!0,translateX:!0,translateY:!0,translateZ:!0},a=function(t){function e(e){var r=this;return e.originalRenderer=e.renderer,e.renderer=function(t){var a=r.target,o=!1;Object.keys(t).forEach(function(e){return n[e]?void(o=!0):void(a[e]=t[e])}),o&&r.handleTransforms(t,a),null==e.target&&"function"==typeof e.originalRenderer&&e.originalRenderer(a)},r=t.call(this,e)||this,r.target=e.target||{},r}return o(e,t),e.prototype.handleTransforms=function(t,e){ | ||
if(null!=t.scaleX||null!=t.scaleY||null!=t.scaleZ||null!=t.rotateX||null!=t.rotateY||null!=t.rotateZ||null!=t.translateX||null!=t.translateY||null!=t.translateZ){t.scaleX=t.scaleX||"1",t.scaleY=t.scaleY||"1",t.scaleZ=t.scaleZ||"1",t.rotateX=t.rotateX||"0deg",t.rotateY=t.rotateY||"0deg",t.rotateZ=t.rotateZ||"0deg",t.translateX=t.translateX||"0",t.translateY=t.translateY||"0",t.translateZ=t.translateZ||"0";var r="scaleX("+t.scaleX+") scaleY("+t.scaleY+") scaleZ("+t.scaleZ+")";r+=" rotateX("+t.rotateX+") rotateY("+t.rotateY+") rotateZ("+t.rotateZ+")",r+=" translateX("+t.translateX+") translateY("+t.translateY+") translateZ("+t.translateZ+")",this.target.webkitTransform=r,this.target.mozTransform=r,this.target.msTransform=r,this.target.transform=r}},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3)],a=function(t,e,r){"use strict";var n=/^(\-?\d*\.?\d+)+(.*?)$/i,a=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,i=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+|\d\.\d+)\s*\)$/i,s=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$|^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+|\d\.\d+)\s*\)$/,u=/^([0-9]+)([^0-9]+)$/,l={transparent:"rgba(0,0,0,0)"},c=function(t){if(0!==t.indexOf("#"))throw new Error("Invalid Hex.");var e={red:0,green:0,blue:0,alpha:1};return 4===t.length?(e.red=parseInt(t.charAt(1)+t.charAt(1),16),e.green=parseInt(t.charAt(2)+t.charAt(2),16),e.blue=parseInt(t.charAt(3)+t.charAt(3),16)):(e.red=parseInt(t.substr(1,2),16),e.green=parseInt(t.substr(3,2),16),e.blue=parseInt(t.substr(5,2),16)),e},p=function(t){if(0===t.indexOf("#")){var e=c(t);return"rgb("+e.red+","+e.green+","+e.blue+")"}return t},f=function(t){return t=t<0?0:t,t=t>255?255:t},d=[{test:function(t){return u.test(t)},map:function(t){return t},name:"numberUnitHandler"},{test:function(t){return s.test(t)},map:function(t){return p(t)},name:"colorHandler"},{test:function(t){return"number"==typeof t},map:function(t){return t},name:"decimalHandler"}],h=function(t){function e(e){var r=t.call(this,e)||this;return r.element=e.target,r.target={},r.renderer=e.renderer||function(t){},r.assignHandlers(),r}return o(e,t),e.prototype.assignHandlers=function(){var t=this.properties;Object.keys(t).forEach(function(e){var r=t[e];if(null==r.to)throw new Error('Cannot animate "'+e+'" without specifying the "to" field.');if(null==r.from)throw new Error('Cannot animate "'+e+'" without specifying the "from" field.');d.some(function(t){return!(!t.test(r.from)||!t.test(r.to))&&(r.from=t.map(r.from),r.to=t.map(r.to),r.handlerName=t.name,!0)}),"string"!=typeof r.handlerName&&(r.handlerName="nullableHandler")})},e.prototype.render=function(){var t=this,e=this.progress,r=this.properties;return Object.keys(r).forEach(function(n){var a=r[n],o=a.handlerName,i=t[o];if("function"!=typeof i)throw new Error("Unassigned Handler.");var s=i.apply(t,[a,e]);t.target[n]=s}),this.renderer(this.target),this},e.prototype.nullableHandler=function(t,e){return t.from},e.prototype.calculateColor=function(t,e){var r=t.from,n=t.to,a=this.duration,o=this.easingFunction;return r=l[r.toLowerCase()]||r,n=l[n.toLowerCase()]||n,this.rgbHandler(r,n,e,a,o)},e.prototype.colorHandler=function(t,e){var r=this.calculateColor(t,e);return r},e.prototype.numberHandler=function(t,e,r,n,a){var o,i=e-t,s=r*n;return o=0!==i?a(s,t,i,n):e,o.toFixed(5)},e.prototype.calculateNumberUnit=function(t,e){var r,a=t.from,o=t.to,i=this.duration,s=this.easingFunction,u=n.exec(a),l=n.exec(o),c=u[2],p=Math.round(100*parseFloat(u[1]))/100,f=Math.round(100*parseFloat(l[1]))/100,r=this.numberHandler(p,f,e,i,s);return r+=c},e.prototype.numberUnitHandler=function(t,e){var r=this.calculateNumberUnit(t,e);return r},e.prototype.caclulateDecimal=function(t,e){var r=t.from,n=t.to,a=this.duration,o=this.easingFunction;return r=parseFloat(r),n=parseFloat(n),this.numberHandler(r,n,e,a,o)},e.prototype.decimalHandler=function(t,e){var r=this.caclulateDecimal(t,e);return r},e.prototype.rgbaHandler=function(t,e,r,n,a){var o,s=t.match(i),u=e.match(i);if(null===s||null===u)throw new Error("Cannot parse rgb, rgba isn't supported yet.");var l=parseInt(s[1],10),c=parseInt(u[1],10),p=parseInt(s[2],10),d=parseInt(u[2],10),h=parseInt(s[3],10),m=parseInt(u[3],10),y=parseInt(this.numberHandler(l,c,r,n,a),10),g=parseInt(this.numberHandler(p,d,r,n,a),10),b=parseInt(this.numberHandler(h,m,r,n,a),10);return y=f(y),g=f(g),b=f(b),o="rgb("+y+","+g+","+b+")"},e.prototype.rgbHandler=function(t,e,r,n,o){var s,u,l,c,p,d,h,m,y,g,b,v,w,I=t.match(a),_=e.match(a);if(null===I||null===_){if(I=I||t.match(i),_=_||e.match(i),null===I||null===_)throw new Error("Couldn't parse rgb or rgba from values from one or both: "+t+", "+e);return u=parseInt(I[1],10),l=parseInt(_[1],10),c=parseInt(I[2],10),p=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),m=parseFloat(I[4]||1),y=parseFloat(_[4]||1),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(c,p,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),w=this.numberHandler(m,y,r,n,o),g=f(g),b=f(b),v=f(v),s="rgba("+g+","+b+","+v+", "+w+")"}return u=parseInt(I[1],10),l=parseInt(_[1],10),c=parseInt(I[2],10),p=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(c,p,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),g=f(g),b=f(b),v=f(v),s="rgb("+g+","+b+","+v+")"},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=h}.apply(e,n),!(void 0!==a&&(t.exports=a))}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.clarityAnimation=e():t.clarityAnimation=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){var n,a;n=[r,e,r(3),r(7),r(8),r(2),r(9),r(10),r(11),r(6)],a=function(t,e,r,n,a,o,i,s,u,l){"use strict";e.Animation=r.default,e.Timeline=n.default,e.PercentageTimeline=a.default,e.ElementAnimation=o.default,e.ElementPathAnimation=i.default,e.CssAnimation=s.default,e.CustomRenderAnimation=u.default,e.easings=l.default}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3)],a=function(t,e,r){"use strict";var n=/^(\-?\d*\.?\d+)+(.*?)$/i,a=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,i=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+|\d\.\d+)\s*\)$/i,s={transparent:"rgba(0,0,0,0)"},u=function(t){if(0!==t.indexOf("#"))throw new Error("Invalid Hex.");var e={red:0,green:0,blue:0,alpha:1};return 4===t.length?(e.red=parseInt(t.charAt(1)+t.charAt(1),16),e.green=parseInt(t.charAt(2)+t.charAt(2),16),e.blue=parseInt(t.charAt(3)+t.charAt(3),16)):(e.red=parseInt(t.substr(1,2),16),e.green=parseInt(t.substr(3,2),16),e.blue=parseInt(t.substr(5,2),16)),e},l=function(t){var e=u(t);return"rgb("+e.red+","+e.green+","+e.blue+")"},c=function(t){return t=t<0?0:t,t=t>255?255:t},p=function(t){function e(e){var r=t.call(this,e)||this;return r.element=null,e.target instanceof Element&&(r.element=e.target,e.target=e.target.style,r.prepareTransformValues()),r.currentValues={},r.mapping={width:{handler:"numberUnitHandler",alias:"width"},height:{handler:"numberUnitHandler",alias:"height"},lineHeight:{handler:"numberUnitHandler",alias:"line-height"},top:{handler:"numberUnitHandler",alias:"top"},right:{handler:"numberUnitHandler",alias:"right"},bottom:{handler:"numberUnitHandler",alias:"bottom"},left:{handler:"numberUnitHandler",alias:"left"},fontSize:{handler:"numberUnitHandler",alias:"font-size"},borderTopWidth:{handler:"numberUnitHandler",alias:"border-top-width"},borderBottomWidth:{handler:"numberUnitHandler",alias:"border-bottom-width"},borderRightWidth:{handler:"numberUnitHandler",alias:"border-right-width"},borderLeftWidth:{handler:"numberUnitHandler",alias:"border-left-width"},borderTopColor:{handler:"colorHandler",alias:"border-top-color"},borderBottomColor:{handler:"colorHandler",alias:"border-bottom-color"},borderLeftColor:{handler:"colorHandler",alias:"border-left-color"},borderRightColor:{handler:"colorHandler",alias:"border-right-color"},marginTop:{handler:"numberUnitHandler",alias:"margin-top"},marginBottom:{handler:"numberUnitHandler",alias:"margin-bottom"},marginLeft:{handler:"numberUnitHandler",alias:"margin-left"},marginRight:{handler:"numberUnitHandler",alias:"margin-right"},paddingTop:{handler:"numberUnitHandler",alias:"padding-top"},paddingBottom:{handler:"numberUnitHandler",alias:"padding-bottom"},paddingLeft:{handler:"numberUnitHandler",alias:"padding-left"},paddingRight:{handler:"numberUnitHandler",alias:"padding-right"},opacity:{handler:"decimalHandler",alias:"opacity"},color:{handler:"colorHandler",alias:"color"},backgroundColor:{handler:"colorHandler",alias:"background-color"},rotateX:{handler:"rotateXHandler",alias:"rotateX"},rotateY:{handler:"rotateYHandler",alias:"rotateY"},rotateZ:{handler:"rotateZHandler",alias:"rotateX"},scaleX:{handler:"scaleXHandler",alias:"scaleX"},scaleY:{handler:"scaleYHandler",alias:"scaleY"},scaleZ:{handler:"scaleZHandler",alias:"scaleZ"},translateX:{handler:"translateXHandler",alias:"translateX"},translateY:{handler:"translateYHandler",alias:"translateY"},translateZ:{handler:"translateZHandler",alias:"translateZ"}},r.scaleYHandler=r.scaleXHandler,r.scaleZHandler=r.scaleXHandler,r.rotateXHandler=r.rotateXHandler.bind(r),r.rotateYHandler=r.rotateXHandler.bind(r),r.rotateZHandler=r.rotateXHandler.bind(r),r.translateXHandler=r.rotateXHandler.bind(r),r.translateYHandler=r.rotateXHandler.bind(r),r.translateZHandler=r.rotateXHandler.bind(r),r}return o(e,t),e.prototype.setCssText=function(){var t=this.element,e=this.currentValues;Object.keys(e).forEach(function(r){return t.style[r]=e[r]})},e.prototype.setElement=function(t){this.element=t,this.prepareTransformValues()},e.prototype.render=function(){var t,e,r=this.progress,n=this.properties;for(e in n){t=this.mapping[e].handler;var a=this[t];if("function"!=typeof a)throw new Error("Doesn't support '"+e+"' style animations.");this[t](e,r)}return this.setCssText(),this},e.prototype.getEndingValue=function(t){var e=this.properties[t];return"object"==typeof e&&null!==e&&(e=e.to),e},e.prototype.getBeginningValue=function(t){var e=this.beginningValues[t],r=this.properties;if("undefined"==typeof e){if(e="undefined"!=typeof r[t].from?r[t].from:this.target[t],""===e||"undefined"==typeof e)throw new Error("Couldn't find beginning value for property '"+t+"'.");this.beginningValues[t]=e}if("undefined"==typeof e)throw new Error("Couldn't find beginning value for property: "+t+". Try setting a 'from' value in the configuration of the aniimation.");return e},e.prototype.rgbaHandler=function(t,e,r,n,a){var o,s=t.match(i),u=e.match(i);if(null===s||null===u)throw new Error("Cannot parse rgb, rgba isn't supported yet.");var l=parseInt(s[1],10),p=parseInt(u[1],10),f=parseInt(s[2],10),d=parseInt(u[2],10),h=parseInt(s[3],10),m=parseInt(u[3],10),y=parseInt(this.numberHandler(l,p,r,n,a),10),g=parseInt(this.numberHandler(f,d,r,n,a),10),b=parseInt(this.numberHandler(h,m,r,n,a),10);return y=c(y),g=c(g),b=c(b),o="rgb("+y+","+g+","+b+")"},e.prototype.rgbHandler=function(t,e,r,n,o){var s,u,l,p,f,d,h,m,y,g,b,v,w,I=t.match(a),_=e.match(a);if(null===I||null===_){if(I=I||t.match(i),_=_||e.match(i),null===I||null===_)throw new Error("Couldn't parse rgb or rgba from values from one or both: "+t+", "+e);return u=parseInt(I[1],10),l=parseInt(_[1],10),p=parseInt(I[2],10),f=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),m=parseFloat(I[4]||1),y=parseFloat(_[4]||1),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(p,f,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),w=this.numberHandler(m,y,r,n,o),g=c(g),b=c(b),v=c(v),s="rgba("+g+","+b+","+v+", "+w+")"}return u=parseInt(I[1],10),l=parseInt(_[1],10),p=parseInt(I[2],10),f=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(p,f,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),g=c(g),b=c(b),v=c(v),s="rgb("+g+","+b+","+v+")"},e.prototype.prepareTransformValues=function(){var t=this.element;t.scaleX=t.scaleX||"1",t.scaleY=t.scaleY||"1",t.scaleZ=t.scaleZ||"1",t.rotateX=t.rotateX||"0deg",t.rotateY=t.rotateY||"0deg",t.rotateZ=t.rotateZ||"0deg",t.translateX=t.translateX||"0",t.translateY=t.translateY||"0",t.translateZ=t.translateZ||"0"},e.prototype.applyTransform=function(){var t=this.element,e="scaleX("+t.scaleX+") scaleY("+t.scaleY+") scaleZ("+t.scaleZ+")";e+=" rotateX("+t.rotateX+") rotateY("+t.rotateY+") rotateZ("+t.rotateZ+")",e+=" translateX("+t.translateX+") translateY("+t.translateY+") translateZ("+t.translateZ+")",this.currentValues.webkitTransform=e,this.currentValues.mozTransform=e,this.currentValues.msTransform=e,this.currentValues.transform=e},e.prototype.scaleXHandler=function(t,e){var r=this.element,n=parseFloat(this.getBeginningValue(t)),a=parseFloat(this.getEndingValue(t)),o=this.duration,i=this.easingFunction,s=this.numberHandler(n,a,e,o,i);r[t]=s,this.applyTransform()},e.prototype.rotateXHandler=function(t,e){var r,n=this.element;r=this.calculateNumberUnit(t,e),n[t]=r,this.applyTransform()},e.prototype.calculateColor=function(t,e){var r=this.getBeginningValue(t),n=this.getEndingValue(t),a=this.duration,o=this.easingFunction;return r=s[r.toLowerCase()]||r,n=s[n.toLowerCase()]||n,0===r.indexOf("#")&&(r=l(r)),0===n.indexOf("#")&&(n=l(n)),this.rgbHandler(r,n,e,a,o)},e.prototype.colorHandler=function(t,e){var r=this.calculateColor(t,e);r=this.properties[t].isImportant?r+" !important":r,this.currentValues[t]=r},e.prototype.numberHandler=function(t,e,r,n,a){var o,i=e-t,s=r*n;return o=0!==i?a(s,t,i,n):e,o.toFixed(5)},e.prototype.calculateNumberUnit=function(t,e){var r=this.getBeginningValue(t),a=this.getEndingValue(t),o=this.duration,i=this.easingFunction,s=n.exec(r),u=n.exec(a),l=s[2];if("undefined"==typeof l)throw new Error("Please use units for the '"+t+"', e.g. 10px, or 10%, 10em");var c=Math.round(100*parseFloat(s[1]))/100,p=Math.round(100*parseFloat(u[1]))/100,f=this.numberHandler(c,p,e,o,i);return f+=l},e.prototype.numberUnitHandler=function(t,e){var r=this.calculateNumberUnit(t,e);r=this.properties[t].isImportant?r+" !important":r,this.currentValues[t]=r},e.prototype.caclulateDecimal=function(t,e){var r=this.getBeginningValue(t),n=this.getEndingValue(t),a=this.duration,o=this.easingFunction;return r=parseFloat(r),n=parseFloat(n),this.numberHandler(r,n,e,a,o)},e.prototype.decimalHandler=function(t,e){var r=this.caclulateDecimal(t,e);r=this.properties[t].isImportant?r+" !important":r,this.currentValues[t]=r},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=p}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e,r(4),r(5),r(6)],a=function(t,e,r,n,a){"use strict";var o=function(t){return new Promise(function(e,r){setTimeout(e,t)})},i=function(t){for(var e=0;e<=100;e++)t[e]=[]},s=new n.default,u=function(){function t(t,e){this._callback=t,this._isStopped=!1,this._isDisposed=!1,this._unbind=e||function(){}}return t.prototype.stop=function(){this._isStopped=!0},t.prototype.start=function(){this._isStopped=!1},t.prototype.callback=function(t){this._isStopped||this._isDisposed||this._callback(t)},t.prototype.dispose=function(){return this._unbind()},t}(),l=function(){function t(t){t=t||{},this.target=t.target||{},this.currentTime=0,this.timeScale=1,this.duration=t.duration||1e-4,this.progress=0,this.properties=t.properties||{},this.beginningValues={},this.startTime=0,this.currentRequestAnimationFrameId=null,this.currentState=r.default.stoppedState,this.animationManager=s,this.iterations=0,this.repeat=1,this.repeatDirection=0,this.observers={play:[],stop:[],pause:[],restart:[],reverse:[],seek:[],tick:[],end:[],start:[]},i(this.observers),"string"==typeof t.easing?this.easingFunction=a.default[t.easing]:"function"==typeof t.easing?this.easingFunction=t.easing:this.easingFunction=a.default.linear}return t.prototype._saveBeginningValues=function(){var t=this.target,e=this.beginningValues,r=this.properties;Object.keys(r).forEach(function(r){e[r]=t[r]})},t.prototype.play=function(){return this.currentState.play(this)},t.prototype.stop=function(){return this.currentState.stop(this),this},t.prototype.observeAtTick=function(t,e){var r=100*t;if("number"==typeof r&&r>=0&&r<=100)return r=parseInt(r),this.observe(r.toString(),e);throw new Error("Invalid Argument Exception: percentage must be a decimal, and with in 0-1")},t.prototype.playToEndAsync=function(t){return"number"==typeof t&&t>=0&&t<=1&&(this.progress=t),this.playToPercentageAsync(100)},t.prototype.playToPercentageAsync=function(t){var e=this,r=t/100;if(t=parseInt(t,10),r<this.progress)throw new Error("Cannot play to a point less than the current progress.");if("number"!=typeof t||t<0||t>100)throw new Error("Expected fraction to be a number within range (0-100).");return new Promise(function(t,n){e.stop();var a=function(){s.dispose(),o.dispose(),i.dispose(),e.seek(e.progress).render()},o=e.observeAtTick(r,function(){a(),e.stop(),t()}),i=e.observe("stop",function(t){a()}),s=e.observe("reverse",function(t){a()});e.play()}).then(function(){return o(0)})},t.prototype.reverseToStartAsync=function(t){return"number"==typeof t&&t>=0&&t<=1&&(this.progress=t),this.reverseToPercentageAsync(0)},t.prototype.reverseToPercentageAsync=function(t){var e=this,r=t/100;if(t=parseInt(t,10),r>this.progress)throw new Error("Cannot reverse to a point greater than the current progress.");if("number"!=typeof t||t<0||t>100)throw new Error("Expected fraction to be a number within range (0-100).");return new Promise(function(t,n){e.stop();var a=function(){s.dispose(),o.dispose(),i.dispose(),e.seek(e.progress).render()},o=e.observeAtTick(r,function(){a(),e.stop(),t()}),i=e.observe("stop",function(t){a()}),s=e.observe("play",function(t){a()});e.reverse()}).then(function(){return o(0)})},t.prototype.pause=function(){return this.currentState.pause(this)},t.prototype.restart=function(){return this.currentState.restart(this)},t.prototype.reverse=function(){return this.currentState.reverse(this)},t.prototype.notify=function(t){var e=t.type;Array.isArray(this.observers[e])&&this.observers[e].forEach(function(e){e.callback(t)})},t.prototype.tick=function(t){var e=this.currentState.tick(this,t);return e},t.prototype.invalidate=function(){return this.progress=0,this.currentState=r.default.pausedState,this},t.prototype.getProgress=function(){return this.progress},t.prototype.setTimeScale=function(t){this.timeScale=t},t.prototype.getTimeScale=function(){return this.timeScale},t.prototype.seek=function(t,e){return this.currentState.seek(this,t,e),this},t.prototype.observe=function(t,e){if("string"!=typeof t)throw new Error("Need to supply a type.");var r=this.observers[t];if("undefined"==typeof r)throw new Error("Unknown type to observe to. Here is a list of types to observe to: play, stop, pause, restart, reverse, seek, tick, end, start");var n=new u(e,function(){var t=r.indexOf(n);t>=0&&r.splice(t,1)});return r.push(n),n},t.prototype.render=function(){var t,e,r,n,a=this.progress,o=this.beginningValues,i=this.properties,s=this.duration,u=this.easingFunction,l=this.target,c=this.properties;c.length;for(r in c){var t=o[r],e=i[r];if("object"==typeof e&&null!==e&&(t=e.from,e=e.to),"undefined"==typeof t&&(o[r]=l[r],t=l[r]),"number"!=typeof t||"number"!=typeof e)throw new Error("Default renderer is only able to animate integers. Set the renderer in the config to handle custom values.");var p=e-t,f=a*s;n=0!==p?u(f,t,p,s):e,l[r]!==n&&(l[r]=n)}return this},Object.defineProperty(t,"REPEAT_DEFAULT",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t,"REPEAT_ALTERNATE",{get:function(){return 1},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e],a=function(t,e){"use strict";var r={},n=function(t){return t},a=function(t){return t.notify({type:"pause",progress:t.progress}),t.currentState=r.forwardPausedState,t.animationManager.unregister(t),t},o=function(t){return t.notify({type:"pause",progress:t.progress}),t.currentState=r.reversePausedState,t.animationManager.unregister(t),t},i=function(t){t.notify({type:"play",progress:t.progress});var e=t.animationManager.now();return t.currentTime=e,t.currentState=r.forwardState,t.animationManager.register(t),t.render(),t},s=function(t){var e=t.animationManager.now();return t.currentTime=e,t.currentState=r.stoppedState,t.animationManager.unregister(t),t},u=function(t){return t.notify({type:"stop",progress:t.progress}),s(t)},l=function(t){t.notify({type:"reverse",progress:t.progress});var e=t.animationManager.now();return t.currentTime=e,t.currentState=r.reverseState,t.animationManager.register(t),t},c=function(t){return t.notify({type:"restart",progress:0}),t.seek(0),t.play(),t},p=function(t){return t.notify({type:"restart",progress:1}),t.seek(1),t},f=function(t){return t>1&&(t=1),t<0&&(t=0),t},d=function(t,e,r){var n=parseInt(100*e),a=parseInt(100*r);0===n&&n!==a&&t.notify({type:n}),n===a&&t.notify({type:a});for(var o=n+1;o<=a;o++)t.notify({type:o})},h=function(t,e,r){var n,a=parseInt(100*e),o=parseInt(100*r);for(100===a&&a!==o&&t.notify({type:a}),a===o&&t.notify({type:o}),n=a-1;n>=o;n--)t.notify({type:n})},m=function(t,e,r){var n=t.progress;r=f(r),t.currentTime="number"!=typeof e?t.animationManager.now():e,t.progress=r,t.render(),t.notify({type:"tick",progress:r,lastProgress:n})};r.forwardPausedState={seek:function(t,e,n){var a=t.progress;return a>e?(t.currentState=r.reversePausedState,t.currentState.seek(t,e,n),void(t.currentState=r.forwardPausedState)):void(t.progress>1||(t.progress<=0&&t.notify({type:"start",progress:0}),m(t,n,e),d(t,a,e),e>=1&&t.notify({type:"end",progress:1})))},play:i,stop:u,pause:n,reverse:l,tick:n,restart:c},r.reversePausedState={seek:function(t,e,n){var a=t.progress;return a<e?(t.currentState=r.forwardPausedState,t.currentState.seek(t,e,n),void(t.currentState=r.reversePausedState)):void(t.progress<0||(t.progress>=1&&t.notify({type:"end"}),m(t,n,e),h(t,a,e),e<=0&&t.notify({type:"start"})))},play:i,stop:u,pause:n,reverse:l,tick:n,restart:p},r.forwardState={seek:r.forwardPausedState.seek,play:n,stop:u,pause:a,reverse:l,tick:function(t,e){var r=t.currentTime;if(e>r){var n=(e-r)*t.timeScale,a=t.progress+n/t.duration;a>=1?(a=1,t.iterations++,t.iterations>=t.repeat?(this.seek(t,a,e),u(t)):(this.seek(t,a,e),0===t.repeatDirection?this.restart(t):this.reverse(t))):this.seek(t,a,e)}return t},restart:c},r.reverseState={seek:r.reversePausedState.seek,play:i,stop:u,pause:o,reverse:n,tick:function(t,e){var r=t.currentTime;if(e>r){var n=(e-r)*t.timeScale,a=t.progress-n/t.duration;a<=0?(a=0,t.iterations++,t.iterations>=t.repeat?(this.seek(t,a,e),u(t)):(this.seek(t,a,e),0===t.repeatDirection?this.restart(t):this.play(t))):this.seek(t,a,e)}return t},restart:p},r.stoppedState={seek:function(t,e,r){return e>1&&(e=1),e<0&&(e=0),t.progress=e,t.currentTime=r,t},play:i,stop:n,pause:a,reverse:l,tick:n,restart:c},Object.defineProperty(e,"__esModule",{value:!0}),e.default=r}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e],a=function(t,e){"use strict";!function(){for(var t=0,e=["ms","moz","webkit","o"],r=0;r<e.length&&!window.requestAnimationFrame;++r)window.requestAnimationFrame=window[e[r]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[r]+"CancelAnimationFrame"]||window[e[r]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,r){var n=(new Date).getTime(),a=Math.max(0,16-(n-t)),o=window.setTimeout(function(){e(n+a)},a);return t=n+a,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var r=function(){function t(t){this._currentRequestAnimationFrame=null,this._animations=[],this._lastTime=0,this._fps=100,this._refreshRateInMilliseconds=1e3/this._fps,this._timer=t||Date,this._requestCallback=function(t){this.tick(this._timer.now())},this._requestCallback=this._requestCallback.bind(this),this.setFramesPerSecond(this._fps)}return t.prototype.setFramesPerSecond=function(t){this._fps=t,this._refreshRateInMilliseconds=1e3/t},t.prototype.getFramesPerSecond=function(){return this._fps},t.prototype.checkRequestToStartOrStop=function(){var t=this._animations;null===this._currentRequestAnimationFrame&&t.length>0&&(this._currentRequestAnimationFrame=requestAnimationFrame(this._requestCallback))},t.prototype.tick=function(t){var e,r=this._animations,n=r.length,a=t-this._lastTime;a>=this._refreshRateInMilliseconds?(this._lastTime=t,n>0?(e=r.slice(0),e.forEach(function(e){e.tick(t)}),this._currentRequestAnimationFrame=requestAnimationFrame(this._requestCallback)):this._currentRequestAnimationFrame=null):this._currentRequestAnimationFrame=requestAnimationFrame(this._requestCallback)},t.prototype.now=function(){return this._timer.now()},t.prototype.register=function(t){var e=this._animations.indexOf(t);e===-1&&(this._animations.push(t),this.checkRequestToStartOrStop())},t.prototype.unregister=function(t){var e=this._animations.indexOf(t);e>=0&&this._animations.splice(e,1)},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=r}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a;n=[r,e],a=function(t,e){"use strict";var r={easeInQuad:function(t,e,r,n){return r*(t/=n)*t+e},easeOutQuad:function(t,e,r,n){return-r*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,r,n){return r*(t/=n)*t*t+e},easeOutCubic:function(t,e,r,n){return r*((t=t/n-1)*t*t+1)+e},easeInOutCubic:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,r,n){return r*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,r,n){return-r*((t=t/n-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,r,n){return r*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,r,n){return r*((t=t/n-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,r,n){return-r*Math.cos(t/n*(Math.PI/2))+r+e},easeOutSine:function(t,e,r,n){return r*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,r,n){return-r/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,r,n){return 0==t?e:r*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,r,n){return t==n?e+r:r*(-Math.pow(2,-10*t/n)+1)+e},easeInOutExpo:function(t,e,r,n){return 0==t?e:t==n?e+r:(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:r/2*(-Math.pow(2,-10*--t)+2)+e},easeInCirc:function(t,e,r,n){return-r*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOutCirc:function(t,e,r,n){return r*Math.sqrt(1-(t=t/n-1)*t)+e},easeInOutCirc:function(t,e,r,n){return(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,r,n){var a=1.70158,o=0,i=r;if(0==t)return e;if(1==(t/=n))return e+r;if(o||(o=.3*n),i<Math.abs(r)){i=r;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(r/i);return-(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-a)*(2*Math.PI)/o))+e},easeOutElastic:function(t,e,r,n){var a=1.70158,o=0,i=r;if(0==t)return e;if(1==(t/=n))return e+r;if(o||(o=.3*n),i<Math.abs(r)){i=r;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(r/i);return i*Math.pow(2,-10*t)*Math.sin((t*n-a)*(2*Math.PI)/o)+r+e},easeInOutElastic:function(t,e,r,n){var a=1.70158,o=0,i=r;if(0==t)return e;if(2==(t/=n/2))return e+r;if(o||(o=n*(.3*1.5)),i<Math.abs(r)){i=r;var a=o/4}else var a=o/(2*Math.PI)*Math.asin(r/i);return t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-a)*(2*Math.PI)/o))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*n-a)*(2*Math.PI)/o)*.5+r+e},easeInBack:function(t,e,r,n,a){return void 0==a&&(a=1.70158),r*(t/=n)*t*((a+1)*t-a)+e},easeOutBack:function(t,e,r,n,a){return void 0==a&&(a=1.70158),r*((t=t/n-1)*t*((a+1)*t+a)+1)+e},easeInOutBack:function(t,e,r,n,a){return void 0==a&&(a=1.70158),(t/=n/2)<1?r/2*(t*t*(((a*=1.525)+1)*t-a))+e:r/2*((t-=2)*t*(((a*=1.525)+1)*t+a)+2)+e},easeInBounce:function(t,e,n,a){return n-r.easeOutBounce(a-t,0,n,a)+e},easeOutBounce:function(t,e,r,n){return(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,n,a){return t<a/2?.5*r.easeInBounce(2*t,0,n,a)+e:.5*r.easeOutBounce(2*t-a,0,n,a)+.5*n+e},linear:function(t,e,r,n){return r*t/n+e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3),r(4)],a=function(t,e,r,n){"use strict";var a=function(t,e){return t.sort(function(t,r){var n=e(t),a=e(r);return n instanceof Date&&(n=n.getTime()),a instanceof Date&&(a=a.getTime()),"string"==typeof n&&(n=n.toLowerCase()),"string"==typeof a&&(a=a.toLowerCase()),"number"==typeof n&&isNaN(n)&&"number"==typeof a&&isNaN(a)?0:n===a?0:n<a?-1:n>a?1:void 0})},i=function(t,e){return t.sort(function(t,r){var n=e(t),a=e(r);return n instanceof Date&&(n=n.getTime()),a instanceof Date&&(a=a.getTime()),"string"==typeof n&&(n=n.toLowerCase()),"string"==typeof a&&(a=a.toLowerCase()),"number"==typeof n&&isNaN(n)&&"number"==typeof a&&isNaN(a)?0:n===a?0:n>a?-1:n<a?1:void 0})},s=function(t){return t.offset},u=function(t){return t.offset+t.animation.duration},l=function(t){function e(e){var r=t.call(this,e)||this;return r.animationItems=new Map,r.iterationCount=1,r.lastCurrentTime=0,r._duration=0,Object.defineProperty(r,"duration",{get:function(){return r._duration},set:function(t){var e=r._duration;r.animationItems.forEach(function(r){var n=r.offset/e,a=r.animation.duration/e;r.offset=n*t,r.animation.duration=a*t}),r._duration=t},configurable:!0}),r}return o(e,t),e.prototype.calculateDuration=function(){return Array.from(this.animationItems.values()).reduce(function(t,e){var r=e.offset+e.animation.duration;return r>t?r:t},0)},e.prototype.cacheDirection=function(){this.forwardArrayAnimations=Array.from(this.animationItems.values()),this.reverseArrayAnimations=this.forwardArrayAnimations.slice(0),a(this.forwardArrayAnimations,s),i(this.reverseArrayAnimations,u)},e.prototype.add=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Array.prototype.slice.call(arguments,0),a=this;n.forEach(function(t){if("number"!=typeof t.offset)throw new Error("animationItem needs to have an offset property set.");if(!(t.animation instanceof r.default))throw new Error("animationItem needs to have an animation property set thats an instanceof Animation.");a.animationItems.set(t,t)}),this._duration=this.calculateDuration(),this.cacheDirection()},e.prototype.remove=function(t){this.animationItems.delete(t),this.forwardArrayAnimations=Array.from(this.animationItems.values()),this.reverseArrayAnimations=this.forwardArrayAnimations.slice(0),a(this.forwardArrayAnimations,s),i(this.reverseArrayAnimations,u)},e.prototype.render=function(){var t,e=this.progress,r=this._duration,a=e*r,o=this.timeScale,i=Date.now(),s=this.currentState;return t=this.currentState===n.default.reverseState||this.currentState===n.default.reversePausedState?this.reverseArrayAnimations:this.forwardArrayAnimations,t.forEach(function(t){var e=t.animation.duration,r=t.offset,u=t.animation;if(s===n.default.reverseState?u.currentState=n.default.reversePausedState:u.currentState=n.default.forwardPausedState,u.setTimeScale(o),a>=r&&a<=r+e){var l=a-r,c=l/e;u.seek(c,i)}a>r+e&&1!==u.progress&&(u.progress<1?(u.seek(1),u.stop()):(u.stop(),u.seek(1))),a<r&&0!==u.progress&&(u.progress>0?(u.seek(0),u.stop()):(u.stop(),u.seek(0)))}),this},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(7),r(3)],a=function(t,e,r,n){"use strict";var a=function(t){function e(e){var r=t.call(this)||this;return r._duration=e,Object.defineProperty(r,"duration",{get:function(){return r._duration},set:function(t){r._duration=t,r._calculateAnimations()},configurable:!0}),r}return o(e,t),e.prototype._calculateAnimations=function(){var t=this;this.animationItems.forEach(function(e){var r=e.startAt*t._duration,n=e.endAt*t._duration-r;e.offset=r,e.animation.duration=n})},e.prototype.add=function(){var t=this,e=this,r=Array.prototype.slice.call(arguments,0);r.forEach(function(r){if("number"!=typeof r.startAt)throw new Error("animationItem needs to have an startAt percentage property set.");if("number"!=typeof r.endAt)throw new Error("animationItem needs to have an endAt percentage property set.");if(!(r.animation instanceof n.default))throw new Error("animationItem needs to have an animation property set thats an instanceof Animation.");if(r.startAt<0&&r.startAt>1||r.endAt<0&&r.endAt>1)throw new Error("startAt and endAt need to be within 0-1.");if(r.startAt>r.endAt)throw new Error("endAt needs to be greater than startAt.");var a=r.startAt*e._duration,o=r.endAt*e._duration-a;r.offset=a,r.animation.duration=o,t.animationItems.set(r,r),t.cacheDirection()})},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3)],a=function(t,e,r){"use strict";var n=function(t){return"number"==typeof t.x||"number"==typeof t.y||"number"==typeof t.z},a=function(t){var e;if(!n(t)){try{e=JSON.stringify(t)}catch(t){e="Couldn't stringify the vector because of recursive objects."}throw new Error("Invalid vector: "+e)}},i=function(t){if(!Array.isArray(t))throw new Error("The animations controls need to be an array of vectors.");var e=t.every(n);if(!e)throw new Error("Invalid control vectors.")},s=function(t){"number"!=typeof t.x&&(t.x=0),"number"!=typeof t.y&&(t.y=0),"number"!=typeof t.z&&(t.z=0)},u=function(t,e,r){return(e-t)*r+t},l=function(t){function e(e){var r=t.call(this,e)||this;if(e=e||{},r.target=e.target,r.duration=e.duration,r.unit=e.unit,r.from=e.from,r.to=e.to,r.controls=e.controls||[],r.points=[],r.calculationMatrix=[],!(r.target instanceof Element))throw new Error("The target must be an Element.");if("number"!=typeof r.duration)throw new Error("The animation's duration must be a number.");if("string"!=typeof r.unit)throw new Error("The animation's unit should be a string");return a(r.from),a(r.to),i(r.controls),r.change={x:r.to.x-r.from.x,y:r.to.y-r.from.y,z:r.to.z-r.from.z},r.points=r.controls.slice(0),r.points.unshift(r.from),r.points.push(r.to),r.points.forEach(s),r.prepareTransformValues(r.target),r}return o(e,t),e.prototype.prepareTransformValues=function(t){"undefined"==typeof t.style.scaleX&&(t._scaleX="1",t._scaleY="1",t._scaleZ="1",t._rotateX="0deg",t._rotateY="0deg",t._rotateZ="0deg",t._translateX="0",t._translateY="0",t._translateZ="0")},e.prototype.applyTransform=function(){var t=this.target,e="scaleX("+t._scaleX+") scaleY("+t._scaleY+") scaleZ("+t._scaleZ+")";e+=" rotateX("+t._rotateX+") rotateY("+t._rotateY+") rotateZ("+t._rotateZ+")",e+=" translateX("+t._translateX+") translateY("+t._translateY+") translateZ("+t._translateZ+")",t.style.webkitTransform=e,t.style.mozTransform=e,t.style.msTransform=e,t.style.transform=e},e.prototype.reduce=function(t,e,r,n){"undefined"==typeof r&&(r=0);var a=n(this.progress*this.duration,0,1,this.duration);this.calculationMatrix[r]=t;var o=this.calculationMatrix[r+1]||[];return t.reduce(function(e,r,n){if(n!==t.length-1){var o=e[n]=e[n]||{x:0,y:0,z:0};o.x=u(r.x,t[n+1].x,a),o.y=u(r.y,t[n+1].y,a),o.z=u(r.z,t[n+1].z,a)}return e},o),o.length>1?this.reduce(o,e,r+1,n):o},e.prototype.render=function(){var t=this.target,e=this.unit,r=this.progress,n=this.easingFunction,a=this.reduce(this.points,r,0,n);return t._translateX=a[0].x+e,t._translateY=a[0].y+e,t._translateZ=a[0].z+"px",this.applyTransform(),this},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(11)],a=function(t,e,r){"use strict";var n={scaleX:!0,scaleY:!0,scaleZ:!0,rotateX:!0,rotateY:!0,rotateZ:!0,translateX:!0,translateY:!0,translateZ:!0},a=function(t){function e(e){var r=this;return e.originalRenderer=e.renderer,e.renderer=function(t){var a=r.target,o=!1;Object.keys(t).forEach(function(e){return n[e]?void(o=!0):void(a[e]=t[e])}),o&&r.handleTransforms(t,a),null==e.target&&"function"==typeof e.originalRenderer&&e.originalRenderer(a); | ||
},r=t.call(this,e)||this,r.target=e.target||{},r}return o(e,t),e.prototype.handleTransforms=function(t,e){if(null!=t.scaleX||null!=t.scaleY||null!=t.scaleZ||null!=t.rotateX||null!=t.rotateY||null!=t.rotateZ||null!=t.translateX||null!=t.translateY||null!=t.translateZ){t.scaleX=t.scaleX||"1",t.scaleY=t.scaleY||"1",t.scaleZ=t.scaleZ||"1",t.rotateX=t.rotateX||"0deg",t.rotateY=t.rotateY||"0deg",t.rotateZ=t.rotateZ||"0deg",t.translateX=t.translateX||"0",t.translateY=t.translateY||"0",t.translateZ=t.translateZ||"0";var r="scaleX("+t.scaleX+") scaleY("+t.scaleY+") scaleZ("+t.scaleZ+")";r+=" rotateX("+t.rotateX+") rotateY("+t.rotateY+") rotateZ("+t.rotateZ+")",r+=" translateX("+t.translateX+") translateY("+t.translateY+") translateZ("+t.translateZ+")",this.target.webkitTransform=r,this.target.mozTransform=r,this.target.msTransform=r,this.target.transform=r}},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}.apply(e,n),!(void 0!==a&&(t.exports=a))},function(t,e,r){var n,a,o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};n=[r,e,r(3)],a=function(t,e,r){"use strict";var n=/^(\-?\d*\.?\d+)+(.*?)$/i,a=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,i=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+|\d\.\d+)\s*\)$/i,s=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$|^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+|\d\.\d+)\s*\)$/,u=/^([0-9]+)([^0-9]+)$/,l={transparent:"rgba(0,0,0,0)"},c=function(t){if(0!==t.indexOf("#"))throw new Error("Invalid Hex.");var e={red:0,green:0,blue:0,alpha:1};return 4===t.length?(e.red=parseInt(t.charAt(1)+t.charAt(1),16),e.green=parseInt(t.charAt(2)+t.charAt(2),16),e.blue=parseInt(t.charAt(3)+t.charAt(3),16)):(e.red=parseInt(t.substr(1,2),16),e.green=parseInt(t.substr(3,2),16),e.blue=parseInt(t.substr(5,2),16)),e},p=function(t){if(0===t.indexOf("#")){var e=c(t);return"rgb("+e.red+","+e.green+","+e.blue+")"}return t},f=function(t){return t=t<0?0:t,t=t>255?255:t},d=[{test:function(t){return u.test(t)},map:function(t){return t},name:"numberUnitHandler"},{test:function(t){return s.test(t)},map:function(t){return p(t)},name:"colorHandler"},{test:function(t){return"number"==typeof t},map:function(t){return t},name:"decimalHandler"}],h=function(t){function e(e){var r=t.call(this,e)||this;return r.element=e.target,r.target={},r.renderer=e.renderer||function(t){},r.assignHandlers(),r}return o(e,t),e.prototype.assignHandlers=function(){var t=this.properties;Object.keys(t).forEach(function(e){var r=t[e];if(null==r.to)throw new Error('Cannot animate "'+e+'" without specifying the "to" field.');if(null==r.from)throw new Error('Cannot animate "'+e+'" without specifying the "from" field.');d.some(function(t){return!(!t.test(r.from)||!t.test(r.to))&&(r.from=t.map(r.from),r.to=t.map(r.to),r.handlerName=t.name,!0)}),"string"!=typeof r.handlerName&&(r.handlerName="nullableHandler")})},e.prototype.render=function(){var t=this,e=this.progress,r=this.properties;return Object.keys(r).forEach(function(n){var a=r[n],o=a.handlerName,i=t[o];if("function"!=typeof i)throw new Error("Unassigned Handler.");var s=i.apply(t,[a,e]);t.target[n]=s}),this.renderer(this.target),this},e.prototype.nullableHandler=function(t,e){return t.from},e.prototype.calculateColor=function(t,e){var r=t.from,n=t.to,a=this.duration,o=this.easingFunction;return r=l[r.toLowerCase()]||r,n=l[n.toLowerCase()]||n,this.rgbHandler(r,n,e,a,o)},e.prototype.colorHandler=function(t,e){var r=this.calculateColor(t,e);return r},e.prototype.numberHandler=function(t,e,r,n,a){var o,i=e-t,s=r*n;return o=0!==i?a(s,t,i,n):e,o.toFixed(5)},e.prototype.calculateNumberUnit=function(t,e){var r,a=t.from,o=t.to,i=this.duration,s=this.easingFunction,u=n.exec(a),l=n.exec(o),c=u[2],p=Math.round(100*parseFloat(u[1]))/100,f=Math.round(100*parseFloat(l[1]))/100,r=this.numberHandler(p,f,e,i,s);return r+=c},e.prototype.numberUnitHandler=function(t,e){var r=this.calculateNumberUnit(t,e);return r},e.prototype.caclulateDecimal=function(t,e){var r=t.from,n=t.to,a=this.duration,o=this.easingFunction;return r=parseFloat(r),n=parseFloat(n),this.numberHandler(r,n,e,a,o)},e.prototype.decimalHandler=function(t,e){var r=this.caclulateDecimal(t,e);return r},e.prototype.rgbaHandler=function(t,e,r,n,a){var o,s=t.match(i),u=e.match(i);if(null===s||null===u)throw new Error("Cannot parse rgb, rgba isn't supported yet.");var l=parseInt(s[1],10),c=parseInt(u[1],10),p=parseInt(s[2],10),d=parseInt(u[2],10),h=parseInt(s[3],10),m=parseInt(u[3],10),y=parseInt(this.numberHandler(l,c,r,n,a),10),g=parseInt(this.numberHandler(p,d,r,n,a),10),b=parseInt(this.numberHandler(h,m,r,n,a),10);return y=f(y),g=f(g),b=f(b),o="rgb("+y+","+g+","+b+")"},e.prototype.rgbHandler=function(t,e,r,n,o){var s,u,l,c,p,d,h,m,y,g,b,v,w,I=t.match(a),_=e.match(a);if(null===I||null===_){if(I=I||t.match(i),_=_||e.match(i),null===I||null===_)throw new Error("Couldn't parse rgb or rgba from values from one or both: "+t+", "+e);return u=parseInt(I[1],10),l=parseInt(_[1],10),c=parseInt(I[2],10),p=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),m=parseFloat(I[4]||1),y=parseFloat(_[4]||1),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(c,p,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),w=this.numberHandler(m,y,r,n,o),g=f(g),b=f(b),v=f(v),s="rgba("+g+","+b+","+v+", "+w+")"}return u=parseInt(I[1],10),l=parseInt(_[1],10),c=parseInt(I[2],10),p=parseInt(_[2],10),d=parseInt(I[3],10),h=parseInt(_[3],10),g=parseInt(this.numberHandler(u,l,r,n,o),10),b=parseInt(this.numberHandler(c,p,r,n,o),10),v=parseInt(this.numberHandler(d,h,r,n,o),10),g=f(g),b=f(b),v=f(v),s="rgb("+g+","+b+","+v+")"},e}(r.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=h}.apply(e,n),!(void 0!==a&&(t.exports=a))}])}); |
@@ -0,0 +0,0 @@ window.SearcherDisplay = (function($) { |
@@ -0,0 +0,0 @@ window.Searcher = (function() { |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ PR.registerLangHandler(PR.createSimpleLexer([ |
@@ -0,0 +0,0 @@ var q = null; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ (function($) { |
@@ -20,3 +20,4 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
_this._calculateAnimations(); | ||
} | ||
}, | ||
configurable: true | ||
}); | ||
@@ -54,7 +55,8 @@ return _this; | ||
} | ||
var offset = animationItem.startAt * self.duration; | ||
var duration = (animationItem.endAt * self.duration) - offset; | ||
var offset = animationItem.startAt * self._duration; | ||
var duration = (animationItem.endAt * self._duration) - offset; | ||
animationItem.offset = offset; | ||
animationItem.animation.duration = duration; | ||
_super.prototype.add.call(_this, animationItem); | ||
_this.animationItems.set(animationItem, animationItem); | ||
_this.cacheDirection(); | ||
}); | ||
@@ -61,0 +63,0 @@ }; |
@@ -5,3 +5,3 @@ import Timeline from "./Timeline"; | ||
export default class PercentageTimeline extends Timeline { | ||
_duration; | ||
_duration; | ||
@@ -19,3 +19,4 @@ constructor(duration) { | ||
this._calculateAnimations(); | ||
} | ||
}, | ||
configurable: true | ||
}); | ||
@@ -59,4 +60,4 @@ } | ||
var offset = animationItem.startAt * self.duration; | ||
var duration = (animationItem.endAt * self.duration) - offset; | ||
var offset = animationItem.startAt * self._duration; | ||
var duration = (animationItem.endAt * self._duration) - offset; | ||
@@ -66,4 +67,6 @@ animationItem.offset = offset; | ||
super.add(animationItem); | ||
this.animationItems.set(animationItem, animationItem); | ||
this.cacheDirection(); | ||
}); | ||
@@ -70,0 +73,0 @@ |
@@ -95,3 +95,4 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
_this._duration = value; | ||
} | ||
}, | ||
configurable: true | ||
}); | ||
@@ -109,2 +110,8 @@ return _this; | ||
}; | ||
Timeline.prototype.cacheDirection = function () { | ||
this.forwardArrayAnimations = Array.from(this.animationItems.values()); | ||
this.reverseArrayAnimations = this.forwardArrayAnimations.slice(0); | ||
orderBy(this.forwardArrayAnimations, renderByOffset); | ||
orderByDesc(this.reverseArrayAnimations, renderByOffsetAndDuration); | ||
}; | ||
Timeline.prototype.add = function () { | ||
@@ -127,6 +134,3 @@ var allAnimationItems = []; | ||
this._duration = this.calculateDuration(); | ||
this.forwardArrayAnimations = Array.from(this.animationItems.values()); | ||
this.reverseArrayAnimations = this.forwardArrayAnimations.slice(0); | ||
orderBy(this.forwardArrayAnimations, renderByOffset); | ||
orderByDesc(this.reverseArrayAnimations, renderByOffsetAndDuration); | ||
this.cacheDirection(); | ||
}; | ||
@@ -133,0 +137,0 @@ Timeline.prototype.remove = function (animationItem) { |
@@ -125,3 +125,4 @@ import Animation from "./Animation"; | ||
this._duration = value; | ||
} | ||
}, | ||
configurable: true | ||
}); | ||
@@ -140,2 +141,10 @@ } | ||
cacheDirection() { | ||
this.forwardArrayAnimations = Array.from(this.animationItems.values()); | ||
this.reverseArrayAnimations = this.forwardArrayAnimations.slice(0); | ||
orderBy(this.forwardArrayAnimations, renderByOffset); | ||
orderByDesc(this.reverseArrayAnimations, renderByOffsetAndDuration); | ||
} | ||
add(...allAnimationItems) { | ||
@@ -158,8 +167,3 @@ var animationItems = Array.prototype.slice.call(arguments, 0); | ||
this._duration = this.calculateDuration(); | ||
this.forwardArrayAnimations = Array.from(this.animationItems.values()); | ||
this.reverseArrayAnimations = this.forwardArrayAnimations.slice(0); | ||
orderBy(this.forwardArrayAnimations, renderByOffset); | ||
orderByDesc(this.reverseArrayAnimations, renderByOffsetAndDuration); | ||
this.cacheDirection(); | ||
} | ||
@@ -166,0 +170,0 @@ |
{ | ||
"name": "clarity-animation", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"description": "Unopinionated animation library.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
139588
4279346