@vueuse/shared 9.0.0-beta.2 → 9.0.2

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
@@ -879,7 +879,7 @@ function useCounter(initialValue = 0, options = {}) {
879
879
 
880
880
  const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
881
881
  const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
882
- const formatDate = (date, formatStr) => {
882
+ const formatDate = (date, formatStr, locales) => {
883
883
  const years = date.getFullYear();
884
884
  const month = date.getMonth();
885
885
  const days = date.getDate();
@@ -889,24 +889,27 @@ const formatDate = (date, formatStr) => {
889
889
  const milliseconds = date.getMilliseconds();
890
890
  const day = date.getDay();
891
891
  const matches = {
892
- YY: String(years).slice(-2),
893
- YYYY: years,
894
- M: month + 1,
895
- MM: `${month + 1}`.padStart(2, "0"),
896
- D: String(days),
897
- DD: `${days}`.padStart(2, "0"),
898
- H: String(hours),
899
- HH: `${hours}`.padStart(2, "0"),
900
- h: `${hours % 12 || 12}`.padStart(1, "0"),
901
- hh: `${hours % 12 || 12}`.padStart(2, "0"),
902
- m: String(minutes),
903
- mm: `${minutes}`.padStart(2, "0"),
904
- s: String(seconds),
905
- ss: `${seconds}`.padStart(2, "0"),
906
- SSS: `${milliseconds}`.padStart(3, "0"),
907
- d: day
892
+ YY: () => String(years).slice(-2),
893
+ YYYY: () => years,
894
+ M: () => month + 1,
895
+ MM: () => `${month + 1}`.padStart(2, "0"),
896
+ D: () => String(days),
897
+ DD: () => `${days}`.padStart(2, "0"),
898
+ H: () => String(hours),
899
+ HH: () => `${hours}`.padStart(2, "0"),
900
+ h: () => `${hours % 12 || 12}`.padStart(1, "0"),
901
+ hh: () => `${hours % 12 || 12}`.padStart(2, "0"),
902
+ m: () => String(minutes),
903
+ mm: () => `${minutes}`.padStart(2, "0"),
904
+ s: () => String(seconds),
905
+ ss: () => `${seconds}`.padStart(2, "0"),
906
+ SSS: () => `${milliseconds}`.padStart(3, "0"),
907
+ d: () => day,
908
+ dd: () => date.toLocaleDateString(locales, { weekday: "narrow" }),
909
+ ddd: () => date.toLocaleDateString(locales, { weekday: "short" }),
910
+ dddd: () => date.toLocaleDateString(locales, { weekday: "long" })
908
911
  };
909
- return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]);
912
+ return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]());
910
913
  };
911
914
  const normalizeDate = (date) => {
912
915
  if (date === null)
@@ -925,8 +928,8 @@ const normalizeDate = (date) => {
925
928
  }
926
929
  return new Date(date);
927
930
  };
928
- function useDateFormat(date, formatStr = "HH:mm:ss") {
929
- return vueDemi.computed(() => formatDate(normalizeDate(shared.resolveUnref(date)), shared.resolveUnref(formatStr)));
931
+ function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) {
932
+ return vueDemi.computed(() => formatDate(normalizeDate(shared.resolveUnref(date)), shared.resolveUnref(formatStr), options == null ? void 0 : options.locales));
930
933
  }
931
934
 
932
935
  function useIntervalFn(cb, interval = 1e3, options = {}) {
package/index.d.ts CHANGED
@@ -632,22 +632,104 @@ interface UntilArrayInstance<T> extends UntilBaseInstance<T> {
632
632
  declare function until<T extends unknown[]>(r: WatchSource<T> | MaybeComputedRef<T>): UntilArrayInstance<T>;
633
633
  declare function until<T>(r: WatchSource<T> | MaybeComputedRef<T>): UntilValueInstance<T>;
634
634
 
635
+ /**
636
+ * Reactive `Array.every`
637
+ *
638
+ * @see https://vueuse.org/useArrayEvery
639
+ * @param {Array} list - the array was called upon.
640
+ * @param fn - a function to test each element.
641
+ *
642
+ * @returns {boolean} **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.
643
+ */
635
644
  declare function useArrayEvery<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef$1<T>[]) => unknown): ComputedRef<boolean>;
636
645
 
646
+ /**
647
+ * Reactive `Array.filter`
648
+ *
649
+ * @see https://vueuse.org/useArrayFilter
650
+ * @param {Array} list - the array was called upon.
651
+ * @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.
652
+ *
653
+ * @returns {Array} a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.
654
+ */
637
655
  declare function useArrayFilter<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, fn: (element: T, index: number, array: T[]) => boolean): ComputedRef<T[]>;
638
656
 
657
+ /**
658
+ * Reactive `Array.find`
659
+ *
660
+ * @see https://vueuse.org/useArrayFind
661
+ * @param {Array} list - the array was called upon.
662
+ * @param fn - a function to test each element.
663
+ *
664
+ * @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.
665
+ */
639
666
  declare function useArrayFind<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef$1<T>[]) => boolean): ComputedRef<T | undefined>;
640
667
 
668
+ /**
669
+ * Reactive `Array.findIndex`
670
+ *
671
+ * @see https://vueuse.org/useArrayFindIndex
672
+ * @param {Array} list - the array was called upon.
673
+ * @param fn - a function to test each element.
674
+ *
675
+ * @returns {number} the index of the first element in the array that passes the test. Otherwise, "-1".
676
+ */
641
677
  declare function useArrayFindIndex<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef$1<T>[]) => unknown): ComputedRef<number>;
642
678
 
679
+ /**
680
+ * Reactive `Array.join`
681
+ *
682
+ * @see https://vueuse.org/useArrayJoin
683
+ * @param {Array} list - the array was called upon.
684
+ * @param {string} separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (",").
685
+ *
686
+ * @returns {string} a string with all array elements joined. If arr.length is 0, the empty string is returned.
687
+ */
643
688
  declare function useArrayJoin(list: MaybeComputedRef$1<MaybeComputedRef$1<any>[]>, separator?: MaybeComputedRef$1<string>): ComputedRef<string>;
644
689
 
690
+ /**
691
+ * Reactive `Array.map`
692
+ *
693
+ * @see https://vueuse.org/useArrayMap
694
+ * @param {Array} list - the array was called upon.
695
+ * @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.
696
+ *
697
+ * @returns {Array} a new array with each element being the result of the callback function.
698
+ */
645
699
  declare function useArrayMap<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, fn: (element: T, index: number, array: T[]) => T): ComputedRef<T[]>;
646
700
 
647
701
  declare type UseArrayReducer<PV, CV, R> = (previousValue: PV, currentValue: CV, currentIndex: number) => R;
702
+ /**
703
+ * Reactive `Array.reduce`
704
+ *
705
+ * @see https://vueuse.org/useArrayReduce
706
+ * @param {Array} list - the array was called upon.
707
+ * @param reducer - a "reducer" function.
708
+ *
709
+ * @returns the value that results from running the "reducer" callback function to completion over the entire array.
710
+ */
648
711
  declare function useArrayReduce<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, reducer: UseArrayReducer<T, T, T>): ComputedRef<T>;
712
+ /**
713
+ * Reactive `Array.reduce`
714
+ *
715
+ * @see https://vueuse.org/useArrayReduce
716
+ * @param {Array} list - the array was called upon.
717
+ * @param reducer - a "reducer" function.
718
+ * @param initialValue - a value to be initialized the first time when the callback is called.
719
+ *
720
+ * @returns the value that results from running the "reducer" callback function to completion over the entire array.
721
+ */
649
722
  declare function useArrayReduce<T, U>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, reducer: UseArrayReducer<U, T, U>, initialValue: MaybeComputedRef$1<U>): ComputedRef<U>;
650
723
 
724
+ /**
725
+ * Reactive `Array.some`
726
+ *
727
+ * @see https://vueuse.org/useArraySome
728
+ * @param {Array} list - the array was called upon.
729
+ * @param fn - a function to test each element.
730
+ *
731
+ * @returns {boolean} **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.
732
+ */
651
733
  declare function useArraySome<T>(list: MaybeComputedRef$1<MaybeComputedRef$1<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef$1<T>[]) => unknown): ComputedRef<boolean>;
652
734
 
653
735
  interface UseCounterOptions {
@@ -671,7 +753,15 @@ declare function useCounter(initialValue?: number, options?: UseCounterOptions):
671
753
  };
672
754
 
673
755
  declare type DateLike = Date | number | string | undefined;
674
- declare const formatDate: (date: Date, formatStr: string) => string;
756
+ interface UseDateFormatOptions {
757
+ /**
758
+ * The locale(s) to used for dd/ddd/dddd format
759
+ *
760
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
761
+ */
762
+ locales?: Intl.LocalesArgument;
763
+ }
764
+ declare const formatDate: (date: Date, formatStr: string, locales?: Intl.LocalesArgument) => string;
675
765
  declare const normalizeDate: (date: DateLike) => Date;
676
766
  /**
677
767
  * Get the formatted date according to the string of tokens passed in.
@@ -679,8 +769,9 @@ declare const normalizeDate: (date: DateLike) => Date;
679
769
  * @see https://vueuse.org/useDateFormat
680
770
  * @param date
681
771
  * @param formatStr
772
+ * @param options
682
773
  */
683
- declare function useDateFormat(date: MaybeComputedRef$1<DateLike>, formatStr?: MaybeComputedRef$1<string>): vue_demi.ComputedRef<string>;
774
+ declare function useDateFormat(date: MaybeComputedRef$1<DateLike>, formatStr?: MaybeComputedRef$1<string>, options?: UseDateFormatOptions): vue_demi.ComputedRef<string>;
684
775
  declare type UseDateFormatReturn = ReturnType<typeof useDateFormat>;
685
776
 
686
777
  /**
@@ -891,4 +982,4 @@ declare function watchTriggerable<T extends object, FnReturnT>(source: T, cb: Wa
891
982
  */
