@gct-paas/core-web 0.1.4-dev.2 → 0.1.4-dev.4

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.
Files changed (85) hide show
  1. package/dist/core-web.css +1 -1
  2. package/dist/index.min.cjs +12 -12
  3. package/dist/index.system.min.js +12 -12
  4. package/es/components/code-editor/code-editor.mjs +1 -2
  5. package/es/editor/gct-form-field-select/gct-model-select.vue +2 -2
  6. package/es/editor/index.mjs +2 -2
  7. package/package.json +5 -5
  8. package/es/_virtual/_commonjsHelpers.mjs +0 -44
  9. package/es/_virtual/node.mjs +0 -7
  10. package/es/_virtual/node2.mjs +0 -3
  11. package/es/node_modules/.pnpm/@aesoper_normal-utils@0.1.5/node_modules/@aesoper/normal-utils/NormalUtils.es.mjs +0 -3
  12. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.mjs +0 -142
  13. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/config/index.mjs +0 -7
  14. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/index.mjs +0 -1
  15. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/loader/index.mjs +0 -188
  16. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.mjs +0 -13
  17. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.mjs +0 -19
  18. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.mjs +0 -14
  19. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.mjs +0 -5
  20. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.mjs +0 -20
  21. package/es/node_modules/.pnpm/@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/validators/index.mjs +0 -49
  22. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/createPopper.mjs +0 -200
  23. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/contains.mjs +0 -26
  24. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.mjs +0 -44
  25. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.mjs +0 -72
  26. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.mjs +0 -60
  27. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.mjs +0 -7
  28. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.mjs +0 -9
  29. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.mjs +0 -32
  30. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.mjs +0 -8
  31. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.mjs +0 -28
  32. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeName.mjs +0 -5
  33. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.mjs +0 -14
  34. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.mjs +0 -71
  35. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getParentNode.mjs +0 -22
  36. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.mjs +0 -19
  37. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.mjs +0 -34
  38. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindow.mjs +0 -14
  39. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.mjs +0 -13
  40. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.mjs +0 -16
  41. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/instanceOf.mjs +0 -23
  42. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.mjs +0 -7
  43. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.mjs +0 -13
  44. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isTableElement.mjs +0 -7
  45. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.mjs +0 -29
  46. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/enums.mjs +0 -33
  47. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/index.mjs +0 -5
  48. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/applyStyles.mjs +0 -87
  49. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/arrow.mjs +0 -92
  50. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/computeStyles.mjs +0 -171
  51. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/eventListeners.mjs +0 -51
  52. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/flip.mjs +0 -149
  53. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/hide.mjs +0 -63
  54. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/index.mjs +0 -9
  55. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/offset.mjs +0 -56
  56. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/popperOffsets.mjs +0 -27
  57. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.mjs +0 -144
  58. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper-lite.mjs +0 -12
  59. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper.mjs +0 -19
  60. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.mjs +0 -46
  61. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeOffsets.mjs +0 -73
  62. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/debounce.mjs +0 -17
  63. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.mjs +0 -67
  64. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/expandToHashMap.mjs +0 -8
  65. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getAltAxis.mjs +0 -5
  66. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getBasePlacement.mjs +0 -7
  67. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getFreshSideObject.mjs +0 -10
  68. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.mjs +0 -5
  69. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositePlacement.mjs +0 -13
  70. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.mjs +0 -11
  71. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getVariation.mjs +0 -5
  72. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/math.mjs +0 -5
  73. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergeByName.mjs +0 -16
  74. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergePaddingObject.mjs +0 -7
  75. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/orderModifiers.mjs +0 -46
  76. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/rectToClientRect.mjs +0 -10
  77. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/userAgent.mjs +0 -13
  78. package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/within.mjs +0 -11
  79. package/es/node_modules/.pnpm/@vueuse_core@13.7.0_vue@3.5.18_typescript@5.9.2_/node_modules/@vueuse/core/index.mjs +0 -8285
  80. package/es/node_modules/.pnpm/@vueuse_shared@13.7.0_vue@3.5.18_typescript@5.9.2_/node_modules/@vueuse/shared/index.mjs +0 -1641
  81. package/es/node_modules/.pnpm/gradient-parser@1.0.2/node_modules/gradient-parser/build/node.mjs +0 -528
  82. package/es/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.mjs +0 -193
  83. package/es/node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.mjs +0 -1180
  84. package/es/node_modules/.pnpm/vue-types@3.0.2_vue@3.5.18_typescript@5.9.2_/node_modules/vue-types/dist/vue-types.m.mjs +0 -3
  85. package/es/node_modules/.pnpm/vue3-colorpicker@2.3.0_@aesoper_normal-utils@0.1.5_@popperjs_core@2.11.8_@vueuse_core@1_c6850a6c65df63e96440af393dfce213/node_modules/vue3-colorpicker/index.es.mjs +0 -1815
