@vueuse/components 10.9.0 → 10.10.1

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.cjs CHANGED
@@ -215,12 +215,33 @@ function onLongPress(target, handler, options) {
215
215
  const elementRef = vueDemi.computed(() => unrefElement(target));
216
216
  let timeout;
217
217
  let posStart;
218
+ let startTimestamp;
219
+ let hasLongPressed = false;
218
220
  function clear() {
219
221
  if (timeout) {
220
222
  clearTimeout(timeout);
221
223
  timeout = void 0;
222
224
  }
223
225
  posStart = void 0;
226
+ startTimestamp = void 0;
227
+ hasLongPressed = false;
228
+ }
229
+ function onRelease(ev) {
230
+ var _a2, _b2, _c;
231
+ const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];
232
+ clear();
233
+ if (!(options == null ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp)
234
+ return;
235
+ if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)
236
+ return;
237
+ if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)
238
+ ev.preventDefault();
239
+ if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)
240
+ ev.stopPropagation();
241
+ const dx = ev.x - _posStart.x;
242
+ const dy = ev.y - _posStart.y;
243
+ const distance = Math.sqrt(dx * dx + dy * dy);
244
+ options.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed);
224
245
  }
225
246
  function onDown(ev) {
226
247
  var _a2, _b2, _c, _d;
@@ -235,8 +256,12 @@ function onLongPress(target, handler, options) {
235
256
  x: ev.x,
236
257
  y: ev.y
237
258
  };
259
+ startTimestamp = ev.timeStamp;
238
260
  timeout = setTimeout(
239
- () => handler(ev),
261
+ () => {
262
+ hasLongPressed = true;
263
+ handler(ev);
264
+ },
240
265
  (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY
241
266
  );
242
267
  }
@@ -263,7 +288,7 @@ function onLongPress(target, handler, options) {
263
288
  const cleanup = [
264
289
  useEventListener(elementRef, "pointerdown", onDown, listenerOptions),
265
290
  useEventListener(elementRef, "pointermove", onMove, listenerOptions),
266
- useEventListener(elementRef, ["pointerup", "pointerleave"], clear, listenerOptions)
291
+ useEventListener(elementRef, ["pointerup", "pointerleave"], onRelease, listenerOptions)
267
292
  ];
268
293
  const stop = () => cleanup.forEach((fn) => fn());
269
294
  return stop;
@@ -531,7 +556,7 @@ function useMounted() {
531
556
  if (instance) {
532
557
  vueDemi.onMounted(() => {
533
558
  isMounted.value = true;
534
- }, vueDemi.isVue2 ? null : instance);
559
+ }, vueDemi.isVue2 ? void 0 : instance);
535
560
  }
536
561
  return isMounted;
537
562
  }
@@ -919,9 +944,9 @@ function useElementSize(target, initialSize = { width: 0, height: 0 }, options =
919
944
  if (window && isSVG.value) {
920
945
  const $elem = unrefElement(target);
921
946
  if ($elem) {
922
- const styles = window.getComputedStyle($elem);
923
- width.value = Number.parseFloat(styles.width);
924
- height.value = Number.parseFloat(styles.height);
947
+ const rect = $elem.getBoundingClientRect();
948
+ width.value = rect.width;
949
+ height.value = rect.height;
925
950
  }
926
951
  } else {
927
952
  if (boxSize) {
@@ -1302,7 +1327,7 @@ function useScroll(element, options = {}) {
1302
1327
  }
1303
1328
  });
1304
1329
  function scrollTo(_x, _y) {
1305
- var _a, _b, _c;
1330
+ var _a, _b, _c, _d;
1306
1331
  if (!window)
1307
1332
  return;
1308
1333
  const _element = shared.toValue(element);
@@ -1313,6 +1338,11 @@ function useScroll(element, options = {}) {
1313
1338
  left: (_b = shared.toValue(_x)) != null ? _b : x.value,
1314
1339
  behavior: shared.toValue(behavior)
1315
1340
  });
1341
+ const scrollContainer = ((_d = _element == null ? void 0 : _element.document) == null ? void 0 : _d.documentElement) || (_element == null ? void 0 : _element.documentElement) || _element;
1342
+ if (x != null)
1343
+ internalX.value = scrollContainer.scrollLeft;
1344
+ if (y != null)
1345
+ internalY.value = scrollContainer.scrollTop;
1316
1346
  }
1317
1347
  const isScrolling = vueDemi.ref(false);
1318
1348
  const arrivedState = vueDemi.reactive({
@@ -1756,7 +1786,7 @@ function useMutationObserver(target, callback, options = {}) {
1756
1786
  () => targets.value,
1757
1787
  (targets2) => {
1758
1788
  cleanup();
1759
- if (isSupported.value && window && targets2.size) {
1789
+ if (isSupported.value && targets2.size) {
1760
1790
  observer = new MutationObserver(callback);
1761
1791
  targets2.forEach((el) => observer.observe(el, mutationOptions));
1762
1792
  }
@@ -1946,14 +1976,19 @@ const elInitialOverflow = /* @__PURE__ */ new WeakMap();
1946
1976
  function useScrollLock(element, initialState = false) {
1947
1977
  const isLocked = vueDemi.ref(initialState);
1948
1978
  let stopTouchMoveListener = null;
1979
+ let initialOverflow = "";
1949
1980
  vueDemi.watch(shared.toRef(element), (el) => {
1950
1981
  const target = resolveElement(shared.toValue(el));
1951
1982
  if (target) {
1952
1983
  const ele = target;
1953
1984
  if (!elInitialOverflow.get(ele))
1954
1985
  elInitialOverflow.set(ele, ele.style.overflow);
1986
+ if (ele.style.overflow !== "hidden")
1987
+ initialOverflow = ele.style.overflow;
1988
+ if (ele.style.overflow === "hidden")
1989
+ return isLocked.value = true;
1955
1990
  if (isLocked.value)
1956
- ele.style.overflow = "hidden";
1991
+ return ele.style.overflow = "hidden";
1957
1992
  }
1958
1993
  }, {
1959
1994
  immediate: true
@@ -1976,12 +2011,11 @@ function useScrollLock(element, initialState = false) {
1976
2011
  isLocked.value = true;
1977
2012
  };
1978
2013
  const unlock = () => {
1979
- var _a;
1980
2014
  const el = resolveElement(shared.toValue(element));
1981
2015
  if (!el || !isLocked.value)
1982
2016
  return;
1983
2017
  shared.isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
1984
- el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : "";
2018
+ el.style.overflow = initialOverflow;
1985
2019
  elInitialOverflow.delete(el);
1986
2020
  isLocked.value = false;
1987
2021
  };
@@ -1993,8 +2027,7 @@ function useScrollLock(element, initialState = false) {
1993
2027
  set(v) {
1994
2028
  if (v)
1995
2029
  lock();
1996
- else
1997
- unlock();
2030
+ else unlock();
1998
2031
  }
1999
2032
  });
2000
2033
  }
package/index.d.cts CHANGED
@@ -81,6 +81,13 @@ interface OnLongPressOptions {
81
81
  * @default 10
82
82
  */
83
83
  distanceThreshold?: number | false;
84
+ /**
85
+ * Function called when the ref element is released.
86
+ * @param duration how long the element was pressed in ms
87
+ * @param distance distance from the pointerdown position
88
+ * @param isLongPress whether the action was a long press or not
89
+ */
90
+ onMouseUp?: (duration: number, distance: number, isLongPress: boolean) => void;
84
91
  }
85
92
  interface OnLongPressModifiers {
86
93
  stop?: boolean;
package/index.d.mts CHANGED
@@ -81,6 +81,13 @@ interface OnLongPressOptions {
81
81
  * @default 10
82
82
  */
83
83
  distanceThreshold?: number | false;
84
+ /**
85
+ * Function called when the ref element is released.
86
+ * @param duration how long the element was pressed in ms
87
+ * @param distance distance from the pointerdown position
88
+ * @param isLongPress whether the action was a long press or not
89
+ */
90
+ onMouseUp?: (duration: number, distance: number, isLongPress: boolean) => void;
84
91
  }
85
92
  interface OnLongPressModifiers {
86
93
  stop?: boolean;
package/index.d.ts CHANGED
@@ -81,6 +81,13 @@ interface OnLongPressOptions {
81
81
  * @default 10
82
82
  */
83
83
  distanceThreshold?: number | false;
84
+ /**
85
+ * Function called when the ref element is released.
86
+ * @param duration how long the element was pressed in ms
87
+ * @param distance distance from the pointerdown position
88
+ * @param isLongPress whether the action was a long press or not
89
+ */
90
+ onMouseUp?: (duration: number, distance: number, isLongPress: boolean) => void;
84
91
  }
85
92
  interface OnLongPressModifiers {
86
93
  stop?: boolean;
package/index.iife.js CHANGED
@@ -113,9 +113,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
113
113
  }
114
114
  return VueDemi
115
115
  })(
116
- (this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
117
- this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
118
- this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
116
+ ((globalThis || self).VueDemi = (globalThis || self).VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
117
+ (globalThis || self).Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
118
+ (globalThis || self).VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
119
119
  );
120
120
  ;
121
121
  ;(function (exports, vueDemi, core, shared) {
@@ -332,12 +332,33 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
332
332
  const elementRef = vueDemi.computed(() => unrefElement(target));
333
333
  let timeout;
334
334
  let posStart;
335
+ let startTimestamp;
336
+ let hasLongPressed = false;
335
337
  function clear() {
336
338
  if (timeout) {
337
339
  clearTimeout(timeout);
338
340
  timeout = void 0;
339
341
  }
340
342
  posStart = void 0;
343
+ startTimestamp = void 0;
344
+ hasLongPressed = false;
345
+ }
346
+ function onRelease(ev) {
347
+ var _a2, _b2, _c;
348
+ const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];
349
+ clear();
350
+ if (!(options == null ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp)
351
+ return;
352
+ if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)
353
+ return;
354
+ if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)
355
+ ev.preventDefault();
356
+ if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)
357
+ ev.stopPropagation();
358
+ const dx = ev.x - _posStart.x;
359
+ const dy = ev.y - _posStart.y;
360
+ const distance = Math.sqrt(dx * dx + dy * dy);
361
+ options.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed);
341
362
  }
342
363
  function onDown(ev) {
343
364
  var _a2, _b2, _c, _d;
@@ -352,8 +373,12 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
352
373
  x: ev.x,
353
374
  y: ev.y
354
375
  };
376
+ startTimestamp = ev.timeStamp;
355
377
  timeout = setTimeout(
356
- () => handler(ev),
378
+ () => {
379
+ hasLongPressed = true;
380
+ handler(ev);
381
+ },
357
382
  (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY
358
383
  );
359
384
  }
@@ -380,7 +405,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
380
405
  const cleanup = [
381
406
  useEventListener(elementRef, "pointerdown", onDown, listenerOptions),
382
407
  useEventListener(elementRef, "pointermove", onMove, listenerOptions),
383
- useEventListener(elementRef, ["pointerup", "pointerleave"], clear, listenerOptions)
408
+ useEventListener(elementRef, ["pointerup", "pointerleave"], onRelease, listenerOptions)
384
409
  ];
385
410
  const stop = () => cleanup.forEach((fn) => fn());
386
411
  return stop;
@@ -648,7 +673,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
648
673
  if (instance) {
649
674
  vueDemi.onMounted(() => {
650
675
  isMounted.value = true;
651
- }, vueDemi.isVue2 ? null : instance);
676
+ }, vueDemi.isVue2 ? void 0 : instance);
652
677
  }
653
678
  return isMounted;
654
679
  }
@@ -1036,9 +1061,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1036
1061
  if (window && isSVG.value) {
1037
1062
  const $elem = unrefElement(target);
1038
1063
  if ($elem) {
1039
- const styles = window.getComputedStyle($elem);
1040
- width.value = Number.parseFloat(styles.width);
1041
- height.value = Number.parseFloat(styles.height);
1064
+ const rect = $elem.getBoundingClientRect();
1065
+ width.value = rect.width;
1066
+ height.value = rect.height;
1042
1067
  }
1043
1068
  } else {
1044
1069
  if (boxSize) {
@@ -1419,7 +1444,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1419
1444
  }
1420
1445
  });
1421
1446
  function scrollTo(_x, _y) {
1422
- var _a, _b, _c;
1447
+ var _a, _b, _c, _d;
1423
1448
  if (!window)
1424
1449
  return;
1425
1450
  const _element = shared.toValue(element);
@@ -1430,6 +1455,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1430
1455
  left: (_b = shared.toValue(_x)) != null ? _b : x.value,
1431
1456
  behavior: shared.toValue(behavior)
1432
1457
  });
1458
+ const scrollContainer = ((_d = _element == null ? void 0 : _element.document) == null ? void 0 : _d.documentElement) || (_element == null ? void 0 : _element.documentElement) || _element;
1459
+ if (x != null)
1460
+ internalX.value = scrollContainer.scrollLeft;
1461
+ if (y != null)
1462
+ internalY.value = scrollContainer.scrollTop;
1433
1463
  }
