import{Y as y,o as b,W as P,r as g,w as $,$ as h,a0 as F,u}from"./index.965ac11d.js";function q(t){return h()?(F(t),!0):!1}var f;const j=typeof window!="undefined",z=t=>typeof t=="string",B=()=>{};j&&((f=window==null?void 0:window.navigator)==null?void 0:f.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function v(t,r){function n(...e){t(()=>r.apply(this,e),{fn:r,thisArg:this,args:e})}return n}const _=t=>t();function S(t,r={}){let n,e;return i=>{const s=u(t),a=u(r.maxWait);if(n&&clearTimeout(n),s<=0||a!==void 0&&a<=0)return e&&(clearTimeout(e),e=null),i();a&&!e&&(e=setTimeout(()=>{n&&clearTimeout(n),e=null,i()},a)),n=setTimeout(()=>{e&&clearTimeout(e),e=null,i()},s)}}function T(t=_){const r=g(!0);function n(){r.value=!1}function e(){r.value=!0}return{isActive:r,pause:n,resume:e,eventFilter:(...i)=>{r.value&&t(...i)}}}function G(t,r=200,n={}){return v(S(r,n),t)}function H(t,r=!0){y()?b(t):r?t():P(t)}var p=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,A=(t,r)=>{var n={};for(var e in t)x.call(t,e)&&r.indexOf(e)<0&&(n[e]=t[e]);if(t!=null&&p)for(var e of p(t))r.indexOf(e)<0&&D.call(t,e)&&(n[e]=t[e]);return n};function I(t,r,n={}){const e=n,{eventFilter:o=_}=e,i=A(e,["eventFilter"]);return $(t,v(o,r),i)}var E=Object.defineProperty,W=Object.defineProperties,C=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,c=(t,r,n)=>r in t?E(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,M=(t,r)=>{for(var n in r||(r={}))w.call(r,n)&&c(t,n,r[n]);if(l)for(var n of l(r))O.call(r,n)&&c(t,n,r[n]);return t},R=(t,r)=>W(t,C(r)),N=(t,r)=>{var n={};for(var e in t)w.call(t,e)&&r.indexOf(e)<0&&(n[e]=t[e]);if(t!=null&&l)for(var e of l(t))r.indexOf(e)<0&&O.call(t,e)&&(n[e]=t[e]);return n};function J(t,r,n={}){const e=n,{eventFilter:o}=e,i=N(e,["eventFilter"]),{eventFilter:s,pause:a,resume:m,isActive:d}=T(o);return{stop:I(t,r,R(M({},i),{eventFilter:s})),pause:a,resume:m,isActive:d}}export{z as a,q as b,j as i,B as n,H as t,G as u,J as w};
