import{u as F,k as S,l as T,n as j,o as A,a as P}from"./@vue_reactivity@3.5.12-IcmYCeX3.js";import{k,n as v,w as g,d as D}from"./@vue_runtime-core@3.5.12-o4JnKqGq.js";function N(t){return j()?(A(t),!0):!1}function x(t){return typeof t=="function"?t():F(t)}const C=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const q=t=>t!=null,I=Object.prototype.toString,z=t=>I.call(t)==="[object Object]",h=()=>{},B=M();function M(){var t,e;return C&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function W(t,e){function n(...o){return new Promise((i,r)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(r)})}return n}const m=t=>t();function G(...t){let e=0,n,o=!0,i=h,r,s,u,a,l;!P(t[0])&&typeof t[0]=="object"?{delay:s,trailing:u=!0,leading:a=!0,rejectOnCancel:l=!1}=t[0]:[s,u=!0,a=!0,l=!1]=t;const d=()=>{n&&(clearTimeout(n),n=void 0,i(),i=h)};return y=>{const c=x(s),p=Date.now()-e,f=()=>r=y();return d(),c<=0?(e=Date.now(),f()):(p>c&&(a||!o)?(e=Date.now(),f()):u&&(r=new Promise((w,O)=>{i=l?O:w,n=setTimeout(()=>{e=Date.now(),o=!0,w(f()),d()},Math.max(0,c-p))})),!a&&!n&&(n=setTimeout(()=>o=!0,c)),o=!1,r)}}function L(t=m){const e=S(!0);function n(){e.value=!1}function o(){e.value=!0}const i=(...r)=>{e.value&&t(...r)};return{isActive:T(e),pause:n,resume:o,eventFilter:i}}function R(t){return D()}function b(t,e,n={}){const{eventFilter:o=m,...i}=n;return g(t,W(o,e),i)}function H(t,e,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:u,isActive:a}=L(o);return{stop:b(t,e,{...i,eventFilter:r}),pause:s,resume:u,isActive:a}}function J(t,e=!0,n){R()?k(t,n):e?t():v(t)}function K(t,e,n){const o=g(t,(...i)=>(v(()=>o()),e(...i)),n);return o}function Q(t,e,n={}){const{throttle:o=0,trailing:i=!0,leading:r=!0,...s}=n;return b(t,e,{...s,eventFilter:G(o,i,r)})}export{J as a,z as b,q as c,N as d,B as e,K as f,Q as g,C as i,h as n,x as t,H as w};