/** * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. * Original file: /npm/d3-timer@3.0.1/src/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ var t,n,e=0,r=0,o=0,i=0,a=0,l=0,u="object"==typeof performance&&performance.now?performance:Date,c="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function s(){return a||(c(f),a=u.now()+l)}function f(){a=0}function _(){this._call=this._time=this._next=null}function w(t,n,e){var r=new _;return r.restart(t,n,e),r}function m(){s(),++e;for(var n,r=t;r;)(n=a-r._time)>=0&&r._call.call(void 0,n),r=r._next;--e}function p(){a=(i=u.now())+l,e=r=0;try{m()}finally{e=0,function(){var e,r,o=t,i=1/0;for(;o;)o._call?(i>o._time&&(i=o._time),e=o,o=o._next):(r=o._next,o._next=null,o=e?e._next=r:t=r);n=e,v(i)}(),a=0}}function h(){var t=u.now(),n=t-i;n>1e3&&(l-=n,i=t)}function v(t){e||(r&&(r=clearTimeout(r)),t-a>24?(t<1/0&&(r=setTimeout(p,t-u.now()-l)),o&&(o=clearInterval(o))):(o||(i=u.now(),o=setInterval(h,1e3)),e=1,c(p)))}function x(t,n,e){var r=new _;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}function y(t,n,e){var r=new _,o=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?s():+e,r._restart((function i(a){a+=o,r._restart(i,o+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)}_.prototype=w.prototype={constructor:_,restart:function(e,r,o){if("function"!=typeof e)throw new TypeError("callback is not a function");o=(null==o?s():+o)+(null==r?0:+r),this._next||n===this||(n?n._next=this:t=this,n=this),this._call=e,this._time=o,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}};export{y as interval,s as now,x as timeout,w as timer,m as timerFlush};export default null;