1434
1464
  const isScrolling = vueDemi.ref(false);
1435
1465
  const arrivedState = vueDemi.reactive({
@@ -1873,7 +1903,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1873
1903
  () => targets.value,
1874
1904
  (targets2) => {
1875
1905
  cleanup();
1876
- if (isSupported.value && window && targets2.size) {
1906
+ if (isSupported.value && targets2.size) {
1877
1907
  observer = new MutationObserver(callback);
1878
1908
  targets2.forEach((el) => observer.observe(el, mutationOptions));
1879
1909
  }
@@ -2063,14 +2093,19 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2063
2093
  function useScrollLock(element, initialState = false) {
2064
2094
  const isLocked = vueDemi.ref(initialState);
2065
2095
  let stopTouchMoveListener = null;
2096
+ let initialOverflow = "";
2066
2097
  vueDemi.watch(shared.toRef(element), (el) => {
2067
2098
  const target = resolveElement(shared.toValue(el));
2068
2099
  if (target) {
2069
2100
  const ele = target;
2070
2101
  if (!elInitialOverflow.get(ele))
2071
2102
  elInitialOverflow.set(ele, ele.style.overflow);
2103
+ if (ele.style.overflow !== "hidden")
2104
+ initialOverflow = ele.style.overflow;
2105
+ if (ele.style.overflow === "hidden")
2106
+ return isLocked.value = true;
2072
2107
  if (isLocked.value)
2073
- ele.style.overflow = "hidden";
2108
+ return ele.style.overflow = "hidden";
2074
2109
  }
2075
2110
  }, {
2076
2111
  immediate: true
@@ -2093,12 +2128,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2093
2128
  isLocked.value = true;
2094
2129
  };
2095
2130
  const unlock = () => {
2096
- var _a;
2097
2131
  const el = resolveElement(shared.toValue(element));
2098
2132
  if (!el || !isLocked.value)
2099
2133
  return;
2100
2134
  shared.isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
2101
- el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : "";
2135
+ el.style.overflow = initialOverflow;
2102
2136
  elInitialOverflow.delete(el);
2103
2137
  isLocked.value = false;
2104
2138
  };
@@ -2110,8 +2144,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2110
2144
  set(v) {
2111
2145
  if (v)
2112
2146
  lock();
2113
- else
2114
- unlock();
2147
+ else unlock();
2115
2148
  }
2116
2149
  });
2117
2150
  }
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var VueDemi=function(i,o,y){if(i.install)return i;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),i;if(o.version.slice(0,4)==="2.7."){let S=function(L,_){var R,B={},j={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(z,H){return B[z]=H,this},directive:function(z,H){return H?(o.directive(z,H),j):o.directive(z)},mount:function(z,H){return R||(R=new o(Object.assign({propsData:_},L,{provide:Object.assign(B,L.provide)})),R.$mount(z,H),R)},unmount:function(){R&&(R.$destroy(),R=void 0)}};return j};var D=S;for(var u in o)i[u]=o[u];i.isVue2=!0,i.isVue3=!1,i.install=function(){},i.Vue=o,i.Vue2=o,i.version=o.version,i.warn=o.util.warn,i.hasInjectionContext=function(){return!!i.getCurrentInstance()},i.createApp=S}else if(o.version.slice(0,2)==="2.")if(y){for(var u in y)i[u]=y[u];i.isVue2=!0,i.isVue3=!1,i.install=function(){},i.Vue=o,i.Vue2=o,i.version=o.version,i.hasInjectionContext=function(){return!!i.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var u in o)i[u]=o[u];i.isVue2=!1,i.isVue3=!0,i.install=function(){},i.Vue=o,i.Vue2=void 0,i.version=o.version,i.set=function(S,L,_){return Array.isArray(S)?(S.length=Math.max(S.length,L),S.splice(L,1,_),_):(S[L]=_,_)},i.del=function(S,L){if(Array.isArray(S)){S.splice(L,1);return}delete S[L]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return i}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(i,o,y,u){"use strict";const D=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return y.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}});function S(e){var t;const n=u.toValue(e);return(t=n?.$el)!=null?t:n}const L=u.isClient?window:void 0;function _(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=L):[t,n,r,a]=e,!t)return u.noop;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],l=()=>{s.forEach(m=>m()),s.length=0},c=(m,f,d,h)=>(m.addEventListener(f,d,h),()=>m.removeEventListener(f,d,h)),p=o.watch(()=>[S(t),u.toValue(a)],([m,f])=>{if(l(),!m)return;const d=u.isObject(f)?{...f}:f;s.push(...n.flatMap(h=>r.map(g=>c(m,h,g,d))))},{immediate:!0,flush:"post"}),v=()=>{p(),l()};return u.tryOnScopeDispose(v),v}let R=!1;function B(e,t,n={}){const{window:r=L,ignore:a=[],capture:s=!0,detectIframe:l=!1}=n;if(!r)return u.noop;u.isIOS&&!R&&(R=!0,Array.from(r.document.body.children).forEach(d=>d.addEventListener("click",u.noop)),r.document.documentElement.addEventListener("click",u.noop));let c=!0;const p=d=>a.some(h=>{if(typeof h=="string")return Array.from(r.document.querySelectorAll(h)).some(g=>g===d.target||d.composedPath().includes(g));{const g=S(h);return g&&(d.target===g||d.composedPath().includes(g))}}),m=[_(r,"click",d=>{const h=S(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(c=!p(d)),!c){c=!0;return}t(d)}},{passive:!0,capture:s}),_(r,"pointerdown",d=>{const h=S(e);c=!p(d)&&!!(h&&!d.composedPath().includes(h))},{passive:!0}),l&&_(r,"blur",d=>{setTimeout(()=>{var h;const g=S(e);((h=r.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!g?.contains(r.document.activeElement)&&t(d)},0)})].filter(Boolean);return()=>m.forEach(d=>d())}const j={[u.directiveHooks.mounted](e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=B(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=B(e,r,Object.assign({capture:n},a))}},[u.directiveHooks.unmounted](e){e.__onClickOutside_stop()}};function z(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function H(...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=L,eventName:s="keydown",passive:l=!1,dedupe:c=!1}=r,p=z(t);return _(a,s,m=>{m.repeat&&u.toValue(c)||p(m)&&n(m)},l)}const ve={[u.directiveHooks.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")H(a,t.value,{target:e});else{const[s,l]=t.value;H(a,s,{target:e,...l})}}},ge=500,me=10;function x(e,t,n){var r,a;const s=o.computed(()=>S(e));let l,c;function p(){l&&(clearTimeout(l),l=void 0),c=void 0}function v(g){var C,E,b,O;(C=n?.modifiers)!=null&&C.self&&g.target!==s.value||(p(),(E=n?.modifiers)!=null&&E.prevent&&g.preventDefault(),(b=n?.modifiers)!=null&&b.stop&&g.stopPropagation(),c={x:g.x,y:g.y},l=setTimeout(()=>t(g),(O=n?.delay)!=null?O:ge))}function m(g){var C,E,b,O;if((C=n?.modifiers)!=null&&C.self&&g.target!==s.value||!c||n?.distanceThreshold===!1)return;(E=n?.modifiers)!=null&&E.prevent&&g.preventDefault(),(b=n?.modifiers)!=null&&b.stop&&g.stopPropagation();const I=g.x-c.x,P=g.y-c.y;Math.sqrt(I*I+P*P)>=((O=n?.distanceThreshold)!=null?O:me)&&p()}const f={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},d=[_(s,"pointerdown",v,f),_(s,"pointermove",m,f),_(s,["pointerup","pointerleave"],p,f)];return()=>d.forEach(g=>g())}const he=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())}}}),ee={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?x(e,t.value,{modifiers:t.modifiers}):x(e,...t.value)}},ye=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:y.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),we=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(y.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Ue=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(y.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),be=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(y.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},K="__vueuse_ssr_handlers__",Se=Ce();function Ce(){return K in F||(F[K]=F[K]||{}),F[K]}function te(e,t){return Se[e]||t}function Oe(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 Ee={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()}},ne="vueuse-storage";function Pe(e,t,n,r={}){var a;const{flush:s="pre",deep:l=!0,listenToStorageChanges:c=!0,writeDefaults:p=!0,mergeDefaults:v=!1,shallow:m,window:f=L,eventFilter:d,onError:h=w=>{console.error(w)},initOnMounted:g}=r,C=(m?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=te("getDefaultStorage",()=>{var w;return(w=L)==null?void 0:w.localStorage})()}catch(w){h(w)}if(!n)return C;const E=u.toValue(t),b=Oe(E),O=(a=r.serializer)!=null?a:Ee[b],{pause:I,resume:P}=u.pausableWatch(C,()=>N(C.value),{flush:s,deep:l,eventFilter:d});f&&c&&u.tryOnMounted(()=>{_(f,"storage",A),_(f,ne,T),g&&A()}),g||A();function V(w,k){f&&f.dispatchEvent(new CustomEvent(ne,{detail:{key:e,oldValue:w,newValue:k,storageArea:n}}))}function N(w){try{const k=n.getItem(e);if(w==null)V(k,null),n.removeItem(e);else{const M=O.write(w);k!==M&&(n.setItem(e,M),V(k,M))}}catch(k){h(k)}}function U(w){const k=w?w.newValue:n.getItem(e);if(k==null)return p&&E!=null&&n.setItem(e,O.write(E)),E;if(!w&&v){const M=O.read(k);return typeof v=="function"?v(M,E):b==="object"&&!Array.isArray(M)?{...E,...M}:M}else return typeof k!="string"?k:O.read(k)}function A(w){if(!(w&&w.storageArea!==n)){if(w&&w.key==null){C.value=E;return}if(!(w&&w.key!==e)){I();try{w?.newValue!==O.write(C.value)&&(C.value=U(w))}catch(k){h(k)}finally{w?o.nextTick(P):P()}}}}function T(w){A(w.detail)}return C}function Le(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},o.isVue2?null:t),e}function G(e){const t=Le();return o.computed(()=>(t.value,!!e()))}function _e(e,t={}){const{window:n=L}=t,r=G(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const s=o.ref(!1),l=v=>{s.value=v.matches},c=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",l):a.removeListener(l))},p=o.watchEffect(()=>{r.value&&(c(),a=n.matchMedia(u.toValue(e)),"addEventListener"in a?a.addEventListener("change",l):a.addListener(l),s.value=a.matches)});return u.tryOnScopeDispose(()=>{p(),c(),a=void 0}),s}function ke(e){return _e("(prefers-color-scheme: dark)",e)}function Ae(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=L,storage:s,storageKey:l="vueuse-color-scheme",listenToStorageChanges:c=!0,storageRef:p,emitAuto:v,disableTransition:m=!0}=e,f={auto:"",light:"light",dark:"dark",...e.modes||{}},d=ke({window:a}),h=o.computed(()=>d.value?"dark":"light"),g=p||(l==null?u.toRef(r):Pe(l,r,s,{window:a,listenToStorageChanges:c})),C=o.computed(()=>g.value==="auto"?h.value:g.value),E=te("updateHTMLAttrs",(P,V,N)=>{const U=typeof P=="string"?a?.document.querySelector(P):S(P);if(!U)return;let A;if(m&&(A=a.document.createElement("style"),A.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),a.document.head.appendChild(A)),V==="class"){const T=N.split(/\s/g);Object.values(f).flatMap(w=>(w||"").split(/\s/g)).filter(Boolean).forEach(w=>{T.includes(w)?U.classList.add(w):U.classList.remove(w)})}else U.setAttribute(V,N);m&&(a.getComputedStyle(A).opacity,document.head.removeChild(A))});function b(P){var V;E(t,n,(V=f[P])!=null?V:P)}function O(P){e.onChanged?e.onChanged(P,b):b(P)}o.watch(C,O,{flush:"post",immediate:!0}),u.tryOnMounted(()=>O(C.value));const I=o.computed({get(){return v?g.value:C.value},set(P){g.value=P}});try{return Object.assign(I,{store:g,system:h,state:C})}catch{return I}}const Me=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ae(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Te=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=y.useDark(e),r=o.reactive({isDark:n,toggleDark:u.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ve=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=o.reactive(y.useDeviceMotion());return()=>{if(t.default)return t.default(n)}}}),Ie=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(y.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),Re=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:y.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),He=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(y.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),ze=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:y.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Ne=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var v;return(v=e.handle)!=null?v:n.value}),a=o.computed(()=>!!e.disabled),s=e.storageKey&&y.useStorage(e.storageKey,u.toValue(e.initialValue)||{x:0,y:0},y.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),l=s||e.initialValue||{x:0,y:0},c=(v,m)=>{var f;(f=e.onEnd)==null||f.call(e,v,m),s&&(s.value.x=v.x,s.value.y=v.y)},p=o.reactive(y.useDraggable(n,{...e,handle:r,initialValue:l,onEnd:c,disabled:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${p.style}`},t.default(p))}}}),We=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(y.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Be(e,t={}){const{delayEnter:n=0,delayLeave:r=0,window:a=L}=t,s=o.ref(!1);let l;const c=p=>{const v=p?n:r;l&&(clearTimeout(l),l=void 0),v?l=setTimeout(()=>s.value=p,v):s.value=p};return a&&(_(e,"mouseenter",()=>c(!0),{passive:!0}),_(e,"mouseleave",()=>c(!1),{passive:!0})),s}const je={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=Be(e);o.watch(n,r=>t.value(r))}}},Fe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(y.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 Ke(e,t,n={}){const{window:r=L,...a}=n;let s;const l=G(()=>r&&"ResizeObserver"in r),c=()=>{s&&(s.disconnect(),s=void 0)},p=o.computed(()=>Array.isArray(e)?e.map(f=>S(f)):[S(e)]),v=o.watch(p,f=>{if(c(),l.value&&r){s=new ResizeObserver(t);for(const d of f)d&&s.observe(d,a)}},{immediate:!0,flush:"post"}),m=()=>{c(),v()};return u.tryOnScopeDispose(m),{isSupported:l,stop:m}}function Ge(e,t={width:0,height:0},n={}){const{window:r=L,box:a="content-box"}=n,s=o.computed(()=>{var f,d;return(d=(f=S(e))==null?void 0:f.namespaceURI)==null?void 0:d.includes("svg")}),l=o.ref(t.width),c=o.ref(t.height),{stop:p}=Ke(e,([f])=>{const d=a==="border-box"?f.borderBoxSize:a==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(r&&s.value){const h=S(e);if(h){const g=r.getComputedStyle(h);l.value=Number.parseFloat(g.width),c.value=Number.parseFloat(g.height)}}else if(d){const h=Array.isArray(d)?d:[d];l.value=h.reduce((g,{inlineSize:C})=>g+C,0),c.value=h.reduce((g,{blockSize:C})=>g+C,0)}else l.value=f.contentRect.width,c.value=f.contentRect.height},n);u.tryOnMounted(()=>{const f=S(e);f&&(l.value="offsetWidth"in f?f.offsetWidth:t.width,c.value="offsetHeight"in f?f.offsetHeight:t.height)});const v=o.watch(()=>S(e),f=>{l.value=f?t.width:0,c.value=f?t.height:0});function m(){p(),v()}return{width:l,height:c,stop:m}}const Je={[u.directiveHooks.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:l}=Ge(e,...a);o.watch([s,l],([c,p])=>r({width:c,height:p}))}},Ye=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:y.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function X(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:s=.1,window:l=L,immediate:c=!0}=n,p=G(()=>l&&"IntersectionObserver"in l),v=o.computed(()=>{const g=u.toValue(e);return(Array.isArray(g)?g:[g]).map(S).filter(u.notNullish)});let m=u.noop;const f=o.ref(c),d=p.value?o.watch(()=>[v.value,S(r),f.value],([g,C])=>{if(m(),!f.value||!g.length)return;const E=new IntersectionObserver(t,{root:S(C),rootMargin:a,threshold:s});g.forEach(b=>b&&E.observe(b)),m=()=>{E.disconnect(),m=u.noop}},{immediate:c,flush:"post"}):u.noop,h=()=>{m(),d(),f.value=!1};return u.tryOnScopeDispose(h),{isSupported:p,isActive:f,pause(){m(),f.value=!1},resume(){f.value=!0},stop:h}}function Q(e,t={}){const{window:n=L,scrollTarget:r,threshold:a=0}=t,s=o.ref(!1);return X(e,l=>{let c=s.value,p=0;for(const v of l)v.time>=p&&(p=v.time,c=v.isIntersecting);s.value=c},{root:r,window:n,threshold:a}),s}const $e={[u.directiveHooks.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,s=>n(s),{immediate:!0})}}},qe=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(y.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(y.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(y.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(y.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:s=u.noop,onSuccess:l=u.noop,resetOnExecute:c=!0,shallow:p=!0,throwError:v}=n??{},m=p?o.shallowRef(t):o.ref(t),f=o.ref(!1),d=o.ref(!1),h=o.shallowRef(void 0);async function g(b=0,...O){c&&(m.value=t),h.value=void 0,f.value=!1,d.value=!0,b>0&&await u.promiseTimeout(b);const I=typeof e=="function"?e(...O):e;try{const P=await I;m.value=P,f.value=!0,l(P)}catch(P){if(h.value=P,s(P),v)throw P}finally{d.value=!1}return m.value}r&&g(a);const C={state:m,isReady:f,isLoading:d,error:h,execute:g};function E(){return new Promise((b,O)=>{u.until(d).toBe(!1).then(()=>b(C)).catch(O)})}return{...C,then(b,O){return E().then(b,O)}}}async function De(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:s,sizes:l,class:c,loading:p,crossorigin:v,referrerPolicy:m}=e;r.src=a,s&&(r.srcset=s),l&&(r.sizes=l),c&&(r.className=c),p&&(r.loading=p),v&&(r.crossOrigin=v),m&&(r.referrerPolicy=m),r.onload=()=>t(r),r.onerror=n})}function et(e,t={}){const n=Ze(()=>De(u.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>u.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const tt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:t}){const n=o.reactive(et(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)}}),oe=1;function Z(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=u.noop,onScroll:s=u.noop,offset:l={left:0,right:0,top:0,bottom:0},eventListenerOptions:c={capture:!1,passive:!0},behavior:p="auto",window:v=L,onError:m=U=>{console.error(U)}}=t,f=o.ref(0),d=o.ref(0),h=o.computed({get(){return f.value},set(U){C(U,void 0)}}),g=o.computed({get(){return d.value},set(U){C(void 0,U)}});function C(U,A){var T,w,k;if(!v)return;const M=u.toValue(e);M&&((k=M instanceof Document?v.document.body:M)==null||k.scrollTo({top:(T=u.toValue(A))!=null?T:g.value,left:(w=u.toValue(U))!=null?w:h.value,behavior:u.toValue(p)}))}const E=o.ref(!1),b=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),O=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),I=U=>{E.value&&(E.value=!1,O.left=!1,O.right=!1,O.top=!1,O.bottom=!1,a(U))},P=u.useDebounceFn(I,n+r),V=U=>{var A;if(!v)return;const T=((A=U?.document)==null?void 0:A.documentElement)||U?.documentElement||S(U),{display:w,flexDirection:k}=getComputedStyle(T),M=T.scrollLeft;O.left=M<f.value,O.right=M>f.value;const ce=Math.abs(M)<=(l.left||0),fe=Math.abs(M)+T.clientWidth>=T.scrollWidth-(l.right||0)-oe;w==="flex"&&k==="row-reverse"?(b.left=fe,b.right=ce):(b.left=ce,b.right=fe),f.value=M;let W=T.scrollTop;U===v.document&&!W&&(W=v.document.body.scrollTop),O.top=W<d.value,O.bottom=W>d.value;const de=Math.abs(W)<=(l.top||0),pe=Math.abs(W)+T.clientHeight>=T.scrollHeight-(l.bottom||0)-oe;w==="flex"&&k==="column-reverse"?(b.top=pe,b.bottom=de):(b.top=de,b.bottom=pe),d.value=W},N=U=>{var A;if(!v)return;const T=(A=U.target.documentElement)!=null?A:U.target;V(T),E.value=!0,P(U),s(U)};return _(e,"scroll",n?u.useThrottleFn(N,n,!0,!1):N,c),u.tryOnMounted(()=>{try{const U=u.toValue(e);if(!U)return;V(U)}catch(U){m(U)}}),_(e,"scrollend",I,c),{x:h,y:g,isScrolling:E,arrivedState:b,directions:O,measure(){const U=u.toValue(e);v&&U&&V(U)}}}function J(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function re(e,t,n={}){var r;const{direction:a="bottom",interval:s=100,canLoadMore:l=()=>!0}=n,c=o.reactive(Z(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),p=o.ref(),v=o.computed(()=>!!p.value),m=o.computed(()=>J(u.toValue(e))),f=Q(m);function d(){if(c.measure(),!m.value||!f.value||!l(m.value))return;const{scrollHeight:h,clientHeight:g,scrollWidth:C,clientWidth:E}=m.value,b=a==="bottom"||a==="top"?h<=g:C<=E;(c.arrivedState[a]||b)&&(p.value||(p.value=Promise.all([t(c),new Promise(O=>setTimeout(O,s))]).finally(()=>{p.value=null,o.nextTick(()=>d())})))}return o.watch(()=>[c.arrivedState[a],f.value],d,{immediate:!0}),{isLoading:v}}const nt={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?re(e,t.value):re(e,...t.value)}},ot={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?X(e,t.value):X(e,...t.value)}},rt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(y.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(y.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(y.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(y.useNetwork());return()=>{if(t.default)return t.default(n)}}}),lt=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(y.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),ut=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=u.toRef(e,"object"),r=y.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(y.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)}}}),ft=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:y.useOnline()});return()=>{if(t.default)return t.default(n)}}}),dt=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:y.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(y.usePointer({...e,target:e.target==="self"?n:L}));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(y.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:y.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),mt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:y.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:y.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:y.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),wt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:y.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}});function Ut(e,t,n={}){const{window:r=L,...a}=n;let s;const l=G(()=>r&&"MutationObserver"in r),c=()=>{s&&(s.disconnect(),s=void 0)},p=o.computed(()=>{const d=u.toValue(e),h=(Array.isArray(d)?d:[d]).map(S).filter(u.notNullish);return new Set(h)}),v=o.watch(()=>p.value,d=>{c(),l.value&&r&&d.size&&(s=new MutationObserver(t),d.forEach(h=>s.observe(h,a)))},{immediate:!0,flush:"post"}),m=()=>s?.takeRecords(),f=()=>{c(),v()};return u.tryOnScopeDispose(f),{isSupported:l,stop:f,takeRecords:m}}function Y(e,t,n={}){const{window:r=L,initialValue:a="",observe:s=!1}=n,l=o.ref(a),c=o.computed(()=>{var v;return S(t)||((v=r?.document)==null?void 0:v.documentElement)});function p(){var v;const m=u.toValue(e),f=u.toValue(c);if(f&&r){const d=(v=r.getComputedStyle(f).getPropertyValue(m))==null?void 0:v.trim();l.value=d||a}}return s&&Ut(c,p,{attributeFilter:["style","class"],window:r}),o.watch([c,()=>u.toValue(e)],p,{immediate:!0}),o.watch(l,v=>{var m;(m=c.value)!=null&&m.style&&c.value.style.setProperty(u.toValue(e),v)}),l}const ae="--vueuse-safe-area-top",se="--vueuse-safe-area-right",ie="--vueuse-safe-area-bottom",le="--vueuse-safe-area-left";function bt(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(u.isClient){const s=Y(ae),l=Y(se),c=Y(ie),p=Y(le);s.value="env(safe-area-inset-top, 0px)",l.value="env(safe-area-inset-right, 0px)",c.value="env(safe-area-inset-bottom, 0px)",p.value="env(safe-area-inset-left, 0px)",a(),_("resize",u.useDebounceFn(a))}function a(){e.value=$(ae),t.value=$(se),n.value=$(ie),r.value=$(le)}return{top:e,right:t,bottom:n,left:r,update:a}}function $(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const St=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}=bt();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())}}}),Ct={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=Z(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=Z(e,{...r,onScroll(s){var l;(l=r.onScroll)==null||l.call(r,s),n(a)},onStop(s){var l;(l=r.onStop)==null||l.call(r,s),n(a)}})}}};function ue(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:ue(n)}}function Ot(e){const t=e||window.event,n=t.target;return ue(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const q=new WeakMap;function Et(e,t=!1){const n=o.ref(t);let r=null;o.watch(u.toRef(e),l=>{const c=J(u.toValue(l));if(c){const p=c;q.get(p)||q.set(p,p.style.overflow),n.value&&(p.style.overflow="hidden")}},{immediate:!0});const a=()=>{const l=J(u.toValue(e));!l||n.value||(u.isIOS&&(r=_(l,"touchmove",c=>{Ot(c)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},s=()=>{var l;const c=J(u.toValue(e));!c||!n.value||(u.isIOS&&r?.(),c.style.overflow=(l=q.get(c))!=null?l:"",q.delete(c),n.value=!1)};return u.tryOnScopeDispose(s),o.computed({get(){return n.value},set(l){l?a():s()}})}function Pt(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Et(n,r.value);o.watch(t,s=>a.value=s)}}const Lt=Pt(),_t=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(y.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(y.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),At=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:l,scrollTo:c}=y.useVirtualList(r,e.options);return n({scrollTo:c}),s.style&&typeof s.style=="object"&&!Array.isArray(s.style)&&(s.style.height=e.height||"300px"),()=>o.h("div",{...s},[o.h("div",{...l.value},a.value.map(p=>o.h("div",{style:{overflow:"hidden",height:p.height}},t.default?t.default(p):"Please set content!")))])}}),Mt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:y.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(y.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});i.OnClickOutside=D,i.OnLongPress=he,i.UseActiveElement=ye,i.UseBattery=we,i.UseBrowserLocation=Ue,i.UseClipboard=be,i.UseColorMode=Me,i.UseDark=Te,i.UseDeviceMotion=Ve,i.UseDeviceOrientation=Ie,i.UseDevicePixelRatio=Re,i.UseDevicesList=He,i.UseDocumentVisibility=ze,i.UseDraggable=Ne,i.UseElementBounding=We,i.UseElementSize=Fe,i.UseElementVisibility=Ye,i.UseEyeDropper=qe,i.UseFullscreen=xe,i.UseGeolocation=Xe,i.UseIdle=Qe,i.UseImage=tt,i.UseMouse=rt,i.UseMouseInElement=at,i.UseMousePressed=st,i.UseNetwork=it,i.UseNow=lt,i.UseObjectUrl=ut,i.UseOffsetPagination=ct,i.UseOnline=ft,i.UsePageLeave=dt,i.UsePointer=pt,i.UsePointerLock=vt,i.UsePreferredColorScheme=gt,i.UsePreferredContrast=mt,i.UsePreferredDark=ht,i.UsePreferredLanguages=yt,i.UsePreferredReducedMotion=wt,i.UseScreenSafeArea=St,i.UseTimeAgo=_t,i.UseTimestamp=kt,i.UseVirtualList=At,i.UseWindowFocus=Mt,i.UseWindowSize=Tt,i.VOnClickOutside=j,i.VOnLongPress=ee,i.vElementHover=je,i.vElementSize=Je,i.vElementVisibility=$e,i.vInfiniteScroll=nt,i.vIntersectionObserver=ot,i.vOnClickOutside=j,i.vOnKeyStroke=ve,i.vOnLongPress=ee,i.vScroll=Ct,i.vScrollLock=Lt})(this.VueUse=this.VueUse||{},VueDemi,VueUse,VueUse);
1
+ var VueDemi=function(l,o,w){if(l.install)return l;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),l;if(o.version.slice(0,4)==="2.7."){let O=function(P,L){var H,j={},F={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(W,N){return j[W]=N,this},directive:function(W,N){return N?(o.directive(W,N),F):o.directive(W)},mount:function(W,N){return H||(H=new o(Object.assign({propsData:L},P,{provide:Object.assign(j,P.provide)})),H.$mount(W,N),H)},unmount:function(){H&&(H.$destroy(),H=void 0)}};return F};var te=O;for(var u in o)l[u]=o[u];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.warn=o.util.warn,l.hasInjectionContext=function(){return!!l.getCurrentInstance()},l.createApp=O}else if(o.version.slice(0,2)==="2.")if(w){for(var u in w)l[u]=w[u];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.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(o.version.slice(0,2)==="3."){for(var u in o)l[u]=o[u];l.isVue2=!1,l.isVue3=!0,l.install=function(){},l.Vue=o,l.Vue2=void 0,l.version=o.version,l.set=function(O,P,L){return Array.isArray(O)?(O.length=Math.max(O.length,P),O.splice(P,1,L),L):(O[P]=L,L)},l.del=function(O,P){if(Array.isArray(O)){O.splice(P,1);return}delete O[P]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return l}((globalThis||self).VueDemi=(globalThis||self).VueDemi||(typeof VueDemi<"u"?VueDemi:{}),(globalThis||self).Vue||(typeof Vue<"u"?Vue:void 0),(globalThis||self).VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(l,o,w,u){"use strict";const te=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())}}});function O(e){var t;const n=u.toValue(e);return(t=n?.$el)!=null?t:n}const P=u.isClient?window:void 0;function L(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=P):[t,n,r,a]=e,!t)return u.noop;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],c=()=>{s.forEach(g=>g()),s.length=0},i=(g,d,p,m)=>(g.addEventListener(d,p,m),()=>g.removeEventListener(d,p,m)),v=o.watch(()=>[O(t),u.toValue(a)],([g,d])=>{if(c(),!g)return;const p=u.isObject(d)?{...d}:d;s.push(...n.flatMap(m=>r.map(y=>i(g,m,y,p))))},{immediate:!0,flush:"post"}),f=()=>{v(),c()};return u.tryOnScopeDispose(f),f}let H=!1;function j(e,t,n={}){const{window:r=P,ignore:a=[],capture:s=!0,detectIframe:c=!1}=n;if(!r)return u.noop;u.isIOS&&!H&&(H=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",u.noop)),r.document.documentElement.addEventListener("click",u.noop));let i=!0;const v=p=>a.some(m=>{if(typeof m=="string")return Array.from(r.document.querySelectorAll(m)).some(y=>y===p.target||p.composedPath().includes(y));{const y=O(m);return y&&(p.target===y||p.composedPath().includes(y))}}),g=[L(r,"click",p=>{const m=O(e);if(!(!m||m===p.target||p.composedPath().includes(m))){if(p.detail===0&&(i=!v(p)),!i){i=!0;return}t(p)}},{passive:!0,capture:s}),L(r,"pointerdown",p=>{const m=O(e);i=!v(p)&&!!(m&&!p.composedPath().includes(m))},{passive:!0}),c&&L(r,"blur",p=>{setTimeout(()=>{var m;const y=O(e);((m=r.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!y?.contains(r.document.activeElement)&&t(p)},0)})].filter(Boolean);return()=>g.forEach(p=>p())}const F={[u.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,a]=t.value;e.__onClickOutside_stop=j(e,r,Object.assign({capture:n},a))}},[u.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:a=P,eventName:s="keydown",passive:c=!1,dedupe:i=!1}=r,v=W(t);return L(a,s,g=>{g.repeat&&u.toValue(i)||v(g)&&n(g)},c)}const ve={[u.directiveHooks.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")N(a,t.value,{target:e});else{const[s,c]=t.value;N(a,s,{target:e,...c})}}},ge=500,me=10;function X(e,t,n){var r,a;const s=o.computed(()=>O(e));let c,i,v,f=!1;function g(){c&&(clearTimeout(c),c=void 0),i=void 0,v=void 0,f=!1}function d(h){var S,V,C;const[A,R,b]=[v,i,f];if(g(),!n?.onMouseUp||!R||!A||(S=n?.modifiers)!=null&&S.self&&h.target!==s.value)return;(V=n?.modifiers)!=null&&V.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation();const k=h.x-R.x,T=h.y-R.y,U=Math.sqrt(k*k+T*T);n.onMouseUp(h.timeStamp-A,U,b)}function p(h){var S,V,C,A;(S=n?.modifiers)!=null&&S.self&&h.target!==s.value||(g(),(V=n?.modifiers)!=null&&V.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation(),i={x:h.x,y:h.y},v=h.timeStamp,c=setTimeout(()=>{f=!0,t(h)},(A=n?.delay)!=null?A:ge))}function m(h){var S,V,C,A;if((S=n?.modifiers)!=null&&S.self&&h.target!==s.value||!i||n?.distanceThreshold===!1)return;(V=n?.modifiers)!=null&&V.prevent&&h.preventDefault(),(C=n?.modifiers)!=null&&C.stop&&h.stopPropagation();const R=h.x-i.x,b=h.y-i.y;Math.sqrt(R*R+b*b)>=((A=n?.distanceThreshold)!=null?A:me)&&g()}const y={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},E=[L(s,"pointerdown",p,y),L(s,"pointermove",m,y),L(s,["pointerup","pointerleave"],d,y)];return()=>E.forEach(h=>h())}const he=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={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},ye=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:w.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),we=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(w.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Ue=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(w.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),be=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)}}}),x=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G="__vueuse_ssr_handlers__",Se=Ce();function Ce(){return G in x||(x[G]=x[G]||{}),x[G]}function oe(e,t){return Se[e]||t}function Oe(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 Ee={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 Pe(e,t,n,r={}){var a;const{flush:s="pre",deep:c=!0,listenToStorageChanges:i=!0,writeDefaults:v=!0,mergeDefaults:f=!1,shallow:g,window:d=P,eventFilter:p,onError:m=U=>{console.error(U)},initOnMounted:y}=r,E=(g?o.shallowRef:o.ref)(typeof t=="function"?t():t);if(!n)try{n=oe("getDefaultStorage",()=>{var U;return(U=P)==null?void 0:U.localStorage})()}catch(U){m(U)}if(!n)return E;const _=u.toValue(t),h=Oe(_),S=(a=r.serializer)!=null?a:Ee[h],{pause:V,resume:C}=u.pausableWatch(E,()=>R(E.value),{flush:s,deep:c,eventFilter:p});d&&i&&u.tryOnMounted(()=>{L(d,"storage",k),L(d,re,T),y&&k()}),y||k();function A(U,M){d&&d.dispatchEvent(new CustomEvent(re,{detail:{key:e,oldValue:U,newValue:M,storageArea:n}}))}function R(U){try{const M=n.getItem(e);if(U==null)A(M,null),n.removeItem(e);else{const I=S.write(U);M!==I&&(n.setItem(e,I),A(M,I))}}catch(M){m(M)}}function b(U){const M=U?U.newValue:n.getItem(e);if(M==null)return v&&_!=null&&n.setItem(e,S.write(_)),_;if(!U&&f){const I=S.read(M);return typeof f=="function"?f(I,_):h==="object"&&!Array.isArray(I)?{..._,...I}:I}else return typeof M!="string"?M:S.read(M)}function k(U){if(!(U&&U.storageArea!==n)){if(U&&U.key==null){E.value=_;return}if(!(U&&U.key!==e)){V();try{U?.newValue!==S.write(E.value)&&(E.value=b(U))}catch(M){m(M)}finally{U?o.nextTick(C):C()}}}}function T(U){k(U.detail)}return E}function Le(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},o.isVue2?void 0:t),e}function J(e){const t=Le();return o.computed(()=>(t.value,!!e()))}function _e(e,t={}){const{window:n=P}=t,r=J(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const s=o.ref(!1),c=f=>{s.value=f.matches},i=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",c):a.removeListener(c))},v=o.watchEffect(()=>{r.value&&(i(),a=n.matchMedia(u.toValue(e)),"addEventListener"in a?a.addEventListener("change",c):a.addListener(c),s.value=a.matches)});return u.tryOnScopeDispose(()=>{v(),i(),a=void 0}),s}function ke(e){return _e("(prefers-color-scheme: dark)",e)}function Ae(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=P,storage:s,storageKey:c="vueuse-color-scheme",listenToStorageChanges:i=!0,storageRef:v,emitAuto:f,disableTransition:g=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=ke({window:a}),m=o.computed(()=>p.value?"dark":"light"),y=v||(c==null?u.toRef(r):Pe(c,r,s,{window:a,listenToStorageChanges:i})),E=o.computed(()=>y.value==="auto"?m.value:y.value),_=oe("updateHTMLAttrs",(C,A,R)=>{const b=typeof C=="string"?a?.document.querySelector(C):O(C);if(!b)return;let k;if(g&&(k=a.document.createElement("style"),k.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),a.document.head.appendChild(k)),A==="class"){const T=R.split(/\s/g);Object.values(d).flatMap(U=>(U||"").split(/\s/g)).filter(Boolean).forEach(U=>{T.includes(U)?b.classList.add(U):b.classList.remove(U)})}else b.setAttribute(A,R);g&&(a.getComputedStyle(k).opacity,document.head.removeChild(k))});function h(C){var A;_(t,n,(A=d[C])!=null?A:C)}function S(C){e.onChanged?e.onChanged(C,h):h(C)}o.watch(E,S,{flush:"post",immediate:!0}),u.tryOnMounted(()=>S(E.value));const V=o.computed({get(){return f?y.value:E.value},set(C){y.value=C}});try{return Object.assign(V,{store:y,system:m,state:E})}catch{return V}}const Me=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=Ae(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),Te=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:u.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ve=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)}}}),Re=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:w.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),He=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)}}}),ze=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:w.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Ne=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var f;return(f=e.handle)!=null?f:n.value}),a=o.computed(()=>!!e.disabled),s=e.storageKey&&w.useStorage(e.storageKey,u.toValue(e.initialValue)||{x:0,y:0},w.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),c=s||e.initialValue||{x:0,y:0},i=(f,g)=>{var d;(d=e.onEnd)==null||d.call(e,f,g),s&&(s.value.x=f.x,s.value.y=f.y)},v=o.reactive(w.useDraggable(n,{...e,handle:r,initialValue:c,onEnd:i,disabled:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${v.style}`},t.default(v))}}}),We=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 Be(e,t={}){const{delayEnter:n=0,delayLeave:r=0,window:a=P}=t,s=o.ref(!1);let c;const i=v=>{const f=v?n:r;c&&(clearTimeout(c),c=void 0),f?c=setTimeout(()=>s.value=v,f):s.value=v};return a&&(L(e,"mouseenter",()=>i(!0),{passive:!0}),L(e,"mouseleave",()=>i(!1),{passive:!0})),s}const je={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=Be(e);o.watch(n,r=>t.value(r))}}},Fe=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 Ke(e,t,n={}){const{window:r=P,...a}=n;let s;const c=J(()=>r&&"ResizeObserver"in r),i=()=>{s&&(s.disconnect(),s=void 0)},v=o.computed(()=>Array.isArray(e)?e.map(d=>O(d)):[O(e)]),f=o.watch(v,d=>{if(i(),c.value&&r){s=new ResizeObserver(t);for(const p of d)p&&s.observe(p,a)}},{immediate:!0,flush:"post"}),g=()=>{i(),f()};return u.tryOnScopeDispose(g),{isSupported:c,stop:g}}function xe(e,t={width:0,height:0},n={}){const{window:r=P,box:a="content-box"}=n,s=o.computed(()=>{var d,p;return(p=(d=O(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),c=o.ref(t.width),i=o.ref(t.height),{stop:v}=Ke(e,([d])=>{const p=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&s.value){const m=O(e);if(m){const y=m.getBoundingClientRect();c.value=y.width,i.value=y.height}}else if(p){const m=Array.isArray(p)?p:[p];c.value=m.reduce((y,{inlineSize:E})=>y+E,0),i.value=m.reduce((y,{blockSize:E})=>y+E,0)}else c.value=d.contentRect.width,i.value=d.contentRect.height},n);u.tryOnMounted(()=>{const d=O(e);d&&(c.value="offsetWidth"in d?d.offsetWidth:t.width,i.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=o.watch(()=>O(e),d=>{c.value=d?t.width:0,i.value=d?t.height:0});function g(){v(),f()}return{width:c,height:i,stop:g}}const Ge={[u.directiveHooks.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:c}=xe(e,...a);o.watch([s,c],([i,v])=>r({width:i,height:v}))}},Je=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 Q(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:s=.1,window:c=P,immediate:i=!0}=n,v=J(()=>c&&"IntersectionObserver"in c),f=o.computed(()=>{const y=u.toValue(e);return(Array.isArray(y)?y:[y]).map(O).filter(u.notNullish)});let g=u.noop;const d=o.ref(i),p=v.value?o.watch(()=>[f.value,O(r),d.value],([y,E])=>{if(g(),!d.value||!y.length)return;const _=new IntersectionObserver(t,{root:O(E),rootMargin:a,threshold:s});y.forEach(h=>h&&_.observe(h)),g=()=>{_.disconnect(),g=u.noop}},{immediate:i,flush:"post"}):u.noop,m=()=>{g(),p(),d.value=!1};return u.tryOnScopeDispose(m),{isSupported:v,isActive:d,pause(){g(),d.value=!1},resume(){d.value=!0},stop:m}}function Z(e,t={}){const{window:n=P,scrollTarget:r,threshold:a=0}=t,s=o.ref(!1);return Q(e,c=>{let i=s.value,v=0;for(const f of c)f.time>=v&&(v=f.time,i=f.isIntersecting);s.value=i},{root:r,window:n,threshold:a}),s}const qe={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=Z(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=Z(e,r);o.watch(a,s=>n(s),{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)}}}),$e=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:s=u.noop,onSuccess:c=u.noop,resetOnExecute:i=!0,shallow:v=!0,throwError:f}=n??{},g=v?o.shallowRef(t):o.ref(t),d=o.ref(!1),p=o.ref(!1),m=o.shallowRef(void 0);async function y(h=0,...S){i&&(g.value=t),m.value=void 0,d.value=!1,p.value=!0,h>0&&await u.promiseTimeout(h);const V=typeof e=="function"?e(...S):e;try{const C=await V;g.value=C,d.value=!0,c(C)}catch(C){if(m.value=C,s(C),f)throw C}finally{p.value=!1}return g.value}r&&y(a);const E={state:g,isReady:d,isLoading:p,error:m,execute:y};function _(){return new Promise((h,S)=>{u.until(p).toBe(!1).then(()=>h(E)).catch(S)})}return{...E,then(h,S){return _().then(h,S)}}}async function De(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:s,sizes:c,class:i,loading:v,crossorigin:f,referrerPolicy:g}=e;r.src=a,s&&(r.srcset=s),c&&(r.sizes=c),i&&(r.className=i),v&&(r.loading=v),f&&(r.crossOrigin=f),g&&(r.referrerPolicy=g),r.onload=()=>t(r),r.onerror=n})}function et(e,t={}){const n=Ze(()=>De(u.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>u.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const tt=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:t}){const n=o.reactive(et(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)}}),ae=1;function D(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=u.noop,onScroll:s=u.noop,offset:c={left:0,right:0,top:0,bottom:0},eventListenerOptions:i={capture:!1,passive:!0},behavior:v="auto",window:f=P,onError:g=b=>{console.error(b)}}=t,d=o.ref(0),p=o.ref(0),m=o.computed({get(){return d.value},set(b){E(b,void 0)}}),y=o.computed({get(){return p.value},set(b){E(void 0,b)}});function E(b,k){var T,U,M,I;if(!f)return;const z=u.toValue(e);if(!z)return;(M=z instanceof Document?f.document.body:z)==null||M.scrollTo({top:(T=u.toValue(k))!=null?T:y.value,left:(U=u.toValue(b))!=null?U:m.value,behavior:u.toValue(v)});const K=((I=z?.document)==null?void 0:I.documentElement)||z?.documentElement||z;m!=null&&(d.value=K.scrollLeft),y!=null&&(p.value=K.scrollTop)}const _=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}),V=b=>{_.value&&(_.value=!1,S.left=!1,S.right=!1,S.top=!1,S.bottom=!1,a(b))},C=u.useDebounceFn(V,n+r),A=b=>{var k;if(!f)return;const T=((k=b?.document)==null?void 0:k.documentElement)||b?.documentElement||O(b),{display:U,flexDirection:M}=getComputedStyle(T),I=T.scrollLeft;S.left=I<d.value,S.right=I>d.value;const z=Math.abs(I)<=(c.left||0),K=Math.abs(I)+T.clientWidth>=T.scrollWidth-(c.right||0)-ae;U==="flex"&&M==="row-reverse"?(h.left=K,h.right=z):(h.left=z,h.right=K),d.value=I;let B=T.scrollTop;b===f.document&&!B&&(B=f.document.body.scrollTop),S.top=B<p.value,S.bottom=B>p.value;const de=Math.abs(B)<=(c.top||0),pe=Math.abs(B)+T.clientHeight>=T.scrollHeight-(c.bottom||0)-ae;U==="flex"&&M==="column-reverse"?(h.top=pe,h.bottom=de):(h.top=de,h.bottom=pe),p.value=B},R=b=>{var k;if(!f)return;const T=(k=b.target.documentElement)!=null?k:b.target;A(T),_.value=!0,C(b),s(b)};return L(e,"scroll",n?u.useThrottleFn(R,n,!0,!1):R,i),u.tryOnMounted(()=>{try{const b=u.toValue(e);if(!b)return;A(b)}catch(b){g(b)}}),L(e,"scrollend",V,i),{x:m,y,isScrolling:_,arrivedState:h,directions:S,measure(){const b=u.toValue(e);f&&b&&A(b)}}}function q(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function se(e,t,n={}){var r;const{direction:a="bottom",interval:s=100,canLoadMore:c=()=>!0}=n,i=o.reactive(D(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),v=o.ref(),f=o.computed(()=>!!v.value),g=o.computed(()=>q(u.toValue(e))),d=Z(g);function p(){if(i.measure(),!g.value||!d.value||!c(g.value))return;const{scrollHeight:m,clientHeight:y,scrollWidth:E,clientWidth:_}=g.value,h=a==="bottom"||a==="top"?m<=y:E<=_;(i.arrivedState[a]||h)&&(v.value||(v.value=Promise.all([t(i),new Promise(S=>setTimeout(S,s))]).finally(()=>{v.value=null,o.nextTick(()=>p())})))}return o.watch(()=>[i.arrivedState[a],d.value],p,{immediate:!0}),{isLoading:f}}const nt={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?se(e,t.value):se(e,...t.value)}},ot={[u.directiveHooks.mounted](e,t){typeof t.value=="function"?Q(e,t.value):Q(e,...t.value)}},rt=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)}}}),at=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)}}}),it=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)}}}),ut=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=u.toRef(e,"object"),r=w.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(w.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)}}}),ft=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:w.useOnline()});return()=>{if(t.default)return t.default(n)}}}),dt=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:P}));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)}}}),mt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:w.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),ht=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:w.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),yt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:w.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),wt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:w.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}});function Ut(e,t,n={}){const{window:r=P,...a}=n;let s;const c=J(()=>r&&"MutationObserver"in r),i=()=>{s&&(s.disconnect(),s=void 0)},v=o.computed(()=>{const p=u.toValue(e),m=(Array.isArray(p)?p:[p]).map(O).filter(u.notNullish);return new Set(m)}),f=o.watch(()=>v.value,p=>{i(),c.value&&p.size&&(s=new MutationObserver(t),p.forEach(m=>s.observe(m,a)))},{immediate:!0,flush:"post"}),g=()=>s?.takeRecords(),d=()=>{i(),f()};return u.tryOnScopeDispose(d),{isSupported:c,stop:d,takeRecords:g}}function Y(e,t,n={}){const{window:r=P,initialValue:a="",observe:s=!1}=n,c=o.ref(a),i=o.computed(()=>{var f;return O(t)||((f=r?.document)==null?void 0:f.documentElement)});function v(){var f;const g=u.toValue(e),d=u.toValue(i);if(d&&r){const p=(f=r.getComputedStyle(d).getPropertyValue(g))==null?void 0:f.trim();c.value=p||a}}return s&&Ut(i,v,{attributeFilter:["style","class"],window:r}),o.watch([i,()=>u.toValue(e)],v,{immediate:!0}),o.watch(c,f=>{var g;(g=i.value)!=null&&g.style&&i.value.style.setProperty(u.toValue(e),f)}),c}const le="--vueuse-safe-area-top",ie="--vueuse-safe-area-right",ue="--vueuse-safe-area-bottom",ce="--vueuse-safe-area-left";function bt(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(u.isClient){const s=Y(le),c=Y(ie),i=Y(ue),v=Y(ce);s.value="env(safe-area-inset-top, 0px)",c.value="env(safe-area-inset-right, 0px)",i.value="env(safe-area-inset-bottom, 0px)",v.value="env(safe-area-inset-left, 0px)",a(),L("resize",u.useDebounceFn(a))}function a(){e.value=$(le),t.value=$(ie),n.value=$(ue),r.value=$(ce)}return{top:e,right:t,bottom:n,left:r,update:a}}function $(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const St=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}=bt();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())}}}),Ct={[u.directiveHooks.mounted](e,t){if(typeof t.value=="function"){const n=t.value,r=D(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=D(e,{...r,onScroll(s){var c;(c=r.onScroll)==null||c.call(r,s),n(a)},onStop(s){var c;(c=r.onStop)==null||c.call(r,s),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 Ot(e){const t=e||window.event,n=t.target;return fe(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const ee=new WeakMap;function Et(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(u.toRef(e),i=>{const v=q(u.toValue(i));if(v){const f=v;if(ee.get(f)||ee.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 i=q(u.toValue(e));!i||n.value||(u.isIOS&&(r=L(i,"touchmove",v=>{Ot(v)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},c=()=>{const i=q(u.toValue(e));!i||!n.value||(u.isIOS&&r?.(),i.style.overflow=a,ee.delete(i),n.value=!1)};return u.tryOnScopeDispose(c),o.computed({get(){return n.value},set(i){i?s():c()}})}function Pt(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Et(n,r.value);o.watch(t,s=>a.value=s)}}const Lt=Pt(),_t=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)}}}),kt=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)}}}),At=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:c,scrollTo:i}=w.useVirtualList(r,e.options);return n({scrollTo:i}),s.style&&typeof s.style=="object"&&!Array.isArray(s.style)&&(s.style.height=e.height||"300px"),()=>o.h("div",{...s},[o.h("div",{...c.value},a.value.map(v=>o.h("div",{style:{overflow:"hidden",height:v.height}},t.default?t.default(v):"Please set content!")))])}}),Mt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:w.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Tt=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)}}});l.OnClickOutside=te,l.OnLongPress=he,l.UseActiveElement=ye,l.UseBattery=we,l.UseBrowserLocation=Ue,l.UseClipboard=be,l.UseColorMode=Me,l.UseDark=Te,l.UseDeviceMotion=Ve,l.UseDeviceOrientation=Ie,l.UseDevicePixelRatio=Re,l.UseDevicesList=He,l.UseDocumentVisibility=ze,l.UseDraggable=Ne,l.UseElementBounding=We,l.UseElementSize=Fe,l.UseElementVisibility=Je,l.UseEyeDropper=Ye,l.UseFullscreen=$e,l.UseGeolocation=Xe,l.UseIdle=Qe,l.UseImage=tt,l.UseMouse=rt,l.UseMouseInElement=at,l.UseMousePressed=st,l.UseNetwork=lt,l.UseNow=it,l.UseObjectUrl=ut,l.UseOffsetPagination=ct,l.UseOnline=ft,l.UsePageLeave=dt,l.UsePointer=pt,l.UsePointerLock=vt,l.UsePreferredColorScheme=gt,l.UsePreferredContrast=mt,l.UsePreferredDark=ht,l.UsePreferredLanguages=yt,l.UsePreferredReducedMotion=wt,l.UseScreenSafeArea=St,l.UseTimeAgo=_t,l.UseTimestamp=kt,l.UseVirtualList=At,l.UseWindowFocus=Mt,l.UseWindowSize=Tt,l.VOnClickOutside=F,l.VOnLongPress=ne,l.vElementHover=je,l.vElementSize=Ge,l.vElementVisibility=qe,l.vInfiniteScroll=nt,l.vIntersectionObserver=ot,l.vOnClickOutside=F,l.vOnKeyStroke=ve,l.vOnLongPress=ne,l.vScroll=Ct,l.vScrollLock=Lt})(this.VueUse=this.VueUse||{},VueDemi,VueUse,VueUse);
package/index.mjs CHANGED
@@ -213,12 +213,33 @@ function onLongPress(target, handler, options) {
213
213
  const elementRef = computed(() => unrefElement(target));
214
214
  let timeout;
215
215
  let posStart;
216
+ let startTimestamp;
217
+ let hasLongPressed = false;
216
218
  function clear() {
217
219
  if (timeout) {
218
220
  clearTimeout(timeout);
219
221
  timeout = void 0;
220
222
  }
221
223
  posStart = void 0;
224
+ startTimestamp = void 0;
225
+ hasLongPressed = false;
226
+ }
227
+ function onRelease(ev) {
228
+ var _a2, _b2, _c;
229
+ const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];
230
+ clear();
231
+ if (!(options == null ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp)
232
+ return;
233
+ if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)
234
+ return;
235
+ if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)
236
+ ev.preventDefault();
237
+ if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)
238
+ ev.stopPropagation();
239
+ const dx = ev.x - _posStart.x;
240
+ const dy = ev.y - _posStart.y;
241
+ const distance = Math.sqrt(dx * dx + dy * dy);
242
+ options.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed);
222
243
  }
223
244
  function onDown(ev) {
224
245
  var _a2, _b2, _c, _d;
@@ -233,8 +254,12 @@ function onLongPress(target, handler, options) {
233
254
  x: ev.x,
234
255
  y: ev.y
235
256
  };
257
+ startTimestamp = ev.timeStamp;
236
258
  timeout = setTimeout(
237
- () => handler(ev),
259
+ () => {
260
+ hasLongPressed = true;
261
+ handler(ev);
262
+ },
238
263
  (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY
239
264
  );
240
265
  }
@@ -261,7 +286,7 @@ function onLongPress(target, handler, options) {
261
286
  const cleanup = [
262
287
  useEventListener(elementRef, "pointerdown", onDown, listenerOptions),
263
288
  useEventListener(elementRef, "pointermove", onMove, listenerOptions),
264
- useEventListener(elementRef, ["pointerup", "pointerleave"], clear, listenerOptions)
289
+ useEventListener(elementRef, ["pointerup", "pointerleave"], onRelease, listenerOptions)
265
290
  ];
266
291
  const stop = () => cleanup.forEach((fn) => fn());
267
292
  return stop;
@@ -529,7 +554,7 @@ function useMounted() {
529
554
  if (instance) {
530
555
  onMounted(() => {
531
556
  isMounted.value = true;
532
- }, isVue2 ? null : instance);
557
+ }, isVue2 ? void 0 : instance);
533
558
  }
534
559
  return isMounted;
535
560
  }
