Socket
Socket
Sign inDemoInstall

@vueuse/shared

Package Overview
Dependencies
Maintainers
4
Versions
236
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vueuse/shared - npm Package Compare versions

Comparing version 10.4.0 to 10.4.1

62

index.iife.js

@@ -121,2 +121,3 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {

function computedEager(fn, options) {
var _a;
const result = vueDemi.shallowRef();

@@ -127,3 +128,3 @@ vueDemi.watchEffect(() => {

...options,
flush: options?.flush ?? "sync"
flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
});

@@ -158,3 +159,3 @@ return vueDemi.readonly(result);

set(v2) {
set?.(v2);
set == null ? void 0 : set(v2);
}

@@ -309,3 +310,3 @@ };

function reactify(fn, options) {
const unrefFn = options?.computedGetter === false ? vueDemi.unref : toValue;
const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? vueDemi.unref : toValue;
return function(...args) {

@@ -406,3 +407,4 @@ return vueDemi.computed(() => fn.apply(this, args.map((i) => unrefFn(i))));

function getIsIOS() {
return isClient && window?.navigator?.userAgent && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
var _a;
return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
}

@@ -578,5 +580,6 @@

function increaseWithUnit(target, delta) {
var _a;
if (typeof target === "number")
return target + delta;
const value = target.match(/^-?[0-9]+\.?[0-9]*/)?.[0] || "";
const value = ((_a = target.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : _a[0]) || "";
const unit = target.slice(value.length);

@@ -665,3 +668,4 @@ const result = Number.parseFloat(value) + delta;

get() {
return source.value ?? defaultValue;
var _a;
return (_a = source.value) != null ? _a : defaultValue;
},

@@ -714,9 +718,10 @@ set(value) {

function set(value, triggering = true) {
var _a, _b;
if (value === source)
return;
const old = source;
if (options.onBeforeChange?.(value, old) === false)
if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
return;
source = value;
options.onChanged?.(value, old);
(_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
if (triggering)

@@ -792,2 +797,3 @@ trigger();

function syncRef(left, right, options = {}) {
var _a, _b;
const {

@@ -801,4 +807,4 @@ flush = "sync",

const watchers = [];
const transformLTR = transform.ltr ?? ((v) => v);
const transformRTL = transform.rtl ?? ((v) => v);
const transformLTR = (_a = transform.ltr) != null ? _a : (v) => v;
const transformRTL = (_b = transform.rtl) != null ? _b : (v) => v;
if (direction === "both" || direction === "ltr") {

@@ -857,3 +863,4 @@ watchers.push(watchPausable(

set(v) {
const replaceRef = toValue(options.replaceRef) ?? true;
var _a;
const replaceRef = (_a = toValue(options.replaceRef)) != null ? _a : true;
if (replaceRef) {

@@ -914,3 +921,3 @@ if (Array.isArray(objectRef.value)) {

if (condition(v) !== isNot) {
stop?.();
stop == null ? void 0 : stop();
resolve(v);

@@ -929,3 +936,3 @@ }

promises.push(
promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop?.())
promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())
);

@@ -938,3 +945,3 @@ }

return toMatch((v) => v === value, options);
const { flush = "sync", deep = false, timeout, throwOnTimeout } = options ?? {};
const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
let stop = null;

@@ -946,3 +953,3 @@ const watcher = new Promise((resolve) => {

if (isNot !== (v1 === v2)) {
stop?.();
stop == null ? void 0 : stop();
resolve(v1);

@@ -962,3 +969,3 @@ }

promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {
stop?.();
stop == null ? void 0 : stop();
return toValue(r);

@@ -1034,5 +1041,6 @@ })

function useArrayDifference(...args) {
var _a;
const list = args[0];
const values = args[1];
let compareFn = args[2] ?? defaultComparator;
let compareFn = (_a = args[2]) != null ? _a : defaultComparator;
if (typeof compareFn === "string") {

@@ -1085,2 +1093,3 @@ const key = compareFn;

function useArrayIncludes(...args) {
var _a;
const list = args[0];

@@ -1091,3 +1100,3 @@ const value = args[1];

if (isArrayIncludesOptions(comparator)) {
formIndex = comparator.fromIndex ?? 0;
formIndex = (_a = comparator.fromIndex) != null ? _a : 0;
comparator = comparator.comparator;

@@ -1099,3 +1108,3 @@ }

}
comparator = comparator ?? ((element, value2) => element === toValue(value2));
comparator = comparator != null ? comparator : (element, value2) => element === toValue(value2);
return vueDemi.computed(

@@ -1172,2 +1181,3 @@ () => toValue(list).slice(formIndex).some(

function formatDate(date, formatStr, options = {}) {
var _a;
const years = date.getFullYear();

@@ -1181,3 +1191,3 @@ const month = date.getMonth();

const day = date.getDay();
const meridiem = options.customMeridiem ?? defaultMeridiem;
const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;
const matches = {

@@ -1210,3 +1220,6 @@ YY: () => String(years).slice(-2),

};
return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 ?? matches[match]?.() ?? match);
return formatStr.replace(REGEX_FORMAT, (match, $1) => {
var _a2, _b;
return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;
});
}

@@ -1309,3 +1322,4 @@ function normalizeDate(date) {

function useLastChanged(source, options = {}) {
const ms = vueDemi.ref(options.initialValue ?? null);
var _a;
const ms = vueDemi.ref((_a = options.initialValue) != null ? _a : null);
vueDemi.watch(

@@ -1363,3 +1377,3 @@ source,

const controls = useTimeoutFn(
callback ?? noop,
callback != null ? callback : noop,
interval,

@@ -1423,3 +1437,3 @@ options

function watchArray(source, cb, options) {
let oldList = options?.immediate ? [] : [
let oldList = (options == null ? void 0 : options.immediate) ? [] : [
...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)

@@ -1426,0 +1440,0 @@ ];

@@ -1,1 +0,1 @@

var VueDemi=function(c,u,C){if(c.install)return c;if(!u)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),c;if(u.version.slice(0,4)==="2.7."){let w=function(A,S){var O,E={},U={config:u.config,use:u.use.bind(u),mixin:u.mixin.bind(u),component:u.component.bind(u),provide:function(T,F){return E[T]=F,this},directive:function(T,F){return F?(u.directive(T,F),U):u.directive(T)},mount:function(T,F){return O||(O=new u(Object.assign({propsData:S},A,{provide:Object.assign(E,A.provide)})),O.$mount(T,F),O)},unmount:function(){O&&(O.$destroy(),O=void 0)}};return U};var v=w;for(var b in u)c[b]=u[b];c.isVue2=!0,c.isVue3=!1,c.install=function(){},c.Vue=u,c.Vue2=u,c.version=u.version,c.warn=u.util.warn,c.hasInjectionContext=()=>!!c.getCurrentInstance(),c.createApp=w}else if(u.version.slice(0,2)==="2.")if(C){for(var b in C)c[b]=C[b];c.isVue2=!0,c.isVue3=!1,c.install=function(){},c.Vue=u,c.Vue2=u,c.version=u.version,c.hasInjectionContext=()=>!!c.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(u.version.slice(0,2)==="3."){for(var b in u)c[b]=u[b];c.isVue2=!1,c.isVue3=!0,c.install=function(){},c.Vue=u,c.Vue2=void 0,c.version=u.version,c.set=function(w,A,S){return Array.isArray(w)?(w.length=Math.max(w.length,A),w.splice(A,1,S),S):(w[A]=S,S)},c.del=function(w,A){if(Array.isArray(w)){w.splice(A,1);return}delete w[A]}}else console.error("[vue-demi] Vue version "+u.version+" is unsupported.");return c}(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(c,u){"use strict";function C(t,e){const n=u.shallowRef();return u.watchEffect(()=>{n.value=t()},{...e,flush:e?.flush??"sync"}),u.readonly(n)}function b(t,e){let n,r,o;const i=u.ref(!0),a=()=>{i.value=!0,o()};u.watch(t,a,{flush:"sync"});const l=typeof e=="function"?e:e.get,h=typeof e=="function"?void 0:e.set,g=u.customRef((y,f)=>(r=y,o=f,{get(){return i.value&&(n=l(),i.value=!1),r(),n},set(d){h?.(d)}}));return Object.isExtensible(g)&&(g.trigger=a),g}function v(t){return u.getCurrentScope()?(u.onScopeDispose(t),!0):!1}function w(){const t=new Set,e=o=>{t.delete(o)};return{on:o=>{t.add(o);const i=()=>e(o);return v(i),{off:i}},off:e,trigger:o=>Promise.all(Array.from(t).map(i=>i(o)))}}function A(t){let e=!1,n;const r=u.effectScope(!0);return(...o)=>(e||(n=r.run(()=>t(...o)),e=!0),n)}function S(t){const e=Symbol("InjectionState");return[(...o)=>{const i=t(...o);return u.provide(e,i),i},()=>u.inject(e)]}function O(t){let e=0,n,r;const o=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...i)=>(e+=1,n||(r=u.effectScope(!0),n=r.run(()=>t(...i))),v(o),n)}function E(t,e,{enumerable:n=!1,unwrap:r=!0}={}){if(!u.isVue3&&!u.version.startsWith("2.7.")){if(process.env.NODE_ENV!=="production")throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");return}for(const[o,i]of Object.entries(e))o!=="value"&&(u.isRef(i)&&r?Object.defineProperty(t,o,{get(){return i.value},set(a){i.value=a},enumerable:n}):Object.defineProperty(t,o,{value:i,enumerable:n}));return t}function U(t,e){return e==null?u.unref(t):u.unref(t)[e]}function T(t){return u.unref(t)!=null}function F(t,e){if(typeof Symbol<"u"){const n={...t};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let r=0;return{next:()=>({value:e[r++],done:r>e.length})}}}),n}else return Object.assign([...e],t)}function s(t){return typeof t=="function"?t():u.unref(t)}const yt=s;function $(t,e){const n=e?.computedGetter===!1?u.unref:s;return function(...r){return u.computed(()=>t.apply(this,r.map(o=>n(o))))}}function gt(t,e={}){let n=[],r;if(Array.isArray(e))n=e;else{r=e;const{includeOwnProperties:o=!0}=e;n.push(...Object.keys(t)),o&&n.push(...Object.getOwnPropertyNames(t))}return Object.fromEntries(n.map(o=>{const i=t[o];return[o,typeof i=="function"?$(i.bind(t),r):i]}))}function V(t){if(!u.isRef(t))return u.reactive(t);const e=new Proxy({},{get(n,r,o){return u.unref(Reflect.get(t.value,r,o))},set(n,r,o){return u.isRef(t.value[r])&&!u.isRef(o)?t.value[r].value=o:t.value[r]=o,!0},deleteProperty(n,r){return Reflect.deleteProperty(t.value,r)},has(n,r){return Reflect.has(t.value,r)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return u.reactive(e)}function H(t){return V(u.computed(t))}function mt(t,...e){const n=e.flat(),r=n[0];return H(()=>Object.fromEntries(typeof r=="function"?Object.entries(u.toRefs(t)).filter(([o,i])=>!r(s(i),o)):Object.entries(u.toRefs(t)).filter(o=>!n.includes(o[0]))))}const k=typeof window<"u"&&typeof document<"u",pt=t=>typeof t<"u",wt=t=>t!=null,bt=(t,...e)=>{t||console.warn(...e)},At=Object.prototype.toString,x=t=>At.call(t)==="[object Object]",Ot=()=>Date.now(),D=()=>+Date.now(),vt=(t,e,n)=>Math.min(n,Math.max(e,t)),I=()=>{},St=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),Tt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Ft=It();function It(){return k&&window?.navigator?.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function N(t,e){function n(...r){return new Promise((o,i)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(o).catch(i)})}return n}const W=t=>t();function Y(t,e={}){let n,r,o=I;const i=l=>{clearTimeout(l),o(),o=I};return l=>{const h=s(t),g=s(e.maxWait);return n&&i(n),h<=0||g!==void 0&&g<=0?(r&&(i(r),r=null),Promise.resolve(l())):new Promise((y,f)=>{o=e.rejectOnCancel?f:y,g&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,y(l())},g)),n=setTimeout(()=>{r&&i(r),r=null,y(l())},h)})}}function G(t,e=!0,n=!0,r=!1){let o=0,i,a=!0,l=I,h;const g=()=>{i&&(clearTimeout(i),i=void 0,l(),l=I)};return f=>{const d=s(t),m=Date.now()-o,p=()=>h=f();return g(),d<=0?(o=Date.now(),p()):(m>d&&(n||!a)?(o=Date.now(),p()):e&&(h=new Promise((P,R)=>{l=r?R:P,i=setTimeout(()=>{o=Date.now(),a=!0,P(p()),g()},Math.max(0,d-m))})),!n&&!i&&(i=setTimeout(()=>a=!0,d)),a=!1,h)}}function tt(t=W){const e=u.ref(!0);function n(){e.value=!1}function r(){e.value=!0}const o=(...i)=>{e.value&&t(...i)};return{isActive:u.readonly(e),pause:n,resume:r,eventFilter:o}}const Pt={mounted:u.isVue3?"mounted":"inserted",updated:u.isVue3?"updated":"componentUpdated",unmounted:u.isVue3?"unmounted":"unbind"};function et(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const Rt=/\B([A-Z])/g,Ct=et(t=>t.replace(Rt,"-$1").toLowerCase()),Mt=/-(\w)/g,Et=et(t=>t.replace(Mt,(e,n)=>n?n.toUpperCase():""));function z(t,e=!1,n="Timeout"){return new Promise((r,o)=>{setTimeout(e?()=>o(n):r,t)})}function kt(t){return t}function Nt(t){let e;function n(){return e||(e=t()),e}return n.reset=async()=>{const r=e;e=void 0,r&&await r},n}function jt(t){return t()}function nt(t,...e){return e.some(n=>n in t)}function Ut(t,e){if(typeof t=="number")return t+e;const n=t.match(/^-?[0-9]+\.?[0-9]*/)?.[0]||"",r=t.slice(n.length),o=Number.parseFloat(n)+e;return Number.isNaN(o)?t:o+r}function Wt(t,e,n=!1){return e.reduce((r,o)=>(o in t&&(!n||t[o]!==void 0)&&(r[o]=t[o]),r),{})}function Lt(t,e,n=!1){return Object.fromEntries(Object.entries(t).filter(([r,o])=>(!n||o!==void 0)&&!e.includes(r)))}function _t(t){return Object.entries(t)}function q(...t){if(t.length!==1)return u.toRef(...t);const e=t[0];return typeof e=="function"?u.readonly(u.customRef(()=>({get:e,set:I}))):u.ref(e)}const Bt=q;function $t(t,...e){const n=e.flat(),r=n[0];return H(()=>Object.fromEntries(typeof r=="function"?Object.entries(u.toRefs(t)).filter(([o,i])=>r(s(i),o)):n.map(o=>[o,q(t,o)])))}function rt(t,e=1e4){return u.customRef((n,r)=>{let o=s(t),i;const a=()=>setTimeout(()=>{o=s(t),r()},s(e));return v(()=>{clearTimeout(i)}),{get(){return n(),o},set(l){o=l,r(),clearTimeout(i),i=a()}}})}function ot(t,e=200,n={}){return N(Y(e,n),t)}function Z(t,e=200,n={}){const r=u.ref(t.value),o=ot(()=>{r.value=t.value},e,n);return u.watch(t,()=>o()),r}function Ht(t,e){return u.computed({get(){return t.value??e},set(n){t.value=n}})}function ct(t,e=200,n=!1,r=!0,o=!1){return N(G(e,n,r,o),t)}function J(t,e=200,n=!0,r=!0){if(e<=0)return t;const o=u.ref(t.value),i=ct(()=>{o.value=t.value},e,n,r);return u.watch(t,()=>i()),o}function ut(t,e={}){let n=t,r,o;const i=u.customRef((d,m)=>(r=d,o=m,{get(){return a()},set(p){l(p)}}));function a(d=!0){return d&&r(),n}function l(d,m=!0){if(d===n)return;const p=n;e.onBeforeChange?.(d,p)!==!1&&(n=d,e.onChanged?.(d,p),m&&o())}return E(i,{get:a,set:l,untrackedGet:()=>a(!1),silentSet:d=>l(d,!1),peek:()=>a(!1),lay:d=>l(d,!1)},{enumerable:!0})}const Yt=ut;function Gt(...t){if(t.length===2){const[e,n]=t;e.value=n}if(t.length===3)if(u.isVue2)u.set(...t);else{const[e,n,r]=t;e[n]=r}}function j(t,e,n={}){const{eventFilter:r=W,...o}=n;return u.watch(t,N(r,e),o)}function L(t,e,n={}){const{eventFilter:r,...o}=n,{eventFilter:i,pause:a,resume:l,isActive:h}=tt(r);return{stop:j(t,e,{...o,eventFilter:i}),pause:a,resume:l,isActive:h}}function zt(t,e,n={}){const{flush:r="sync",deep:o=!1,immediate:i=!0,direction:a="both",transform:l={}}=n,h=[],g=l.ltr??(d=>d),y=l.rtl??(d=>d);return(a==="both"||a==="ltr")&&h.push(L(t,d=>{h.forEach(m=>m.pause()),e.value=g(d),h.forEach(m=>m.resume())},{flush:r,deep:o,immediate:i})),(a==="both"||a==="rtl")&&h.push(L(e,d=>{h.forEach(m=>m.pause()),t.value=y(d),h.forEach(m=>m.resume())},{flush:r,deep:o,immediate:i})),()=>{h.forEach(d=>d.stop())}}function qt(t,e,n={}){const{flush:r="sync",deep:o=!1,immediate:i=!0}=n;return Array.isArray(e)||(e=[e]),u.watch(t,a=>e.forEach(l=>l.value=a),{flush:r,deep:o,immediate:i})}function Zt(t,e={}){if(!u.isRef(t))return u.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const r in t.value)n[r]=u.customRef(()=>({get(){return t.value[r]},set(o){if(s(e.replaceRef)??!0)if(Array.isArray(t.value)){const a=[...t.value];a[r]=o,t.value=a}else{const a={...t.value,[r]:o};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[r]=o}}));return n}function Jt(t,e=!0){u.getCurrentInstance()?u.onBeforeMount(t):e?t():u.nextTick(t)}function Xt(t){u.getCurrentInstance()&&u.onBeforeUnmount(t)}function Kt(t,e=!0){u.getCurrentInstance()?u.onMounted(t):e?t():u.nextTick(t)}function Qt(t){u.getCurrentInstance()&&u.onUnmounted(t)}function X(t,e=!1){function n(f,{flush:d="sync",deep:m=!1,timeout:p,throwOnTimeout:P}={}){let R=null;const Q=[new Promise(B=>{R=u.watch(t,M=>{f(M)!==e&&(R?.(),B(M))},{flush:d,deep:m,immediate:!0})})];return p!=null&&Q.push(z(p,P).then(()=>s(t)).finally(()=>R?.())),Promise.race(Q)}function r(f,d){if(!u.isRef(f))return n(M=>M===f,d);const{flush:m="sync",deep:p=!1,timeout:P,throwOnTimeout:R}=d??{};let _=null;const B=[new Promise(M=>{_=u.watch([t,f],([ht,Ue])=>{e!==(ht===Ue)&&(_?.(),M(ht))},{flush:m,deep:p,immediate:!0})})];return P!=null&&B.push(z(P,R).then(()=>s(t)).finally(()=>(_?.(),s(t)))),Promise.race(B)}function o(f){return n(d=>!!d,f)}function i(f){return r(null,f)}function a(f){return r(void 0,f)}function l(f){return n(Number.isNaN,f)}function h(f,d){return n(m=>{const p=Array.from(m);return p.includes(f)||p.includes(s(f))},d)}function g(f){return y(1,f)}function y(f=1,d){let m=-1;return n(()=>(m+=1,m>=f),d)}return Array.isArray(s(t))?{toMatch:n,toContains:h,changed:g,changedTimes:y,get not(){return X(t,!e)}}:{toMatch:n,toBe:r,toBeTruthy:o,toBeNull:i,toBeNaN:l,toBeUndefined:a,changed:g,changedTimes:y,get not(){return X(t,!e)}}}function Vt(t){return X(t)}function xt(t,e){return t===e}function Dt(...t){const e=t[0],n=t[1];let r=t[2]??xt;if(typeof r=="string"){const o=r;r=(i,a)=>i[o]===a[o]}return u.computed(()=>s(e).filter(o=>s(n).findIndex(i=>r(o,i))===-1))}function te(t,e){return u.computed(()=>s(t).every((n,r,o)=>e(s(n),r,o)))}function ee(t,e){return u.computed(()=>s(t).map(n=>s(n)).filter(e))}function ne(t,e){return u.computed(()=>s(s(t).find((n,r,o)=>e(s(n),r,o))))}function re(t,e){return u.computed(()=>s(t).findIndex((n,r,o)=>e(s(n),r,o)))}function oe(t,e){let n=t.length;for(;n-- >0;)if(e(t[n],n,t))return t[n]}function ce(t,e){return u.computed(()=>s(Array.prototype.findLast?s(t).findLast((n,r,o)=>e(s(n),r,o)):oe(s(t),(n,r,o)=>e(s(n),r,o))))}function ue(t){return x(t)&&nt(t,"formIndex","comparator")}function ie(...t){const e=t[0],n=t[1];let r=t[2],o=0;if(ue(r)&&(o=r.fromIndex??0,r=r.comparator),typeof r=="string"){const i=r;r=(a,l)=>a[i]===s(l)}return r=r??((i,a)=>i===s(a)),u.computed(()=>s(e).slice(o).some((i,a,l)=>r(s(i),s(n),a,s(l))))}function ae(t,e){return u.computed(()=>s(t).map(n=>s(n)).join(s(e)))}function se(t,e){return u.computed(()=>s(t).map(n=>s(n)).map(e))}function le(t,e,...n){const r=(o,i,a)=>e(s(o),s(i),a);return u.computed(()=>{const o=s(t);return n.length?o.reduce(r,s(n[0])):o.reduce(r)})}function fe(t,e){return u.computed(()=>s(t).some((n,r,o)=>e(s(n),r,o)))}function de(t){return Array.from(new Set(t))}function he(t,e){return t.reduce((n,r)=>(n.some(o=>e(r,o,t))||n.push(r),n),[])}function ye(t,e){return u.computed(()=>{const n=s(t).map(r=>s(r));return e?he(n,e):de(n)})}function ge(t=0,e={}){let n=u.unref(t);const r=u.ref(t),{max:o=Number.POSITIVE_INFINITY,min:i=Number.NEGATIVE_INFINITY}=e,a=(f=1)=>r.value=Math.min(o,r.value+f),l=(f=1)=>r.value=Math.max(i,r.value-f),h=()=>r.value,g=f=>r.value=Math.max(i,Math.min(o,f));return{count:r,inc:a,dec:l,get:h,set:g,reset:(f=n)=>(n=f,g(f))}}const me=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,pe=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function we(t,e,n,r){let o=t<12?"AM":"PM";return r&&(o=o.split("").reduce((i,a)=>i+=`${a}.`,"")),n?o.toLowerCase():o}function it(t,e,n={}){const r=t.getFullYear(),o=t.getMonth(),i=t.getDate(),a=t.getHours(),l=t.getMinutes(),h=t.getSeconds(),g=t.getMilliseconds(),y=t.getDay(),f=n.customMeridiem??we,d={YY:()=>String(r).slice(-2),YYYY:()=>r,M:()=>o+1,MM:()=>`${o+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(n.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(n.locales,{month:"long"}),D:()=>String(i),DD:()=>`${i}`.padStart(2,"0"),H:()=>String(a),HH:()=>`${a}`.padStart(2,"0"),h:()=>`${a%12||12}`.padStart(1,"0"),hh:()=>`${a%12||12}`.padStart(2,"0"),m:()=>String(l),mm:()=>`${l}`.padStart(2,"0"),s:()=>String(h),ss:()=>`${h}`.padStart(2,"0"),SSS:()=>`${g}`.padStart(3,"0"),d:()=>y,dd:()=>t.toLocaleDateString(n.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(n.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(n.locales,{weekday:"long"}),A:()=>f(a,l),AA:()=>f(a,l,!1,!0),a:()=>f(a,l,!0),aa:()=>f(a,l,!0,!0)};return e.replace(pe,(m,p)=>p??d[m]?.()??m)}function at(t){if(t===null)return new Date(Number.NaN);if(t===void 0)return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){const e=t.match(me);if(e){const n=e[2]-1||0,r=(e[7]||"0").substring(0,3);return new Date(e[1],n,e[3]||1,e[4]||0,e[5]||0,e[6]||0,r)}}return new Date(t)}function be(t,e="HH:mm:ss",n={}){return u.computed(()=>it(at(s(t)),s(e),n))}function st(t,e=1e3,n={}){const{immediate:r=!0,immediateCallback:o=!1}=n;let i=null;const a=u.ref(!1);function l(){i&&(clearInterval(i),i=null)}function h(){a.value=!1,l()}function g(){const y=s(e);y<=0||(a.value=!0,o&&t(),l(),i=setInterval(t,y))}if(r&&k&&g(),u.isRef(e)||typeof e=="function"){const y=u.watch(e,()=>{a.value&&k&&g()});v(y)}return v(h),{isActive:a,pause:h,resume:g}}function Ae(t=1e3,e={}){const{controls:n=!1,immediate:r=!0,callback:o}=e,i=u.ref(0),a=()=>i.value+=1,l=()=>{i.value=0},h=st(o?()=>{a(),o(i.value)}:a,t,{immediate:r});return n?{counter:i,reset:l,...h}:i}function Oe(t,e={}){const n=u.ref(e.initialValue??null);return u.watch(t,()=>n.value=D(),e),n}function lt(t,e,n={}){const{immediate:r=!0}=n,o=u.ref(!1);let i=null;function a(){i&&(clearTimeout(i),i=null)}function l(){o.value=!1,a()}function h(...g){a(),o.value=!0,i=setTimeout(()=>{o.value=!1,i=null,t(...g)},s(e))}return r&&(o.value=!0,k&&h()),v(l),{isPending:u.readonly(o),start:h,stop:l}}function ve(t=1e3,e={}){const{controls:n=!1,callback:r}=e,o=lt(r??I,t,e),i=u.computed(()=>!o.isPending.value);return n?{ready:i,...o}:i}function Se(t,e={}){const{method:n="parseFloat",radix:r,nanToZero:o}=e;return u.computed(()=>{let i=s(t);return typeof i=="string"&&(i=Number[n](i,r)),o&&Number.isNaN(i)&&(i=0),i})}function Te(t){return u.computed(()=>`${s(t)}`)}function Fe(t=!1,e={}){const{truthyValue:n=!0,falsyValue:r=!1}=e,o=u.isRef(t),i=u.ref(t);function a(l){if(arguments.length)return i.value=l,i.value;{const h=s(n);return i.value=i.value===h?s(r):h,i.value}}return o?a:[i,a]}function Ie(t,e,n){let r=n?.immediate?[]:[...t instanceof Function?t():Array.isArray(t)?t:s(t)];return u.watch(t,(o,i,a)=>{const l=Array.from({length:r.length}),h=[];for(const y of o){let f=!1;for(let d=0;d<r.length;d++)if(!l[d]&&y===r[d]){l[d]=!0,f=!0;break}f||h.push(y)}const g=r.filter((y,f)=>!l[f]);e(o,r,h,g,a),r=[...o]},n)}function Pe(t,e,n){const{count:r,...o}=n,i=u.ref(0),a=j(t,(...l)=>{i.value+=1,i.value>=s(r)&&u.nextTick(()=>a()),e(...l)},o);return{count:i,stop:a}}function ft(t,e,n={}){const{debounce:r=0,maxWait:o=void 0,...i}=n;return j(t,e,{...i,eventFilter:Y(r,{maxWait:o})})}function Re(t,e,n){return u.watch(t,e,{...n,deep:!0})}function K(t,e,n={}){const{eventFilter:r=W,...o}=n,i=N(r,e);let a,l,h;if(o.flush==="sync"){const g=u.ref(!1);l=()=>{},a=y=>{g.value=!0,y(),g.value=!1},h=u.watch(t,(...y)=>{g.value||i(...y)},o)}else{const g=[],y=u.ref(0),f=u.ref(0);l=()=>{y.value=f.value},g.push(u.watch(t,()=>{f.value++},{...o,flush:"sync"})),a=d=>{const m=f.value;d(),y.value+=f.value-m},g.push(u.watch(t,(...d)=>{const m=y.value>0&&y.value===f.value;y.value=0,f.value=0,!m&&i(...d)},o)),h=()=>{g.forEach(d=>d())}}return{stop:h,ignoreUpdates:a,ignorePrevAsyncUpdates:l}}function Ce(t,e,n){return u.watch(t,e,{...n,immediate:!0})}function Me(t,e,n){const r=u.watch(t,(...o)=>(u.nextTick(()=>r()),e(...o)),n)}function dt(t,e,n={}){const{throttle:r=0,trailing:o=!0,leading:i=!0,...a}=n;return j(t,e,{...a,eventFilter:G(r,o,i)})}function Ee(t,e,n={}){let r;function o(){if(!r)return;const y=r;r=void 0,y()}function i(y){r=y}const a=(y,f)=>(o(),e(y,f,i)),l=K(t,a,n),{ignoreUpdates:h}=l;return{...l,trigger:()=>{let y;return h(()=>{y=a(ke(t),Ne(t))}),y}}}function ke(t){return u.isReactive(t)?t:Array.isArray(t)?t.map(e=>s(e)):s(t)}function Ne(t){return Array.isArray(t)?t.map(()=>{}):void 0}function je(t,e,n){return u.watch(t,(r,o,i)=>{r&&e(r,o,i)},n)}c.assert=bt,c.autoResetRef=rt,c.bypassFilter=W,c.camelize=Et,c.clamp=vt,c.computedEager=C,c.computedWithControl=b,c.containsProp=nt,c.controlledComputed=b,c.controlledRef=Yt,c.createEventHook=w,c.createFilterWrapper=N,c.createGlobalState=A,c.createInjectionState=S,c.createReactiveFn=$,c.createSharedComposable=O,c.createSingletonPromise=Nt,c.debounceFilter=Y,c.debouncedRef=Z,c.debouncedWatch=ft,c.directiveHooks=Pt,c.eagerComputed=C,c.extendRef=E,c.formatDate=it,c.get=U,c.hasOwn=Tt,c.hyphenate=Ct,c.identity=kt,c.ignorableWatch=K,c.increaseWithUnit=Ut,c.invoke=jt,c.isClient=k,c.isDef=pt,c.isDefined=T,c.isIOS=Ft,c.isObject=x,c.makeDestructurable=F,c.noop=I,c.normalizeDate=at,c.notNullish=wt,c.now=Ot,c.objectEntries=_t,c.objectOmit=Lt,c.objectPick=Wt,c.pausableFilter=tt,c.pausableWatch=L,c.promiseTimeout=z,c.rand=St,c.reactify=$,c.reactifyObject=gt,c.reactiveComputed=H,c.reactiveOmit=mt,c.reactivePick=$t,c.refAutoReset=rt,c.refDebounced=Z,c.refDefault=Ht,c.refThrottled=J,c.refWithControl=ut,c.resolveRef=Bt,c.resolveUnref=yt,c.set=Gt,c.syncRef=zt,c.syncRefs=qt,c.throttleFilter=G,c.throttledRef=J,c.throttledWatch=dt,c.timestamp=D,c.toReactive=V,c.toRef=q,c.toRefs=Zt,c.toValue=s,c.tryOnBeforeMount=Jt,c.tryOnBeforeUnmount=Xt,c.tryOnMounted=Kt,c.tryOnScopeDispose=v,c.tryOnUnmounted=Qt,c.until=Vt,c.useArrayDifference=Dt,c.useArrayEvery=te,c.useArrayFilter=ee,c.useArrayFind=ne,c.useArrayFindIndex=re,c.useArrayFindLast=ce,c.useArrayIncludes=ie,c.useArrayJoin=ae,c.useArrayMap=se,c.useArrayReduce=le,c.useArraySome=fe,c.useArrayUnique=ye,c.useCounter=ge,c.useDateFormat=be,c.useDebounce=Z,c.useDebounceFn=ot,c.useInterval=Ae,c.useIntervalFn=st,c.useLastChanged=Oe,c.useThrottle=J,c.useThrottleFn=ct,c.useTimeout=ve,c.useTimeoutFn=lt,c.useToNumber=Se,c.useToString=Te,c.useToggle=Fe,c.watchArray=Ie,c.watchAtMost=Pe,c.watchDebounced=ft,c.watchDeep=Re,c.watchIgnorable=K,c.watchImmediate=Ce,c.watchOnce=Me,c.watchPausable=L,c.watchThrottled=dt,c.watchTriggerable=Ee,c.watchWithFilter=j,c.whenever=je})(this.VueUse=this.VueUse||{},VueDemi);
var VueDemi=function(u,c,M){if(u.install)return u;if(!c)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),u;if(c.version.slice(0,4)==="2.7."){let b=function(O,I){var S,_={},U={config:c.config,use:c.use.bind(c),mixin:c.mixin.bind(c),component:c.component.bind(c),provide:function(P,R){return _[P]=R,this},directive:function(P,R){return R?(c.directive(P,R),U):c.directive(P)},mount:function(P,R){return S||(S=new c(Object.assign({propsData:I},O,{provide:Object.assign(_,O.provide)})),S.$mount(P,R),S)},unmount:function(){S&&(S.$destroy(),S=void 0)}};return U};var F=b;for(var A in c)u[A]=c[A];u.isVue2=!0,u.isVue3=!1,u.install=function(){},u.Vue=c,u.Vue2=c,u.version=c.version,u.warn=c.util.warn,u.hasInjectionContext=()=>!!u.getCurrentInstance(),u.createApp=b}else if(c.version.slice(0,2)==="2.")if(M){for(var A in M)u[A]=M[A];u.isVue2=!0,u.isVue3=!1,u.install=function(){},u.Vue=c,u.Vue2=c,u.version=c.version,u.hasInjectionContext=()=>!!u.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(c.version.slice(0,2)==="3."){for(var A in c)u[A]=c[A];u.isVue2=!1,u.isVue3=!0,u.install=function(){},u.Vue=c,u.Vue2=void 0,u.version=c.version,u.set=function(b,O,I){return Array.isArray(b)?(b.length=Math.max(b.length,O),b.splice(O,1,I),I):(b[O]=I,I)},u.del=function(b,O){if(Array.isArray(b)){b.splice(O,1);return}delete b[O]}}else console.error("[vue-demi] Vue version "+c.version+" is unsupported.");return u}(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(u,c){"use strict";function M(t,e){var n;const r=c.shallowRef();return c.watchEffect(()=>{r.value=t()},{...e,flush:(n=e?.flush)!=null?n:"sync"}),c.readonly(r)}function A(t,e){let n,r,o;const a=c.ref(!0),l=()=>{a.value=!0,o()};c.watch(t,l,{flush:"sync"});const i=typeof e=="function"?e:e.get,d=typeof e=="function"?void 0:e.set,g=c.customRef((h,f)=>(r=h,o=f,{get(){return a.value&&(n=i(),a.value=!1),r(),n},set(y){d?.(y)}}));return Object.isExtensible(g)&&(g.trigger=l),g}function F(t){return c.getCurrentScope()?(c.onScopeDispose(t),!0):!1}function b(){const t=new Set,e=o=>{t.delete(o)};return{on:o=>{t.add(o);const a=()=>e(o);return F(a),{off:a}},off:e,trigger:o=>Promise.all(Array.from(t).map(a=>a(o)))}}function O(t){let e=!1,n;const r=c.effectScope(!0);return(...o)=>(e||(n=r.run(()=>t(...o)),e=!0),n)}function I(t){const e=Symbol("InjectionState");return[(...o)=>{const a=t(...o);return c.provide(e,a),a},()=>c.inject(e)]}function S(t){let e=0,n,r;const o=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(e+=1,n||(r=c.effectScope(!0),n=r.run(()=>t(...a))),F(o),n)}function _(t,e,{enumerable:n=!1,unwrap:r=!0}={}){if(!c.isVue3&&!c.version.startsWith("2.7.")){if(process.env.NODE_ENV!=="production")throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");return}for(const[o,a]of Object.entries(e))o!=="value"&&(c.isRef(a)&&r?Object.defineProperty(t,o,{get(){return a.value},set(l){a.value=l},enumerable:n}):Object.defineProperty(t,o,{value:a,enumerable:n}));return t}function U(t,e){return e==null?c.unref(t):c.unref(t)[e]}function P(t){return c.unref(t)!=null}function R(t,e){if(typeof Symbol<"u"){const n={...t};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let r=0;return{next:()=>({value:e[r++],done:r>e.length})}}}),n}else return Object.assign([...e],t)}function s(t){return typeof t=="function"?t():c.unref(t)}const yt=s;function $(t,e){const n=e?.computedGetter===!1?c.unref:s;return function(...r){return c.computed(()=>t.apply(this,r.map(o=>n(o))))}}function gt(t,e={}){let n=[],r;if(Array.isArray(e))n=e;else{r=e;const{includeOwnProperties:o=!0}=e;n.push(...Object.keys(t)),o&&n.push(...Object.getOwnPropertyNames(t))}return Object.fromEntries(n.map(o=>{const a=t[o];return[o,typeof a=="function"?$(a.bind(t),r):a]}))}function V(t){if(!c.isRef(t))return c.reactive(t);const e=new Proxy({},{get(n,r,o){return c.unref(Reflect.get(t.value,r,o))},set(n,r,o){return c.isRef(t.value[r])&&!c.isRef(o)?t.value[r].value=o:t.value[r]=o,!0},deleteProperty(n,r){return Reflect.deleteProperty(t.value,r)},has(n,r){return Reflect.has(t.value,r)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return c.reactive(e)}function H(t){return V(c.computed(t))}function mt(t,...e){const n=e.flat(),r=n[0];return H(()=>Object.fromEntries(typeof r=="function"?Object.entries(c.toRefs(t)).filter(([o,a])=>!r(s(a),o)):Object.entries(c.toRefs(t)).filter(o=>!n.includes(o[0]))))}const k=typeof window<"u"&&typeof document<"u",wt=t=>typeof t<"u",pt=t=>t!=null,vt=(t,...e)=>{t||console.warn(...e)},bt=Object.prototype.toString,x=t=>bt.call(t)==="[object Object]",At=()=>Date.now(),D=()=>+Date.now(),Ot=(t,e,n)=>Math.min(n,Math.max(e,t)),C=()=>{},St=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),Tt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Ft=It();function It(){var t;return k&&((t=window?.navigator)==null?void 0:t.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function N(t,e){function n(...r){return new Promise((o,a)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(o).catch(a)})}return n}const W=t=>t();function Y(t,e={}){let n,r,o=C;const a=i=>{clearTimeout(i),o(),o=C};return i=>{const d=s(t),g=s(e.maxWait);return n&&a(n),d<=0||g!==void 0&&g<=0?(r&&(a(r),r=null),Promise.resolve(i())):new Promise((h,f)=>{o=e.rejectOnCancel?f:h,g&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,h(i())},g)),n=setTimeout(()=>{r&&a(r),r=null,h(i())},d)})}}function G(t,e=!0,n=!0,r=!1){let o=0,a,l=!0,i=C,d;const g=()=>{a&&(clearTimeout(a),a=void 0,i(),i=C)};return f=>{const y=s(t),w=Date.now()-o,m=()=>d=f();return g(),y<=0?(o=Date.now(),m()):(w>y&&(n||!l)?(o=Date.now(),m()):e&&(d=new Promise((p,v)=>{i=r?v:p,a=setTimeout(()=>{o=Date.now(),l=!0,p(m()),g()},Math.max(0,y-w))})),!n&&!a&&(a=setTimeout(()=>l=!0,y)),l=!1,d)}}function tt(t=W){const e=c.ref(!0);function n(){e.value=!1}function r(){e.value=!0}const o=(...a)=>{e.value&&t(...a)};return{isActive:c.readonly(e),pause:n,resume:r,eventFilter:o}}const Pt={mounted:c.isVue3?"mounted":"inserted",updated:c.isVue3?"updated":"componentUpdated",unmounted:c.isVue3?"unmounted":"unbind"};function et(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const Rt=/\B([A-Z])/g,Ct=et(t=>t.replace(Rt,"-$1").toLowerCase()),Mt=/-(\w)/g,Et=et(t=>t.replace(Mt,(e,n)=>n?n.toUpperCase():""));function z(t,e=!1,n="Timeout"){return new Promise((r,o)=>{setTimeout(e?()=>o(n):r,t)})}function _t(t){return t}function kt(t){let e;function n(){return e||(e=t()),e}return n.reset=async()=>{const r=e;e=void 0,r&&await r},n}function Nt(t){return t()}function nt(t,...e){return e.some(n=>n in t)}function jt(t,e){var n;if(typeof t=="number")return t+e;const r=((n=t.match(/^-?[0-9]+\.?[0-9]*/))==null?void 0:n[0])||"",o=t.slice(r.length),a=Number.parseFloat(r)+e;return Number.isNaN(a)?t:a+o}function Ut(t,e,n=!1){return e.reduce((r,o)=>(o in t&&(!n||t[o]!==void 0)&&(r[o]=t[o]),r),{})}function Wt(t,e,n=!1){return Object.fromEntries(Object.entries(t).filter(([r,o])=>(!n||o!==void 0)&&!e.includes(r)))}function Lt(t){return Object.entries(t)}function q(...t){if(t.length!==1)return c.toRef(...t);const e=t[0];return typeof e=="function"?c.readonly(c.customRef(()=>({get:e,set:C}))):c.ref(e)}const Bt=q;function $t(t,...e){const n=e.flat(),r=n[0];return H(()=>Object.fromEntries(typeof r=="function"?Object.entries(c.toRefs(t)).filter(([o,a])=>r(s(a),o)):n.map(o=>[o,q(t,o)])))}function rt(t,e=1e4){return c.customRef((n,r)=>{let o=s(t),a;const l=()=>setTimeout(()=>{o=s(t),r()},s(e));return F(()=>{clearTimeout(a)}),{get(){return n(),o},set(i){o=i,r(),clearTimeout(a),a=l()}}})}function ot(t,e=200,n={}){return N(Y(e,n),t)}function Z(t,e=200,n={}){const r=c.ref(t.value),o=ot(()=>{r.value=t.value},e,n);return c.watch(t,()=>o()),r}function Ht(t,e){return c.computed({get(){var n;return(n=t.value)!=null?n:e},set(n){t.value=n}})}function ut(t,e=200,n=!1,r=!0,o=!1){return N(G(e,n,r,o),t)}function J(t,e=200,n=!0,r=!0){if(e<=0)return t;const o=c.ref(t.value),a=ut(()=>{o.value=t.value},e,n,r);return c.watch(t,()=>a()),o}function ct(t,e={}){let n=t,r,o;const a=c.customRef((y,w)=>(r=y,o=w,{get(){return l()},set(m){i(m)}}));function l(y=!0){return y&&r(),n}function i(y,w=!0){var m,p;if(y===n)return;const v=n;((m=e.onBeforeChange)==null?void 0:m.call(e,y,v))!==!1&&(n=y,(p=e.onChanged)==null||p.call(e,y,v),w&&o())}return _(a,{get:l,set:i,untrackedGet:()=>l(!1),silentSet:y=>i(y,!1),peek:()=>l(!1),lay:y=>i(y,!1)},{enumerable:!0})}const Yt=ct;function Gt(...t){if(t.length===2){const[e,n]=t;e.value=n}if(t.length===3)if(c.isVue2)c.set(...t);else{const[e,n,r]=t;e[n]=r}}function j(t,e,n={}){const{eventFilter:r=W,...o}=n;return c.watch(t,N(r,e),o)}function L(t,e,n={}){const{eventFilter:r,...o}=n,{eventFilter:a,pause:l,resume:i,isActive:d}=tt(r);return{stop:j(t,e,{...o,eventFilter:a}),pause:l,resume:i,isActive:d}}function zt(t,e,n={}){var r,o;const{flush:a="sync",deep:l=!1,immediate:i=!0,direction:d="both",transform:g={}}=n,h=[],f=(r=g.ltr)!=null?r:m=>m,y=(o=g.rtl)!=null?o:m=>m;return(d==="both"||d==="ltr")&&h.push(L(t,m=>{h.forEach(p=>p.pause()),e.value=f(m),h.forEach(p=>p.resume())},{flush:a,deep:l,immediate:i})),(d==="both"||d==="rtl")&&h.push(L(e,m=>{h.forEach(p=>p.pause()),t.value=y(m),h.forEach(p=>p.resume())},{flush:a,deep:l,immediate:i})),()=>{h.forEach(m=>m.stop())}}function qt(t,e,n={}){const{flush:r="sync",deep:o=!1,immediate:a=!0}=n;return Array.isArray(e)||(e=[e]),c.watch(t,l=>e.forEach(i=>i.value=l),{flush:r,deep:o,immediate:a})}function Zt(t,e={}){if(!c.isRef(t))return c.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const r in t.value)n[r]=c.customRef(()=>({get(){return t.value[r]},set(o){var a;if((a=s(e.replaceRef))!=null?a:!0)if(Array.isArray(t.value)){const i=[...t.value];i[r]=o,t.value=i}else{const i={...t.value,[r]:o};Object.setPrototypeOf(i,Object.getPrototypeOf(t.value)),t.value=i}else t.value[r]=o}}));return n}function Jt(t,e=!0){c.getCurrentInstance()?c.onBeforeMount(t):e?t():c.nextTick(t)}function Xt(t){c.getCurrentInstance()&&c.onBeforeUnmount(t)}function Kt(t,e=!0){c.getCurrentInstance()?c.onMounted(t):e?t():c.nextTick(t)}function Qt(t){c.getCurrentInstance()&&c.onUnmounted(t)}function X(t,e=!1){function n(f,{flush:y="sync",deep:w=!1,timeout:m,throwOnTimeout:p}={}){let v=null;const Q=[new Promise(B=>{v=c.watch(t,E=>{f(E)!==e&&(v?.(),B(E))},{flush:y,deep:w,immediate:!0})})];return m!=null&&Q.push(z(m,p).then(()=>s(t)).finally(()=>v?.())),Promise.race(Q)}function r(f,y){if(!c.isRef(f))return n(E=>E===f,y);const{flush:w="sync",deep:m=!1,timeout:p,throwOnTimeout:v}=y??{};let T=null;const B=[new Promise(E=>{T=c.watch([t,f],([ht,je])=>{e!==(ht===je)&&(T?.(),E(ht))},{flush:w,deep:m,immediate:!0})})];return p!=null&&B.push(z(p,v).then(()=>s(t)).finally(()=>(T?.(),s(t)))),Promise.race(B)}function o(f){return n(y=>!!y,f)}function a(f){return r(null,f)}function l(f){return r(void 0,f)}function i(f){return n(Number.isNaN,f)}function d(f,y){return n(w=>{const m=Array.from(w);return m.includes(f)||m.includes(s(f))},y)}function g(f){return h(1,f)}function h(f=1,y){let w=-1;return n(()=>(w+=1,w>=f),y)}return Array.isArray(s(t))?{toMatch:n,toContains:d,changed:g,changedTimes:h,get not(){return X(t,!e)}}:{toMatch:n,toBe:r,toBeTruthy:o,toBeNull:a,toBeNaN:i,toBeUndefined:l,changed:g,changedTimes:h,get not(){return X(t,!e)}}}function Vt(t){return X(t)}function xt(t,e){return t===e}function Dt(...t){var e;const n=t[0],r=t[1];let o=(e=t[2])!=null?e:xt;if(typeof o=="string"){const a=o;o=(l,i)=>l[a]===i[a]}return c.computed(()=>s(n).filter(a=>s(r).findIndex(l=>o(a,l))===-1))}function te(t,e){return c.computed(()=>s(t).every((n,r,o)=>e(s(n),r,o)))}function ee(t,e){return c.computed(()=>s(t).map(n=>s(n)).filter(e))}function ne(t,e){return c.computed(()=>s(s(t).find((n,r,o)=>e(s(n),r,o))))}function re(t,e){return c.computed(()=>s(t).findIndex((n,r,o)=>e(s(n),r,o)))}function oe(t,e){let n=t.length;for(;n-- >0;)if(e(t[n],n,t))return t[n]}function ue(t,e){return c.computed(()=>s(Array.prototype.findLast?s(t).findLast((n,r,o)=>e(s(n),r,o)):oe(s(t),(n,r,o)=>e(s(n),r,o))))}function ce(t){return x(t)&&nt(t,"formIndex","comparator")}function ae(...t){var e;const n=t[0],r=t[1];let o=t[2],a=0;if(ce(o)&&(a=(e=o.fromIndex)!=null?e:0,o=o.comparator),typeof o=="string"){const l=o;o=(i,d)=>i[l]===s(d)}return o=o??((l,i)=>l===s(i)),c.computed(()=>s(n).slice(a).some((l,i,d)=>o(s(l),s(r),i,s(d))))}function ie(t,e){return c.computed(()=>s(t).map(n=>s(n)).join(s(e)))}function le(t,e){return c.computed(()=>s(t).map(n=>s(n)).map(e))}function se(t,e,...n){const r=(o,a,l)=>e(s(o),s(a),l);return c.computed(()=>{const o=s(t);return n.length?o.reduce(r,s(n[0])):o.reduce(r)})}function fe(t,e){return c.computed(()=>s(t).some((n,r,o)=>e(s(n),r,o)))}function de(t){return Array.from(new Set(t))}function he(t,e){return t.reduce((n,r)=>(n.some(o=>e(r,o,t))||n.push(r),n),[])}function ye(t,e){return c.computed(()=>{const n=s(t).map(r=>s(r));return e?he(n,e):de(n)})}function ge(t=0,e={}){let n=c.unref(t);const r=c.ref(t),{max:o=Number.POSITIVE_INFINITY,min:a=Number.NEGATIVE_INFINITY}=e,l=(f=1)=>r.value=Math.min(o,r.value+f),i=(f=1)=>r.value=Math.max(a,r.value-f),d=()=>r.value,g=f=>r.value=Math.max(a,Math.min(o,f));return{count:r,inc:l,dec:i,get:d,set:g,reset:(f=n)=>(n=f,g(f))}}const me=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,we=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function pe(t,e,n,r){let o=t<12?"AM":"PM";return r&&(o=o.split("").reduce((a,l)=>a+=`${l}.`,"")),n?o.toLowerCase():o}function at(t,e,n={}){var r;const o=t.getFullYear(),a=t.getMonth(),l=t.getDate(),i=t.getHours(),d=t.getMinutes(),g=t.getSeconds(),h=t.getMilliseconds(),f=t.getDay(),y=(r=n.customMeridiem)!=null?r:pe,w={YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>a+1,MM:()=>`${a+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(n.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(n.locales,{month:"long"}),D:()=>String(l),DD:()=>`${l}`.padStart(2,"0"),H:()=>String(i),HH:()=>`${i}`.padStart(2,"0"),h:()=>`${i%12||12}`.padStart(1,"0"),hh:()=>`${i%12||12}`.padStart(2,"0"),m:()=>String(d),mm:()=>`${d}`.padStart(2,"0"),s:()=>String(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${h}`.padStart(3,"0"),d:()=>f,dd:()=>t.toLocaleDateString(n.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(n.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(n.locales,{weekday:"long"}),A:()=>y(i,d),AA:()=>y(i,d,!1,!0),a:()=>y(i,d,!0),aa:()=>y(i,d,!0,!0)};return e.replace(we,(m,p)=>{var v,T;return(T=p??((v=w[m])==null?void 0:v.call(w)))!=null?T:m})}function it(t){if(t===null)return new Date(Number.NaN);if(t===void 0)return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){const e=t.match(me);if(e){const n=e[2]-1||0,r=(e[7]||"0").substring(0,3);return new Date(e[1],n,e[3]||1,e[4]||0,e[5]||0,e[6]||0,r)}}return new Date(t)}function ve(t,e="HH:mm:ss",n={}){return c.computed(()=>at(it(s(t)),s(e),n))}function lt(t,e=1e3,n={}){const{immediate:r=!0,immediateCallback:o=!1}=n;let a=null;const l=c.ref(!1);function i(){a&&(clearInterval(a),a=null)}function d(){l.value=!1,i()}function g(){const h=s(e);h<=0||(l.value=!0,o&&t(),i(),a=setInterval(t,h))}if(r&&k&&g(),c.isRef(e)||typeof e=="function"){const h=c.watch(e,()=>{l.value&&k&&g()});F(h)}return F(d),{isActive:l,pause:d,resume:g}}function be(t=1e3,e={}){const{controls:n=!1,immediate:r=!0,callback:o}=e,a=c.ref(0),l=()=>a.value+=1,i=()=>{a.value=0},d=lt(o?()=>{l(),o(a.value)}:l,t,{immediate:r});return n?{counter:a,reset:i,...d}:a}function Ae(t,e={}){var n;const r=c.ref((n=e.initialValue)!=null?n:null);return c.watch(t,()=>r.value=D(),e),r}function st(t,e,n={}){const{immediate:r=!0}=n,o=c.ref(!1);let a=null;function l(){a&&(clearTimeout(a),a=null)}function i(){o.value=!1,l()}function d(...g){l(),o.value=!0,a=setTimeout(()=>{o.value=!1,a=null,t(...g)},s(e))}return r&&(o.value=!0,k&&d()),F(i),{isPending:c.readonly(o),start:d,stop:i}}function Oe(t=1e3,e={}){const{controls:n=!1,callback:r}=e,o=st(r??C,t,e),a=c.computed(()=>!o.isPending.value);return n?{ready:a,...o}:a}function Se(t,e={}){const{method:n="parseFloat",radix:r,nanToZero:o}=e;return c.computed(()=>{let a=s(t);return typeof a=="string"&&(a=Number[n](a,r)),o&&Number.isNaN(a)&&(a=0),a})}function Te(t){return c.computed(()=>`${s(t)}`)}function Fe(t=!1,e={}){const{truthyValue:n=!0,falsyValue:r=!1}=e,o=c.isRef(t),a=c.ref(t);function l(i){if(arguments.length)return a.value=i,a.value;{const d=s(n);return a.value=a.value===d?s(r):d,a.value}}return o?l:[a,l]}function Ie(t,e,n){let r=n?.immediate?[]:[...t instanceof Function?t():Array.isArray(t)?t:s(t)];return c.watch(t,(o,a,l)=>{const i=Array.from({length:r.length}),d=[];for(const h of o){let f=!1;for(let y=0;y<r.length;y++)if(!i[y]&&h===r[y]){i[y]=!0,f=!0;break}f||d.push(h)}const g=r.filter((h,f)=>!i[f]);e(o,r,d,g,l),r=[...o]},n)}function Pe(t,e,n){const{count:r,...o}=n,a=c.ref(0),l=j(t,(...i)=>{a.value+=1,a.value>=s(r)&&c.nextTick(()=>l()),e(...i)},o);return{count:a,stop:l}}function ft(t,e,n={}){const{debounce:r=0,maxWait:o=void 0,...a}=n;return j(t,e,{...a,eventFilter:Y(r,{maxWait:o})})}function Re(t,e,n){return c.watch(t,e,{...n,deep:!0})}function K(t,e,n={}){const{eventFilter:r=W,...o}=n,a=N(r,e);let l,i,d;if(o.flush==="sync"){const g=c.ref(!1);i=()=>{},l=h=>{g.value=!0,h(),g.value=!1},d=c.watch(t,(...h)=>{g.value||a(...h)},o)}else{const g=[],h=c.ref(0),f=c.ref(0);i=()=>{h.value=f.value},g.push(c.watch(t,()=>{f.value++},{...o,flush:"sync"})),l=y=>{const w=f.value;y(),h.value+=f.value-w},g.push(c.watch(t,(...y)=>{const w=h.value>0&&h.value===f.value;h.value=0,f.value=0,!w&&a(...y)},o)),d=()=>{g.forEach(y=>y())}}return{stop:d,ignoreUpdates:l,ignorePrevAsyncUpdates:i}}function Ce(t,e,n){return c.watch(t,e,{...n,immediate:!0})}function Me(t,e,n){const r=c.watch(t,(...o)=>(c.nextTick(()=>r()),e(...o)),n)}function dt(t,e,n={}){const{throttle:r=0,trailing:o=!0,leading:a=!0,...l}=n;return j(t,e,{...l,eventFilter:G(r,o,a)})}function Ee(t,e,n={}){let r;function o(){if(!r)return;const h=r;r=void 0,h()}function a(h){r=h}const l=(h,f)=>(o(),e(h,f,a)),i=K(t,l,n),{ignoreUpdates:d}=i;return{...i,trigger:()=>{let h;return d(()=>{h=l(_e(t),ke(t))}),h}}}function _e(t){return c.isReactive(t)?t:Array.isArray(t)?t.map(e=>s(e)):s(t)}function ke(t){return Array.isArray(t)?t.map(()=>{}):void 0}function Ne(t,e,n){return c.watch(t,(r,o,a)=>{r&&e(r,o,a)},n)}u.assert=vt,u.autoResetRef=rt,u.bypassFilter=W,u.camelize=Et,u.clamp=Ot,u.computedEager=M,u.computedWithControl=A,u.containsProp=nt,u.controlledComputed=A,u.controlledRef=Yt,u.createEventHook=b,u.createFilterWrapper=N,u.createGlobalState=O,u.createInjectionState=I,u.createReactiveFn=$,u.createSharedComposable=S,u.createSingletonPromise=kt,u.debounceFilter=Y,u.debouncedRef=Z,u.debouncedWatch=ft,u.directiveHooks=Pt,u.eagerComputed=M,u.extendRef=_,u.formatDate=at,u.get=U,u.hasOwn=Tt,u.hyphenate=Ct,u.identity=_t,u.ignorableWatch=K,u.increaseWithUnit=jt,u.invoke=Nt,u.isClient=k,u.isDef=wt,u.isDefined=P,u.isIOS=Ft,u.isObject=x,u.makeDestructurable=R,u.noop=C,u.normalizeDate=it,u.notNullish=pt,u.now=At,u.objectEntries=Lt,u.objectOmit=Wt,u.objectPick=Ut,u.pausableFilter=tt,u.pausableWatch=L,u.promiseTimeout=z,u.rand=St,u.reactify=$,u.reactifyObject=gt,u.reactiveComputed=H,u.reactiveOmit=mt,u.reactivePick=$t,u.refAutoReset=rt,u.refDebounced=Z,u.refDefault=Ht,u.refThrottled=J,u.refWithControl=ct,u.resolveRef=Bt,u.resolveUnref=yt,u.set=Gt,u.syncRef=zt,u.syncRefs=qt,u.throttleFilter=G,u.throttledRef=J,u.throttledWatch=dt,u.timestamp=D,u.toReactive=V,u.toRef=q,u.toRefs=Zt,u.toValue=s,u.tryOnBeforeMount=Jt,u.tryOnBeforeUnmount=Xt,u.tryOnMounted=Kt,u.tryOnScopeDispose=F,u.tryOnUnmounted=Qt,u.until=Vt,u.useArrayDifference=Dt,u.useArrayEvery=te,u.useArrayFilter=ee,u.useArrayFind=ne,u.useArrayFindIndex=re,u.useArrayFindLast=ue,u.useArrayIncludes=ae,u.useArrayJoin=ie,u.useArrayMap=le,u.useArrayReduce=se,u.useArraySome=fe,u.useArrayUnique=ye,u.useCounter=ge,u.useDateFormat=ve,u.useDebounce=Z,u.useDebounceFn=ot,u.useInterval=be,u.useIntervalFn=lt,u.useLastChanged=Ae,u.useThrottle=J,u.useThrottleFn=ut,u.useTimeout=Oe,u.useTimeoutFn=st,u.useToNumber=Se,u.useToString=Te,u.useToggle=Fe,u.watchArray=Ie,u.watchAtMost=Pe,u.watchDebounced=ft,u.watchDeep=Re,u.watchIgnorable=K,u.watchImmediate=Ce,u.watchOnce=Me,u.watchPausable=L,u.watchThrottled=dt,u.watchTriggerable=Ee,u.watchWithFilter=j,u.whenever=Ne})(this.VueUse=this.VueUse||{},VueDemi);
{
"name": "@vueuse/shared",
"version": "10.4.0",
"version": "10.4.1",
"author": "Anthony Fu <https://github.com/antfu>",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc