@vueuse/shared 6.3.2 → 6.5.3

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.mjs CHANGED
@@ -1,1101 +1,1102 @@
1
1
  import { computed, unref, watch, ref, customRef, isVue3, isRef, effectScope, getCurrentScope, onScopeDispose, shallowRef, watchSyncEffect, readonly, reactive, toRef, isVue2, toRefs as toRefs$1, getCurrentInstance, onBeforeUnmount, onMounted, nextTick, onUnmounted } from 'vue-demi';
2
2
 
3
- /**
4
- * `AND` conditions for refs.
5
- *
6
- * @see https://vueuse.org/and
7
- */
8
- function and(...args) {
9
- return computed(() => args.every(i => unref(i)));
3
+ function and(...args) {
4
+ return computed(() => args.every((i) => unref(i)));
10
5
  }
11
6
 
12
- /**
13
- * Two-way refs synchronization.
14
- *
15
- * @param a
16
- * @param b
17
- */
18
- function biSyncRef(a, b) {
19
- const flush = 'sync';
20
- const stop1 = watch(a, (newValue) => {
21
- b.value = newValue;
22
- }, {
23
- flush,
24
- immediate: true,
25
- });
26
- const stop2 = watch(b, (newValue) => {
27
- a.value = newValue;
28
- }, {
29
- flush,
30
- immediate: true,
31
- });
32
- return () => {
33
- stop1();
34
- stop2();
35
- };
7
+ function biSyncRef(a, b) {
8
+ const flush = "sync";
9
+ const stop1 = watch(a, (newValue) => {
10
+ b.value = newValue;
11
+ }, {
12
+ flush,
13
+ immediate: true
14
+ });
15
+ const stop2 = watch(b, (newValue) => {
16
+ a.value = newValue;
17
+ }, {
18
+ flush,
19
+ immediate: true
20
+ });
21
+ return () => {
22
+ stop1();
23
+ stop2();
24
+ };
36
25
  }
37
26
 
38
- /**
39
- * Explicitly define the deps of computed.
40
- *
41
- * @param source
42
- * @param fn
43
- */
44
- function controlledComputed(source, fn) {
45
- let v = undefined;
46
- let track;
47
- let trigger;
48
- const dirty = ref(true);
49
- watch(source, () => {
50
- dirty.value = true;
51
- trigger();
52
- }, { flush: 'sync' });
53
- return customRef((_track, _trigger) => {
54
- track = _track;
55
- trigger = _trigger;
56
- return {
57
- get() {
58
- if (dirty.value) {
59
- v = fn();
60
- dirty.value = false;
61
- }
62
- track();
63
- return v;
64
- },
65
- set() { },
66
- };
67
- });
27
+ function controlledComputed(source, fn) {
28
+ let v = void 0;
29
+ let track;
30
+ let trigger;
31
+ const dirty = ref(true);
32
+ watch(source, () => {
33
+ dirty.value = true;
34
+ trigger();
35
+ }, { flush: "sync" });
36
+ return customRef((_track, _trigger) => {
37
+ track = _track;
38
+ trigger = _trigger;
39
+ return {
40
+ get() {
41
+ if (dirty.value) {
42
+ v = fn();
43
+ dirty.value = false;
44
+ }
45
+ track();
46
+ return v;
47
+ },
48
+ set() {
49
+ }
50
+ };
51
+ });
68
52
  }
69
53
 
70
- function __onlyVue3(name = 'this function') {
71
- if (isVue3)
72
- return;
73
- throw new Error(`[VueUse] ${name} is only works on Vue 3.`);
54
+ function __onlyVue3(name = "this function") {
55
+ if (isVue3)
56
+ return;
57
+ throw new Error(`[VueUse] ${name} is only works on Vue 3.`);
74
58
  }
75
59
 
76
- // implementation
77
- function extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {
78
- __onlyVue3();
79
- for (const [key, value] of Object.entries(extend)) {
80
- if (key === 'value')
81
- continue;
82
- if (isRef(value) && unwrap) {
83
- Object.defineProperty(ref, key, {
84
- get() {
85
- return value.value;
86
- },
87
- set(v) {
88
- value.value = v;
89
- },
90
- enumerable,
91
- });
92
- }
93
- else {
94
- Object.defineProperty(ref, key, { value, enumerable });
95
- }
96
- }
97
- return ref;
60
+ function extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {
61
+ __onlyVue3();
62
+ for (const [key, value] of Object.entries(extend)) {
63
+ if (key === "value")
64
+ continue;
65
+ if (isRef(value) && unwrap) {
66
+ Object.defineProperty(ref, key, {
67
+ get() {
68
+ return value.value;
69
+ },
70
+ set(v) {
71
+ value.value = v;
72
+ },
73
+ enumerable
74
+ });
75
+ } else {
76
+ Object.defineProperty(ref, key, { value, enumerable });
77
+ }
78
+ }
79
+ return ref;
98
80
  }
99
81
 
100
- /**
101
- * Explicitly define the deps of computed.
102
- *
103
- * @param source
104
- * @param fn
105
- */
106
- function controlledRef(initial, options = {}) {
107
- let source = initial;
108
- let track;
109
- let trigger;
110
- const ref = customRef((_track, _trigger) => {
111
- track = _track;
112
- trigger = _trigger;
113
- return {
114
- get() {
115
- return get();
116
- },
117
- set(v) {
118
- set(v);
119
- },
120
- };
121
- });
122
- function get(tracking = true) {
123
- if (tracking)
124
- track();
125
- return source;
126
- }
127
- function set(value, triggering = true) {
128
- var _a, _b;
129
- if (value === source)
130
- return;
131
- const old = source;
132
- if (((_a = options.onBeforeChange) === null || _a === void 0 ? void 0 : _a.call(options, value, old)) === false)
133
- return; // dismissed
134
- source = value;
135
- (_b = options.onChanged) === null || _b === void 0 ? void 0 : _b.call(options, value, old);
136
- if (triggering)
137
- trigger();
138
- }
139
- /**
140
- * Get the value without tracked in the reactivity system
141
- */
142
- const untrackedGet = () => get(false);
143
- /**
144
- * Set the value without triggering the reactivity system
145
- */
146
- const silentSet = (v) => set(v, false);
147
- /**
148
- * Get the value without tracked in the reactivity system.
149
- *
150
- * Alias for `untrackedGet()`
151
- */
152
- const peek = () => get(false);
153
- /**
154
- * Set the value without triggering the reactivity system
155
- *
156
- * Alias for `silentSet(v)`
157
- */
158
- const lay = (v) => set(v, false);
159
- return extendRef(ref, {
160
- get,
161
- set,
162
- untrackedGet,
163
- silentSet,
164
- peek,
165
- lay,
166
- }, { enumerable: true });
82
+ function controlledRef(initial, options = {}) {
83
+ let source = initial;
84
+ let track;
85
+ let trigger;
86
+ const ref = customRef((_track, _trigger) => {
87
+ track = _track;
88
+ trigger = _trigger;
89
+ return {
90
+ get() {
91
+ return get();
92
+ },
93
+ set(v) {
94
+ set(v);
95
+ }
96
+ };
97
+ });
98
+ function get(tracking = true) {
99
+ if (tracking)
100
+ track();
101
+ return source;
102
+ }
103
+ function set(value, triggering = true) {
104
+ var _a, _b;
105
+ if (value === source)
106
+ return;
107
+ const old = source;
108
+ if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
109
+ return;
110
+ source = value;
111
+ (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
112
+ if (triggering)
113
+ trigger();
114
+ }
115
+ const untrackedGet = () => get(false);
116
+ const silentSet = (v) => set(v, false);
117
+ const peek = () => get(false);
118
+ const lay = (v) => set(v, false);
119
+ return extendRef(ref, {
120
+ get,
121
+ set,
122
+ untrackedGet,
123
+ silentSet,
124
+ peek,
125
+ lay
126
+ }, { enumerable: true });
167
127
  }
168
128
 
169
- /**
170
- * The source code for this function was inspired by vue-apollo's `useEventHook` util
171
- * https://github.com/vuejs/vue-apollo/blob/v4/packages/vue-apollo-composable/src/util/useEventHook.ts
172
- */
173
- /**
174
- * Utility for creating event hooks
175
- *
176
- * @see https://vueuse.org/createEventHook
177
- */
178
- function createEventHook() {
179
- const fns = [];
180
- const off = (fn) => {
181
- const index = fns.indexOf(fn);
182
- if (index !== -1)
183
- fns.splice(index, 1);
184
- };
185
- const on = (fn) => {
186
- fns.push(fn);
187
- return {
188
- off: () => off(fn),
189
- };
190
- };
191
- const trigger = (param) => {
192
- fns.forEach(fn => fn(param));
193
- };
194
- return {
195
- on,
196
- off,
197
- trigger,
198
- };
129
+ function createEventHook() {
130
+ const fns = [];
131
+ const off = (fn) => {
132
+ const index = fns.indexOf(fn);
133
+ if (index !== -1)
134
+ fns.splice(index, 1);
135
+ };
136
+ const on = (fn) => {
137
+ fns.push(fn);
138
+ return {
139
+ off: () => off(fn)
140
+ };
141
+ };
142
+ const trigger = (param) => {
143
+ fns.forEach((fn) => fn(param));
144
+ };
145
+ return {
146
+ on,
147
+ off,
148
+ trigger
149
+ };
199
150
  }
200
151
 
201
- /**
202
- * Keep states in the global scope to be reusable across Vue instances.
203
- *
204
- * @see https://vueuse.org/createGlobalState
205
- * @param stateFactory A factory function to create the state
206
- */
207
- function createGlobalState(stateFactory) {
208
- let initialized = false;
209
- let state;
210
- const scope = effectScope(true);
211
- return () => {
212
- if (!initialized) {
213
- state = scope.run(stateFactory);
214
- initialized = true;
215
- }
216
- return state;
217
- };
152
+ function createGlobalState(stateFactory) {
153
+ let initialized = false;
154
+ let state;
155
+ const scope = effectScope(true);
156
+ return () => {
157
+ if (!initialized) {
158
+ state = scope.run(stateFactory);
159
+ initialized = true;
160
+ }
161
+ return state;
162
+ };
218
163
  }
219
164
 
220
- /**
221
- * Call onScopeDispose() if it's inside a effect scope lifecycle, if not, do nothing
222
- *
223
- * @param fn
224
- */
225
- function tryOnScopeDispose(fn) {
226
- if (getCurrentScope()) {
227
- onScopeDispose(fn);
228
- return true;
229
- }
230
- return false;
165
+ function tryOnScopeDispose(fn) {
166
+ if (getCurrentScope()) {
167
+ onScopeDispose(fn);
168
+ return true;
169
+ }
170
+ return false;
231
171
  }
232
172
 
233
- /**
234
- * Make a composable function usable with multiple Vue instances.
235
- *
236
- * @see https://vueuse.org/createSharedComposable
237
- */
238
- function createSharedComposable(composable) {
239
- let subscribers = 0;
240
- let state;
241
- let scope;
242
- const dispose = () => {
243
- subscribers -= 1;
244
- if (scope && subscribers <= 0) {
245
- scope.stop();
246
- state = undefined;
247
- scope = undefined;
248
- }
249
- };
250
- return ((...args) => {
251
- subscribers += 1;
252
- if (!state) {
253
- scope = effectScope(true);
254
- state = scope.run(() => composable(...args));
255
- }
256
- tryOnScopeDispose(dispose);
257
- return state;
258
- });
173
+ function createSharedComposable(composable) {
174
+ let subscribers = 0;
175
+ let state;
176
+ let scope;
177
+ const dispose = () => {
178
+ subscribers -= 1;
179
+ if (scope && subscribers <= 0) {
180
+ scope.stop();
181
+ state = void 0;
182
+ scope = void 0;
183
+ }
184
+ };
185
+ return (...args) => {
186
+ subscribers += 1;
187
+ if (!state) {
188
+ scope = effectScope(true);
189
+ state = scope.run(() => composable(...args));
190
+ }
191
+ tryOnScopeDispose(dispose);
192
+ return state;
193
+ };
259
194
  }
260
195
 
261
- /*! *****************************************************************************
262
- Copyright (c) Microsoft Corporation.
263
-
264
- Permission to use, copy, modify, and/or distribute this software for any
265
- purpose with or without fee is hereby granted.
266
-
267
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
268
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
269
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
270
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
271
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
272
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
273
- PERFORMANCE OF THIS SOFTWARE.
274
- ***************************************************************************** */
275
-
276
- function __rest(s, e) {
277
- var t = {};
278
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
279
- t[p] = s[p];
280
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
281
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
282
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
283
- t[p[i]] = s[p[i]];
284
- }
285
- return t;
286
- }
196
+ const isClient = typeof window !== "undefined";
197
+ const isDef = (val) => typeof val !== "undefined";
198
+ const assert = (condition, ...infos) => {
199
+ if (!condition)
200
+ console.warn(...infos);
201
+ };
202
+ const toString = Object.prototype.toString;
203
+ const isBoolean = (val) => typeof val === "boolean";
204
+ const isFunction = (val) => typeof val === "function";
205
+ const isNumber = (val) => typeof val === "number";
206
+ const isString = (val) => typeof val === "string";
207
+ const isObject = (val) => toString.call(val) === "[object Object]";
208
+ const isWindow = (val) => typeof window !== "undefined" && toString.call(val) === "[object Window]";
209
+ const now = () => Date.now();
210
+ const timestamp = () => +Date.now();
211
+ const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
212
+ const noop = () => {
213
+ };
214
+ const rand = (min, max) => {
215
+ min = Math.ceil(min);
216
+ max = Math.floor(max);
217
+ return Math.floor(Math.random() * (max - min + 1)) + min;
218
+ };
287
219
 
288
- const isClient = typeof window !== 'undefined';
289
- const isDef = (val) => typeof val !== 'undefined';
290
- const assert = (condition, ...infos) => {
291
- // eslint-disable-next-line no-console
292
- if (!condition)
293
- console.warn(...infos);
294
- };
295
- const toString = Object.prototype.toString;
296
- const isBoolean = (val) => typeof val === 'boolean';
297
- const isFunction = (val) => typeof val === 'function';
298
- const isNumber = (val) => typeof val === 'number';
299
- const isString = (val) => typeof val === 'string';
300
- const isObject = (val) => toString.call(val) === '[object Object]';
301
- const isWindow = (val) => typeof window !== 'undefined' && toString.call(val) === '[object Window]';
302
- const now = () => Date.now();
303
- const timestamp = () => +Date.now();
304
- const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
305
- const noop = () => { };
306
- const rand = (min, max) => {
307
- min = Math.ceil(min);
308
- max = Math.floor(max);
309
- return Math.floor(Math.random() * (max - min + 1)) + min;
220
+ function createFilterWrapper(filter, fn) {
221
+ function wrapper(...args) {
222
+ filter(() => fn.apply(this, args), { fn, thisArg: this, args });
223
+ }
224
+ return wrapper;
225
+ }
226
+ const bypassFilter = (invoke) => {
227
+ return invoke();
310
228
  };
229
+ function debounceFilter(ms) {
230
+ let timer;
231
+ const filter = (invoke) => {
232
+ const duration = unref(ms);
233
+ if (timer)
234
+ clearTimeout(timer);
235
+ if (duration <= 0)
236
+ return invoke();
237
+ timer = setTimeout(invoke, duration);
238
+ };
239
+ return filter;
240
+ }
241
+ function throttleFilter(ms, trailing = true, leading = true) {
242
+ let lastExec = 0;
243
+ let timer;
244
+ let preventLeading = !leading;
245
+ const clear = () => {
246
+ if (timer) {
247
+ clearTimeout(timer);
248
+ timer = void 0;
249
+ }
250
+ };
251
+ const filter = (invoke) => {
252
+ const duration = unref(ms);
253
+ const elapsed = Date.now() - lastExec;
254
+ clear();
255
+ if (duration <= 0) {
256
+ lastExec = Date.now();
257
+ return invoke();
258
+ }
259
+ if (elapsed > duration) {
260
+ lastExec = Date.now();
261
+ if (preventLeading)
262
+ preventLeading = false;
263
+ else
264
+ invoke();
265
+ } else if (trailing) {
266
+ timer = setTimeout(() => {
267
+ lastExec = Date.now();
268
+ if (!leading)
269
+ preventLeading = true;
270
+ clear();
271
+ invoke();
272
+ }, duration);
273
+ }
274
+ if (!leading && !timer)
275
+ timer = setTimeout(() => preventLeading = true, duration);
276
+ };
277
+ return filter;
278
+ }
279
+ function pausableFilter(extendFilter = bypassFilter) {
280
+ const isActive = ref(true);
281
+ function pause() {
282
+ isActive.value = false;
283
+ }
284
+ function resume() {
285
+ isActive.value = true;
286
+ }
287
+ const eventFilter = (...args) => {
288
+ if (isActive.value)
289
+ extendFilter(...args);
290
+ };
291
+ return { isActive, pause, resume, eventFilter };
292
+ }
311
293
 
312
- /**
313
- * @internal
314
- */
315
- function createFilterWrapper(filter, fn) {
316
- function wrapper(...args) {
317
- filter(() => fn.apply(this, args), { fn, thisArg: this, args });
318
- }
319
- return wrapper;
320
- }
321
- const bypassFilter = (invoke) => {
322
- return invoke();
323
- };
324
- /**
325
- * Create an EventFilter that debounce the events
326
- *
327
- * @param ms
328
- */
329
- function debounceFilter(ms) {
330
- let timer;
331
- const filter = (invoke) => {
332
- const duration = unref(ms);
333
- if (timer)
334
- clearTimeout(timer);
335
- if (duration <= 0)
336
- return invoke();
337
- timer = setTimeout(invoke, duration);
338
- };
339
- return filter;
340
- }
341
- /**
342
- * Create an EventFilter that throttle the events
343
- *
344
- * @param ms
345
- * @param [trailing=true]
346
- */
347
- function throttleFilter(ms, trailing = true) {
348
- let lastExec = 0;
349
- let timer;
350
- const clear = () => {
351
- if (timer) {
352
- clearTimeout(timer);
353
- timer = undefined;
354
- }
355
- };
356
- const filter = (invoke) => {
357
- const duration = unref(ms);
358
- const elapsed = Date.now() - lastExec;
359
- clear();
360
- if (duration <= 0) {
361
- lastExec = Date.now();
362
- return invoke();
363
- }
364
- if (elapsed > duration) {
365
- lastExec = Date.now();
366
- invoke();
367
- }
368
- else if (trailing) {
369
- timer = setTimeout(() => {
370
- lastExec = Date.now();
371
- clear();
372
- invoke();
373
- }, duration);
374
- }
375
- };
376
- return filter;
377
- }
378
- /**
379
- * EventFilter that gives extra controls to pause and resume the filter
380
- *
381
- * @param extendFilter Extra filter to apply when the PauseableFilter is active, default to none
382
- *
383
- */
384
- function pausableFilter(extendFilter = bypassFilter) {
385
- const isActive = ref(true);
386
- function pause() {
387
- isActive.value = false;
388
- }
389
- function resume() {
390
- isActive.value = true;
391
- }
392
- const eventFilter = (...args) => {
393
- if (isActive.value)
394
- extendFilter(...args);
395
- };
396
- return { isActive, pause, resume, eventFilter };
294
+ function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
295
+ return new Promise((resolve, reject) => {
296
+ if (throwOnTimeout)
297
+ setTimeout(() => reject(reason), ms);
298
+ else
299
+ setTimeout(resolve, ms);
300
+ });
301
+ }
302
+ function identity(arg) {
303
+ return arg;
304
+ }
305
+ function createSingletonPromise(fn) {
306
+ let _promise;
307
+ function wrapper() {
308
+ if (!_promise)
309
+ _promise = fn();
310
+ return _promise;
311
+ }
312
+ wrapper.reset = async () => {
313
+ const _prev = _promise;
314
+ _promise = void 0;
315
+ if (_prev)
316
+ await _prev;
317
+ };
318
+ return wrapper;
319
+ }
320
+ function invoke(fn) {
321
+ return fn();
322
+ }
323
+ function containsProp(obj, ...props) {
324
+ return props.some((k) => k in obj);
325
+ }
326
+ function increaseWithUnit(target, delta) {
327
+ var _a;
328
+ if (typeof target === "number")
329
+ return target + delta;
330
+ const value = ((_a = target.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : _a[0]) || "";
331
+ const unit = target.slice(value.length);
332
+ const result = parseFloat(value) + delta;
333
+ if (Number.isNaN(result))
334
+ return target;
335
+ return result + unit;
336
+ }
337
+ function objectPick(obj, keys, omitUndefined = false) {
338
+ return keys.reduce((n, k) => {
339
+ if (k in obj) {
340
+ if (!omitUndefined || !obj[k] === void 0)
341
+ n[k] = obj[k];
342
+ }
343
+ return n;
344
+ }, {});
397
345
  }
398
346
 
399
- function promiseTimeout(ms, throwOnTimeout = false, reason = 'Timeout') {
400
- return new Promise((resolve, reject) => {
401
- if (throwOnTimeout)
402
- setTimeout(() => reject(reason), ms);
403
- else
404
- setTimeout(resolve, ms);
405
- });
406
- }
407
- function identity(arg) {
408
- return arg;
409
- }
410
- /**
411
- * Create singleton promise function
412
- *
413
- * @example
414
- * ```
415
- * const promise = createSingletonPromise(async () => { ... })
416
- *
417
- * await promise()
418
- * await promise() // all of them will be bind to a single promise instance
419
- * await promise() // and be resolved together
420
- * ```
421
- */
422
- function createSingletonPromise(fn) {
423
- let _promise;
424
- function wrapper() {
425
- if (!_promise)
426
- _promise = fn();
427
- return _promise;
428
- }
429
- wrapper.reset = async () => {
430
- const _prev = _promise;
431
- _promise = undefined;
432
- if (_prev)
433
- await _prev;
434
- };
435
- return wrapper;
436
- }
437
- function invoke(fn) {
438
- return fn();
439
- }
440
- function containsProp(obj, ...props) {
441
- return props.some(k => k in obj);
442
- }
443
- function increaseWithUnit(target, delta) {
444
- var _a;
445
- if (typeof target === 'number')
446
- return target + delta;
447
- const value = ((_a = target.match(/^-?[0-9]+\.?[0-9]*/)) === null || _a === void 0 ? void 0 : _a[0]) || '';
448
- const unit = target.slice(value.length);
449
- const result = (parseFloat(value) + delta);
450
- if (Number.isNaN(result))
451
- return target;
452
- return result + unit;
453
- }
454
- /**
455
- * Create a new subset object by giving keys
456
- *
457
- * @category Object
458
- */
459
- function objectPick(obj, keys, omitUndefined = false) {
460
- return keys.reduce((n, k) => {
461
- if (k in obj)
462
- if (!omitUndefined || !obj[k] === undefined)
463
- n[k] = obj[k];
464
- return n;
465
- }, {});
347
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
348
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
349
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
350
+ var __objRest$5 = (source, exclude) => {
351
+ var target = {};
352
+ for (var prop in source)
353
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
354
+ target[prop] = source[prop];
355
+ if (source != null && __getOwnPropSymbols$8)
356
+ for (var prop of __getOwnPropSymbols$8(source)) {
357
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
358
+ target[prop] = source[prop];
359
+ }
360
+ return target;
361
+ };
362
+ function watchWithFilter(source, cb, options = {}) {
363
+ const _a = options, {
364
+ eventFilter = bypassFilter
365
+ } = _a, watchOptions = __objRest$5(_a, [
366
+ "eventFilter"
367
+ ]);
368
+ return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
466
369
  }
467
370
 
468
- // implementation
469
- function watchWithFilter(source, cb, options = {}) {
470
- const { eventFilter = bypassFilter } = options, watchOptions = __rest(options, ["eventFilter"]);
471
- return watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
371
+ var __defProp$6 = Object.defineProperty;
372
+ var __defProps$3 = Object.defineProperties;
373
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
374
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
375
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
376
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
377
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
378
+ var __spreadValues$6 = (a, b) => {
379
+ for (var prop in b || (b = {}))
380
+ if (__hasOwnProp$7.call(b, prop))
381
+ __defNormalProp$6(a, prop, b[prop]);
382
+ if (__getOwnPropSymbols$7)
383
+ for (var prop of __getOwnPropSymbols$7(b)) {
384
+ if (__propIsEnum$7.call(b, prop))
385
+ __defNormalProp$6(a, prop, b[prop]);
386
+ }
387
+ return a;
388
+ };
389
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
390
+ var __objRest$4 = (source, exclude) => {
391
+ var target = {};
392
+ for (var prop in source)
393
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
394
+ target[prop] = source[prop];
395
+ if (source != null && __getOwnPropSymbols$7)
396
+ for (var prop of __getOwnPropSymbols$7(source)) {
397
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
398
+ target[prop] = source[prop];
399
+ }
400
+ return target;
401
+ };
402
+ function debouncedWatch(source, cb, options = {}) {
403
+ const _a = options, {
404
+ debounce = 0
405
+ } = _a, watchOptions = __objRest$4(_a, [
406
+ "debounce"
407
+ ]);
408
+ return watchWithFilter(source, cb, __spreadProps$3(__spreadValues$6({}, watchOptions), {
409
+ eventFilter: debounceFilter(debounce)
410
+ }));
472
411
  }
473
412
 
474
- // implementation
475
- function debouncedWatch(source, cb, options = {}) {
476
- const { debounce = 0 } = options, watchOptions = __rest(options, ["debounce"]);
477
- return watchWithFilter(source, cb, Object.assign(Object.assign({}, watchOptions), { eventFilter: debounceFilter(debounce) }));
413
+ function eagerComputed(fn) {
414
+ const result = shallowRef();
415
+ watchSyncEffect(() => {
416
+ result.value = fn();
417
+ });
418
+ return readonly(result);
478
419
  }
479
420
 
480
- // ported from https://dev.to/linusborg/vue-when-a-computed-property-can-be-the-wrong-tool-195j
481
- function eagerComputed(fn) {
482
- const result = shallowRef();
483
- watchSyncEffect(() => {
484
- result.value = fn();
485
- });
486
- return readonly(result);
421
+ function get(obj, key) {
422
+ if (key == null)
423
+ return unref(obj);
424
+ return unref(obj)[key];
487
425
  }
488
426
 
489
- function get(obj, key) {
490
- if (key == null)
491
- return unref(obj);
492
- return unref(obj)[key];
427
+ var __defProp$5 = Object.defineProperty;
428
+ var __defProps$2 = Object.defineProperties;
429
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
430
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
431
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
432
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
433
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
434
+ var __spreadValues$5 = (a, b) => {
435
+ for (var prop in b || (b = {}))
436
+ if (__hasOwnProp$6.call(b, prop))
437
+ __defNormalProp$5(a, prop, b[prop]);
438
+ if (__getOwnPropSymbols$6)
439
+ for (var prop of __getOwnPropSymbols$6(b)) {
440
+ if (__propIsEnum$6.call(b, prop))
441
+ __defNormalProp$5(a, prop, b[prop]);
442
+ }
443
+ return a;
444
+ };
445
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
446
+ var __objRest$3 = (source, exclude) => {
447
+ var target = {};
448
+ for (var prop in source)
449
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
450
+ target[prop] = source[prop];
451
+ if (source != null && __getOwnPropSymbols$6)
452
+ for (var prop of __getOwnPropSymbols$6(source)) {
453
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
454
+ target[prop] = source[prop];
455
+ }
456
+ return target;
457
+ };
458
+ function ignorableWatch(source, cb, options = {}) {
459
+ const _a = options, {
460
+ eventFilter = bypassFilter
461
+ } = _a, watchOptions = __objRest$3(_a, [
462
+ "eventFilter"
463
+ ]);
464
+ const filteredCb = createFilterWrapper(eventFilter, cb);
465
+ let ignoreUpdates;
466
+ let ignorePrevAsyncUpdates;
467
+ let stop;
468
+ if (watchOptions.flush === "sync") {
469
+ const ignore = ref(false);
470
+ ignorePrevAsyncUpdates = () => {
471
+ };
472
+ ignoreUpdates = (updater) => {
473
+ ignore.value = true;
474
+ updater();
475
+ ignore.value = false;
476
+ };
477
+ stop = watch(source, (...args) => {
478
+ if (!ignore.value)
479
+ filteredCb(...args);
480
+ }, watchOptions);
481
+ } else {
482
+ const disposables = [];
483
+ const ignoreCounter = ref(0);
484
+ const syncCounter = ref(0);
485
+ ignorePrevAsyncUpdates = () => {
486
+ ignoreCounter.value = syncCounter.value;
487
+ };
488
+ disposables.push(watch(source, () => {
489
+ syncCounter.value++;
490
+ }, __spreadProps$2(__spreadValues$5({}, watchOptions), { flush: "sync" })));
491
+ ignoreUpdates = (updater) => {
492
+ const syncCounterPrev = syncCounter.value;
493
+ updater();
494
+ ignoreCounter.value += syncCounter.value - syncCounterPrev;
495
+ };
496
+ disposables.push(watch(source, (...args) => {
497
+ const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;
498
+ ignoreCounter.value = 0;
499
+ syncCounter.value = 0;
500
+ if (ignore)
501
+ return;
502
+ filteredCb(...args);
503
+ }, watchOptions));
504
+ stop = () => {
505
+ disposables.forEach((fn) => fn());
506
+ };
507
+ }
508
+ return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
509
+ }
510
+
511
+ var __defProp$4 = Object.defineProperty;
512
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
513
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
514
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
515
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
516
+ var __spreadValues$4 = (a, b) => {
517
+ for (var prop in b || (b = {}))
518
+ if (__hasOwnProp$5.call(b, prop))
519
+ __defNormalProp$4(a, prop, b[prop]);
520
+ if (__getOwnPropSymbols$5)
521
+ for (var prop of __getOwnPropSymbols$5(b)) {
522
+ if (__propIsEnum$5.call(b, prop))
523
+ __defNormalProp$4(a, prop, b[prop]);
524
+ }
525
+ return a;
526
+ };
527
+ function makeDestructurable(obj, arr) {
528
+ if (typeof Symbol !== "undefined") {
529
+ const clone = __spreadValues$4({}, obj);
530
+ Object.defineProperty(clone, Symbol.iterator, {
531
+ enumerable: false,
532
+ value() {
533
+ let index = 0;
534
+ return {
535
+ next: () => ({
536
+ value: arr[index++],
537
+ done: index > arr.length
538
+ })
539
+ };
540
+ }
541
+ });
542
+ return clone;
543
+ } else {
544
+ return Object.assign([...arr], obj);
545
+ }
493
546
  }
494
547
 
495
- function ignorableWatch(source, cb, options = {}) {
496
- const { eventFilter = bypassFilter } = options, watchOptions = __rest(options, ["eventFilter"]);
497
- const filteredCb = createFilterWrapper(eventFilter, cb);
498
- let ignoreUpdates;
499
- let ignorePrevAsyncUpdates;
500
- let stop;
501
- if (watchOptions.flush === 'sync') {
502
- const ignore = ref(false);
503
- // no op for flush: sync
504
- ignorePrevAsyncUpdates = () => { };
505
- ignoreUpdates = (updater) => {
506
- // Call the updater function and count how many sync updates are performed,
507
- // then add them to the ignore count
508
- ignore.value = true;
509
- updater();
510
- ignore.value = false;
511
- };
512
- stop = watch(source, (...args) => {
513
- if (!ignore.value)
514
- filteredCb(...args);
515
- }, watchOptions);
516
- }
517
- else {
518
- // flush 'pre' and 'post'
519
- const disposables = [];
520
- // counters for how many following changes to be ignored
521
- // ignoreCounter is incremented before there is a history operation
522
- // affecting the source ref value (undo, redo, revert).
523
- // syncCounter is incremented in sync with every change to the
524
- // source ref value. This let us know how many times the ref
525
- // was modified and support chained sync operations. If there
526
- // are more sync triggers than the ignore count, the we now
527
- // there are modifications in the source ref value that we
528
- // need to commit
529
- const ignoreCounter = ref(0);
530
- const syncCounter = ref(0);
531
- ignorePrevAsyncUpdates = () => {
532
- ignoreCounter.value = syncCounter.value;
533
- };
534
- // Sync watch to count modifications to the source
535
- disposables.push(watch(source, () => {
536
- syncCounter.value++;
537
- }, Object.assign(Object.assign({}, watchOptions), { flush: 'sync' })));
538
- ignoreUpdates = (updater) => {
539
- // Call the updater function and count how many sync updates are performed,
540
- // then add them to the ignore count
541
- const syncCounterPrev = syncCounter.value;
542
- updater();
543
- ignoreCounter.value += syncCounter.value - syncCounterPrev;
544
- };
545
- disposables.push(watch(source, (...args) => {
546
- // If a history operation was performed (ignoreCounter > 0) and there are
547
- // no other changes to the source ref value afterwards, then ignore this commit
548
- const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;
549
- ignoreCounter.value = 0;
550
- syncCounter.value = 0;
551
- if (ignore)
552
- return;
553
- filteredCb(...args);
554
- }, watchOptions));
555
- stop = () => {
556
- disposables.forEach(fn => fn());
557
- };
558
- }
559
- return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
548
+ function not(v) {
549
+ return computed(() => !unref(v));
560
550
  }
561
551
 
562
- function makeDestructurable(obj, arr) {
563
- if (typeof Symbol !== 'undefined') {
564
- const clone = Object.assign({}, obj);
565
- Object.defineProperty(clone, Symbol.iterator, {
566
- enumerable: false,
567
- value() {
568
- let index = 0;
569
- return {
570
- next: () => ({
571
- value: arr[index++],
572
- done: index > arr.length,
573
- }),
574
- };
575
- },
576
- });
577
- return clone;
578
- }
579
- else {
580
- return Object.assign([...arr], obj);
581
- }
552
+ function or(...args) {
553
+ return computed(() => args.some((i) => unref(i)));
582
554
  }
583
555
 
584
- /**
585
- * `NOT` conditions for refs.
586
- *
587
- * @see https://vueuse.org/not
588
- */
589
- function not(v) {
590
- return computed(() => !unref(v));
556
+ var __defProp$3 = Object.defineProperty;
557
+ var __defProps$1 = Object.defineProperties;
558
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
559
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
560
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
561
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
562
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
563
+ var __spreadValues$3 = (a, b) => {
564
+ for (var prop in b || (b = {}))
565
+ if (__hasOwnProp$4.call(b, prop))
566
+ __defNormalProp$3(a, prop, b[prop]);
567
+ if (__getOwnPropSymbols$4)
568
+ for (var prop of __getOwnPropSymbols$4(b)) {
569
+ if (__propIsEnum$4.call(b, prop))
570
+ __defNormalProp$3(a, prop, b[prop]);
571
+ }
572
+ return a;
573
+ };
574
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
575
+ var __objRest$2 = (source, exclude) => {
576
+ var target = {};
577
+ for (var prop in source)
578
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
579
+ target[prop] = source[prop];
580
+ if (source != null && __getOwnPropSymbols$4)
581
+ for (var prop of __getOwnPropSymbols$4(source)) {
582
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
583
+ target[prop] = source[prop];
584
+ }
585
+ return target;
586
+ };
587
+ function pausableWatch(source, cb, options = {}) {
588
+ const _a = options, {
589
+ eventFilter: filter
590
+ } = _a, watchOptions = __objRest$2(_a, [
591
+ "eventFilter"
592
+ ]);
593
+ const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
594
+ const stop = watchWithFilter(source, cb, __spreadProps$1(__spreadValues$3({}, watchOptions), {
595
+ eventFilter
596
+ }));
597
+ return { stop, pause, resume, isActive };
591
598
  }
592
599
 
593
- /**
594
- * `OR` conditions for refs.
595
- *
596
- * @see https://vueuse.org/or
597
- */
598
- function or(...args) {
599
- return computed(() => args.some(i => unref(i)));
600
+ function reactify(fn) {
601
+ return function(...args) {
602
+ return computed(() => fn.apply(this, args.map((i) => unref(i))));
603
+ };
600
604
  }
601
605
 
602
- // implementation
603
- function pausableWatch(source, cb, options = {}) {
604
- const { eventFilter: filter } = options, watchOptions = __rest(options, ["eventFilter"]);
605
- const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
606
- const stop = watchWithFilter(source, cb, Object.assign(Object.assign({}, watchOptions), { eventFilter }));
607
- return { stop, pause, resume, isActive };
606
+ function reactifyObject(obj, optionsOrKeys = {}) {
607
+ let keys = [];
608
+ if (Array.isArray(optionsOrKeys)) {
609
+ keys = optionsOrKeys;
610
+ } else {
611
+ const { includeOwnProperties = true } = optionsOrKeys;
612
+ keys.push(...Object.keys(obj));
613
+ if (includeOwnProperties)
614
+ keys.push(...Object.getOwnPropertyNames(obj));
615
+ }
616
+ return Object.fromEntries(keys.map((key) => {
617
+ const value = obj[key];
618
+ return [
619
+ key,
620
+ typeof value === "function" ? reactify(value.bind(obj)) : value
621
+ ];
622
+ }));
608
623
  }
609
624
 
610
- /**
611
- * Converts plain function into a reactive function.
612
- * The converted function accepts refs as it's arguments
613
- * and returns a ComputedRef, with proper typing.
614
- *
615
- * @param fn - Source function
616
- */
617
- function reactify(fn) {
618
- return function (...args) {
619
- return computed(() => fn.apply(this, args.map(i => unref(i))));
620
- };
625
+ function reactivePick(obj, ...keys) {
626
+ return reactive(Object.fromEntries(keys.map((k) => [k, toRef(obj, k)])));
621
627
  }
622
628
 
623
- function reactifyObject(obj, optionsOrKeys = {}) {
624
- let keys = [];
625
- if (Array.isArray(optionsOrKeys)) {
626
- keys = optionsOrKeys;
627
- }
628
- else {
629
- const { includeOwnProperties = true } = optionsOrKeys;
630
- keys.push(...Object.keys(obj));
631
- if (includeOwnProperties)
632
- keys.push(...Object.getOwnPropertyNames(obj));
633
- }
634
- return Object.fromEntries(keys
635
- .map((key) => {
636
- const value = obj[key];
637
- return [
638
- key,
639
- typeof value === 'function'
640
- ? reactify(value.bind(obj))
641
- : value,
642
- ];
643
- }));
629
+ function set(...args) {
630
+ if (args.length === 2) {
631
+ const [ref, value] = args;
632
+ ref.value = value;
633
+ }
634
+ if (args.length === 3) {
635
+ if (isVue2) {
636
+ require("vue-demi").set(...args);
637
+ } else {
638
+ const [target, key, value] = args;
639
+ target[key] = value;
640
+ }
641
+ }
644
642
  }
645
643
 
646
- /**
647
- * Reactively pick fields from a reactive object
648
- *
649
- * @see https://vueuse.js.org/reactivePick
650
- */
651
- function reactivePick(obj, ...keys) {
652
- return reactive(Object.fromEntries(keys.map(k => [k, toRef(obj, k)])));
644
+ function syncRef(source, targets, {
645
+ flush = "sync",
646
+ deep = false,
647
+ immediate = true
648
+ } = {}) {
649
+ if (!Array.isArray(targets))
650
+ targets = [targets];
651
+ return watch(source, (newValue) => {
652
+ targets.forEach((target) => target.value = newValue);
653
+ }, {
654
+ flush,
655
+ deep,
656
+ immediate
657
+ });
653
658
  }
654
659
 
655
- /**
656
- * Shorthand for `ref.value = x`
657
- */
658
- function set(...args) {
659
- if (args.length === 2) {
660
- const [ref, value] = args;
661
- ref.value = value;
662
- }
663
- if (args.length === 3) {
664
- if (isVue2) {
665
- // use @vue/composition-api's set API
666
- // eslint-disable-next-line @typescript-eslint/no-var-requires
667
- require('vue-demi').set(...args);
668
- }
669
- else {
670
- const [target, key, value] = args;
671
- target[key] = value;
672
- }
673
- }
660
+ var __defProp$2 = Object.defineProperty;
661
+ var __defProps = Object.defineProperties;
662
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
663
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
664
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
665
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
666
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
667
+ var __spreadValues$2 = (a, b) => {
668
+ for (var prop in b || (b = {}))
669
+ if (__hasOwnProp$3.call(b, prop))
670
+ __defNormalProp$2(a, prop, b[prop]);
671
+ if (__getOwnPropSymbols$3)
672
+ for (var prop of __getOwnPropSymbols$3(b)) {
673
+ if (__propIsEnum$3.call(b, prop))
674
+ __defNormalProp$2(a, prop, b[prop]);
675
+ }
676
+ return a;
677
+ };
678
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
679
+ var __objRest$1 = (source, exclude) => {
680
+ var target = {};
681
+ for (var prop in source)
682
+ if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
683
+ target[prop] = source[prop];
684
+ if (source != null && __getOwnPropSymbols$3)
685
+ for (var prop of __getOwnPropSymbols$3(source)) {
686
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
687
+ target[prop] = source[prop];
688
+ }
689
+ return target;
690
+ };
691
+ function throttledWatch(source, cb, options = {}) {
692
+ const _a = options, {
693
+ throttle = 0,
694
+ trailing = true
695
+ } = _a, watchOptions = __objRest$1(_a, [
696
+ "throttle",
697
+ "trailing"
698
+ ]);
699
+ return watchWithFilter(source, cb, __spreadProps(__spreadValues$2({}, watchOptions), {
700
+ eventFilter: throttleFilter(throttle, trailing)
701
+ }));
674
702
  }
675
703
 
676
- /**
677
- * Keep target ref(s) in sync with the source ref
678
- *
679
- * @param source source ref
680
- * @param targets
681
- */
682
- function syncRef(source, targets, { flush = 'sync', deep = false, immediate = true, } = {}) {
683
- if (!Array.isArray(targets))
684
- targets = [targets];
685
- return watch(source, (newValue) => {
686
- targets.forEach(target => target.value = newValue);
687
- }, {
688
- flush,
689
- deep,
690
- immediate,
691
- });
704
+ function toReactive(objectRef) {
705
+ if (!isRef(objectRef))
706
+ return reactive(objectRef);
707
+ const proxy = new Proxy({}, {
708
+ get(_, p, receiver) {
709
+ return Reflect.get(objectRef.value, p, receiver);
710
+ },
711
+ set(_, p, value) {
712
+ objectRef.value[p] = value;
713
+ return true;
714
+ },
715
+ deleteProperty(_, p) {
716
+ return Reflect.deleteProperty(objectRef.value, p);
717
+ },
718
+ has(_, p) {
719
+ return Reflect.has(objectRef.value, p);
720
+ },
721
+ ownKeys() {
722
+ return Object.keys(objectRef.value);
723
+ },
724
+ getOwnPropertyDescriptor() {
725
+ return {
726
+ enumerable: true,
727
+ configurable: true
728
+ };
729
+ }
730
+ });
731
+ return reactive(proxy);
692
732
  }
693
733
 
694
- // implementation
695
- function throttledWatch(source, cb, options = {}) {
696
- const { throttle = 0 } = options, watchOptions = __rest(options, ["throttle"]);
697
- return watchWithFilter(source, cb, Object.assign(Object.assign({}, watchOptions), { eventFilter: throttleFilter(throttle) }));
734
+ function toRefs(objectRef) {
735
+ if (!isRef(objectRef))
736
+ return toRefs$1(objectRef);
737
+ const result = Array.isArray(objectRef.value) ? new Array(objectRef.value.length) : {};
738
+ for (const key in objectRef.value) {
739
+ result[key] = customRef(() => ({
740
+ get() {
741
+ return objectRef.value[key];
742
+ },
743
+ set(v) {
744
+ objectRef.value[key] = v;
745
+ }
746
+ }));
747
+ }
748
+ return result;
698
749
  }
699
750
 
700
- /**
701
- * Converts ref to reactive.
702
- *
703
- * @see https://vueuse.org/toReactive
704
- * @param objectRef A ref of object
705
- */
706
- function toReactive(objectRef) {
707
- if (!isRef(objectRef))
708
- return reactive(objectRef);
709
- const proxy = new Proxy({}, {
710
- get(_, p, receiver) {
711
- return Reflect.get(objectRef.value, p, receiver);
712
- },
713
- set(_, p, value) {
714
- objectRef.value[p] = value;
715
- return true;
716
- },
717
- deleteProperty(_, p) {
718
- return Reflect.deleteProperty(objectRef.value, p);
719
- },
720
- has(_, p) {
721
- return Reflect.has(objectRef.value, p);
722
- },
723
- ownKeys() {
724
- return Object.keys(objectRef.value);
725
- },
726
- getOwnPropertyDescriptor() {
727
- return {
728
- enumerable: true,
729
- configurable: true,
730
- };
731
- },
732
- });
733
- return reactive(proxy);
751
+ function tryOnBeforeUnmount(fn) {
752
+ if (getCurrentInstance())
753
+ onBeforeUnmount(fn);
734
754
  }
735
755
 
736
- /**
737
- * Extended `toRefs` that also accepts refs of an object.
738
- *
739
- * @see https://vueuse.org/toRefs
740
- * @param objectRef A ref or normal object or array.
741
- */
742
- function toRefs(objectRef) {
743
- if (!isRef(objectRef))
744
- return toRefs$1(objectRef);
745
- const result = Array.isArray(objectRef.value)
746
- ? new Array(objectRef.value.length)
747
- : {};
748
- // eslint-disable-next-line no-restricted-syntax
749
- for (const key in objectRef.value) {
750
- result[key] = customRef(() => ({
751
- get() {
752
- return objectRef.value[key];
753
- },
754
- set(v) {
755
- objectRef.value[key] = v;
756
- },
757
- }));
758
- }
759
- return result;
756
+ function tryOnMounted(fn, sync = true) {
757
+ if (getCurrentInstance())
758
+ onMounted(fn);
759
+ else if (sync)
760
+ fn();
761
+ else
762
+ nextTick(fn);
760
763
  }
761
764
 
762
- /**
763
- * Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
764
- *
765
- * @param fn
766
- */
767
- function tryOnBeforeUnmount(fn) {
768
- if (getCurrentInstance())
769
- onBeforeUnmount(fn);
765
+ function tryOnUnmounted(fn) {
766
+ if (getCurrentInstance())
767
+ onUnmounted(fn);
770
768
  }
771
769
 
772
- /**
773
- * Call onMounted() if it's inside a component lifecycle, if not, run just call the function
774
- *
775
- * @param fn
776
- * @param sync if set to false, it will run in the nextTick() of Vue
777
- */
778
- function tryOnMounted(fn, sync = true) {
779
- if (getCurrentInstance())
780
- onMounted(fn);
781
- else if (sync)
782
- fn();
783
- else
784
- nextTick(fn);
770
+ function until(r) {
771
+ let isNot = false;
772
+ function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
773
+ let stop = null;
774
+ const watcher = new Promise((resolve) => {
775
+ stop = watch(r, (v) => {
776
+ if (condition(v) === !isNot) {
777
+ stop == null ? void 0 : stop();
778
+ resolve();
779
+ }
780
+ }, {
781
+ flush,
782
+ deep,
783
+ immediate: true
784
+ });
785
+ });
786
+ const promises = [watcher];
787
+ if (timeout) {
788
+ promises.push(promiseTimeout(timeout, throwOnTimeout).finally(() => {
789
+ stop == null ? void 0 : stop();
790
+ }));
791
+ }
792
+ return Promise.race(promises);
793
+ }
794
+ function toBe(value, options) {
795
+ return toMatch((v) => v === unref(value), options);
796
+ }
797
+ function toBeTruthy(options) {
798
+ return toMatch((v) => Boolean(v), options);
799
+ }
800
+ function toBeNull(options) {
801
+ return toBe(null, options);
802
+ }
803
+ function toBeUndefined(options) {
804
+ return toBe(void 0, options);
805
+ }
806
+ function toBeNaN(options) {
807
+ return toMatch(Number.isNaN, options);
808
+ }
809
+ function toContains(value, options) {
810
+ return toMatch((v) => {
811
+ const array = Array.from(v);
812
+ return array.includes(value) || array.includes(unref(value));
813
+ }, options);
814
+ }
815
+ function changed(options) {
816
+ return changedTimes(1, options);
817
+ }
818
+ function changedTimes(n = 1, options) {
819
+ let count = -1;
820
+ return toMatch(() => {
821
+ count += 1;
822
+ return count >= n;
823
+ }, options);
824
+ }
825
+ if (Array.isArray(unref(r))) {
826
+ const instance = {
827
+ toMatch,
828
+ toContains,
829
+ changed,
830
+ changedTimes,
831
+ get not() {
832
+ isNot = !isNot;
833
+ return this;
834
+ }
835
+ };
836
+ return instance;
837
+ } else {
838
+ const instance = {
839
+ toMatch,
840
+ toBe,
841
+ toBeTruthy,
842
+ toBeNull,
843
+ toBeNaN,
844
+ toBeUndefined,
845
+ changed,
846
+ changedTimes,
847
+ get not() {
848
+ isNot = !isNot;
849
+ return this;
850
+ }
851
+ };
852
+ return instance;
853
+ }
785
854
  }
786
855
 
787
- /**
788
- * Call onUnmounted() if it's inside a component lifecycle, if not, do nothing
789
- *
790
- * @param fn
791
- */
792
- function tryOnUnmounted(fn) {
793
- if (getCurrentInstance())
794
- onUnmounted(fn);
856
+ function useCounter(initialValue = 0) {
857
+ const count = ref(initialValue);
858
+ const inc = (delta = 1) => count.value += delta;
859
+ const dec = (delta = 1) => count.value -= delta;
860
+ const get = () => count.value;
861
+ const set = (val) => count.value = val;
862
+ const reset = (val = initialValue) => {
863
+ initialValue = val;
864
+ return set(val);
865
+ };
866
+ return { count, inc, dec, get, set, reset };
795
867
  }
796
868
 
797
- function until(r) {
798
- let isNot = false;
799
- function toMatch(condition, { flush = 'sync', deep = false, timeout, throwOnTimeout } = {}) {
800
- let stop = null;
801
- const watcher = new Promise((resolve) => {
802
- stop = watch(r, (v) => {
803
- if (condition(v) === !isNot) {
804
- stop === null || stop === void 0 ? void 0 : stop();
805
- resolve();
806
- }
807
- }, {
808
- flush,
809
- deep,
810
- immediate: true,
811
- });
812
- });
813
- const promises = [watcher];
814
- if (timeout) {
815
- promises.push(promiseTimeout(timeout, throwOnTimeout).finally(() => {
816
- stop === null || stop === void 0 ? void 0 : stop();
817
- }));
818
- }
819
- return Promise.race(promises);
820
- }
821
- function toBe(value, options) {
822
- return toMatch(v => v === unref(value), options);
823
- }
824
- function toBeTruthy(options) {
825
- return toMatch(v => Boolean(v), options);
826
- }
827
- function toBeNull(options) {
828
- return toBe(null, options);
829
- }
830
- function toBeUndefined(options) {
831
- return toBe(undefined, options);
832
- }
833
- function toBeNaN(options) {
834
- return toMatch(Number.isNaN, options);
835
- }
836
- function toContains(value, options) {
837
- return toMatch((v) => {
838
- const array = Array.from(v);
839
- return array.includes(value) || array.includes(unref(value));
840
- }, options);
841
- }
842
- function changed(options) {
843
- return changedTimes(1, options);
844
- }
845
- function changedTimes(n = 1, options) {
846
- let count = -1; // skip the immediate check
847
- return toMatch(() => {
848
- count += 1;
849
- return count >= n;
850
- }, options);
851
- }
852
- if (Array.isArray(unref(r))) {
853
- const instance = {
854
- toMatch,
855
- toContains,
856
- changed,
857
- changedTimes,
858
- get not() {
859
- isNot = !isNot;
860
- return this;
861
- },
862
- };
863
- return instance;
864
- }
865
- else {
866
- const instance = {
867
- toMatch,
868
- toBe,
869
- toBeTruthy,
870
- toBeNull,
871
- toBeNaN,
872
- toBeUndefined,
873
- changed,
874
- changedTimes,
875
- get not() {
876
- isNot = !isNot;
877
- return this;
878
- },
879
- };
880
- return instance;
881
- }
869
+ function useDebounceFn(fn, ms = 200) {
870
+ return createFilterWrapper(debounceFilter(ms), fn);
882
871
  }
883
872
 
884
- /**
885
- * Basic counter with utility functions.
886
- *
887
- * @see https://vueuse.org/useCounter
888
- * @param [initialValue=0]
889
- */
890
- function useCounter(initialValue = 0) {
891
- const count = ref(initialValue);
892
- const inc = (delta = 1) => (count.value += delta);
893
- const dec = (delta = 1) => (count.value -= delta);
894
- const get = () => count.value;
895
- const set = (val) => (count.value = val);
896
- const reset = (val = initialValue) => {
897
- initialValue = val;
898
- return set(val);
899
- };
900
- return { count, inc, dec, get, set, reset };
873
+ function useDebounce(value, ms = 200) {
874
+ if (ms <= 0)
875
+ return value;
876
+ const debounced = ref(value.value);
877
+ const updater = useDebounceFn(() => {
878
+ debounced.value = value.value;
879
+ }, ms);
880
+ watch(value, () => updater());
881
+ return debounced;
901
882
  }
902
883
 
903
- /**
904
- * Debounce execution of a function.
905
- *
906
- * @param fn A function to be executed after delay milliseconds debounced.
907
- * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
908
- *
909
- * @return A new, debounce, function.
910
- */
911
- function useDebounceFn(fn, ms = 200) {
912
- return createFilterWrapper(debounceFilter(ms), fn);
884
+ function useIntervalFn(cb, interval = 1e3, options = {}) {
885
+ const {
886
+ immediate = true,
887
+ immediateCallback = false
888
+ } = options;
889
+ let timer = null;
890
+ const isActive = ref(false);
891
+ function clean() {
892
+ if (timer) {
893
+ clearInterval(timer);
894
+ timer = null;
895
+ }
896
+ }
897
+ function pause() {
898
+ isActive.value = false;
899
+ clean();
900
+ }
901
+ function resume() {
902
+ if (interval <= 0)
903
+ return;
904
+ isActive.value = true;
905
+ if (immediateCallback)
906
+ cb();
907
+ clean();
908
+ timer = setInterval(cb, interval);
909
+ }
910
+ if (immediate && isClient)
911
+ resume();
912
+ tryOnScopeDispose(pause);
913
+ return {
914
+ isActive,
915
+ pause,
916
+ resume
917
+ };
913
918
  }
914
919
 
915
- function useDebounce(value, ms = 200) {
916
- if (ms <= 0)
917
- return value;
918
- const debounced = ref(value.value);
919
- const updater = useDebounceFn(() => {
920
- debounced.value = value.value;
921
- }, ms);
922
- watch(value, () => updater());
923
- return debounced;
920
+ var __defProp$1 = Object.defineProperty;
921
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
922
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
923
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
924
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
925
+ var __spreadValues$1 = (a, b) => {
926
+ for (var prop in b || (b = {}))
927
+ if (__hasOwnProp$2.call(b, prop))
928
+ __defNormalProp$1(a, prop, b[prop]);
929
+ if (__getOwnPropSymbols$2)
930
+ for (var prop of __getOwnPropSymbols$2(b)) {
931
+ if (__propIsEnum$2.call(b, prop))
932
+ __defNormalProp$1(a, prop, b[prop]);
933
+ }
934
+ return a;
935
+ };
936
+ function useInterval(interval = 1e3, options = {}) {
937
+ const {
938
+ controls: exposeControls = false,
939
+ immediate = true
940
+ } = options;
941
+ const counter = ref(0);
942
+ const controls = useIntervalFn(() => counter.value += 1, interval, { immediate });
943
+ if (exposeControls) {
944
+ return __spreadValues$1({
945
+ counter
946
+ }, controls);
947
+ } else {
948
+ return counter;
949
+ }
924
950
  }
925
951
 
926
- /**
927
- * Wrapper for `setInterval` with controls
928
- *
929
- * @param cb
930
- * @param interval
931
- * @param options
932
- */
933
- function useIntervalFn(cb, interval = 1000, options = {}) {
934
- const { immediate = true, immediateCallback = false, } = options;
935
- let timer = null;
936
- const isActive = ref(false);
937
- function clean() {
938
- if (timer) {
939
- clearInterval(timer);
940
- timer = null;
941
- }
942
- }
943
- function pause() {
944
- isActive.value = false;
945
- clean();
946
- }
947
- function resume() {
948
- if (interval <= 0)
949
- return;
950
- isActive.value = true;
951
- if (immediateCallback)
952
- cb();
953
- clean();
954
- timer = setInterval(cb, interval);
955
- }
956
- if (immediate && isClient)
957
- resume();
958
- tryOnScopeDispose(pause);
959
- return {
960
- isActive,
961
- pause,
962
- resume,
963
- };
952
+ function useLastChanged(source, options = {}) {
953
+ var _a;
954
+ const ms = ref((_a = options.initialValue) != null ? _a : null);
955
+ watch(source, () => ms.value = timestamp(), options);
956
+ return ms;
964
957
  }
965
958
 
966
- function useInterval(interval = 1000, options = {}) {
967
- const { controls: exposeControls = false, immediate = true, } = options;
968
- const counter = ref(0);
969
- const controls = useIntervalFn(() => counter.value += 1, interval, { immediate });
970
- if (exposeControls) {
971
- return Object.assign({ counter }, controls);
972
- }
973
- else {
974
- return counter;
975
- }
959
+ function useThrottleFn(fn, ms = 200, trailing = true, leading = true) {
960
+ return createFilterWrapper(throttleFilter(ms, trailing, leading), fn);
976
961
  }
977
962
 
978
- function useLastChanged(source, options = {}) {
979
- var _a;
980
- const ms = ref((_a = options.initialValue) !== null && _a !== void 0 ? _a : null);
981
- watch(source, () => ms.value = timestamp(), options);
982
- return ms;
963
+ function useThrottle(value, delay = 200, trailing = true, leading = true) {
964
+ if (delay <= 0)
965
+ return value;
966
+ const throttled = ref(value.value);
967
+ const updater = useThrottleFn(() => {
968
+ throttled.value = value.value;
969
+ }, delay, trailing, leading);
970
+ watch(value, () => updater());
971
+ return throttled;
983
972
  }
984
973
 
985
- /**
986
- * Throttle execution of a function. Especially useful for rate limiting
987
- * execution of handlers on events like resize and scroll.
988
- *
989
- * @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
990
- * to `callback` when the throttled-function is executed.
991
- * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
992
- *
993
- * @return A new, throttled, function.
994
- */
995
- function useThrottleFn(fn, ms = 200, trailing = true) {
996
- return createFilterWrapper(throttleFilter(ms, trailing), fn);
974
+ function useTimeoutFn(cb, interval, options = {}) {
975
+ const {
976
+ immediate = true
977
+ } = options;
978
+ const isPending = ref(false);
979
+ let timer = null;
980
+ function clear() {
981
+ if (timer) {
982
+ clearTimeout(timer);
983
+ timer = null;
984
+ }
985
+ }
986
+ function stop() {
987
+ isPending.value = false;
988
+ clear();
989
+ }
990
+ function start(...args) {
991
+ clear();
992
+ isPending.value = true;
993
+ timer = setTimeout(() => {
994
+ isPending.value = false;
995
+ timer = null;
996
+ cb(...args);
997
+ }, unref(interval));
998
+ }
999
+ if (immediate) {
1000
+ isPending.value = true;
1001
+ if (isClient)
1002
+ start();
1003
+ }
1004
+ tryOnScopeDispose(stop);
1005
+ return {
1006
+ isPending,
1007
+ start,
1008
+ stop
1009
+ };
997
1010
  }
998
1011
 
999
- /**
1000
- * Throttle execution of a function. Especially useful for rate limiting
1001
- * execution of handlers on events like resize and scroll.
1002
- *
1003
- * @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
1004
- */
1005
- function useThrottle(value, delay = 200) {
1006
- if (delay <= 0)
1007
- return value;
1008
- const throttled = ref(value.value);
1009
- const updater = useThrottleFn(() => {
1010
- throttled.value = value.value;
1011
- }, delay);
1012
- watch(value, () => updater());
1013
- return throttled;
1012
+ var __defProp = Object.defineProperty;
1013
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1014
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1015
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1016
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1017
+ var __spreadValues = (a, b) => {
1018
+ for (var prop in b || (b = {}))
1019
+ if (__hasOwnProp$1.call(b, prop))
1020
+ __defNormalProp(a, prop, b[prop]);
1021
+ if (__getOwnPropSymbols$1)
1022
+ for (var prop of __getOwnPropSymbols$1(b)) {
1023
+ if (__propIsEnum$1.call(b, prop))
1024
+ __defNormalProp(a, prop, b[prop]);
1025
+ }
1026
+ return a;
1027
+ };
1028
+ function useTimeout(interval = 1e3, options = {}) {
1029
+ const {
1030
+ controls: exposeControls = false
1031
+ } = options;
1032
+ const controls = useTimeoutFn(noop, interval, options);
1033
+ const ready = computed(() => !controls.isPending.value);
1034
+ if (exposeControls) {
1035
+ return __spreadValues({
1036
+ ready
1037
+ }, controls);
1038
+ } else {
1039
+ return ready;
1040
+ }
1014
1041
  }
1015
1042
 
1016
- /**
1017
- * Wrapper for `setTimeout` with controls.
1018
- *
1019
- * @param cb
1020
- * @param interval
1021
- * @param immediate
1022
- */
1023
- function useTimeoutFn(cb, interval, options = {}) {
1024
- const { immediate = true, } = options;
1025
- const isPending = ref(false);
1026
- let timer = null;
1027
- function clear() {
1028
- if (timer) {
1029
- clearTimeout(timer);
1030
- timer = null;
1031
- }
1032
- }
1033
- function stop() {
1034
- isPending.value = false;
1035
- clear();
1036
- }
1037
- function start(...args) {
1038
- clear();
1039
- isPending.value = true;
1040
- timer = setTimeout(() => {
1041
- isPending.value = false;
1042
- timer = null;
1043
- // eslint-disable-next-line node/no-callback-literal
1044
- cb(...args);
1045
- }, unref(interval));
1046
- }
1047
- if (immediate) {
1048
- isPending.value = true;
1049
- if (isClient)
1050
- start();
1051
- }
1052
- tryOnScopeDispose(stop);
1053
- return {
1054
- isPending,
1055
- start,
1056
- stop,
1057
- };
1043
+ function useToggle(initialValue = false) {
1044
+ if (isRef(initialValue)) {
1045
+ return (value) => {
1046
+ initialValue.value = typeof value === "boolean" ? value : !initialValue.value;
1047
+ };
1048
+ } else {
1049
+ const boolean = ref(initialValue);
1050
+ const toggle = (value) => {
1051
+ boolean.value = typeof value === "boolean" ? value : !boolean.value;
1052
+ };
1053
+ return [boolean, toggle];
1054
+ }
1058
1055
  }
1059
1056
 
1060
- function useTimeout(interval = 1000, options = {}) {
1061
- const { controls: exposeControls = false, } = options;
1062
- const controls = useTimeoutFn(noop, interval, options);
1063
- const ready = computed(() => !controls.isPending.value);
1064
- if (exposeControls) {
1065
- return Object.assign({ ready }, controls);
1066
- }
1067
- else {
1068
- return ready;
1069
- }
1057
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
1058
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
1059
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
1060
+ var __objRest = (source, exclude) => {
1061
+ var target = {};
1062
+ for (var prop in source)
1063
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
1064
+ target[prop] = source[prop];
1065
+ if (source != null && __getOwnPropSymbols)
1066
+ for (var prop of __getOwnPropSymbols(source)) {
1067
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
1068
+ target[prop] = source[prop];
1069
+ }
1070
+ return target;
1071
+ };
1072
+ function watchAtMost(source, cb, options) {
1073
+ const _a = options, {
1074
+ count
1075
+ } = _a, watchOptions = __objRest(_a, [
1076
+ "count"
1077
+ ]);
1078
+ const current = ref(0);
1079
+ const stop = watchWithFilter(source, (...args) => {
1080
+ current.value += 1;
1081
+ if (current.value >= unref(count))
1082
+ stop();
1083
+ cb(...args);
1084
+ }, watchOptions);
1085
+ return { count: current, stop };
1070
1086
  }
1071
1087
 
1072
- function useToggle(initialValue = false) {
1073
- if (isRef(initialValue)) {
1074
- return (value) => {
1075
- initialValue.value = typeof value === 'boolean'
1076
- ? value
1077
- : !initialValue.value;
1078
- };
1079
- }
1080
- else {
1081
- const boolean = ref(initialValue);
1082
- const toggle = (value) => {
1083
- boolean.value = typeof value === 'boolean'
1084
- ? value
1085
- : !boolean.value;
1086
- };
1087
- return [boolean, toggle];
1088
- }
1088
+ function watchOnce(source, cb, options) {
1089
+ const stop = watch(source, (...args) => {
1090
+ stop();
1091
+ return cb(...args);
1092
+ }, options);
1089
1093
  }
1090
1094
 
1091
- /**
1092
- * Shorthand for watching value to be truthy
1093
- *
1094
- * @see https://vueuse.js.org/whenever
1095
- */
1096
- function whenever(source, cb, options) {
1097
- return watch(source, (v, ov, onInvalidate) => { if (v)
1098
- cb(v, ov, onInvalidate); }, options);
1095
+ function whenever(source, cb, options) {
1096
+ return watch(source, (v, ov, onInvalidate) => {
1097
+ if (v)
1098
+ cb(v, ov, onInvalidate);
1099
+ }, options);
1099
1100
  }
1100
1101
 
1101
- export { and, assert, biSyncRef, bypassFilter, clamp, containsProp, controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createSharedComposable, createSingletonPromise, debounceFilter, debouncedWatch, eagerComputed, extendRef, get, identity, ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isFunction, isNumber, isObject, isString, isWindow, makeDestructurable, noop, not, now, objectPick, or, pausableFilter, pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactivePick, set, syncRef, throttleFilter, throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useCounter, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToggle, watchWithFilter, whenever };
1102
+ export { and, assert, biSyncRef, bypassFilter, clamp, containsProp, controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createSharedComposable, createSingletonPromise, debounceFilter, debouncedWatch, eagerComputed, extendRef, get, identity, ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isFunction, isNumber, isObject, isString, isWindow, makeDestructurable, noop, not, now, objectPick, or, pausableFilter, pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactivePick, set, syncRef, throttleFilter, throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useCounter, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToggle, watchAtMost, watchOnce, watchWithFilter, whenever };