@@ -1,1641 +0,0 @@
1
- import { shallowRef, watchEffect, readonly, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, hasInjectionContext, inject, provide, ref, isRef, unref, toValue as toValue$1, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, shallowReadonly, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue';
2
-
3
- function computedEager(fn, options) {
4
- var _a;
5
- const result = shallowRef();
6
- watchEffect(() => {
7
- result.value = fn();
8
- }, {
9
- ...options,
10
- flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
11
- });
12
- return readonly(result);
13
- }
14
-
15
- function computedWithControl(source, fn, options = {}) {
16
- let v = void 0;
17
- let track;
18
- let trigger;
19
- let dirty = true;
20
- const update = () => {
21
- dirty = true;
22
- trigger();
23
- };
24
- watch(source, update, { flush: "sync", ...options });
25
- const get = typeof fn === "function" ? fn : fn.get;
26
- const set = typeof fn === "function" ? void 0 : fn.set;
27
- const result = customRef((_track, _trigger) => {
28
- track = _track;
29
- trigger = _trigger;
30
- return {
31
- get() {
32
- if (dirty) {
33
- v = get(v);
34
- dirty = false;
35
- }
36
- track();
37
- return v;
38
- },
39
- set(v2) {
40
- set == null ? void 0 : set(v2);
41
- }
42
- };
43
- });
44
- result.trigger = update;
45
- return result;
46
- }
47
-
48
- function tryOnScopeDispose(fn) {
49
- if (getCurrentScope()) {
50
- onScopeDispose(fn);
51
- return true;
52
- }
53
- return false;
54
- }
55
-
56
- // @__NO_SIDE_EFFECTS__
57
- function createEventHook() {
58
- const fns = /* @__PURE__ */ new Set();
59
- const off = (fn) => {
60
- fns.delete(fn);
61
- };
62
- const clear = () => {
63
- fns.clear();
64
- };
65
- const on = (fn) => {
66
- fns.add(fn);
67
- const offFn = () => off(fn);
68
- tryOnScopeDispose(offFn);
69
- return {
70
- off: offFn
71
- };
72
- };
73
- const trigger = (...args) => {
74
- return Promise.all(Array.from(fns).map((fn) => fn(...args)));
75
- };
76
- return {
77
- on,
78
- off,
79
- trigger,
80
- clear
81
- };
82
- }
83
-
84
- // @__NO_SIDE_EFFECTS__
85
- function createGlobalState(stateFactory) {
86
- let initialized = false;
87
- let state;
88
- const scope = effectScope(true);
89
- return (...args) => {
90
- if (!initialized) {
91
- state = scope.run(() => stateFactory(...args));
92
- initialized = true;
93
- }
94
- return state;
95
- };
96
- }
97
-
98
- const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
99
-
100
- const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
101
- var _a;
102
- const key = args[0];
103
- const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
104
- if (instance == null && !hasInjectionContext())
105
- throw new Error("injectLocal must be called in setup");
106
- if (instance && localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
107
- return localProvidedStateMap.get(instance)[key];
108
- return inject(...args);
109
- };
110
-
111
- function provideLocal(key, value) {
112
- var _a;
113
- const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
114
- if (instance == null)
115
- throw new Error("provideLocal must be called in setup");
116
- if (!localProvidedStateMap.has(instance))
117
- localProvidedStateMap.set(instance, /* @__PURE__ */ Object.create(null));
118
- const localProvidedState = localProvidedStateMap.get(instance);
119
- localProvidedState[key] = value;
120
- return provide(key, value);
121
- }
122
-
123
- // @__NO_SIDE_EFFECTS__
124
- function createInjectionState(composable, options) {
125
- const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState");
126
- const defaultValue = options == null ? void 0 : options.defaultValue;
127
- const useProvidingState = (...args) => {
128
- const state = composable(...args);
129
- provideLocal(key, state);
130
- return state;
131
- };
132
- const useInjectedState = () => injectLocal(key, defaultValue);
133
- return [useProvidingState, useInjectedState];
134
- }
135
-
136
- // @__NO_SIDE_EFFECTS__
137
- function createRef(value, deep) {
138
- if (deep === true) {
139
- return ref(value);
140
- } else {
141
- return shallowRef(value);
142
- }
143
- }
144
-
145
- // @__NO_SIDE_EFFECTS__
146
- function createSharedComposable(composable) {
147
- let subscribers = 0;
148
- let state;
149
- let scope;
150
- const dispose = () => {
151
- subscribers -= 1;
152
- if (scope && subscribers <= 0) {
153
- scope.stop();
154
- state = void 0;
155
- scope = void 0;
156
- }
157
- };
158
- return (...args) => {
159
- subscribers += 1;
160
- if (!scope) {
161
- scope = effectScope(true);
162
- state = scope.run(() => composable(...args));
163
- }
164
- tryOnScopeDispose(dispose);
165
- return state;
166
- };
167
- }
168
-
169
- function extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {
170
- for (const [key, value] of Object.entries(extend)) {
171
- if (key === "value")
172
- continue;
173
- if (isRef(value) && unwrap) {
174
- Object.defineProperty(ref, key, {
175
- get() {
176
- return value.value;
177
- },
178
- set(v) {
179
- value.value = v;
180
- },
181
- enumerable
182
- });
183
- } else {
184
- Object.defineProperty(ref, key, { value, enumerable });
185
- }
186
- }
187
- return ref;
188
- }
189
-
190
- function get(obj, key) {
191
- if (key == null)
192
- return unref(obj);
193
- return unref(obj)[key];
194
- }
195
-
196
- function isDefined(v) {
197
- return unref(v) != null;
198
- }
199
-
200
- // @__NO_SIDE_EFFECTS__
201
- function makeDestructurable(obj, arr) {
202
- if (typeof Symbol !== "undefined") {
203
- const clone = { ...obj };
204
- Object.defineProperty(clone, Symbol.iterator, {
205
- enumerable: false,
206
- value() {
207
- let index = 0;
208
- return {
209
- next: () => ({
210
- value: arr[index++],
211
- done: index > arr.length
212
- })
213
- };
214
- }
215
- });
216
- return clone;
217
- } else {
218
- return Object.assign([...arr], obj);
219
- }
220
- }
221
-
222
- // @__NO_SIDE_EFFECTS__
223
- function reactify(fn, options) {
224
- const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? unref : toValue$1;
225
- return function(...args) {
226
- return computed(() => fn.apply(this, args.map((i) => unrefFn(i))));
227
- };
228
- }
229
-
230
- // @__NO_SIDE_EFFECTS__
231
- function reactifyObject(obj, optionsOrKeys = {}) {
232
- let keys = [];
233
- let options;
234
- if (Array.isArray(optionsOrKeys)) {
235
- keys = optionsOrKeys;
236
- } else {
237
- options = optionsOrKeys;
238
- const { includeOwnProperties = true } = optionsOrKeys;
239
- keys.push(...Object.keys(obj));
240
- if (includeOwnProperties)
241
- keys.push(...Object.getOwnPropertyNames(obj));
242
- }
243
- return Object.fromEntries(
244
- keys.map((key) => {
245
- const value = obj[key];
246
- return [
247
- key,
248
- typeof value === "function" ? reactify(value.bind(obj), options) : value
249
- ];
250
- })
251
- );
252
- }
253
-
254
- function toReactive(objectRef) {
255
- if (!isRef(objectRef))
256
- return reactive(objectRef);
257
- const proxy = new Proxy({}, {
258
- get(_, p, receiver) {
259
- return unref(Reflect.get(objectRef.value, p, receiver));
260
- },
261
- set(_, p, value) {
262
- if (isRef(objectRef.value[p]) && !isRef(value))
263
- objectRef.value[p].value = value;
264
- else
265
- objectRef.value[p] = value;
266
- return true;
267
- },
268
- deleteProperty(_, p) {
269
- return Reflect.deleteProperty(objectRef.value, p);
270
- },
271
- has(_, p) {
272
- return Reflect.has(objectRef.value, p);
273
- },
274
- ownKeys() {
275
- return Object.keys(objectRef.value);
276
- },
277
- getOwnPropertyDescriptor() {
278
- return {
279
- enumerable: true,
280
- configurable: true
281
- };
282
- }
283
- });
284
- return reactive(proxy);
285
- }
286
-
287
- function reactiveComputed(fn) {
288
- return toReactive(computed(fn));
289
- }
290
-
291
- function reactiveOmit(obj, ...keys) {
292
- const flatKeys = keys.flat();
293
- const predicate = flatKeys[0];
294
- return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue$1(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));
295
- }
296
-
297
- const isClient = typeof window !== "undefined" && typeof document !== "undefined";
298
- const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
299
- const isDef = (val) => typeof val !== "undefined";
300
- const notNullish = (val) => val != null;
301
- const assert = (condition, ...infos) => {
302
- if (!condition)
303
- console.warn(...infos);
304
- };
305
- const toString = Object.prototype.toString;
306
- const isObject = (val) => toString.call(val) === "[object Object]";
307
- const now = () => Date.now();
308
- const timestamp = () => +Date.now();
309
- const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
310
- const noop = () => {
311
- };
312
- const rand = (min, max) => {
313
- min = Math.ceil(min);
314
- max = Math.floor(max);
315
- return Math.floor(Math.random() * (max - min + 1)) + min;
316
- };
317
- const hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
318
- const isIOS = /* @__PURE__ */ getIsIOS();
319
- function getIsIOS() {
320
- var _a, _b;
321
- return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
322
- }
323
-
324
- function toRef(...args) {
325
- if (args.length !== 1)
326
- return toRef$1(...args);
327
- const r = args[0];
328
- return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);
329
- }
330
- const resolveRef = toRef;
331
-
332
- function reactivePick(obj, ...keys) {
333
- const flatKeys = keys.flat();
334
- const predicate = flatKeys[0];
335
- return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue$1(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));
336
- }
337
-
338
- function refAutoReset(defaultValue, afterMs = 1e4) {
339
- return customRef((track, trigger) => {
340
- let value = toValue$1(defaultValue);
341
- let timer;
342
- const resetAfter = () => setTimeout(() => {
343
- value = toValue$1(defaultValue);
344
- trigger();
345
- }, toValue$1(afterMs));
346
- tryOnScopeDispose(() => {
347
- clearTimeout(timer);
348
- });
349
- return {
350
- get() {
351
- track();
352
- return value;
353
- },
354
- set(newValue) {
355
- value = newValue;
356
- trigger();
357
- clearTimeout(timer);
358
- timer = resetAfter();
359
- }
360
- };
361
- });
362
- }
363
-
364
- function createFilterWrapper(filter, fn) {
365
- function wrapper(...args) {
366
- return new Promise((resolve, reject) => {
367
- Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
368
- });
369
- }
370
- return wrapper;
371
- }
372
- const bypassFilter = (invoke) => {
373
- return invoke();
374
- };
375
- function debounceFilter(ms, options = {}) {
376
- let timer;
377
- let maxTimer;
378
- let lastRejector = noop;
379
- const _clearTimeout = (timer2) => {
380
- clearTimeout(timer2);
381
- lastRejector();
382
- lastRejector = noop;
383
- };
384
- let lastInvoker;
385
- const filter = (invoke) => {
386
- const duration = toValue$1(ms);
387
- const maxDuration = toValue$1(options.maxWait);
388
- if (timer)
389
- _clearTimeout(timer);
390
- if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
391
- if (maxTimer) {
392
- _clearTimeout(maxTimer);
393
- maxTimer = void 0;
394
- }
395
- return Promise.resolve(invoke());
396
- }
397
- return new Promise((resolve, reject) => {
398
- lastRejector = options.rejectOnCancel ? reject : resolve;
399
- lastInvoker = invoke;
400
- if (maxDuration && !maxTimer) {
401
- maxTimer = setTimeout(() => {
402
- if (timer)
403
- _clearTimeout(timer);
404
- maxTimer = void 0;
405
- resolve(lastInvoker());
406
- }, maxDuration);
407
- }
408
- timer = setTimeout(() => {
409
- if (maxTimer)
410
- _clearTimeout(maxTimer);
411
- maxTimer = void 0;
412
- resolve(invoke());
413
- }, duration);
414
- });
415
- };
416
- return filter;
417
- }
418
- function throttleFilter(...args) {
419
- let lastExec = 0;
420
- let timer;
421
- let isLeading = true;
422
- let lastRejector = noop;
423
- let lastValue;
424
- let ms;
425
- let trailing;
426
- let leading;
427
- let rejectOnCancel;
428
- if (!isRef(args[0]) && typeof args[0] === "object")
429
- ({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0]);
430
- else
431
- [ms, trailing = true, leading = true, rejectOnCancel = false] = args;
432
- const clear = () => {
433
- if (timer) {
434
- clearTimeout(timer);
435
- timer = void 0;
436
- lastRejector();
437
- lastRejector = noop;
438
- }
439
- };
440
- const filter = (_invoke) => {
441
- const duration = toValue$1(ms);
442
- const elapsed = Date.now() - lastExec;
443
- const invoke = () => {
444
- return lastValue = _invoke();
445
- };
446
- clear();
447
- if (duration <= 0) {
448
- lastExec = Date.now();
449
- return invoke();
450
- }
451
- if (elapsed > duration && (leading || !isLeading)) {
452
- lastExec = Date.now();
453
- invoke();
454
- } else if (trailing) {
455
- lastValue = new Promise((resolve, reject) => {
456
- lastRejector = rejectOnCancel ? reject : resolve;
457
- timer = setTimeout(() => {
458
- lastExec = Date.now();
459
- isLeading = true;
460
- resolve(invoke());
461
- clear();
462
- }, Math.max(0, duration - elapsed));
463
- });
464
- }
465
- if (!leading && !timer)
466
- timer = setTimeout(() => isLeading = true, duration);
467
- isLeading = false;
468
- return lastValue;
469
- };
470
- return filter;
471
- }
472
- function pausableFilter(extendFilter = bypassFilter, options = {}) {
473
- const {
474
- initialState = "active"
475
- } = options;
476
- const isActive = toRef(initialState === "active");
477
- function pause() {
478
- isActive.value = false;
479
- }
480
- function resume() {
481
- isActive.value = true;
482
- }
483
- const eventFilter = (...args) => {
484
- if (isActive.value)
485
- extendFilter(...args);
486
- };
487
- return { isActive: readonly(isActive), pause, resume, eventFilter };
488
- }
489
-
490
- function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
491
- return new Promise((resolve, reject) => {
492
- if (throwOnTimeout)
493
- setTimeout(() => reject(reason), ms);
494
- else
495
- setTimeout(resolve, ms);
496
- });
497
- }
498
- function identity(arg) {
499
- return arg;
500
- }
501
- function createSingletonPromise(fn) {
502
- let _promise;
503
- function wrapper() {
504
- if (!_promise)
505
- _promise = fn();
506
- return _promise;
507
- }
508
- wrapper.reset = async () => {
509
- const _prev = _promise;
510
- _promise = void 0;
511
- if (_prev)
512
- await _prev;
513
- };
514
- return wrapper;
515
- }
516
- function invoke(fn) {
517
- return fn();
518
- }
519
- function containsProp(obj, ...props) {
520
- return props.some((k) => k in obj);
521
- }
522
- function increaseWithUnit(target, delta) {
523
- var _a;
524
- if (typeof target === "number")
525
- return target + delta;
526
- const value = ((_a = target.match(/^-?\d+\.?\d*/)) == null ? void 0 : _a[0]) || "";
527
- const unit = target.slice(value.length);
528
- const result = Number.parseFloat(value) + delta;
529
- if (Number.isNaN(result))
530
- return target;
531
- return result + unit;
532
- }
533
- function pxValue(px) {
534
- return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
535
- }
536
- function objectPick(obj, keys, omitUndefined = false) {
537
- return keys.reduce((n, k) => {
538
- if (k in obj) {
539
- if (!omitUndefined || obj[k] !== void 0)
540
- n[k] = obj[k];
541
- }
542
- return n;
543
- }, {});
544
- }
545
- function objectOmit(obj, keys, omitUndefined = false) {
546
- return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {
547
- return (!omitUndefined || value !== void 0) && !keys.includes(key);
548
- }));
549
- }
550
- function objectEntries(obj) {
551
- return Object.entries(obj);
552
- }
553
- function toArray(value) {
554
- return Array.isArray(value) ? value : [value];
555
- }
556
-
557
- function cacheStringFunction(fn) {
558
- const cache = /* @__PURE__ */ Object.create(null);
559
- return (str) => {
560
- const hit = cache[str];
561
- return hit || (cache[str] = fn(str));
562
- };
563
- }
564
- const hyphenateRE = /\B([A-Z])/g;
565
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
566
- const camelizeRE = /-(\w)/g;
567
- const camelize = cacheStringFunction((str) => {
568
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
569
- });
570
-
571
- function getLifeCycleTarget(target) {
572
- return target || getCurrentInstance();
573
- }
574
-
575
- // @__NO_SIDE_EFFECTS__
576
- function useDebounceFn(fn, ms = 200, options = {}) {
577
- return createFilterWrapper(
578
- debounceFilter(ms, options),
579
- fn
580
- );
581
- }
582
-
583
- function refDebounced(value, ms = 200, options = {}) {
584
- const debounced = ref(toValue$1(value));
585
- const updater = useDebounceFn(() => {
586
- debounced.value = value.value;
587
- }, ms, options);
588
- watch(value, () => updater());
589
- return shallowReadonly(debounced);
590
- }
591
-
592
- // @__NO_SIDE_EFFECTS__
593
- function refDefault(source, defaultValue) {
594
- return computed({
595
- get() {
596
- var _a;
597
- return (_a = source.value) != null ? _a : defaultValue;
598
- },
599
- set(value) {
600
- source.value = value;
601
- }
602
- });
603
- }
604
-
605
- // @__NO_SIDE_EFFECTS__
606
- function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
607
- return createFilterWrapper(
608
- throttleFilter(ms, trailing, leading, rejectOnCancel),
609
- fn
610
- );
611
- }
612
-
613
- function refThrottled(value, delay = 200, trailing = true, leading = true) {
614
- if (delay <= 0)
615
- return value;
616
- const throttled = ref(toValue$1(value));
617
- const updater = useThrottleFn(() => {
618
- throttled.value = value.value;
619
- }, delay, trailing, leading);
620
- watch(value, () => updater());
621
- return throttled;
622
- }
623
-
624
- // @__NO_SIDE_EFFECTS__
625
- function refWithControl(initial, options = {}) {
626
- let source = initial;
627
- let track;
628
- let trigger;
629
- const ref = customRef((_track, _trigger) => {
630
- track = _track;
631
- trigger = _trigger;
632
- return {
633
- get() {
634
- return get();
635
- },
636
- set(v) {
637
- set(v);
638
- }
639
- };
640
- });
641
- function get(tracking = true) {
642
- if (tracking)
643
- track();
644
- return source;
645
- }
646
- function set(value, triggering = true) {
647
- var _a, _b;
648
- if (value === source)
649
- return;
650
- const old = source;
651
- if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
652
- return;
653
- source = value;
654
- (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
655
- if (triggering)
656
- trigger();
657
- }
658
- const untrackedGet = () => get(false);
659
- const silentSet = (v) => set(v, false);
660
- const peek = () => get(false);
661
- const lay = (v) => set(v, false);
662
- return extendRef(
663
- ref,
664
- {
665
- get,
666
- set,
667
- untrackedGet,
668
- silentSet,
669
- peek,
670
- lay
671
- },
672
- { enumerable: true }
673
- );
674
- }
675
- const controlledRef = refWithControl;
676
-
677
- function set(...args) {
678
- if (args.length === 2) {
679
- const [ref, value] = args;
680
- ref.value = value;
681
- }
682
- if (args.length === 3) {
683
- const [target, key, value] = args;
684
- target[key] = value;
685
- }
686
- }
687
-
688
- function watchWithFilter(source, cb, options = {}) {
689
- const {
690
- eventFilter = bypassFilter,
691
- ...watchOptions
692
- } = options;
693
- return watch(
694
- source,
695
- createFilterWrapper(
696
- eventFilter,
697
- cb
698
- ),
699
- watchOptions
700
- );
701
- }
702
-
703
- function watchPausable(source, cb, options = {}) {
704
- const {
705
- eventFilter: filter,
706
- initialState = "active",
707
- ...watchOptions
708
- } = options;
709
- const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
710
- const stop = watchWithFilter(
711
- source,
712
- cb,
713
- {
714
- ...watchOptions,
715
- eventFilter
716
- }
717
- );
718
- return { stop, pause, resume, isActive };
719
- }
720
-
721
- function syncRef(left, right, ...[options]) {
722
- const {
723
- flush = "sync",
724
- deep = false,
725
- immediate = true,
726
- direction = "both",
727
- transform = {}
728
- } = options || {};
729
- const watchers = [];
730
- const transformLTR = "ltr" in transform && transform.ltr || ((v) => v);
731
- const transformRTL = "rtl" in transform && transform.rtl || ((v) => v);
732
- if (direction === "both" || direction === "ltr") {
733
- watchers.push(watchPausable(
734
- left,
735
- (newValue) => {
736
- watchers.forEach((w) => w.pause());
737
- right.value = transformLTR(newValue);
738
- watchers.forEach((w) => w.resume());
739
- },
740
- { flush, deep, immediate }
741
- ));
742
- }
743
- if (direction === "both" || direction === "rtl") {
744
- watchers.push(watchPausable(
745
- right,
746
- (newValue) => {
747
- watchers.forEach((w) => w.pause());
748
- left.value = transformRTL(newValue);
749
- watchers.forEach((w) => w.resume());
750
- },
751
- { flush, deep, immediate }
752
- ));
753
- }
754
- const stop = () => {
755
- watchers.forEach((w) => w.stop());
756
- };
757
- return stop;
758
- }
759
-
760
- function syncRefs(source, targets, options = {}) {
761
- const {
762
- flush = "sync",
763
- deep = false,
764
- immediate = true
765
- } = options;
766
- const targetsArray = toArray(targets);
767
- return watch(
768
- source,
769
- (newValue) => targetsArray.forEach((target) => target.value = newValue),
770
- { flush, deep, immediate }
771
- );
772
- }
773
-
774
- function toRefs(objectRef, options = {}) {
775
- if (!isRef(objectRef))
776
- return toRefs$1(objectRef);
777
- const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};
778
- for (const key in objectRef.value) {
779
- result[key] = customRef(() => ({
780
- get() {
781
- return objectRef.value[key];
782
- },
783
- set(v) {
784
- var _a;
785
- const replaceRef = (_a = toValue$1(options.replaceRef)) != null ? _a : true;
786
- if (replaceRef) {
787
- if (Array.isArray(objectRef.value)) {
788
- const copy = [...objectRef.value];
789
- copy[key] = v;
790
- objectRef.value = copy;
791
- } else {
792
- const newObject = { ...objectRef.value, [key]: v };
793
- Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
794
- objectRef.value = newObject;
795
- }
796
- } else {
797
- objectRef.value[key] = v;
798
- }
799
- }
800
- }));
801
- }
802
- return result;
803
- }
804
-
805
- const toValue = toValue$1;
806
- const resolveUnref = toValue$1;
807
-
808
- function tryOnBeforeMount(fn, sync = true, target) {
809
- const instance = getLifeCycleTarget(target);
810
- if (instance)
811
- onBeforeMount(fn, target);
812
- else if (sync)
813
- fn();
814
- else
815
- nextTick(fn);
816
- }
817
-
818
- function tryOnBeforeUnmount(fn, target) {
819
- const instance = getLifeCycleTarget(target);
820
- if (instance)
821
- onBeforeUnmount(fn, target);
822
- }
823
-
824
- function tryOnMounted(fn, sync = true, target) {
825
- const instance = getLifeCycleTarget(target);
826
- if (instance)
827
- onMounted(fn, target);
828
- else if (sync)
829
- fn();
830
- else
831
- nextTick(fn);
832
- }
833
-
834
- function tryOnUnmounted(fn, target) {
835
- const instance = getLifeCycleTarget(target);
836
- if (instance)
837
- onUnmounted(fn, target);
838
- }
839
-
840
- function createUntil(r, isNot = false) {
841
- function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
842
- let stop = null;
843
- const watcher = new Promise((resolve) => {
844
- stop = watch(
845
- r,
846
- (v) => {
847
- if (condition(v) !== isNot) {
848
- if (stop)
849
- stop();
850
- else
851
- nextTick(() => stop == null ? void 0 : stop());
852
- resolve(v);
853
- }
854
- },
855
- {
856
- flush,
857
- deep,
858
- immediate: true
859
- }
860
- );
861
- });
862
- const promises = [watcher];
863
- if (timeout != null) {
864
- promises.push(
865
- promiseTimeout(timeout, throwOnTimeout).then(() => toValue$1(r)).finally(() => stop == null ? void 0 : stop())
866
- );
867
- }
868
- return Promise.race(promises);
869
- }
870
- function toBe(value, options) {
871
- if (!isRef(value))
872
- return toMatch((v) => v === value, options);
873
- const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
874
- let stop = null;
875
- const watcher = new Promise((resolve) => {
876
- stop = watch(
877
- [r, value],
878
- ([v1, v2]) => {
879
- if (isNot !== (v1 === v2)) {
880
- if (stop)
881
- stop();
882
- else
883
- nextTick(() => stop == null ? void 0 : stop());
884
- resolve(v1);
885
- }
886
- },
887
- {
888
- flush,
889
- deep,
890
- immediate: true
891
- }
892
- );
893
- });
894
- const promises = [watcher];
895
- if (timeout != null) {
896
- promises.push(
897
- promiseTimeout(timeout, throwOnTimeout).then(() => toValue$1(r)).finally(() => {
898
- stop == null ? void 0 : stop();
899
- return toValue$1(r);
900
- })
901
- );
902
- }
903
- return Promise.race(promises);
904
- }
905
- function toBeTruthy(options) {
906
- return toMatch((v) => Boolean(v), options);
907
- }
908
- function toBeNull(options) {
909
- return toBe(null, options);
910
- }
911
- function toBeUndefined(options) {
912
- return toBe(void 0, options);
913
- }
914
- function toBeNaN(options) {
915
- return toMatch(Number.isNaN, options);
916
- }
917
- function toContains(value, options) {
918
- return toMatch((v) => {
919
- const array = Array.from(v);
920
- return array.includes(value) || array.includes(toValue$1(value));
921
- }, options);
922
- }
923
- function changed(options) {
924
- return changedTimes(1, options);
925
- }
926
- function changedTimes(n = 1, options) {
927
- let count = -1;
928
- return toMatch(() => {
929
- count += 1;
930
- return count >= n;
931
- }, options);
932
- }
933
- if (Array.isArray(toValue$1(r))) {
934
- const instance = {
935
- toMatch,
936
- toContains,
937
- changed,
938
- changedTimes,
939
- get not() {
940
- return createUntil(r, !isNot);
941
- }
942
- };
943
- return instance;
944
- } else {
945
- const instance = {
946
- toMatch,
947
- toBe,
948
- toBeTruthy,
949
- toBeNull,
950
- toBeNaN,
951
- toBeUndefined,
952
- changed,
953
- changedTimes,
954
- get not() {
955
- return createUntil(r, !isNot);
956
- }
957
- };
958
- return instance;
959
- }
960
- }
961
- function until(r) {
962
- return createUntil(r);
963
- }
964
-
965
- function defaultComparator(value, othVal) {
966
- return value === othVal;
967
- }
968
- // @__NO_SIDE_EFFECTS__
969
- function useArrayDifference(...args) {
970
- var _a, _b;
971
- const list = args[0];
972
- const values = args[1];
973
- let compareFn = (_a = args[2]) != null ? _a : defaultComparator;
974
- const {
975
- symmetric = false
976
- } = (_b = args[3]) != null ? _b : {};
977
- if (typeof compareFn === "string") {
978
- const key = compareFn;
979
- compareFn = (value, othVal) => value[key] === othVal[key];
980
- }
981
- const diff1 = computed(() => toValue$1(list).filter((x) => toValue$1(values).findIndex((y) => compareFn(x, y)) === -1));
982
- if (symmetric) {
983
- const diff2 = computed(() => toValue$1(values).filter((x) => toValue$1(list).findIndex((y) => compareFn(x, y)) === -1));
984
- return computed(() => symmetric ? [...toValue$1(diff1), ...toValue$1(diff2)] : toValue$1(diff1));
985
- } else {
986
- return diff1;
987
- }
988
- }
989
-
990
- // @__NO_SIDE_EFFECTS__
991
- function useArrayEvery(list, fn) {
992
- return computed(() => toValue$1(list).every((element, index, array) => fn(toValue$1(element), index, array)));
993
- }
994
-
995
- // @__NO_SIDE_EFFECTS__
996
- function useArrayFilter(list, fn) {
997
- return computed(() => toValue$1(list).map((i) => toValue$1(i)).filter(fn));
998
- }
999
-
1000
- // @__NO_SIDE_EFFECTS__
1001
- function useArrayFind(list, fn) {
1002
- return computed(() => toValue$1(
1003
- toValue$1(list).find((element, index, array) => fn(toValue$1(element), index, array))
1004
- ));
1005
- }
1006
-
1007
- // @__NO_SIDE_EFFECTS__
1008
- function useArrayFindIndex(list, fn) {
1009
- return computed(() => toValue$1(list).findIndex((element, index, array) => fn(toValue$1(element), index, array)));
1010
- }
1011
-
1012
- function findLast(arr, cb) {
1013
- let index = arr.length;
1014
- while (index-- > 0) {
1015
- if (cb(arr[index], index, arr))
1016
- return arr[index];
1017
- }
1018
- return void 0;
1019
- }
1020
- // @__NO_SIDE_EFFECTS__
1021
- function useArrayFindLast(list, fn) {
1022
- return computed(() => toValue$1(
1023
- !Array.prototype.findLast ? findLast(toValue$1(list), (element, index, array) => fn(toValue$1(element), index, array)) : toValue$1(list).findLast((element, index, array) => fn(toValue$1(element), index, array))
1024
- ));
1025
- }
1026
-
1027
- function isArrayIncludesOptions(obj) {
1028
- return isObject(obj) && containsProp(obj, "formIndex", "comparator");
1029
- }
1030
- // @__NO_SIDE_EFFECTS__
1031
- function useArrayIncludes(...args) {
1032
- var _a;
1033
- const list = args[0];
1034
- const value = args[1];
1035
- let comparator = args[2];
1036
- let formIndex = 0;
1037
- if (isArrayIncludesOptions(comparator)) {
1038
- formIndex = (_a = comparator.fromIndex) != null ? _a : 0;
1039
- comparator = comparator.comparator;
1040
- }
1041
- if (typeof comparator === "string") {
1042
- const key = comparator;
1043
- comparator = (element, value2) => element[key] === toValue$1(value2);
1044
- }
1045
- comparator = comparator != null ? comparator : (element, value2) => element === toValue$1(value2);
1046
- return computed(() => toValue$1(list).slice(formIndex).some((element, index, array) => comparator(
1047
- toValue$1(element),
1048
- toValue$1(value),
1049
- index,
1050
- toValue$1(array)
1051
- )));
1052
- }
1053
-
1054
- // @__NO_SIDE_EFFECTS__
1055
- function useArrayJoin(list, separator) {
1056
- return computed(() => toValue$1(list).map((i) => toValue$1(i)).join(toValue$1(separator)));
1057
- }
1058
-
1059
- // @__NO_SIDE_EFFECTS__
1060
- function useArrayMap(list, fn) {
1061
- return computed(() => toValue$1(list).map((i) => toValue$1(i)).map(fn));
1062
- }
1063
-
1064
- // @__NO_SIDE_EFFECTS__
1065
- function useArrayReduce(list, reducer, ...args) {
1066
- const reduceCallback = (sum, value, index) => reducer(toValue$1(sum), toValue$1(value), index);
1067
- return computed(() => {
1068
- const resolved = toValue$1(list);
1069
- return args.length ? resolved.reduce(reduceCallback, typeof args[0] === "function" ? toValue$1(args[0]()) : toValue$1(args[0])) : resolved.reduce(reduceCallback);
1070
- });
1071
- }
1072
-
1073
- // @__NO_SIDE_EFFECTS__
1074
- function useArraySome(list, fn) {
1075
- return computed(() => toValue$1(list).some((element, index, array) => fn(toValue$1(element), index, array)));
1076
- }
1077
-
1078
- function uniq(array) {
1079
- return Array.from(new Set(array));
1080
- }
1081
- function uniqueElementsBy(array, fn) {
1082
- return array.reduce((acc, v) => {
1083
- if (!acc.some((x) => fn(v, x, array)))
1084
- acc.push(v);
1085
- return acc;
1086
- }, []);
1087
- }
1088
- // @__NO_SIDE_EFFECTS__
1089
- function useArrayUnique(list, compareFn) {
1090
- return computed(() => {
1091
- const resolvedList = toValue$1(list).map((element) => toValue$1(element));
1092
- return compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);
1093
- });
1094
- }
1095
-
1096
- function useCounter(initialValue = 0, options = {}) {
1097
- let _initialValue = unref(initialValue);
1098
- const count = shallowRef(initialValue);
1099
- const {
1100
- max = Number.POSITIVE_INFINITY,
1101
- min = Number.NEGATIVE_INFINITY
1102
- } = options;
1103
- const inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);
1104
- const dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);
1105
- const get = () => count.value;
1106
- const set = (val) => count.value = Math.max(min, Math.min(max, val));
1107
- const reset = (val = _initialValue) => {
1108
- _initialValue = val;
1109
- return set(val);
1110
- };
1111
- return { count: shallowReadonly(count), inc, dec, get, set, reset };
1112
- }
1113
-
1114
- const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[T\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/i;
1115
- const REGEX_FORMAT = /[YMDHhms]o|\[([^\]]+)\]|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}|z{1,4}|SSS/g;
1116
- function defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {
1117
- let m = hours < 12 ? "AM" : "PM";
1118
- if (hasPeriod)
1119
- m = m.split("").reduce((acc, curr) => acc += `${curr}.`, "");
1120
- return isLowercase ? m.toLowerCase() : m;
1121
- }
1122
- function formatOrdinal(num) {
1123
- const suffixes = ["th", "st", "nd", "rd"];
1124
- const v = num % 100;
1125
- return num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);
1126
- }
1127
- function formatDate(date, formatStr, options = {}) {
1128
- var _a;
1129
- const years = date.getFullYear();
1130
- const month = date.getMonth();
1131
- const days = date.getDate();
1132
- const hours = date.getHours();
1133
- const minutes = date.getMinutes();
1134
- const seconds = date.getSeconds();
1135
- const milliseconds = date.getMilliseconds();
1136
- const day = date.getDay();
1137
- const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;
1138
- const stripTimeZone = (dateString) => {
1139
- var _a2;
1140
- return (_a2 = dateString.split(" ")[1]) != null ? _a2 : "";
1141
- };
1142
- const matches = {
1143
- Yo: () => formatOrdinal(years),
1144
- YY: () => String(years).slice(-2),
1145
- YYYY: () => years,
1146
- M: () => month + 1,
1147
- Mo: () => formatOrdinal(month + 1),
1148
- MM: () => `${month + 1}`.padStart(2, "0"),
1149
- MMM: () => date.toLocaleDateString(toValue$1(options.locales), { month: "short" }),
1150
- MMMM: () => date.toLocaleDateString(toValue$1(options.locales), { month: "long" }),
1151
- D: () => String(days),
1152
- Do: () => formatOrdinal(days),
1153
- DD: () => `${days}`.padStart(2, "0"),
1154
- H: () => String(hours),
1155
- Ho: () => formatOrdinal(hours),
1156
- HH: () => `${hours}`.padStart(2, "0"),
1157
- h: () => `${hours % 12 || 12}`.padStart(1, "0"),
1158
- ho: () => formatOrdinal(hours % 12 || 12),
1159
- hh: () => `${hours % 12 || 12}`.padStart(2, "0"),
1160
- m: () => String(minutes),
1161
- mo: () => formatOrdinal(minutes),
1162
- mm: () => `${minutes}`.padStart(2, "0"),
1163
- s: () => String(seconds),
1164
- so: () => formatOrdinal(seconds),
1165
- ss: () => `${seconds}`.padStart(2, "0"),
1166
- SSS: () => `${milliseconds}`.padStart(3, "0"),
1167
- d: () => day,
1168
- dd: () => date.toLocaleDateString(toValue$1(options.locales), { weekday: "narrow" }),
1169
- ddd: () => date.toLocaleDateString(toValue$1(options.locales), { weekday: "short" }),
1170
- dddd: () => date.toLocaleDateString(toValue$1(options.locales), { weekday: "long" }),
1171
- A: () => meridiem(hours, minutes),
1172
- AA: () => meridiem(hours, minutes, false, true),
1173
- a: () => meridiem(hours, minutes, true),
1174
- aa: () => meridiem(hours, minutes, true, true),
1175
- z: () => stripTimeZone(date.toLocaleDateString(toValue$1(options.locales), { timeZoneName: "shortOffset" })),
1176
- zz: () => stripTimeZone(date.toLocaleDateString(toValue$1(options.locales), { timeZoneName: "shortOffset" })),
1177
- zzz: () => stripTimeZone(date.toLocaleDateString(toValue$1(options.locales), { timeZoneName: "shortOffset" })),
1178
- zzzz: () => stripTimeZone(date.toLocaleDateString(toValue$1(options.locales), { timeZoneName: "longOffset" }))
1179
- };
1180
- return formatStr.replace(REGEX_FORMAT, (match, $1) => {
1181
- var _a2, _b;
1182
- return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;
1183
- });
1184
- }
1185
- function normalizeDate(date) {
1186
- if (date === null)
1187
- return new Date(Number.NaN);
1188
- if (date === void 0)
1189
- return /* @__PURE__ */ new Date();
1190
- if (date instanceof Date)
1191
- return new Date(date);
1192
- if (typeof date === "string" && !/Z$/i.test(date)) {
1193
- const d = date.match(REGEX_PARSE);
1194
- if (d) {
1195
- const m = d[2] - 1 || 0;
1196
- const ms = (d[7] || "0").substring(0, 3);
1197
- return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
1198
- }
1199
- }
1200
- return new Date(date);
1201
- }
1202
- // @__NO_SIDE_EFFECTS__
1203
- function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) {
1204
- return computed(() => formatDate(normalizeDate(toValue$1(date)), toValue$1(formatStr), options));
1205
- }
1206
-
1207
- function useIntervalFn(cb, interval = 1e3, options = {}) {
1208
- const {
1209
- immediate = true,
1210
- immediateCallback = false
1211
- } = options;
1212
- let timer = null;
1213
- const isActive = shallowRef(false);
1214
- function clean() {
1215
- if (timer) {
1216
- clearInterval(timer);
1217
- timer = null;
1218
- }
1219
- }
1220
- function pause() {
1221
- isActive.value = false;
1222
- clean();
1223
- }
1224
- function resume() {
1225
- const intervalValue = toValue$1(interval);
1226
- if (intervalValue <= 0)
1227
- return;
1228
- isActive.value = true;
1229
- if (immediateCallback)
1230
- cb();
1231
- clean();
1232
- if (isActive.value)
1233
- timer = setInterval(cb, intervalValue);
1234
- }
1235
- if (immediate && isClient)
1236
- resume();
1237
- if (isRef(interval) || typeof interval === "function") {
1238
- const stopWatch = watch(interval, () => {
1239
- if (isActive.value && isClient)
1240
- resume();
1241
- });
1242
- tryOnScopeDispose(stopWatch);
1243
- }
1244
- tryOnScopeDispose(pause);
1245
- return {
1246
- isActive: shallowReadonly(isActive),
1247
- pause,
1248
- resume
1249
- };
1250
- }
1251
-
1252
- function useInterval(interval = 1e3, options = {}) {
1253
- const {
1254
- controls: exposeControls = false,
1255
- immediate = true,
1256
- callback
1257
- } = options;
1258
- const counter = shallowRef(0);
1259
- const update = () => counter.value += 1;
1260
- const reset = () => {
1261
- counter.value = 0;
1262
- };
1263
- const controls = useIntervalFn(
1264
- callback ? () => {
1265
- update();
1266
- callback(counter.value);
1267
- } : update,
1268
- interval,
1269
- { immediate }
1270
- );
1271
- if (exposeControls) {
1272
- return {
1273
- counter: shallowReadonly(counter),
1274
- reset,
1275
- ...controls
1276
- };
1277
- } else {
1278
- return shallowReadonly(counter);
1279
- }
1280
- }
1281
-
1282
- function useLastChanged(source, options = {}) {
1283
- var _a;
1284
- const ms = shallowRef((_a = options.initialValue) != null ? _a : null);
1285
- watch(
1286
- source,
1287
- () => ms.value = timestamp(),
1288
- options
1289
- );
1290
- return shallowReadonly(ms);
1291
- }
1292
-
1293
- function useTimeoutFn(cb, interval, options = {}) {
1294
- const {
1295
- immediate = true,
1296
- immediateCallback = false
1297
- } = options;
1298
- const isPending = shallowRef(false);
1299
- let timer;
1300
- function clear() {
1301
- if (timer) {
1302
- clearTimeout(timer);
1303
- timer = void 0;
1304
- }
1305
- }
1306
- function stop() {
1307
- isPending.value = false;
1308
- clear();
1309
- }
1310
- function start(...args) {
1311
- if (immediateCallback)
1312
- cb();
1313
- clear();
1314
- isPending.value = true;
1315
- timer = setTimeout(() => {
1316
- isPending.value = false;
1317
- timer = void 0;
1318
- cb(...args);
1319
- }, toValue$1(interval));
1320
- }
1321
- if (immediate) {
1322
- isPending.value = true;
1323
- if (isClient)
1324
- start();
1325
- }
1326
- tryOnScopeDispose(stop);
1327
- return {
1328
- isPending: shallowReadonly(isPending),
1329
- start,
1330
- stop
1331
- };
1332
- }
1333
-
1334
- function useTimeout(interval = 1e3, options = {}) {
1335
- const {
1336
- controls: exposeControls = false,
1337
- callback
1338
- } = options;
1339
- const controls = useTimeoutFn(
1340
- callback != null ? callback : noop,
1341
- interval,
1342
- options
1343
- );
1344
- const ready = computed(() => !controls.isPending.value);
1345
- if (exposeControls) {
1346
- return {
1347
- ready,
1348
- ...controls
1349
- };
1350
- } else {
1351
- return ready;
1352
- }
1353
- }
1354
-
1355
- // @__NO_SIDE_EFFECTS__
1356
- function useToNumber(value, options = {}) {
1357
- const {
1358
- method = "parseFloat",
1359
- radix,
1360
- nanToZero
1361
- } = options;
1362
- return computed(() => {
1363
- let resolved = toValue$1(value);
1364
- if (typeof method === "function")
1365
- resolved = method(resolved);
1366
- else if (typeof resolved === "string")
1367
- resolved = Number[method](resolved, radix);
1368
- if (nanToZero && Number.isNaN(resolved))
1369
- resolved = 0;
1370
- return resolved;
1371
- });
1372
- }
1373
-
1374
- // @__NO_SIDE_EFFECTS__
1375
- function useToString(value) {
1376
- return computed(() => `${toValue$1(value)}`);
1377
- }
1378
-
1379
- // @__NO_SIDE_EFFECTS__
1380
- function useToggle(initialValue = false, options = {}) {
1381
- const {
1382
- truthyValue = true,
1383
- falsyValue = false
1384
- } = options;
1385
- const valueIsRef = isRef(initialValue);
1386
- const _value = shallowRef(initialValue);
1387
- function toggle(value) {
1388
- if (arguments.length) {
1389
- _value.value = value;
1390
- return _value.value;
1391
- } else {
1392
- const truthy = toValue$1(truthyValue);
1393
- _value.value = _value.value === truthy ? toValue$1(falsyValue) : truthy;
1394
- return _value.value;
1395
- }
1396
- }
1397
- if (valueIsRef)
1398
- return toggle;
1399
- else
1400
- return [_value, toggle];
1401
- }
1402
-
1403
- function watchArray(source, cb, options) {
1404
- let oldList = (options == null ? void 0 : options.immediate) ? [] : [...typeof source === "function" ? source() : Array.isArray(source) ? source : toValue$1(source)];
1405
- return watch(source, (newList, _, onCleanup) => {
1406
- const oldListRemains = Array.from({ length: oldList.length });
1407
- const added = [];
1408
- for (const obj of newList) {
1409
- let found = false;
1410
- for (let i = 0; i < oldList.length; i++) {
1411
- if (!oldListRemains[i] && obj === oldList[i]) {
1412
- oldListRemains[i] = true;
1413
- found = true;
1414
- break;
1415
- }
1416
- }
1417
- if (!found)
1418
- added.push(obj);
1419
- }
1420
- const removed = oldList.filter((_2, i) => !oldListRemains[i]);
1421
- cb(newList, oldList, added, removed, onCleanup);
1422
- oldList = [...newList];
1423
- }, options);
1424
- }
1425
-
1426
- function watchAtMost(source, cb, options) {
1427
- const {
1428
- count,
1429
- ...watchOptions
1430
- } = options;
1431
- const current = shallowRef(0);
1432
- const stop = watchWithFilter(
1433
- source,
1434
- (...args) => {
1435
- current.value += 1;
1436
- if (current.value >= toValue$1(count))
1437
- nextTick(() => stop());
1438
- cb(...args);
1439
- },
1440
- watchOptions
1441
- );
1442
- return { count: current, stop };
1443
- }
1444
-
1445
- function watchDebounced(source, cb, options = {}) {
1446
- const {
1447
- debounce = 0,
1448
- maxWait = void 0,
1449
- ...watchOptions
1450
- } = options;
1451
- return watchWithFilter(
1452
- source,
1453
- cb,
1454
- {
1455
- ...watchOptions,
1456
- eventFilter: debounceFilter(debounce, { maxWait })
1457
- }
1458
- );
1459
- }
1460
-
1461
- function watchDeep(source, cb, options) {
1462
- return watch(
1463
- source,
1464
- cb,
1465
- {
1466
- ...options,
1467
- deep: true
1468
- }
1469
- );
1470
- }
1471
-
1472
- function watchIgnorable(source, cb, options = {}) {
1473
- const {
1474
- eventFilter = bypassFilter,
1475
- ...watchOptions
1476
- } = options;
1477
- const filteredCb = createFilterWrapper(
1478
- eventFilter,
1479
- cb
1480
- );
1481
- let ignoreUpdates;
1482
- let ignorePrevAsyncUpdates;
1483
- let stop;
1484
- if (watchOptions.flush === "sync") {
1485
- let ignore = false;
1486
- ignorePrevAsyncUpdates = () => {
1487
- };
1488
- ignoreUpdates = (updater) => {
1489
- ignore = true;
1490
- updater();
1491
- ignore = false;
1492
- };
1493
- stop = watch(
1494
- source,
1495
- (...args) => {
1496
- if (!ignore)
1497
- filteredCb(...args);
1498
- },
1499
- watchOptions
1500
- );
1501
- } else {
1502
- const disposables = [];
1503
- let ignoreCounter = 0;
1504
- let syncCounter = 0;
1505
- ignorePrevAsyncUpdates = () => {
1506
- ignoreCounter = syncCounter;
1507
- };
1508
- disposables.push(
1509
- watch(
1510
- source,
1511
- () => {
1512
- syncCounter++;
1513
- },
1514
- { ...watchOptions, flush: "sync" }
1515
- )
1516
- );
1517
- ignoreUpdates = (updater) => {
1518
- const syncCounterPrev = syncCounter;
1519
- updater();
1520
- ignoreCounter += syncCounter - syncCounterPrev;
1521
- };
1522
- disposables.push(
1523
- watch(
1524
- source,
1525
- (...args) => {
1526
- const ignore = ignoreCounter > 0 && ignoreCounter === syncCounter;
1527
- ignoreCounter = 0;
1528
- syncCounter = 0;
1529
- if (ignore)
1530
- return;
1531
- filteredCb(...args);
1532
- },
1533
- watchOptions
1534
- )
1535
- );
1536
- stop = () => {
1537
- disposables.forEach((fn) => fn());
1538
- };
1539
- }
1540
- return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
1541
- }
1542
-
1543
- function watchImmediate(source, cb, options) {
1544
- return watch(
1545
- source,
1546
- cb,
1547
- {
1548
- ...options,
1549
- immediate: true
1550
- }
1551
- );
1552
- }
1553
-
1554
- function watchOnce(source, cb, options) {
1555
- return watch(
1556
- source,
1557
- cb,
1558
- {
1559
- ...options,
1560
- once: true
1561
- }
1562
- );
1563
- }
1564
-
1565
- function watchThrottled(source, cb, options = {}) {
1566
- const {
1567
- throttle = 0,
1568
- trailing = true,
1569
- leading = true,
1570
- ...watchOptions
1571
- } = options;
1572
- return watchWithFilter(
1573
- source,
1574
- cb,
1575
- {
1576
- ...watchOptions,
1577
- eventFilter: throttleFilter(throttle, trailing, leading)
1578
- }
1579
- );
1580
- }
1581
-
1582
- function watchTriggerable(source, cb, options = {}) {
1583
- let cleanupFn;
1584
- function onEffect() {
1585
- if (!cleanupFn)
1586
- return;
1587
- const fn = cleanupFn;
1588
- cleanupFn = void 0;
1589
- fn();
1590
- }
1591
- function onCleanup(callback) {
1592
- cleanupFn = callback;
1593
- }
1594
- const _cb = (value, oldValue) => {
1595
- onEffect();
1596
- return cb(value, oldValue, onCleanup);
1597
- };
1598
- const res = watchIgnorable(source, _cb, options);
1599
- const { ignoreUpdates } = res;
1600
- const trigger = () => {
1601
- let res2;
1602
- ignoreUpdates(() => {
1603
- res2 = _cb(getWatchSources(source), getOldValue(source));
1604
- });
1605
- return res2;
1606
- };
1607
- return {
1608
- ...res,
1609
- trigger
1610
- };
1611
- }
1612
- function getWatchSources(sources) {
1613
- if (isReactive(sources))
1614
- return sources;
1615
- if (Array.isArray(sources))
1616
- return sources.map((item) => toValue$1(item));
1617
- return toValue$1(sources);
1618
- }
1619
- function getOldValue(source) {
1620
- return Array.isArray(source) ? source.map(() => void 0) : void 0;
1621
- }
1622
-
1623
- function whenever(source, cb, options) {
1624
- const stop = watch(
1625
- source,
1626
- (v, ov, onInvalidate) => {
1627
- if (v) {
1628
- if (options == null ? void 0 : options.once)
1629
- nextTick(() => stop());
1630
- cb(v, ov, onInvalidate);
1631
- }
1632
- },
1633
- {
1634
- ...options,
1635
- once: false
1636
- }
1637
- );
1638
- return stop;
1639
- }
1640
-
1641
- export { assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };