import{i as T}from"./BEEhNDUU.js";import{i as L,b as N,r as A}from"./B4p9B_f7.js";var M="[object Symbol]";function _(e){return typeof e=="symbol"||L(e)&&N(e)==M}var $=/\s/;function j(e){for(var n=e.length;n--&&$.test(e.charAt(n)););return n}var B=/^\s+/;function F(e){return e&&e.slice(0,j(e)+1).replace(B,"")}var k=NaN,U=/^[-+]0x[0-9a-f]+$/i,X=/^0b[01]+$/i,D=/^0o[0-7]+$/i,G=parseInt;function O(e){if(typeof e=="number")return e;if(_(e))return k;if(T(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=T(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=F(e);var i=X.test(e);return i||D.test(e)?G(e.slice(2),i?2:8):U.test(e)?k:+e}var h=function(){return A.Date.now()},H="Expected a function",P=Math.max,q=Math.min;function z(e,n,i){var a,f,l,o,t,c,d=0,v=!1,s=!1,b=!0;if(typeof e!="function")throw new TypeError(H);n=O(n)||0,T(i)&&(v=!!i.leading,s="maxWait"in i,l=s?P(O(i.maxWait)||0,n):l,b="trailing"in i?!!i.trailing:b);function x(r){var u=a,m=f;return a=f=void 0,d=r,o=e.apply(m,u),o}function S(r){return d=r,t=setTimeout(g,n),v?x(r):o}function W(r){var u=r-c,m=r-d,p=n-u;return s?q(p,l-m):p}function E(r){var u=r-c,m=r-d;return c===void 0||u>=n||u<0||s&&m>=l}function g(){var r=h();if(E(r))return I(r);t=setTimeout(g,W(r))}function I(r){return t=void 0,b&&a?x(r):(a=f=void 0,o)}function R(){t!==void 0&&clearTimeout(t),d=0,a=c=f=t=void 0}function C(){return t===void 0?o:I(h())}function y(){var r=h(),u=E(r);if(a=arguments,f=this,c=r,u){if(t===void 0)return S(c);if(s)return clearTimeout(t),t=setTimeout(g,n),x(c)}return t===void 0&&(t=setTimeout(g,n)),o}return y.cancel=R,y.flush=C,y}var J="Expected a function";function V(e,n,i){var a=!0,f=!0;if(typeof e!="function")throw new TypeError(J);return T(i)&&(a="leading"in i?!!i.leading:a,f="trailing"in i?!!i.trailing:f),z(e,n,{leading:a,maxWait:n,trailing:f})}export{V as t};
