Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: third_party/polymer/v0_8/components-chromium/web-animations-js/web-animations-next-lite.min.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 !function(a,b){b["true"]=a;var c={},d={},e={},f=null;!function(a){function b(b,c ){var d={delay:0,endDelay:0,fill:c?"both":"none",iterationStart:0,iterations:1,d uration:c?"auto":0,playbackRate:1,direction:"normal",easing:"linear"};return"num ber"!=typeof b||isNaN(b)?void 0!==b&&Object.getOwnPropertyNames(b).forEach(funct ion(c){if("auto"!=b[c]){if(("number"==typeof d[c]||"duration"==c)&&("number"!=ty peof b[c]||isNaN(b[c])))return;if("fill"==c&&-1==p.indexOf(b[c]))return;if("dire ction"==c&&-1==q.indexOf(b[c]))return;if("playbackRate"==c&&1!==b[c]&&a.isDeprec ated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRa te instead."))return;d[c]=b[c]}}):d.duration=b,d}function c(a,c){var d=b(a,c);re turn d.easing=f(d.easing),d}function d(a,b,c,d){return 0>a||a>1||0>c||c>1?y:func tion(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 e(a,b){return function(c){if(c>=1)return 1;var d=1/a;return c+=b *d,c-c%d}}function f(a){var b=w.exec(a);if(b)return d.apply(this,b.slice(1).map( Number));var c=x.exec(a);if(c)return e(Number(c[1]),{start:r,middle:s,end:t}[c[2 ]]);var f=u[a];return f?f:y}function g(a){return Math.abs(h(a)/a.playbackRate)}f unction h(a){return a.duration*a.iterations}function i(a,b,c){return null==b?z:b <c.delay?A:b>=c.delay+a?B:C}function j(a,b,c,d,e){switch(d){case A:return"backwa rds"==b||"both"==b?0:null;case C:return c-e;case B:return"forwards"==b||"both"== b?a:null;case z:return null}}function k(a,b,c,d){return(d.playbackRate<0?b-a:b)* d.playbackRate+c}function l(a,b,c,d,e){return 1/0===c||c===-1/0||c-d==b&&e.itera tions&&(e.iterations+e.iterationStart)%1==0?a:c%a}function m(a,b,c,d){return 0== =c?0:b==a?d.iterationStart+d.iterations-1:Math.floor(c/a)}function n(a,b,c,d){va r e=a%2>=1,f="normal"==d.direction||d.direction==(e?"alternate-reverse":"alterna te"),g=f?c:b-c,h=g/b;return b*d.easing(h)}function o(a,b,c){var d=i(a,b,c),e=j(a ,c.fill,b,d,c.delay);if(null===e)return null;if(0===a)return d===A?0:1;var f=c.i terationStart*c.duration,g=k(a,e,f,c),o=l(c.duration,h(c),g,f,c),p=m(c.duration, o,g,c);return n(p,c.duration,o,c)/c.duration}var p="backwards|forwards|both|none ".split("|"),q="reverse|alternate|alternate-reverse".split("|"),r=1,s=.5,t=0,u={ ease:d(.25,.1,.25,1),"ease-in":d(.42,0,1,1),"ease-out":d(0,0,.58,1),"ease-in-out ":d(.42,0,.58,1),"step-start":e(1,r),"step-middle":e(1,s),"step-end":e(1,t)},v=" \\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",w=new RegExp("cubic-bezier\\("+v+","+v+","+v +","+v+"\\)"),x=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,y=function(a){re turn a},z=0,A=1,B=2,C=3;a.makeTiming=b,a.normalizeTimingInput=c,a.calculateActiv eDuration=g,a.calculateTimeFraction=o,a.calculatePhase=i,a.toTimingFunction=f}(c ,f),function(a){function b(a,b){return a in h?h[a][b]||b:b}function c(a,c,d){var g=e[a];if(g){f.style[a]=c;for(var h in g){var i=g[h],j=f.style[i];d[i]=b(i,j)}} else d[a]=b(a,c)}function d(b){function d(){var a=e.length;null==e[a-1].offset&& (e[a-1].offset=1),a>1&&null==e[0].offset&&(e[0].offset=0);for(var b=0,c=e[0].off set,d=1;a>d;d++){var f=e[d].offset;if(null!=f){for(var g=1;d-b>g;g++)e[b+g].offs et=c+(f-c)*g/(d-b);b=d,c=f}}}if(!Array.isArray(b)&&null!==b)throw new TypeError( "Keyframes must be null or an array of keyframes");if(null==b)return[];for(var e =b.map(function(b){var d={};for(var e in b){var f=b[e];if("offset"==e){if(null!= f&&(f=Number(f),!isFinite(f)))throw new TypeError("keyframe offsets must be numb ers.")}else{if("composite"==e)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"No tSupportedError",message:"add compositing is not supported"};f="easing"==e?a.toT imingFunction(f):""+f}c(e,f,d)}return void 0==d.offset&&(d.offset=null),void 0== d.easing&&(d.easing=a.toTimingFunction("linear")),d}),f=!0,g=-1/0,h=0;h<e.length ;h++){var i=e[h].offset;if(null!=i){if(g>i)throw{code:DOMException.INVALID_MODIF ICATION_ERR,name:"InvalidModificationError",message:"Keyframes are not loosely s orted by offset. Sort or specify offsets."};g=i}else f=!1}return e=e.filter(func tion(a){return a.offset>=0&&a.offset<=1}),f||d(),e}var e={background:["backgroun dImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAtta chment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTo pColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle", "borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth"," borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBotto mWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor"," borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeft Width","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius", "borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borde rRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["bo rderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth"," borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexS hrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fon tWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginL eft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTo p","paddingRight","paddingBottom","paddingLeft"]},f=document.createElementNS("ht tp://www.w3.org/1999/xhtml","div"),g={thin:"1px",medium:"3px",thick:"5px"},h={bo rderBottomWidth:g,borderLeftWidth:g,borderRightWidth:g,borderTopWidth:g,fontSize :{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-lar ge":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth: g,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px t ransparent"}};a.normalizeKeyframes=d}(c,f),function(a){var b={};a.isDeprecated=f unction(a,c,d,e){var f=e?"are":"is",g=new Date,h=new Date(c);return h.setMonth(h .getMonth()+3),h>g?(a in b||console.warn("Web Animations: "+a+" "+f+" deprecated and will stop working on "+h.toDateString()+". "+d),b[a]=!0,!1):!0},a.deprecate d=function(b,c,d,e){var f=e?"are":"is";if(a.isDeprecated(b,c,d,e))throw new Erro r(b+" "+f+" no longer supported. "+d)}}(c),function(){if(document.documentElemen t.animate){var a=document.documentElement.animate([],0),b=!0;if(a&&(b=!1,"play|c urrentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split(" |").forEach(function(c){void 0===a[c]&&(b=!0)})),!b)return}!function(a,b){functi on c(a){for(var b={},c=0;c<a.length;c++)for(var d in a[c])if("offset"!=d&&"easin g"!=d&&"composite"!=d){var e={offset:a[c].offset,easing:a[c].easing,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{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupported Error",message:"Partial keyframes are not supported"}}return b}function d(a){var c=[];for(var d in a)for(var e=a[d],f=0;f<e.length-1;f++){var g=e[f].offset,h=e[ f+1].offset,i=e[f].value,j=e[f+1].value;g==h&&(1==h?i=j:j=i),c.push({startTime:g ,endTime:h,easing:e[f].easing,property:d,interpolation:b.propertyInterpolation(d ,i,j)})}return c.sort(function(a,b){return a.startTime-b.startTime}),c}b.convert EffectInput=function(e){var f=a.normalizeKeyframes(e),g=c(f),h=d(g);return funct ion(a,c){if(null!=c)h.filter(function(a){return 0>=c&&0==a.startTime||c>=1&&1==a .endTime||c>=a.startTime&&c<=a.endTime}).forEach(function(d){var e=c-d.startTime ,f=d.endTime-d.startTime,g=0==f?0:d.easing(e/f);b.apply(a,d.property,d.interpola tion(g))});else for(var d in g)"offset"!=d&&"easing"!=d&&"composite"!=d&&b.clear (a,d)}}}(c,d,f),function(a){function b(a,b,c){e[c]=e[c]||[],e[c].push([a,b])}fun ction c(a,c,d){for(var e=0;e<d.length;e++){var f=d[e];b(a,c,f),/-/.test(f)&&b(a, c,f.replace(/-(.)/g,function(a,b){return b.toUpperCase()}))}}function d(b,c,d){f or(var f=c==d?[]:e[b],g=0;f&&g<f.length;g++){var h=f[g][0](c),i=f[g][0](d);if(vo id 0!==h&&void 0!==i){var j=f[g][1](h,i);if(j){var k=a.Interpolation.apply(null, j);return function(a){return 0==a?c:1==a?d:k(a)}}}}return a.Interpolation(!1,!0, function(a){return a?d:c})}var e={};a.addPropertiesHandler=c,a.propertyInterpola tion=d}(d,f),function(a,b){function c(b){var c=a.calculateActiveDuration(b),d=fu nction(d){return a.calculateTimeFraction(c,d,b)};return d._totalDuration=b.delay +c+b.endDelay,d._isCurrent=function(d){var e=a.calculatePhase(c,d,b);return e=== PhaseActive||e===PhaseBefore},d}b.KeyframeEffect=function(d,e,f){var g,h=c(a.nor malizeTimingInput(f)),i=b.convertEffectInput(e),j=function(){i(d,g)};return j._u pdate=function(a){return g=h(a),null!==g},j._clear=function(){i(d,null)},j._hasS ameTarget=function(a){return d===a},j._isCurrent=h._isCurrent,j._totalDuration=h ._totalDuration,j},b.NullEffect=function(a){var b=function(){a&&(a(),a=null)};re turn b._update=function(){return null},b._totalDuration=0,b._isCurrent=function( ){return!1},b._hasSameTarget=function(){return!1},b}}(c,d,f),function(a){a.apply =function(b,c,d){b.style[a.propertyName(c)]=d},a.clear=function(b,c){b.style[a.p ropertyName(c)]=""}}(d,f),function(a){window.Element.prototype.animate=function( b,c){return a.timeline._play(a.KeyframeEffect(this,b,c))}}(d),function(a){functi on b(a,c,d){if("number"==typeof a&&"number"==typeof c)return a*(1-d)+c*d;if("boo lean"==typeof a&&"boolean"==typeof c)return.5>d?a:c;if(a.length==c.length){for(v ar e=[],f=0;f<a.length;f++)e.push(b(a[f],c[f],d));return e}throw"Mismatched inte rpolation arguments "+a+":"+c}a.Interpolation=function(a,c,d){return function(e) {return d(b(a,c,e))}}}(d,f),function(a){var b=0,c=function(a,b,c){this.target=a, this.currentTime=b,this.timelineTime=c,this.type="finish",this.bubbles=!1,this.c ancelable=!1,this.currentTarget=a,this.defaultPrevented=!1,this.eventPhase=Event .AT_TARGET,this.timeStamp=Date.now()};a.Animation=function(a){this._sequenceNumb er=b++,this._currentTime=0,this._startTime=null,this.paused=!1,this._playbackRat e=1,this._inTimeline=!0,this._finishedFlag=!1,this.onfinish=null,this._finishHan dlers=[],this._effect=a,this._inEffect=this._effect._update(0),this._idle=!0,thi s._currentTimePending=!1},a.Animation.prototype={_ensureAlive:function(){this._i nEffect=this._effect._update(this.playbackRate<0&&0===this.currentTime?-1:this.c urrentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTime line=!0,a.timeline._animations.push(this))},_tickCurrentTime:function(a,b){a!=th is._currentTime&&(this._currentTime=a,this.finished&&!b&&(this._currentTime=this ._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){ return this._idle||this._currentTimePending?null:this._currentTime},set currentT ime(b){b=+b,isNaN(b)||(a.restart(),this.paused||null==this._startTime||(this._st artTime=this._timeline.currentTime-b/this._playbackRate),this._currentTimePendin g=!1,this._currentTime!=b&&(this._tickCurrentTime(b,!0),a.invalidateEffects()))} ,get startTime(){return this._startTime},set startTime(b){b=+b,isNaN(b)||this.pa used||this._idle||(this._startTime=b,this._tickCurrentTime((this._timeline.curre ntTime-this._startTime)*this.playbackRate),a.invalidateEffects())},get playbackR ate(){return this._playbackRate},set playbackRate(a){if(a!=this._playbackRate){v ar b=this.currentTime;this._playbackRate=a,this._startTime=null,"paused"!=this.p layState&&"idle"!=this.playState&&this.play(),null!=b&&(this.currentTime=b)}},ge t finished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._ totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration() {return this._effect._totalDuration},get playState(){return this._idle?"idle":nu ll==this._startTime&&!this.paused&&0!=this.playbackRate||this._currentTimePendin g?"pending":this.paused?"paused":this.finished?"finished":"running"},play:functi on(){this.paused=!1,(this.finished||this._idle)&&(this._currentTime=this._playba ckRate>0?0:this._totalDuration,this._startTime=null,a.invalidateEffects()),this. _finishedFlag=!1,a.restart(),this._idle=!1,this._ensureAlive()},pause:function() {this.finished||this.paused||this._idle||(this._currentTimePending=!0),this._sta rtTime=null,this.paused=!0},finish:function(){this._idle||(this.currentTime=this ._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this. currentTime,this._currentTimePending=!1)},cancel:function(){this._inEffect=!1,th is._idle=!0,this.currentTime=0,this._startTime=null},reverse:function(){this.pla ybackRate*=-1,this.play()},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.sp lice(c,1)}},_fireEvents:function(a){var b=this.finished;if((b||this._idle)&&!thi s._finishedFlag){var d=new c(this,this._currentTime,a),e=this._finishHandlers.co ncat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){e.forEach(function( a){a.call(d.target,d)})},0)}this._finishedFlag=b},_tick:function(a){return this. _idle||this.paused||(null==this._startTime?this.startTime=a-this._currentTime/th is.playbackRate:this.finished||this._tickCurrentTime((a-this._startTime)*this.pl aybackRate)),this._currentTimePending=!1,this._fireEvents(a),!this._idle&&(this. _inEffect||!this._finishedFlag)}}}(d,f),function(a,b){function c(a){var b=i;i=[] ,g(a),b.forEach(function(b){b[1](a)}),m&&g(a),f()}function d(a,b){return a._sequ enceNumber-b._sequenceNumber}function e(){this._animations=[],this.currentTime=w indow.performance&&performance.now?performance.now():0}function f(){n.forEach(fu nction(a){a()}),n.length=0}function g(a){l=!1;var c=b.timeline;c.currentTime=a,c ._animations.sort(d),k=!1;var e=c._animations;c._animations=[];var f=[],g=[];e=e .filter(function(b){return b._inTimeline=b._tick(a),b._inEffect?g.push(b._effect ):f.push(b._effect),b.finished||b.paused||b._idle||(k=!0),b._inTimeline}),n.push .apply(n,f),n.push.apply(n,g),c._animations.push.apply(c._animations,e),m=!1,k&& requestAnimationFrame(function(){})}var h=window.requestAnimationFrame,i=[],j=0; window.requestAnimationFrame=function(a){var b=j++;return 0==i.length&&h(c),i.pu sh([b,a]),b},window.cancelAnimationFrame=function(a){i.forEach(function(b){b[0]= =a&&(b[1]=function(){})})},e.prototype={_play:function(c){c._timing=a.normalizeT imingInput(c.timing);var d=new b.Animation(c);return d._idle=!1,d._timeline=this ,this._animations.push(d),b.restart(),b.invalidateEffects(),d}};var k=!1,l=!1;b. restart=function(){return k||(k=!0,requestAnimationFrame(function(){}),l=!0),l}; var m=!1;b.invalidateEffects=function(){m=!0};var n=[],o=window.getComputedStyle ;Object.defineProperty(window,"getComputedStyle",{configurable:!0,enumerable:!0, value:function(){return m&&g(p.currentTime),f(),o.apply(this,arguments)}});var p =new e;b.timeline=p}(c,d,f),function(a){function b(a,b){var c=a.exec(b);return c ?(c=a.ignoreCase?c[0].toLowerCase():c[0],[c,b.substr(c.length)]):void 0}function c(a,b){b=b.replace(/^\s*/,"");var c=a(b);return c?[c[0],c[1].replace(/^\s*/,"") ]:void 0}function d(a,d,e){a=c.bind(null,a);for(var f=[];;){var g=a(e);if(!g)ret urn[f,e];if(f.push(g[0]),e=g[1],g=b(d,e),!g||""==g[1])return[f,e];e=g[1]}}functi on e(a,b){for(var c=0,d=0;d<b.length&&(!/\s|,/.test(b[d])||0!=c);d++)if("("==b[d ])c++;else if(")"==b[d]&&(c--,0==c&&d++,0>=c))break;var e=a(b.substr(0,d));retur n void 0==e?void 0:[e,b.substr(d)]}function f(a,b){for(var c=a,d=b;c&&d;)c>d?c%= d:d%=c;return c=a*b/(c+d)}function g(a){return function(b){var c=a(b);return c&& (c[0]=void 0),c}}function h(a,b){return function(c){var d=a(c);return d?d:[b,c]} }function i(b,c){for(var d=[],e=0;e<b.length;e++){var f=a.consumeTrimmed(b[e],c) ;if(!f||""==f[0])return;void 0!==f[0]&&d.push(f[0]),c=f[1]}return""==c?d:void 0} function j(a,b,c,d,e){for(var g=[],h=[],i=[],j=f(d.length,e.length),k=0;j>k;k++) {var l=b(d[k%d.length],e[k%e.length]);if(!l)return;g.push(l[0]),h.push(l[1]),i.p ush(l[2])}return[g,h,function(b){var d=b.map(function(a,b){return i[b](a)}).join (c);return a?a(d):d}]}function k(a,b,c){for(var d=[],e=[],f=[],g=0,h=0;h<c.lengt h;h++)if("function"==typeof c[h]){var i=c[h](a[g],b[g++]);d.push(i[0]),e.push(i[ 1]),f.push(i[2])}else!function(a){d.push(!1),e.push(!1),f.push(function(){return c[a]})}(h);return[d,e,function(a){for(var b="",c=0;c<a.length;c++)b+=f[c](a[c]) ;return b}]}a.consumeToken=b,a.consumeTrimmed=c,a.consumeRepeated=d,a.consumePar enthesised=e,a.ignore=g,a.optional=h,a.consumeList=i,a.mergeNestedRepeated=j.bin d(null,null),a.mergeWrappedNestedRepeated=j,a.mergeList=k}(d),function(a){functi on b(b){function c(b){var c=a.consumeToken(/^inset/i,b);if(c)return d.inset=!0,c ;var c=a.consumeLengthOrPercent(b);if(c)return d.lengths.push(c[0]),c;var c=a.co nsumeColor(b);return c?(d.color=c[0],c):void 0}var d={inset:!1,lengths:[],color: null},e=a.consumeRepeated(c,/^/,b);return e&&e[0].length?[d,e[1]]:void 0}functio n c(c){var d=a.consumeRepeated(b,/^,/,c);return d&&""==d[1]?d[0]:void 0}function d(b,c){for(;b.lengths.length<Math.max(b.lengths.length,c.lengths.length);)b.len gths.push({px:0});for(;c.lengths.length<Math.max(b.lengths.length,c.lengths.leng th);)c.lengths.push({px:0});if(b.inset==c.inset&&!!b.color==!!c.color){for(var d ,e=[],f=[[],0],g=[[],0],h=0;h<b.lengths.length;h++){var i=a.mergeDimensions(b.le ngths[h],c.lengths[h],2==h);f[0].push(i[0]),g[0].push(i[1]),e.push(i[2])}if(b.co lor&&c.color){var j=a.mergeColors(b.color,c.color);f[1]=j[0],g[1]=j[1],d=j[2]}re turn[f,g,function(a){for(var c=b.inset?"inset ":" ",f=0;f<e.length;f++)c+=e[f](a [0][f])+" ";return d&&(c+=d(a[1])),c}]}}function e(b,c,d,e){function f(a){return {inset:a,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var g=[],h=[ ],i=0;i<d.length||i<e.length;i++){var j=d[i]||f(e[i].inset),k=e[i]||f(d[i].inset );g.push(j),h.push(k)}return a.mergeNestedRepeated(b,c,g,h)}var f=e.bind(null,d, ", ");a.addPropertiesHandler(c,f,["box-shadow","text-shadow"])}(d),function(a){f unction b(a){return a.toFixed(3).replace(".000","")}function c(a,b,c){return Mat h.min(b,Math.max(a,c))}function d(a){return/^\s*[-+]?(\d*\.)?\d+\s*$/.test(a)?Nu mber(a):void 0}function e(a,c){return[a,c,b]}function f(a,b){return 0!=a?h(0,1/0 )(a,b):void 0}function g(a,b){return[a,b,function(a){return Math.round(c(1,1/0,a ))}]}function h(a,d){return function(e,f){return[e,f,function(e){return b(c(a,d, e))}]}}function i(a,b){return[a,b,Math.round]}a.clamp=c,a.addPropertiesHandler(d ,h(0,1/0),["border-image-width","line-height"]),a.addPropertiesHandler(d,h(0,1), ["opacity","shape-image-threshold"]),a.addPropertiesHandler(d,f,["flex-grow","fl ex-shrink"]),a.addPropertiesHandler(d,g,["orphans","widows"]),a.addPropertiesHan dler(d,i,["z-index"]),a.parseNumber=d,a.mergeNumbers=e,a.numberToString=b}(d,f), function(a){function b(a,b){return"visible"==a||"visible"==b?[0,1,function(c){re turn 0>=c?a:c>=1?b:"visible"}]:void 0}a.addPropertiesHandler(String,b,["visibili ty"])}(d),function(a){function b(a){a=a.trim(),e.fillStyle="#000",e.fillStyle=a; var b=e.fillStyle;if(e.fillStyle="#fff",e.fillStyle=a,b==e.fillStyle){e.fillRect (0,0,1,1);var c=e.getImageData(0,0,1,1).data;e.clearRect(0,0,1,1);var d=c[3]/255 ;return[c[0]*d,c[1]*d,c[2]*d,d]}}function c(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.r ound(c(b[d]/b[3]));return b[3]=a.numberToString(a.clamp(0,1,b[3])),"rgba("+b.joi n(",")+")"}]}var d=document.createElementNS("http://www.w3.org/1999/xhtml","canv as");d.width=d.height=1;var e=d.getContext("2d");a.addPropertiesHandler(b,c,["ba ckground-color","border-bottom-color","border-left-color","border-right-color"," border-top-color","color","outline-color","text-decoration-color"]),a.consumeCol or=a.consumeParenthesised.bind(null,b),a.mergeColors=c}(d,f),function(a,b){funct ion 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,func tion(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").re place(/\s/g,""),f=[/N\*(D)/g,/(N|D)[*/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],g=0;g<f.len gth;)f[g].test(e)?(e=e.replace(f[g],"$1"),g=0):g++;if("D"==e){for(var h in c){va r 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(a,b){return e(a,b,!0)}function e(b,c,d){var e,f=[];for(e in b)f.push(e);for(e in c)f.indexOf(e)<0&&f.push(e);r eturn b=f.map(function(a){return b[a]||0}),c=f.map(function(a){return c[a]||0}), [b,c,function(b){var c=b.map(function(c,e){return 1==b.length&&d&&(c=Math.max(c, 0)),a.numberToString(c)+f[e]}).join(" + ");return b.length>1?"calc("+c+")":c}]}v ar f="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",g=c.bind(null,new RegExp(f ,"g")),h=c.bind(null,new RegExp(f+"|%","g")),i=c.bind(null,/deg|rad|grad|turn/g) ;a.parseLength=g,a.parseLengthOrPercent=h,a.consumeLengthOrPercent=a.consumePare nthesised.bind(null,h),a.parseAngle=i,a.mergeDimensions=e;var j=a.consumeParenth esised.bind(null,g),k=a.consumeRepeated.bind(void 0,j,/^/),l=a.consumeRepeated.b ind(void 0,k,/^,/);a.consumeSizePairList=l;var m=function(a){var b=l(a);return b &&""==b[1]?b[0]:void 0},n=a.mergeNestedRepeated.bind(void 0,d," "),o=a.mergeNest edRepeated.bind(void 0,n,",");a.mergeNonNegativeSizePair=n,a.addPropertiesHandle r(m,o,["background-size"]),a.addPropertiesHandler(h,d,["border-bottom-width","bo rder-image-width","border-left-width","border-right-width","border-top-width","f lex-basis","font-size","height","line-height","max-height","max-width","outline- width","width"]),a.addPropertiesHandler(h,e,["border-bottom-left-radius","border -bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom ","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-t op","min-height","min-width","outline-offset","padding-bottom","padding-left","p adding-right","padding-top","perspective","right","shape-margin","text-indent"," top","vertical-align","word-spacing"])}(d,f),function(a){function b(b){return a. consumeLengthOrPercent(b)||a.consumeToken(/^auto/,b)}function c(c){var d=a.consu meList([a.ignore(a.consumeToken.bind(null,/^rect/)),a.ignore(a.consumeToken.bind (null,/^\(/)),a.consumeRepeated.bind(null,b,/^,/),a.ignore(a.consumeToken.bind(n ull,/^\)/))],c);return d&&4==d[0].length?d[0]:void 0}function d(b,c){return"auto "==b||"auto"==c?[!0,!1,function(d){var e=d?b:c;if("auto"==e)return"auto";var f=a .mergeDimensions(e,e);return f[2](f[0])}]:a.mergeDimensions(b,c)}function e(a){r eturn"rect("+a+")"}var f=a.mergeWrappedNestedRepeated.bind(null,e,d,", ");a.pars eBox=c,a.mergeBoxes=f,a.addPropertiesHandler(c,f,["clip"])}(d,f),function(a){fun ction b(a){return function(b){var c=0;return a.map(function(a){return a===j?b[c+ +]:a})}}function c(a){return a}function d(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=m[g];if(!h)return;var i=c[2].split (","),j=h[0];if(j.length<i.length)return;for(var n=[],o=0;o<j.length;o++){var p, q=i[o],r=j[o];if(p=q?{A:function(b){return"0"==b.trim()?l:a.parseAngle(b)},N:a.p arseNumber,T:a.parseLengthOrPercent,L:a.parseLength}[r.toUpperCase()](q):{a:l,n: n[0],t:k}[r],void 0===p)return;n.push(p)}if(e.push({t:g,d:n}),d.lastIndex==b.len gth)return e}}function e(a){return a.toFixed(6).replace(".000000","")}function f (b,c){if(b.decompositionPair!==c){b.decompositionPair=c;var d=a.makeMatrixDecomp osition(b)}if(c.decompositionPair!==b){c.decompositionPair=b;var f=a.makeMatrixD ecomposition(c)}return null==d[0]||null==f[0]?[[!1],[!0],function(a){return a?c[ 0].d:b[0].d}]:(d[0].push(0),f[0].push(1),[d,f,function(b){var c=a.quat(d[0][3],f [0][3],b[5]),g=a.composeMatrix(b[0],b[1],b[2],c,b[4]),h=g.map(e).join(",");retur n h}])}function g(a){return a.replace(/[xy]/,"")}function h(a){return a.replace( /(x|y|z|3d)?$/,"3d")}function i(b,c){var d=a.makeMatrixDecomposition&&!0,e=!1;if (!b.length||!c.length){b.length||(e=!0,b=c,c=[]);for(var i=0;i<b.length;i++){var j=b[i].t,k=b[i].d,l="scale"==j.substr(0,5)?1:0;c.push({t:j,d:k.map(function(a){ if("number"==typeof a)return l;var b={};for(var c in a)b[c]=l;return b})})}}var n=function(a,b){return"perspective"==a&&"perspective"==b||("matrix"==a||"matrix3 d"==a)&&("matrix"==b||"matrix3d"==b)},o=[],p=[],q=[];if(b.length!=c.length){if(! d)return;var r=f(b,c);o=[r[0]],p=[r[1]],q=[["matrix",[r[2]]]]}else for(var i=0;i <b.length;i++){var j,s=b[i].t,t=c[i].t,u=b[i].d,v=c[i].d,w=m[s],x=m[t];if(n(s,t) ){if(!d)return;var r=f([b[i]],[c[i]]);o.push(r[0]),p.push(r[1]),q.push(["matrix" ,[r[2]]])}else{if(s==t)j=s;else if(w[2]&&x[2]&&g(s)==g(t))j=g(s),u=w[2](u),v=x[2 ](v);else{if(!w[1]||!x[1]||h(s)!=h(t)){if(!d)return;var r=f(b,c);o=[r[0]],p=[r[1 ]],q=[["matrix",[r[2]]]];break}j=h(s),u=w[1](u),v=x[1](v)}for(var y=[],z=[],A=[] ,B=0;B<u.length;B++){var C="number"==typeof u[B]?a.mergeNumbers:a.mergeDimension s,r=C(u[B],v[B]);y[B]=r[0],z[B]=r[1],A.push(r[2])}o.push(y),p.push(z),q.push([j, A])}}if(e){var D=o;o=p,p=D}return[o,p,function(a){return a.map(function(a,b){var c=a.map(function(a,c){return q[b][1][c](a)}).join(",");return"matrix"==q[b][0]& &16==c.split(",").length&&(q[b][0]="matrix3d"),q[b][0]+"("+c+")"}).join(" ")}]}v ar j=null,k={px:0},l={deg:0},m={matrix:["NNNNNN",[j,j,0,0,j,j,0,0,0,0,1,0,j,j,0, 1],c],matrix3d:["NNNNNNNNNNNNNNNN",c],rotate:["A"],rotatex:["A"],rotatey:["A"],r otatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",b([j,j,1]),c],scale x:["N",b([j,1,1]),b([j,1])],scaley:["N",b([1,j,1]),b([1,j])],scalez:["N",b([1,1, j])],scale3d:["NNN",c],skew:["Aa",null,c],skewx:["A",null,b([j,l])],skewy:["A",n ull,b([l,j])],translate:["Tt",b([j,j,k]),c],translatex:["T",b([j,k,k]),b([j,k])] ,translatey:["T",b([k,j,k]),b([k,j])],translatez:["L",b([k,k,j])],translate3d:[" TTL",c]};a.addPropertiesHandler(d,i,["transform"])}(d,f),function(a){function b( a,b){b.concat([a]).forEach(function(b){b in document.documentElement.style&&(c[a ]=b)})}var c={};b("transform",["webkitTransform","msTransform"]),b("transformOri gin",["webkitTransformOrigin"]),b("perspective",["webkitPerspective"]),b("perspe ctiveOrigin",["webkitPerspectiveOrigin"]),a.propertyName=function(a){return c[a] ||a}}(d,f)}(),!function(a,b){function c(a){var b=window.document.timeline;b.curr entTime=a,b._discardAnimations(),0==b._animations.length?d=!1:requestAnimationFr ame(c)}b.AnimationTimeline=function(){this._animations=[],this.currentTime=void 0},b.AnimationTimeline.prototype={getAnimations:function(){return this._discardA nimations(),this._animations.slice()},getAnimationPlayers:function(){return a.de precated("AnimationTimeline.getAnimationPlayers","2015-03-23","Use AnimationTime line.getAnimations instead."),this.getAnimations()},_discardAnimations:function( ){this._animations=this._animations.filter(function(a){return"finished"!=a.playS tate&&"idle"!=a.playState})},play:function(a){var c=new b.Animation(a);return th is._animations.push(c),b.restartWebAnimationsNextTick(),c._animation.play(),c}}; var d=!1;b.restartWebAnimationsNextTick=function(){d||(d=!0,requestAnimationFram e(c))};var e=new b.AnimationTimeline;b.timeline=e;try{Object.defineProperty(wind ow.document,"timeline",{configurable:!0,get:function(){return e}})}catch(f){}try {window.document.timeline=e}catch(f){}}(c,e,f),function(a,b){b.Animation=functio n(a){this.effect=a,a&&(a.animation=this),this._isGroup=!1,this._animation=null,t his._childAnimations=[],this._callback=null,this._rebuildUnderlyingAnimation(),t his._animation.cancel()},b.Animation.prototype={_rebuildUnderlyingAnimation:func tion(){this._animation&&(this._animation.cancel(),this._animation=null),(!this.e ffect||this.effect instanceof window.KeyframeEffect)&&(this._animation=b.newUnde rlyingAnimationForKeyframeEffect(this.effect),b.bindAnimationForKeyframeEffect(t his)),(this.effect instanceof window.SequenceEffect||this.effect instanceof wind ow.GroupEffect)&&(this._animation=b.newUnderlyingAnimationForGroup(this.effect), b.bindAnimationForGroup(this))},_updateChildren:function(){if(this.effect&&"idle "!=this.playState){var a=this.effect._timing.delay;this._childAnimations.forEach (function(c){this._arrangeChildren(c,a),this.effect instanceof window.SequenceEf fect&&(a+=b.groupChildDuration(c.effect))}.bind(this))}},_setExternalAnimation:f unction(a){if(this.effect&&this._isGroup)for(var b=0;b<this.effect.children.leng th;b++)this.effect.children[b].animation=a,this._childAnimations[b]._setExternal Animation(a)},_constructChildren:function(){if(this.effect&&this._isGroup){var a =this.effect._timing.delay;this.effect.children.forEach(function(c){var d=window .document.timeline.play(c);this._childAnimations.push(d),d.playbackRate=this.pla ybackRate,this.paused&&d.pause(),c.animation=this.effect.animation,this._arrange Children(d,a),this.effect instanceof window.SequenceEffect&&(a+=b.groupChildDura tion(c))}.bind(this))}},_arrangeChildren:function(a,b){null===this.startTime?(a. currentTime=this.currentTime-b/this.playbackRate,a._startTime=null):a.startTime! ==this.startTime+b/this.playbackRate&&(a.startTime=this.startTime+b/this.playbac kRate)},get paused(){return this._animation.paused},get playState(){return this. _animation.playState},get onfinish(){return this._onfinish},set onfinish(a){"fun ction"==typeof a?(this._onfinish=a,this._animation.onfinish=function(b){b.target =this,a.call(this,b)}.bind(this)):(this._animation.onfinish=a,this.onfinish=this ._animation.onfinish)},get currentTime(){return this._animation.currentTime},set currentTime(a){this._animation.currentTime=a,this._register(),this._forEachChil d(function(b,c){b.currentTime=a-c})},get startTime(){return this._animation.star tTime},set startTime(a){this._animation.startTime=a,this._register(),this._forEa chChild(function(b,c){b.startTime=a+c})},get playbackRate(){return this._animati on.playbackRate},set playbackRate(a){var b=this.currentTime;this._animation.play backRate=a,this._forEachChild(function(b){b.playbackRate=a}),"paused"!=this.play State&&"idle"!=this.playState&&this.play(),null!==b&&(this.currentTime=b)},get f inished(){return this._animation.finished},get source(){return a.deprecated("Ani mation.source","2015-03-23","Use Animation.effect instead."),this.effect},play:f unction(){this._animation.play(),this._register(),b.awaitStartTime(this),this._f orEachChild(function(a){var b=a.currentTime;a.play(),a.currentTime=b})},pause:fu nction(){this._animation.pause(),this._register(),this._forEachChild(function(a) {a.pause()})},finish:function(){this._animation.finish(),this._register()},cance l:function(){this._animation.cancel(),this._register(),this._removeChildren()},r everse:function(){var a=this.currentTime;this._animation.reverse(),this._forEach Child(function(a){a.reverse()}),null!==a&&(this.currentTime=a)},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._animation.addEventListener(a,c)},remove EventListener:function(a,b){this._animation.removeEventListener(a,b&&b._wrapper| |b)},_removeChildren:function(){for(;this._childAnimations.length;)this._childAn imations.pop().cancel()},_forEachChild:function(b){var c=0;if(this.effect.childr en&&this._childAnimations.length<this.effect.children.length&&this._constructChi ldren(),this._childAnimations.forEach(function(a){b.call(this,a,c),this.effect i nstanceof window.SequenceEffect&&(c+=a.effect.activeDuration)}.bind(this)),"pend ing"!=this._animation.playState){var d=this.effect._timing,e=this._animation.cur rentTime;null!==e&&(e=a.calculateTimeFraction(a.calculateActiveDuration(d),e,d)) ,(null==e||isNaN(e))&&this._removeChildren()}}}}(c,e,f),function(a,b){function c (b){this._frames=a.normalizeKeyframes(b)}function d(){for(var a=!1;g.length;)g.s hift()._updateChildren(),a=!0;return a}b.KeyframeEffect=function(b,d,e){return t his.target=b,this._timingInput=e,this._timing=a.normalizeTimingInput(e),this.tim ing=a.makeTiming(e),this._normalizedKeyframes="function"==typeof d?d:new c(d),th is._keyframes=d,this.activeDuration=a.calculateActiveDuration(this._timing),this
16 },b.KeyframeEffect.prototype={getFrames:function(){return"function"==typeof this ._normalizedKeyframes?this._normalizedKeyframes:this._normalizedKeyframes._frame s},get effect(){return a.deprecated("KeyframeEffect.effect","2015-03-23","Use Ke yframeEffect.getFrames() instead."),this._normalizedKeyframes}};var e=Element.pr ototype.animate;Element.prototype.animate=function(a,c){return b.timeline.play(n ew b.KeyframeEffect(this,a,c))};var f=document.createElementNS("http://www.w3.or g/1999/xhtml","div");b.newUnderlyingAnimationForKeyframeEffect=function(a){var b =a.target||f,c=a._keyframes;return"function"==typeof c&&(c=[]),e.apply(b,[c,a._t imingInput])},b.bindAnimationForKeyframeEffect=function(a){a.effect&&"function"= =typeof a.effect._normalizedKeyframes&&b.bindAnimationForCustomEffect(a)};var g= [];b.awaitStartTime=function(a){null===a.startTime&&a._isGroup&&(0==g.length&&re questAnimationFrame(d),g.push(a))};var h=window.getComputedStyle;Object.definePr operty(window,"getComputedStyle",{configurable:!0,enumerable:!0,value:function() {var a=h.apply(this,arguments);return d()&&(a=h.apply(this,arguments)),a}}),wind ow.KeyframeEffect=b.KeyframeEffect,window.Element.prototype.getAnimations=functi on(){return document.timeline.getAnimations().filter(function(a){return null!==a .effect&&a.effect.target==this}.bind(this))},window.Element.prototype.getAnimati onPlayers=function(){return a.deprecated("Element.getAnimationPlayers","2015-03- 23","Use Element.getAnimations instead."),this.getAnimations()},window.Animation =function(){a.deprecated("window.Animation","2015-03-23","Use window.KeyframeEff ect instead."),window.KeyframeEffect.apply(this,arguments)},window.Animation.pro totype=Object.create(window.KeyframeEffect.prototype),window.Animation.prototype .constructor=window.Animation}(c,e,f),function(a,b){function c(a){a._registered| |(a._registered=!0,f.push(a),g||(g=!0,requestAnimationFrame(d)))}function d(){va r a=f;f=[],a.sort(function(a,b){return a._sequenceNumber-b._sequenceNumber}),a=a .filter(function(a){a();var b=a._animation?a._animation.playState:"idle";return" running"!=b&&"pending"!=b&&(a._registered=!1),a._registered}),f.push.apply(f,a), f.length?(g=!0,requestAnimationFrame(d)):g=!1}var e=(document.createElementNS("h ttp://www.w3.org/1999/xhtml","div"),0);b.bindAnimationForCustomEffect=function(b ){var d=b.effect.target,f=b.effect._normalizedKeyframes,g=b.effect.timing,h=null ;g=a.normalizeTimingInput(g);var i=function(){var c=i._animation?i._animation.cu rrentTime:null;null!==c&&(c=a.calculateTimeFraction(a.calculateActiveDuration(g) ,c,g),isNaN(c)&&(c=null)),c!==h&&f(c,d,b.effect),h=c};i._animation=b,i._register ed=!1,i._sequenceNumber=e++,b._callback=i,c(i)};var f=[],g=!1;b.Animation.protot ype._register=function(){this._callback&&c(this._callback)}}(c,e,f),function(a,b ){function c(a){return a._timing.delay+a.activeDuration+a._timing.endDelay}funct ion d(b,c){this.children=b||[],this._timing=a.normalizeTimingInput(c,!0),this.ti ming=a.makeTiming(c,!0),"auto"===this._timing.duration&&(this._timing.duration=t his.activeDuration)}window.SequenceEffect=function(){d.apply(this,arguments)},wi ndow.GroupEffect=function(){d.apply(this,arguments)},window.SequenceEffect.proto type={get activeDuration(){var a=0;return this.children.forEach(function(b){a+=c (b)}),Math.max(a,0)}},window.GroupEffect.prototype={get activeDuration(){var a=0 ;return this.children.forEach(function(b){a=Math.max(a,c(b))}),a}},b.newUnderlyi ngAnimationForGroup=function(c){var d,e=null,f=function(b){var c=d._wrapper;retu rn"pending"!=c.playState&&c.effect?null==b?void c._removeChildren():0==b&&c.play backRate<0&&(e||(e=a.normalizeTimingInput(c.effect.timing)),b=a.calculateTimeFra ction(a.calculateActiveDuration(e),-1,e),isNaN(b)||null==b)?(c._forEachChild(fun ction(a){a.currentTime=-1}),void c._removeChildren()):void 0:void 0};return d=b. timeline.play(new b.KeyframeEffect(null,f,c._timing))},b.bindAnimationForGroup=f unction(a){a._animation._wrapper=a,a._isGroup=!0,b.awaitStartTime(a),a._construc tChildren(),a._setExternalAnimation(a)},b.groupChildDuration=c,window.AnimationS equence=function(){a.deprecated("window.AnimationSequence","2015-03-23","Use win dow.SequenceEffect instead."),window.SequenceEffect.apply(this,arguments)},windo w.AnimationSequence.prototype=Object.create(window.SequenceEffect.prototype),win dow.AnimationSequence.prototype.constructor=window.AnimationSequence,window.Anim ationGroup=function(){a.deprecated("window.AnimationGroup","2015-03-23","Use win dow.GroupEffect instead."),window.GroupEffect.apply(this,arguments)},window.Anim ationGroup.prototype=Object.create(window.GroupEffect.prototype),window.Animatio nGroup.prototype.constructor=window.AnimationGroup}(c,e,f)}({},function(){return this}());
17 //# sourceMappingURL=web-animations-next-lite.min.js.map
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698