892
983
  declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WatchOptions): vue_demi.WatchStopHandle;
893
984
 
894
- export { ArgumentsType, Awaitable, ComputedRefWithControl, ComputedWithControlRefExtra, ConfigurableEventFilter, ConfigurableFlush, ConfigurableFlushSync, ControlledRefOptions, CreateGlobalStateReturn, DateLike, DebounceFilterOptions, DeepMaybeRef, ElementOf, EventFilter, EventHook, EventHookOff, EventHookOn, EventHookTrigger, ExtendRefOptions, Fn, FunctionArgs, FunctionWrapperOptions, IgnoredUpdater, MapOldSources, MapSources, MaybeComputedRef, MaybeRef, Pausable, Reactified, ReactifyNested, ReactifyObjectOptions, ReactifyOptions, RemovableRef, RemoveableRef, ShallowUnwrapRef, SingletonPromiseReturn, Stopable, Stoppable, SyncRefOptions, SyncRefsOptions, UntilArrayInstance, UntilBaseInstance, UntilToMatchOptions, UntilValueInstance, UseArrayReducer, UseCounterOptions, UseDateFormatReturn, UseIntervalFnOptions, UseIntervalOptions, UseLastChangedOptions, UseTimeoutFnOptions, UseTimeoutOptions, UseToggleOptions, WatchArrayCallback, WatchAtMostOptions, WatchAtMostReturn, WatchDebouncedOptions, WatchIgnorableReturn, WatchPausableReturn, WatchThrottledOptions, WatchTriggerableCallback, WatchTriggerableReturn, WatchWithFilterOptions, WritableComputedRefWithControl, __onlyVue3, assert, refAutoReset as autoResetRef, bypassFilter, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, identity, watchIgnorable as ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isDefined, isFunction, isIOS, isNumber, isObject, isString, isWindow, makeDestructurable, noop, normalizeDate, now, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToggle, watchArray, watchAtMost, watchDebounced, watchIgnorable, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
985
+ export { ArgumentsType, Awaitable, ComputedRefWithControl, ComputedWithControlRefExtra, ConfigurableEventFilter, ConfigurableFlush, ConfigurableFlushSync, ControlledRefOptions, CreateGlobalStateReturn, DateLike, DebounceFilterOptions, DeepMaybeRef, ElementOf, EventFilter, EventHook, EventHookOff, EventHookOn, EventHookTrigger, ExtendRefOptions, Fn, FunctionArgs, FunctionWrapperOptions, IgnoredUpdater, MapOldSources, MapSources, MaybeComputedRef, MaybeRef, Pausable, Reactified, ReactifyNested, ReactifyObjectOptions, ReactifyOptions, RemovableRef, RemoveableRef, ShallowUnwrapRef, SingletonPromiseReturn, Stopable, Stoppable, SyncRefOptions, SyncRefsOptions, UntilArrayInstance, UntilBaseInstance, UntilToMatchOptions, UntilValueInstance, UseArrayReducer, UseCounterOptions, UseDateFormatOptions, UseDateFormatReturn, UseIntervalFnOptions, UseIntervalOptions, UseLastChangedOptions, UseTimeoutFnOptions, UseTimeoutOptions, UseToggleOptions, WatchArrayCallback, WatchAtMostOptions, WatchAtMostReturn, WatchDebouncedOptions, WatchIgnorableReturn, WatchPausableReturn, WatchThrottledOptions, WatchTriggerableCallback, WatchTriggerableReturn, WatchWithFilterOptions, WritableComputedRefWithControl, __onlyVue3, assert, refAutoReset as autoResetRef, bypassFilter, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, identity, watchIgnorable as ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isDefined, isFunction, isIOS, isNumber, isObject, isString, isWindow, makeDestructurable, noop, normalizeDate, now, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToggle, watchArray, watchAtMost, watchDebounced, watchIgnorable, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
package/index.iife.js CHANGED
@@ -948,7 +948,7 @@
948
948
 
949
949
  const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
950
950
  const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
951
- const formatDate = (date, formatStr) => {
951
+ const formatDate = (date, formatStr, locales) => {
952
952
  const years = date.getFullYear();
953
953
  const month = date.getMonth();
954
954
  const days = date.getDate();
@@ -958,24 +958,27 @@
958
958
  const milliseconds = date.getMilliseconds();
959
959
  const day = date.getDay();
960
960
  const matches = {
961
- YY: String(years).slice(-2),
962
- YYYY: years,
963
- M: month + 1,
964
- MM: `${month + 1}`.padStart(2, "0"),
965
- D: String(days),
966
- DD: `${days}`.padStart(2, "0"),
967
- H: String(hours),
968
- HH: `${hours}`.padStart(2, "0"),
969
- h: `${hours % 12 || 12}`.padStart(1, "0"),
970
- hh: `${hours % 12 || 12}`.padStart(2, "0"),
971
- m: String(minutes),
972
- mm: `${minutes}`.padStart(2, "0"),
973
- s: String(seconds),
974
- ss: `${seconds}`.padStart(2, "0"),
975
- SSS: `${milliseconds}`.padStart(3, "0"),
976
- d: day
961
+ YY: () => String(years).slice(-2),
962
+ YYYY: () => years,
963
+ M: () => month + 1,
964
+ MM: () => `${month + 1}`.padStart(2, "0"),
965
+ D: () => String(days),
966
+ DD: () => `${days}`.padStart(2, "0"),
967
+ H: () => String(hours),
968
+ HH: () => `${hours}`.padStart(2, "0"),
969
+ h: () => `${hours % 12 || 12}`.padStart(1, "0"),
970
+ hh: () => `${hours % 12 || 12}`.padStart(2, "0"),
971
+ m: () => String(minutes),
972
+ mm: () => `${minutes}`.padStart(2, "0"),
973
+ s: () => String(seconds),
974
+ ss: () => `${seconds}`.padStart(2, "0"),
975
+ SSS: () => `${milliseconds}`.padStart(3, "0"),
976
+ d: () => day,
977
+ dd: () => date.toLocaleDateString(locales, { weekday: "narrow" }),
978
+ ddd: () => date.toLocaleDateString(locales, { weekday: "short" }),
979
+ dddd: () => date.toLocaleDateString(locales, { weekday: "long" })
977
980
  };
978
- return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]);
981
+ return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]());
979
982
  };
980
983
  const normalizeDate = (date) => {
981
984
  if (date === null)
@@ -994,8 +997,8 @@
994
997
  }
995
998
  return new Date(date);
996
999
  };
997
- function useDateFormat(date, formatStr = "HH:mm:ss") {
998
- return vueDemi.computed(() => formatDate(normalizeDate(shared.resolveUnref(date)), shared.resolveUnref(formatStr)));
1000
+ function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) {
1001
+ return vueDemi.computed(() => formatDate(normalizeDate(shared.resolveUnref(date)), shared.resolveUnref(formatStr), options == null ? void 0 : options.locales));
999
1002
  }
1000
1003
 