@@ -917,9 +942,9 @@ function useElementSize(target, initialSize = { width: 0, height: 0 }, options =
917
942
  if (window && isSVG.value) {
918
943
  const $elem = unrefElement(target);
919
944
  if ($elem) {
920
- const styles = window.getComputedStyle($elem);
921
- width.value = Number.parseFloat(styles.width);
922
- height.value = Number.parseFloat(styles.height);
945
+ const rect = $elem.getBoundingClientRect();
946
+ width.value = rect.width;
947
+ height.value = rect.height;
923
948
  }
924
949
  } else {
925
950
  if (boxSize) {
@@ -1300,7 +1325,7 @@ function useScroll(element, options = {}) {
1300
1325
  }
1301
1326
  });
1302
1327
  function scrollTo(_x, _y) {
1303
- var _a, _b, _c;
1328
+ var _a, _b, _c, _d;
1304
1329
  if (!window)
1305
1330
  return;
1306
1331
  const _element = toValue(element);
@@ -1311,6 +1336,11 @@ function useScroll(element, options = {}) {
1311
1336
  left: (_b = toValue(_x)) != null ? _b : x.value,
1312
1337
  behavior: toValue(behavior)
1313
1338
  });
1339
+ const scrollContainer = ((_d = _element == null ? void 0 : _element.document) == null ? void 0 : _d.documentElement) || (_element == null ? void 0 : _element.documentElement) || _element;
1340
+ if (x != null)
1341
+ internalX.value = scrollContainer.scrollLeft;
1342
+ if (y != null)
1343
+ internalY.value = scrollContainer.scrollTop;
1314
1344
  }
