import{g as n}from"./ansi-regex-DJPe--rM.js";var t,e,l,u,r={},o={};function i(){return t||(t=1,n=o,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),n.debounce=function(n,t=0,e={}){"object"!=typeof e&&(e={});let l,u=null,r=null,o=null,i=0,a=null;const{leading:c=!1,trailing:s=!0,maxWait:f}=e,m="maxWait"in e,g=m?Math.max(Number(f)||0,t):0,d=t=>(null!==u&&(l=n.apply(r,u)),u=r=null,i=t,l),b=n=>(a=null,s&&null!==u?d(n):l),T=n=>{if(null===o)return!0;const e=n-o;return e>=t||e<0||m&&n-i>=g},p=()=>{const n=Date.now();if(T(n))return b(n);a=setTimeout(p,(n=>{const e=t-(null===o?0:n-o),l=g-(n-i);return m?Math.min(e,l):e})(n))},h=function(...n){const e=Date.now(),s=T(e);if(u=n,r=this,o=e,s){if(null===a)return i=f=e,a=setTimeout(p,t),c&&null!==u?d(f):l;if(m)return clearTimeout(a),a=setTimeout(p,t),d(e)}var f;return null===a&&(a=setTimeout(p,t)),l};return h.cancel=()=>{null!==a&&clearTimeout(a),i=0,o=u=r=a=null},h.flush=()=>null===a?l:b(Date.now()),h}),o;var n}function a(){return e||(e=1,function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const t=i();n.throttle=function(n,e=0,l={}){const{leading:u=!0,trailing:r=!0}=l;return t.debounce(n,e,{leading:u,maxWait:e,trailing:r})}}(r)),r}function c(){return u?l:(u=1,l=a().throttle)}const s=n(c());export{s as t};
