Socket
Socket
Sign inDemoInstall

@antv/g-web-animations-api

Package Overview
Dependencies
Maintainers
64
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-web-animations-api - npm Package Compare versions

Comparing version 1.0.39 to 1.1.0-alpha.1

dist/index.esm.js.map

1

dist/dom/Animation.d.ts

@@ -135,2 +135,1 @@ import type { IAnimation } from '@antv/g-lite';

}
//# sourceMappingURL=Animation.d.ts.map

@@ -59,2 +59,1 @@ import type { KeyframeEffect } from './KeyframeEffect';

}
//# sourceMappingURL=AnimationEffectTiming.d.ts.map

@@ -12,2 +12,1 @@ import type { EventService } from '@antv/g-lite';

}
//# sourceMappingURL=AnimationEvent.d.ts.map

@@ -40,2 +40,1 @@ import type { IDocument, IAnimationTimeline, IElement, IAnimation } from '@antv/g-lite';

}
//# sourceMappingURL=AnimationTimeline.d.ts.map

@@ -6,2 +6,1 @@ export * from './Animation';

export * from './KeyframeList';
//# sourceMappingURL=index.d.ts.map

@@ -48,2 +48,1 @@ import { IElement, IKeyframeEffect } from '@antv/g-lite';

}
//# sourceMappingURL=KeyframeEffect.d.ts.map
import type { AnimationEffectTiming } from './AnimationEffectTiming';
export declare function normalizeKeyframes(effectInput: Keyframe[] | PropertyIndexedKeyframes | null, timing?: AnimationEffectTiming): ComputedKeyframe[];
//# sourceMappingURL=KeyframeList.d.ts.map
export * from './dom';
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,2 @@

