@vueuse/components 12.2.0 → 12.3.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(y,C,o,b){"use strict";const ge=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=b.isClient?window:void 0;function L(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function M(...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 b.noop;n=b.toArray(n),r=b.toArray(r);const s=[],i=()=>{s.forEach(u=>u()),s.length=0},l=(u,c,m,U)=>(u.addEventListener(c,m,U),()=>u.removeEventListener(c,m,U)),d=o.watch(()=>[L(t),o.toValue(a)],([u,c])=>{if(i(),!u)return;const m=b.isObject(c)?{...c}:c;s.push(...n.flatMap(U=>r.map(w=>l(u,U,w,m))))},{immediate:!0,flush:"post"}),f=()=>{d(),i()};return b.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 b.noop;b.isIOS&&!Q&&(Q=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",b.noop)),r.document.documentElement.addEventListener("click",b.noop));let l=!0;const d=p=>o.toValue(a).some(v=>{if(typeof v=="string")return Array.from(r.document.querySelectorAll(v)).some(h=>h===p.target||p.composedPath().includes(h));{const h=L(v);return h&&(p.target===h||p.composedPath().includes(h))}});function f(p){const v=o.toValue(p);return v&&v.$.subTree.shapeFlag===16}function u(p,v){const h=o.toValue(p),S=h.$.subTree&&h.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(_=>_.el===v.target||v.composedPath().includes(_.el))}const c=p=>{const v=L(e);if(p.target!=null&&!(!(v instanceof Element)&&f(e)&&u(e,p))&&!(!v||v===p.target||p.composedPath().includes(v))){if(p.detail===0&&(l=!d(p)),!l){l=!0;return}t(p)}};let m=!1;const U=[M(r,"click",p=>{m||(m=!0,setTimeout(()=>{m=!1},0),c(p))},{passive:!0,capture:s}),M(r,"pointerdown",p=>{const v=L(e);l=!d(p)&&!!(v&&!p.composedPath().includes(v))},{passive:!0}),i&&M(r,"blur",p=>{setTimeout(()=>{var v;const h=L(e);((v=r.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!h?.contains(r.document.activeElement)&&t(p)},0)})].filter(Boolean);return()=>U.forEach(p=>p())}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 ye(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=ye(t);return M(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(()=>L(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(h){var S,_,O;const[P,A,g]=[d,l,f];if(u(),!n?.onMouseUp||!A||!P||(S=n?.modifiers)!=null&&S.self&&h.target!==s.value)return;(_=n?.modifiers)!=null&&_.prevent&&h.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&h.stopPropagation();const D=h.x-A.x,k=h.y-A.y,E=Math.sqrt(D*D+k*k);n.onMouseUp(h.timeStamp-P,E,g)}function m(h){var S,_,O,P;(S=n?.modifiers)!=null&&S.self&&h.target!==s.value||(u(),(_=n?.modifiers)!=null&&_.prevent&&h.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&h.stopPropagation(),l={x:h.x,y:h.y},d=h.timeStamp,i=setTimeout(()=>{f=!0,t(h)},(P=n?.delay)!=null?P:Ue))}function U(h){var S,_,O,P;if((S=n?.modifiers)!=null&&S.self&&h.target!==s.value||!l||n?.distanceThreshold===!1)return;(_=n?.modifiers)!=null&&_.prevent&&h.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&h.stopPropagation();const A=h.x-l.x,g=h.y-l.y;Math.sqrt(A*A+g*g)>=((P=n?.distanceThreshold)!=null?P:Se)&&u()}const w={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},p=[M(s,"pointerdown",m,w),M(s,"pointermove",U,w),M(s,["pointerup","pointerleave"],c,w)];return()=>p.forEach(h=>h())}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()?b.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(m=>{const U=m.includes("not all"),w=m.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),p=m.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let v=!!(w||p);return w&&v&&(v=r>=b.pxValue(w[1])),p&&v&&(v=r<=b.pxValue(p[1])),U?!v:v});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 b.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:m,onError:U=E=>{console.error(E)},initOnMounted:w}=r,p=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=oe("getDefaultStorage",()=>{var E;return(E=R)==null?void 0:E.localStorage})()}catch(E){U(E)}if(!n)return p;const v=o.toValue(t),h=Ae(v),S=(a=r.serializer)!=null?a:Re[h],{pause:_,resume:O}=b.pausableWatch(p,()=>A(p.value),{flush:s,deep:i,eventFilter:m});c&&l&&b.tryOnMounted(()=>{n instanceof Storage?M(c,"storage",D):M(c,re,k),w&&D()}),w||D();function P(E,V){if(c){const T={key:e,oldValue:E,newValue:V,storageArea:n};c.dispatchEvent(n instanceof Storage?new StorageEvent("storage",T):new CustomEvent(re,{detail:T}))}}function A(E){try{const V=n.getItem(e);if(E==null)P(V,null),n.removeItem(e);else{const T=S.write(E);V!==T&&(n.setItem(e,T),P(V,T))}}catch(V){U(V)}}function g(E){const V=E?E.newValue:n.getItem(e);if(V==null)return d&&v!=null&&n.setItem(e,S.write(v)),v;if(!E&&f){const T=S.read(V);return typeof f=="function"?f(T,v):h==="object"&&!Array.isArray(T)?{...v,...T}:T}else return typeof V!="string"?V:S.read(V)}function D(E){if(!(E&&E.storageArea!==n)){if(E&&E.key==null){p.value=v;return}if(!(E&&E.key!==e)){_();try{E?.newValue!==S.write(p.value)&&(p.value=g(E))}catch(V){U(V)}finally{E?o.nextTick(O):O()}}}}function k(E){D(E.detail)}return p}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||{}},m=ke({window:a}),U=o.computed(()=>m.value?"dark":"light"),w=d||(i==null?b.toRef(r):We(i,r,s,{window:a,listenToStorageChanges:l})),p=o.computed(()=>w.value==="auto"?U.value:w.value),v=oe("updateHTMLAttrs",(O,P,A)=>{const g=typeof O=="string"?a?.document.querySelector(O):L(O);if(!g)return;const D=new Set,k=new Set;let E=null;if(P==="class"){const T=A.split(/\s/g);Object.values(c).flatMap(W=>(W||"").split(/\s/g)).filter(Boolean).forEach(W=>{T.includes(W)?D.add(W):k.add(W)})}else E={key:P,value:A};if(D.size===0&&k.size===0&&E===null)return;let V;u&&(V=a.document.createElement("style"),V.appendChild(document.createTextNode(ze)),a.document.head.appendChild(V));for(const T of D)g.classList.add(T);for(const T of k)g.classList.remove(T);E&&g.setAttribute(E.key,E.value),u&&(a.getComputedStyle(V).opacity,document.head.removeChild(V))});function h(O){var P;v(t,n,(P=c[O])!=null?P:O)}function S(O){e.onChanged?e.onChanged(O,h):h(O)}o.watch(p,S,{flush:"post",immediate:!0}),b.tryOnMounted(()=>S(p.value));const _=o.computed({get(){return f?w.value:p.value},set(O){w.value=O}});return Object.assign(_,{store:w,system:U,state:p})}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:b.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 m;(m=e.onEnd)==null||m.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 m=o.toValue(e),U=b.toArray(m).map(L).filter(b.notNullish);return new Set(U)}),f=o.watch(()=>d.value,m=>{l(),i.value&&m.size&&(s=new MutationObserver(t),m.forEach(U=>s.observe(U,a)))},{immediate:!0,flush:"post"}),u=()=>s?.takeRecords(),c=()=>{f(),l()};return b.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(m=>L(m)):[L(c)]}),f=o.watch(d,c=>{if(l(),i.value&&r){s=new ResizeObserver(t);for(const m of c)m&&s.observe(m,a)}},{immediate:!0,flush:"post"}),u=()=>{l(),f()};return b.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),m=o.ref(0),U=o.ref(0),w=o.ref(0);function p(){const h=L(e);if(!h){n&&(l.value=0,d.value=0,f.value=0,u.value=0,c.value=0,m.value=0,U.value=0,w.value=0);return}const S=h.getBoundingClientRect();l.value=S.height,d.value=S.bottom,f.value=S.left,u.value=S.right,c.value=S.top,m.value=S.width,U.value=S.x,w.value=S.y}function v(){i==="sync"?p():i==="next-frame"&&requestAnimationFrame(()=>p())}return F(e,v),o.watch(()=>L(e),h=>!h&&v()),K(e,v,{attributeFilter:["style","class"]}),a&&M("scroll",v,{capture:!0,passive:!0}),r&&M("resize",v,{passive:!0}),b.tryOnMounted(()=>{s&&v()}),{height:l,bottom:d,left:f,right:u,top:c,width:m,x:U,y:w,update:v}}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 b.noop;let i;const l=u=>{i?.(),i=u},d=o.watchEffect(()=>{const u=L(e);if(u){const{stop:c}=K(a,m=>{m.map(w=>[...w.removedNodes]).flat().some(w=>w===u||w.contains(u))&&t(m)},{window:r,childList:!0,subtree:!0});l(c)}},{flush:s}),f=()=>{d(),l()};return b.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&&(M(e,"mouseenter",()=>d(!0),{passive:!0}),M(e,"mouseleave",()=>d(!1),{passive:!0}),a&&$e(o.computed(()=>L(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,m;return(m=(c=L(e))==null?void 0:c.namespaceURI)==null?void 0:m.includes("svg")}),i=o.ref(t.width),l=o.ref(t.height),{stop:d}=F(e,([c])=>{const m=a==="border-box"?c.borderBoxSize:a==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(r&&s.value){const U=L(e);if(U){const w=U.getBoundingClientRect();i.value=w.width,l.value=w.height}}else if(m){const U=b.toArray(m);i.value=U.reduce((w,{inlineSize:p})=>w+p,0),l.value=U.reduce((w,{blockSize:p})=>w+p,0)}else i.value=c.contentRect.width,l.value=c.contentRect.height},n);b.tryOnMounted(()=>{const c=L(e);c&&(i.value="offsetWidth"in c?c.offsetWidth:t.width,l.value="offsetHeight"in c?c.offsetHeight:t.height)});const f=o.watch(()=>L(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 b.toArray(w).map(L).filter(b.notNullish)});let u=b.noop;const c=o.ref(l),m=d.value?o.watch(()=>[f.value,L(r),c.value],([w,p])=>{if(u(),!c.value||!w.length)return;const v=new IntersectionObserver(t,{root:L(p),rootMargin:a,threshold:s});w.forEach(h=>h&&v.observe(h)),u=()=>{v.disconnect(),u=b.noop}},{immediate:l,flush:"post"}):b.noop,U=()=>{u(),m(),c.value=!1};return b.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=b.noop,onSuccess:i=b.noop,resetOnExecute:l=!0,shallow:d=!0,throwError:f}=n??{},u=d?o.shallowRef(t):o.ref(t),c=o.ref(!1),m=o.ref(!1),U=o.shallowRef(void 0);async function w(h=0,...S){l&&(u.value=t),U.value=void 0,c.value=!1,m.value=!0,h>0&&await b.promiseTimeout(h);const _=typeof e=="function"?e(...S):e;try{const O=await _;u.value=O,c.value=!0,i(O)}catch(O){if(U.value=O,s(O),f)throw O}finally{m.value=!1}return u.value}r&&w(a);const p={state:u,isReady:c,isLoading:m,error:U,execute:w};function v(){return new Promise((h,S)=>{b.until(m).toBe(!1).then(()=>h(p)).catch(S)})}return{...p,then(h,S){return v().then(h,S)}}}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:m,decoding:U,fetchPriority:w,ismap:p,usemap:v}=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),m!=null&&(r.height=m),U!=null&&(r.decoding=U),w!=null&&(r.fetchPriority=w),p!=null&&(r.isMap=p),v!=null&&(r.useMap=v),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=b.noop,onScroll:s=b.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=g=>{console.error(g)}}=t,c=o.ref(0),m=o.ref(0),U=o.computed({get(){return c.value},set(g){p(g,void 0)}}),w=o.computed({get(){return m.value},set(g){p(void 0,g)}});function p(g,D){var k,E,V,T;if(!f)return;const W=o.toValue(e);if(!W)return;(V=W instanceof Document?f.document.body:W)==null||V.scrollTo({top:(k=o.toValue(D))!=null?k:w.value,left:(E=o.toValue(g))!=null?E:U.value,behavior:o.toValue(d)});const z=((T=W?.document)==null?void 0:T.documentElement)||W?.documentElement||W;U!=null&&(c.value=z.scrollLeft),w!=null&&(m.value=z.scrollTop)}const v=o.ref(!1),h=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),S=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),_=g=>{v.value&&(v.value=!1,S.left=!1,S.right=!1,S.top=!1,S.bottom=!1,a(g))},O=b.useDebounceFn(_,n+r),P=g=>{var D;if(!f)return;const k=((D=g?.document)==null?void 0:D.documentElement)||g?.documentElement||L(g),{display:E,flexDirection:V,direction:T}=getComputedStyle(k),W=T==="rtl"?-1:1,z=k.scrollLeft;S.left=z<c.value,S.right=z>c.value;const me=z*W<=(i.left||0),pe=z*W+k.clientWidth>=k.scrollWidth-(i.right||0)-se;E==="flex"&&V==="row-reverse"?(h.left=pe,h.right=me):(h.left=me,h.right=pe),c.value=z;let I=k.scrollTop;g===f.document&&!I&&(I=f.document.body.scrollTop),S.top=I<m.value,S.bottom=I>m.value;const he=I<=(i.top||0),ve=I+k.clientHeight>=k.scrollHeight-(i.bottom||0)-se;E==="flex"&&V==="column-reverse"?(h.top=ve,h.bottom=he):(h.top=he,h.bottom=ve),m.value=I},A=g=>{var D;if(!f)return;const k=(D=g.target.documentElement)!=null?D:g.target;P(k),v.value=!0,O(g),s(g)};return M(e,"scroll",n?b.useThrottleFn(A,n,!0,!1):A,l),b.tryOnMounted(()=>{try{const g=o.toValue(e);if(!g)return;P(g)}catch(g){u(g)}}),M(e,"scrollend",_,l),{x:U,y:w,isScrolling:v,arrivedState:h,directions:S,measure(){const g=o.toValue(e);f&&g&&P(g)}}}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 m(){if(l.measure(),!u.value||!c.value||!i(u.value))return;const{scrollHeight:w,clientHeight:p,scrollWidth:v,clientWidth:h}=u.value,S=a==="bottom"||a==="top"?w<=p:v<=h;(l.arrivedState[a]||S)&&(d.value||(d.value=Promise.all([t(l),new Promise(_=>setTimeout(_,s))]).finally(()=>{d.value=null,o.nextTick(()=>m())})))}const U=o.watch(()=>[l.arrivedState[a],c.value],m,{immediate:!0});return b.tryOnUnmounted(U),{isLoading:f,reset(){o.nextTick(()=>m())}}}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 vt(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 m=o.ref(a.x),U=o.ref(a.y),w=o.ref(null),p=typeof t=="function"?t:ht[t],v=g=>{const D=p(g);f=g,D&&([m.value,U.value]=D,w.value="mouse"),s&&(u=s.scrollX,c=s.scrollY)},h=g=>{if(g.touches.length>0){const D=p(g.touches[0]);D&&([m.value,U.value]=D,w.value="touch")}},S=()=>{if(!f||!s)return;const g=p(f);f instanceof MouseEvent&&g&&(m.value=g[0]+s.scrollX-u,U.value=g[1]+s.scrollY-c)},_=()=>{m.value=a.x,U.value=a.y},O=d?g=>d(()=>v(g),{}):g=>v(g),P=d?g=>d(()=>h(g),{}):g=>h(g),A=d?()=>d(()=>S(),{}):()=>S();if(i){const g={passive:!0};M(i,["mousemove","dragover"],O,g),n&&t!=="movement"&&(M(i,["touchstart","touchmove"],P,g),r&&M(i,"touchend",_,g)),l&&t==="page"&&M(s,"scroll",A,{passive:!0})}return{x:m,y:U,sourceType:w}}function gt(e,t={}){const{handleOutside:n=!0,window:r=R}=t,a=t.type||"page",{x:s,y:i,sourceType:l}=vt(t),d=o.ref(e??r?.document.body),f=o.ref(0),u=o.ref(0),c=o.ref(0),m=o.ref(0),U=o.ref(0),w=o.ref(0),p=o.ref(!0);let v=()=>{};return r&&(v=o.watch([d,s,i],()=>{const h=L(d);if(!h||!(h instanceof Element))return;const{left:S,top:_,width:O,height:P}=h.getBoundingClientRect();c.value=S+(a==="page"?r.pageXOffset:0),m.value=_+(a==="page"?r.pageYOffset:0),U.value=P,w.value=O;const A=s.value-c.value,g=i.value-m.value;p.value=O===0||P===0||A<0||g<0||A>O||g>P,(n||!p.value)&&(f.value=A,u.value=g)},{immediate:!0}),M(document,"mouseleave",()=>{p.value=!0})),{x:s,y:i,sourceType:l,elementX:f,elementY:u,elementPositionX:c,elementPositionY:m,elementHeight:U,elementWidth:w,isOutside:p,stop:v}}const yt={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,a=b.reactiveOmit(o.reactive(gt(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=b.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 L(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 m=(f=r.getComputedStyle(c).getPropertyValue(u))==null?void 0:f.trim();i.value=m||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(b.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(),M("resize",b.useDebounceFn(a))}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(b.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||(b.isIOS&&(r=M(l,"touchmove",d=>{It(d)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},i=()=>{const l=j(o.toValue(e));!l||!n.value||(b.isIOS&&r?.(),l.style.overflow=a,q.delete(l),n.value=!1)};return b.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)}}});y.OnClickOutside=ge,y.OnLongPress=be,y.UseActiveElement=Ce,y.UseBattery=Ee,y.UseBrowserLocation=Oe,y.UseClipboard=Pe,y.UseColorMode=Be,y.UseDark=He,y.UseDeviceMotion=Ne,y.UseDeviceOrientation=Fe,y.UseDevicePixelRatio=je,y.UseDevicesList=Ye,y.UseDocumentVisibility=xe,y.UseDraggable=Xe,y.UseElementBounding=Ke,y.UseElementSize=Qe,y.UseElementVisibility=tt,y.UseEyeDropper=ot,y.UseFullscreen=rt,y.UseGeolocation=at,y.UseIdle=st,y.UseImage=ct,y.UseMouse=mt,y.UseMouseInElement=pt,y.UseMousePressed=wt,y.UseNetwork=Ut,y.UseNow=St,y.UseObjectUrl=bt,y.UseOffsetPagination=Ct,y.UseOnline=Et,y.UsePageLeave=Ot,y.UsePointer=Pt,y.UsePointerLock=Vt,y.UsePreferredColorScheme=_t,y.UsePreferredContrast=Dt,y.UsePreferredDark=Lt,y.UsePreferredLanguages=Mt,y.UsePreferredReducedMotion=Tt,y.UsePreferredReducedTransparency=kt,y.UseScreenSafeArea=Wt,y.UseTimeAgo=Ft,y.UseTimestamp=jt,y.UseVirtualList=Yt,y.UseWindowFocus=xt,y.UseWindowSize=Xt,y.VOnClickOutside=ee,y.VOnLongPress=ne,y.vElementBounding=Je,y.vElementHover=qe,y.vElementSize=et,y.vElementVisibility=nt,y.vInfiniteScroll=ft,y.vIntersectionObserver=dt,y.vMouseInElement=yt,y.vOnClickOutside=ee,y.vOnKeyStroke=we,y.vOnLongPress=ne,y.vResizeObserver=At,y.vScroll=zt,y.vScrollLock=Nt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);