@vueuse/components 12.2.0 → 12.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- (function(h,U,o,f){"use strict";const ge=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return U.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),A=f.isClient?window:void 0;function M(e){var t;const n=f.toValue(e);return(t=n?.$el)!=null?t:n}function R(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=A):[t,n,r,a]=e,!t)return f.noop;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],s=()=>{i.forEach(c=>c()),i.length=0},l=(c,u,p,S)=>(c.addEventListener(u,p,S),()=>c.removeEventListener(u,p,S)),m=o.watch(()=>[M(t),f.toValue(a)],([c,u])=>{if(s(),!c)return;const p=f.isObject(u)?{...u}:u;i.push(...n.flatMap(S=>r.map(w=>l(c,S,w,p))))},{immediate:!0,flush:"post"}),d=()=>{m(),s()};return f.tryOnScopeDispose(d),d}let q=!1;function Q(e,t,n={}){const{window:r=A,ignore:a=[],capture:i=!0,detectIframe:s=!1}=n;if(!r)return f.noop;f.isIOS&&!q&&(q=!0,Array.from(r.document.body.children).forEach(v=>v.addEventListener("click",f.noop)),r.document.documentElement.addEventListener("click",f.noop));let l=!0;const m=v=>f.toValue(a).some(y=>{if(typeof y=="string")return Array.from(r.document.querySelectorAll(y)).some(g=>g===v.target||v.composedPath().includes(g));{const g=M(y);return g&&(v.target===g||v.composedPath().includes(g))}});function d(v){const y=f.toValue(v);return y&&y.$.subTree.shapeFlag===16}function c(v,y){const g=f.toValue(v),E=g.$.subTree&&g.$.subTree.children;return E==null||!Array.isArray(E)?!1:E.some(V=>V.el===y.target||y.composedPath().includes(V.el))}const u=v=>{const y=M(e);if(v.target!=null&&!(!(y instanceof Element)&&d(e)&&c(e,v))&&!(!y||y===v.target||v.composedPath().includes(y))){if(v.detail===0&&(l=!m(v)),!l){l=!0;return}t(v)}};let p=!1;const S=[R(r,"click",v=>{p||(p=!0,setTimeout(()=>{p=!1},0),u(v))},{passive:!0,capture:i}),R(r,"pointerdown",v=>{const y=M(e);l=!m(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),s&&R(r,"blur",v=>{setTimeout(()=>{var y;const g=M(e);((y=r.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!g?.contains(r.document.activeElement)&&t(v)},0)})].filter(Boolean);return()=>S.forEach(v=>v())}const Z={mounted(e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=Q(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=Q(e,r,Object.assign({capture:n},a))}},unmounted(e){e.__onClickOutside_stop()}};function he(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ee(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:a=A,eventName:i="keydown",passive:s=!1,dedupe:l=!1}=r,m=he(t);return R(a,i,c=>{c.repeat&&f.toValue(l)||m(c)&&n(c)},s)}const ye={mounted(e,t){var n,r;const a=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")ee(a,t.value,{target:e});else{const[i,s]=t.value;ee(a,i,{target:e,...s})}}},we=500,Ue=10;function x(e,t,n){var r,a;const i=o.computed(()=>M(e));let s,l,m,d=!1;function c(){s&&(clearTimeout(s),s=void 0),l=void 0,m=void 0,d=!1}function u(g){var E,V,P;const[D,z,C]=[m,l,d];if(c(),!n?.onMouseUp||!z||!D||(E=n?.modifiers)!=null&&E.self&&g.target!==i.value)return;(V=n?.modifiers)!=null&&V.prevent&&g.preventDefault(),(P=n?.modifiers)!=null&&P.stop&&g.stopPropagation();const T=g.x-z.x,L=g.y-z.y,b=Math.sqrt(T*T+L*L);n.onMouseUp(g.timeStamp-D,b,C)}function p(g){var E,V,P,D;(E=n?.modifiers)!=null&&E.self&&g.target!==i.value||(c(),(V=n?.modifiers)!=null&&V.prevent&&g.preventDefault(),(P=n?.modifiers)!=null&&P.stop&&g.stopPropagation(),l={x:g.x,y:g.y},m=g.timeStamp,s=setTimeout(()=>{d=!0,t(g)},(D=n?.delay)!=null?D:we))}function S(g){var E,V,P,D;if((E=n?.modifiers)!=null&&E.self&&g.target!==i.value||!l||n?.distanceThreshold===!1)return;(V=n?.modifiers)!=null&&V.prevent&&g.preventDefault(),(P=n?.modifiers)!=null&&P.stop&&g.stopPropagation();const z=g.x-l.x,C=g.y-l.y;Math.sqrt(z*z+C*C)>=((D=n?.distanceThreshold)!=null?D:Ue)&&c()}const w={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},v=[R(i,"pointerdown",p,w),R(i,"pointermove",S,w),R(i,["pointerup","pointerleave"],u,w)];return()=>v.forEach(g=>g())}const Se=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return x(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),te={mounted(e,t){typeof t.value=="function"?x(e,t.value,{modifiers:t.modifiers}):x(e,...t.value)}},be=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:U.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ce=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(U.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Ee=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(U.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(U.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B="__vueuse_ssr_handlers__",Oe=Ve();function Ve(){return B in N||(N[B]=N[B]||{}),N[B]}function ne(e,t){return Oe[e]||t}const _e=Symbol("vueuse-ssr-width");function De(){const e=o.hasInjectionContext()?f.injectLocal(_e,null):null;return typeof e=="number"?e:void 0}function Le(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function H(e){const t=Le();return o.computed(()=>(t.value,!!e()))}function Te(e,t={}){const{window:n=A,ssrWidth:r=De()}=t,a=H(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=o.ref(typeof r=="number");let s;const l=o.ref(!1),m=u=>{l.value=u.matches},d=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",m):s.removeListener(m))},c=o.watchEffect(()=>{if(i.value){i.value=!a.value;const u=f.toValue(e).split(",");l.value=u.some(p=>{const S=p.includes("not all"),w=p.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),v=p.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let y=!!(w||v);return w&&y&&(y=r>=f.pxValue(w[1])),v&&y&&(y=r<=f.pxValue(v[1])),S?!y:y});return}a.value&&(d(),s=n.matchMedia(f.toValue(e)),"addEventListener"in s?s.addEventListener("change",m):s.addListener(m),l.value=s.matches)});return f.tryOnScopeDispose(()=>{c(),d(),s=void 0}),o.computed(()=>l.value)}function Me(e){return Te("(prefers-color-scheme: dark)",e)}function ke(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ae={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},oe="vueuse-storage";function Re(e,t,n,r={}){var a;const{flush:i="pre",deep:s=!0,listenToStorageChanges:l=!0,writeDefaults:m=!0,mergeDefaults:d=!1,shallow:c,window:u=A,eventFilter:p,onError:S=b=>{console.error(b)},initOnMounted:w}=r,v=(c?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=ne("getDefaultStorage",()=>{var b;return(b=A)==null?void 0:b.localStorage})()}catch(b){S(b)}if(!n)return v;const y=f.toValue(t),g=ke(y),E=(a=r.serializer)!=null?a:Ae[g],{pause:V,resume:P}=f.pausableWatch(v,()=>z(v.value),{flush:i,deep:s,eventFilter:p});u&&l&&f.tryOnMounted(()=>{n instanceof Storage?R(u,"storage",T):R(u,oe,L),w&&T()}),w||T();function D(b,O){if(u){const _={key:e,oldValue:b,newValue:O,storageArea:n};u.dispatchEvent(n instanceof Storage?new StorageEvent("storage",_):new CustomEvent(oe,{detail:_}))}}function z(b){try{const O=n.getItem(e);if(b==null)D(O,null),n.removeItem(e);else{const _=E.write(b);O!==_&&(n.setItem(e,_),D(O,_))}}catch(O){S(O)}}function C(b){const O=b?b.newValue:n.getItem(e);if(O==null)return m&&y!=null&&n.setItem(e,E.write(y)),y;if(!b&&d){const _=E.read(O);return typeof d=="function"?d(_,y):g==="object"&&!Array.isArray(_)?{...y,..._}:_}else return typeof O!="string"?O:E.read(O)}function T(b){if(!(b&&b.storageArea!==n)){if(b&&b.key==null){v.value=y;return}if(!(b&&b.key!==e)){V();try{b?.newValue!==E.write(v.value)&&(v.value=C(b))}catch(O){S(O)}finally{b?o.nextTick(P):P()}}}}function L(b){T(b.detail)}return v}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ie(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=A,storage:i,storageKey:s="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:m,emitAuto:d,disableTransition:c=!0}=e,u={auto:"",light:"light",dark:"dark",...e.modes||{}},p=Me({window:a}),S=o.computed(()=>p.value?"dark":"light"),w=m||(s==null?f.toRef(r):Re(s,r,i,{window:a,listenToStorageChanges:l})),v=o.computed(()=>w.value==="auto"?S.value:w.value),y=ne("updateHTMLAttrs",(P,D,z)=>{const C=typeof P=="string"?a?.document.querySelector(P):M(P);if(!C)return;const T=new Set,L=new Set;let b=null;if(D==="class"){const _=z.split(/\s/g);Object.values(u).flatMap(k=>(k||"").split(/\s/g)).filter(Boolean).forEach(k=>{_.includes(k)?T.add(k):L.add(k)})}else b={key:D,value:z};if(T.size===0&&L.size===0&&b===null)return;let O;c&&(O=a.document.createElement("style"),O.appendChild(document.createTextNode(ze)),a.document.head.appendChild(O));for(const _ of T)C.classList.add(_);for(const _ of L)C.classList.remove(_);b&&C.setAttribute(b.key,b.value),c&&(a.getComputedStyle(O).opacity,document.head.removeChild(O))});function g(P){var D;y(t,n,(D=u[P])!=null?D:P)}function E(P){e.onChanged?e.onChanged(P,g):g(P)}o.watch(v,E,{flush:"post",immediate:!0}),f.tryOnMounted(()=>E(v.value));const V=o.computed({get(){return d?w.value:v.value},set(P){w.value=P}});return Object.assign(V,{store:w,system:S,state:v})}const We=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ie(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Ne=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=U.useDark(e),r=o.reactive({isDark:n,toggleDark:f.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Be=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=U.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),He=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(U.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:U.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Fe=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(U.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),Ke=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:U.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var c;return(c=e.handle)!=null?c:n.value}),a=o.computed(()=>{var c;return(c=e.containerElement)!=null?c:void 0}),i=o.computed(()=>!!e.disabled),s=e.storageKey&&U.useStorage(e.storageKey,f.toValue(e.initialValue)||{x:0,y:0},U.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),l=s||e.initialValue||{x:0,y:0},m=(c,u)=>{var p;(p=e.onEnd)==null||p.call(e,c,u),s&&(s.value.x=c.x,s.value.y=c.y)},d=o.reactive(U.useDraggable(n,{...e,handle:r,initialValue:l,onEnd:m,disabled:i,containerElement:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${d.style}`},t.default(d))}}}),Ge=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(U.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function re(e,t={}){const{delayEnter:n=0,delayLeave:r=0,window:a=A}=t,i=o.ref(!1);let s;const l=m=>{const d=m?n:r;s&&(clearTimeout(s),s=void 0),d?s=setTimeout(()=>i.value=m,d):i.value=m};return a&&(R(e,"mouseenter",()=>l(!0),{passive:!0}),R(e,"mouseleave",()=>l(!1),{passive:!0})),i}const Je={mounted(e,t){const n=t.value;if(typeof n=="function"){const r=re(e);o.watch(r,a=>n(a))}else{const[r,a]=n,i=re(e,a);o.watch(i,s=>r(s))}}},$e=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(U.useElementSize(n,{width:e.width,height:e.height},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function G(e,t,n={}){const{window:r=A,...a}=n;let i;const s=H(()=>r&&"ResizeObserver"in r),l=()=>{i&&(i.disconnect(),i=void 0)},m=o.computed(()=>{const u=f.toValue(e);return Array.isArray(u)?u.map(p=>M(p)):[M(u)]}),d=o.watch(m,u=>{if(l(),s.value&&r){i=new ResizeObserver(t);for(const p of u)p&&i.observe(p,a)}},{immediate:!0,flush:"post"}),c=()=>{l(),d()};return f.tryOnScopeDispose(c),{isSupported:s,stop:c}}function Ye(e,t={width:0,height:0},n={}){const{window:r=A,box:a="content-box"}=n,i=o.computed(()=>{var u,p;return(p=(u=M(e))==null?void 0:u.namespaceURI)==null?void 0:p.includes("svg")}),s=o.ref(t.width),l=o.ref(t.height),{stop:m}=G(e,([u])=>{const p=a==="border-box"?u.borderBoxSize:a==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(r&&i.value){const S=M(e);if(S){const w=S.getBoundingClientRect();s.value=w.width,l.value=w.height}}else if(p){const S=Array.isArray(p)?p:[p];s.value=S.reduce((w,{inlineSize:v})=>w+v,0),l.value=S.reduce((w,{blockSize:v})=>w+v,0)}else s.value=u.contentRect.width,l.value=u.contentRect.height},n);f.tryOnMounted(()=>{const u=M(e);u&&(s.value="offsetWidth"in u?u.offsetWidth:t.width,l.value="offsetHeight"in u?u.offsetHeight:t.height)});const d=o.watch(()=>M(e),u=>{s.value=u?t.width:0,l.value=u?t.height:0});function c(){m(),d()}return{width:s,height:l,stop:c}}const Xe={mounted(e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],a=typeof t.value=="function"?[]:t.value.slice(1),{width:i,height:s}=Ye(e,...a);o.watch([i,s],([l,m])=>r({width:l,height:m}))}},qe=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:U.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function J(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:i=0,window:s=A,immediate:l=!0}=n,m=H(()=>s&&"IntersectionObserver"in s),d=o.computed(()=>{const w=f.toValue(e);return(Array.isArray(w)?w:[w]).map(M).filter(f.notNullish)});let c=f.noop;const u=o.ref(l),p=m.value?o.watch(()=>[d.value,M(r),u.value],([w,v])=>{if(c(),!u.value||!w.length)return;const y=new IntersectionObserver(t,{root:M(v),rootMargin:a,threshold:i});w.forEach(g=>g&&y.observe(g)),c=()=>{y.disconnect(),c=f.noop}},{immediate:l,flush:"post"}):f.noop,S=()=>{c(),p(),u.value=!1};return f.tryOnScopeDispose(S),{isSupported:m,isActive:u,pause(){c(),u.value=!1},resume(){u.value=!0},stop:S}}function $(e,t={}){const{window:n=A,scrollTarget:r,threshold:a=0,rootMargin:i}=t,s=o.ref(!1);return J(e,l=>{let m=s.value,d=0;for(const c of l)c.time>=d&&(d=c.time,m=c.isIntersecting);s.value=m},{root:r,window:n,threshold:a,rootMargin:f.toValue(i)}),s}const Qe={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=$(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=$(e,r);o.watch(a,i=>n(i),{immediate:!0})}}},Ze=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(U.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),et=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(U.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),tt=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(U.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),nt=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(U.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function ot(e,t,n){const{immediate:r=!0,delay:a=0,onError:i=f.noop,onSuccess:s=f.noop,resetOnExecute:l=!0,shallow:m=!0,throwError:d}=n??{},c=m?o.shallowRef(t):o.ref(t),u=o.ref(!1),p=o.ref(!1),S=o.shallowRef(void 0);async function w(g=0,...E){l&&(c.value=t),S.value=void 0,u.value=!1,p.value=!0,g>0&&await f.promiseTimeout(g);const V=typeof e=="function"?e(...E):e;try{const P=await V;c.value=P,u.value=!0,s(P)}catch(P){if(S.value=P,i(P),d)throw P}finally{p.value=!1}return c.value}r&&w(a);const v={state:c,isReady:u,isLoading:p,error:S,execute:w};function y(){return new Promise((g,E)=>{f.until(p).toBe(!1).then(()=>g(v)).catch(E)})}return{...v,then(g,E){return y().then(g,E)}}}async function rt(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:i,sizes:s,class:l,loading:m,crossorigin:d,referrerPolicy:c,width:u,height:p,decoding:S,fetchPriority:w,ismap:v,usemap:y}=e;r.src=a,i!=null&&(r.srcset=i),s!=null&&(r.sizes=s),l!=null&&(r.className=l),m!=null&&(r.loading=m),d!=null&&(r.crossOrigin=d),c!=null&&(r.referrerPolicy=c),u!=null&&(r.width=u),p!=null&&(r.height=p),S!=null&&(r.decoding=S),w!=null&&(r.fetchPriority=w),v!=null&&(r.isMap=v),y!=null&&(r.useMap=y),r.onload=()=>t(r),r.onerror=n})}function at(e,t={}){const n=ot(()=>rt(f.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>f.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const it=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(at(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function j(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const ae=1;function Y(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=f.noop,onScroll:i=f.noop,offset:s={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:m="auto",window:d=A,onError:c=C=>{console.error(C)}}=t,u=o.ref(0),p=o.ref(0),S=o.computed({get(){return u.value},set(C){v(C,void 0)}}),w=o.computed({get(){return p.value},set(C){v(void 0,C)}});function v(C,T){var L,b,O,_;if(!d)return;const k=f.toValue(e);if(!k)return;(O=k instanceof Document?d.document.body:k)==null||O.scrollTo({top:(L=f.toValue(T))!=null?L:w.value,left:(b=f.toValue(C))!=null?b:S.value,behavior:f.toValue(m)});const I=((_=k?.document)==null?void 0:_.documentElement)||k?.documentElement||k;S!=null&&(u.value=I.scrollLeft),w!=null&&(p.value=I.scrollTop)}const y=o.ref(!1),g=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),E=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),V=C=>{y.value&&(y.value=!1,E.left=!1,E.right=!1,E.top=!1,E.bottom=!1,a(C))},P=f.useDebounceFn(V,n+r),D=C=>{var T;if(!d)return;const L=((T=C?.document)==null?void 0:T.documentElement)||C?.documentElement||M(C),{display:b,flexDirection:O,direction:_}=getComputedStyle(L),k=_==="rtl"?-1:1,I=L.scrollLeft;E.left=I<u.value,E.right=I>u.value;const de=I*k<=(s.left||0),me=I*k+L.clientWidth>=L.scrollWidth-(s.right||0)-ae;b==="flex"&&O==="row-reverse"?(g.left=me,g.right=de):(g.left=de,g.right=me),u.value=I;let W=L.scrollTop;C===d.document&&!W&&(W=d.document.body.scrollTop),E.top=W<p.value,E.bottom=W>p.value;const pe=W<=(s.top||0),ve=W+L.clientHeight>=L.scrollHeight-(s.bottom||0)-ae;b==="flex"&&O==="column-reverse"?(g.top=ve,g.bottom=pe):(g.top=pe,g.bottom=ve),p.value=W},z=C=>{var T;if(!d)return;const L=(T=C.target.documentElement)!=null?T:C.target;D(L),y.value=!0,P(C),i(C)};return R(e,"scroll",n?f.useThrottleFn(z,n,!0,!1):z,l),f.tryOnMounted(()=>{try{const C=f.toValue(e);if(!C)return;D(C)}catch(C){c(C)}}),R(e,"scrollend",V,l),{x:S,y:w,isScrolling:y,arrivedState:g,directions:E,measure(){const C=f.toValue(e);d&&C&&D(C)}}}function ie(e,t,n={}){var r;const{direction:a="bottom",interval:i=100,canLoadMore:s=()=>!0}=n,l=o.reactive(Y(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),m=o.ref(),d=o.computed(()=>!!m.value),c=o.computed(()=>j(f.toValue(e))),u=$(c);function p(){if(l.measure(),!c.value||!u.value||!s(c.value))return;const{scrollHeight:w,clientHeight:v,scrollWidth:y,clientWidth:g}=c.value,E=a==="bottom"||a==="top"?w<=v:y<=g;(l.arrivedState[a]||E)&&(m.value||(m.value=Promise.all([t(l),new Promise(V=>setTimeout(V,i))]).finally(()=>{m.value=null,o.nextTick(()=>p())})))}const S=o.watch(()=>[l.arrivedState[a],u.value],p,{immediate:!0});return f.tryOnUnmounted(S),{isLoading:d,reset(){o.nextTick(()=>p())}}}const st={mounted(e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},lt={mounted(e,t){typeof t.value=="function"?J(e,t.value):J(e,...t.value)}},ut=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(U.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),ct=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(U.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),ft=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(U.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),dt=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(U.useNetwork());return()=>{if(t.default)return t.default(n)}}}),mt=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(U.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=f.toRef(e,"object"),r=U.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),vt=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const r=o.reactive(U.useOffsetPagination({...e,onPageChange(...a){var i;(i=e.onPageChange)==null||i.call(e,...a),n("page-change",...a)},onPageSizeChange(...a){var i;(i=e.onPageSizeChange)==null||i.call(e,...a),n("page-size-change",...a)},onPageCountChange(...a){var i;(i=e.onPageCountChange)==null||i.call(e,...a),n("page-count-change",...a)}}));return()=>{if(t.default)return t.default(r)}}}),gt=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:U.useOnline()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:U.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(U.usePointer({...e,target:e.target==="self"?n:A}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),wt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(U.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Ut=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:U.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),St=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:U.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:U.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),Ct=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:U.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),Et=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:U.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:U.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),Ot={mounted(e,t){typeof t.value=="function"?G(e,t.value):G(e,...t.value)}};function Vt(e,t,n={}){const{window:r=A,...a}=n;let i;const s=H(()=>r&&"MutationObserver"in r),l=()=>{i&&(i.disconnect(),i=void 0)},m=o.computed(()=>{const p=f.toValue(e),S=(Array.isArray(p)?p:[p]).map(M).filter(f.notNullish);return new Set(S)}),d=o.watch(()=>m.value,p=>{l(),s.value&&p.size&&(i=new MutationObserver(t),p.forEach(S=>i.observe(S,a)))},{immediate:!0,flush:"post"}),c=()=>i?.takeRecords(),u=()=>{d(),l()};return f.tryOnScopeDispose(u),{isSupported:s,stop:u,takeRecords:c}}function F(e,t,n={}){const{window:r=A,initialValue:a,observe:i=!1}=n,s=o.ref(a),l=o.computed(()=>{var d;return M(t)||((d=r?.document)==null?void 0:d.documentElement)});function m(){var d;const c=f.toValue(e),u=f.toValue(l);if(u&&r&&c){const p=(d=r.getComputedStyle(u).getPropertyValue(c))==null?void 0:d.trim();s.value=p||a}}return i&&Vt(l,m,{attributeFilter:["style","class"],window:r}),o.watch([l,()=>f.toValue(e)],(d,c)=>{c[0]&&c[1]&&c[0].style.removeProperty(c[1]),m()},{immediate:!0}),o.watch(s,d=>{var c;const u=f.toValue(e);(c=l.value)!=null&&c.style&&u&&(d==null?l.value.style.removeProperty(u):l.value.style.setProperty(u,d))}),s}const se="--vueuse-safe-area-top",le="--vueuse-safe-area-right",ue="--vueuse-safe-area-bottom",ce="--vueuse-safe-area-left";function _t(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(f.isClient){const i=F(se),s=F(le),l=F(ue),m=F(ce);i.value="env(safe-area-inset-top, 0px)",s.value="env(safe-area-inset-right, 0px)",l.value="env(safe-area-inset-bottom, 0px)",m.value="env(safe-area-inset-left, 0px)",a(),R("resize",f.useDebounceFn(a))}function a(){e.value=K(se),t.value=K(le),n.value=K(ue),r.value=K(ce)}return{top:e,right:t,bottom:n,left:r,update:a}}function K(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Dt=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:a,left:i}=_t();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?a.value:"",paddingLeft:e.left?i.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),Lt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=Y(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=Y(e,{...r,onScroll(i){var s;(s=r.onScroll)==null||s.call(r,i),n(a)},onStop(i){var s;(s=r.onStop)==null||s.call(r,i),n(a)}})}}};function fe(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:fe(n)}}function Tt(e){const t=e||window.event,n=t.target;return fe(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const X=new WeakMap;function Mt(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(f.toRef(e),l=>{const m=j(f.toValue(l));if(m){const d=m;if(X.get(d)||X.set(d,d.style.overflow),d.style.overflow!=="hidden"&&(a=d.style.overflow),d.style.overflow==="hidden")return n.value=!0;if(n.value)return d.style.overflow="hidden"}},{immediate:!0});const i=()=>{const l=j(f.toValue(e));!l||n.value||(f.isIOS&&(r=R(l,"touchmove",m=>{Tt(m)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},s=()=>{const l=j(f.toValue(e));!l||!n.value||(f.isIOS&&r?.(),l.style.overflow=a,X.delete(l),n.value=!1)};return f.tryOnScopeDispose(s),o.computed({get(){return n.value},set(l){l?i():s()}})}function kt(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Mt(n,r.value);o.watch(t,i=>a.value=i)}}const At=kt(),Rt=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(U.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),zt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(U.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),It=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:a,containerProps:i,wrapperProps:s,scrollTo:l}=U.useVirtualList(r,e.options);return n({scrollTo:l}),i.style&&typeof i.style=="object"&&!Array.isArray(i.style)&&(i.style.height=e.height||"300px"),()=>o.h("div",{...i},[o.h("div",{...s.value},a.value.map(m=>o.h("div",{style:{overflow:"hidden",height:m.height}},t.default?t.default(m):"Please set content!")))])}}),Wt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:U.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Nt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(U.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});h.OnClickOutside=ge,h.OnLongPress=Se,h.UseActiveElement=be,h.UseBattery=Ce,h.UseBrowserLocation=Ee,h.UseClipboard=Pe,h.UseColorMode=We,h.UseDark=Ne,h.UseDeviceMotion=Be,h.UseDeviceOrientation=He,h.UseDevicePixelRatio=je,h.UseDevicesList=Fe,h.UseDocumentVisibility=Ke,h.UseDraggable=xe,h.UseElementBounding=Ge,h.UseElementSize=$e,h.UseElementVisibility=qe,h.UseEyeDropper=Ze,h.UseFullscreen=et,h.UseGeolocation=tt,h.UseIdle=nt,h.UseImage=it,h.UseMouse=ut,h.UseMouseInElement=ct,h.UseMousePressed=ft,h.UseNetwork=dt,h.UseNow=mt,h.UseObjectUrl=pt,h.UseOffsetPagination=vt,h.UseOnline=gt,h.UsePageLeave=ht,h.UsePointer=yt,h.UsePointerLock=wt,h.UsePreferredColorScheme=Ut,h.UsePreferredContrast=St,h.UsePreferredDark=bt,h.UsePreferredLanguages=Ct,h.UsePreferredReducedMotion=Et,h.UsePreferredReducedTransparency=Pt,h.UseScreenSafeArea=Dt,h.UseTimeAgo=Rt,h.UseTimestamp=zt,h.UseVirtualList=It,h.UseWindowFocus=Wt,h.UseWindowSize=Nt,h.VOnClickOutside=Z,h.VOnLongPress=te,h.vElementHover=Je,h.vElementSize=Xe,h.vElementVisibility=Qe,h.vInfiniteScroll=st,h.vIntersectionObserver=lt,h.vOnClickOutside=Z,h.vOnKeyStroke=ye,h.vOnLongPress=te,h.vResizeObserver=Ot,h.vScroll=Lt,h.vScrollLock=At})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
1
+ (function(v,C,o,S){"use strict";const ye=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return C.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),R=S.isClient?window:void 0;function M(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function k(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=R):[t,n,r,a]=e,!t)return S.noop;n=S.toArray(n),r=S.toArray(r);const s=[],i=()=>{s.forEach(u=>u()),s.length=0},l=(u,c,p,U)=>(u.addEventListener(c,p,U),()=>u.removeEventListener(c,p,U)),d=o.watch(()=>[M(t),o.toValue(a)],([u,c])=>{if(i(),!u)return;const p=S.isObject(c)?{...c}:c;s.push(...n.flatMap(U=>r.map(w=>l(u,U,w,p))))},{immediate:!0,flush:"post"}),f=()=>{d(),i()};return S.tryOnScopeDispose(f),f}let Q=!1;function Z(e,t,n={}){const{window:r=R,ignore:a=[],capture:s=!0,detectIframe:i=!1}=n;if(!r)return S.noop;S.isIOS&&!Q&&(Q=!0,Array.from(r.document.body.children).forEach(h=>h.addEventListener("click",S.noop)),r.document.documentElement.addEventListener("click",S.noop));let l=!0;const d=h=>o.toValue(a).some(g=>{if(typeof g=="string")return Array.from(r.document.querySelectorAll(g)).some(m=>m===h.target||h.composedPath().includes(m));{const m=M(g);return m&&(h.target===m||h.composedPath().includes(m))}});function f(h){const g=o.toValue(h);return g&&g.$.subTree.shapeFlag===16}function u(h,g){const m=o.toValue(h),b=m.$.subTree&&m.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(P=>P.el===g.target||g.composedPath().includes(P.el))}const c=h=>{const g=M(e);if(h.target!=null&&!(!(g instanceof Element)&&f(e)&&u(e,h))&&!(!g||g===h.target||h.composedPath().includes(g))){if(h.detail===0&&(l=!d(h)),!l){l=!0;return}t(h)}};let p=!1;const U=[k(r,"click",h=>{p||(p=!0,setTimeout(()=>{p=!1},0),c(h))},{passive:!0,capture:s}),k(r,"pointerdown",h=>{const g=M(e);l=!d(h)&&!!(g&&!h.composedPath().includes(g))},{passive:!0}),i&&k(r,"blur",h=>{setTimeout(()=>{var g;const m=M(e);((g=r.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!m?.contains(r.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean);return()=>U.forEach(h=>h())}const ee={mounted(e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=Z(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=Z(e,r,Object.assign({capture:n},a))}},unmounted(e){e.__onClickOutside_stop()}};function ve(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function te(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:a=R,eventName:s="keydown",passive:i=!1,dedupe:l=!1}=r,d=ve(t);return k(a,s,u=>{u.repeat&&o.toValue(l)||d(u)&&n(u)},i)}const we={mounted(e,t){var n,r;const a=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")te(a,t.value,{target:e});else{const[s,i]=t.value;te(a,s,{target:e,...i})}}},Ue=500,Se=10;function X(e,t,n){var r,a;const s=o.computed(()=>M(e));let i,l,d,f=!1;function u(){i&&(clearTimeout(i),i=void 0),l=void 0,d=void 0,f=!1}function c(m){var b,P,O;const[_,A,y]=[d,l,f];if(u(),!n?.onMouseUp||!A||!_||(b=n?.modifiers)!=null&&b.self&&m.target!==s.value)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const T=m.x-A.x,L=m.y-A.y,W=Math.sqrt(T*T+L*L);n.onMouseUp(m.timeStamp-_,W,y)}function p(m){var b,P,O,_;(b=n?.modifiers)!=null&&b.self&&m.target!==s.value||(u(),(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation(),l={x:m.x,y:m.y},d=m.timeStamp,i=setTimeout(()=>{f=!0,t(m)},(_=n?.delay)!=null?_:Ue))}function U(m){var b,P,O,_;if((b=n?.modifiers)!=null&&b.self&&m.target!==s.value||!l||n?.distanceThreshold===!1)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const A=m.x-l.x,y=m.y-l.y;Math.sqrt(A*A+y*y)>=((_=n?.distanceThreshold)!=null?_:Se)&&u()}const w={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},h=[k(s,"pointerdown",p,w),k(s,"pointermove",U,w),k(s,["pointerup","pointerleave"],c,w)];return()=>h.forEach(m=>m())}const be=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return X(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),ne={mounted(e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},Ce=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:C.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ee=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(C.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Oe=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(C.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(C.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H="__vueuse_ssr_handlers__",Ve=_e();function _e(){return H in B||(B[H]=B[H]||{}),B[H]}function oe(e,t){return Ve[e]||t}const De=Symbol("vueuse-ssr-width");function Le(){const e=o.hasInjectionContext()?S.injectLocal(De,null):null;return typeof e=="number"?e:void 0}function Me(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function N(e){const t=Me();return o.computed(()=>(t.value,!!e()))}function Te(e,t={}){const{window:n=R,ssrWidth:r=Le()}=t,a=N(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),s=o.ref(typeof r=="number");let i;const l=o.ref(!1),d=c=>{l.value=c.matches},f=()=>{i&&("removeEventListener"in i?i.removeEventListener("change",d):i.removeListener(d))},u=o.watchEffect(()=>{if(s.value){s.value=!a.value;const c=o.toValue(e).split(",");l.value=c.some(p=>{const U=p.includes("not all"),w=p.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=p.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let g=!!(w||h);return w&&g&&(g=r>=S.pxValue(w[1])),h&&g&&(g=r<=S.pxValue(h[1])),U?!g:g});return}a.value&&(f(),i=n.matchMedia(o.toValue(e)),"addEventListener"in i?i.addEventListener("change",d):i.addListener(d),l.value=i.matches)});return S.tryOnScopeDispose(()=>{u(),f(),i=void 0}),o.computed(()=>l.value)}function ke(e){return Te("(prefers-color-scheme: dark)",e)}function Ae(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Re={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},re="vueuse-storage";function We(e,t,n,r={}){var a;const{flush:s="pre",deep:i=!0,listenToStorageChanges:l=!0,writeDefaults:d=!0,mergeDefaults:f=!1,shallow:u,window:c=R,eventFilter:p,onError:U=E=>{console.error(E)},initOnMounted:w}=r,h=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t),g=o.computed(()=>o.toValue(e));if(!n)try{n=oe("getDefaultStorage",()=>{var E;return(E=R)==null?void 0:E.localStorage})()}catch(E){U(E)}if(!n)return h;const m=o.toValue(t),b=Ae(m),P=(a=r.serializer)!=null?a:Re[b],{pause:O,resume:_}=S.pausableWatch(h,()=>y(h.value),{flush:s,deep:i,eventFilter:p});o.watch(g,()=>L(),{flush:s}),c&&l&&S.tryOnMounted(()=>{n instanceof Storage?k(c,"storage",L,{passive:!0}):k(c,re,W),w&&L()}),w||L();function A(E,D){if(c){const V={key:g.value,oldValue:E,newValue:D,storageArea:n};c.dispatchEvent(n instanceof Storage?new StorageEvent("storage",V):new CustomEvent(re,{detail:V}))}}function y(E){try{const D=n.getItem(g.value);if(E==null)A(D,null),n.removeItem(g.value);else{const V=P.write(E);D!==V&&(n.setItem(g.value,V),A(D,V))}}catch(D){U(D)}}function T(E){const D=E?E.newValue:n.getItem(g.value);if(D==null)return d&&m!=null&&n.setItem(g.value,P.write(m)),m;if(!E&&f){const V=P.read(D);return typeof f=="function"?f(V,m):b==="object"&&!Array.isArray(V)?{...m,...V}:V}else return typeof D!="string"?D:P.read(D)}function L(E){if(!(E&&E.storageArea!==n)){if(E&&E.key==null){h.value=m;return}if(!(E&&E.key!==g.value)){O();try{E?.newValue!==P.write(h.value)&&(h.value=T(E))}catch(D){U(D)}finally{E?o.nextTick(_):_()}}}}function W(E){L(E.detail)}return h}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ie(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=R,storage:s,storageKey:i="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:d,emitAuto:f,disableTransition:u=!0}=e,c={auto:"",light:"light",dark:"dark",...e.modes||{}},p=ke({window:a}),U=o.computed(()=>p.value?"dark":"light"),w=d||(i==null?S.toRef(r):We(i,r,s,{window:a,listenToStorageChanges:l})),h=o.computed(()=>w.value==="auto"?U.value:w.value),g=oe("updateHTMLAttrs",(O,_,A)=>{const y=typeof O=="string"?a?.document.querySelector(O):M(O);if(!y)return;const T=new Set,L=new Set;let W=null;if(_==="class"){const D=A.split(/\s/g);Object.values(c).flatMap(V=>(V||"").split(/\s/g)).filter(Boolean).forEach(V=>{D.includes(V)?T.add(V):L.add(V)})}else W={key:_,value:A};if(T.size===0&&L.size===0&&W===null)return;let E;u&&(E=a.document.createElement("style"),E.appendChild(document.createTextNode(ze)),a.document.head.appendChild(E));for(const D of T)y.classList.add(D);for(const D of L)y.classList.remove(D);W&&y.setAttribute(W.key,W.value),u&&(a.getComputedStyle(E).opacity,document.head.removeChild(E))});function m(O){var _;g(t,n,(_=c[O])!=null?_:O)}function b(O){e.onChanged?e.onChanged(O,m):m(O)}o.watch(h,b,{flush:"post",immediate:!0}),S.tryOnMounted(()=>b(h.value));const P=o.computed({get(){return f?w.value:h.value},set(O){w.value=O}});return Object.assign(P,{store:w,system:U,state:h})}const Be=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ie(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),He=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=C.useDark(e),r=o.reactive({isDark:n,toggleDark:S.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ne=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=C.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),Fe=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(C.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:C.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(C.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:C.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var u;return(u=e.handle)!=null?u:n.value}),a=o.computed(()=>{var u;return(u=e.containerElement)!=null?u:void 0}),s=o.computed(()=>!!e.disabled),i=e.storageKey&&C.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},C.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),l=i||e.initialValue||{x:0,y:0},d=(u,c)=>{var p;(p=e.onEnd)==null||p.call(e,u,c),i&&(i.value.x=u.x,i.value.y=u.y)},f=o.reactive(C.useDraggable(n,{...e,handle:r,initialValue:l,onEnd:d,disabled:s,containerElement:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${f.style}`},t.default(f))}}}),Ke=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function K(e,t,n={}){const{window:r=R,...a}=n;let s;const i=N(()=>r&&"MutationObserver"in r),l=()=>{s&&(s.disconnect(),s=void 0)},d=o.computed(()=>{const p=o.toValue(e),U=S.toArray(p).map(M).filter(S.notNullish);return new Set(U)}),f=o.watch(()=>d.value,p=>{l(),i.value&&p.size&&(s=new MutationObserver(t),p.forEach(U=>s.observe(U,a)))},{immediate:!0,flush:"post"}),u=()=>s?.takeRecords(),c=()=>{f(),l()};return S.tryOnScopeDispose(c),{isSupported:i,stop:c,takeRecords:u}}function F(e,t,n={}){const{window:r=R,...a}=n;let s;const i=N(()=>r&&"ResizeObserver"in r),l=()=>{s&&(s.disconnect(),s=void 0)},d=o.computed(()=>{const c=o.toValue(e);return Array.isArray(c)?c.map(p=>M(p)):[M(c)]}),f=o.watch(d,c=>{if(l(),i.value&&r){s=new ResizeObserver(t);for(const p of c)p&&s.observe(p,a)}},{immediate:!0,flush:"post"}),u=()=>{l(),f()};return S.tryOnScopeDispose(u),{isSupported:i,stop:u}}function Ge(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:a=!0,immediate:s=!0,updateTiming:i="sync"}=t,l=o.ref(0),d=o.ref(0),f=o.ref(0),u=o.ref(0),c=o.ref(0),p=o.ref(0),U=o.ref(0),w=o.ref(0);function h(){const m=M(e);if(!m){n&&(l.value=0,d.value=0,f.value=0,u.value=0,c.value=0,p.value=0,U.value=0,w.value=0);return}const b=m.getBoundingClientRect();l.value=b.height,d.value=b.bottom,f.value=b.left,u.value=b.right,c.value=b.top,p.value=b.width,U.value=b.x,w.value=b.y}function g(){i==="sync"?h():i==="next-frame"&&requestAnimationFrame(()=>h())}return F(e,g),o.watch(()=>M(e),m=>!m&&g()),K(e,g,{attributeFilter:["style","class"]}),a&&k("scroll",g,{capture:!0,passive:!0}),r&&k("resize",g,{passive:!0}),S.tryOnMounted(()=>{s&&g()}),{height:l,bottom:d,left:f,right:u,top:c,width:p,x:U,y:w,update:g}}const Je={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,{height:a,bottom:s,left:i,right:l,top:d,width:f,x:u,y:c}=Ge(e,r);o.watch([a,s,i,l,d,f,u,c],()=>n({height:a,bottom:s,left:i,right:l,top:d,width:f,x:u,y:c}))}};function $e(e,t,n={}){const{window:r=R,document:a=r?.document,flush:s="sync"}=n;if(!r||!a)return S.noop;let i;const l=u=>{i?.(),i=u},d=o.watchEffect(()=>{const u=M(e);if(u){const{stop:c}=K(a,p=>{p.map(w=>[...w.removedNodes]).flat().some(w=>w===u||w.contains(u))&&t(p)},{window:r,childList:!0,subtree:!0});l(c)}},{flush:s}),f=()=>{d(),l()};return S.tryOnScopeDispose(f),f}function ae(e,t={}){const{delayEnter:n=0,delayLeave:r=0,triggerOnRemoval:a=!1,window:s=R}=t,i=o.ref(!1);let l;const d=f=>{const u=f?n:r;l&&(clearTimeout(l),l=void 0),u?l=setTimeout(()=>i.value=f,u):i.value=f};return s&&(k(e,"mouseenter",()=>d(!0),{passive:!0}),k(e,"mouseleave",()=>d(!1),{passive:!0}),a&&$e(o.computed(()=>M(e)),()=>d(!1))),i}const qe={mounted(e,t){const n=t.value;if(typeof n=="function"){const r=ae(e);o.watch(r,a=>n(a))}else{const[r,a]=n,s=ae(e,a);o.watch(s,i=>r(i))}}},Qe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementSize(n,{width:e.width,height:e.height},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Ze(e,t={width:0,height:0},n={}){const{window:r=R,box:a="content-box"}=n,s=o.computed(()=>{var c,p;return(p=(c=M(e))==null?void 0:c.namespaceURI)==null?void 0:p.includes("svg")}),i=o.ref(t.width),l=o.ref(t.height),{stop:d}=F(e,([c])=>{const p=a==="border-box"?c.borderBoxSize:a==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(r&&s.value){const U=M(e);if(U){const w=U.getBoundingClientRect();i.value=w.width,l.value=w.height}}else if(p){const U=S.toArray(p);i.value=U.reduce((w,{inlineSize:h})=>w+h,0),l.value=U.reduce((w,{blockSize:h})=>w+h,0)}else i.value=c.contentRect.width,l.value=c.contentRect.height},n);S.tryOnMounted(()=>{const c=M(e);c&&(i.value="offsetWidth"in c?c.offsetWidth:t.width,l.value="offsetHeight"in c?c.offsetHeight:t.height)});const f=o.watch(()=>M(e),c=>{i.value=c?t.width:0,l.value=c?t.height:0});function u(){d(),f()}return{width:i,height:l,stop:u}}const et={mounted(e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],a=typeof t.value=="function"?[]:t.value.slice(1),{width:s,height:i}=Ze(e,...a);o.watch([s,i],([l,d])=>r({width:l,height:d}))}},tt=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:C.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function G(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:s=0,window:i=R,immediate:l=!0}=n,d=N(()=>i&&"IntersectionObserver"in i),f=o.computed(()=>{const w=o.toValue(e);return S.toArray(w).map(M).filter(S.notNullish)});let u=S.noop;const c=o.ref(l),p=d.value?o.watch(()=>[f.value,M(r),c.value],([w,h])=>{if(u(),!c.value||!w.length)return;const g=new IntersectionObserver(t,{root:M(h),rootMargin:a,threshold:s});w.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=S.noop}},{immediate:l,flush:"post"}):S.noop,U=()=>{u(),p(),c.value=!1};return S.tryOnScopeDispose(U),{isSupported:d,isActive:c,pause(){u(),c.value=!1},resume(){c.value=!0},stop:U}}function J(e,t={}){const{window:n=R,scrollTarget:r,threshold:a=0,rootMargin:s}=t,i=o.ref(!1);return G(e,l=>{let d=i.value,f=0;for(const u of l)u.time>=f&&(f=u.time,d=u.isIntersecting);i.value=d},{root:r,window:n,threshold:a,rootMargin:o.toValue(s)}),i}const nt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=J(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=J(e,r);o.watch(a,s=>n(s),{immediate:!0})}}},ot=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(C.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),rt=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),at=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(C.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),st=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(C.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function it(e,t,n){const{immediate:r=!0,delay:a=0,onError:s=S.noop,onSuccess:i=S.noop,resetOnExecute:l=!0,shallow:d=!0,throwError:f}=n??{},u=d?o.shallowRef(t):o.ref(t),c=o.ref(!1),p=o.ref(!1),U=o.shallowRef(void 0);async function w(m=0,...b){l&&(u.value=t),U.value=void 0,c.value=!1,p.value=!0,m>0&&await S.promiseTimeout(m);const P=typeof e=="function"?e(...b):e;try{const O=await P;u.value=O,c.value=!0,i(O)}catch(O){if(U.value=O,s(O),f)throw O}finally{p.value=!1}return u.value}r&&w(a);const h={state:u,isReady:c,isLoading:p,error:U,execute:w};function g(){return new Promise((m,b)=>{S.until(p).toBe(!1).then(()=>m(h)).catch(b)})}return{...h,then(m,b){return g().then(m,b)}}}async function lt(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:s,sizes:i,class:l,loading:d,crossorigin:f,referrerPolicy:u,width:c,height:p,decoding:U,fetchPriority:w,ismap:h,usemap:g}=e;r.src=a,s!=null&&(r.srcset=s),i!=null&&(r.sizes=i),l!=null&&(r.className=l),d!=null&&(r.loading=d),f!=null&&(r.crossOrigin=f),u!=null&&(r.referrerPolicy=u),c!=null&&(r.width=c),p!=null&&(r.height=p),U!=null&&(r.decoding=U),w!=null&&(r.fetchPriority=w),h!=null&&(r.isMap=h),g!=null&&(r.useMap=g),r.onload=()=>t(r),r.onerror=n})}function ut(e,t={}){const n=it(()=>lt(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const ct=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(ut(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function j(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const se=1;function $(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=S.noop,onScroll:s=S.noop,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:d="auto",window:f=R,onError:u=y=>{console.error(y)}}=t,c=o.ref(0),p=o.ref(0),U=o.computed({get(){return c.value},set(y){h(y,void 0)}}),w=o.computed({get(){return p.value},set(y){h(void 0,y)}});function h(y,T){var L,W,E,D;if(!f)return;const V=o.toValue(e);if(!V)return;(E=V instanceof Document?f.document.body:V)==null||E.scrollTo({top:(L=o.toValue(T))!=null?L:w.value,left:(W=o.toValue(y))!=null?W:U.value,behavior:o.toValue(d)});const z=((D=V?.document)==null?void 0:D.documentElement)||V?.documentElement||V;U!=null&&(c.value=z.scrollLeft),w!=null&&(p.value=z.scrollTop)}const g=o.ref(!1),m=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),b=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),P=y=>{g.value&&(g.value=!1,b.left=!1,b.right=!1,b.top=!1,b.bottom=!1,a(y))},O=S.useDebounceFn(P,n+r),_=y=>{var T;if(!f)return;const L=((T=y?.document)==null?void 0:T.documentElement)||y?.documentElement||M(y),{display:W,flexDirection:E,direction:D}=getComputedStyle(L),V=D==="rtl"?-1:1,z=L.scrollLeft;b.left=z<c.value,b.right=z>c.value;const me=z*V<=(i.left||0),pe=z*V+L.clientWidth>=L.scrollWidth-(i.right||0)-se;W==="flex"&&E==="row-reverse"?(m.left=pe,m.right=me):(m.left=me,m.right=pe),c.value=z;let I=L.scrollTop;y===f.document&&!I&&(I=f.document.body.scrollTop),b.top=I<p.value,b.bottom=I>p.value;const he=I<=(i.top||0),ge=I+L.clientHeight>=L.scrollHeight-(i.bottom||0)-se;W==="flex"&&E==="column-reverse"?(m.top=ge,m.bottom=he):(m.top=he,m.bottom=ge),p.value=I},A=y=>{var T;if(!f)return;const L=(T=y.target.documentElement)!=null?T:y.target;_(L),g.value=!0,O(y),s(y)};return k(e,"scroll",n?S.useThrottleFn(A,n,!0,!1):A,l),S.tryOnMounted(()=>{try{const y=o.toValue(e);if(!y)return;_(y)}catch(y){u(y)}}),k(e,"scrollend",P,l),{x:U,y:w,isScrolling:g,arrivedState:m,directions:b,measure(){const y=o.toValue(e);f&&y&&_(y)}}}function ie(e,t,n={}){var r;const{direction:a="bottom",interval:s=100,canLoadMore:i=()=>!0}=n,l=o.reactive($(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),d=o.ref(),f=o.computed(()=>!!d.value),u=o.computed(()=>j(o.toValue(e))),c=J(u);function p(){if(l.measure(),!u.value||!c.value||!i(u.value))return;const{scrollHeight:w,clientHeight:h,scrollWidth:g,clientWidth:m}=u.value,b=a==="bottom"||a==="top"?w<=h:g<=m;(l.arrivedState[a]||b)&&(d.value||(d.value=Promise.all([t(l),new Promise(P=>setTimeout(P,s))]).finally(()=>{d.value=null,o.nextTick(()=>p())})))}const U=o.watch(()=>[l.arrivedState[a],c.value],p,{immediate:!0});return S.tryOnUnmounted(U),{isLoading:f,reset(){o.nextTick(()=>p())}}}const ft={mounted(e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},dt={mounted(e,t){typeof t.value=="function"?G(e,t.value):G(e,...t.value)}},mt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(C.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),ht={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function gt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:r=!1,initialValue:a={x:0,y:0},window:s=R,target:i=s,scroll:l=!0,eventFilter:d}=e;let f=null,u=0,c=0;const p=o.ref(a.x),U=o.ref(a.y),w=o.ref(null),h=typeof t=="function"?t:ht[t],g=y=>{const T=h(y);f=y,T&&([p.value,U.value]=T,w.value="mouse"),s&&(u=s.scrollX,c=s.scrollY)},m=y=>{if(y.touches.length>0){const T=h(y.touches[0]);T&&([p.value,U.value]=T,w.value="touch")}},b=()=>{if(!f||!s)return;const y=h(f);f instanceof MouseEvent&&y&&(p.value=y[0]+s.scrollX-u,U.value=y[1]+s.scrollY-c)},P=()=>{p.value=a.x,U.value=a.y},O=d?y=>d(()=>g(y),{}):y=>g(y),_=d?y=>d(()=>m(y),{}):y=>m(y),A=d?()=>d(()=>b(),{}):()=>b();if(i){const y={passive:!0};k(i,["mousemove","dragover"],O,y),n&&t!=="movement"&&(k(i,["touchstart","touchmove"],_,y),r&&k(i,"touchend",P,y)),l&&t==="page"&&k(s,"scroll",A,y)}return{x:p,y:U,sourceType:w}}function yt(e,t={}){const{handleOutside:n=!0,window:r=R}=t,a=t.type||"page",{x:s,y:i,sourceType:l}=gt(t),d=o.ref(e??r?.document.body),f=o.ref(0),u=o.ref(0),c=o.ref(0),p=o.ref(0),U=o.ref(0),w=o.ref(0),h=o.ref(!0);let g=()=>{};return r&&(g=o.watch([d,s,i],()=>{const m=M(d);if(!m||!(m instanceof Element))return;const{left:b,top:P,width:O,height:_}=m.getBoundingClientRect();c.value=b+(a==="page"?r.pageXOffset:0),p.value=P+(a==="page"?r.pageYOffset:0),U.value=_,w.value=O;const A=s.value-c.value,y=i.value-p.value;h.value=O===0||_===0||A<0||y<0||A>O||y>_,(n||!h.value)&&(f.value=A,u.value=y)},{immediate:!0}),k(document,"mouseleave",()=>h.value=!0,{passive:!0})),{x:s,y:i,sourceType:l,elementX:f,elementY:u,elementPositionX:c,elementPositionY:p,elementHeight:U,elementWidth:w,isOutside:h,stop:g}}const vt={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,a=S.reactiveOmit(o.reactive(yt(e,r)),"stop");o.watch(a,s=>n(s))}},wt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Ut=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(C.useNetwork());return()=>{if(t.default)return t.default(n)}}}),St=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(C.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=S.toRef(e,"object"),r=C.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),Ct=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const r=o.reactive(C.useOffsetPagination({...e,onPageChange(...a){var s;(s=e.onPageChange)==null||s.call(e,...a),n("page-change",...a)},onPageSizeChange(...a){var s;(s=e.onPageSizeChange)==null||s.call(e,...a),n("page-size-change",...a)},onPageCountChange(...a){var s;(s=e.onPageCountChange)==null||s.call(e,...a),n("page-count-change",...a)}}));return()=>{if(t.default)return t.default(r)}}}),Et=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:C.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Ot=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:C.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(C.usePointer({...e,target:e.target==="self"?n:R}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),Vt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),_t=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:C.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),Dt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:C.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),Lt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:C.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:C.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:C.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:C.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),At={mounted(e,t){typeof t.value=="function"?F(e,t.value):F(e,...t.value)}};function Y(e,t,n={}){const{window:r=R,initialValue:a,observe:s=!1}=n,i=o.ref(a),l=o.computed(()=>{var f;return M(t)||((f=r?.document)==null?void 0:f.documentElement)});function d(){var f;const u=o.toValue(e),c=o.toValue(l);if(c&&r&&u){const p=(f=r.getComputedStyle(c).getPropertyValue(u))==null?void 0:f.trim();i.value=p||a}}return s&&K(l,d,{attributeFilter:["style","class"],window:r}),o.watch([l,()=>o.toValue(e)],(f,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),d()},{immediate:!0}),o.watch(i,f=>{var u;const c=o.toValue(e);(u=l.value)!=null&&u.style&&c&&(f==null?l.value.style.removeProperty(c):l.value.style.setProperty(c,f))}),i}const le="--vueuse-safe-area-top",ue="--vueuse-safe-area-right",ce="--vueuse-safe-area-bottom",fe="--vueuse-safe-area-left";function Rt(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(S.isClient){const s=Y(le),i=Y(ue),l=Y(ce),d=Y(fe);s.value="env(safe-area-inset-top, 0px)",i.value="env(safe-area-inset-right, 0px)",l.value="env(safe-area-inset-bottom, 0px)",d.value="env(safe-area-inset-left, 0px)",a(),k("resize",S.useDebounceFn(a),{passive:!0})}function a(){e.value=x(le),t.value=x(ue),n.value=x(ce),r.value=x(fe)}return{top:e,right:t,bottom:n,left:r,update:a}}function x(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Wt=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:a,left:s}=Rt();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?a.value:"",paddingLeft:e.left?s.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),zt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=$(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=$(e,{...r,onScroll(s){var i;(i=r.onScroll)==null||i.call(r,s),n(a)},onStop(s){var i;(i=r.onStop)==null||i.call(r,s),n(a)}})}}};function de(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:de(n)}}function It(e){const t=e||window.event,n=t.target;return de(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const q=new WeakMap;function Bt(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(S.toRef(e),l=>{const d=j(o.toValue(l));if(d){const f=d;if(q.get(f)||q.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(a=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const s=()=>{const l=j(o.toValue(e));!l||n.value||(S.isIOS&&(r=k(l,"touchmove",d=>{It(d)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},i=()=>{const l=j(o.toValue(e));!l||!n.value||(S.isIOS&&r?.(),l.style.overflow=a,q.delete(l),n.value=!1)};return S.tryOnScopeDispose(i),o.computed({get(){return n.value},set(l){l?s():i()}})}function Ht(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Bt(n,r.value);o.watch(t,s=>a.value=s)}}const Nt=Ht(),Ft=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(C.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),jt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(C.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Yt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:a,containerProps:s,wrapperProps:i,scrollTo:l}=C.useVirtualList(r,e.options);return n({scrollTo:l}),s.style&&typeof s.style=="object"&&!Array.isArray(s.style)&&(s.style.height=e.height||"300px"),()=>o.h("div",{...s},[o.h("div",{...i.value},a.value.map(d=>o.h("div",{style:{overflow:"hidden",height:d.height}},t.default?t.default(d):"Please set content!")))])}}),xt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:C.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Xt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(C.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});v.OnClickOutside=ye,v.OnLongPress=be,v.UseActiveElement=Ce,v.UseBattery=Ee,v.UseBrowserLocation=Oe,v.UseClipboard=Pe,v.UseColorMode=Be,v.UseDark=He,v.UseDeviceMotion=Ne,v.UseDeviceOrientation=Fe,v.UseDevicePixelRatio=je,v.UseDevicesList=Ye,v.UseDocumentVisibility=xe,v.UseDraggable=Xe,v.UseElementBounding=Ke,v.UseElementSize=Qe,v.UseElementVisibility=tt,v.UseEyeDropper=ot,v.UseFullscreen=rt,v.UseGeolocation=at,v.UseIdle=st,v.UseImage=ct,v.UseMouse=mt,v.UseMouseInElement=pt,v.UseMousePressed=wt,v.UseNetwork=Ut,v.UseNow=St,v.UseObjectUrl=bt,v.UseOffsetPagination=Ct,v.UseOnline=Et,v.UsePageLeave=Ot,v.UsePointer=Pt,v.UsePointerLock=Vt,v.UsePreferredColorScheme=_t,v.UsePreferredContrast=Dt,v.UsePreferredDark=Lt,v.UsePreferredLanguages=Mt,v.UsePreferredReducedMotion=Tt,v.UsePreferredReducedTransparency=kt,v.UseScreenSafeArea=Wt,v.UseTimeAgo=Ft,v.UseTimestamp=jt,v.UseVirtualList=Yt,v.UseWindowFocus=xt,v.UseWindowSize=Xt,v.VOnClickOutside=ee,v.VOnLongPress=ne,v.vElementBounding=Je,v.vElementHover=qe,v.vElementSize=et,v.vElementVisibility=nt,v.vInfiniteScroll=ft,v.vIntersectionObserver=dt,v.vMouseInElement=vt,v.vOnClickOutside=ee,v.vOnKeyStroke=we,v.vOnLongPress=ne,v.vResizeObserver=At,v.vScroll=zt,v.vScrollLock=Nt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);