!function(i,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],t):t(((i="undefined"!=typeof globalThis?globalThis:i||self).G=i.G||{},i.G.WebAnimationsAPI={}),i.window.G)}(this,(function(i,t){"use strict";function e(i,t){for(var e=0;t.length>e;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,(r=void 0,"symbol"==typeof(r=function(i,t){if("object"!=typeof i||null===i)return i;var e=i[Symbol.toPrimitive];if(void 0!==e){var n=e.call(i,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(i)}(n.key,"string"))?r:r+""),n)}var r}function n(i,t,n){return t&&e(i.prototype,t),n&&e(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}function r(i,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,t){return i.__proto__=t,i},r(i,t)}var s=function(i){var t,e;function n(t,e,n,r){var s;return(s=i.call(this,t)||this).currentTime=void 0,s.timelineTime=void 0,s.currentTime=n,s.timelineTime=r,s.target=e,s.type="finish",s.bubbles=!1,s.currentTarget=e,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=n,s.timelineTime=r,s}return(t=n).prototype=Object.create((e=i).prototype),t.prototype.constructor=t,r(t,e),n}(t.FederatedEvent),o=0,a=function(){function i(i,t){var e;this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=i,i.animation=this,this.timeline=t,this.id=""+o++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(e=this.effect)||void 0===e?void 0:e.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=i.prototype;return e.updatePromises=function(){var i=this.oldPlayState,t=this.pending?"pending":this.playState;return this.readyPromise&&t!==i&&("idle"===t?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===i?this.resolveReadyPromise():"pending"===t&&(this.readyPromise=void 0)),this.finishedPromise&&t!==i&&("idle"===t?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===t?this.resolveFinishedPromise():"finished"===i&&(this.finishedPromise=void 0)),this.oldPlayState=t,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){var i=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var t=new s(null,this,this.currentTime,null);setTimeout((function(){i.oncancel(t)}))}},e.reverse=function(){this.updatePromises();var i=this.currentTime;this.playbackRate*=-1,this.play(),null!==i&&(this.currentTime=i),this.updatePromises()},e.updatePlaybackRate=function(i){this.playbackRate=i},e.targetAnimations=function(){var i;return(null===(i=this.effect)||void 0===i?void 0:i.target).getAnimations()},e.markTarget=function(){var i=this.targetAnimations();-1===i.indexOf(this)&&i.push(this)},e.unmarkTarget=function(){var i=this.targetAnimations(),t=i.indexOf(this);-1!==t&&i.splice(t,1)},e.tick=function(i,t){this._idle||this._paused||(null===this._startTime?t&&(this.startTime=i-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((i-this._startTime)*this.playbackRate)),t&&(this.currentTimePending=!1,this.fireEvents(i))},e.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},e.persist=function(){throw Error(t.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},e.addEventListener=function(i,e,n){throw Error(t.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},e.removeEventListener=function(i,e,n){throw Error(t.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},e.dispatchEvent=function(i){throw Error(t.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},e.commitStyles=function(){throw Error(t.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},e.ensureAlive=function(){var i,t;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(i=this.effect)||void 0===i?void 0:i.update(-1)):this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(i,t){i!==this._currentTime&&(this._currentTime=i,this._isFinished&&!t&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(i){var t=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var e=new s(null,this,this.currentTime,i);setTimeout((function(){t.onfinish&&t.onfinish(e)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var n=new s(null,this,this.currentTime,i);this.onframe(n)}this._finishedFlag=!1}},n(i,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var i=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(t,e){i.resolveReadyPromise=function(){t(i)},i.rejectReadyPromise=function(){e(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var i=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(t,e){i.resolveFinishedPromise=function(){t(i)},i.rejectFinishedPromise=function(){e(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(i){if(!isNaN(i=Number(i))){var t;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(t=this.timeline)||void 0===t?void 0:t.currentTime)-i/this.playbackRate;this.currentTimePending=!1,this._currentTime!==i&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(i,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(i){if(null!==i){if(this.updatePromises(),isNaN(i=Number(i)))return;if(this._paused||this._idle)return;this._startTime=i,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(i){if(i!==this._playbackRate){this.updatePromises();var t=this.currentTime;this._playbackRate=i,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==t&&(this.currentTime=t),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),i}(),u=.1,h="function"==typeof Float32Array,f=function(i,t){return 1-3*t+3*i},c=function(i,t){return 3*t-6*i},m=function(i){return 3*i},l=function(i,t,e){return((f(t,e)*i+c(t,e))*i+m(t))*i},d=function(i,t,e){return 3*f(t,e)*i*i+2*c(t,e)*i+m(t)},p=function(i,t,e,n){if(0>i||i>1||0>e||e>1)throw Error("bezier x values must be in [0, 1] range");if(i===t&&e===n)return function(i){return i};for(var r=h?new Float32Array(11):[,,,,,,,,,,,],s=0;11>s;++s)r[s]=l(s*u,i,e);var o=function(t){for(var n=0,s=1;10!==s&&t>=r[s];++s)n+=u;--s;var o=n+(t-r[s])/(r[s+1]-r[s])*u,a=d(o,i,e);return.001>a?0===a?o:function(i,t,e,n,r){var s,o,a=0;do{(s=l(o=t+(e-t)/2,n,r)-i)>0?e=o:t=o}while(Math.abs(s)>1e-7&&10>++a);return o}(t,n,n+u,i,e):function(i,t,e,n){for(var r=0;4>r;++r){var s=d(t,e,n);if(0===s)return t;t-=(l(t,e,n)-i)/s}return t}(t,o,i,e)};return function(i){return 0===i||1===i?i:l(o(i),t,n)}},v=function(i){return null==i},y={}.toString,g=function(i,t,e){return t>i?t:i>e?e:i},T=function(i){return function(i,t){return y.call(i)==="[object "+t+"]"}(i,"Number")},b=function(i){return Math.pow(i,2)},_=function(i){return Math.pow(i,3)},P=function(i){return Math.pow(i,4)},k=function(i){return Math.pow(i,5)},E=function(i){return Math.pow(i,6)},A=function(i){return 1-Math.cos(i*Math.PI/2)},w=function(i){return 1-Math.sqrt(1-i*i)},O=function(i){return i*i*(3*i-2)},M=function(i){for(var t,e=4;i<((t=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*t-2)/22-i,2)},R=function(i,t){void 0===t&&(t=[]);var e=t[0],n=t[1],r=void 0===n?.5:n,s=g(Number(void 0===e?1:e),1,10),o=g(Number(r),.1,2);return 0===i||1===i?i:-s*Math.pow(2,10*(i-1))*Math.sin(2*Math.PI*(i-1-o/(2*Math.PI)*Math.asin(1/s))/o)},F=function(i,t,e){void 0===t&&(t=[]);var n=t[0],r=void 0===n?1:n,s=t[1],o=void 0===s?100:s,a=t[2],u=void 0===a?10:a,h=t[3],f=void 0===h?0:h;r=g(r,.1,1e3),o=g(o,.1,1e3),u=g(u,.1,1e3),f=g(f,.1,1e3);var c=Math.sqrt(o/r),m=u/(2*Math.sqrt(o*r)),l=1>m?c*Math.sqrt(1-m*m):0,d=1>m?(m*c-f)/l:-f+c,p=e?e*i/1e3:i;return p=1>m?Math.exp(-p*m*c)*(1*Math.cos(l*p)+d*Math.sin(l*p)):(1+d*p)*Math.exp(-p*c),0===i||1===i?i:1-p},N=function(i,t){void 0===t&&(t=[]);var e=t[0],n=void 0===e?10:e;return("start"==t[1]?Math.ceil:Math.floor)(g(i,0,1)*n)/n},D=function(i,t){void 0===t&&(t=[]);return p(t[0],t[1],t[2],t[3])(i)},S=p(.42,0,1,1),x=function(i){return function(t,e,n){return void 0===e&&(e=[]),1-i(1-t,e,n)}},q=function(i){return function(t,e,n){return void 0===e&&(e=[]),.5>t?i(2*t,e,n)/2:1-i(-2*t+2,e,n)/2}},I=function(i){return function(t,e,n){return void 0===e&&(e=[]),.5>t?(1-i(1-2*t,e,n))/2:(i(2*t-1,e,n)+1)/2}},C={steps:N,"step-start":function(i){return N(i,[1,"start"])},"step-end":function(i){return N(i,[1,"end"])},linear:function(i){return i},"cubic-bezier":D,ease:function(i){return D(i,[.25,.1,.25,1])},in:S,out:x(S),"in-out":q(S),"out-in":I(S),"in-quad":b,"out-quad":x(b),"in-out-quad":q(b),"out-in-quad":I(b),"in-cubic":_,"out-cubic":x(_),"in-out-cubic":q(_),"out-in-cubic":I(_),"in-quart":P,"out-quart":x(P),"in-out-quart":q(P),"out-in-quart":I(P),"in-quint":k,"out-quint":x(k),"in-out-quint":q(k),"out-in-quint":I(k),"in-expo":E,"out-expo":x(E),"in-out-expo":q(E),"out-in-expo":I(E),"in-sine":A,"out-sine":x(A),"in-out-sine":q(A),"out-in-sine":I(A),"in-circ":w,"out-circ":x(w),"in-out-circ":q(w),"out-in-circ":I(w),"in-back":O,"out-back":x(O),"in-out-back":q(O),"out-in-back":I(O),"in-bounce":M,"out-bounce":x(M),"in-out-bounce":q(M),"out-in-bounce":I(M),"in-elastic":R,"out-elastic":x(R),"in-out-elastic":q(R),"out-in-elastic":I(R),spring:F,"spring-in":F,"spring-out":x(F),"spring-in-out":q(F),"spring-out-in":I(F)},j=function(i){return C[function(i){return(t=i,"-"===(t=t.replace(/([A-Z])/g,(function(i){return"-"+i.toLowerCase()}))).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim();var t}(i)]||C.linear},K=function(i){return i},W=1,z=.5,G=0;function L(i,t){return function(e){if(e>=1)return 1;var n=1/i;return(e+=t*n)-e%n}}var V="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",H=RegExp("cubic-bezier\\("+V+","+V+","+V+","+V+"\\)"),U=/steps\(\s*(\d+)\s*\)/,Z=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function B(i){var t=H.exec(i);if(t)return p.apply(void 0,t.slice(1).map(Number));var e=U.exec(i);if(e)return L(Number(e[1]),G);var n=Z.exec(i);return n?L(Number(n[1]),{start:W,middle:z,end:G}[n[2]]):j(i)}function J(i){return Math.abs(function(i){var t;if(0===i.duration||0===i.iterations)return 0;return("auto"===i.duration?0:Number(i.duration))*(null!==(t=i.iterations)&&void 0!==t?t:1)}(i)/(i.playbackRate||1))}var Q=0,X=1,Y=2,$=3;function ii(i,t,e){var n=function(i,t,e){if(null===t)return Q;var n=e.endTime;return Math.min(e.delay,n)>t?X:Math.min(e.delay+i+e.endDelay,n)>t?$:Y}(i,t,e),r=function(i,t,e,n,r){switch(n){case X:return"backwards"===t||"both"===t?0:null;case $:return e-r;case Y:return"forwards"===t||"both"===t?i:null;case Q:return null}}(i,e.fill,t,n,e.delay);if(null===r)return null;var s="auto"===e.duration?0:e.duration,o=function(i,t,e,n,r){var s=r;return 0===i?t!==X&&(s+=e):s+=n/i,s}(s,n,e.iterations,r,e.iterationStart),a=function(i,t,e,n,r,s){var o=i===1/0?t%1:i%1;return 0!==o||e!==Y||0===n||0===r&&0!==s||(o=1),o}(o,e.iterationStart,n,e.iterations,r,s),u=function(i,t,e,n){return i===Y&&t===1/0?1/0:1===e?Math.floor(n)-1:Math.floor(n)}(n,e.iterations,a,o),h=function(i,t,e){var n=i;if("normal"!==i&&"reverse"!==i){var r=t;"alternate-reverse"===i&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?e:1-e}(e.direction,u,a);return e.currentIteration=u,e.progress=h,e.easingFunction(h)}function ti(i,t,e){var n=function(i,t){for(var e={},n=0;i.length>n;n++)for(var r in i[n])if(ei(r)){var s={offset:i[n].offset,computedOffset:i[n].computedOffset,easing:i[n].easing,easingFunction:B(i[n].easing)||t.easingFunction,value:i[n][r]};e[r]=e[r]||[],e[r].push(s)}return e}(i,t),r=function(i,t){var e=[];for(var n in i)for(var r=i[n],s=0;r.length-1>s;s++){var o=s,a=s+1,u=r[o].computedOffset,h=r[a].computedOffset,f=u,c=h;0===s&&(f=-1/0,0===h&&(a=o)),s===r.length-2&&(c=1/0,1===u&&(o=a)),e.push({applyFrom:f,applyTo:c,startOffset:r[o].computedOffset,endOffset:r[a].computedOffset,easingFunction:r[o].easingFunction,property:n,interpolation:ri(n,r[o].value,r[a].value,t)})}return e.sort((function(i,t){return i.startOffset-t.startOffset})),e}(n,e);return function(i,t){if(null!==t)r.filter((function(i){return t>=i.applyFrom&&i.applyTo>t})).forEach((function(e){var n=e.endOffset-e.startOffset,r=0===n?0:e.easingFunction((t-e.startOffset)/n);i.setAttribute(e.property,e.interpolation(r))}));else for(var e in n)ei(e)&&i.setAttribute(e,null)}}function ei(i){return"offset"!==i&&"easing"!==i&&"composite"!==i&&"computedOffset"!==i}var ni=function(i,e,n){return function(r){var s=si(i,e,r);return!t.runtime.enableCSSParsing&&T(s)?s:n(s)}};function ri(i,e,n,r){var s=t.propertyMetadataCache[i];if(s&&s.syntax&&s.int){var o=t.runtime.styleValueRegistry.getPropertySyntax(s.syntax);if(o){var a,u;if(t.runtime.enableCSSParsing){var h=t.runtime.styleValueRegistry.parseProperty(i,e,r),f=t.runtime.styleValueRegistry.parseProperty(i,n,r);a=t.runtime.styleValueRegistry.computeProperty(i,h,r),u=t.runtime.styleValueRegistry.computeProperty(i,f,r)}else{var c=o.parserWithCSSDisabled;a=c?c(e,r):e,u=c?c(n,r):n}var m=o.mixer(a,u,r);if(m){var l=ni.apply(void 0,m);return function(i){return 0===i?e:1===i?n:l(i)}}}}return ni(!1,!0,(function(i){return i?n:e}))}function si(i,t,e){if("number"==typeof i&&"number"==typeof t)return i*(1-e)+t*e;if("boolean"==typeof i&&"boolean"==typeof t||"string"==typeof i&&"string"==typeof t)return.5>e?i:t;if(Array.isArray(i)&&Array.isArray(t)){for(var n=i.length,r=t.length,s=Math.max(n,r),o=[],a=0;s>a;a++)o.push(si(i[n>a?a:n-1],t[r>a?a:r-1],e));return o}throw Error("Mismatched interpolation arguments "+i+":"+t)}var oi=function(){function i(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=K,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return n(i,[{key:"easing",get:function(){return this._easing},set:function(i){this.easingFunction=B(i),this._easing=i}}]),i}();function ai(i,t){if(null===i)return[];Array.isArray(i)||(i=function(i){var t=[];for(var e in i)if(!(e in["easing","offset","composite"])){var n=i[e];Array.isArray(n)||(n=[n]);for(var r=n.length,s=0;r>s;s++){if(!t[s]){var o={};"offset"in i&&(o.offset=Number(i.offset)),"easing"in i&&(o.easing=i.easing),"composite"in i&&(o.composite=i.composite),t[s]=o}null!=n[s]&&(t[s][e]=n[s])}}return t.sort((function(i,t){return(i.computedOffset||0)-(t.computedOffset||0)})),t}(i));for(var e=i.map((function(i){var e={};for(var n in(null==t?void 0:t.composite)&&(e.composite="auto"),i){var r=i[n];if("offset"===n){if(null!==r){if(!isFinite(r=Number(r)))throw Error("Keyframe offsets must be numbers.");if(0>r||r>1)throw Error("Keyframe offsets must be between 0 and 1.");e.computedOffset=r}}else if("composite"===n&&-1===["replace","add","accumulate","auto"].indexOf(r))throw Error(r+" compositing is not supported");e[n]=r}return void 0===e.offset&&(e.offset=null),void 0===e.easing&&(e.easing=(null==t?void 0:t.easing)||"linear"),void 0===e.composite&&(e.composite="auto"),e})),n=!0,r=-1/0,s=0;e.length>s;s++){var o=e[s].offset;if(v(o))n=!1;else{if(r>o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}return e=e.filter((function(i){return Number(i.offset)>=0&&1>=Number(i.offset)})),n||function(){var i,t,n=e.length;e[n-1].computedOffset=Number(null!==(i=e[n-1].offset)&&void 0!==i?i:1),n>1&&(e[0].computedOffset=Number(null!==(t=e[0].offset)&&void 0!==t?t:0));for(var r=0,s=Number(e[0].computedOffset),o=1;n>o;o++){var a=e[o].computedOffset;if(!v(a)&&!v(s)){for(var u=1;o-r>u;u++)e[r+u].computedOffset=s+(Number(a)-s)*u/(o-r);r=o,s=Number(a)}}}(),e}var ui="backwards|forwards|both|none".split("|"),hi="reverse|alternate|alternate-reverse".split("|");function fi(i,t){var e=new oi;return t&&(e.fill="both",e.duration="auto"),"number"!=typeof i||isNaN(i)?void 0!==i&&Object.keys(i).forEach((function(t){if(null!=i[t]&&"auto"!==i[t]){if(("number"==typeof e[t]||"duration"===t)&&("number"!=typeof i[t]||isNaN(i[t])))return;if("fill"===t&&-1===ui.indexOf(i[t]))return;if("direction"===t&&-1===hi.indexOf(i[t]))return;e[t]=i[t]}})):e.duration=i,e}function ci(i,t){var e;return fi(i=mi(null!==(e=i)&&void 0!==e?e:{duration:"auto"}),t)}function mi(i){return"number"==typeof i&&(i=isNaN(i)?{duration:"auto"}:{duration:i}),i}var li=function(){function i(i,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=i,this.timing=ci(n,!1),this.timing.effect=this,this.timing.activeDuration=J(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ai(e,this.timing),this.interpolations=ti(this.normalizedKeyframes,this.timing,this.target);var s=t.runtime.globalThis.Proxy;this.computedTiming=s?new s(this.timing,{get:function(i,t){return"duration"===t?"auto"===i.duration?0:i.duration:"fill"===t?"auto"===i.fill?"none":i.fill:"localTime"===t?r.animation&&r.animation.currentTime||null:"currentIteration"===t?r.animation&&"running"===r.animation.playState?i.currentIteration||0:null:"progress"===t?r.animation&&"running"===r.animation.playState?i.progress||0:null:i[t]},set:function(){return!0}}):this.timing}var e=i.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(i){return null!==i&&(this.timeFraction=ii(this.timing.activeDuration,i,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(i){this.normalizedKeyframes=ai(i)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(i){var t=this;Object.keys(i||{}).forEach((function(e){t.timing[e]=i[e]}))},i}();function di(i,t){return Number(i.id)-Number(t.id)}var pi=function(){function i(i){var t=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(i){t.currentTime=i,t.discardAnimations(),0===t.animations.length?t.timelineTicking=!1:t.requestAnimationFrame(t.webAnimationsNextTick)},this.processRafCallbacks=function(i){var e=t.rafCallbacks;t.rafCallbacks=[],Number(t.currentTime)>i&&(i=Number(t.currentTime)),t.animations.sort(di),t.animations=t.tick(i,!0,t.animations)[0],e.forEach((function(t){t[1](i)})),t.applyPendingEffects()},this.document=i}var t=i.prototype;return t.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.isTicking=function(){return this.inTick},t.play=function(i,t,e){var n=new li(i,t,e),r=new a(n,this);return this.animations.push(r),this.restartWebAnimationsNextTick(),r.updatePromises(),r.play(),r.updatePromises(),r},t.applyDirtiedAnimation=function(i){var t=this;if(!this.inTick){i.markTarget();var e=i.targetAnimations();e.sort(di),this.tick(Number(this.currentTime),!1,e.slice())[1].forEach((function(i){var e=t.animations.indexOf(i);-1!==e&&t.animations.splice(e,1)})),this.applyPendingEffects()}},t.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.applyPendingEffects=function(){this.pendingEffects.forEach((function(i){null==i||i.applyInterpolations()})),this.pendingEffects=[]},t.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(i){return i.updatePromises()}))},t.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(i){return"finished"!==i.playState&&"idle"!==i.playState}))},t.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.rAF=function(i){var t=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([t,i]),t},t.requestAnimationFrame=function(i){var t=this;return this.rAF((function(e){t.updateAnimationsPromises(),i(e),t.updateAnimationsPromises()}))},t.tick=function(i,t,e){var n,r,s=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=i,this.ticking=!1;var o=[],a=[],u=[],h=[];return e.forEach((function(e){e.tick(i,t),e._inEffect?(a.push(e.effect),e.markTarget()):(o.push(e.effect),e.unmarkTarget()),e._needsTick&&(s.ticking=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?u.push(e):h.push(e)})),(n=this.pendingEffects).push.apply(n,o),(r=this.pendingEffects).push.apply(r,a),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,h]},i}();t.runtime.EasingFunction=B,t.runtime.AnimationTimeline=pi,i.Animation=a,i.AnimationEvent=s,i.AnimationTimeline=pi,i.KeyframeEffect=li,i.compareAnimations=di,i.makeTiming=fi,i.normalizeKeyframes=ai,i.normalizeTimingInput=ci,i.numericTimingToObject=mi,Object.defineProperty(i,"__esModule",{value:!0})}));
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],i):i(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.WebAnimationsAPI={}),t.window.G)}(this,(function(t,i){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},e(t,i)};function n(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,r,s=e.call(t),o=[];try{for(;(void 0===i||i-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(e=s.return)&&e.call(s)}finally{if(r)throw r.error}}return o}function r(t,i,e){if(e||2===arguments.length)for(var n,r=0,s=i.length;s>r;r++)!n&&r in i||(n||(n=Array.prototype.slice.call(i,0,r)),n[r]=i[r]);return t.concat(n||Array.prototype.slice.call(i))}var s=function(t){function i(i,e,n,r){var s=t.call(this,i)||this;return s.currentTime=n,s.timelineTime=r,s.target=e,s.type="finish",s.bubbles=!1,s.currentTarget=e,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=n,s.timelineTime=r,s}return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+i+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}(i,t),i}(i.FederatedEvent),o=0,a=function(){function t(t,i){var e;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=i,this.id="".concat(o++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(e=this.effect)||void 0===e?void 0:e.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(i,e){t.resolveReadyPromise=function(){i(t)},t.rejectReadyPromise=function(){e(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(i,e){t.resolveFinishedPromise=function(){i(t)},t.rejectFinishedPromise=function(){e(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var i;isNaN(t=Number(t))||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(i=this.timeline)||void 0===i?void 0:i.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var i=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==i&&(this.currentTime=i),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,i=this.pending?"pending":this.playState;return this.readyPromise&&i!==t&&("idle"===i?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===i&&(this.readyPromise=void 0)),this.finishedPromise&&i!==t&&("idle"===i?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===i?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=i,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var i=new s(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(i)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),i=t.indexOf(this);-1!==i&&t.splice(i,1)},t.prototype.tick=function(t,i){this._idle||this._paused||(null===this._startTime?i&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),i&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},t.prototype.persist=function(){throw Error(i.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},t.prototype.addEventListener=function(t,e,n){throw Error(i.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},t.prototype.removeEventListener=function(t,e,n){throw Error(i.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},t.prototype.dispatchEvent=function(t){throw Error(i.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},t.prototype.commitStyles=function(){throw Error(i.ERROR_MSG_METHOD_NOT_IMPLEMENTED)},t.prototype.ensureAlive=function(){var t,i;this._inEffect=0>this.playbackRate&&0===this.currentTime?!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):!!(null===(i=this.effect)||void 0===i?void 0:i.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,i){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!i&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var i=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var e=new s(null,this,this.currentTime,t);setTimeout((function(){i.onfinish&&i.onfinish(e)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var n=new s(null,this,this.currentTime,t);this.onframe(n)}this._finishedFlag=!1}},t}(),u=.1,f="function"==typeof Float32Array,c=function(t,i){return 1-3*i+3*t},h=function(t,i){return 3*i-6*t},l=function(t){return 3*t},m=function(t,i,e){return((c(i,e)*t+h(i,e))*t+l(i))*t},p=function(t,i,e){return 3*c(i,e)*t*t+2*h(i,e)*t+l(i)},d=function(t,i,e,n){if(0>t||t>1||0>e||e>1)throw Error("bezier x values must be in [0, 1] range");if(t===i&&e===n)return function(t){return t};for(var r=f?new Float32Array(11):[,,,,,,,,,,,],s=0;11>s;++s)r[s]=m(s*u,t,e);var o=function(i){for(var n=0,s=1;10!==s&&i>=r[s];++s)n+=u;--s;var o=n+(i-r[s])/(r[s+1]-r[s])*u,a=p(o,t,e);return.001>a?0===a?o:function(t,i,e,n,r){var s,o,a=0;do{(s=m(o=i+(e-i)/2,n,r)-t)>0?e=o:i=o}while(Math.abs(s)>1e-7&&10>++a);return o}(i,n,n+u,t,e):function(t,i,e,n){for(var r=0;4>r;++r){var s=p(i,e,n);if(0===s)return i;i-=(m(i,e,n)-t)/s}return i}(i,o,t,e)};return function(t){return 0===t||1===t?t:m(o(t),i,n)}},y=function(t){return null==t},g={}.toString,v=function(t,i){return g.call(t)==="[object "+i+"]"},b=function(t,i,e){return i>t?i:t>e?e:t},T=function(t){return v(t,"Number")},_=function(t){return Math.pow(t,2)},P=function(t){return Math.pow(t,3)},k=function(t){return Math.pow(t,4)},E=function(t){return Math.pow(t,5)},O=function(t){return Math.pow(t,6)},A=function(t){return 1-Math.cos(t*Math.PI/2)},w=function(t){return 1-Math.sqrt(1-t*t)},M=function(t){return t*t*(3*t-2)},N=function(t){for(var i,e=4;t<((i=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*i-2)/22-t,2)},R=function(t,i){void 0===i&&(i=[]);var e=n(i,2),r=e[0],s=e[1],o=void 0===s?.5:s,a=b(Number(void 0===r?1:r),1,10),u=b(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-u/(2*Math.PI)*Math.asin(1/a))/u)},F=function(t,i,e){void 0===i&&(i=[]);var r=n(i,4),s=r[0],o=void 0===s?1:s,a=r[1],u=void 0===a?100:a,f=r[2],c=void 0===f?10:f,h=r[3],l=void 0===h?0:h;o=b(o,.1,1e3),u=b(u,.1,1e3),c=b(c,.1,1e3),l=b(l,.1,1e3);var m=Math.sqrt(u/o),p=c/(2*Math.sqrt(u*o)),d=1>p?m*Math.sqrt(1-p*p):0,y=1>p?(p*m-l)/d:-l+m,g=e?e*t/1e3:t;return g=1>p?Math.exp(-g*p*m)*(1*Math.cos(d*g)+y*Math.sin(d*g)):(1+y*g)*Math.exp(-g*m),0===t||1===t?t:1-g},x=function(t,i){void 0===i&&(i=[]);var e=n(i,2),r=e[0],s=void 0===r?10:r;return("start"==e[1]?Math.ceil:Math.floor)(b(t,0,1)*s)/s},S=function(t,i){void 0===i&&(i=[]);var e=n(i,4);return d(e[0],e[1],e[2],e[3])(t)},D=d(.42,0,1,1),j=function(t){return function(i,e,n){return void 0===e&&(e=[]),1-t(1-i,e,n)}},q=function(t){return function(i,e,n){return void 0===e&&(e=[]),.5>i?t(2*i,e,n)/2:1-t(-2*i+2,e,n)/2}},C=function(t){return function(i,e,n){return void 0===e&&(e=[]),.5>i?(1-t(1-2*i,e,n))/2:(t(2*i-1,e,n)+1)/2}},I={steps:x,"step-start":function(t){return x(t,[1,"start"])},"step-end":function(t){return x(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":S,ease:function(t){return S(t,[.25,.1,.25,1])},in:D,out:j(D),"in-out":q(D),"out-in":C(D),"in-quad":_,"out-quad":j(_),"in-out-quad":q(_),"out-in-quad":C(_),"in-cubic":P,"out-cubic":j(P),"in-out-cubic":q(P),"out-in-cubic":C(P),"in-quart":k,"out-quart":j(k),"in-out-quart":q(k),"out-in-quart":C(k),"in-quint":E,"out-quint":j(E),"in-out-quint":q(E),"out-in-quint":C(E),"in-expo":O,"out-expo":j(O),"in-out-expo":q(O),"out-in-expo":C(O),"in-sine":A,"out-sine":j(A),"in-out-sine":q(A),"out-in-sine":C(A),"in-circ":w,"out-circ":j(w),"in-out-circ":q(w),"out-in-circ":C(w),"in-back":M,"out-back":j(M),"in-out-back":q(M),"out-in-back":C(M),"in-bounce":N,"out-bounce":j(N),"in-out-bounce":q(N),"out-in-bounce":C(N),"in-elastic":R,"out-elastic":j(R),"in-out-elastic":q(R),"out-in-elastic":C(R),spring:F,"spring-in":F,"spring-out":j(F),"spring-in-out":q(F),"spring-out-in":C(F)},K=function(t){return I[function(t){return(i=t,"-"===(i=i.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?i.substring(1):i).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim();var i}(t)]||I.linear},W=function(t){return t},G=1,z=.5,L=0;function V(t,i){return function(e){if(e>=1)return 1;var n=1/t;return(e+=i*n)-e%n}}var H="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",U=RegExp("cubic-bezier\\("+H+","+H+","+H+","+H+"\\)"),Z=/steps\(\s*(\d+)\s*\)/,B=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function J(t){var i=U.exec(t);if(i)return d.apply(void 0,r([],n(i.slice(1).map(Number)),!1));var e=Z.exec(t);if(e)return V(Number(e[1]),L);var s=B.exec(t);return s?V(Number(s[1]),{start:G,middle:z,end:L}[s[2]]):K(t)}function Q(t){return Math.abs(function(t){var i;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(i=t.iterations)&&void 0!==i?i:1)}(t)/(t.playbackRate||1))}var X=0,Y=1,$=2,tt=3;function it(t,i,e){var n=function(t,i,e){if(null===i)return X;var n=e.endTime;return Math.min(e.delay,n)>i?Y:Math.min(e.delay+t+e.endDelay,n)>i?tt:$}(t,i,e),r=function(t,i,e,n,r){switch(n){case Y:return"backwards"===i||"both"===i?0:null;case tt:return e-r;case $:return"forwards"===i||"both"===i?t:null;case X:return null}}(t,e.fill,i,n,e.delay);if(null===r)return null;var s="auto"===e.duration?0:e.duration,o=function(t,i,e,n,r){var s=r;return 0===t?i!==Y&&(s+=e):s+=n/t,s}(s,n,e.iterations,r,e.iterationStart),a=function(t,i,e,n,r,s){var o=t===1/0?i%1:t%1;return 0!==o||e!==$||0===n||0===r&&0!==s||(o=1),o}(o,e.iterationStart,n,e.iterations,r,s),u=function(t,i,e,n){return t===$&&i===1/0?1/0:1===e?Math.floor(n)-1:Math.floor(n)}(n,e.iterations,a,o),f=function(t,i,e){var n=t;if("normal"!==t&&"reverse"!==t){var r=i;"alternate-reverse"===t&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?e:1-e}(e.direction,u,a);return e.currentIteration=u,e.progress=f,e.easingFunction(f)}function et(t,i,e){var n=function(t,i){for(var e={},n=0;t.length>n;n++)for(var r in t[n])if(nt(r)){var s={offset:t[n].offset,computedOffset:t[n].computedOffset,easing:t[n].easing,easingFunction:J(t[n].easing)||i.easingFunction,value:t[n][r]};e[r]=e[r]||[],e[r].push(s)}return e}(t,i),r=function(t,i){var e=[];for(var n in t)for(var r=t[n],s=0;r.length-1>s;s++){var o=s,a=s+1,u=r[o].computedOffset,f=r[a].computedOffset,c=u,h=f;0===s&&(c=-1/0,0===f&&(a=o)),s===r.length-2&&(h=1/0,1===u&&(o=a)),e.push({applyFrom:c,applyTo:h,startOffset:r[o].computedOffset,endOffset:r[a].computedOffset,easingFunction:r[o].easingFunction,property:n,interpolation:st(n,r[o].value,r[a].value,i)})}return e.sort((function(t,i){return t.startOffset-i.startOffset})),e}(n,e);return function(t,i){if(null!==i)r.filter((function(t){return i>=t.applyFrom&&t.applyTo>i})).forEach((function(e){var n=e.endOffset-e.startOffset,r=0===n?0:e.easingFunction((i-e.startOffset)/n);t.setAttribute(e.property,e.interpolation(r))}));else for(var e in n)nt(e)&&t.setAttribute(e,null)}}function nt(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var rt=function(t,e,n){return function(r){var s=ot(t,e,r);return!i.runtime.enableCSSParsing&&T(s)?s:n(s)}};function st(t,e,s,o){var a=i.propertyMetadataCache[t];if(a&&a.syntax&&a.int){var u=i.runtime.styleValueRegistry.getPropertySyntax(a.syntax);if(u){var f=void 0,c=void 0;if(i.runtime.enableCSSParsing){var h=i.runtime.styleValueRegistry.parseProperty(t,e,o),l=i.runtime.styleValueRegistry.parseProperty(t,s,o);f=i.runtime.styleValueRegistry.computeProperty(t,h,o),c=i.runtime.styleValueRegistry.computeProperty(t,l,o)}else{var m=u.parserWithCSSDisabled;f=m?m(e,o):e,c=m?m(s,o):s}var p=u.mixer(f,c,o);if(p){var d=rt.apply(void 0,r([],n(p),!1));return function(t){return 0===t?e:1===t?s:d(t)}}}}return rt(!1,!0,(function(t){return t?s:e}))}function ot(t,i,e){if("number"==typeof t&&"number"==typeof i)return t*(1-e)+i*e;if("boolean"==typeof t&&"boolean"==typeof i||"string"==typeof t&&"string"==typeof i)return.5>e?t:i;if(Array.isArray(t)&&Array.isArray(i)){for(var n=t.length,r=i.length,s=Math.max(n,r),o=[],a=0;s>a;a++)o.push(ot(t[n>a?a:n-1],i[r>a?a:r-1],e));return o}throw Error("Mismatched interpolation arguments "+t+":"+i)}var at=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=W,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=J(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function ut(t,i){if(null===t)return[];Array.isArray(t)||(t=function(t){var i=[];for(var e in t)if(!(e in["easing","offset","composite"])){var n=t[e];Array.isArray(n)||(n=[n]);for(var r=n.length,s=0;r>s;s++){if(!i[s]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),i[s]=o}null!=n[s]&&(i[s][e]=n[s])}}return i.sort((function(t,i){return(t.computedOffset||0)-(i.computedOffset||0)})),i}(t));for(var e=t.map((function(t){var e={};for(var n in(null==i?void 0:i.composite)&&(e.composite="auto"),t){var r=t[n];if("offset"===n){if(null!==r){if(!isFinite(r=Number(r)))throw Error("Keyframe offsets must be numbers.");if(0>r||r>1)throw Error("Keyframe offsets must be between 0 and 1.");e.computedOffset=r}}else if("composite"===n&&-1===["replace","add","accumulate","auto"].indexOf(r))throw Error("".concat(r," compositing is not supported"));e[n]=r}return void 0===e.offset&&(e.offset=null),void 0===e.easing&&(e.easing=(null==i?void 0:i.easing)||"linear"),void 0===e.composite&&(e.composite="auto"),e})),n=!0,r=-1/0,s=0;e.length>s;s++){var o=e[s].offset;if(y(o))n=!1;else{if(r>o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}return e=e.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),n||function(){var t,i,n=e.length;e[n-1].computedOffset=Number(null!==(t=e[n-1].offset)&&void 0!==t?t:1),n>1&&(e[0].computedOffset=Number(null!==(i=e[0].offset)&&void 0!==i?i:0));for(var r=0,s=Number(e[0].computedOffset),o=1;n>o;o++){var a=e[o].computedOffset;if(!y(a)&&!y(s)){for(var u=1;o-r>u;u++)e[r+u].computedOffset=s+(Number(a)-s)*u/(o-r);r=o,s=Number(a)}}}(),e}var ft="backwards|forwards|both|none".split("|"),ct="reverse|alternate|alternate-reverse".split("|");function ht(t,i){var e=new at;return i&&(e.fill="both",e.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(i){if(null!=t[i]&&"auto"!==t[i]){if(("number"==typeof e[i]||"duration"===i)&&("number"!=typeof t[i]||isNaN(t[i])))return;if("fill"===i&&-1===ft.indexOf(t[i]))return;if("direction"===i&&-1===ct.indexOf(t[i]))return;e[i]=t[i]}})):e.duration=t,e}function lt(t,i){return ht(t=mt(null!=t?t:{duration:"auto"}),i)}function mt(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var pt=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=lt(n,!1),this.timing.effect=this,this.timing.activeDuration=Q(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ut(e,this.timing),this.interpolations=et(this.normalizedKeyframes,this.timing,this.target);var s=i.runtime.globalThis.Proxy;this.computedTiming=s?new s(this.timing,{get:function(t,i){return"duration"===i?"auto"===t.duration?0:t.duration:"fill"===i?"auto"===t.fill?"none":t.fill:"localTime"===i?r.animation&&r.animation.currentTime||null:"currentIteration"===i?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===i?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[i]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=it(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=ut(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var i=this;Object.keys(t||{}).forEach((function(e){i.timing[e]=t[e]}))},t}();function dt(t,i){return Number(t.id)-Number(i.id)}var yt=function(){function t(t){var i=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){i.currentTime=t,i.discardAnimations(),0===i.animations.length?i.timelineTicking=!1:i.requestAnimationFrame(i.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=i.rafCallbacks;i.rafCallbacks=[],Number(i.currentTime)>t&&(t=Number(i.currentTime)),i.animations.sort(dt),i.animations=i.tick(t,!0,i.animations)[0],e.forEach((function(i){i[1](t)})),i.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,i,e){var n=new pt(t,i,e),r=new a(n,this);return this.animations.push(r),this.restartWebAnimationsNextTick(),r.updatePromises(),r.play(),r.updatePromises(),r},t.prototype.applyDirtiedAnimation=function(t){var i=this;if(!this.inTick){t.markTarget();var e=t.targetAnimations();e.sort(dt),this.tick(Number(this.currentTime),!1,e.slice())[1].forEach((function(t){var e=i.animations.indexOf(t);-1!==e&&i.animations.splice(e,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var i=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([i,t]),i},t.prototype.requestAnimationFrame=function(t){var i=this;return this.rAF((function(e){i.updateAnimationsPromises(),t(e),i.updateAnimationsPromises()}))},t.prototype.tick=function(t,i,e){var s,o,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var u=[],f=[],c=[],h=[];return e.forEach((function(e){e.tick(t,i),e._inEffect?(f.push(e.effect),e.markTarget()):(u.push(e.effect),e.unmarkTarget()),e._needsTick&&(a.ticking=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?c.push(e):h.push(e)})),(s=this.pendingEffects).push.apply(s,r([],n(u),!1)),(o=this.pendingEffects).push.apply(o,r([],n(f),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,h]},t}();i.runtime.EasingFunction=J,i.runtime.AnimationTimeline=yt,t.Animation=a,t.AnimationEvent=s,t.AnimationTimeline=yt,t.KeyframeEffect=pt,t.compareAnimations=dt,t.makeTiming=ht,t.normalizeKeyframes=ut,t.normalizeTimingInput=lt,t.numericTimingToObject=mt}));
//# sourceMappingURL=index.umd.min.js.map

@@ -16,2 +16,1 @@ import type { AnimationEffectTiming } from '../dom/AnimationEffectTiming';

export declare const getEase: (ease?: keyof typeof EASINGS | string) => string;
//# sourceMappingURL=animation.d.ts.map

@@ -21,2 +21,1 @@ /**

export declare const bezier: (mX1: number, mY1: number, mX2: number, mY2: number) => (t: number) => number;
//# sourceMappingURL=bezier-easing.d.ts.map

@@ -16,2 +16,1 @@ /**

export {};
//# sourceMappingURL=custom-easing.d.ts.map

@@ -5,2 +5,1 @@ export * from './animation';

export * from './interpolation';
//# sourceMappingURL=index.d.ts.map
import type { IAnimationEffectTiming, IElement } from '@antv/g-lite';
export declare function convertEffectInput(keyframes: ComputedKeyframe[], timing: IAnimationEffectTiming, target: IElement | null): (target: IElement, fraction: number) => void;
//# sourceMappingURL=interpolation.d.ts.map
{
"name": "@antv/g-web-animations-api",
"version": "1.0.39",
"version": "1.1.0-alpha.1",
"description": "A simple implementation of Web Animations API.",

@@ -21,2 +21,7 @@ "keywords": [

"sideEffects": true,
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.esm.js",
"default": "./dist/index.js"
},
"main": "dist/index.js",

@@ -33,14 +38,15 @@ "unpkg": "dist/index.umd.min.js",

"scripts": {
"sync": "tnpm sync"
"build": "npm run clean && rollup -c",
"clean": "rimraf dist",
"sync": "tnpm sync",
"watch": "rollup -c -w"
},
"dependencies": {
"@antv/util": "^3.3.1"
"@antv/g-lite": "workspace:*",
"@antv/util": "^3.3.1",
"tslib": "^2.5.3"
},
"peerDependencies": {
"@antv/g-lite": "^1.0.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "53932c66ed9f2cbc28993e1e359c8df27703fc52"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc