@vueuse/components 11.3.0 → 12.0.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
- var _VueDemiGlobal=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this,VueDemi=function(l,d,o){if(l.install)return l;if(!d)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),l;if(d.version.slice(0,4)==="2.7."){let P=function(_,T){var H,j={},F={config:d.config,use:d.use.bind(d),mixin:d.mixin.bind(d),component:d.component.bind(d),provide:function(W,N){return j[W]=N,this},directive:function(W,N){return N?(d.directive(W,N),F):d.directive(W)},mount:function(W,N){return H||(H=new d(Object.assign({propsData:T},_,{provide:Object.assign(j,_.provide)})),H.$mount(W,N),H)},unmount:function(){H&&(H.$destroy(),H=void 0)}};return F};var ne=P;for(var i in d)l[i]=d[i];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=d,l.Vue2=d,l.version=d.version,l.warn=d.util.warn,l.hasInjectionContext=function(){return!!l.getCurrentInstance()},l.createApp=P}else if(d.version.slice(0,2)==="2.")if(o){for(var i in o)l[i]=o[i];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=d,l.Vue2=d,l.version=d.version,l.hasInjectionContext=function(){return!!l.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(d.version.slice(0,2)==="3."){for(var i in d)l[i]=d[i];l.isVue2=!1,l.isVue3=!0,l.install=function(){},l.Vue=d,l.Vue2=void 0,l.version=d.version,l.set=function(P,_,T){return Array.isArray(P)?(P.length=Math.max(P.length,_),P.splice(_,1,T),T):(P[_]=T,T)},l.del=function(P,_){if(Array.isArray(P)){P.splice(_,1);return}delete P[_]}}else console.error("[vue-demi] Vue version "+d.version+" is unsupported.");return l}(_VueDemiGlobal.VueDemi=_VueDemiGlobal.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),_VueDemiGlobal.Vue||(typeof Vue<"u"?Vue:void 0),_VueDemiGlobal.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(l,d,o,i){"use strict";const ne=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return d.onClickOutside(r,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),P=i.isClient?window:void 0;function _(e){var t;const n=i.toValue(e);return(t=n?.$el)!=null?t:n}function T(...e){let t,n,r,s;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,s]=e,t=P):[t,n,r,s]=e,!t)return i.noop;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const a=[],u=()=>{a.forEach(p=>p()),a.length=0},c=(p,f,h,C)=>(p.addEventListener(f,h,C),()=>p.removeEventListener(f,h,C)),m=o.watch(()=>[_(t),i.toValue(s)],([p,f])=>{if(u(),!p)return;const h=i.isObject(f)?{...f}:f;a.push(...n.flatMap(C=>r.map(E=>c(p,C,E,h))))},{immediate:!0,flush:"post"}),v=()=>{m(),u()};return i.tryOnScopeDispose(v),v}let H=!1;function j(e,t,n={}){const{window:r=P,ignore:s=[],capture:a=!0,detectIframe:u=!1}=n;if(!r)return i.noop;i.isIOS&&!H&&(H=!0,Array.from(r.document.body.children).forEach(y=>y.addEventListener("click",i.noop)),r.document.documentElement.addEventListener("click",i.noop));let c=!0;const m=y=>i.toValue(s).some(w=>{if(typeof w=="string")return Array.from(r.document.querySelectorAll(w)).some(g=>g===y.target||y.composedPath().includes(g));{const g=_(w);return g&&(y.target===g||y.composedPath().includes(g))}});function v(y){const w=i.toValue(y);return w&&w.$.subTree.shapeFlag===16}function p(y,w){const g=i.toValue(y),S=g.$.subTree&&g.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(A=>A.el===w.target||w.composedPath().includes(A.el))}const f=y=>{const w=_(e);if(y.target!=null&&!(!(w instanceof Element)&&v(e)&&p(e,y))&&!(!w||w===y.target||y.composedPath().includes(w))){if(y.detail===0&&(c=!m(y)),!c){c=!0;return}t(y)}};let h=!1;const C=[T(r,"click",y=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(y))},{passive:!0,capture:a}),T(r,"pointerdown",y=>{const w=_(e);c=!m(y)&&!!(w&&!y.composedPath().includes(w))},{passive:!0}),u&&T(r,"blur",y=>{setTimeout(()=>{var w;const g=_(e);((w=r.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!g?.contains(r.document.activeElement)&&t(y)},0)})].filter(Boolean);return()=>C.forEach(y=>y())}const F={[i.directiveHooks.mounted](e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=j(e,t.value,{capture:n});else{const[r,s]=t.value;e.__onClickOutside_stop=j(e,r,Object.assign({capture:n},s))}},[i.directiveHooks.unmounted](e){e.__onClickOutside_stop()}};function W(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function N(...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:s=P,eventName:a="keydown",passive:u=!1,dedupe:c=!1}=r,m=W(t);return T(s,a,p=>{p.repeat&&i.toValue(c)||m(p)&&n(p)},u)}const me={[i.directiveHooks.mounted](e,t){var n,r;const s=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")N(s,t.value,{target:e});else{const[a,u]=t.value;N(s,a,{target:e,...u})}}},he=500,ye=10;function X(e,t,n){var r,s;const a=o.computed(()=>_(e));let u,c,m,v=!1;function p(){u&&(clearTimeout(u),u=void 0),c=void 0,m=void 0,v=!1}function f(g){var S,A,O;const[M,z,U]=[m,c,v];if(p(),!n?.onMouseUp||!z||!M||(S=n?.modifiers)!=null&&S.self&&g.target!==a.value)return;(A=n?.modifiers)!=null&&A.prevent&&g.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&g.stopPropagation();const R=g.x-z.x,V=g.y-z.y,b=Math.sqrt(R*R+V*V);n.onMouseUp(g.timeStamp-M,b,U)}function h(g){var S,A,O,M;(S=n?.modifiers)!=null&&S.self&&g.target!==a.value||(p(),(A=n?.modifiers)!=null&&A.prevent&&g.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&g.stopPropagation(),c={x:g.x,y:g.y},m=g.timeStamp,u=setTimeout(()=>{v=!0,t(g)},(M=n?.delay)!=null?M:he))}function C(g){var S,A,O,M;if((S=n?.modifiers)!=null&&S.self&&g.target!==a.value||!c||n?.distanceThreshold===!1)return;(A=n?.modifiers)!=null&&A.prevent&&g.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&g.stopPropagation();const z=g.x-c.x,U=g.y-c.y;Math.sqrt(z*z+U*U)>=((M=n?.distanceThreshold)!=null?M:ye)&&p()}const E={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(s=n?.modifiers)==null?void 0:s.once},y=[T(a,"pointerdown",h,E),T(a,"pointermove",C,E),T(a,["pointerup","pointerleave"],f,E)];return()=>y.forEach(g=>g())}const we=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return X(r,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),oe={[i.directiveHooks.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:d.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ue=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(d.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Se=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(d.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Ce=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(d.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},x="__vueuse_ssr_handlers__",Ee=Oe();function Oe(){return x in $||($[x]=$[x]||{}),$[x]}function re(e,t){return Ee[e]||t}function Pe(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},o.isVue2?void 0:t),e}function G(e){const t=Pe();return o.computed(()=>(t.value,!!e()))}function _e(e,t={}){const{window:n=P}=t,r=G(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let s;const a=o.ref(!1),u=v=>{a.value=v.matches},c=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",u):s.removeListener(u))},m=o.watchEffect(()=>{r.value&&(c(),s=n.matchMedia(i.toValue(e)),"addEventListener"in s?s.addEventListener("change",u):s.addListener(u),a.value=s.matches)});return i.tryOnScopeDispose(()=>{m(),c(),s=void 0}),a}function Le(e){return _e("(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()}},se="vueuse-storage";function Te(e,t,n,r={}){var s;const{flush:a="pre",deep:u=!0,listenToStorageChanges:c=!0,writeDefaults:m=!0,mergeDefaults:v=!1,shallow:p,window:f=P,eventFilter:h,onError:C=b=>{console.error(b)},initOnMounted:E}=r,y=(p?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=re("getDefaultStorage",()=>{var b;return(b=P)==null?void 0:b.localStorage})()}catch(b){C(b)}if(!n)return y;const w=i.toValue(t),g=ke(w),S=(s=r.serializer)!=null?s:Ae[g],{pause:A,resume:O}=i.pausableWatch(y,()=>z(y.value),{flush:a,deep:u,eventFilter:h});f&&c&&i.tryOnMounted(()=>{n instanceof Storage?T(f,"storage",R):T(f,se,V),E&&R()}),E||R();function M(b,L){if(f){const k={key:e,oldValue:b,newValue:L,storageArea:n};f.dispatchEvent(n instanceof Storage?new StorageEvent("storage",k):new CustomEvent(se,{detail:k}))}}function z(b){try{const L=n.getItem(e);if(b==null)M(L,null),n.removeItem(e);else{const k=S.write(b);L!==k&&(n.setItem(e,k),M(L,k))}}catch(L){C(L)}}function U(b){const L=b?b.newValue:n.getItem(e);if(L==null)return m&&w!=null&&n.setItem(e,S.write(w)),w;if(!b&&v){const k=S.read(L);return typeof v=="function"?v(k,w):g==="object"&&!Array.isArray(k)?{...w,...k}:k}else return typeof L!="string"?L:S.read(L)}function R(b){if(!(b&&b.storageArea!==n)){if(b&&b.key==null){y.value=w;return}if(!(b&&b.key!==e)){A();try{b?.newValue!==S.write(y.value)&&(y.value=U(b))}catch(L){C(L)}finally{b?o.nextTick(O):O()}}}}function V(b){R(b.detail)}return y}const Me="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ve(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:s=P,storage:a,storageKey:u="vueuse-color-scheme",listenToStorageChanges:c=!0,storageRef:m,emitAuto:v,disableTransition:p=!0}=e,f={auto:"",light:"light",dark:"dark",...e.modes||{}},h=Le({window:s}),C=o.computed(()=>h.value?"dark":"light"),E=m||(u==null?i.toRef(r):Te(u,r,a,{window:s,listenToStorageChanges:c})),y=o.computed(()=>E.value==="auto"?C.value:E.value),w=re("updateHTMLAttrs",(O,M,z)=>{const U=typeof O=="string"?s?.document.querySelector(O):_(O);if(!U)return;const R=new Set,V=new Set;let b=null;if(M==="class"){const k=z.split(/\s/g);Object.values(f).flatMap(I=>(I||"").split(/\s/g)).filter(Boolean).forEach(I=>{k.includes(I)?R.add(I):V.add(I)})}else b={key:M,value:z};if(R.size===0&&V.size===0&&b===null)return;let L;p&&(L=s.document.createElement("style"),L.appendChild(document.createTextNode(Me)),s.document.head.appendChild(L));for(const k of R)U.classList.add(k);for(const k of V)U.classList.remove(k);b&&U.setAttribute(b.key,b.value),p&&(s.getComputedStyle(L).opacity,document.head.removeChild(L))});function g(O){var M;w(t,n,(M=f[O])!=null?M:O)}function S(O){e.onChanged?e.onChanged(O,g):g(O)}o.watch(y,S,{flush:"post",immediate:!0}),i.tryOnMounted(()=>S(y.value));const A=o.computed({get(){return v?E.value:y.value},set(O){E.value=O}});try{return Object.assign(A,{store:E,system:C,state:y})}catch{return A}}const Re=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ve(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Ie=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=d.useDark(e),r=o.reactive({isDark:n,toggleDark:i.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),ze=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=o.reactive(d.useDeviceMotion());return()=>{if(t.default)return t.default(n)}}}),He=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(d.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Ne=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:d.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),We=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(d.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),Be=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:d.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),je=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 p;return(p=e.handle)!=null?p:n.value}),s=o.computed(()=>{var p;return(p=e.containerElement)!=null?p:void 0}),a=o.computed(()=>!!e.disabled),u=e.storageKey&&d.useStorage(e.storageKey,i.toValue(e.initialValue)||{x:0,y:0},d.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),c=u||e.initialValue||{x:0,y:0},m=(p,f)=>{var h;(h=e.onEnd)==null||h.call(e,p,f),u&&(u.value.x=p.x,u.value.y=p.y)},v=o.reactive(d.useDraggable(n,{...e,handle:r,initialValue:c,onEnd:m,disabled:a,containerElement:s}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${v.style}`},t.default(v))}}}),Fe=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(d.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function ae(e,t={}){const{delayEnter:n=0,delayLeave:r=0,window:s=P}=t,a=o.ref(!1);let u;const c=m=>{const v=m?n:r;u&&(clearTimeout(u),u=void 0),v?u=setTimeout(()=>a.value=m,v):a.value=m};return s&&(T(e,"mouseenter",()=>c(!0),{passive:!0}),T(e,"mouseleave",()=>c(!1),{passive:!0})),a}const Ke={[i.directiveHooks.mounted](e,t){const n=t.value;if(typeof n=="function"){const r=ae(e);o.watch(r,s=>n(s))}else{const[r,s]=n,a=ae(e,s);o.watch(a,u=>r(u))}}},$e=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(d.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 Q(e,t,n={}){const{window:r=P,...s}=n;let a;const u=G(()=>r&&"ResizeObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},m=o.computed(()=>{const f=i.toValue(e);return Array.isArray(f)?f.map(h=>_(h)):[_(f)]}),v=o.watch(m,f=>{if(c(),u.value&&r){a=new ResizeObserver(t);for(const h of f)h&&a.observe(h,s)}},{immediate:!0,flush:"post"}),p=()=>{c(),v()};return i.tryOnScopeDispose(p),{isSupported:u,stop:p}}function xe(e,t={width:0,height:0},n={}){const{window:r=P,box:s="content-box"}=n,a=o.computed(()=>{var f,h;return(h=(f=_(e))==null?void 0:f.namespaceURI)==null?void 0:h.includes("svg")}),u=o.ref(t.width),c=o.ref(t.height),{stop:m}=Q(e,([f])=>{const h=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(r&&a.value){const C=_(e);if(C){const E=C.getBoundingClientRect();u.value=E.width,c.value=E.height}}else if(h){const C=Array.isArray(h)?h:[h];u.value=C.reduce((E,{inlineSize:y})=>E+y,0),c.value=C.reduce((E,{blockSize:y})=>E+y,0)}else u.value=f.contentRect.width,c.value=f.contentRect.height},n);i.tryOnMounted(()=>{const f=_(e);f&&(u.value="offsetWidth"in f?f.offsetWidth:t.width,c.value="offsetHeight"in f?f.offsetHeight:t.height)});const v=o.watch(()=>_(e),f=>{u.value=f?t.width:0,c.value=f?t.height:0});function p(){m(),v()}return{width:u,height:c,stop:p}}const Ge={[i.directiveHooks.mounted](e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],s=typeof t.value=="function"?[]:t.value.slice(1),{width:a,height:u}=xe(e,...s);o.watch([a,u],([c,m])=>r({width:c,height:m}))}},Je=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:d.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Z(e,t,n={}){const{root:r,rootMargin:s="0px",threshold:a=0,window:u=P,immediate:c=!0}=n,m=G(()=>u&&"IntersectionObserver"in u),v=o.computed(()=>{const E=i.toValue(e);return(Array.isArray(E)?E:[E]).map(_).filter(i.notNullish)});let p=i.noop;const f=o.ref(c),h=m.value?o.watch(()=>[v.value,_(r),f.value],([E,y])=>{if(p(),!f.value||!E.length)return;const w=new IntersectionObserver(t,{root:_(y),rootMargin:s,threshold:a});E.forEach(g=>g&&w.observe(g)),p=()=>{w.disconnect(),p=i.noop}},{immediate:c,flush:"post"}):i.noop,C=()=>{p(),h(),f.value=!1};return i.tryOnScopeDispose(C),{isSupported:m,isActive:f,pause(){p(),f.value=!1},resume(){f.value=!0},stop:C}}function D(e,t={}){const{window:n=P,scrollTarget:r,threshold:s=0}=t,a=o.ref(!1);return Z(e,u=>{let c=a.value,m=0;for(const v of u)v.time>=m&&(m=v.time,c=v.isIntersecting);a.value=c},{root:r,window:n,threshold:s}),a}const qe={[i.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=D(e);o.watch(r,s=>n(s),{immediate:!0})}else{const[n,r]=t.value,s=D(e,r);o.watch(s,a=>n(a),{immediate:!0})}}},Ye=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(d.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(d.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Qe=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(d.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),Ze=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(d.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function De(e,t,n){const{immediate:r=!0,delay:s=0,onError:a=i.noop,onSuccess:u=i.noop,resetOnExecute:c=!0,shallow:m=!0,throwError:v}=n??{},p=m?o.shallowRef(t):o.ref(t),f=o.ref(!1),h=o.ref(!1),C=o.shallowRef(void 0);async function E(g=0,...S){c&&(p.value=t),C.value=void 0,f.value=!1,h.value=!0,g>0&&await i.promiseTimeout(g);const A=typeof e=="function"?e(...S):e;try{const O=await A;p.value=O,f.value=!0,u(O)}catch(O){if(C.value=O,a(O),v)throw O}finally{h.value=!1}return p.value}r&&E(s);const y={state:p,isReady:f,isLoading:h,error:C,execute:E};function w(){return new Promise((g,S)=>{i.until(h).toBe(!1).then(()=>g(y)).catch(S)})}return{...y,then(g,S){return w().then(g,S)}}}async function et(e){return new Promise((t,n)=>{const r=new Image,{src:s,srcset:a,sizes:u,class:c,loading:m,crossorigin:v,referrerPolicy:p}=e;r.src=s,a&&(r.srcset=a),u&&(r.sizes=u),c&&(r.className=c),m&&(r.loading=m),v&&(r.crossOrigin=v),p&&(r.referrerPolicy=p),r.onload=()=>t(r),r.onerror=n})}function tt(e,t={}){const n=De(()=>et(i.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>i.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const nt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:t}){const n=o.reactive(tt(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 le=1;function ee(e,t={}){const{throttle:n=0,idle:r=200,onStop:s=i.noop,onScroll:a=i.noop,offset:u={left:0,right:0,top:0,bottom:0},eventListenerOptions:c={capture:!1,passive:!0},behavior:m="auto",window:v=P,onError:p=U=>{console.error(U)}}=t,f=o.ref(0),h=o.ref(0),C=o.computed({get(){return f.value},set(U){y(U,void 0)}}),E=o.computed({get(){return h.value},set(U){y(void 0,U)}});function y(U,R){var V,b,L,k;if(!v)return;const I=i.toValue(e);if(!I)return;(L=I instanceof Document?v.document.body:I)==null||L.scrollTo({top:(V=i.toValue(R))!=null?V:E.value,left:(b=i.toValue(U))!=null?b:C.value,behavior:i.toValue(m)});const K=((k=I?.document)==null?void 0:k.documentElement)||I?.documentElement||I;C!=null&&(f.value=K.scrollLeft),E!=null&&(h.value=K.scrollTop)}const w=o.ref(!1),g=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),S=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),A=U=>{w.value&&(w.value=!1,S.left=!1,S.right=!1,S.top=!1,S.bottom=!1,s(U))},O=i.useDebounceFn(A,n+r),M=U=>{var R;if(!v)return;const V=((R=U?.document)==null?void 0:R.documentElement)||U?.documentElement||_(U),{display:b,flexDirection:L}=getComputedStyle(V),k=V.scrollLeft;S.left=k<f.value,S.right=k>f.value;const I=Math.abs(k)<=(u.left||0),K=Math.abs(k)+V.clientWidth>=V.scrollWidth-(u.right||0)-le;b==="flex"&&L==="row-reverse"?(g.left=K,g.right=I):(g.left=I,g.right=K),f.value=k;let B=V.scrollTop;U===v.document&&!B&&(B=v.document.body.scrollTop),S.top=B<h.value,S.bottom=B>h.value;const ve=Math.abs(B)<=(u.top||0),ge=Math.abs(B)+V.clientHeight>=V.scrollHeight-(u.bottom||0)-le;b==="flex"&&L==="column-reverse"?(g.top=ge,g.bottom=ve):(g.top=ve,g.bottom=ge),h.value=B},z=U=>{var R;if(!v)return;const V=(R=U.target.documentElement)!=null?R:U.target;M(V),w.value=!0,O(U),a(U)};return T(e,"scroll",n?i.useThrottleFn(z,n,!0,!1):z,c),i.tryOnMounted(()=>{try{const U=i.toValue(e);if(!U)return;M(U)}catch(U){p(U)}}),T(e,"scrollend",A,c),{x:C,y:E,isScrolling:w,arrivedState:g,directions:S,measure(){const U=i.toValue(e);v&&U&&M(U)}}}function ie(e,t,n={}){var r;const{direction:s="bottom",interval:a=100,canLoadMore:u=()=>!0}=n,c=o.reactive(ee(e,{...n,offset:{[s]:(r=n.distance)!=null?r:0,...n.offset}})),m=o.ref(),v=o.computed(()=>!!m.value),p=o.computed(()=>J(i.toValue(e))),f=D(p);function h(){if(c.measure(),!p.value||!f.value||!u(p.value))return;const{scrollHeight:E,clientHeight:y,scrollWidth:w,clientWidth:g}=p.value,S=s==="bottom"||s==="top"?E<=y:w<=g;(c.arrivedState[s]||S)&&(m.value||(m.value=Promise.all([t(c),new Promise(A=>setTimeout(A,a))]).finally(()=>{m.value=null,o.nextTick(()=>h())})))}const C=o.watch(()=>[c.arrivedState[s],f.value],h,{immediate:!0});return i.tryOnUnmounted(C),{isLoading:v,reset(){o.nextTick(()=>h())}}}const ot={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},rt={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?Z(e,t.value):Z(e,...t.value)}},st=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(d.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),at=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(d.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),lt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(d.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),it=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(d.useNetwork());return()=>{if(t.default)return t.default(n)}}}),ut=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(d.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),ct=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=i.toRef(e,"object"),r=d.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),ft=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(d.useOffsetPagination({...e,onPageChange(...s){var a;(a=e.onPageChange)==null||a.call(e,...s),n("page-change",...s)},onPageSizeChange(...s){var a;(a=e.onPageSizeChange)==null||a.call(e,...s),n("page-size-change",...s)},onPageCountChange(...s){var a;(a=e.onPageCountChange)==null||a.call(e,...s),n("page-count-change",...s)}}));return()=>{if(t.default)return t.default(r)}}}),dt=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:d.useOnline()});return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:d.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),vt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(d.usePointer({...e,target:e.target==="self"?n:P}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),gt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(d.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),mt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:d.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:d.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:d.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),wt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:d.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:d.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),Ut={[i.directiveHooks.mounted](e,t){typeof t.value=="function"?Q(e,t.value):Q(e,...t.value)}};function St(e,t,n={}){const{window:r=P,...s}=n;let a;const u=G(()=>r&&"MutationObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},m=o.computed(()=>{const h=i.toValue(e),C=(Array.isArray(h)?h:[h]).map(_).filter(i.notNullish);return new Set(C)}),v=o.watch(()=>m.value,h=>{c(),u.value&&h.size&&(a=new MutationObserver(t),h.forEach(C=>a.observe(C,s)))},{immediate:!0,flush:"post"}),p=()=>a?.takeRecords(),f=()=>{v(),c()};return i.tryOnScopeDispose(f),{isSupported:u,stop:f,takeRecords:p}}function q(e,t,n={}){const{window:r=P,initialValue:s,observe:a=!1}=n,u=o.ref(s),c=o.computed(()=>{var v;return _(t)||((v=r?.document)==null?void 0:v.documentElement)});function m(){var v;const p=i.toValue(e),f=i.toValue(c);if(f&&r&&p){const h=(v=r.getComputedStyle(f).getPropertyValue(p))==null?void 0:v.trim();u.value=h||s}}return a&&St(c,m,{attributeFilter:["style","class"],window:r}),o.watch([c,()=>i.toValue(e)],(v,p)=>{p[0]&&p[1]&&p[0].style.removeProperty(p[1]),m()},{immediate:!0}),o.watch(u,v=>{var p;const f=i.toValue(e);(p=c.value)!=null&&p.style&&f&&(v==null?c.value.style.removeProperty(f):c.value.style.setProperty(f,v))}),u}const ue="--vueuse-safe-area-top",ce="--vueuse-safe-area-right",fe="--vueuse-safe-area-bottom",de="--vueuse-safe-area-left";function Ct(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(i.isClient){const a=q(ue),u=q(ce),c=q(fe),m=q(de);a.value="env(safe-area-inset-top, 0px)",u.value="env(safe-area-inset-right, 0px)",c.value="env(safe-area-inset-bottom, 0px)",m.value="env(safe-area-inset-left, 0px)",s(),T("resize",i.useDebounceFn(s))}function s(){e.value=Y(ue),t.value=Y(ce),n.value=Y(fe),r.value=Y(de)}return{top:e,right:t,bottom:n,left:r,update:s}}function Y(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const Et=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:s,left:a}=Ct();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?s.value:"",paddingLeft:e.left?a.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),Ot={[i.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=ee(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,s=ee(e,{...r,onScroll(a){var u;(u=r.onScroll)==null||u.call(r,a),n(s)},onStop(a){var u;(u=r.onStop)==null||u.call(r,a),n(s)}})}}};function pe(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:pe(n)}}function Pt(e){const t=e||window.event,n=t.target;return pe(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const te=new WeakMap;function _t(e,t=!1){const n=o.ref(t);let r=null,s="";o.watch(i.toRef(e),c=>{const m=J(i.toValue(c));if(m){const v=m;if(te.get(v)||te.set(v,v.style.overflow),v.style.overflow!=="hidden"&&(s=v.style.overflow),v.style.overflow==="hidden")return n.value=!0;if(n.value)return v.style.overflow="hidden"}},{immediate:!0});const a=()=>{const c=J(i.toValue(e));!c||n.value||(i.isIOS&&(r=T(c,"touchmove",m=>{Pt(m)},{passive:!1})),c.style.overflow="hidden",n.value=!0)},u=()=>{const c=J(i.toValue(e));!c||!n.value||(i.isIOS&&r?.(),c.style.overflow=s,te.delete(c),n.value=!1)};return i.tryOnScopeDispose(u),o.computed({get(){return n.value},set(c){c?a():u()}})}function Lt(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const s=_t(n,r.value);o.watch(t,a=>s.value=a)}}const kt=Lt(),At=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(d.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(d.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:s,containerProps:a,wrapperProps:u,scrollTo:c}=d.useVirtualList(r,e.options);return n({scrollTo:c}),a.style&&typeof a.style=="object"&&!Array.isArray(a.style)&&(a.style.height=e.height||"300px"),()=>o.h("div",{...a},[o.h("div",{...u.value},s.value.map(m=>o.h("div",{style:{overflow:"hidden",height:m.height}},t.default?t.default(m):"Please set content!")))])}}),Vt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:d.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Rt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(d.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});l.OnClickOutside=ne,l.OnLongPress=we,l.UseActiveElement=be,l.UseBattery=Ue,l.UseBrowserLocation=Se,l.UseClipboard=Ce,l.UseColorMode=Re,l.UseDark=Ie,l.UseDeviceMotion=ze,l.UseDeviceOrientation=He,l.UseDevicePixelRatio=Ne,l.UseDevicesList=We,l.UseDocumentVisibility=Be,l.UseDraggable=je,l.UseElementBounding=Fe,l.UseElementSize=$e,l.UseElementVisibility=Je,l.UseEyeDropper=Ye,l.UseFullscreen=Xe,l.UseGeolocation=Qe,l.UseIdle=Ze,l.UseImage=nt,l.UseMouse=st,l.UseMouseInElement=at,l.UseMousePressed=lt,l.UseNetwork=it,l.UseNow=ut,l.UseObjectUrl=ct,l.UseOffsetPagination=ft,l.UseOnline=dt,l.UsePageLeave=pt,l.UsePointer=vt,l.UsePointerLock=gt,l.UsePreferredColorScheme=mt,l.UsePreferredContrast=ht,l.UsePreferredDark=yt,l.UsePreferredLanguages=wt,l.UsePreferredReducedMotion=bt,l.UseScreenSafeArea=Et,l.UseTimeAgo=At,l.UseTimestamp=Tt,l.UseVirtualList=Mt,l.UseWindowFocus=Vt,l.UseWindowSize=Rt,l.VOnClickOutside=F,l.VOnLongPress=oe,l.vElementHover=Ke,l.vElementSize=Ge,l.vElementVisibility=qe,l.vInfiniteScroll=ot,l.vIntersectionObserver=rt,l.vOnClickOutside=F,l.vOnKeyStroke=me,l.vOnLongPress=oe,l.vResizeObserver=Ut,l.vScroll=Ot,l.vScrollLock=kt})(this.VueUse=this.VueUse||{},VueUse,VueDemi,VueUse);
1
+ (function(v,w,o,f){"use strict";const pe=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return w.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 T(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,g,C)=>(c.addEventListener(u,g,C),()=>c.removeEventListener(u,g,C)),p=o.watch(()=>[T(t),f.toValue(a)],([c,u])=>{if(s(),!c)return;const g=f.isObject(u)?{...u}:u;i.push(...n.flatMap(C=>r.map(E=>l(c,C,E,g))))},{immediate:!0,flush:"post"}),d=()=>{p(),s()};return f.tryOnScopeDispose(d),d}let x=!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&&!x&&(x=!0,Array.from(r.document.body.children).forEach(h=>h.addEventListener("click",f.noop)),r.document.documentElement.addEventListener("click",f.noop));let l=!0;const p=h=>f.toValue(a).some(y=>{if(typeof y=="string")return Array.from(r.document.querySelectorAll(y)).some(m=>m===h.target||h.composedPath().includes(m));{const m=T(y);return m&&(h.target===m||h.composedPath().includes(m))}});function d(h){const y=f.toValue(h);return y&&y.$.subTree.shapeFlag===16}function c(h,y){const m=f.toValue(h),b=m.$.subTree&&m.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(_=>_.el===y.target||y.composedPath().includes(_.el))}const u=h=>{const y=T(e);if(h.target!=null&&!(!(y instanceof Element)&&d(e)&&c(e,h))&&!(!y||y===h.target||h.composedPath().includes(y))){if(h.detail===0&&(l=!p(h)),!l){l=!0;return}t(h)}};let g=!1;const C=[R(r,"click",h=>{g||(g=!0,setTimeout(()=>{g=!1},0),u(h))},{passive:!0,capture:i}),R(r,"pointerdown",h=>{const y=T(e);l=!p(h)&&!!(y&&!h.composedPath().includes(y))},{passive:!0}),s&&R(r,"blur",h=>{setTimeout(()=>{var y;const m=T(e);((y=r.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!m?.contains(r.document.activeElement)&&t(h)},0)})].filter(Boolean);return()=>C.forEach(h=>h())}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 ve(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,p=ve(t);return R(a,i,c=>{c.repeat&&f.toValue(l)||p(c)&&n(c)},s)}const ge={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})}}},he=500,ye=10;function G(e,t,n){var r,a;const i=o.computed(()=>T(e));let s,l,p,d=!1;function c(){s&&(clearTimeout(s),s=void 0),l=void 0,p=void 0,d=!1}function u(m){var b,_,O;const[D,z,S]=[p,l,d];if(c(),!n?.onMouseUp||!z||!D||(b=n?.modifiers)!=null&&b.self&&m.target!==i.value)return;(_=n?.modifiers)!=null&&_.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const M=m.x-z.x,L=m.y-z.y,U=Math.sqrt(M*M+L*L);n.onMouseUp(m.timeStamp-D,U,S)}function g(m){var b,_,O,D;(b=n?.modifiers)!=null&&b.self&&m.target!==i.value||(c(),(_=n?.modifiers)!=null&&_.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation(),l={x:m.x,y:m.y},p=m.timeStamp,s=setTimeout(()=>{d=!0,t(m)},(D=n?.delay)!=null?D:he))}function C(m){var b,_,O,D;if((b=n?.modifiers)!=null&&b.self&&m.target!==i.value||!l||n?.distanceThreshold===!1)return;(_=n?.modifiers)!=null&&_.prevent&&m.preventDefault(),(O=n?.modifiers)!=null&&O.stop&&m.stopPropagation();const z=m.x-l.x,S=m.y-l.y;Math.sqrt(z*z+S*S)>=((D=n?.distanceThreshold)!=null?D:ye)&&c()}const E={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},h=[R(i,"pointerdown",g,E),R(i,"pointermove",C,E),R(i,["pointerup","pointerleave"],u,E)];return()=>h.forEach(m=>m())}const we=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return G(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"?G(e,t.value,{modifiers:t.modifiers}):G(e,...t.value)}},Ue=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:w.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Se=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(w.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),be=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(w.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Ce=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(w.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B="__vueuse_ssr_handlers__",Ee=Oe();function Oe(){return B in W||(W[B]=W[B]||{}),W[B]}function ne(e,t){return Ee[e]||t}function Pe(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function H(e){const t=Pe();return o.computed(()=>(t.value,!!e()))}function Ve(e,t={}){const{window:n=A}=t,r=H(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const i=o.ref(!1),s=d=>{i.value=d.matches},l=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",s):a.removeListener(s))},p=o.watchEffect(()=>{r.value&&(l(),a=n.matchMedia(f.toValue(e)),"addEventListener"in a?a.addEventListener("change",s):a.addListener(s),i.value=a.matches)});return f.tryOnScopeDispose(()=>{p(),l(),a=void 0}),i}function _e(e){return Ve("(prefers-color-scheme: dark)",e)}function De(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 Le={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 Me(e,t,n,r={}){var a;const{flush:i="pre",deep:s=!0,listenToStorageChanges:l=!0,writeDefaults:p=!0,mergeDefaults:d=!1,shallow:c,window:u=A,eventFilter:g,onError:C=U=>{console.error(U)},initOnMounted:E}=r,h=(c?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=ne("getDefaultStorage",()=>{var U;return(U=A)==null?void 0:U.localStorage})()}catch(U){C(U)}if(!n)return h;const y=f.toValue(t),m=De(y),b=(a=r.serializer)!=null?a:Le[m],{pause:_,resume:O}=f.pausableWatch(h,()=>z(h.value),{flush:i,deep:s,eventFilter:g});u&&l&&f.tryOnMounted(()=>{n instanceof Storage?R(u,"storage",M):R(u,oe,L),E&&M()}),E||M();function D(U,P){if(u){const V={key:e,oldValue:U,newValue:P,storageArea:n};u.dispatchEvent(n instanceof Storage?new StorageEvent("storage",V):new CustomEvent(oe,{detail:V}))}}function z(U){try{const P=n.getItem(e);if(U==null)D(P,null),n.removeItem(e);else{const V=b.write(U);P!==V&&(n.setItem(e,V),D(P,V))}}catch(P){C(P)}}function S(U){const P=U?U.newValue:n.getItem(e);if(P==null)return p&&y!=null&&n.setItem(e,b.write(y)),y;if(!U&&d){const V=b.read(P);return typeof d=="function"?d(V,y):m==="object"&&!Array.isArray(V)?{...y,...V}:V}else return typeof P!="string"?P:b.read(P)}function M(U){if(!(U&&U.storageArea!==n)){if(U&&U.key==null){h.value=y;return}if(!(U&&U.key!==e)){_();try{U?.newValue!==b.write(h.value)&&(h.value=S(U))}catch(P){C(P)}finally{U?o.nextTick(O):O()}}}}function L(U){M(U.detail)}return h}const Te="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function ke(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:p,emitAuto:d,disableTransition:c=!0}=e,u={auto:"",light:"light",dark:"dark",...e.modes||{}},g=_e({window:a}),C=o.computed(()=>g.value?"dark":"light"),E=p||(s==null?f.toRef(r):Me(s,r,i,{window:a,listenToStorageChanges:l})),h=o.computed(()=>E.value==="auto"?C.value:E.value),y=ne("updateHTMLAttrs",(O,D,z)=>{const S=typeof O=="string"?a?.document.querySelector(O):T(O);if(!S)return;const M=new Set,L=new Set;let U=null;if(D==="class"){const V=z.split(/\s/g);Object.values(u).flatMap(k=>(k||"").split(/\s/g)).filter(Boolean).forEach(k=>{V.includes(k)?M.add(k):L.add(k)})}else U={key:D,value:z};if(M.size===0&&L.size===0&&U===null)return;let P;c&&(P=a.document.createElement("style"),P.appendChild(document.createTextNode(Te)),a.document.head.appendChild(P));for(const V of M)S.classList.add(V);for(const V of L)S.classList.remove(V);U&&S.setAttribute(U.key,U.value),c&&(a.getComputedStyle(P).opacity,document.head.removeChild(P))});function m(O){var D;y(t,n,(D=u[O])!=null?D:O)}function b(O){e.onChanged?e.onChanged(O,m):m(O)}o.watch(h,b,{flush:"post",immediate:!0}),f.tryOnMounted(()=>b(h.value));const _=o.computed({get(){return d?E.value:h.value},set(O){E.value=O}});return Object.assign(_,{store:E,system:C,state:h})}const Ae=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=ke(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Re=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=w.useDark(e),r=o.reactive({isDark:n,toggleDark:f.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),ze=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=o.reactive(w.useDeviceMotion());return()=>{if(t.default)return t.default(n)}}}),Ie=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(w.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Ne=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:w.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),We=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(w.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),Be=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:w.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),He=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&&w.useStorage(e.storageKey,f.toValue(e.initialValue)||{x:0,y:0},w.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),l=s||e.initialValue||{x:0,y:0},p=(c,u)=>{var g;(g=e.onEnd)==null||g.call(e,c,u),s&&(s.value.x=c.x,s.value.y=c.y)},d=o.reactive(w.useDraggable(n,{...e,handle:r,initialValue:l,onEnd:p,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))}}}),je=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.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=p=>{const d=p?n:r;s&&(clearTimeout(s),s=void 0),d?s=setTimeout(()=>i.value=p,d):i.value=p};return a&&(R(e,"mouseenter",()=>l(!0),{passive:!0}),R(e,"mouseleave",()=>l(!1),{passive:!0})),i}const Fe={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))}}},Ke=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.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 J(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)},p=o.computed(()=>{const u=f.toValue(e);return Array.isArray(u)?u.map(g=>T(g)):[T(u)]}),d=o.watch(p,u=>{if(l(),s.value&&r){i=new ResizeObserver(t);for(const g of u)g&&i.observe(g,a)}},{immediate:!0,flush:"post"}),c=()=>{l(),d()};return f.tryOnScopeDispose(c),{isSupported:s,stop:c}}function Ge(e,t={width:0,height:0},n={}){const{window:r=A,box:a="content-box"}=n,i=o.computed(()=>{var u,g;return(g=(u=T(e))==null?void 0:u.namespaceURI)==null?void 0:g.includes("svg")}),s=o.ref(t.width),l=o.ref(t.height),{stop:p}=J(e,([u])=>{const g=a==="border-box"?u.borderBoxSize:a==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(r&&i.value){const C=T(e);if(C){const E=C.getBoundingClientRect();s.value=E.width,l.value=E.height}}else if(g){const C=Array.isArray(g)?g:[g];s.value=C.reduce((E,{inlineSize:h})=>E+h,0),l.value=C.reduce((E,{blockSize:h})=>E+h,0)}else s.value=u.contentRect.width,l.value=u.contentRect.height},n);f.tryOnMounted(()=>{const u=T(e);u&&(s.value="offsetWidth"in u?u.offsetWidth:t.width,l.value="offsetHeight"in u?u.offsetHeight:t.height)});const d=o.watch(()=>T(e),u=>{s.value=u?t.width:0,l.value=u?t.height:0});function c(){p(),d()}return{width:s,height:l,stop:c}}const Je={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}=Ge(e,...a);o.watch([i,s],([l,p])=>r({width:l,height:p}))}},$e=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:w.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function $(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:i=0,window:s=A,immediate:l=!0}=n,p=H(()=>s&&"IntersectionObserver"in s),d=o.computed(()=>{const E=f.toValue(e);return(Array.isArray(E)?E:[E]).map(T).filter(f.notNullish)});let c=f.noop;const u=o.ref(l),g=p.value?o.watch(()=>[d.value,T(r),u.value],([E,h])=>{if(c(),!u.value||!E.length)return;const y=new IntersectionObserver(t,{root:T(h),rootMargin:a,threshold:i});E.forEach(m=>m&&y.observe(m)),c=()=>{y.disconnect(),c=f.noop}},{immediate:l,flush:"post"}):f.noop,C=()=>{c(),g(),u.value=!1};return f.tryOnScopeDispose(C),{isSupported:p,isActive:u,pause(){c(),u.value=!1},resume(){u.value=!0},stop:C}}function q(e,t={}){const{window:n=A,scrollTarget:r,threshold:a=0}=t,i=o.ref(!1);return $(e,s=>{let l=i.value,p=0;for(const d of s)d.time>=p&&(p=d.time,l=d.isIntersecting);i.value=l},{root:r,window:n,threshold:a}),i}const qe={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=q(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=q(e,r);o.watch(a,i=>n(i),{immediate:!0})}}},Ye=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(w.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),xe=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(w.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),Qe=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(w.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function Ze(e,t,n){const{immediate:r=!0,delay:a=0,onError:i=f.noop,onSuccess:s=f.noop,resetOnExecute:l=!0,shallow:p=!0,throwError:d}=n??{},c=p?o.shallowRef(t):o.ref(t),u=o.ref(!1),g=o.ref(!1),C=o.shallowRef(void 0);async function E(m=0,...b){l&&(c.value=t),C.value=void 0,u.value=!1,g.value=!0,m>0&&await f.promiseTimeout(m);const _=typeof e=="function"?e(...b):e;try{const O=await _;c.value=O,u.value=!0,s(O)}catch(O){if(C.value=O,i(O),d)throw O}finally{g.value=!1}return c.value}r&&E(a);const h={state:c,isReady:u,isLoading:g,error:C,execute:E};function y(){return new Promise((m,b)=>{f.until(g).toBe(!1).then(()=>m(h)).catch(b)})}return{...h,then(m,b){return y().then(m,b)}}}async function et(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:i,sizes:s,class:l,loading:p,crossorigin:d,referrerPolicy:c}=e;r.src=a,i&&(r.srcset=i),s&&(r.sizes=s),l&&(r.className=l),p&&(r.loading=p),d&&(r.crossOrigin=d),c&&(r.referrerPolicy=c),r.onload=()=>t(r),r.onerror=n})}function tt(e,t={}){const n=Ze(()=>et(f.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>f.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const nt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:t}){const n=o.reactive(tt(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:p="auto",window:d=A,onError:c=S=>{console.error(S)}}=t,u=o.ref(0),g=o.ref(0),C=o.computed({get(){return u.value},set(S){h(S,void 0)}}),E=o.computed({get(){return g.value},set(S){h(void 0,S)}});function h(S,M){var L,U,P,V;if(!d)return;const k=f.toValue(e);if(!k)return;(P=k instanceof Document?d.document.body:k)==null||P.scrollTo({top:(L=f.toValue(M))!=null?L:E.value,left:(U=f.toValue(S))!=null?U:C.value,behavior:f.toValue(p)});const N=((V=k?.document)==null?void 0:V.documentElement)||k?.documentElement||k;C!=null&&(u.value=N.scrollLeft),E!=null&&(g.value=N.scrollTop)}const y=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}),_=S=>{y.value&&(y.value=!1,b.left=!1,b.right=!1,b.top=!1,b.bottom=!1,a(S))},O=f.useDebounceFn(_,n+r),D=S=>{var M;if(!d)return;const L=((M=S?.document)==null?void 0:M.documentElement)||S?.documentElement||T(S),{display:U,flexDirection:P}=getComputedStyle(L),V=L.scrollLeft;b.left=V<u.value,b.right=V>u.value;const k=Math.abs(V)<=(s.left||0),N=Math.abs(V)+L.clientWidth>=L.scrollWidth-(s.right||0)-ae;U==="flex"&&P==="row-reverse"?(m.left=N,m.right=k):(m.left=k,m.right=N),u.value=V;let I=L.scrollTop;S===d.document&&!I&&(I=d.document.body.scrollTop),b.top=I<g.value,b.bottom=I>g.value;const de=Math.abs(I)<=(s.top||0),me=Math.abs(I)+L.clientHeight>=L.scrollHeight-(s.bottom||0)-ae;U==="flex"&&P==="column-reverse"?(m.top=me,m.bottom=de):(m.top=de,m.bottom=me),g.value=I},z=S=>{var M;if(!d)return;const L=(M=S.target.documentElement)!=null?M:S.target;D(L),y.value=!0,O(S),i(S)};return R(e,"scroll",n?f.useThrottleFn(z,n,!0,!1):z,l),f.tryOnMounted(()=>{try{const S=f.toValue(e);if(!S)return;D(S)}catch(S){c(S)}}),R(e,"scrollend",_,l),{x:C,y:E,isScrolling:y,arrivedState:m,directions:b,measure(){const S=f.toValue(e);d&&S&&D(S)}}}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}})),p=o.ref(),d=o.computed(()=>!!p.value),c=o.computed(()=>j(f.toValue(e))),u=q(c);function g(){if(l.measure(),!c.value||!u.value||!s(c.value))return;const{scrollHeight:E,clientHeight:h,scrollWidth:y,clientWidth:m}=c.value,b=a==="bottom"||a==="top"?E<=h:y<=m;(l.arrivedState[a]||b)&&(p.value||(p.value=Promise.all([t(l),new Promise(_=>setTimeout(_,i))]).finally(()=>{p.value=null,o.nextTick(()=>g())})))}const C=o.watch(()=>[l.arrivedState[a],u.value],g,{immediate:!0});return f.tryOnUnmounted(C),{isLoading:d,reset(){o.nextTick(()=>g())}}}const ot={mounted(e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},rt={mounted(e,t){typeof t.value=="function"?$(e,t.value):$(e,...t.value)}},at=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(w.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),it=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),st=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(w.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),lt=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(w.useNetwork());return()=>{if(t.default)return t.default(n)}}}),ut=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(w.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),ct=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=f.toRef(e,"object"),r=w.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),ft=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(w.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)}}}),dt=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:w.useOnline()});return()=>{if(t.default)return t.default(n)}}}),mt=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:w.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(w.usePointer({...e,target:e.target==="self"?n:A}));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(w.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),gt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:w.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:w.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:w.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),wt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:w.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),Ut=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:w.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),St={mounted(e,t){typeof t.value=="function"?J(e,t.value):J(e,...t.value)}};function bt(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)},p=o.computed(()=>{const g=f.toValue(e),C=(Array.isArray(g)?g:[g]).map(T).filter(f.notNullish);return new Set(C)}),d=o.watch(()=>p.value,g=>{l(),s.value&&g.size&&(i=new MutationObserver(t),g.forEach(C=>i.observe(C,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 T(t)||((d=r?.document)==null?void 0:d.documentElement)});function p(){var d;const c=f.toValue(e),u=f.toValue(l);if(u&&r&&c){const g=(d=r.getComputedStyle(u).getPropertyValue(c))==null?void 0:d.trim();s.value=g||a}}return i&&bt(l,p,{attributeFilter:["style","class"],window:r}),o.watch([l,()=>f.toValue(e)],(d,c)=>{c[0]&&c[1]&&c[0].style.removeProperty(c[1]),p()},{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 Ct(){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),p=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)",p.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 Et=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}=Ct();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())}}}),Ot={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 Pt(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 Vt(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(f.toRef(e),l=>{const p=j(f.toValue(l));if(p){const d=p;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",p=>{Pt(p)},{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 _t(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Vt(n,r.value);o.watch(t,i=>a.value=i)}}const Dt=_t(),Lt=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(w.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(w.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Tt=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}=w.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(p=>o.h("div",{style:{overflow:"hidden",height:p.height}},t.default?t.default(p):"Please set content!")))])}}),kt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:w.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),At=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(w.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});v.OnClickOutside=pe,v.OnLongPress=we,v.UseActiveElement=Ue,v.UseBattery=Se,v.UseBrowserLocation=be,v.UseClipboard=Ce,v.UseColorMode=Ae,v.UseDark=Re,v.UseDeviceMotion=ze,v.UseDeviceOrientation=Ie,v.UseDevicePixelRatio=Ne,v.UseDevicesList=We,v.UseDocumentVisibility=Be,v.UseDraggable=He,v.UseElementBounding=je,v.UseElementSize=Ke,v.UseElementVisibility=$e,v.UseEyeDropper=Ye,v.UseFullscreen=Xe,v.UseGeolocation=xe,v.UseIdle=Qe,v.UseImage=nt,v.UseMouse=at,v.UseMouseInElement=it,v.UseMousePressed=st,v.UseNetwork=lt,v.UseNow=ut,v.UseObjectUrl=ct,v.UseOffsetPagination=ft,v.UseOnline=dt,v.UsePageLeave=mt,v.UsePointer=pt,v.UsePointerLock=vt,v.UsePreferredColorScheme=gt,v.UsePreferredContrast=ht,v.UsePreferredDark=yt,v.UsePreferredLanguages=wt,v.UsePreferredReducedMotion=Ut,v.UseScreenSafeArea=Et,v.UseTimeAgo=Lt,v.UseTimestamp=Mt,v.UseVirtualList=Tt,v.UseWindowFocus=kt,v.UseWindowSize=At,v.VOnClickOutside=Z,v.VOnLongPress=te,v.vElementHover=Fe,v.vElementSize=Je,v.vElementVisibility=qe,v.vInfiniteScroll=ot,v.vIntersectionObserver=rt,v.vOnClickOutside=Z,v.vOnKeyStroke=ge,v.vOnLongPress=te,v.vResizeObserver=St,v.vScroll=Ot,v.vScrollLock=Dt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { onClickOutside as onClickOutside$1, useActiveElement, useBattery, useBrowserLocation, useClipboard, useDark, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDocumentVisibility, useStorage as useStorage$1, isClient as isClient$1, useDraggable, useElementBounding, useElementSize as useElementSize$1, useElementVisibility as useElementVisibility$1, useEyeDropper, useFullscreen, useGeolocation, useIdle, useMouse, useMouseInElement, useMousePressed, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, usePointer, usePointerLock, usePreferredColorScheme, usePreferredContrast, usePreferredDark as usePreferredDark$1, usePreferredLanguages, usePreferredReducedMotion, useTimeAgo, useTimestamp, useVirtualList, useWindowFocus, useWindowSize } from '@vueuse/core';
2
- import { defineComponent, ref, h, watch, computed, reactive, getCurrentInstance, onMounted, isVue2, watchEffect, shallowRef, nextTick, toRefs } from 'vue-demi';
3
- import { isClient, toValue, noop, isObject, tryOnScopeDispose, isIOS, directiveHooks, pausableWatch, tryOnMounted, toRef, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn, tryOnUnmounted } from '@vueuse/shared';
2
+ import { defineComponent, ref, h, watch, computed, reactive, getCurrentInstance, onMounted, watchEffect, shallowRef, nextTick, toRefs } from 'vue';
3
+ import { isClient, toValue, noop, isObject, tryOnScopeDispose, isIOS, pausableWatch, tryOnMounted, toRef, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn, tryOnUnmounted } from '@vueuse/shared';
4
4
 
5
5
  const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
6
6
  name: "OnClickOutside",
@@ -153,7 +153,7 @@ function onClickOutside(target, handler, options = {}) {
153
153
  }
154
154
 
155
155
  const vOnClickOutside = {
156
- [directiveHooks.mounted](el, binding) {
156
+ mounted(el, binding) {
157
157
  const capture = !binding.modifiers.bubble;
158
158
  if (typeof binding.value === "function") {
159
159
  el.__onClickOutside_stop = onClickOutside(el, binding.value, { capture });
@@ -162,7 +162,7 @@ const vOnClickOutside = {
162
162
  el.__onClickOutside_stop = onClickOutside(el, handler, Object.assign({ capture }, options));
163
163
  }
164
164
  },
165
- [directiveHooks.unmounted](el) {
165
+ unmounted(el) {
166
166
  el.__onClickOutside_stop();
167
167
  }
168
168
  };
@@ -214,7 +214,7 @@ function onKeyStroke(...args) {
214
214
  }
215
215
 
216
216
  const vOnKeyStroke = {
217
- [directiveHooks.mounted](el, binding) {
217
+ mounted(el, binding) {
218
218
  var _a, _b;
219
219
  const keys = (_b = (_a = binding.arg) == null ? void 0 : _a.split(",")) != null ? _b : true;
220
220
  if (typeof binding.value === "function") {
@@ -338,7 +338,7 @@ const OnLongPress = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
338
338
  });
339
339
 
340
340
  const vOnLongPress = {
341
- [directiveHooks.mounted](el, binding) {
341
+ mounted(el, binding) {
342
342
  if (typeof binding.value === "function")
343
343
  onLongPress(el, binding.value, { modifiers: binding.modifiers });
344
344
  else
@@ -417,7 +417,7 @@ function useMounted() {
417
417
  if (instance) {
418
418
  onMounted(() => {
419
419
  isMounted.value = true;
420
- }, isVue2 ? void 0 : instance);
420
+ }, instance);
421
421
  }
422
422
  return isMounted;
423
423
  }
@@ -721,11 +721,7 @@ function useColorMode(options = {}) {
721
721
  store.value = v;
722
722
  }
723
723
  });
724
- try {
725
- return Object.assign(auto, { store, system, state });
726
- } catch (e) {
727
- return auto;
728
- }
724
+ return Object.assign(auto, { store, system, state });
729
725
  }
730
726
 
731
727
  const UseColorMode = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
@@ -921,7 +917,7 @@ function useElementHover(el, options = {}) {
921
917
  }
922
918
 
923
919
  const vElementHover = {
924
- [directiveHooks.mounted](el, binding) {
920
+ mounted(el, binding) {
925
921
  const value = binding.value;
926
922
  if (typeof value === "function") {
927
923
  const isHovered = useElementHover(el);
@@ -1044,7 +1040,7 @@ function useElementSize(target, initialSize = { width: 0, height: 0 }, options =
1044
1040
  }
1045
1041
 
1046
1042
  const vElementSize = {
1047
- [directiveHooks.mounted](el, binding) {
1043
+ mounted(el, binding) {
1048
1044
  var _a;
1049
1045
  const handler = typeof binding.value === "function" ? binding.value : (_a = binding.value) == null ? void 0 : _a[0];
1050
1046
  const options = typeof binding.value === "function" ? [] : binding.value.slice(1);
@@ -1153,7 +1149,7 @@ function useElementVisibility(element, options = {}) {
1153
1149
  }
1154
1150
 
1155
1151
  const vElementVisibility = {
1156
- [directiveHooks.mounted](el, binding) {
1152
+ mounted(el, binding) {
1157
1153
  if (typeof binding.value === "function") {
1158
1154
  const handler = binding.value;
1159
1155
  const isVisible = useElementVisibility(el);
@@ -1570,7 +1566,7 @@ function useInfiniteScroll(element, onLoadMore, options = {}) {
1570
1566
  }
1571
1567
 
1572
1568
  const vInfiniteScroll = {
1573
- [directiveHooks.mounted](el, binding) {
1569
+ mounted(el, binding) {
1574
1570
  if (typeof binding.value === "function")
1575
1571
  useInfiniteScroll(el, binding.value);
1576
1572
  else
@@ -1579,7 +1575,7 @@ const vInfiniteScroll = {
1579
1575
  };
1580
1576
 
1581
1577
  const vIntersectionObserver = {
1582
- [directiveHooks.mounted](el, binding) {
1578
+ mounted(el, binding) {
1583
1579
  if (typeof binding.value === "function")
1584
1580
  useIntersectionObserver(el, binding.value);
1585
1581
  else
@@ -1829,7 +1825,7 @@ const UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponen
1829
1825
  });
1830
1826
 
1831
1827
  const vResizeObserver = {
1832
- [directiveHooks.mounted](el, binding) {
1828
+ mounted(el, binding) {
1833
1829
  if (typeof binding.value === "function")
1834
1830
  useResizeObserver(el, binding.value);
1835
1831
  else
@@ -1999,7 +1995,7 @@ const UseScreenSafeArea = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1999
1995
  });
2000
1996
 
2001
1997
  const vScroll = {
2002
- [directiveHooks.mounted](el, binding) {
1998
+ mounted(el, binding) {
2003
1999
  if (typeof binding.value === "function") {
2004
2000
  const handler = binding.value;
2005
2001
  const state = useScroll(el, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/components",
3
- "version": "11.3.0",
3
+ "version": "12.0.0",
4
4
  "description": "Renderless components for VueUse",
5
5
  "author": "Jacob Clevenger<https://github.com/wheatjs>",
6
6
  "license": "MIT",
@@ -32,8 +32,8 @@
32
32
  "jsdelivr": "./index.iife.min.js",
33
33
  "types": "./index.d.cts",
34
34
  "dependencies": {
35
- "@vueuse/core": "11.3.0",
36
- "@vueuse/shared": "11.3.0",
37
- "vue-demi": ">=0.14.10"
35
+ "@vueuse/core": "12.0.0",
36
+ "@vueuse/shared": "12.0.0",
37
+ "vue": "^3.5.13"
38
38
  }
39
39
  }