function e(e,t,n=!1){let r,i,a,o,s;t??=100;function c(){let l=Date.now()-o;l<t&&l>=0?r=setTimeout(c,t-l):(r=null,n||(s=e.apply(a,i||[]),a=i=null))}let l=function(){a=this,i=arguments,o=Date.now();let l=n&&!r;return r||=setTimeout(c,t),l&&(s=e.apply(a,i||[]),a=i=null),s};return l.clear=function(){r&&=(clearTimeout(r),null)},l.flush=function(){r&&=(i&&(s=e.apply(a,i),a=i=null),clearTimeout(r),null)},l}e.debounce=e;export{e as t};