var t="object"==typeof global&&global&&global.Object===Object&&global,n="object"==typeof self&&self&&self.Object===Object&&self,r=t||n||Function("return this")(),e=r.Symbol,o=Object.prototype,i=o.hasOwnProperty,u=o.toString,f=e?e.toStringTag:void 0,c=Object.prototype.toString,a=e?e.toStringTag:void 0;function v(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?function(t){var n=i.call(t,f),r=t[f];try{t[f]=void 0;var e=!0}catch(c){}var o=u.call(t);return e&&(n?t[f]=r:delete t[f]),o}(t):function(t){return c.call(t)}(t)}function l(t){return null!=t&&"object"==typeof t}function b(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}var s=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,y=/^0o[0-7]+$/i,j=parseInt;function m(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||l(t)&&"[object Symbol]"==v(t)}(t))return NaN;if(b(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=b(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var r=p.test(t);return r||y.test(t)?j(t.slice(2),r?2:8):d.test(t)?NaN:+t}var g=function(){return r.Date.now()},T=Math.max,h=Math.min;function N(t,n,r){var e,o,i,u,f,c,a=0,v=!1,l=!1,s=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(n){var r=e,i=o;return e=o=void 0,a=n,u=t.apply(i,r)}function p(t){return a=t,f=setTimeout(j,n),v?d(t):u}function y(t){var r=t-c;return void 0===c||r>=n||r<0||l&&t-a>=i}function j(){var t=g();if(y(t))return N(t);f=setTimeout(j,function(t){var r=n-(t-c);return l?h(r,i-(t-a)):r}(t))}function N(t){return f=void 0,s&&e?d(t):(e=o=void 0,u)}function O(){var t=g(),r=y(t);if(e=arguments,o=this,c=t,r){if(void 0===f)return p(c);if(l)return clearTimeout(f),f=setTimeout(j,n),d(c)}return void 0===f&&(f=setTimeout(j,n)),u}return n=m(n)||0,b(r)&&(v=!!r.leading,i=(l="maxWait"in r)?T(m(r.maxWait)||0,n):i,s="trailing"in r?!!r.trailing:s),O.cancel=function(){void 0!==f&&clearTimeout(f),a=0,e=c=o=f=void 0},O.flush=function(){return void 0===f?u:N(g())},O}export{l as a,v as b,N as d,t as f,b as i,r}