1001
1004
  function useIntervalFn(cb, interval = 1e3, options = {}) {
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var VueDemi=function(o,i,_){if(o.install)return o;if(i)if(i.version.slice(0,4)==="2.7."){for(var g in i)o[g]=i[g];o.isVue2=!0,o.isVue3=!1,o.install=function(){},o.Vue=i,o.Vue2=i,o.version=i.version}else if(i.version.slice(0,2)==="2.")if(_){for(var g in _)o[g]=_[g];o.isVue2=!0,o.isVue3=!1,o.install=function(){},o.Vue=i,o.Vue2=i,o.version=i.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(i.version.slice(0,2)==="3."){for(var g in i)o[g]=i[g];o.isVue2=!1,o.isVue3=!0,o.install=function(){},o.Vue=i,o.Vue2=void 0,o.version=i.version,o.set=function(h,m,b){return Array.isArray(h)?(h.length=Math.max(h.length,m),h.splice(m,1,b),b):(h[m]=b,b)},o.del=function(h,m){if(Array.isArray(h)){h.splice(m,1);return}delete h[m]}}else console.error("[vue-demi] Vue version "+i.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");return o}(this.VueDemi=this.VueDemi||(typeof VueDemi!="undefined"?VueDemi:{}),this.Vue||(typeof Vue!="undefined"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI!="undefined"?VueCompositionAPI:void 0));(function(o,i,_){"use strict";var g=Object.defineProperty,h=Object.defineProperties,m=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,X=(e,t,r)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ze=(e,t)=>{for(var r in t||(t={}))Ge.call(t,r)&&X(e,r,t[r]);if(b)for(var r of b(t))Le.call(t,r)&&X(e,r,t[r]);return e},Ve=(e,t)=>h(e,m(t));function Z(e,t){var r;const n=i.shallowRef();return i.watchEffect(()=>{n.value=e()},Ve(ze({},t),{flush:(r=t==null?void 0:t.flush)!=null?r:"sync"})),i.readonly(n)}var k;const I=typeof window!="undefined",Je=e=>typeof e!="undefined",Xe=(e,...t)=>{e||console.warn(...t)},q=Object.prototype.toString,Ze=e=>typeof e=="boolean",W=e=>typeof e=="function",ke=e=>typeof e=="number",qe=e=>typeof e=="string",Ke=e=>q.call(e)==="[object Object]",Qe=e=>typeof window!="undefined"&&q.call(e)==="[object Window]",De=()=>Date.now(),K=()=>+Date.now(),xe=(e,t,r)=>Math.min(r,Math.max(t,e)),Q=()=>{},et=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),tt=I&&((k=window==null?void 0:window.navigator)==null?void 0:k.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function w(e){return typeof e=="function"?e():i.unref(e)}function F(e,t){function r(...n){e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})}return r}const T=e=>e();function B(e,t={}){let r,n;return l=>{const u=w(e),c=w(t.maxWait);if(r&&clearTimeout(r),u<=0||c!==void 0&&c<=0)return n&&(clearTimeout(n),n=null),l();c&&!n&&(n=setTimeout(()=>{r&&clearTimeout(r),n=null,l()},c)),r=setTimeout(()=>{n&&clearTimeout(n),n=null,l()},u)}}function H(e,t=!0,r=!0){let n=0,a,l=!0;const u=()=>{a&&(clearTimeout(a),a=void 0)};return p=>{const v=w(e),f=Date.now()-n;if(u(),v<=0)return n=Date.now(),p();f>v&&(r||!l)?(n=Date.now(),p()):t&&(a=setTimeout(()=>{n=Date.now(),l=!0,u(),p()},v)),!r&&!a&&(a=setTimeout(()=>l=!0,v)),l=!1}}function D(e=T){const t=i.ref(!0);function r(){t.value=!1}function n(){t.value=!0}return{isActive:t,pause:r,resume:n,eventFilter:(...l)=>{t.value&&e(...l)}}}function x(e="this function"){if(!i.isVue3)throw new Error(`[VueUse] ${e} is only works on Vue 3.`)}const rt={mounted:i.isVue3?"mounted":"inserted",updated:i.isVue3?"updated":"componentUpdated",unmounted:i.isVue3?"unmounted":"unbind"};function Y(e,t=!1,r="Timeout"){return new Promise((n,a)=>{setTimeout(t?()=>a(r):n,e)})}function nt(e){return e}function ot(e){let t;function r(){return t||(t=e()),t}return r.reset=async()=>{const n=t;t=void 0,n&&await n},r}function at(e){return e()}function it(e,...t){return t.some(r=>r in e)}function lt(e,t){var r;if(typeof e=="number")return e+t;const n=((r=e.match(/^-?[0-9]+\.?[0-9]*/))==null?void 0:r[0])||"",a=e.slice(n.length),l=parseFloat(n)+t;return Number.isNaN(l)?e:l+a}function ut(e,t,r=!1){return t.reduce((n,a)=>(a in e&&(!r||e[a]!==void 0)&&(n[a]=e[a]),n),{})}function ee(e,t){let r,n,a;const l=i.ref(!0),u=()=>{l.value=!0,a()};i.watch(e,u,{flush:"sync"});const c=W(t)?t:t.get,p=W(t)?void 0:t.set,v=i.customRef((f,s)=>(n=f,a=s,{get(){return l.value&&(r=c(),l.value=!1),n(),r},set(d){p==null||p(d)}}));return Object.isExtensible(v)&&(v.trigger=u),v}function ct(){const e=[],t=a=>{const l=e.indexOf(a);l!==-1&&e.splice(l,1)};return{on:a=>(e.push(a),{off:()=>t(a)}),off:t,trigger:a=>{e.forEach(l=>l(a))}}}function st(e){let t=!1,r;const n=i.effectScope(!0);return()=>(t||(r=n.run(e),t=!0),r)}function ft(e){const t=Symbol("InjectionState");return[(...a)=>{i.provide(t,e(...a))},()=>i.inject(t)]}function S(e){return i.getCurrentScope()?(i.onScopeDispose(e),!0):!1}function dt(e){let t=0,r,n;const a=()=>{t-=1,n&&t<=0&&(n.stop(),r=void 0,n=void 0)};return(...l)=>(t+=1,r||(n=i.effectScope(!0),r=n.run(()=>e(...l))),S(a),r)}function te(e,t,{enumerable:r=!1,unwrap:n=!0}={}){x();for(const[a,l]of Object.entries(t))a!=="value"&&(i.isRef(l)&&n?Object.defineProperty(e,a,{get(){return l.value},set(u){l.value=u},enumerable:r}):Object.defineProperty(e,a,{value:l,enumerable:r}));return e}function pt(e,t){return t==null?i.unref(e):i.unref(e)[t]}function vt(e){return i.unref(e)!=null}var _t=Object.defineProperty,re=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,ne=(e,t,r)=>t in e?_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wt=(e,t)=>{for(var r in t||(t={}))yt.call(t,r)&&ne(e,r,t[r]);if(re)for(var r of re(t))Ot.call(t,r)&&ne(e,r,t[r]);return e};function ht(e,t){if(typeof Symbol!="undefined"){const r=wt({},e);return Object.defineProperty(r,Symbol.iterator,{enumerable:!1,value(){let n=0;return{next:()=>({value:t[n++],done:n>t.length})}}}),r}else return Object.assign([...t],e)}function G(e,t){const r=(t==null?void 0:t.computedGetter)===!1?i.unref:w;return function(...n){return i.computed(()=>e.apply(this,n.map(a=>r(a))))}}function gt(e,t={}){let r=[],n;if(Array.isArray(t))r=t;else{n=t;const{includeOwnProperties:a=!0}=t;r.push(...Object.keys(e)),a&&r.push(...Object.getOwnPropertyNames(e))}return Object.fromEntries(r.map(a=>{const l=e[a];return[a,typeof l=="function"?G(l.bind(e),n):l]}))}function oe(e){if(!i.isRef(e))return i.reactive(e);const t=new Proxy({},{get(r,n,a){return i.unref(Reflect.get(e.value,n,a))},set(r,n,a){return i.isRef(e.value[n])&&!i.isRef(a)?e.value[n].value=a:e.value[n]=a,!0},deleteProperty(r,n){return Reflect.deleteProperty(e.value,n)},has(r,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return i.reactive(t)}function ae(e){return oe(i.computed(e))}function Pt(e,...t){const r=t.flat();return ae(()=>Object.fromEntries(Object.entries(i.toRefs(e)).filter(n=>!r.includes(n[0]))))}function mt(e,...t){const r=t.flat();return i.reactive(Object.fromEntries(r.map(n=>[n,i.toRef(e,n)])))}function ie(e,t=1e4){return i.customRef((r,n)=>{let a=e,l;const u=()=>setTimeout(()=>{a=e,n()},_.resolveUnref(t));return S(()=>{clearTimeout(l)}),{get(){return r(),a},set(c){a=c,n(),clearTimeout(l),l=u()}}})}function le(e,t=200,r={}){return F(B(t,r),e)}function L(e,t=200,r={}){if(t<=0)return e;const n=i.ref(e.value),a=le(()=>{n.value=e.value},t,r);return i.watch(e,()=>a()),n}function bt(e,t){return i.computed({get(){var r;return(r=e.value)!=null?r:t},set(r){e.value=r}})}function ue(e,t=200,r=!1,n=!0){return F(H(t,r,n),e)}function z(e,t=200,r=!0,n=!0){if(t<=0)return e;const a=i.ref(e.value),l=ue(()=>{a.value=e.value},t,r,n);return i.watch(e,()=>l()),a}function ce(e,t={}){let r=e,n,a;const l=i.customRef((d,O)=>(n=d,a=O,{get(){return u()},set(y){c(y)}}));function u(d=!0){return d&&n(),r}function c(d,O=!0){var y,$;if(d===r)return;const P=r;((y=t.onBeforeChange)==null?void 0:y.call(t,d,P))!==!1&&(r=d,($=t.onChanged)==null||$.call(t,d,P),O&&a())}return te(l,{get:u,set:c,untrackedGet:()=>u(!1),silentSet:d=>c(d,!1),peek:()=>u(!1),lay:d=>c(d,!1)},{enumerable:!0})}const $t=ce;function St(e){return typeof e=="function"?i.computed(e):i.ref(e)}function At(...e){if(e.length===2){const[t,r]=e;t.value=r}if(e.length===3)if(i.isVue2)i.set(...e);else{const[t,r,n]=e;t[r]=n}}function jt(e,t,r={}){var n,a;const{flush:l="sync",deep:u=!1,immediate:c=!0,direction:p="both",transform:v={}}=r;let f,s;const d=(n=v.ltr)!=null?n:y=>y,O=(a=v.rtl)!=null?a:y=>y;return(p==="both"||p==="ltr")&&(f=i.watch(e,y=>t.value=d(y),{flush:l,deep:u,immediate:c})),(p==="both"||p==="rtl")&&(s=i.watch(t,y=>e.value=O(y),{flush:l,deep:u,immediate:c})),()=>{f==null||f(),s==null||s()}}function It(e,t,r={}){const{flush:n="sync",deep:a=!1,immediate:l=!0}=r;return Array.isArray(t)||(t=[t]),i.watch(e,u=>t.forEach(c=>c.value=u),{flush:n,deep:a,immediate:l})}var Ft=Object.defineProperty,Et=Object.defineProperties,Tt=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,fe=(e,t,r)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ct=(e,t)=>{for(var r in t||(t={}))Ut.call(t,r)&&fe(e,r,t[r]);if(se)for(var r of se(t))Rt.call(t,r)&&fe(e,r,t[r]);return e},Mt=(e,t)=>Et(e,Tt(t));function Nt(e){if(!i.isRef(e))return i.toRefs(e);const t=Array.isArray(e.value)?new Array(e.value.length):{};for(const r in e.value)t[r]=i.customRef(()=>({get(){return e.value[r]},set(n){if(Array.isArray(e.value)){const a=[...e.value];a[r]=n,e.value=a}else{const a=Mt(Ct({},e.value),{[r]:n});Object.setPrototypeOf(a,e.value),e.value=a}}}));return t}function Wt(e,t=!0){i.getCurrentInstance()?i.onBeforeMount(e):t?e():i.nextTick(e)}function Bt(e){i.getCurrentInstance()&&i.onBeforeUnmount(e)}function Ht(e,t=!0){i.getCurrentInstance()?i.onMounted(e):t?e():i.nextTick(e)}function Yt(e){i.getCurrentInstance()&&i.onUnmounted(e)}function Gt(e){let t=!1;function r(s,{flush:d="sync",deep:O=!1,timeout:y,throwOnTimeout:$}={}){let P=null;const J=[new Promise(N=>{P=i.watch(e,j=>{s(j)!==t&&(P==null||P(),N(j))},{flush:d,deep:O,immediate:!0})})];return y!=null&&J.push(Y(y,$).then(()=>w(e)).finally(()=>P==null?void 0:P())),Promise.race(J)}function n(s,d){if(!i.isRef(s))return r(j=>j===s,d);const{flush:O="sync",deep:y=!1,timeout:$,throwOnTimeout:P}=d??{};let A=null;const N=[new Promise(j=>{A=i.watch([e,s],([Ye,rn])=>{t!==(Ye===rn)&&(A==null||A(),j(Ye))},{flush:O,deep:y,immediate:!0})})];return $!=null&&N.push(Y($,P).then(()=>w(e)).finally(()=>(A==null||A(),w(e)))),Promise.race(N)}function a(s){return r(d=>Boolean(d),s)}function l(s){return n(null,s)}function u(s){return n(void 0,s)}function c(s){return r(Number.isNaN,s)}function p(s,d){return r(O=>{const y=Array.from(O);return y.includes(s)||y.includes(w(s))},d)}function v(s){return f(1,s)}function f(s=1,d){let O=-1;return r(()=>(O+=1,O>=s),d)}return Array.isArray(w(e))?{toMatch:r,toContains:p,changed:v,changedTimes:f,get not(){return t=!t,this}}:{toMatch:r,toBe:n,toBeTruthy:a,toBeNull:l,toBeNaN:c,toBeUndefined:u,changed:v,changedTimes:f,get not(){return t=!t,this}}}function Lt(e,t){return i.computed(()=>_.resolveUnref(e).every((r,n,a)=>t(_.resolveUnref(r),n,a)))}function zt(e,t){return i.computed(()=>_.resolveUnref(e).map(r=>_.resolveUnref(r)).filter(t))}function Vt(e,t){return i.computed(()=>_.resolveUnref(_.resolveUnref(e).find((r,n,a)=>t(_.resolveUnref(r),n,a))))}function Jt(e,t){return i.computed(()=>_.resolveUnref(e).findIndex((r,n,a)=>t(_.resolveUnref(r),n,a)))}function Xt(e,t){return i.computed(()=>_.resolveUnref(e).map(r=>_.resolveUnref(r)).join(_.resolveUnref(t)))}function Zt(e,t){return i.computed(()=>_.resolveUnref(e).map(r=>_.resolveUnref(r)).map(t))}function kt(e,t,...r){const n=(a,l,u)=>t(_.resolveUnref(a),_.resolveUnref(l),u);return i.computed(()=>{const a=_.resolveUnref(e);return r.length?a.reduce(n,_.resolveUnref(r[0])):a.reduce(n)})}function qt(e,t){return i.computed(()=>_.resolveUnref(e).some((r,n,a)=>t(_.resolveUnref(r),n,a)))}function Kt(e=0,t={}){const r=i.ref(e),{max:n=1/0,min:a=-1/0}=t,l=(f=1)=>r.value=Math.min(n,r.value+f),u=(f=1)=>r.value=Math.max(a,r.value-f),c=()=>r.value,p=f=>r.value=f;return{count:r,inc:l,dec:u,get:c,set:p,reset:(f=e)=>(e=f,p(f))}}const Qt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Dt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,de=(e,t)=>{const r=e.getFullYear(),n=e.getMonth(),a=e.getDate(),l=e.getHours(),u=e.getMinutes(),c=e.getSeconds(),p=e.getMilliseconds(),v=e.getDay(),f={YY:String(r).slice(-2),YYYY:r,M:n+1,MM:`${n+1}`.padStart(2,"0"),D:String(a),DD:`${a}`.padStart(2,"0"),H:String(l),HH:`${l}`.padStart(2,"0"),h:`${l%12||12}`.padStart(1,"0"),hh:`${l%12||12}`.padStart(2,"0"),m:String(u),mm:`${u}`.padStart(2,"0"),s:String(c),ss:`${c}`.padStart(2,"0"),SSS:`${p}`.padStart(3,"0"),d:v};return t.replace(Dt,(s,d)=>d||f[s])},pe=e=>{if(e===null)return new Date(NaN);if(e===void 0)return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){const t=e.match(Qt);if(t){const r=t[2]-1||0,n=(t[7]||"0").substring(0,3);return new Date(t[1],r,t[3]||1,t[4]||0,t[5]||0,t[6]||0,n)}}return new Date(e)};function xt(e,t="HH:mm:ss"){return i.computed(()=>de(pe(_.resolveUnref(e)),_.resolveUnref(t)))}function ve(e,t=1e3,r={}){const{immediate:n=!0,immediateCallback:a=!1}=r;let l=null;const u=i.ref(!1);function c(){l&&(clearInterval(l),l=null)}function p(){u.value=!1,c()}function v(){i.unref(t)<=0||(u.value=!0,a&&e(),c(),l=setInterval(e,w(t)))}if(n&&I&&v(),i.isRef(t)){const f=i.watch(t,()=>{u.value&&I&&v()});S(f)}return S(p),{isActive:u,pause:p,resume:v}}var er=Object.defineProperty,_e=Object.getOwnPropertySymbols,tr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,ye=(e,t,r)=>t in e?er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nr=(e,t)=>{for(var r in t||(t={}))tr.call(t,r)&&ye(e,r,t[r]);if(_e)for(var r of _e(t))rr.call(t,r)&&ye(e,r,t[r]);return e};function or(e=1e3,t={}){const{controls:r=!1,immediate:n=!0}=t,a=i.ref(0),l=ve(()=>a.value+=1,e,{immediate:n});return r?nr({counter:a},l):a}function ar(e,t={}){var r;const n=i.ref((r=t.initialValue)!=null?r:null);return i.watch(e,()=>n.value=K(),t),n}function Oe(e,t,r={}){const{immediate:n=!0}=r,a=i.ref(!1);let l=null;function u(){l&&(clearTimeout(l),l=null)}function c(){a.value=!1,u()}function p(...v){u(),a.value=!0,l=setTimeout(()=>{a.value=!1,l=null,e(...v)},_.resolveUnref(t))}return n&&(a.value=!0,I&&p()),S(c),{isPending:a,start:p,stop:c}}var ir=Object.defineProperty,we=Object.getOwnPropertySymbols,lr=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable,he=(e,t,r)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cr=(e,t)=>{for(var r in t||(t={}))lr.call(t,r)&&he(e,r,t[r]);if(we)for(var r of we(t))ur.call(t,r)&&he(e,r,t[r]);return e};function sr(e=1e3,t={}){const{controls:r=!1}=t,n=Oe(Q,e,t),a=i.computed(()=>!n.isPending.value);return r?cr({ready:a},n):a}function fr(e=!1,t={}){const{truthyValue:r=!0,falsyValue:n=!1}=t,a=i.isRef(e),l=i.ref(e);function u(c){if(arguments.length)return l.value=c,l.value;{const p=w(r);return l.value=l.value===p?w(n):p,l.value}}return a?u:[l,u]}function dr(e,t,r){let n=(r==null?void 0:r.immediate)?[]:[...e instanceof Function?e():Array.isArray(e)?e:i.unref(e)];return i.watch(e,(a,l,u)=>{const c=new Array(n.length),p=[];for(const f of a){let s=!1;for(let d=0;d<n.length;d++)if(!c[d]&&f===n[d]){c[d]=!0,s=!0;break}s||p.push(f)}const v=n.filter((f,s)=>!c[s]);t(a,n,p,v,u),n=[...a]},r)}var ge=Object.getOwnPropertySymbols,pr=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable,_r=(e,t)=>{var r={};for(var n in e)pr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ge)for(var n of ge(e))t.indexOf(n)<0&&vr.call(e,n)&&(r[n]=e[n]);return r};function E(e,t,r={}){const n=r,{eventFilter:a=T}=n,l=_r(n,["eventFilter"]);return i.watch(e,F(a,t),l)}var Pe=Object.getOwnPropertySymbols,yr=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,wr=(e,t)=>{var r={};for(var n in e)yr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pe)for(var n of Pe(e))t.indexOf(n)<0&&Or.call(e,n)&&(r[n]=e[n]);return r};function hr(e,t,r){const n=r,{count:a}=n,l=wr(n,["count"]),u=i.ref(0),c=E(e,(...p)=>{u.value+=1,u.value>=w(a)&&i.nextTick(()=>c()),t(...p)},l);return{count:u,stop:c}}var gr=Object.defineProperty,Pr=Object.defineProperties,mr=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,$e=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,br=(e,t)=>{for(var r in t||(t={}))me.call(t,r)&&$e(e,r,t[r]);if(U)for(var r of U(t))be.call(t,r)&&$e(e,r,t[r]);return e},$r=(e,t)=>Pr(e,mr(t)),Sr=(e,t)=>{var r={};for(var n in e)me.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&U)for(var n of U(e))t.indexOf(n)<0&&be.call(e,n)&&(r[n]=e[n]);return r};function Se(e,t,r={}){const n=r,{debounce:a=0,maxWait:l=void 0}=n,u=Sr(n,["debounce","maxWait"]);return E(e,t,$r(br({},u),{eventFilter:B(a,{maxWait:l})}))}var Ar=Object.defineProperty,jr=Object.defineProperties,Ir=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Ie=(e,t,r)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fr=(e,t)=>{for(var r in t||(t={}))Ae.call(t,r)&&Ie(e,r,t[r]);if(R)for(var r of R(t))je.call(t,r)&&Ie(e,r,t[r]);return e},Er=(e,t)=>jr(e,Ir(t)),Tr=(e,t)=>{var r={};for(var n in e)Ae.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&R)for(var n of R(e))t.indexOf(n)<0&&je.call(e,n)&&(r[n]=e[n]);return r};function V(e,t,r={}){const n=r,{eventFilter:a=T}=n,l=Tr(n,["eventFilter"]),u=F(a,t);let c,p,v;if(l.flush==="sync"){const f=i.ref(!1);p=()=>{},c=s=>{f.value=!0,s(),f.value=!1},v=i.watch(e,(...s)=>{f.value||u(...s)},l)}else{const f=[],s=i.ref(0),d=i.ref(0);p=()=>{s.value=d.value},f.push(i.watch(e,()=>{d.value++},Er(Fr({},l),{flush:"sync"}))),c=O=>{const y=d.value;O(),s.value+=d.value-y},f.push(i.watch(e,(...O)=>{const y=s.value>0&&s.value===d.value;s.value=0,d.value=0,!y&&u(...O)},l)),v=()=>{f.forEach(O=>O())}}return{stop:v,ignoreUpdates:c,ignorePrevAsyncUpdates:p}}function Ur(e,t,r){const n=i.watch(e,(...a)=>(i.nextTick(()=>n()),t(...a)),r)}var Rr=Object.defineProperty,Cr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Te=(e,t,r)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nr=(e,t)=>{for(var r in t||(t={}))Fe.call(t,r)&&Te(e,r,t[r]);if(C)for(var r of C(t))Ee.call(t,r)&&Te(e,r,t[r]);return e},Wr=(e,t)=>Cr(e,Mr(t)),Br=(e,t)=>{var r={};for(var n in e)Fe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&C)for(var n of C(e))t.indexOf(n)<0&&Ee.call(e,n)&&(r[n]=e[n]);return r};function Ue(e,t,r={}){const n=r,{eventFilter:a}=n,l=Br(n,["eventFilter"]),{eventFilter:u,pause:c,resume:p,isActive:v}=D(a);return{stop:E(e,t,Wr(Nr({},l),{eventFilter:u})),pause:c,resume:p,isActive:v}}var Hr=Object.defineProperty,Yr=Object.defineProperties,Gr=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Me=(e,t,r)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lr=(e,t)=>{for(var r in t||(t={}))Re.call(t,r)&&Me(e,r,t[r]);if(M)for(var r of M(t))Ce.call(t,r)&&Me(e,r,t[r]);return e},zr=(e,t)=>Yr(e,Gr(t)),Vr=(e,t)=>{var r={};for(var n in e)Re.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&M)for(var n of M(e))t.indexOf(n)<0&&Ce.call(e,n)&&(r[n]=e[n]);return r};function Ne(e,t,r={}){const n=r,{throttle:a=0,trailing:l=!0,leading:u=!0}=n,c=Vr(n,["throttle","trailing","leading"]);return E(e,t,zr(Lr({},c),{eventFilter:H(a,l,u)}))}var Jr=Object.defineProperty,Xr=Object.defineProperties,Zr=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Be=(e,t,r)=>t in e?Jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kr=(e,t)=>{for(var r in t||(t={}))kr.call(t,r)&&Be(e,r,t[r]);if(We)for(var r of We(t))qr.call(t,r)&&Be(e,r,t[r]);return e},Qr=(e,t)=>Xr(e,Zr(t));function Dr(e,t,r={}){let n;function a(){if(!n)return;const f=n;n=void 0,f()}function l(f){n=f}const u=(f,s)=>(a(),t(f,s,l)),c=V(e,u,r),{ignoreUpdates:p}=c,v=()=>{let f;return p(()=>{f=u(xr(e),en(e))}),f};return Qr(Kr({},c),{trigger:v})}function xr(e){return i.isReactive(e)?e:Array.isArray(e)?e.map(t=>He(t)):He(e)}function He(e){return typeof e=="function"?e():i.unref(e)}function en(e){return Array.isArray(e)?e.map(()=>{}):void 0}function tn(e,t,r){return i.watch(e,(n,a,l)=>{n&&t(n,a,l)},r)}o.__onlyVue3=x,o.assert=Xe,o.autoResetRef=ie,o.bypassFilter=T,o.clamp=xe,o.computedEager=Z,o.computedWithControl=ee,o.containsProp=it,o.controlledComputed=ee,o.controlledRef=$t,o.createEventHook=ct,o.createFilterWrapper=F,o.createGlobalState=st,o.createInjectionState=ft,o.createReactiveFn=G,o.createSharedComposable=dt,o.createSingletonPromise=ot,o.debounceFilter=B,o.debouncedRef=L,o.debouncedWatch=Se,o.directiveHooks=rt,o.eagerComputed=Z,o.extendRef=te,o.formatDate=de,o.get=pt,o.identity=nt,o.ignorableWatch=V,o.increaseWithUnit=lt,o.invoke=at,o.isBoolean=Ze,o.isClient=I,o.isDef=Je,o.isDefined=vt,o.isFunction=W,o.isIOS=tt,o.isNumber=ke,o.isObject=Ke,o.isString=qe,o.isWindow=Qe,o.makeDestructurable=ht,o.noop=Q,o.normalizeDate=pe,o.now=De,o.objectPick=ut,o.pausableFilter=D,o.pausableWatch=Ue,o.promiseTimeout=Y,o.rand=et,o.reactify=G,o.reactifyObject=gt,o.reactiveComputed=ae,o.reactiveOmit=Pt,o.reactivePick=mt,o.refAutoReset=ie,o.refDebounced=L,o.refDefault=bt,o.refThrottled=z,o.refWithControl=ce,o.resolveRef=St,o.resolveUnref=w,o.set=At,o.syncRef=jt,o.syncRefs=It,o.throttleFilter=H,o.throttledRef=z,o.throttledWatch=Ne,o.timestamp=K,o.toReactive=oe,o.toRefs=Nt,o.tryOnBeforeMount=Wt,o.tryOnBeforeUnmount=Bt,o.tryOnMounted=Ht,o.tryOnScopeDispose=S,o.tryOnUnmounted=Yt,o.until=Gt,o.useArrayEvery=Lt,o.useArrayFilter=zt,o.useArrayFind=Vt,o.useArrayFindIndex=Jt,o.useArrayJoin=Xt,o.useArrayMap=Zt,o.useArrayReduce=kt,o.useArraySome=qt,o.useCounter=Kt,o.useDateFormat=xt,o.useDebounce=L,o.useDebounceFn=le,o.useInterval=or,o.useIntervalFn=ve,o.useLastChanged=ar,o.useThrottle=z,o.useThrottleFn=ue,o.useTimeout=sr,o.useTimeoutFn=Oe,o.useToggle=fr,o.watchArray=dr,o.watchAtMost=hr,o.watchDebounced=Se,o.watchIgnorable=V,o.watchOnce=Ur,o.watchPausable=Ue,o.watchThrottled=Ne,o.watchTriggerable=Dr,o.watchWithFilter=E,o.whenever=tn,Object.defineProperty(o,"__esModule",{value:!0})})(this.VueUse=this.VueUse||{},VueDemi,VueUse);
1
+ var VueDemi=function(o,i,y){if(o.install)return o;if(i)if(i.version.slice(0,4)==="2.7."){for(var g in i)o[g]=i[g];o.isVue2=!0,o.isVue3=!1,o.install=function(){},o.Vue=i,o.Vue2=i,o.version=i.version}else if(i.version.slice(0,2)==="2.")if(y){for(var g in y)o[g]=y[g];o.isVue2=!0,o.isVue3=!1,o.install=function(){},o.Vue=i,o.Vue2=i,o.version=i.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(i.version.slice(0,2)==="3."){for(var g in i)o[g]=i[g];o.isVue2=!1,o.isVue3=!0,o.install=function(){},o.Vue=i,o.Vue2=void 0,o.version=i.version,o.set=function(h,m,b){return Array.isArray(h)?(h.length=Math.max(h.length,m),h.splice(m,1,b),b):(h[m]=b,b)},o.del=function(h,m){if(Array.isArray(h)){h.splice(m,1);return}delete h[m]}}else console.error("[vue-demi] Vue version "+i.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");return o}(this.VueDemi=this.VueDemi||(typeof VueDemi!="undefined"?VueDemi:{}),this.Vue||(typeof Vue!="undefined"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI!="undefined"?VueCompositionAPI:void 0));(function(o,i,y){"use strict";var g=Object.defineProperty,h=Object.defineProperties,m=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,J=(e,t,r)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ke=(e,t)=>{for(var r in t||(t={}))Ye.call(t,r)&&J(e,r,t[r]);if(b)for(var r of b(t))Ge.call(t,r)&&J(e,r,t[r]);return e},ze=(e,t)=>h(e,m(t));function X(e,t){var r;const n=i.shallowRef();return i.watchEffect(()=>{n.value=e()},ze(ke({},t),{flush:(r=t==null?void 0:t.flush)!=null?r:"sync"})),i.readonly(n)}var Z;const I=typeof window!="undefined",Ve=e=>typeof e!="undefined",Je=(e,...t)=>{e||console.warn(...t)},q=Object.prototype.toString,Xe=e=>typeof e=="boolean",W=e=>typeof e=="function",Ze=e=>typeof e=="number",qe=e=>typeof e=="string",Ke=e=>q.call(e)==="[object Object]",Qe=e=>typeof window!="undefined"&&q.call(e)==="[object Window]",De=()=>Date.now(),K=()=>+Date.now(),xe=(e,t,r)=>Math.min(r,Math.max(t,e)),Q=()=>{},et=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),tt=I&&((Z=window==null?void 0:window.navigator)==null?void 0:Z.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function w(e){return typeof e=="function"?e():i.unref(e)}function F(e,t){function r(...n){e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})}return r}const T=e=>e();function B(e,t={}){let r,n;return l=>{const u=w(e),c=w(t.maxWait);if(r&&clearTimeout(r),u<=0||c!==void 0&&c<=0)return n&&(clearTimeout(n),n=null),l();c&&!n&&(n=setTimeout(()=>{r&&clearTimeout(r),n=null,l()},c)),r=setTimeout(()=>{n&&clearTimeout(n),n=null,l()},u)}}function H(e,t=!0,r=!0){let n=0,a,l=!0;const u=()=>{a&&(clearTimeout(a),a=void 0)};return p=>{const v=w(e),f=Date.now()-n;if(u(),v<=0)return n=Date.now(),p();f>v&&(r||!l)?(n=Date.now(),p()):t&&(a=setTimeout(()=>{n=Date.now(),l=!0,u(),p()},v)),!r&&!a&&(a=setTimeout(()=>l=!0,v)),l=!1}}function D(e=T){const t=i.ref(!0);function r(){t.value=!1}function n(){t.value=!0}return{isActive:t,pause:r,resume:n,eventFilter:(...l)=>{t.value&&e(...l)}}}function x(e="this function"){if(!i.isVue3)throw new Error(`[VueUse] ${e} is only works on Vue 3.`)}const rt={mounted:i.isVue3?"mounted":"inserted",updated:i.isVue3?"updated":"componentUpdated",unmounted:i.isVue3?"unmounted":"unbind"};function L(e,t=!1,r="Timeout"){return new Promise((n,a)=>{setTimeout(t?()=>a(r):n,e)})}function nt(e){return e}function ot(e){let t;function r(){return t||(t=e()),t}return r.reset=async()=>{const n=t;t=void 0,n&&await n},r}function at(e){return e()}function it(e,...t){return t.some(r=>r in e)}function lt(e,t){var r;if(typeof e=="number")return e+t;const n=((r=e.match(/^-?[0-9]+\.?[0-9]*/))==null?void 0:r[0])||"",a=e.slice(n.length),l=parseFloat(n)+t;return Number.isNaN(l)?e:l+a}function ut(e,t,r=!1){return t.reduce((n,a)=>(a in e&&(!r||e[a]!==void 0)&&(n[a]=e[a]),n),{})}function ee(e,t){let r,n,a;const l=i.ref(!0),u=()=>{l.value=!0,a()};i.watch(e,u,{flush:"sync"});const c=W(t)?t:t.get,p=W(t)?void 0:t.set,v=i.customRef((f,s)=>(n=f,a=s,{get(){return l.value&&(r=c(),l.value=!1),n(),r},set(d){p==null||p(d)}}));return Object.isExtensible(v)&&(v.trigger=u),v}function ct(){const e=[],t=a=>{const l=e.indexOf(a);l!==-1&&e.splice(l,1)};return{on:a=>(e.push(a),{off:()=>t(a)}),off:t,trigger:a=>{e.forEach(l=>l(a))}}}function st(e){let t=!1,r;const n=i.effectScope(!0);return()=>(t||(r=n.run(e),t=!0),r)}function ft(e){const t=Symbol("InjectionState");return[(...a)=>{i.provide(t,e(...a))},()=>i.inject(t)]}function S(e){return i.getCurrentScope()?(i.onScopeDispose(e),!0):!1}function dt(e){let t=0,r,n;const a=()=>{t-=1,n&&t<=0&&(n.stop(),r=void 0,n=void 0)};return(...l)=>(t+=1,r||(n=i.effectScope(!0),r=n.run(()=>e(...l))),S(a),r)}function te(e,t,{enumerable:r=!1,unwrap:n=!0}={}){x();for(const[a,l]of Object.entries(t))a!=="value"&&(i.isRef(l)&&n?Object.defineProperty(e,a,{get(){return l.value},set(u){l.value=u},enumerable:r}):Object.defineProperty(e,a,{value:l,enumerable:r}));return e}function pt(e,t){return t==null?i.unref(e):i.unref(e)[t]}function vt(e){return i.unref(e)!=null}var yt=Object.defineProperty,re=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,ne=(e,t,r)=>t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wt=(e,t)=>{for(var r in t||(t={}))_t.call(t,r)&&ne(e,r,t[r]);if(re)for(var r of re(t))Ot.call(t,r)&&ne(e,r,t[r]);return e};function ht(e,t){if(typeof Symbol!="undefined"){const r=wt({},e);return Object.defineProperty(r,Symbol.iterator,{enumerable:!1,value(){let n=0;return{next:()=>({value:t[n++],done:n>t.length})}}}),r}else return Object.assign([...t],e)}function Y(e,t){const r=(t==null?void 0:t.computedGetter)===!1?i.unref:w;return function(...n){return i.computed(()=>e.apply(this,n.map(a=>r(a))))}}function gt(e,t={}){let r=[],n;if(Array.isArray(t))r=t;else{n=t;const{includeOwnProperties:a=!0}=t;r.push(...Object.keys(e)),a&&r.push(...Object.getOwnPropertyNames(e))}return Object.fromEntries(r.map(a=>{const l=e[a];return[a,typeof l=="function"?Y(l.bind(e),n):l]}))}function oe(e){if(!i.isRef(e))return i.reactive(e);const t=new Proxy({},{get(r,n,a){return i.unref(Reflect.get(e.value,n,a))},set(r,n,a){return i.isRef(e.value[n])&&!i.isRef(a)?e.value[n].value=a:e.value[n]=a,!0},deleteProperty(r,n){return Reflect.deleteProperty(e.value,n)},has(r,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return i.reactive(t)}function ae(e){return oe(i.computed(e))}function Pt(e,...t){const r=t.flat();return ae(()=>Object.fromEntries(Object.entries(i.toRefs(e)).filter(n=>!r.includes(n[0]))))}function mt(e,...t){const r=t.flat();return i.reactive(Object.fromEntries(r.map(n=>[n,i.toRef(e,n)])))}function ie(e,t=1e4){return i.customRef((r,n)=>{let a=e,l;const u=()=>setTimeout(()=>{a=e,n()},y.resolveUnref(t));return S(()=>{clearTimeout(l)}),{get(){return r(),a},set(c){a=c,n(),clearTimeout(l),l=u()}}})}function le(e,t=200,r={}){return F(B(t,r),e)}function G(e,t=200,r={}){if(t<=0)return e;const n=i.ref(e.value),a=le(()=>{n.value=e.value},t,r);return i.watch(e,()=>a()),n}function bt(e,t){return i.computed({get(){var r;return(r=e.value)!=null?r:t},set(r){e.value=r}})}function ue(e,t=200,r=!1,n=!0){return F(H(t,r,n),e)}function k(e,t=200,r=!0,n=!0){if(t<=0)return e;const a=i.ref(e.value),l=ue(()=>{a.value=e.value},t,r,n);return i.watch(e,()=>l()),a}function ce(e,t={}){let r=e,n,a;const l=i.customRef((d,O)=>(n=d,a=O,{get(){return u()},set(_){c(_)}}));function u(d=!0){return d&&n(),r}function c(d,O=!0){var _,$;if(d===r)return;const P=r;((_=t.onBeforeChange)==null?void 0:_.call(t,d,P))!==!1&&(r=d,($=t.onChanged)==null||$.call(t,d,P),O&&a())}return te(l,{get:u,set:c,untrackedGet:()=>u(!1),silentSet:d=>c(d,!1),peek:()=>u(!1),lay:d=>c(d,!1)},{enumerable:!0})}const $t=ce;function St(e){return typeof e=="function"?i.computed(e):i.ref(e)}function At(...e){if(e.length===2){const[t,r]=e;t.value=r}if(e.length===3)if(i.isVue2)i.set(...e);else{const[t,r,n]=e;t[r]=n}}function jt(e,t,r={}){var n,a;const{flush:l="sync",deep:u=!1,immediate:c=!0,direction:p="both",transform:v={}}=r;let f,s;const d=(n=v.ltr)!=null?n:_=>_,O=(a=v.rtl)!=null?a:_=>_;return(p==="both"||p==="ltr")&&(f=i.watch(e,_=>t.value=d(_),{flush:l,deep:u,immediate:c})),(p==="both"||p==="rtl")&&(s=i.watch(t,_=>e.value=O(_),{flush:l,deep:u,immediate:c})),()=>{f==null||f(),s==null||s()}}function It(e,t,r={}){const{flush:n="sync",deep:a=!1,immediate:l=!0}=r;return Array.isArray(t)||(t=[t]),i.watch(e,u=>t.forEach(c=>c.value=u),{flush:n,deep:a,immediate:l})}var Ft=Object.defineProperty,Et=Object.defineProperties,Tt=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,fe=(e,t,r)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ct=(e,t)=>{for(var r in t||(t={}))Ut.call(t,r)&&fe(e,r,t[r]);if(se)for(var r of se(t))Rt.call(t,r)&&fe(e,r,t[r]);return e},Mt=(e,t)=>Et(e,Tt(t));function Nt(e){if(!i.isRef(e))return i.toRefs(e);const t=Array.isArray(e.value)?new Array(e.value.length):{};for(const r in e.value)t[r]=i.customRef(()=>({get(){return e.value[r]},set(n){if(Array.isArray(e.value)){const a=[...e.value];a[r]=n,e.value=a}else{const a=Mt(Ct({},e.value),{[r]:n});Object.setPrototypeOf(a,e.value),e.value=a}}}));return t}function Wt(e,t=!0){i.getCurrentInstance()?i.onBeforeMount(e):t?e():i.nextTick(e)}function Bt(e){i.getCurrentInstance()&&i.onBeforeUnmount(e)}function Ht(e,t=!0){i.getCurrentInstance()?i.onMounted(e):t?e():i.nextTick(e)}function Lt(e){i.getCurrentInstance()&&i.onUnmounted(e)}function Yt(e){let t=!1;function r(s,{flush:d="sync",deep:O=!1,timeout:_,throwOnTimeout:$}={}){let P=null;const V=[new Promise(N=>{P=i.watch(e,j=>{s(j)!==t&&(P==null||P(),N(j))},{flush:d,deep:O,immediate:!0})})];return _!=null&&V.push(L(_,$).then(()=>w(e)).finally(()=>P==null?void 0:P())),Promise.race(V)}function n(s,d){if(!i.isRef(s))return r(j=>j===s,d);const{flush:O="sync",deep:_=!1,timeout:$,throwOnTimeout:P}=d??{};let A=null;const N=[new Promise(j=>{A=i.watch([e,s],([Le,rn])=>{t!==(Le===rn)&&(A==null||A(),j(Le))},{flush:O,deep:_,immediate:!0})})];return $!=null&&N.push(L($,P).then(()=>w(e)).finally(()=>(A==null||A(),w(e)))),Promise.race(N)}function a(s){return r(d=>Boolean(d),s)}function l(s){return n(null,s)}function u(s){return n(void 0,s)}function c(s){return r(Number.isNaN,s)}function p(s,d){return r(O=>{const _=Array.from(O);return _.includes(s)||_.includes(w(s))},d)}function v(s){return f(1,s)}function f(s=1,d){let O=-1;return r(()=>(O+=1,O>=s),d)}return Array.isArray(w(e))?{toMatch:r,toContains:p,changed:v,changedTimes:f,get not(){return t=!t,this}}:{toMatch:r,toBe:n,toBeTruthy:a,toBeNull:l,toBeNaN:c,toBeUndefined:u,changed:v,changedTimes:f,get not(){return t=!t,this}}}function Gt(e,t){return i.computed(()=>y.resolveUnref(e).every((r,n,a)=>t(y.resolveUnref(r),n,a)))}function kt(e,t){return i.computed(()=>y.resolveUnref(e).map(r=>y.resolveUnref(r)).filter(t))}function zt(e,t){return i.computed(()=>y.resolveUnref(y.resolveUnref(e).find((r,n,a)=>t(y.resolveUnref(r),n,a))))}function Vt(e,t){return i.computed(()=>y.resolveUnref(e).findIndex((r,n,a)=>t(y.resolveUnref(r),n,a)))}function Jt(e,t){return i.computed(()=>y.resolveUnref(e).map(r=>y.resolveUnref(r)).join(y.resolveUnref(t)))}function Xt(e,t){return i.computed(()=>y.resolveUnref(e).map(r=>y.resolveUnref(r)).map(t))}function Zt(e,t,...r){const n=(a,l,u)=>t(y.resolveUnref(a),y.resolveUnref(l),u);return i.computed(()=>{const a=y.resolveUnref(e);return r.length?a.reduce(n,y.resolveUnref(r[0])):a.reduce(n)})}function qt(e,t){return i.computed(()=>y.resolveUnref(e).some((r,n,a)=>t(y.resolveUnref(r),n,a)))}function Kt(e=0,t={}){const r=i.ref(e),{max:n=1/0,min:a=-1/0}=t,l=(f=1)=>r.value=Math.min(n,r.value+f),u=(f=1)=>r.value=Math.max(a,r.value-f),c=()=>r.value,p=f=>r.value=f;return{count:r,inc:l,dec:u,get:c,set:p,reset:(f=e)=>(e=f,p(f))}}const Qt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Dt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,de=(e,t,r)=>{const n=e.getFullYear(),a=e.getMonth(),l=e.getDate(),u=e.getHours(),c=e.getMinutes(),p=e.getSeconds(),v=e.getMilliseconds(),f=e.getDay(),s={YY:()=>String(n).slice(-2),YYYY:()=>n,M:()=>a+1,MM:()=>`${a+1}`.padStart(2,"0"),D:()=>String(l),DD:()=>`${l}`.padStart(2,"0"),H:()=>String(u),HH:()=>`${u}`.padStart(2,"0"),h:()=>`${u%12||12}`.padStart(1,"0"),hh:()=>`${u%12||12}`.padStart(2,"0"),m:()=>String(c),mm:()=>`${c}`.padStart(2,"0"),s:()=>String(p),ss:()=>`${p}`.padStart(2,"0"),SSS:()=>`${v}`.padStart(3,"0"),d:()=>f,dd:()=>e.toLocaleDateString(r,{weekday:"narrow"}),ddd:()=>e.toLocaleDateString(r,{weekday:"short"}),dddd:()=>e.toLocaleDateString(r,{weekday:"long"})};return t.replace(Dt,(d,O)=>O||s[d]())},pe=e=>{if(e===null)return new Date(NaN);if(e===void 0)return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){const t=e.match(Qt);if(t){const r=t[2]-1||0,n=(t[7]||"0").substring(0,3);return new Date(t[1],r,t[3]||1,t[4]||0,t[5]||0,t[6]||0,n)}}return new Date(e)};function xt(e,t="HH:mm:ss",r={}){return i.computed(()=>de(pe(y.resolveUnref(e)),y.resolveUnref(t),r==null?void 0:r.locales))}function ve(e,t=1e3,r={}){const{immediate:n=!0,immediateCallback:a=!1}=r;let l=null;const u=i.ref(!1);function c(){l&&(clearInterval(l),l=null)}function p(){u.value=!1,c()}function v(){i.unref(t)<=0||(u.value=!0,a&&e(),c(),l=setInterval(e,w(t)))}if(n&&I&&v(),i.isRef(t)){const f=i.watch(t,()=>{u.value&&I&&v()});S(f)}return S(p),{isActive:u,pause:p,resume:v}}var er=Object.defineProperty,ye=Object.getOwnPropertySymbols,tr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,_e=(e,t,r)=>t in e?er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nr=(e,t)=>{for(var r in t||(t={}))tr.call(t,r)&&_e(e,r,t[r]);if(ye)for(var r of ye(t))rr.call(t,r)&&_e(e,r,t[r]);return e};function or(e=1e3,t={}){const{controls:r=!1,immediate:n=!0}=t,a=i.ref(0),l=ve(()=>a.value+=1,e,{immediate:n});return r?nr({counter:a},l):a}function ar(e,t={}){var r;const n=i.ref((r=t.initialValue)!=null?r:null);return i.watch(e,()=>n.value=K(),t),n}function Oe(e,t,r={}){const{immediate:n=!0}=r,a=i.ref(!1);let l=null;function u(){l&&(clearTimeout(l),l=null)}function c(){a.value=!1,u()}function p(...v){u(),a.value=!0,l=setTimeout(()=>{a.value=!1,l=null,e(...v)},y.resolveUnref(t))}return n&&(a.value=!0,I&&p()),S(c),{isPending:a,start:p,stop:c}}var ir=Object.defineProperty,we=Object.getOwnPropertySymbols,lr=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable,he=(e,t,r)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cr=(e,t)=>{for(var r in t||(t={}))lr.call(t,r)&&he(e,r,t[r]);if(we)for(var r of we(t))ur.call(t,r)&&he(e,r,t[r]);return e};function sr(e=1e3,t={}){const{controls:r=!1}=t,n=Oe(Q,e,t),a=i.computed(()=>!n.isPending.value);return r?cr({ready:a},n):a}function fr(e=!1,t={}){const{truthyValue:r=!0,falsyValue:n=!1}=t,a=i.isRef(e),l=i.ref(e);function u(c){if(arguments.length)return l.value=c,l.value;{const p=w(r);return l.value=l.value===p?w(n):p,l.value}}return a?u:[l,u]}function dr(e,t,r){let n=(r==null?void 0:r.immediate)?[]:[...e instanceof Function?e():Array.isArray(e)?e:i.unref(e)];return i.watch(e,(a,l,u)=>{const c=new Array(n.length),p=[];for(const f of a){let s=!1;for(let d=0;d<n.length;d++)if(!c[d]&&f===n[d]){c[d]=!0,s=!0;break}s||p.push(f)}const v=n.filter((f,s)=>!c[s]);t(a,n,p,v,u),n=[...a]},r)}var ge=Object.getOwnPropertySymbols,pr=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable,yr=(e,t)=>{var r={};for(var n in e)pr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ge)for(var n of ge(e))t.indexOf(n)<0&&vr.call(e,n)&&(r[n]=e[n]);return r};function E(e,t,r={}){const n=r,{eventFilter:a=T}=n,l=yr(n,["eventFilter"]);return i.watch(e,F(a,t),l)}var Pe=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,wr=(e,t)=>{var r={};for(var n in e)_r.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pe)for(var n of Pe(e))t.indexOf(n)<0&&Or.call(e,n)&&(r[n]=e[n]);return r};function hr(e,t,r){const n=r,{count:a}=n,l=wr(n,["count"]),u=i.ref(0),c=E(e,(...p)=>{u.value+=1,u.value>=w(a)&&i.nextTick(()=>c()),t(...p)},l);return{count:u,stop:c}}var gr=Object.defineProperty,Pr=Object.defineProperties,mr=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,$e=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,br=(e,t)=>{for(var r in t||(t={}))me.call(t,r)&&$e(e,r,t[r]);if(U)for(var r of U(t))be.call(t,r)&&$e(e,r,t[r]);return e},$r=(e,t)=>Pr(e,mr(t)),Sr=(e,t)=>{var r={};for(var n in e)me.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&U)for(var n of U(e))t.indexOf(n)<0&&be.call(e,n)&&(r[n]=e[n]);return r};function Se(e,t,r={}){const n=r,{debounce:a=0,maxWait:l=void 0}=n,u=Sr(n,["debounce","maxWait"]);return E(e,t,$r(br({},u),{eventFilter:B(a,{maxWait:l})}))}var Ar=Object.defineProperty,jr=Object.defineProperties,Ir=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Ie=(e,t,r)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fr=(e,t)=>{for(var r in t||(t={}))Ae.call(t,r)&&Ie(e,r,t[r]);if(R)for(var r of R(t))je.call(t,r)&&Ie(e,r,t[r]);return e},Er=(e,t)=>jr(e,Ir(t)),Tr=(e,t)=>{var r={};for(var n in e)Ae.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&R)for(var n of R(e))t.indexOf(n)<0&&je.call(e,n)&&(r[n]=e[n]);return r};function z(e,t,r={}){const n=r,{eventFilter:a=T}=n,l=Tr(n,["eventFilter"]),u=F(a,t);let c,p,v;if(l.flush==="sync"){const f=i.ref(!1);p=()=>{},c=s=>{f.value=!0,s(),f.value=!1},v=i.watch(e,(...s)=>{f.value||u(...s)},l)}else{const f=[],s=i.ref(0),d=i.ref(0);p=()=>{s.value=d.value},f.push(i.watch(e,()=>{d.value++},Er(Fr({},l),{flush:"sync"}))),c=O=>{const _=d.value;O(),s.value+=d.value-_},f.push(i.watch(e,(...O)=>{const _=s.value>0&&s.value===d.value;s.value=0,d.value=0,!_&&u(...O)},l)),v=()=>{f.forEach(O=>O())}}return{stop:v,ignoreUpdates:c,ignorePrevAsyncUpdates:p}}function Ur(e,t,r){const n=i.watch(e,(...a)=>(i.nextTick(()=>n()),t(...a)),r)}var Rr=Object.defineProperty,Cr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Te=(e,t,r)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nr=(e,t)=>{for(var r in t||(t={}))Fe.call(t,r)&&Te(e,r,t[r]);if(C)for(var r of C(t))Ee.call(t,r)&&Te(e,r,t[r]);return e},Wr=(e,t)=>Cr(e,Mr(t)),Br=(e,t)=>{var r={};for(var n in e)Fe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&C)for(var n of C(e))t.indexOf(n)<0&&Ee.call(e,n)&&(r[n]=e[n]);return r};function Ue(e,t,r={}){const n=r,{eventFilter:a}=n,l=Br(n,["eventFilter"]),{eventFilter:u,pause:c,resume:p,isActive:v}=D(a);return{stop:E(e,t,Wr(Nr({},l),{eventFilter:u})),pause:c,resume:p,isActive:v}}var Hr=Object.defineProperty,Lr=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Me=(e,t,r)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gr=(e,t)=>{for(var r in t||(t={}))Re.call(t,r)&&Me(e,r,t[r]);if(M)for(var r of M(t))Ce.call(t,r)&&Me(e,r,t[r]);return e},kr=(e,t)=>Lr(e,Yr(t)),zr=(e,t)=>{var r={};for(var n in e)Re.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&M)for(var n of M(e))t.indexOf(n)<0&&Ce.call(e,n)&&(r[n]=e[n]);return r};function Ne(e,t,r={}){const n=r,{throttle:a=0,trailing:l=!0,leading:u=!0}=n,c=zr(n,["throttle","trailing","leading"]);return E(e,t,kr(Gr({},c),{eventFilter:H(a,l,u)}))}var Vr=Object.defineProperty,Jr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,Zr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Be=(e,t,r)=>t in e?Vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kr=(e,t)=>{for(var r in t||(t={}))Zr.call(t,r)&&Be(e,r,t[r]);if(We)for(var r of We(t))qr.call(t,r)&&Be(e,r,t[r]);return e},Qr=(e,t)=>Jr(e,Xr(t));function Dr(e,t,r={}){let n;function a(){if(!n)return;const f=n;n=void 0,f()}function l(f){n=f}const u=(f,s)=>(a(),t(f,s,l)),c=z(e,u,r),{ignoreUpdates:p}=c,v=()=>{let f;return p(()=>{f=u(xr(e),en(e))}),f};return Qr(Kr({},c),{trigger:v})}function xr(e){return i.isReactive(e)?e:Array.isArray(e)?e.map(t=>He(t)):He(e)}function He(e){return typeof e=="function"?e():i.unref(e)}function en(e){return Array.isArray(e)?e.map(()=>{}):void 0}function tn(e,t,r){return i.watch(e,(n,a,l)=>{n&&t(n,a,l)},r)}o.__onlyVue3=x,o.assert=Je,o.autoResetRef=ie,o.bypassFilter=T,o.clamp=xe,o.computedEager=X,o.computedWithControl=ee,o.containsProp=it,o.controlledComputed=ee,o.controlledRef=$t,o.createEventHook=ct,o.createFilterWrapper=F,o.createGlobalState=st,o.createInjectionState=ft,o.createReactiveFn=Y,o.createSharedComposable=dt,o.createSingletonPromise=ot,o.debounceFilter=B,o.debouncedRef=G,o.debouncedWatch=Se,o.directiveHooks=rt,o.eagerComputed=X,o.extendRef=te,o.formatDate=de,o.get=pt,o.identity=nt,o.ignorableWatch=z,o.increaseWithUnit=lt,o.invoke=at,o.isBoolean=Xe,o.isClient=I,o.isDef=Ve,o.isDefined=vt,o.isFunction=W,o.isIOS=tt,o.isNumber=Ze,o.isObject=Ke,o.isString=qe,o.isWindow=Qe,o.makeDestructurable=ht,o.noop=Q,o.normalizeDate=pe,o.now=De,o.objectPick=ut,o.pausableFilter=D,o.pausableWatch=Ue,o.promiseTimeout=L,o.rand=et,o.reactify=Y,o.reactifyObject=gt,o.reactiveComputed=ae,o.reactiveOmit=Pt,o.reactivePick=mt,o.refAutoReset=ie,o.refDebounced=G,o.refDefault=bt,o.refThrottled=k,o.refWithControl=ce,o.resolveRef=St,o.resolveUnref=w,o.set=At,o.syncRef=jt,o.syncRefs=It,o.throttleFilter=H,o.throttledRef=k,o.throttledWatch=Ne,o.timestamp=K,o.toReactive=oe,o.toRefs=Nt,o.tryOnBeforeMount=Wt,o.tryOnBeforeUnmount=Bt,o.tryOnMounted=Ht,o.tryOnScopeDispose=S,o.tryOnUnmounted=Lt,o.until=Yt,o.useArrayEvery=Gt,o.useArrayFilter=kt,o.useArrayFind=zt,o.useArrayFindIndex=Vt,o.useArrayJoin=Jt,o.useArrayMap=Xt,o.useArrayReduce=Zt,o.useArraySome=qt,o.useCounter=Kt,o.useDateFormat=xt,o.useDebounce=G,o.useDebounceFn=le,o.useInterval=or,o.useIntervalFn=ve,o.useLastChanged=ar,o.useThrottle=k,o.useThrottleFn=ue,o.useTimeout=sr,o.useTimeoutFn=Oe,o.useToggle=fr,o.watchArray=dr,o.watchAtMost=hr,o.watchDebounced=Se,o.watchIgnorable=z,o.watchOnce=Ur,o.watchPausable=Ue,o.watchThrottled=Ne,o.watchTriggerable=Dr,o.watchWithFilter=E,o.whenever=tn,Object.defineProperty(o,"__esModule",{value:!0})})(this.VueUse=this.VueUse||{},VueDemi,VueUse);
package/index.mjs CHANGED
@@ -875,7 +875,7 @@ function useCounter(initialValue = 0, options = {}) {
875
875
 
876
876
  const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
877
877
  const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
878
- const formatDate = (date, formatStr) => {
878
+ const formatDate = (date, formatStr, locales) => {
879
879
  const years = date.getFullYear();
880
880
  const month = date.getMonth();
881
881
  const days = date.getDate();
@@ -885,24 +885,27 @@ const formatDate = (date, formatStr) => {
885
885
  const milliseconds = date.getMilliseconds();
886
886
  const day = date.getDay();
887
887
  const matches = {
888
- YY: String(years).slice(-2),
889
- YYYY: years,
890
- M: month + 1,
891
- MM: `${month + 1}`.padStart(2, "0"),
892
- D: String(days),
893
- DD: `${days}`.padStart(2, "0"),
894
- H: String(hours),
895
- HH: `${hours}`.padStart(2, "0"),
896
- h: `${hours % 12 || 12}`.padStart(1, "0"),
897
- hh: `${hours % 12 || 12}`.padStart(2, "0"),
898
- m: String(minutes),
899
- mm: `${minutes}`.padStart(2, "0"),
900
- s: String(seconds),
901
- ss: `${seconds}`.padStart(2, "0"),
902
- SSS: `${milliseconds}`.padStart(3, "0"),
903
- d: day
888
+ YY: () => String(years).slice(-2),
889
+ YYYY: () => years,
890
+ M: () => month + 1,
891
+ MM: () => `${month + 1}`.padStart(2, "0"),
892
+ D: () => String(days),
893
+ DD: () => `${days}`.padStart(2, "0"),
894
+ H: () => String(hours),
895
+ HH: () => `${hours}`.padStart(2, "0"),
896
+ h: () => `${hours % 12 || 12}`.padStart(1, "0"),
897
+ hh: () => `${hours % 12 || 12}`.padStart(2, "0"),
898
+ m: () => String(minutes),
899
+ mm: () => `${minutes}`.padStart(2, "0"),
900
+ s: () => String(seconds),
901
+ ss: () => `${seconds}`.padStart(2, "0"),
902
+ SSS: () => `${milliseconds}`.padStart(3, "0"),
903
+ d: () => day,
904
+ dd: () => date.toLocaleDateString(locales, { weekday: "narrow" }),
905
+ ddd: () => date.toLocaleDateString(locales, { weekday: "short" }),
906
+ dddd: () => date.toLocaleDateString(locales, { weekday: "long" })
904
907
  };
905
- return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]);
908
+ return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]());
906
909
  };
907
910
  const normalizeDate = (date) => {
908
911
  if (date === null)
@@ -921,8 +924,8 @@ const normalizeDate = (date) => {
921
924
  }
922
925
  return new Date(date);
923
926
  };
924
- function useDateFormat(date, formatStr = "HH:mm:ss") {
925
- return computed(() => formatDate(normalizeDate(resolveUnref$1(date)), resolveUnref$1(formatStr)));
927
+ function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) {
928
+ return computed(() => formatDate(normalizeDate(resolveUnref$1(date)), resolveUnref$1(formatStr), options == null ? void 0 : options.locales));
926
929
  }
927
930
 
928
931
  function useIntervalFn(cb, interval = 1e3, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/shared",
3
- "version": "9.0.0-beta.2",
3
+ "version": "9.0.2",
4
4
  "author": "Anthony Fu <https://github.com/antfu>",
5
5
  "license": "MIT",
6
6
  "funding": "https://github.com/sponsors/antfu",