index.da1fa078.js 1.1 KB

1
  1. import{R as w,be as g,Z as y,bc as c,bf as O,bg as P}from"./index.5f7ffb46.js";var p;const u=typeof window!="undefined",A=t=>typeof t=="string",j=()=>{};u&&((p=window==null?void 0:window.navigator)==null?void 0:p.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function v(t){return O()?(P(t),!0):!1}function b(t,e=1e3,r={}){const{immediate:a=!0,immediateCallback:o=!1}=r;let n=null;const s=w(!1);function l(){n&&(clearInterval(n),n=null)}function f(){s.value=!1,l()}function i(){c(e)<=0||(s.value=!0,o&&t(),l(),n=setInterval(t,c(e)))}if(a&&u&&i(),g(e)){const _=y(e,()=>{s.value&&u&&i()});v(_)}return v(f),{isActive:s,pause:f,resume:i}}var I=Object.defineProperty,d=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,m=(t,e,r)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,h=(t,e)=>{for(var r in e||(e={}))S.call(e,r)&&m(t,r,e[r]);if(d)for(var r of d(e))$.call(e,r)&&m(t,r,e[r]);return t};function x(t=1e3,e={}){const{controls:r=!1,immediate:a=!0}=e,o=w(0),n=b(()=>o.value+=1,t,{immediate:a});return r?h({counter:o},n):o}export{u as a,b,A as i,j as n,v as t,x as u};