1315
1345
  const isScrolling = ref(false);
1316
1346
  const arrivedState = reactive({
@@ -1754,7 +1784,7 @@ function useMutationObserver(target, callback, options = {}) {
1754
1784
  () => targets.value,
1755
1785
  (targets2) => {
1756
1786
  cleanup();
1757
- if (isSupported.value && window && targets2.size) {
1787
+ if (isSupported.value && targets2.size) {
1758
1788
  observer = new MutationObserver(callback);
1759
1789
  targets2.forEach((el) => observer.observe(el, mutationOptions));
1760
1790
  }
@@ -1944,14 +1974,19 @@ const elInitialOverflow = /* @__PURE__ */ new WeakMap();
1944
1974
  function useScrollLock(element, initialState = false) {
1945
1975
  const isLocked = ref(initialState);
1946
1976
  let stopTouchMoveListener = null;
1977
+ let initialOverflow = "";
1947
1978
  watch(toRef(element), (el) => {
1948
1979
  const target = resolveElement(toValue(el));
1949
1980
  if (target) {
1950
1981
  const ele = target;
1951
1982
  if (!elInitialOverflow.get(ele))
1952
1983
  elInitialOverflow.set(ele, ele.style.overflow);
1984
+ if (ele.style.overflow !== "hidden")
1985
+ initialOverflow = ele.style.overflow;
1986
+ if (ele.style.overflow === "hidden")
1987
+ return isLocked.value = true;
1953
1988
  if (isLocked.value)
1954
- ele.style.overflow = "hidden";
1989
+ return ele.style.overflow = "hidden";
1955
1990
  }
1956
1991
  }, {
1957
1992
  immediate: true
@@ -1974,12 +2009,11 @@ function useScrollLock(element, initialState = false) {
1974
2009
  isLocked.value = true;
1975
2010
  };
1976
2011
  const unlock = () => {
1977
- var _a;
1978
2012
  const el = resolveElement(toValue(element));
1979
2013
  if (!el || !isLocked.value)
1980
2014
  return;
1981
2015
  isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
1982
- el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : "";
2016
+ el.style.overflow = initialOverflow;
1983
2017
  elInitialOverflow.delete(el);
1984
2018
  isLocked.value = false;
1985
2019
  };
@@ -1991,8 +2025,7 @@ function useScrollLock(element, initialState = false) {
1991
2025
  set(v) {
1992
2026
  if (v)
1993
2027
  lock();
1994
- else
1995
- unlock();
2028
+ else unlock();
1996
2029
  }
1997
2030
  });
1998
2031
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/components",
3
- "version": "10.9.0",
3
+ "version": "10.10.1",
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": "10.9.0",
36
- "@vueuse/shared": "10.9.0",
37
- "vue-demi": ">=0.14.7"
35
+ "@vueuse/core": "10.10.1",
36
+ "@vueuse/shared": "10.10.1",
37
+ "vue-demi": ">=0.14.8"
38
38
  }
39
39
  }