Created
July 29, 2014 07:58
-
-
Save douglasduteil/994a4ff53c215fa464b4 to your computer and use it in GitHub Desktop.
A web-animations/web-animations-next build version (247654e00c2371eede3eea53240e06049cae8de5)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2014 Google Inc. All rights reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
// See the License for the specific language governing permissions and | |
// limitations under the License. | |
!function(a,b){b["true"]=a;var c={},d={},e={},f=null;!function(a,b,c){function d(a,b){var c={delay:0,endDelay:0,fill:b?"both":"none",iterationStart:0,iterations:1,duration:b?"auto":0,playbackRate:1,direction:"normal",easing:"linear"};return"number"==typeof a?c.duration=a:void 0!==a&&Object.getOwnPropertyNames(a).forEach(function(b){if("auto"!=a[b]){if("number"==typeof c[b]&&"number"!=typeof a[b]&&"duration"!=b)return;if("fill"==b&&-1==q.indexOf(a[b]))return;if("direction"==b&&-1==r.indexOf(a[b]))return;c[b]=a[b]}}),c.easing=g(c.easing),c}function e(a,b,c,d){return 0>a||a>1||0>c||c>1?z:function(e){function f(a,b,c){return 3*a*(1-c)*(1-c)*c+3*b*(1-c)*c*c+c*c*c}for(var g=0,h=1;;){var i=(g+h)/2,j=f(a,c,i);if(Math.abs(e-j)<.001)return f(b,d,i);e>j?g=i:h=i}}}function f(a,b){return function(c){if(c>=1)return 1;var d=1/a;return c+=b*d,c-c%d}}function g(a){var b=x.exec(a);if(b)return e.apply(this,b.slice(1).map(Number));var c=y.exec(a);if(c)return f(Number(c[1]),{start:s,middle:t,end:u}[c[2]]);var d=v[a];return d?d:z}function h(a){return Math.abs(i(a)/a.playbackRate)}function i(a){return a.duration*a.iterations}function j(a,b,c){return null==b?A:b<c.delay?B:b>=c.delay+a?C:D}function k(a,b,c,d,e){switch(d){case B:return"backwards"==b||"both"==b?0:null;case D:return c-e;case C:return"forwards"==b||"both"==b?a:null;case A:return null}}function l(a,b,c,d){return(d.playbackRate<0?b-a:b)*d.playbackRate+c}function m(a,b,c,d,e){return 1/0===c||c===-1/0||c-d==b&&e.iterations&&(e.iterations+e.iterationStart)%1==0?a:c%a}function n(a,b,c,d){return 0===c?0:b==a?d.iterationStart+d.iterations-1:Math.floor(c/a)}function o(a,b,c,d){var e=a%2>=1,f="normal"==d.direction||d.direction==(e?"alternate-reverse":"alternate"),g=f?c:b-c,h=g/b;return b*d.easing(h)}function p(a,b,c){var d=j(a,b,c),e=k(a,c.fill,b,d,c.delay);if(null===e)return null;if(0===a)return d===B?0:1;var f=c.iterationStart*c.duration,g=l(a,e,f,c),h=m(c.duration,i(c),g,f,c),p=n(c.duration,h,g,c);return o(p,c.duration,h,c)/c.duration}var q="backwards|forwards|both".split("|"),r="reverse|alternate|alternate-reverse".split("|"),s=1,t=.5,u=0,v={ease:e(.25,.1,.25,1),"ease-in":e(.42,0,1,1),"ease-out":e(0,0,.58,1),"ease-in-out":e(.42,0,.58,1),"step-start":f(1,s),"step-middle":f(1,t),"step-end":f(1,u)},w="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",x=new RegExp("cubic-bezier\\("+w+","+w+","+w+","+w+"\\)"),y=/step\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,z=function(a){return a},A=0,B=1,C=2,D=3;a.normalizeTimingInput=d,a.calculateActiveDuration=h,a.calculateTimeFraction=p,b.AnimationNode=function(a){var b=h(a),c=function(c){return p(b,c,a)};return c._totalDuration=a.delay+b+a.endDelay,c._isCurrent=function(c){var d=j(b,c,a);return d===D||d===B},c}}(c,d,f),function(a,b,c){function d(a){function b(){var a=c.length;null==c[a-1].offset&&(c[a-1].offset=1),a>1&&null==c[0].offset&&(c[0].offset=0);for(var b=0,d=c[0].offset,e=1;a>e;e++){var f=c[e].offset;if(null!=f){for(var g=1;e-b>g;g++)c[b+g].offset=d+(f-d)*g/(e-b);b=e,d=f}}}if(!Array.isArray(a)&&null!==a)throw new TypeError("Keyframe effect must be null or an array of keyframes");if(null==a)return[];for(var c=a.map(function(a){var b={};for(var c in a){var d=a[c];if("offset"==c){if(null!=d&&(d=Number(d),!isFinite(d)))throw new TypeError("keyframe offsets must be numbers.")}else d=""+d;b[c]=d}return void 0==b.offset&&(b.offset=null),b}),d=!0,e=!0,f=-1/0,g=0;g<c.length;g++){var h=c[g].offset;null!=h?(f>h&&(e=!1),f=h):d=!1}if(c=c.filter(function(a){return a.offset>=0&&a.offset<=1}),!e){if(!d)throw"Keyframes are not loosely sorted by offset. Sort or specify offsets.";c.sort(function(a,b){return a.offset-b.offset})}return d||b(),c}function e(a){for(var b={},c=0;c<a.length;c++)for(var d in a[c])if("offset"!=d){var e={offset:a[c].offset,value:a[c][d]};b[d]=b[d]||[],b[d].push(e)}for(var f in b){var g=b[f];if(0!=g[0].offset||1!=g[g.length-1].offset)throw"Partial keyframes are not supported"}return b}function f(a){var c=[];for(var d in a)for(var e=a[d],f=0;f<e.length-1;f++)c.push({startTime:e[f].offset,endTime:e[f+1].offset,property:d,interpolation:b.propertyInterpolation(d,e[f].value,e[f+1].value)});return c.sort(function(a,b){return a.startTime-b.startTime}),c}b.convertEffectInput=function(a){var c=d(a),g=e(c),h=f(g);return function(a,c){if(null!=c)for(var d=0;d<h.length&&h[d].startTime<=c;d++)h[d].endTime>=c&&h[d].endTime!=h[d].startTime&&b.apply(a,h[d].property,h[d].interpolation((c-h[d].startTime)/(h[d].endTime-h[d].startTime)));else for(var e in g)"offset"!=e&&b.clear(a,e)}},a.normalizeKeyframes=d}(c,d,f),function(a){function b(a,b,c){for(var e=0;e<c.length;e++){var f=c[e];d[f]=d[f]||[],d[f].push([a,b])}}function c(b,c,e){for(var f=c==e?[]:d[b],g=0;f&&g<f.length;g++){var h=f[g][0](c),i=f[g][0](e);if(void 0!==h&&void 0!==i){var j=f[g][1](h,i);if(j)return a.Interpolation.apply(null,j)}}return a.Interpolation(!1,!0,function(a){return a?e:c})}var d={};a.addPropertiesHandler=b,a.propertyInterpolation=c}(d,f),function(a,b){b.Animation=function(c,d,e){var f,g=b.AnimationNode(a.normalizeTimingInput(e)),h=b.convertEffectInput(d),i=function(){h(c,f)};return i._update=function(a){return f=g(a),null!==f},i._clear=function(){h(c,null)},i._hasSameTarget=function(a){return c===a},i._isCurrent=g._isCurrent,i._totalDuration=g._totalDuration,i},b.NullAnimation=function(a){var b=function(){a&&(a(),a=null)};return b._update=function(){return null},b._totalDuration=0,b._isCurrent=function(){return!1},b._hasSameTarget=function(){return!1},b}}(c,d,f),function(a){function b(a){return c[a]||a}var c={};["webkitTransform","msTransform","transform"].forEach(function(a){a in document.documentElement.style&&(c.transform=a)}),a.apply=function(a,c,d){a.style[b(c)]=d},a.clear=function(a,c){a.style[b(c)]=""}}(d,f),function(a,b){function c(a){a=a.trim(),f.fillStyle="#000",f.fillStyle=a;var b=f.fillStyle;if(f.fillStyle="#fff",f.fillStyle=a,b==f.fillStyle){f.fillRect(0,0,1,1);var c=f.getImageData(0,0,1,1).data;f.clearRect(0,0,1,1);var d=c[3]/255;return[c[0]*d,c[1]*d,c[2]*d,d]}}function d(b,c){return[b,c,function(b){function c(a){return Math.max(0,Math.min(255,a))}if(b[3])for(var d=0;3>d;d++)b[d]=Math.round(c(b[d]/b[3]));return b[3]=a.numberToString(c(b[3])),"rgba("+b.join(",")+")"}]}var e=document.createElement("canvas");e.width=e.height=1;var f=e.getContext("2d");a.addPropertiesHandler(c,d,["color","backgroundColor"])}(d,f),function(a,b){function c(a,b){if(b=b.trim().toLowerCase(),"0"==b&&"px".search(a)>=0)return{px:0};if(/^[^(]*$|^calc/.test(b)){b=b.replace(/calc\(/g,"(");var c={};b=b.replace(a,function(a){return c[a]=null,"U"+a});for(var d="U("+a.source+")",e=b.replace(/[-+]?(\d*\.)?\d+/g,"N").replace(new RegExp("N"+d,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),f=[/N\*(D)/g,/(N|D)[*/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],g=0;g<f.length;)f[g].test(e)?(e=e.replace(f[g],"$1"),g=0):g++;if("D"==e){for(var h in c){var i=eval(b.replace(new RegExp("U"+h,"g"),"").replace(new RegExp(d,"g"),"*0"));if(!isFinite(i))return;c[h]=i}return c}}}function d(b,c){var d,e=[];for(d in b)e.push(d);for(d in c)e.indexOf(d)<0&&e.push(d);return b=e.map(function(a){return b[a]||0}),c=e.map(function(a){return c[a]||0}),[b,c,function(b){var c=b.map(function(b,c){return a.numberToString(b)+e[c]}).join(" + ");return b.length>1?"calc("+c+")":c}]}var e="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",f=c.bind(null,new RegExp(e,"g")),g=c.bind(null,new RegExp(e+"|%","g")),h=c.bind(null,/deg|rad|grad|turn/g);a.parseLength=f,a.parseLengthOrPercent=g,a.parseAngle=h,a.mergeDimensions=d,a.addPropertiesHandler(g,d,"left|right|top|bottom|width|height".split("|"))}(d,f),function(a){window.Element.prototype.animate=function(b,c){return a.timeline._play(a.Animation(this,b,c))},window.Element.prototype.getAnimationPlayers=function(){return document.timeline.getAnimationPlayers().filter(function(a){return a._source._hasSameTarget(this)}.bind(this))}}(d),function(a,b){function c(a,b,d){if("number"==typeof a&&"number"==typeof b)return a*(1-d)+b*d;if("boolean"==typeof a&&"boolean"==typeof b)return.5>d?a:b;if(a.length==b.length){for(var e=[],f=0;f<a.length;f++)e.push(c(a[f],b[f],d));return e}throw"Mismatched interpolation arguments "+a+":"+b}a.Interpolation=function(a,b,d){return function(e){return d(c(a,b,e))}}}(d,f),function(a){function b(a){return a.toFixed(3).replace(".000","")}function c(a,b,c){return Math.min(b,Math.max(a,c))}function d(a){return/^\s*[-+]?(\d*\.)?\d+\s*$/.test(a)?Number(a):void 0}function e(a,c){return[a,c,b]}function f(a,d){return function(e,f){return[e,f,function(e){return b(c(a,d,e))}]}}a.addPropertiesHandler(d,f(0,1),["opacity"]),a.parseNumber=d,a.mergeNumbers=e,a.numberToString=b}(d,f),function(a,b){var c=0,d=function(a,b,c){this.target=a,this.currentTime=b,this.timelineTime=c,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=a,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};b.Player=function(a){this._sequenceNumber=c++,this._currentTime=0,this._startTime=0/0,this.paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!1,this.onfinish=null,this._finishHandlers=[],this._source=a,this._inEffect=this._source._update(0)},b.Player.prototype={_ensureAlive:function(){this._inEffect=this._source._update(this._currentTime),!this._inTimeline&&this._inEffect&&(this._inTimeline=!0,document.timeline._players.push(this))},_tickCurrentTime:function(a,b){a!=this._currentTime&&(this._currentTime=a,this.finished&&!b&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._currentTime},set currentTime(a){b.restart()&&(this._startTime=0/0),this.paused||isNaN(this._startTime)||(this._startTime=this._timeline.currentTime-a/this._playbackRate),this._currentTime!=a&&(this._tickCurrentTime(a,!0),b.invalidateEffects())},get startTime(){return this._startTime},set startTime(a){this.paused||(this._startTime=a,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),b.invalidateEffects())},get playbackRate(){return this._playbackRate},get finished(){return this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0},get _totalDuration(){return this._source._totalDuration},play:function(){this.paused=!1,this.finished&&(this._currentTime=this._playbackRate>0?0:this._totalDuration,b.invalidateEffects()),this._finishedFlag=!1,this._startTime=b.restart()?0/0:this._timeline.currentTime-this._currentTime/this._playbackRate,this._ensureAlive()},pause:function(){this.paused=!0,this._startTime=0/0},finish:function(){this.currentTime=this._playbackRate>0?this._totalDuration:0},cancel:function(){this._source=b.NullAnimation(this._source._clear),this._inEffect=!1,this.currentTime=0},reverse:function(){this._playbackRate*=-1,this._startTime=b.restart()?0/0:this._timeline.currentTime-this._currentTime/this._playbackRate,this._inTimeline||(this._inTimeline=!0,document.timeline._players.push(this)),this._finishedFlag=!1,this._ensureAlive()},addEventListener:function(a,b){"function"==typeof b&&"finish"==a&&this._finishHandlers.push(b)},removeEventListener:function(a,b){if("finish"==a){var c=this._finishHandlers.indexOf(b);c>=0&&this._finishHandlers.splice(c,1)}},_fireEvents:function(a){var b=this.finished;if(b&&!this._finishedFlag){var c=new d(this,this.currentTime,a),e=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){e.forEach(function(a){a.call(c.target,c)})},0)}this._finishedFlag=b},_tick:function(a){return!this.paused&&isNaN(this._startTime)?this.startTime=a-this._currentTime/this.playbackRate:this.paused||this.finished||this._tickCurrentTime((a-this._startTime)*this.playbackRate),this._fireEvents(a),!this.finished||this._inEffect}}}(c,d,f),function(a,b,c){function d(a){var b=i;i=[],g(a),b.forEach(function(b){b(a)}),l&&g(a),f()}function e(a,b){return a._sequenceNumber-b._sequenceNumber}function f(){m.forEach(function(a){a()})}function g(a){k=!1;var b=window.document.timeline;b.currentTime=a,b._players.sort(e),j=!1;var c=b._players;b._players=[];var d=[],f=[];c=c.filter(function(b){return b._inTimeline=b._tick(a),b._inEffect?f.push(b._source):d.push(b._source),b.finished||b.paused||(j=!0),b._inTimeline}),m.length=0,m.push.apply(m,d),m.push.apply(m,f),b._players.push.apply(b._players,c),l=!1,j&&requestAnimationFrame(function(){})}var h=window.requestAnimationFrame,i=[];window.requestAnimationFrame=function(a){0==i.length&&h(d),i.push(a)},b.AnimationTimeline=function(){this._players=[],this.currentTime=void 0},b.AnimationTimeline.prototype={_play:function(a){var c=new b.Player(a);return c._timeline=this,this._players.push(c),b.restart(),b.invalidateEffects(),c},getAnimationPlayers:function(){return l&&g(o.currentTime),this._players.filter(function(a){return a._source._isCurrent(a.currentTime)}).sort(e)}};var j=!1,k=!1;b.restart=function(){return j||(j=!0,requestAnimationFrame(function(){}),k=!0),k};var l=!1;b.invalidateEffects=function(){l=!0};var m=[],n=window.getComputedStyle;Object.defineProperty(window,"getComputedStyle",{configurable:!0,enumerable:!0,value:function(){return l&&g(o.currentTime),f(),n.apply(this,arguments)}});var o=new b.AnimationTimeline;b.timeline=o;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return o}})}catch(p){}try{window.document.timeline=o}catch(p){}}(c,d,f),function(a,b){function c(a){return function(b){var c=0;return a.map(function(a){return a===i?b[c++]:a})}}function d(a){return a}function e(b){if(b=b.toLowerCase().trim(),"none"==b)return[];for(var c,d=/\s*(\w+)\(([^)]*)\)/g,e=[],f=0;c=d.exec(b);){if(c.index!=f)return;f=c.index+c[0].length;var g=c[1],h=l[g];if(!h)return;var i=c[2].split(","),m=h[0];if(m.length<i.length)return;for(var n=[],o=0;o<m.length;o++){var p,q=i[o],r=m[o];if(p=q?{A:function(b){return"0"==b.trim()?k:a.parseAngle(b)},N:a.parseNumber,T:a.parseLengthOrPercent,L:a.parseLength}[r.toUpperCase()](q):{a:k,n:n[0],t:j}[r],void 0===p)return;n.push(p)}if(e.push([g,n]),d.lastIndex==b.length)return e}}function f(a){return a.replace(/[xy]/,"")}function g(a){return a.replace(/(x|y|z|3d)?$/,"3d")}function h(b,c){var d=!1;if(!b.length||!c.length){b.length||(d=!0,b=c,c=[]);for(var e=0;e<b.length;e++){var h=b[e][0],i=b[e][1],j="scale"==h.substr(0,5)?1:0;c.push([h,i.map(function(a){if("number"==typeof a)return j;var b={};for(var c in a)b[c]=j;return b})])}}if(b.length==c.length){for(var k=[],m=[],n=[],e=0;e<b.length;e++){var h,o=b[e][0],p=c[e][0],q=b[e][1],r=c[e][1],s=l[o],t=l[p];if(o==p)h=o;else if(s[2]&&t[2]&&f(o)==f(p))h=f(o),q=s[2](q),r=t[2](r);else{if(!s[1]||!t[1]||g(o)!=g(p))return;h=g(o),q=s[1](q),r=t[1](r)}for(var u=[],v=0;v<q.length;v++){var w="number"==typeof q[v]?a.mergeNumbers:a.mergeDimensions,x=w(q[v],r[v]);q[v]=x[0],r[v]=x[1],u.push(x[2])}k.push(q),m.push(r),n.push([h,u])}if(d){var y=k;k=m,m=y}return[k,m,function(a){return a.map(function(a,b){var c=a.map(function(a,c){return n[b][1][c](a)}).join(",");return n[b][0]+"("+c+")"}).join(" ")}]}}var i=null,j={px:0},k={deg:0},l={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],scale:["Nn",c([i,i,1]),d],scalex:["N",c([i,1,1]),c([i,1])],scaley:["N",c([1,i,1]),c([1,i])],scalez:["N",c([1,1,i])],scale3d:["NNN",d],skew:["Aa",null,d],skewx:["A",null,c([i,k])],skewy:["A",null,c([k,i])],translate:["Tt",c([i,i,j]),d],translatex:["T",c([i,j,j]),c([i,j])],translatey:["T",c([j,i,j]),c([j,i])],translatez:["L",c([j,j,i])],translate3d:["TTL",d]};a.addPropertiesHandler(e,h,["transform"])}(d,f),function(a,b){b.Player=function(a){this.source=null,this._isGroup=!1,this._player=a,this._childPlayers=[],this._callback=null},b.Player.prototype={get paused(){return this._player.paused},get onfinish(){return this._onfinish},set onfinish(a){"function"==typeof a?(this._onfinish=a,this._player.onfinish=function(b){b.target=this,a.call(this,b)}.bind(this)):(this._player.onfinish=a,this.onfinish=this._player.onfinish)},get currentTime(){return this._player.currentTime},set currentTime(a){this._player.currentTime=a,this._register(),this._forEachChild(function(b,c){b.currentTime=a-c})},get startTime(){return this._player.startTime},set startTime(a){this._player.startTime=a,this._register(),this._forEachChild(function(b,c){b.startTime=a+c})},get playbackRate(){return this._player.playbackRate},get finished(){return this._player.finished},play:function(){this._player.play(),this._register(),b.awaitStartTime(this),this._forEachChild(function(a){var b=a.currentTime;a.play(),a.currentTime=b})},pause:function(){this._player.pause(),this._register(),this._forEachChild(function(a){a.pause()})},finish:function(){this._player.finish(),this._register()},cancel:function(){this._player.cancel(),this._callback&&(this._register(),this._callback._player=null),this.source=null,this._removePlayers()},reverse:function(){this._player.reverse(),b.awaitStartTime(this),this._register(),this._forEachChild(function(a,b){a.reverse(),a.startTime=this.startTime+b*this.playbackRate,a.currentTime=this.currentTime+b*this.playbackRate})},addEventListener:function(a,b){var c=b;"function"==typeof b&&(c=function(a){a.target=this,b.call(this,a)}.bind(this),b._wrapper=c),this._player.addEventListener(a,c)},removeEventListener:function(a,b){this._player.removeEventListener(a,b&&b._wrapper||b)},_removePlayers:function(){for(;this._childPlayers.length;)this._childPlayers.pop().cancel()},_forEachChild:function(a){var b=0;this._childPlayers.forEach(function(c){a.call(this,c,b),this.source instanceof window.AnimationSequence&&(b+=c.source.activeDuration)}.bind(this))}}}(c,e,f),function(a,b){function c(a){return a.timing.delay+a.activeDuration+a.timing.endDelay}function d(b){this._frames=a.normalizeKeyframes(b)}function e(){for(var a=!1;f.length;)f.shift()._updateChildren(),a=!0;return a}d.prototype={getFrames:function(){return this._frames}},window.Animation=function(b,c,e){return this.target=b,this.timing=a.normalizeTimingInput(e),this.effect="function"==typeof c?c:new d(c),this._effect=c,this._internalPlayer=null,this.activeDuration=a.calculateActiveDuration(this.timing),this};var f=[];b.awaitStartTime=function(a){isNaN(a.startTime)&&a._isGroup&&(0==f.length&&requestAnimationFrame(e),f.push(a))};var g=window.getComputedStyle;Object.defineProperty(window,"getComputedStyle",{configurable:!0,enumerable:!0,value:function(){var a=g.apply(this,arguments);return e()&&(a=g.apply(this,arguments)),a}}),b.Player.prototype._updateChildren=function(){if(!isNaN(this.startTime)&&this.source&&this._isGroup)for(var a=this.source.timing.delay,b=0;b<this.source.children.length;b++){var d,e=this.source.children[b];b>=this._childPlayers.length?(d=window.document.timeline.play(e),e.player=this.source.player,this._childPlayers.push(d)):d=this._childPlayers[b],d.startTime!=this.startTime+a&&(d.startTime=this.startTime+a,d._updateChildren()),-1==this.playbackRate&&this.currentTime<a&&-1!==d.currentTime&&(d.currentTime=-1),this.source instanceof window.AnimationSequence&&(a+=c(e))}},window.document.timeline.play=function(a){if(a instanceof window.Animation){var c=a.target.animate(a._effect,a.timing);return c.source=a,a.player=c,c}if(a instanceof window.AnimationSequence||a instanceof window.AnimationGroup){var d=function(a){return c.source?null==a?void c._removePlayers():void(isNaN(c.startTime)||c._updateChildren()):void 0},c=document.createElement("div").animate(d,a.timing);return c.source=a,c._isGroup=!0,a.player=c,b.awaitStartTime(c),c}},b.groupChildDuration=c}(c,e,f),function(a,b){function c(b,c,e,f){var g="fixme",i=void 0;f=a.normalizeTimingInput(f);var j=function(){var b=j._player?j._player.currentTime:0/0;isNaN(b)?b=null:(b=a.calculateTimeFraction(a.calculateActiveDuration(f),b,f),isNaN(b)&&(b=null)),b!==i&&e(b,c,g),i=b};j._player=b,j._registered=!1,j._sequenceNumber=h++,b._callback=j,d(j)}function d(a){a._registered||(a._registered=!0,i.push(a),j||(j=!0,requestAnimationFrame(e)))}function e(){var a=i;i=[],a.sort(function(a,b){return a._sequenceNumber-b._sequenceNumber}),a.filter(function(a){return a(),(!a._player||a._player.finished||a._player.paused)&&(a._registered=!1),a._registered}),i.push.apply(i,a),i.length?(j=!0,requestAnimationFrame(e)):j=!1}var f=document.createElement("div"),g=Element.prototype.animate;Element.prototype.animate=function(a,d){if("function"==typeof a){var e=new b.Player(g.call(f,[],d));return c(e,this,a,d),e}return new b.Player(g.call(this,a,d))};var h=0,i=[],j=!1;b.Player.prototype._register=function(){this._callback&&d(this._callback)}}(c,e,f),function(a,b){function c(b,c){this.children=b||[],this.timing=a.normalizeTimingInput(c,!0),"auto"===this.timing.duration&&(this.timing.duration=this.activeDuration),this._internalPlayer=null}window.AnimationSequence=function(){c.apply(this,arguments)},window.AnimationGroup=function(){c.apply(this,arguments)},window.AnimationSequence.prototype={get activeDuration(){var a=0;return this.children.forEach(function(c){a+=b.groupChildDuration(c)}),Math.max(a,0)}},window.AnimationGroup.prototype={get activeDuration(){var a=0;return this.children.forEach(function(c){a=Math.max(a,b.groupChildDuration(c))}),a}}}(c,e,f)}({},function(){return this}()); | |
//# sourceMappingURL=web-animations.min.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":3,"file":"web-animations.min.js","sources":["?","src/scope.js","src/animation-node.js","src/effect.js","src/property-interpolation.js","src/animation.js","src/apply.js","src/color-handler.js","src/dimension-handler.js","src/element-animatable.js","src/interpolation.js","src/number-handler.js","src/player.js","src/timeline.js","src/transform-handler.js","src/maxifill-player.js","src/animation-constructor.js","src/effect-callback.js","src/group-constructors.js"],"names":["exports","global","webAnimationsShared","webAnimationsMinifill","webAnimationsMaxifill","webAnimationsTesting","shared","scope","testing","normalizeTimingInput","timingInput","forGroup","timing","delay","endDelay","fill","iterationStart","iterations","duration","playbackRate","direction","easing","undefined","Object","getOwnPropertyNames","forEach","property","fills","indexOf","directions","toTimingFunction","cubic","a","b","c","d","linear","x","f","m","start","end","mid","xEst","Math","abs","step","count","pos","stepSize","cubicData","cubicBezierRe","exec","apply","this","slice","map","Number","stepData","stepRe","Start","middle","Middle","End","preset","presets","calculateActiveDuration","repeatedDuration","calculatePhase","activeDuration","localTime","PhaseNone","PhaseBefore","PhaseAfter","PhaseActive","calculateActiveTime","fillMode","phase","calculateScaledActiveTime","activeTime","startOffset","calculateIterationTime","iterationDuration","scaledActiveTime","Infinity","calculateCurrentIteration","iterationTime","floor","calculateTransformedTime","currentIteration","currentIterationIsOdd","currentDirectionIsForwards","directedTime","timeFraction","calculateTimeFraction","split","ease","ease-in","ease-out","ease-in-out","step-start","step-middle","step-end","numberString","RegExp","AnimationNode","animationNode","_totalDuration","_isCurrent","normalize","effectInput","spaceKeyframes","length","keyframeEffect","offset","previousIndex","previousOffset","i","j","Array","isArray","TypeError","originalKeyframe","keyframe","member","memberValue","isFinite","everyFrameHasOffset","looselySortedByOffset","filter","sort","leftKeyframe","rightKeyframe","makePropertySpecificKeyframeGroups","propertySpecificKeyframeGroups","propertySpecificKeyframe","value","push","groupName","group","makeInterpolations","interpolations","startTime","endTime","interpolation","propertyInterpolation","leftInterpolation","rightInterpolation","convertEffectInput","target","fraction","clear","normalizeKeyframes","addPropertiesHandler","parser","merger","properties","propertyHandlers","left","right","handlers","parsedLeft","parsedRight","interpolationArgs","Interpolation","bool","Animation","effect","animation","_update","_clear","_hasSameTarget","otherTarget","NullAnimation","nullAnimation","propertyName","aliased","candidate","document","documentElement","style","element","parseColor","string","trim","context","fillStyle","contextSerializedFillStyle","fillRect","pixelColor","getImageData","data","clearRect","alpha","mergeColors","clamp","v","max","min","round","numberToString","join","canvas","createElement","width","height","getContext","parseDimension","unitRegExp","toLowerCase","search","px","test","replace","matchedUnits","match","taggedUnitRegExp","source","typeCheck","reductions","unit","result","eval","mergeDimensions","units","values","lengthUnits","parseLength","bind","parseLengthOrPercent","parseAngle","window","Element","prototype","animate","timeline","_play","getAnimationPlayers","player","_source","interpolate","from","to","r","convertToString","toFixed","parseNumber","mergeNumbers","clampedMergeNumbers","sequenceNumber","AnimationPlayerEvent","currentTime","timelineTime","type","bubbles","cancelable","currentTarget","defaultPrevented","eventPhase","Event","AT_TARGET","timeStamp","Date","now","Player","_sequenceNumber","_currentTime","_startTime","NaN","paused","_playbackRate","_inTimeline","_finishedFlag","onfinish","_finishHandlers","_inEffect","_ensureAlive","_players","_tickCurrentTime","newTime","ignoreLimit","finished",{"end":{"file":"src/player.js","comments_before":[],"nlb":false,"endpos":2054,"pos":2043,"col":8,"line":63,"value":"currentTime","type":"name"},"start":{"file":"src/player.js","comments_before":[],"nlb":false,"endpos":2054,"pos":2043,"col":8,"line":63,"value":"currentTime","type":"name"},"name":"currentTime"},"restart","isNaN","_timeline","invalidateEffects","play","pause","finish","cancel","reverse","addEventListener","handler","removeEventListener","index","splice","_fireEvents","baseTime","event","concat","setTimeout","call","_tick","processRafCallbacks","t","processing","rafCallbacks","tick","needsRetick","applyPendingEffects","comparePlayers","leftPlayer","rightPlayer","pendingEffects","hasRestartedThisFrame","ticking","updatingPlayers","newPendingClears","newPendingEffects","requestAnimationFrame","originalRequestAnimationFrame","AnimationTimeline","originalGetComputedStyle","getComputedStyle","defineProperty","configurable","enumerable","arguments","get","e","cast","pattern","contents","_","id","parseTransform","transformRegExp","prevLastIndex","functionName","functionData","transformFunctions","args","argTypes","parsedArgs","parsedArg","arg","A","s","Odeg","N","T","L","toUpperCase","n","Opx","lastIndex","typeTo2D","typeTo3D","mergeTransforms","flipResults","defaultValue","substr","leftResult","rightResult","types","leftType","rightType","leftArgs","rightArgs","leftFunctionData","rightFunctionData","stringConversions","merge","merged","tmp","list","stringifiedArgs","deg","rotate","rotatex","rotatey","rotatez","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","_isGroup","_player","_childPlayers","_callback","_onfinish","_register","_forEachChild","child","awaitStartTime","time","_removePlayers","wrapped","_wrapper","pop","AnimationSequence","groupChildDuration","node","KeyframeEffect","_frames","updatePendingGroups","updated","pendingGroups","shift","_updateChildren","getFrames","_effect","_internalPlayer","groupPlayer","children","childPlayer","AnimationGroup","ticker","tf","last","callback","_registered","register","callbacks","updating","originalAnimate","constructor","total"],"mappings":";;;;;;;;;;;;;;CAAC,SAASA,EAASC,GAASA,EAAO,QAAUD,CCc7C,IAAIE,MACAC,KACAC,KAGEC,EAAuB,MCL7B,SAAUC,EAAQC,EAAOC,GAKvB,QAASC,GAAqBC,EAAaC,GACzC,GAAIC,IACFC,MAAO,EACPC,SAAU,EACVC,KAAMJ,EAAW,OAAS,OAC1BK,eAAgB,EAChBC,WAAY,EACZC,SAAUP,EAAW,OAAS,EAC9BQ,aAAc,EACdC,UAAW,SACXC,OAAQ,SAsBV,OAnB0B,gBAAfX,GACTE,EAAOM,SAAWR,EACOY,SAAhBZ,GACTa,OAAOC,oBAAoBd,GAAae,QAAQ,SAASC,GACvD,GAA6B,QAAzBhB,EAAYgB,GAAqB,CACnC,GAA+B,gBA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