/* 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. Copyright 2016 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(){var G={},F={},L={};(function(y,v){function k(){this._endDelay=this._delay=0;this._fill="none";this._iterationStart=0;this._iterations=1;this._duration=0;this._playbackRate=1;this._direction="normal";this._easing="linear";this._easingFunction=n}function f(){return y.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function h(p,w,z){var A=new k;w&&(A.fill="both",A.duration="auto");typeof p!="number"||isNaN(p)?p!==void 0&&Object.getOwnPropertyNames(p).forEach(function(B){if(p[B]!= "auto"){if(typeof A[B]=="number"||B=="duration")if(typeof p[B]!="number"||isNaN(p[B]))return;B=="fill"&&e.indexOf(p[B])==-1||B=="direction"&&m.indexOf(p[B])==-1||B=="playbackRate"&&p[B]!==1&&y.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead.")||(A[B]=p[B])}}):A.duration=p;return A}function d(p,w,z,A){return p<0||p>1||z<0||z>1?n:function(B){if(B<=0){var D=0;p>0?D=w/p:!w&&z>0&&(D=A/z);return D*B}if(B>=1)return D=0,z<1?D=(A-1)/(z-1):z==1&&p<1&&(D=(w- 1)/(p-1)),1+D*(B-1);D=0;for(var H=1;D=1)return 1;var A=1/p;z+=w*A;return z-z%A}}function c(p){u||(u=document.createElement("div").style);u.animationTimingFunction="";u.animationTimingFunction=p;var w=u.animationTimingFunction;if(w==""&&f())throw new TypeError(p+" is not a valid value for easing");return w}function b(p){if(p== "linear")return n;var w=q.exec(p);return w?d.apply(this,w.slice(1).map(Number)):(w=C.exec(p))?a(Number(w[1]),{start:l,middle:r,end:t}[w[2]]):(p=x[p])?p:n}function g(p,w,z){if(w==null)return 0;var A=z.delay+p+z.endDelay;return w=Math.min(z.delay+p,A)?2:3}var e=["backwards","forwards","both","none"],m=["reverse","alternate","alternate-reverse"],n=function(p){return p};k.prototype={_setMember:function(p,w){this["_"+p]=w;this._effect&&(this._effect._timingInput[p]=w,this._effect._timing= y.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=y.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(p){this._setMember("delay",p)},get delay(){return this._delay},set endDelay(p){this._setMember("endDelay",p)},get endDelay(){return this._endDelay},set fill(p){this._setMember("fill",p)},get fill(){return this._fill},set iterationStart(p){if((isNaN(p)|| p<0)&&f())throw new TypeError("iterationStart must be a non-negative number, received: "+p);this._setMember("iterationStart",p)},get iterationStart(){return this._iterationStart},set duration(p){if(p!="auto"&&(isNaN(p)||p<0)&&f())throw new TypeError("duration must be non-negative or auto, received: "+p);this._setMember("duration",p)},get duration(){return this._duration},set direction(p){this._setMember("direction",p)},get direction(){return this._direction},set easing(p){this._easingFunction=b(c(p)); this._setMember("easing",p)},get easing(){return this._easing},set iterations(p){if((isNaN(p)||p<0)&&f())throw new TypeError("iterations must be non-negative, received: "+p);this._setMember("iterations",p)},get iterations(){return this._iterations}};var l=1,r=.5,t=0,x={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":a(1,l),"step-middle":a(1,r),"step-end":a(1,t)},u=null,q=RegExp("cubic-bezier\\(\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*,\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*,\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*,\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*\\)"), C=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;y.cloneTimingInput=function(p){if(typeof p=="number")return p;var w={},z;for(z in p)w[z]=p[z];return w};y.makeTiming=h;y.numericTimingToObject=function(p){typeof p=="number"&&(p=isNaN(p)?{duration:0}:{duration:p});return p};y.normalizeTimingInput=function(p,w){p=y.numericTimingToObject(p);return h(p,w)};y.calculateActiveDuration=function(p){var w=Math,z=w.abs;var A=p.duration===0||p.iterations===0?0:p.duration*p.iterations;return z.call(w,A/p.playbackRate)}; y.calculateIterationProgress=function(p,w,z){var A=g(p,w,z);a:{var B=z.fill;switch(A){case 1:p=B=="backwards"||B=="both"?0:null;break a;case 3:p=w-z.delay;break a;case 2:p=B=="forwards"||B=="both"?p:null;break a;case 0:p=null;break a}p=void 0}if(p===null)return null;w=z.duration;B=z.iterationStart;w===0?A!==1&&(B+=z.iterations):B+=p/w;w=B;B=w===Infinity?z.iterationStart%1:w%1;B!==0||A!==2||z.iterations===0||p===0&&z.duration!==0||(B=1);p=B;B=A===2&&z.iterations===Infinity?Infinity:p===1?Math.floor(w)- 1:Math.floor(w);w=A=z.direction;A!=="normal"&&A!=="reverse"&&(A==="alternate-reverse"&&(B+=1),w="normal",B!==Infinity&&B%2!==0&&(w="reverse"));return z._easingFunction(w==="normal"?p:1-p)};y.calculatePhase=g;y.normalizeEasing=c;y.parseEasingFunction=b})(G,null);(function(y,v){function k(a){var c=[],b;for(b in a)if(!(b in["easing","offset","composite"])){var g=a[b];Array.isArray(g)||(g=[g]);for(var e,m=g.length,n=0;n1&&b[0].offset==null&&(b[0].offset=0);for(var l=0,r=b[0].offset, t=1;t1)throw new TypeError("Keyframe offsets must be between 0 and 1.");}}else if(r== "composite"){if(t=="add"||t=="accumulate")throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if(t!="replace")throw new TypeError("Invalid composite mode "+t+".");}else t=r=="easing"?y.normalizeEasing(t):""+t;var x=void 0,u=r,q=t;t=l;var C=u;if(C!=="display"&&C.lastIndexOf("animation",0)!==0&&C.lastIndexOf("transition",0)!==0)if(C=f[u])for(x in h.style[u]=q,C){q=u=C[x];var p=h.style[u];t[u]=q in d?d[q][p]||p:p}else t[u]=u in d?d[u][q]||q: q}l.offset==void 0&&(l.offset=null);l.easing==void 0&&(l.easing="linear");return l});a=!0;for(var g=-Infinity,e=0;e=0&&n.offset<=1});a||c();return b}})(G,null);(function(y){var v={};y.isDeprecated=function(k,f,h,d){d=d?"are":"is";var a=new Date;f=new Date(f);f.setMonth(f.getMonth()+3);return a=l.applyFrom&& m0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(a){a=+a;isNaN(a)||(f.restart(),this._paused||this._startTime==null||(this._startTime=this._timeline.currentTime-a/this._playbackRate),this._currentTimePending=!1,this._currentTime!=a&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(a, !0),f.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(a){a=+a;isNaN(a)||this._paused||this._idle||(this._startTime=a,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),f.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(a){if(a!=this._playbackRate){var c=this.currentTime;this._playbackRate=a;this._startTime=null;this.playState!="paused"&&this.playState!="idle"&&(this._idle=this._finishedFlag= !1,this._ensureAlive(),f.applyDirtiedAnimation(this));c!=null&&(this.currentTime=c)}},get _isFinished(){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":this._startTime==null&&!this._paused&&this.playbackRate!=0||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>= 0)this._currentTime=0;else if(this._totalDuration0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,f.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),f.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*= -1;this.play()},addEventListener:function(a,c){typeof c=="function"&&a=="finish"&&this._finishHandlers.push(c)},removeEventListener:function(a,c){a=="finish"&&(a=this._finishHandlers.indexOf(c),a>=0&&this._finishHandlers.splice(a,1))},_fireEvents:function(a){if(this._isFinished){if(!this._finishedFlag){var c=new d(this,this._currentTime,a),b=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){b.forEach(function(g){g.call(c.target,c)})},0);this._finishedFlag=!0}}else this._finishedFlag= !1},_tick:function(a,c){this._idle||this._paused||(this._startTime==null?c&&(this.startTime=a-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((a-this._startTime)*this.playbackRate));c&&(this._currentTimePending=!1,this._fireEvents(a))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var a=this._effect._target;a._activeAnimations||(a._activeAnimations=[]);return a._activeAnimations},_markTarget:function(){var a= this._targetAnimations();a.indexOf(this)===-1&&a.push(this)},_unmarkTarget:function(){var a=this._targetAnimations(),c=a.indexOf(this);c!==-1&&a.splice(c,1)}}})(G,F,null);(function(k,f,h){function d(q){var C=m;m=[];qe?g%=e:e%=g;return c*b/(g+e)}function a(c,b, g,e,m){for(var n=[],l=[],r=[],t=d(e.length,m.length),x=0;x=1?d:"visible"}]},["visibility"])})(F);(function(k,f){function h(c){c=c.trim();a.fillStyle="#000";a.fillStyle=c;var b=a.fillStyle;a.fillStyle="#fff";a.fillStyle= c;if(b==a.fillStyle)return a.fillRect(0,0,1,1),c=a.getImageData(0,0,1,1).data,a.clearRect(0,0,1,1),b=c[3]/255,[c[0]*b,c[1]*b,c[2]*b,b]}function d(c,b){return[c,b,function(g){if(g[3])for(var e=0;e<3;e++)g[e]=Math.round(Math.max(0,Math.min(255,g[e]/g[3])));g[3]=k.numberToString(k.clamp(0,1,g[3]));return"rgba("+g.join(",")+")"}]}f=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");f.width=f.height=1;var a=f.getContext("2d");k.addPropertiesHandler(h,d,"background-color border-bottom-color border-left-color border-right-color border-top-color color fill flood-color lighting-color outline-color stop-color stroke text-decoration-color".split(" ")); k.consumeColor=k.consumeParenthesised.bind(null,h);k.mergeColors=d})(F,null);(function(k,f){function h(m){function n(){var q=x.exec(m);u=q?q[0]:void 0}function l(){if(u!=="("){var q=Number(u);n();return q}n();q=t();if(u!==")")return NaN;n();return q}function r(){for(var q=l();u==="*"||u==="/";){var C=u;n();var p=l();q=C==="*"?q*p:q/p}return q}function t(){for(var q=r();u==="+"||u==="-";){var C=u;n();var p=r();q=C==="+"?q+p:q-p}return q}var x=/([\+\-\w\.]+|[\(\)\*\/])/g,u;n();return t()}function d(m, n){n=n.trim().toLowerCase();if(n=="0"&&"px".search(m)>=0)return{px:0};if(/^[^(]*$|^calc/.test(n)){n=n.replace(/calc\(/g,"(");var l={};n=n.replace(m,function(q){l[q]=null;return"U"+q});m="U("+m.source+")";for(var r=n.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+m,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),t=[/N\*(D)/g,/(N|D)[*/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],x=0;x1?"calc("+u+")":u}]}var b=d.bind(null,RegExp("px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc", "g"));f=d.bind(null,RegExp("px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|%","g"));var g=d.bind(null,/deg|rad|grad|turn/g);k.parseLength=b;k.parseLengthOrPercent=f;k.consumeLengthOrPercent=k.consumeParenthesised.bind(null,f);k.parseAngle=g;k.mergeDimensions=c;b=k.consumeParenthesised.bind(null,b);b=k.consumeRepeated.bind(void 0,b,/^/);var e=k.consumeRepeated.bind(void 0,b,/^,/);k.consumeSizePairList=e;b=k.mergeNestedRepeated.bind(void 0,a," ");g=k.mergeNestedRepeated.bind(void 0,b,",");k.mergeNonNegativeSizePair= b;k.addPropertiesHandler(function(m){if((m=e(m))&&m[1]=="")return m[0]},g,["background-size"]);k.addPropertiesHandler(f,a,"border-bottom-width border-image-width border-left-width border-right-width border-top-width flex-basis font-size height line-height max-height max-width outline-width width".split(" "));k.addPropertiesHandler(f,c,"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-top min-height min-width outline-offset padding-bottom padding-left padding-right padding-top perspective right shape-margin stroke-dashoffset text-indent top vertical-align word-spacing".split(" "))})(F, null);(function(k,f){function h(a){return k.consumeLengthOrPercent(a)||k.consumeToken(/^auto/,a)}function d(a){if((a=k.consumeList([k.ignore(k.consumeToken.bind(null,/^rect/)),k.ignore(k.consumeToken.bind(null,/^\(/)),k.consumeRepeated.bind(null,h,/^,/),k.ignore(k.consumeToken.bind(null,/^\)/))],a))&&a[0].length==4)return a[0]}f=k.mergeWrappedNestedRepeated.bind(null,function(a){return"rect("+a+")"},function(a,c){return a=="auto"||c=="auto"?[!0,!1,function(b){b=b?a:c;if(b=="auto")return"auto";b=k.mergeDimensions(b, b);return b[2](b[0])}]:k.mergeDimensions(a,c)},", ");k.parseBox=d;k.mergeBoxes=f;k.addPropertiesHandler(d,f,["clip"])})(F,null);(function(k,f){function h(l){return function(r){var t=0;return l.map(function(x){return x===null?r[t++]:x})}}function d(l){return l}function a(l){l=l.toLowerCase().trim();if(l=="none")return[];for(var r=/\s*(\w+)\(([^)]*)\)/g,t=[],x,u=0;(x=r.exec(l))&&x.index==u;){u=x.index+x[0].length;var q=x[1],C=n[q];if(!C)break;x=x[2].split(",");C=C[0];if(C.length=0&&this._cancelHandlers.splice(b,1)):c.call(this,b,g)};return f}}})();(function(y){var v=document.documentElement,k=null,f=!1;try{var h=getComputedStyle(v).getPropertyValue("opacity")== "0"?"1":"0";k=v.animate({opacity:[h,h]},{duration:1});k.currentTime=0;f=getComputedStyle(v).getPropertyValue("opacity")==h}catch(a){}finally{k&&k.cancel()}if(!f){var d=window.Element.prototype.animate;window.Element.prototype.animate=function(a,c){window.Symbol&&Symbol.iterator&&Array.prototype.from&&a[Symbol.iterator]&&(a=Array.from(a));Array.isArray(a)||a===null||(a=y.convertToArrayForm(a));return d.call(this,a,c)}}})(G);(function(y,v,k){function f(c){var b=v.timeline;b.currentTime=c;b._discardAnimations(); b._animations.length==0?d=!1:requestAnimationFrame(f)}var h=window.requestAnimationFrame;window.requestAnimationFrame=function(c){return h(function(b){v.timeline._updateAnimationsPromises();c(b);v.timeline._updateAnimationsPromises()})};v.AnimationTimeline=function(){this._animations=[];this.currentTime=void 0};v.AnimationTimeline.prototype={getAnimations:function(){this._discardAnimations();return this._animations.slice()},_updateAnimationsPromises:function(){v.animationsWithPromises=v.animationsWithPromises.filter(function(c){return c._updatePromises()})}, _discardAnimations:function(){this._updateAnimationsPromises();this._animations=this._animations.filter(function(c){return c.playState!="finished"&&c.playState!="idle"})},_play:function(c){c=new v.Animation(c,this);this._animations.push(c);v.restartWebAnimationsNextTick();c._updatePromises();c._animation.play();c._updatePromises();return c},play:function(c){c&&c.remove();return this._play(c)}};var d=!1;v.restartWebAnimationsNextTick=function(){d||(d=!0,requestAnimationFrame(f))};var a=new v.AnimationTimeline; v.timeline=a;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return a}})}catch(c){}try{window.document.timeline=a}catch(c){}})(G,L,null);(function(y,v,k){v.animationsWithPromises=[];v.Animation=function(f,h){this.id="";f&&f._id&&(this.id=f._id);if(this.effect=f)f._animation=this;if(!h)throw Error("Animation with null timeline is not supported");this._timeline=h;this._sequenceNumber=y.sequenceNumber++;this._holdTime=0;this._isGroup=this._paused=!1;this._animation= null;this._childAnimations=[];this._callback=null;this._oldPlayState="idle";this._rebuildUnderlyingAnimation();this._animation.cancel();this._updatePromises()};v.Animation.prototype={_updatePromises:function(){var f=this._oldPlayState,h=this.playState;this._readyPromise&&h!==f&&(h=="idle"?(this._rejectReadyPromise(),this._readyPromise=void 0):f=="pending"?this._resolveReadyPromise():h=="pending"&&(this._readyPromise=void 0));this._finishedPromise&&h!==f&&(h=="idle"?(this._rejectFinishedPromise(), this._finishedPromise=void 0):h=="finished"?this._resolveFinishedPromise():f=="finished"&&(this._finishedPromise=void 0));this._oldPlayState=this.playState;return this._readyPromise||this._finishedPromise},_rebuildUnderlyingAnimation:function(){this._updatePromises();var f=this._animation?!0:!1;if(f){var h=this.playbackRate;var d=this._paused;var a=this.startTime;var c=this.currentTime;this._animation.cancel();this._animation=this._animation._wrapper=null}if(!this.effect||this.effect instanceof window.KeyframeEffect)this._animation= v.newUnderlyingAnimationForKeyframeEffect(this.effect),v.bindAnimationForKeyframeEffect(this);if(this.effect instanceof window.SequenceEffect||this.effect instanceof window.GroupEffect)this._animation=v.newUnderlyingAnimationForGroup(this.effect),v.bindAnimationForGroup(this);this.effect&&this.effect._onsample&&v.bindAnimationForCustomEffect(this);f&&(h!=1&&(this.playbackRate=h),a!==null?this.startTime=a:c!==null?this.currentTime=c:this._holdTime!==null&&(this.currentTime=this._holdTime),d&&this.pause()); this._updatePromises()},_updateChildren:function(){if(this.effect&&this.playState!="idle"){var f=this.effect._timing.delay;this._childAnimations.forEach(function(h){this._arrangeChildren(h,f);this.effect instanceof window.SequenceEffect&&(f+=v.groupChildDuration(h.effect))}.bind(this))}},_setExternalAnimation:function(f){if(this.effect&&this._isGroup)for(var h=0;h