1import{a as R}from"./chunk-QZ55RY24.js";import{c as P}from"./chunk-5TBO732O.js";var r=P(R());function j(a,n,c,s){var p=this,i=(0,r.useRef)(null),o=(0,r.useRef)(0),l=(0,r.useRef)(0),t=(0,r.useRef)(null),f=(0,r.useRef)([]),m=(0,r.useRef)(),v=(0,r.useRef)(),W=(0,r.useRef)(a),d=(0,r.useRef)(!0);W.current=a;var y=typeof window<"u",w=!n&&n!==0&&y;if(typeof a!="function")throw new TypeError("Expected a function");n=+n||0;var D=!!(c=c||{}).leading,k=!("trailing"in c)||!!c.trailing,g="maxWait"in c,C="debounceOnServer"in c&&!!c.debounceOnServer,T=g?Math.max(+c.maxWait||0,n):null;(0,r.useEffect)(function(){return d.current=!0,function(){d.current=!1}},[]);var S=(0,r.useMemo)(function(){var F=function(e){var u=f.current,x=m.current;return f.current=m.current=null,o.current=e,l.current=l.current||e,v.current=W.current.apply(x,u)},b=function(e,u){w&&cancelAnimationFrame(t.current),t.current=w?requestAnimationFrame(e):setTimeout(e,u)},E=function(e){if(!d.current)return!1;var u=e-i.current;return!i.current||u>=n||u<0||g&&e-o.current>=T},M=function(e){return t.current=null,k&&f.current?F(e):(f.current=m.current=null,v.current)},A=function e(){var u=Date.now();if(D&&l.current===o.current&&q(),E(u))return M(u);if(d.current){var x=n-(u-i.current),O=g?Math.min(x,T-(u-o.current)):x;b(e,O)}},q=function(){s&&s({})},h=function(){if(y||C){var e=Date.now(),u=E(e);if(f.current=[].slice.call(arguments),m.current=p,i.current=e,u){if(!t.current&&d.current)return o.current=i.current,b(A,n),D?F(i.current):v.current;if(g)return b(A,n),F(i.current)}return t.current||b(A,n),v.current}};return h.cancel=function(){t.current&&(w?cancelAnimationFrame(t.current):clearTimeout(t.current)),o.current=0,f.current=i.current=m.current=t.current=null},h.isPending=function(){return!!t.current},h.flush=function(){return t.current?M(Date.now()):v.current},h},[D,g,n,T,k,w,y,C,s]);return S}function z(a,n){return a===n}function B(a,n,c){var s=c&&c.equalityFn||z,p=(0,r.useRef)(a),i=(0,r.useState)({})[1],o=j((0,r.useCallback)(function(t){p.current=t,i({})},[i]),n,c,i),l=(0,r.useRef)(a);return s(l.current,a)||(o(a),l.current=a),[p.current,o]}export{B as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.