@vue/reactivity 3.4.27 → 3.4.29
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/dist/reactivity.cjs.js +37 -20
- package/dist/reactivity.cjs.prod.js +30 -18
- package/dist/reactivity.d.ts +9 -5
- package/dist/reactivity.esm-browser.js +37 -20
- package/dist/reactivity.esm-browser.prod.js +2 -2
- package/dist/reactivity.esm-bundler.js +37 -20
- package/dist/reactivity.global.js +37 -20
- package/dist/reactivity.global.prod.js +2 -2
- package/package.json +2 -2
package/dist/reactivity.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -124,7 +124,7 @@ class ReactiveEffect {
|
|
|
124
124
|
/**
|
|
125
125
|
* @internal
|
|
126
126
|
*/
|
|
127
|
-
this._dirtyLevel =
|
|
127
|
+
this._dirtyLevel = 5;
|
|
128
128
|
/**
|
|
129
129
|
* @internal
|
|
130
130
|
*/
|
|
@@ -144,14 +144,18 @@ class ReactiveEffect {
|
|
|
144
144
|
recordEffectScope(this, scope);
|
|
145
145
|
}
|
|
146
146
|
get dirty() {
|
|
147
|
-
if (this._dirtyLevel === 2
|
|
147
|
+
if (this._dirtyLevel === 2)
|
|
148
|
+
return false;
|
|
149
|
+
if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
|
|
148
150
|
this._dirtyLevel = 1;
|
|
149
151
|
pauseTracking();
|
|
150
152
|
for (let i = 0; i < this._depsLength; i++) {
|
|
151
153
|
const dep = this.deps[i];
|
|
152
154
|
if (dep.computed) {
|
|
155
|
+
if (dep.computed.effect._dirtyLevel === 2)
|
|
156
|
+
return true;
|
|
153
157
|
triggerComputed(dep.computed);
|
|
154
|
-
if (this._dirtyLevel >=
|
|
158
|
+
if (this._dirtyLevel >= 5) {
|
|
155
159
|
break;
|
|
156
160
|
}
|
|
157
161
|
}
|
|
@@ -161,10 +165,10 @@ class ReactiveEffect {
|
|
|
161
165
|
}
|
|
162
166
|
resetTracking();
|
|
163
167
|
}
|
|
164
|
-
return this._dirtyLevel >=
|
|
168
|
+
return this._dirtyLevel >= 5;
|
|
165
169
|
}
|
|
166
170
|
set dirty(v) {
|
|
167
|
-
this._dirtyLevel = v ?
|
|
171
|
+
this._dirtyLevel = v ? 5 : 0;
|
|
168
172
|
}
|
|
169
173
|
run() {
|
|
170
174
|
this._dirtyLevel = 0;
|
|
@@ -230,8 +234,7 @@ function effect(fn, options) {
|
|
|
230
234
|
});
|
|
231
235
|
if (options) {
|
|
232
236
|
shared.extend(_effect, options);
|
|
233
|
-
if (options.scope)
|
|
234
|
-
recordEffectScope(_effect, options.scope);
|
|
237
|
+
if (options.scope) recordEffectScope(_effect, options.scope);
|
|
235
238
|
}
|
|
236
239
|
if (!options || !options.lazy) {
|
|
237
240
|
_effect.run();
|
|
@@ -290,9 +293,18 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
|
290
293
|
var _a;
|
|
291
294
|
pauseScheduling();
|
|
292
295
|
for (const effect2 of dep.keys()) {
|
|
296
|
+
if (!dep.computed && effect2.computed) {
|
|
297
|
+
if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
|
|
298
|
+
effect2._dirtyLevel = 2;
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
293
302
|
let tracking;
|
|
294
303
|
if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
295
304
|
effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
|
|
305
|
+
if (effect2.computed && effect2._dirtyLevel === 2) {
|
|
306
|
+
effect2._shouldSchedule = true;
|
|
307
|
+
}
|
|
296
308
|
effect2._dirtyLevel = dirtyLevel;
|
|
297
309
|
}
|
|
298
310
|
if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
@@ -300,7 +312,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
|
300
312
|
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, shared.extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
301
313
|
}
|
|
302
314
|
effect2.trigger();
|
|
303
|
-
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !==
|
|
315
|
+
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
|
|
304
316
|
effect2._shouldSchedule = false;
|
|
305
317
|
if (effect2.scheduler) {
|
|
306
318
|
queueEffectSchedulers.push(effect2.scheduler);
|
|
@@ -392,7 +404,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
392
404
|
if (dep) {
|
|
393
405
|
triggerEffects(
|
|
394
406
|
dep,
|
|
395
|
-
|
|
407
|
+
5,
|
|
396
408
|
{
|
|
397
409
|
target,
|
|
398
410
|
type,
|
|
@@ -445,8 +457,7 @@ function createArrayInstrumentations() {
|
|
|
445
457
|
return instrumentations;
|
|
446
458
|
}
|
|
447
459
|
function hasOwnProperty(key) {
|
|
448
|
-
if (!shared.isSymbol(key))
|
|
449
|
-
key = String(key);
|
|
460
|
+
if (!shared.isSymbol(key)) key = String(key);
|
|
450
461
|
const obj = toRaw(this);
|
|
451
462
|
track(obj, "has", key);
|
|
452
463
|
return obj.hasOwnProperty(key);
|
|
@@ -930,7 +941,11 @@ function shallowReadonly(target) {
|
|
|
930
941
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
931
942
|
if (!shared.isObject(target)) {
|
|
932
943
|
{
|
|
933
|
-
warn(
|
|
944
|
+
warn(
|
|
945
|
+
`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
|
|
946
|
+
target
|
|
947
|
+
)}`
|
|
948
|
+
);
|
|
934
949
|
}
|
|
935
950
|
return target;
|
|
936
951
|
}
|
|
@@ -992,7 +1007,7 @@ class ComputedRefImpl {
|
|
|
992
1007
|
() => getter(this._value),
|
|
993
1008
|
() => triggerRefValue(
|
|
994
1009
|
this,
|
|
995
|
-
this.effect._dirtyLevel ===
|
|
1010
|
+
this.effect._dirtyLevel === 3 ? 3 : 4
|
|
996
1011
|
)
|
|
997
1012
|
);
|
|
998
1013
|
this.effect.computed = this;
|
|
@@ -1002,7 +1017,7 @@ class ComputedRefImpl {
|
|
|
1002
1017
|
get value() {
|
|
1003
1018
|
const self = toRaw(this);
|
|
1004
1019
|
if ((!self._cacheable || self.effect.dirty) && shared.hasChanged(self._value, self._value = self.effect.run())) {
|
|
1005
|
-
triggerRefValue(self,
|
|
1020
|
+
triggerRefValue(self, 5);
|
|
1006
1021
|
}
|
|
1007
1022
|
trackRefValue(self);
|
|
1008
1023
|
if (self.effect._dirtyLevel >= 2) {
|
|
@@ -1011,7 +1026,7 @@ class ComputedRefImpl {
|
|
|
1011
1026
|
|
|
1012
1027
|
getter: `, this.getter);
|
|
1013
1028
|
}
|
|
1014
|
-
triggerRefValue(self,
|
|
1029
|
+
triggerRefValue(self, 3);
|
|
1015
1030
|
}
|
|
1016
1031
|
return self._value;
|
|
1017
1032
|
}
|
|
@@ -1066,7 +1081,7 @@ function trackRefValue(ref2) {
|
|
|
1066
1081
|
);
|
|
1067
1082
|
}
|
|
1068
1083
|
}
|
|
1069
|
-
function triggerRefValue(ref2, dirtyLevel =
|
|
1084
|
+
function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
|
|
1070
1085
|
ref2 = toRaw(ref2);
|
|
1071
1086
|
const dep = ref2.dep;
|
|
1072
1087
|
if (dep) {
|
|
@@ -1077,7 +1092,8 @@ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
|
|
|
1077
1092
|
target: ref2,
|
|
1078
1093
|
type: "set",
|
|
1079
1094
|
key: "value",
|
|
1080
|
-
newValue: newVal
|
|
1095
|
+
newValue: newVal,
|
|
1096
|
+
oldValue: oldVal
|
|
1081
1097
|
}
|
|
1082
1098
|
);
|
|
1083
1099
|
}
|
|
@@ -1113,14 +1129,15 @@ class RefImpl {
|
|
|
1113
1129
|
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1114
1130
|
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1115
1131
|
if (shared.hasChanged(newVal, this._rawValue)) {
|
|
1132
|
+
const oldVal = this._rawValue;
|
|
1116
1133
|
this._rawValue = newVal;
|
|
1117
1134
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1118
|
-
triggerRefValue(this,
|
|
1135
|
+
triggerRefValue(this, 5, newVal, oldVal);
|
|
1119
1136
|
}
|
|
1120
1137
|
}
|
|
1121
1138
|
}
|
|
1122
1139
|
function triggerRef(ref2) {
|
|
1123
|
-
triggerRefValue(ref2,
|
|
1140
|
+
triggerRefValue(ref2, 5, ref2.value );
|
|
1124
1141
|
}
|
|
1125
1142
|
function unref(ref2) {
|
|
1126
1143
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -114,7 +114,7 @@ class ReactiveEffect {
|
|
|
114
114
|
/**
|
|
115
115
|
* @internal
|
|
116
116
|
*/
|
|
117
|
-
this._dirtyLevel =
|
|
117
|
+
this._dirtyLevel = 5;
|
|
118
118
|
/**
|
|
119
119
|
* @internal
|
|
120
120
|
*/
|
|
@@ -134,14 +134,18 @@ class ReactiveEffect {
|
|
|
134
134
|
recordEffectScope(this, scope);
|
|
135
135
|
}
|
|
136
136
|
get dirty() {
|
|
137
|
-
if (this._dirtyLevel === 2
|
|
137
|
+
if (this._dirtyLevel === 2)
|
|
138
|
+
return false;
|
|
139
|
+
if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
|
|
138
140
|
this._dirtyLevel = 1;
|
|
139
141
|
pauseTracking();
|
|
140
142
|
for (let i = 0; i < this._depsLength; i++) {
|
|
141
143
|
const dep = this.deps[i];
|
|
142
144
|
if (dep.computed) {
|
|
145
|
+
if (dep.computed.effect._dirtyLevel === 2)
|
|
146
|
+
return true;
|
|
143
147
|
triggerComputed(dep.computed);
|
|
144
|
-
if (this._dirtyLevel >=
|
|
148
|
+
if (this._dirtyLevel >= 5) {
|
|
145
149
|
break;
|
|
146
150
|
}
|
|
147
151
|
}
|
|
@@ -151,10 +155,10 @@ class ReactiveEffect {
|
|
|
151
155
|
}
|
|
152
156
|
resetTracking();
|
|
153
157
|
}
|
|
154
|
-
return this._dirtyLevel >=
|
|
158
|
+
return this._dirtyLevel >= 5;
|
|
155
159
|
}
|
|
156
160
|
set dirty(v) {
|
|
157
|
-
this._dirtyLevel = v ?
|
|
161
|
+
this._dirtyLevel = v ? 5 : 0;
|
|
158
162
|
}
|
|
159
163
|
run() {
|
|
160
164
|
this._dirtyLevel = 0;
|
|
@@ -220,8 +224,7 @@ function effect(fn, options) {
|
|
|
220
224
|
});
|
|
221
225
|
if (options) {
|
|
222
226
|
shared.extend(_effect, options);
|
|
223
|
-
if (options.scope)
|
|
224
|
-
recordEffectScope(_effect, options.scope);
|
|
227
|
+
if (options.scope) recordEffectScope(_effect, options.scope);
|
|
225
228
|
}
|
|
226
229
|
if (!options || !options.lazy) {
|
|
227
230
|
_effect.run();
|
|
@@ -275,14 +278,23 @@ const queueEffectSchedulers = [];
|
|
|
275
278
|
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
276
279
|
pauseScheduling();
|
|
277
280
|
for (const effect2 of dep.keys()) {
|
|
281
|
+
if (!dep.computed && effect2.computed) {
|
|
282
|
+
if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
|
|
283
|
+
effect2._dirtyLevel = 2;
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
278
287
|
let tracking;
|
|
279
288
|
if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
280
289
|
effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
|
|
290
|
+
if (effect2.computed && effect2._dirtyLevel === 2) {
|
|
291
|
+
effect2._shouldSchedule = true;
|
|
292
|
+
}
|
|
281
293
|
effect2._dirtyLevel = dirtyLevel;
|
|
282
294
|
}
|
|
283
295
|
if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
284
296
|
effect2.trigger();
|
|
285
|
-
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !==
|
|
297
|
+
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
|
|
286
298
|
effect2._shouldSchedule = false;
|
|
287
299
|
if (effect2.scheduler) {
|
|
288
300
|
queueEffectSchedulers.push(effect2.scheduler);
|
|
@@ -368,7 +380,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
368
380
|
if (dep) {
|
|
369
381
|
triggerEffects(
|
|
370
382
|
dep,
|
|
371
|
-
|
|
383
|
+
5);
|
|
372
384
|
}
|
|
373
385
|
}
|
|
374
386
|
resetScheduling();
|
|
@@ -412,8 +424,7 @@ function createArrayInstrumentations() {
|
|
|
412
424
|
return instrumentations;
|
|
413
425
|
}
|
|
414
426
|
function hasOwnProperty(key) {
|
|
415
|
-
if (!shared.isSymbol(key))
|
|
416
|
-
key = String(key);
|
|
427
|
+
if (!shared.isSymbol(key)) key = String(key);
|
|
417
428
|
const obj = toRaw(this);
|
|
418
429
|
track(obj, "has", key);
|
|
419
430
|
return obj.hasOwnProperty(key);
|
|
@@ -922,7 +933,7 @@ class ComputedRefImpl {
|
|
|
922
933
|
() => getter(this._value),
|
|
923
934
|
() => triggerRefValue(
|
|
924
935
|
this,
|
|
925
|
-
this.effect._dirtyLevel ===
|
|
936
|
+
this.effect._dirtyLevel === 3 ? 3 : 4
|
|
926
937
|
)
|
|
927
938
|
);
|
|
928
939
|
this.effect.computed = this;
|
|
@@ -932,11 +943,11 @@ class ComputedRefImpl {
|
|
|
932
943
|
get value() {
|
|
933
944
|
const self = toRaw(this);
|
|
934
945
|
if ((!self._cacheable || self.effect.dirty) && shared.hasChanged(self._value, self._value = self.effect.run())) {
|
|
935
|
-
triggerRefValue(self,
|
|
946
|
+
triggerRefValue(self, 5);
|
|
936
947
|
}
|
|
937
948
|
trackRefValue(self);
|
|
938
949
|
if (self.effect._dirtyLevel >= 2) {
|
|
939
|
-
triggerRefValue(self,
|
|
950
|
+
triggerRefValue(self, 3);
|
|
940
951
|
}
|
|
941
952
|
return self._value;
|
|
942
953
|
}
|
|
@@ -979,7 +990,7 @@ function trackRefValue(ref2) {
|
|
|
979
990
|
));
|
|
980
991
|
}
|
|
981
992
|
}
|
|
982
|
-
function triggerRefValue(ref2, dirtyLevel =
|
|
993
|
+
function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
|
|
983
994
|
ref2 = toRaw(ref2);
|
|
984
995
|
const dep = ref2.dep;
|
|
985
996
|
if (dep) {
|
|
@@ -1019,14 +1030,15 @@ class RefImpl {
|
|
|
1019
1030
|
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1020
1031
|
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1021
1032
|
if (shared.hasChanged(newVal, this._rawValue)) {
|
|
1033
|
+
this._rawValue;
|
|
1022
1034
|
this._rawValue = newVal;
|
|
1023
1035
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1024
|
-
triggerRefValue(this,
|
|
1036
|
+
triggerRefValue(this, 5);
|
|
1025
1037
|
}
|
|
1026
1038
|
}
|
|
1027
1039
|
}
|
|
1028
1040
|
function triggerRef(ref2) {
|
|
1029
|
-
triggerRefValue(ref2,
|
|
1041
|
+
triggerRefValue(ref2, 5);
|
|
1030
1042
|
}
|
|
1031
1043
|
function unref(ref2) {
|
|
1032
1044
|
return isRef(ref2) ? ref2.value : ref2;
|
package/dist/reactivity.d.ts
CHANGED
|
@@ -200,6 +200,11 @@ export declare function computed<T>(getter: ComputedGetter<T>, debugOptions?: De
|
|
|
200
200
|
export declare function computed<T>(options: WritableComputedOptions<T>, debugOptions?: DebuggerOptions): WritableComputedRef<T>;
|
|
201
201
|
|
|
202
202
|
export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
|
203
|
+
declare const ReactiveMarkerSymbol: unique symbol;
|
|
204
|
+
export declare class ReactiveMarker {
|
|
205
|
+
private [ReactiveMarkerSymbol]?;
|
|
206
|
+
}
|
|
207
|
+
export type Reactive<T> = UnwrapNestedRefs<T> & (T extends readonly any[] ? ReactiveMarker : {});
|
|
203
208
|
/**
|
|
204
209
|
* Returns a reactive proxy of the object.
|
|
205
210
|
*
|
|
@@ -215,7 +220,7 @@ export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
|
|
215
220
|
* @param target - The source object.
|
|
216
221
|
* @see {@link https://vuejs.org/api/reactivity-core.html#reactive}
|
|
217
222
|
*/
|
|
218
|
-
export declare function reactive<T extends object>(target: T):
|
|
223
|
+
export declare function reactive<T extends object>(target: T): Reactive<T>;
|
|
219
224
|
declare const ShallowReactiveMarker: unique symbol;
|
|
220
225
|
export type ShallowReactive<T> = T & {
|
|
221
226
|
[ShallowReactiveMarker]?: true;
|
|
@@ -602,7 +607,6 @@ export type ToRef<T> = IfAny<T, Ref<T>, [T] extends [Ref] ? T : Ref<T>>;
|
|
|
602
607
|
export declare function toRef<T>(value: T): T extends () => infer R ? Readonly<Ref<R>> : T extends Ref ? T : Ref<UnwrapRef<T>>;
|
|
603
608
|
export declare function toRef<T extends object, K extends keyof T>(object: T, key: K): ToRef<T[K]>;
|
|
604
609
|
export declare function toRef<T extends object, K extends keyof T>(object: T, key: K, defaultValue: T[K]): ToRef<Exclude<T[K], undefined>>;
|
|
605
|
-
type BaseTypes = string | number | boolean;
|
|
606
610
|
/**
|
|
607
611
|
* This is a special exported interface for other packages to declare
|
|
608
612
|
* additional types that should bail out for ref unwrapping. For example
|
|
@@ -619,11 +623,11 @@ type BaseTypes = string | number | boolean;
|
|
|
619
623
|
export interface RefUnwrapBailTypes {
|
|
620
624
|
}
|
|
621
625
|
export type ShallowUnwrapRef<T> = {
|
|
622
|
-
[K in keyof T]:
|
|
626
|
+
[K in keyof T]: DistributeRef<T[K]>;
|
|
623
627
|
};
|
|
624
|
-
type
|
|
628
|
+
type DistributeRef<T> = T extends Ref<infer V> ? V : T;
|
|
625
629
|
export type UnwrapRef<T> = T extends ShallowRef<infer V> ? V : T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
|
626
|
-
type UnwrapRefSimple<T> = T extends
|
|
630
|
+
type UnwrapRefSimple<T> = T extends Builtin | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | {
|
|
627
631
|
[RawSymbol]?: true;
|
|
628
632
|
} ? T : T extends Map<infer K, infer V> ? Map<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Map<any, any>>> : T extends WeakMap<infer K, infer V> ? WeakMap<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakMap<any, any>>> : T extends Set<infer V> ? Set<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Set<any>>> : T extends WeakSet<infer V> ? WeakSet<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakSet<any>>> : T extends ReadonlyArray<any> ? {
|
|
629
633
|
[K in keyof T]: UnwrapRefSimple<T[K]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -162,7 +162,7 @@ class ReactiveEffect {
|
|
|
162
162
|
/**
|
|
163
163
|
* @internal
|
|
164
164
|
*/
|
|
165
|
-
this._dirtyLevel =
|
|
165
|
+
this._dirtyLevel = 5;
|
|
166
166
|
/**
|
|
167
167
|
* @internal
|
|
168
168
|
*/
|
|
@@ -182,14 +182,18 @@ class ReactiveEffect {
|
|
|
182
182
|
recordEffectScope(this, scope);
|
|
183
183
|
}
|
|
184
184
|
get dirty() {
|
|
185
|
-
if (this._dirtyLevel === 2
|
|
185
|
+
if (this._dirtyLevel === 2)
|
|
186
|
+
return false;
|
|
187
|
+
if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
|
|
186
188
|
this._dirtyLevel = 1;
|
|
187
189
|
pauseTracking();
|
|
188
190
|
for (let i = 0; i < this._depsLength; i++) {
|
|
189
191
|
const dep = this.deps[i];
|
|
190
192
|
if (dep.computed) {
|
|
193
|
+
if (dep.computed.effect._dirtyLevel === 2)
|
|
194
|
+
return true;
|
|
191
195
|
triggerComputed(dep.computed);
|
|
192
|
-
if (this._dirtyLevel >=
|
|
196
|
+
if (this._dirtyLevel >= 5) {
|
|
193
197
|
break;
|
|
194
198
|
}
|
|
195
199
|
}
|
|
@@ -199,10 +203,10 @@ class ReactiveEffect {
|
|
|
199
203
|
}
|
|
200
204
|
resetTracking();
|
|
201
205
|
}
|
|
202
|
-
return this._dirtyLevel >=
|
|
206
|
+
return this._dirtyLevel >= 5;
|
|
203
207
|
}
|
|
204
208
|
set dirty(v) {
|
|
205
|
-
this._dirtyLevel = v ?
|
|
209
|
+
this._dirtyLevel = v ? 5 : 0;
|
|
206
210
|
}
|
|
207
211
|
run() {
|
|
208
212
|
this._dirtyLevel = 0;
|
|
@@ -268,8 +272,7 @@ function effect(fn, options) {
|
|
|
268
272
|
});
|
|
269
273
|
if (options) {
|
|
270
274
|
extend(_effect, options);
|
|
271
|
-
if (options.scope)
|
|
272
|
-
recordEffectScope(_effect, options.scope);
|
|
275
|
+
if (options.scope) recordEffectScope(_effect, options.scope);
|
|
273
276
|
}
|
|
274
277
|
if (!options || !options.lazy) {
|
|
275
278
|
_effect.run();
|
|
@@ -328,9 +331,18 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
|
328
331
|
var _a;
|
|
329
332
|
pauseScheduling();
|
|
330
333
|
for (const effect2 of dep.keys()) {
|
|
334
|
+
if (!dep.computed && effect2.computed) {
|
|
335
|
+
if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
|
|
336
|
+
effect2._dirtyLevel = 2;
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
331
340
|
let tracking;
|
|
332
341
|
if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
333
342
|
effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
|
|
343
|
+
if (effect2.computed && effect2._dirtyLevel === 2) {
|
|
344
|
+
effect2._shouldSchedule = true;
|
|
345
|
+
}
|
|
334
346
|
effect2._dirtyLevel = dirtyLevel;
|
|
335
347
|
}
|
|
336
348
|
if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
@@ -338,7 +350,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
|
338
350
|
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
339
351
|
}
|
|
340
352
|
effect2.trigger();
|
|
341
|
-
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !==
|
|
353
|
+
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
|
|
342
354
|
effect2._shouldSchedule = false;
|
|
343
355
|
if (effect2.scheduler) {
|
|
344
356
|
queueEffectSchedulers.push(effect2.scheduler);
|
|
@@ -430,7 +442,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
430
442
|
if (dep) {
|
|
431
443
|
triggerEffects(
|
|
432
444
|
dep,
|
|
433
|
-
|
|
445
|
+
5,
|
|
434
446
|
{
|
|
435
447
|
target,
|
|
436
448
|
type,
|
|
@@ -483,8 +495,7 @@ function createArrayInstrumentations() {
|
|
|
483
495
|
return instrumentations;
|
|
484
496
|
}
|
|
485
497
|
function hasOwnProperty(key) {
|
|
486
|
-
if (!isSymbol(key))
|
|
487
|
-
key = String(key);
|
|
498
|
+
if (!isSymbol(key)) key = String(key);
|
|
488
499
|
const obj = toRaw(this);
|
|
489
500
|
track(obj, "has", key);
|
|
490
501
|
return obj.hasOwnProperty(key);
|
|
@@ -968,7 +979,11 @@ function shallowReadonly(target) {
|
|
|
968
979
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
969
980
|
if (!isObject(target)) {
|
|
970
981
|
{
|
|
971
|
-
warn(
|
|
982
|
+
warn(
|
|
983
|
+
`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
|
|
984
|
+
target
|
|
985
|
+
)}`
|
|
986
|
+
);
|
|
972
987
|
}
|
|
973
988
|
return target;
|
|
974
989
|
}
|
|
@@ -1030,7 +1045,7 @@ class ComputedRefImpl {
|
|
|
1030
1045
|
() => getter(this._value),
|
|
1031
1046
|
() => triggerRefValue(
|
|
1032
1047
|
this,
|
|
1033
|
-
this.effect._dirtyLevel ===
|
|
1048
|
+
this.effect._dirtyLevel === 3 ? 3 : 4
|
|
1034
1049
|
)
|
|
1035
1050
|
);
|
|
1036
1051
|
this.effect.computed = this;
|
|
@@ -1040,7 +1055,7 @@ class ComputedRefImpl {
|
|
|
1040
1055
|
get value() {
|
|
1041
1056
|
const self = toRaw(this);
|
|
1042
1057
|
if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
|
|
1043
|
-
triggerRefValue(self,
|
|
1058
|
+
triggerRefValue(self, 5);
|
|
1044
1059
|
}
|
|
1045
1060
|
trackRefValue(self);
|
|
1046
1061
|
if (self.effect._dirtyLevel >= 2) {
|
|
@@ -1049,7 +1064,7 @@ class ComputedRefImpl {
|
|
|
1049
1064
|
|
|
1050
1065
|
getter: `, this.getter);
|
|
1051
1066
|
}
|
|
1052
|
-
triggerRefValue(self,
|
|
1067
|
+
triggerRefValue(self, 3);
|
|
1053
1068
|
}
|
|
1054
1069
|
return self._value;
|
|
1055
1070
|
}
|
|
@@ -1104,7 +1119,7 @@ function trackRefValue(ref2) {
|
|
|
1104
1119
|
);
|
|
1105
1120
|
}
|
|
1106
1121
|
}
|
|
1107
|
-
function triggerRefValue(ref2, dirtyLevel =
|
|
1122
|
+
function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
|
|
1108
1123
|
ref2 = toRaw(ref2);
|
|
1109
1124
|
const dep = ref2.dep;
|
|
1110
1125
|
if (dep) {
|
|
@@ -1115,7 +1130,8 @@ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
|
|
|
1115
1130
|
target: ref2,
|
|
1116
1131
|
type: "set",
|
|
1117
1132
|
key: "value",
|
|
1118
|
-
newValue: newVal
|
|
1133
|
+
newValue: newVal,
|
|
1134
|
+
oldValue: oldVal
|
|
1119
1135
|
}
|
|
1120
1136
|
);
|
|
1121
1137
|
}
|
|
@@ -1151,14 +1167,15 @@ class RefImpl {
|
|
|
1151
1167
|
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1152
1168
|
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1153
1169
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1170
|
+
const oldVal = this._rawValue;
|
|
1154
1171
|
this._rawValue = newVal;
|
|
1155
1172
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1156
|
-
triggerRefValue(this,
|
|
1173
|
+
triggerRefValue(this, 5, newVal, oldVal);
|
|
1157
1174
|
}
|
|
1158
1175
|
}
|
|
1159
1176
|
}
|
|
1160
1177
|
function triggerRef(ref2) {
|
|
1161
|
-
triggerRefValue(ref2,
|
|
1178
|
+
triggerRefValue(ref2, 5, ref2.value );
|
|
1162
1179
|
}
|
|
1163
1180
|
function unref(ref2) {
|
|
1164
1181
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
7
|
-
function t(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const e=()=>{},s=Object.assign,n=Object.prototype.hasOwnProperty,i=(t,e)=>n.call(t,e),r=Array.isArray,c=t=>"[object Map]"===a(t),o=t=>"function"==typeof t,u=t=>"symbol"==typeof t,h=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,a=t=>l.call(t),_=t=>a(t).slice(8,-1),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,d=(t,e)=>!Object.is(t,e);let p,v;class g{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=p,!t&&p&&(this.index=(p.scopes||(p.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=p;try{return p=this,t()}finally{p=e}}}on(){p=this}off(){p=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function y(t){return new g(t)}function w(t,e=p){e&&e.active&&e.effects.push(t)}function b(){return p}function R(t){p&&p.cleanups.push(t)}class S{constructor(t,e,s,n){this.fn=t,this.trigger=e,this.scheduler=s,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,w(this,n)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,A();for(let t=0;t<this._depsLength;t++){const e=this.deps[t];if(e.computed&&(L(e.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),W()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=x,e=v;try{return x=!0,v=this,this._runnings++,k(this),this.fn()}finally{E(this),this._runnings--,v=e,x=t}}stop(){this.active&&(k(this),E(this),this.onStop&&this.onStop(),this.active=!1)}}function L(t){return t.value}function k(t){t._trackId++,t._depsLength=0}function E(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e<t.deps.length;e++)O(t.deps[e],t);t.deps.length=t._depsLength}}function O(t,e){const s=t.get(e);void 0!==s&&e._trackId!==s&&(t.delete(e),0===t.size&&t.cleanup())}function m(t,n){t.effect instanceof S&&(t=t.effect.fn);const i=new S(t,e,(()=>{i.dirty&&i.run()}));n&&(s(i,n),n.scope&&w(i,n.scope)),n&&n.lazy||i.run();const r=i.run.bind(i);return r.effect=i,r}function j(t){t.effect.stop()}let x=!0,I=0;const P=[];function A(){P.push(x),x=!1}function M(){P.push(x),x=!0}function W(){const t=P.pop();x=void 0===t||t}function z(){I++}function V(){for(I--;!I&&T.length;)T.shift()()}function N(t,e,s){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const s=t.deps[t._depsLength];s!==e?(s&&O(s,t),t.deps[t._depsLength++]=e):t._depsLength++}}const T=[];function D(t,e,s){z();for(const n of t.keys()){let s;n._dirtyLevel<e&&(null!=s?s:s=t.get(n)===n._trackId)&&(n._shouldSchedule||(n._shouldSchedule=0===n._dirtyLevel),n._dirtyLevel=e),n._shouldSchedule&&(null!=s?s:s=t.get(n)===n._trackId)&&(n.trigger(),n._runnings&&!n.allowRecurse||2===n._dirtyLevel||(n._shouldSchedule=!1,n.scheduler&&T.push(n.scheduler)))}V()}const K=(t,e)=>{const s=new Map;return s.cleanup=t,s.computed=e,s},C=new WeakMap,H=Symbol(""),G=Symbol("");function Y(t,e,s){if(x&&v){let e=C.get(t);e||C.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=K((()=>e.delete(s)))),N(v,n)}}function q(t,e,s,n,i,o){const h=C.get(t);if(!h)return;let l=[];if("clear"===e)l=[...h.values()];else if("length"===s&&r(t)){const t=Number(n);h.forEach(((e,s)=>{("length"===s||!u(s)&&s>=t)&&l.push(e)}))}else switch(void 0!==s&&l.push(h.get(s)),e){case"add":r(t)?f(s)&&l.push(h.get("length")):(l.push(h.get(H)),c(t)&&l.push(h.get(G)));break;case"delete":r(t)||(l.push(h.get(H)),c(t)&&l.push(h.get(G)));break;case"set":c(t)&&l.push(h.get(H))}z();for(const r of l)r&&D(r,4);V()}const B=t("__proto__,__v_isRef,__isVue"),F=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(u)),J=Q();function Q(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const s=Dt(this);for(let e=0,i=this.length;e<i;e++)Y(s,0,e+"");const n=s[e](...t);return-1===n||!1===n?s[e](...t.map(Dt)):n}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){A(),z();const s=Dt(this)[e].apply(this,t);return V(),W(),s}})),t}function U(t){u(t)||(t=String(t));const e=Dt(this);return Y(e,0,t),e.hasOwnProperty(t)}class X{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,c=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return c;if("__v_raw"===e)return s===(n?c?xt:jt:c?mt:Ot).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=r(t);if(!n){if(o&&i(J,e))return Reflect.get(J,e,s);if("hasOwnProperty"===e)return U}const l=Reflect.get(t,e,s);return(u(e)?F.has(e):B(e))?l:(n||Y(t,0,e),c?l:Ft(l)?o&&f(e)?l:l.value:h(l)?n?At(l):It(l):l)}}class Z extends X{constructor(t=!1){super(!1,t)}set(t,e,s,n){let c=t[e];if(!this._isShallow){const e=Vt(c);if(Nt(s)||Vt(s)||(c=Dt(c),s=Dt(s)),!r(t)&&Ft(c)&&!Ft(s))return!e&&(c.value=s,!0)}const o=r(t)&&f(e)?Number(e)<t.length:i(t,e),u=Reflect.set(t,e,s,n);return t===Dt(n)&&(o?d(s,c)&&q(t,"set",e,s):q(t,"add",e,s)),u}deleteProperty(t,e){const s=i(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&q(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return u(e)&&F.has(e)||Y(t,0,e),s}ownKeys(t){return Y(t,0,r(t)?"length":H),Reflect.ownKeys(t)}}class $ extends X{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const tt=new Z,et=new $,st=new Z(!0),nt=new $(!0),it=t=>t,rt=t=>Reflect.getPrototypeOf(t);function ct(t,e,s=!1,n=!1){const i=Dt(t=t.__v_raw),r=Dt(e);s||(d(e,r)&&Y(i,0,e),Y(i,0,r));const{has:c}=rt(i),o=n?it:s?Ht:Ct;return c.call(i,e)?o(t.get(e)):c.call(i,r)?o(t.get(r)):void(t!==i&&t.get(e))}function ot(t,e=!1){const s=this.__v_raw,n=Dt(s),i=Dt(t);return e||(d(t,i)&&Y(n,0,t),Y(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function ut(t,e=!1){return t=t.__v_raw,!e&&Y(Dt(t),0,H),Reflect.get(t,"size",t)}function ht(t){t=Dt(t);const e=Dt(this);return rt(e).has.call(e,t)||(e.add(t),q(e,"add",t,t)),this}function lt(t,e){e=Dt(e);const s=Dt(this),{has:n,get:i}=rt(s);let r=n.call(s,t);r||(t=Dt(t),r=n.call(s,t));const c=i.call(s,t);return s.set(t,e),r?d(e,c)&&q(s,"set",t,e):q(s,"add",t,e),this}function at(t){const e=Dt(this),{has:s,get:n}=rt(e);let i=s.call(e,t);i||(t=Dt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&q(e,"delete",t,void 0),r}function _t(){const t=Dt(this),e=0!==t.size,s=t.clear();return e&&q(t,"clear",void 0,void 0),s}function ft(t,e){return function(s,n){const i=this,r=i.__v_raw,c=Dt(r),o=e?it:t?Ht:Ct;return!t&&Y(c,0,H),r.forEach(((t,e)=>s.call(n,o(t),o(e),i)))}}function dt(t,e,s){return function(...n){const i=this.__v_raw,r=Dt(i),o=c(r),u="entries"===t||t===Symbol.iterator&&o,h="keys"===t&&o,l=i[t](...n),a=s?it:e?Ht:Ct;return!e&&Y(r,0,h?G:H),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[a(t[0]),a(t[1])]:a(t),done:e}},[Symbol.iterator](){return this}}}}function pt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function vt(){const t={get(t){return ct(this,t)},get size(){return ut(this)},has:ot,add:ht,set:lt,delete:at,clear:_t,forEach:ft(!1,!1)},e={get(t){return ct(this,t,!1,!0)},get size(){return ut(this)},has:ot,add:ht,set:lt,delete:at,clear:_t,forEach:ft(!1,!0)},s={get(t){return ct(this,t,!0)},get size(){return ut(this,!0)},has(t){return ot.call(this,t,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:ft(!0,!1)},n={get(t){return ct(this,t,!0,!0)},get size(){return ut(this,!0)},has(t){return ot.call(this,t,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:ft(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=dt(i,!1,!1),s[i]=dt(i,!0,!1),e[i]=dt(i,!1,!0),n[i]=dt(i,!0,!0)})),[t,s,e,n]}const[gt,yt,wt,bt]=vt();function Rt(t,e){const s=e?t?bt:wt:t?yt:gt;return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(i(s,n)&&n in e?s:e,n,r)}const St={get:Rt(!1,!1)},Lt={get:Rt(!1,!0)},kt={get:Rt(!0,!1)},Et={get:Rt(!0,!0)},Ot=new WeakMap,mt=new WeakMap,jt=new WeakMap,xt=new WeakMap;function It(t){return Vt(t)?t:Wt(t,!1,tt,St,Ot)}function Pt(t){return Wt(t,!1,st,Lt,mt)}function At(t){return Wt(t,!0,et,kt,jt)}function Mt(t){return Wt(t,!0,nt,Et,xt)}function Wt(t,e,s,n,i){if(!h(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const c=(o=t).__v_skip||!Object.isExtensible(o)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(_(o));var o;if(0===c)return t;const u=new Proxy(t,2===c?n:s);return i.set(t,u),u}function zt(t){return Vt(t)?zt(t.__v_raw):!(!t||!t.__v_isReactive)}function Vt(t){return!(!t||!t.__v_isReadonly)}function Nt(t){return!(!t||!t.__v_isShallow)}function Tt(t){return!!t&&!!t.__v_raw}function Dt(t){const e=t&&t.__v_raw;return e?Dt(e):t}function Kt(t){return Object.isExtensible(t)&&((t,e,s,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:s})})(t,"__v_skip",!0),t}const Ct=t=>h(t)?It(t):t,Ht=t=>h(t)?At(t):t;class Gt{constructor(t,e,s,n){this.getter=t,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new S((()=>t(this._value)),(()=>Bt(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=s}get value(){const t=Dt(this);return t._cacheable&&!t.effect.dirty||!d(t._value,t._value=t.effect.run())||Bt(t,4),qt(t),t.effect._dirtyLevel>=2&&Bt(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Yt(t,s,n=!1){let i,r;const c=o(t);c?(i=t,r=e):(i=t.get,r=t.set);return new Gt(i,r,c||!r,n)}function qt(t){var e;x&&v&&(t=Dt(t),N(v,null!=(e=t.dep)?e:t.dep=K((()=>t.dep=void 0),t instanceof Gt?t:void 0)))}function Bt(t,e=4,s){const n=(t=Dt(t)).dep;n&&D(n,e)}function Ft(t){return!(!t||!0!==t.__v_isRef)}function Jt(t){return Ut(t,!1)}function Qt(t){return Ut(t,!0)}function Ut(t,e){return Ft(t)?t:new Xt(t,e)}class Xt{constructor(t,e){this.__v_isShallow=e,this.dep=void 0,this.__v_isRef=!0,this._rawValue=e?t:Dt(t),this._value=e?t:Ct(t)}get value(){return qt(this),this._value}set value(t){const e=this.__v_isShallow||Nt(t)||Vt(t);t=e?t:Dt(t),d(t,this._rawValue)&&(this._rawValue=t,this._value=e?t:Ct(t),Bt(this,4))}}function Zt(t){Bt(t,4)}function $t(t){return Ft(t)?t.value:t}function te(t){return o(t)?t():$t(t)}const ee={get:(t,e,s)=>$t(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Ft(i)&&!Ft(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};function se(t){return zt(t)?t:new Proxy(t,ee)}class ne{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:e,set:s}=t((()=>qt(this)),(()=>Bt(this)));this._get=e,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}function ie(t){return new ne(t)}function re(t){const e=r(t)?new Array(t.length):{};for(const s in t)e[s]=he(t,s);return e}class ce{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return function(t,e){const s=C.get(t);return s&&s.get(e)}(Dt(this._object),this._key)}}class oe{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function ue(t,e,s){return Ft(t)?t:o(t)?new oe(t):h(t)&&arguments.length>1?he(t,e,s):Jt(t)}function he(t,e,s){const n=t[e];return Ft(n)?n:new ce(t,e,s)}const le=Yt,ae={GET:"get",HAS:"has",ITERATE:"iterate"},_e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},fe={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"};export{g as EffectScope,H as ITERATE_KEY,S as ReactiveEffect,fe as ReactiveFlags,ae as TrackOpTypes,_e as TriggerOpTypes,Yt as computed,ie as customRef,le as deferredComputed,m as effect,y as effectScope,M as enableTracking,b as getCurrentScope,Tt as isProxy,zt as isReactive,Vt as isReadonly,Ft as isRef,Nt as isShallow,Kt as markRaw,R as onScopeDispose,z as pauseScheduling,A as pauseTracking,se as proxyRefs,It as reactive,At as readonly,Jt as ref,V as resetScheduling,W as resetTracking,Pt as shallowReactive,Mt as shallowReadonly,Qt as shallowRef,j as stop,Dt as toRaw,ue as toRef,re as toRefs,te as toValue,Y as track,q as trigger,Zt as triggerRef,$t as unref};
|
|
7
|
+
function t(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const e=()=>{},s=Object.assign,n=Object.prototype.hasOwnProperty,i=(t,e)=>n.call(t,e),r=Array.isArray,c=t=>"[object Map]"===a(t),o=t=>"function"==typeof t,u=t=>"symbol"==typeof t,h=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,a=t=>l.call(t),_=t=>a(t).slice(8,-1),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,d=(t,e)=>!Object.is(t,e);let p,v;class g{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=p,!t&&p&&(this.index=(p.scopes||(p.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=p;try{return p=this,t()}finally{p=e}}}on(){p=this}off(){p=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function y(t){return new g(t)}function w(t,e=p){e&&e.active&&e.effects.push(t)}function b(){return p}function R(t){p&&p.cleanups.push(t)}class S{constructor(t,e,s,n){this.fn=t,this.trigger=e,this.scheduler=s,this.active=!0,this.deps=[],this._dirtyLevel=5,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,w(this,n)}get dirty(){if(2===this._dirtyLevel)return!1;if(3===this._dirtyLevel||4===this._dirtyLevel){this._dirtyLevel=1,A();for(let t=0;t<this._depsLength;t++){const e=this.deps[t];if(e.computed){if(2===e.computed.effect._dirtyLevel)return!0;if(L(e.computed),this._dirtyLevel>=5)break}}1===this._dirtyLevel&&(this._dirtyLevel=0),W()}return this._dirtyLevel>=5}set dirty(t){this._dirtyLevel=t?5:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=I,e=v;try{return I=!0,v=this,this._runnings++,k(this),this.fn()}finally{m(this),this._runnings--,v=e,I=t}}stop(){this.active&&(k(this),m(this),this.onStop&&this.onStop(),this.active=!1)}}function L(t){return t.value}function k(t){t._trackId++,t._depsLength=0}function m(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e<t.deps.length;e++)E(t.deps[e],t);t.deps.length=t._depsLength}}function E(t,e){const s=t.get(e);void 0!==s&&e._trackId!==s&&(t.delete(e),0===t.size&&t.cleanup())}function O(t,n){t.effect instanceof S&&(t=t.effect.fn);const i=new S(t,e,(()=>{i.dirty&&i.run()}));n&&(s(i,n),n.scope&&w(i,n.scope)),n&&n.lazy||i.run();const r=i.run.bind(i);return r.effect=i,r}function j(t){t.effect.stop()}let I=!0,x=0;const P=[];function A(){P.push(I),I=!1}function M(){P.push(I),I=!0}function W(){const t=P.pop();I=void 0===t||t}function z(){x++}function V(){for(x--;!x&&T.length;)T.shift()()}function N(t,e,s){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const s=t.deps[t._depsLength];s!==e?(s&&E(s,t),t.deps[t._depsLength++]=e):t._depsLength++}}const T=[];function D(t,e,s){z();for(const n of t.keys()){if(!t.computed&&n.computed&&t.get(n)===n._trackId&&n._runnings>0){n._dirtyLevel=2;continue}let s;n._dirtyLevel<e&&(null!=s?s:s=t.get(n)===n._trackId)&&(n._shouldSchedule||(n._shouldSchedule=0===n._dirtyLevel),n.computed&&2===n._dirtyLevel&&(n._shouldSchedule=!0),n._dirtyLevel=e),n._shouldSchedule&&(null!=s?s:s=t.get(n)===n._trackId)&&(n.trigger(),n._runnings&&!n.allowRecurse||3===n._dirtyLevel||(n._shouldSchedule=!1,n.scheduler&&T.push(n.scheduler)))}V()}const K=(t,e)=>{const s=new Map;return s.cleanup=t,s.computed=e,s},C=new WeakMap,H=Symbol(""),G=Symbol("");function Y(t,e,s){if(I&&v){let e=C.get(t);e||C.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=K((()=>e.delete(s)))),N(v,n)}}function q(t,e,s,n,i,o){const h=C.get(t);if(!h)return;let l=[];if("clear"===e)l=[...h.values()];else if("length"===s&&r(t)){const t=Number(n);h.forEach(((e,s)=>{("length"===s||!u(s)&&s>=t)&&l.push(e)}))}else switch(void 0!==s&&l.push(h.get(s)),e){case"add":r(t)?f(s)&&l.push(h.get("length")):(l.push(h.get(H)),c(t)&&l.push(h.get(G)));break;case"delete":r(t)||(l.push(h.get(H)),c(t)&&l.push(h.get(G)));break;case"set":c(t)&&l.push(h.get(H))}z();for(const r of l)r&&D(r,5);V()}const B=t("__proto__,__v_isRef,__isVue"),F=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(u)),J=Q();function Q(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const s=Dt(this);for(let e=0,i=this.length;e<i;e++)Y(s,0,e+"");const n=s[e](...t);return-1===n||!1===n?s[e](...t.map(Dt)):n}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){A(),z();const s=Dt(this)[e].apply(this,t);return V(),W(),s}})),t}function U(t){u(t)||(t=String(t));const e=Dt(this);return Y(e,0,t),e.hasOwnProperty(t)}class X{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,c=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return c;if("__v_raw"===e)return s===(n?c?It:jt:c?Ot:Et).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=r(t);if(!n){if(o&&i(J,e))return Reflect.get(J,e,s);if("hasOwnProperty"===e)return U}const l=Reflect.get(t,e,s);return(u(e)?F.has(e):B(e))?l:(n||Y(t,0,e),c?l:Ft(l)?o&&f(e)?l:l.value:h(l)?n?At(l):xt(l):l)}}class Z extends X{constructor(t=!1){super(!1,t)}set(t,e,s,n){let c=t[e];if(!this._isShallow){const e=Vt(c);if(Nt(s)||Vt(s)||(c=Dt(c),s=Dt(s)),!r(t)&&Ft(c)&&!Ft(s))return!e&&(c.value=s,!0)}const o=r(t)&&f(e)?Number(e)<t.length:i(t,e),u=Reflect.set(t,e,s,n);return t===Dt(n)&&(o?d(s,c)&&q(t,"set",e,s):q(t,"add",e,s)),u}deleteProperty(t,e){const s=i(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&q(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return u(e)&&F.has(e)||Y(t,0,e),s}ownKeys(t){return Y(t,0,r(t)?"length":H),Reflect.ownKeys(t)}}class $ extends X{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const tt=new Z,et=new $,st=new Z(!0),nt=new $(!0),it=t=>t,rt=t=>Reflect.getPrototypeOf(t);function ct(t,e,s=!1,n=!1){const i=Dt(t=t.__v_raw),r=Dt(e);s||(d(e,r)&&Y(i,0,e),Y(i,0,r));const{has:c}=rt(i),o=n?it:s?Ht:Ct;return c.call(i,e)?o(t.get(e)):c.call(i,r)?o(t.get(r)):void(t!==i&&t.get(e))}function ot(t,e=!1){const s=this.__v_raw,n=Dt(s),i=Dt(t);return e||(d(t,i)&&Y(n,0,t),Y(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function ut(t,e=!1){return t=t.__v_raw,!e&&Y(Dt(t),0,H),Reflect.get(t,"size",t)}function ht(t){t=Dt(t);const e=Dt(this);return rt(e).has.call(e,t)||(e.add(t),q(e,"add",t,t)),this}function lt(t,e){e=Dt(e);const s=Dt(this),{has:n,get:i}=rt(s);let r=n.call(s,t);r||(t=Dt(t),r=n.call(s,t));const c=i.call(s,t);return s.set(t,e),r?d(e,c)&&q(s,"set",t,e):q(s,"add",t,e),this}function at(t){const e=Dt(this),{has:s,get:n}=rt(e);let i=s.call(e,t);i||(t=Dt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&q(e,"delete",t,void 0),r}function _t(){const t=Dt(this),e=0!==t.size,s=t.clear();return e&&q(t,"clear",void 0,void 0),s}function ft(t,e){return function(s,n){const i=this,r=i.__v_raw,c=Dt(r),o=e?it:t?Ht:Ct;return!t&&Y(c,0,H),r.forEach(((t,e)=>s.call(n,o(t),o(e),i)))}}function dt(t,e,s){return function(...n){const i=this.__v_raw,r=Dt(i),o=c(r),u="entries"===t||t===Symbol.iterator&&o,h="keys"===t&&o,l=i[t](...n),a=s?it:e?Ht:Ct;return!e&&Y(r,0,h?G:H),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[a(t[0]),a(t[1])]:a(t),done:e}},[Symbol.iterator](){return this}}}}function pt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function vt(){const t={get(t){return ct(this,t)},get size(){return ut(this)},has:ot,add:ht,set:lt,delete:at,clear:_t,forEach:ft(!1,!1)},e={get(t){return ct(this,t,!1,!0)},get size(){return ut(this)},has:ot,add:ht,set:lt,delete:at,clear:_t,forEach:ft(!1,!0)},s={get(t){return ct(this,t,!0)},get size(){return ut(this,!0)},has(t){return ot.call(this,t,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:ft(!0,!1)},n={get(t){return ct(this,t,!0,!0)},get size(){return ut(this,!0)},has(t){return ot.call(this,t,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:ft(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=dt(i,!1,!1),s[i]=dt(i,!0,!1),e[i]=dt(i,!1,!0),n[i]=dt(i,!0,!0)})),[t,s,e,n]}const[gt,yt,wt,bt]=vt();function Rt(t,e){const s=e?t?bt:wt:t?yt:gt;return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(i(s,n)&&n in e?s:e,n,r)}const St={get:Rt(!1,!1)},Lt={get:Rt(!1,!0)},kt={get:Rt(!0,!1)},mt={get:Rt(!0,!0)},Et=new WeakMap,Ot=new WeakMap,jt=new WeakMap,It=new WeakMap;function xt(t){return Vt(t)?t:Wt(t,!1,tt,St,Et)}function Pt(t){return Wt(t,!1,st,Lt,Ot)}function At(t){return Wt(t,!0,et,kt,jt)}function Mt(t){return Wt(t,!0,nt,mt,It)}function Wt(t,e,s,n,i){if(!h(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const c=(o=t).__v_skip||!Object.isExtensible(o)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(_(o));var o;if(0===c)return t;const u=new Proxy(t,2===c?n:s);return i.set(t,u),u}function zt(t){return Vt(t)?zt(t.__v_raw):!(!t||!t.__v_isReactive)}function Vt(t){return!(!t||!t.__v_isReadonly)}function Nt(t){return!(!t||!t.__v_isShallow)}function Tt(t){return!!t&&!!t.__v_raw}function Dt(t){const e=t&&t.__v_raw;return e?Dt(e):t}function Kt(t){return Object.isExtensible(t)&&((t,e,s,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:s})})(t,"__v_skip",!0),t}const Ct=t=>h(t)?xt(t):t,Ht=t=>h(t)?At(t):t;class Gt{constructor(t,e,s,n){this.getter=t,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new S((()=>t(this._value)),(()=>Bt(this,3===this.effect._dirtyLevel?3:4))),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=s}get value(){const t=Dt(this);return t._cacheable&&!t.effect.dirty||!d(t._value,t._value=t.effect.run())||Bt(t,5),qt(t),t.effect._dirtyLevel>=2&&Bt(t,3),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Yt(t,s,n=!1){let i,r;const c=o(t);c?(i=t,r=e):(i=t.get,r=t.set);return new Gt(i,r,c||!r,n)}function qt(t){var e;I&&v&&(t=Dt(t),N(v,null!=(e=t.dep)?e:t.dep=K((()=>t.dep=void 0),t instanceof Gt?t:void 0)))}function Bt(t,e=5,s,n){const i=(t=Dt(t)).dep;i&&D(i,e)}function Ft(t){return!(!t||!0!==t.__v_isRef)}function Jt(t){return Ut(t,!1)}function Qt(t){return Ut(t,!0)}function Ut(t,e){return Ft(t)?t:new Xt(t,e)}class Xt{constructor(t,e){this.__v_isShallow=e,this.dep=void 0,this.__v_isRef=!0,this._rawValue=e?t:Dt(t),this._value=e?t:Ct(t)}get value(){return qt(this),this._value}set value(t){const e=this.__v_isShallow||Nt(t)||Vt(t);t=e?t:Dt(t),d(t,this._rawValue)&&(this._rawValue=t,this._value=e?t:Ct(t),Bt(this,5))}}function Zt(t){Bt(t,5)}function $t(t){return Ft(t)?t.value:t}function te(t){return o(t)?t():$t(t)}const ee={get:(t,e,s)=>$t(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Ft(i)&&!Ft(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};function se(t){return zt(t)?t:new Proxy(t,ee)}class ne{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:e,set:s}=t((()=>qt(this)),(()=>Bt(this)));this._get=e,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}function ie(t){return new ne(t)}function re(t){const e=r(t)?new Array(t.length):{};for(const s in t)e[s]=he(t,s);return e}class ce{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return function(t,e){const s=C.get(t);return s&&s.get(e)}(Dt(this._object),this._key)}}class oe{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function ue(t,e,s){return Ft(t)?t:o(t)?new oe(t):h(t)&&arguments.length>1?he(t,e,s):Jt(t)}function he(t,e,s){const n=t[e];return Ft(n)?n:new ce(t,e,s)}const le=Yt,ae={GET:"get",HAS:"has",ITERATE:"iterate"},_e={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},fe={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"};export{g as EffectScope,H as ITERATE_KEY,S as ReactiveEffect,fe as ReactiveFlags,ae as TrackOpTypes,_e as TriggerOpTypes,Yt as computed,ie as customRef,le as deferredComputed,O as effect,y as effectScope,M as enableTracking,b as getCurrentScope,Tt as isProxy,zt as isReactive,Vt as isReadonly,Ft as isRef,Nt as isShallow,Kt as markRaw,R as onScopeDispose,z as pauseScheduling,A as pauseTracking,se as proxyRefs,xt as reactive,At as readonly,Jt as ref,V as resetScheduling,W as resetTracking,Pt as shallowReactive,Mt as shallowReadonly,Qt as shallowRef,j as stop,Dt as toRaw,ue as toRef,re as toRefs,te as toValue,Y as track,q as trigger,Zt as triggerRef,$t as unref};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -120,7 +120,7 @@ class ReactiveEffect {
|
|
|
120
120
|
/**
|
|
121
121
|
* @internal
|
|
122
122
|
*/
|
|
123
|
-
this._dirtyLevel =
|
|
123
|
+
this._dirtyLevel = 5;
|
|
124
124
|
/**
|
|
125
125
|
* @internal
|
|
126
126
|
*/
|
|
@@ -140,14 +140,18 @@ class ReactiveEffect {
|
|
|
140
140
|
recordEffectScope(this, scope);
|
|
141
141
|
}
|
|
142
142
|
get dirty() {
|
|
143
|
-
if (this._dirtyLevel === 2
|
|
143
|
+
if (this._dirtyLevel === 2)
|
|
144
|
+
return false;
|
|
145
|
+
if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
|
|
144
146
|
this._dirtyLevel = 1;
|
|
145
147
|
pauseTracking();
|
|
146
148
|
for (let i = 0; i < this._depsLength; i++) {
|
|
147
149
|
const dep = this.deps[i];
|
|
148
150
|
if (dep.computed) {
|
|
151
|
+
if (dep.computed.effect._dirtyLevel === 2)
|
|
152
|
+
return true;
|
|
149
153
|
triggerComputed(dep.computed);
|
|
150
|
-
if (this._dirtyLevel >=
|
|
154
|
+
if (this._dirtyLevel >= 5) {
|
|
151
155
|
break;
|
|
152
156
|
}
|
|
153
157
|
}
|
|
@@ -157,10 +161,10 @@ class ReactiveEffect {
|
|
|
157
161
|
}
|
|
158
162
|
resetTracking();
|
|
159
163
|
}
|
|
160
|
-
return this._dirtyLevel >=
|
|
164
|
+
return this._dirtyLevel >= 5;
|
|
161
165
|
}
|
|
162
166
|
set dirty(v) {
|
|
163
|
-
this._dirtyLevel = v ?
|
|
167
|
+
this._dirtyLevel = v ? 5 : 0;
|
|
164
168
|
}
|
|
165
169
|
run() {
|
|
166
170
|
this._dirtyLevel = 0;
|
|
@@ -226,8 +230,7 @@ function effect(fn, options) {
|
|
|
226
230
|
});
|
|
227
231
|
if (options) {
|
|
228
232
|
extend(_effect, options);
|
|
229
|
-
if (options.scope)
|
|
230
|
-
recordEffectScope(_effect, options.scope);
|
|
233
|
+
if (options.scope) recordEffectScope(_effect, options.scope);
|
|
231
234
|
}
|
|
232
235
|
if (!options || !options.lazy) {
|
|
233
236
|
_effect.run();
|
|
@@ -286,9 +289,18 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
|
286
289
|
var _a;
|
|
287
290
|
pauseScheduling();
|
|
288
291
|
for (const effect2 of dep.keys()) {
|
|
292
|
+
if (!dep.computed && effect2.computed) {
|
|
293
|
+
if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
|
|
294
|
+
effect2._dirtyLevel = 2;
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
289
298
|
let tracking;
|
|
290
299
|
if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
291
300
|
effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
|
|
301
|
+
if (effect2.computed && effect2._dirtyLevel === 2) {
|
|
302
|
+
effect2._shouldSchedule = true;
|
|
303
|
+
}
|
|
292
304
|
effect2._dirtyLevel = dirtyLevel;
|
|
293
305
|
}
|
|
294
306
|
if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
@@ -296,7 +308,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
|
296
308
|
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
297
309
|
}
|
|
298
310
|
effect2.trigger();
|
|
299
|
-
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !==
|
|
311
|
+
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
|
|
300
312
|
effect2._shouldSchedule = false;
|
|
301
313
|
if (effect2.scheduler) {
|
|
302
314
|
queueEffectSchedulers.push(effect2.scheduler);
|
|
@@ -388,7 +400,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
388
400
|
if (dep) {
|
|
389
401
|
triggerEffects(
|
|
390
402
|
dep,
|
|
391
|
-
|
|
403
|
+
5,
|
|
392
404
|
!!(process.env.NODE_ENV !== "production") ? {
|
|
393
405
|
target,
|
|
394
406
|
type,
|
|
@@ -441,8 +453,7 @@ function createArrayInstrumentations() {
|
|
|
441
453
|
return instrumentations;
|
|
442
454
|
}
|
|
443
455
|
function hasOwnProperty(key) {
|
|
444
|
-
if (!isSymbol(key))
|
|
445
|
-
key = String(key);
|
|
456
|
+
if (!isSymbol(key)) key = String(key);
|
|
446
457
|
const obj = toRaw(this);
|
|
447
458
|
track(obj, "has", key);
|
|
448
459
|
return obj.hasOwnProperty(key);
|
|
@@ -926,7 +937,11 @@ function shallowReadonly(target) {
|
|
|
926
937
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
927
938
|
if (!isObject(target)) {
|
|
928
939
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
929
|
-
warn(
|
|
940
|
+
warn(
|
|
941
|
+
`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
|
|
942
|
+
target
|
|
943
|
+
)}`
|
|
944
|
+
);
|
|
930
945
|
}
|
|
931
946
|
return target;
|
|
932
947
|
}
|
|
@@ -988,7 +1003,7 @@ class ComputedRefImpl {
|
|
|
988
1003
|
() => getter(this._value),
|
|
989
1004
|
() => triggerRefValue(
|
|
990
1005
|
this,
|
|
991
|
-
this.effect._dirtyLevel ===
|
|
1006
|
+
this.effect._dirtyLevel === 3 ? 3 : 4
|
|
992
1007
|
)
|
|
993
1008
|
);
|
|
994
1009
|
this.effect.computed = this;
|
|
@@ -998,7 +1013,7 @@ class ComputedRefImpl {
|
|
|
998
1013
|
get value() {
|
|
999
1014
|
const self = toRaw(this);
|
|
1000
1015
|
if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
|
|
1001
|
-
triggerRefValue(self,
|
|
1016
|
+
triggerRefValue(self, 5);
|
|
1002
1017
|
}
|
|
1003
1018
|
trackRefValue(self);
|
|
1004
1019
|
if (self.effect._dirtyLevel >= 2) {
|
|
@@ -1007,7 +1022,7 @@ class ComputedRefImpl {
|
|
|
1007
1022
|
|
|
1008
1023
|
getter: `, this.getter);
|
|
1009
1024
|
}
|
|
1010
|
-
triggerRefValue(self,
|
|
1025
|
+
triggerRefValue(self, 3);
|
|
1011
1026
|
}
|
|
1012
1027
|
return self._value;
|
|
1013
1028
|
}
|
|
@@ -1062,7 +1077,7 @@ function trackRefValue(ref2) {
|
|
|
1062
1077
|
);
|
|
1063
1078
|
}
|
|
1064
1079
|
}
|
|
1065
|
-
function triggerRefValue(ref2, dirtyLevel =
|
|
1080
|
+
function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
|
|
1066
1081
|
ref2 = toRaw(ref2);
|
|
1067
1082
|
const dep = ref2.dep;
|
|
1068
1083
|
if (dep) {
|
|
@@ -1073,7 +1088,8 @@ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
|
|
|
1073
1088
|
target: ref2,
|
|
1074
1089
|
type: "set",
|
|
1075
1090
|
key: "value",
|
|
1076
|
-
newValue: newVal
|
|
1091
|
+
newValue: newVal,
|
|
1092
|
+
oldValue: oldVal
|
|
1077
1093
|
} : void 0
|
|
1078
1094
|
);
|
|
1079
1095
|
}
|
|
@@ -1109,14 +1125,15 @@ class RefImpl {
|
|
|
1109
1125
|
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1110
1126
|
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1111
1127
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1128
|
+
const oldVal = this._rawValue;
|
|
1112
1129
|
this._rawValue = newVal;
|
|
1113
1130
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1114
|
-
triggerRefValue(this,
|
|
1131
|
+
triggerRefValue(this, 5, newVal, oldVal);
|
|
1115
1132
|
}
|
|
1116
1133
|
}
|
|
1117
1134
|
}
|
|
1118
1135
|
function triggerRef(ref2) {
|
|
1119
|
-
triggerRefValue(ref2,
|
|
1136
|
+
triggerRefValue(ref2, 5, !!(process.env.NODE_ENV !== "production") ? ref2.value : void 0);
|
|
1120
1137
|
}
|
|
1121
1138
|
function unref(ref2) {
|
|
1122
1139
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -165,7 +165,7 @@ var VueReactivity = (function (exports) {
|
|
|
165
165
|
/**
|
|
166
166
|
* @internal
|
|
167
167
|
*/
|
|
168
|
-
this._dirtyLevel =
|
|
168
|
+
this._dirtyLevel = 5;
|
|
169
169
|
/**
|
|
170
170
|
* @internal
|
|
171
171
|
*/
|
|
@@ -185,14 +185,18 @@ var VueReactivity = (function (exports) {
|
|
|
185
185
|
recordEffectScope(this, scope);
|
|
186
186
|
}
|
|
187
187
|
get dirty() {
|
|
188
|
-
if (this._dirtyLevel === 2
|
|
188
|
+
if (this._dirtyLevel === 2)
|
|
189
|
+
return false;
|
|
190
|
+
if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
|
|
189
191
|
this._dirtyLevel = 1;
|
|
190
192
|
pauseTracking();
|
|
191
193
|
for (let i = 0; i < this._depsLength; i++) {
|
|
192
194
|
const dep = this.deps[i];
|
|
193
195
|
if (dep.computed) {
|
|
196
|
+
if (dep.computed.effect._dirtyLevel === 2)
|
|
197
|
+
return true;
|
|
194
198
|
triggerComputed(dep.computed);
|
|
195
|
-
if (this._dirtyLevel >=
|
|
199
|
+
if (this._dirtyLevel >= 5) {
|
|
196
200
|
break;
|
|
197
201
|
}
|
|
198
202
|
}
|
|
@@ -202,10 +206,10 @@ var VueReactivity = (function (exports) {
|
|
|
202
206
|
}
|
|
203
207
|
resetTracking();
|
|
204
208
|
}
|
|
205
|
-
return this._dirtyLevel >=
|
|
209
|
+
return this._dirtyLevel >= 5;
|
|
206
210
|
}
|
|
207
211
|
set dirty(v) {
|
|
208
|
-
this._dirtyLevel = v ?
|
|
212
|
+
this._dirtyLevel = v ? 5 : 0;
|
|
209
213
|
}
|
|
210
214
|
run() {
|
|
211
215
|
this._dirtyLevel = 0;
|
|
@@ -271,8 +275,7 @@ var VueReactivity = (function (exports) {
|
|
|
271
275
|
});
|
|
272
276
|
if (options) {
|
|
273
277
|
extend(_effect, options);
|
|
274
|
-
if (options.scope)
|
|
275
|
-
recordEffectScope(_effect, options.scope);
|
|
278
|
+
if (options.scope) recordEffectScope(_effect, options.scope);
|
|
276
279
|
}
|
|
277
280
|
if (!options || !options.lazy) {
|
|
278
281
|
_effect.run();
|
|
@@ -331,9 +334,18 @@ var VueReactivity = (function (exports) {
|
|
|
331
334
|
var _a;
|
|
332
335
|
pauseScheduling();
|
|
333
336
|
for (const effect2 of dep.keys()) {
|
|
337
|
+
if (!dep.computed && effect2.computed) {
|
|
338
|
+
if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
|
|
339
|
+
effect2._dirtyLevel = 2;
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
334
343
|
let tracking;
|
|
335
344
|
if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
336
345
|
effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
|
|
346
|
+
if (effect2.computed && effect2._dirtyLevel === 2) {
|
|
347
|
+
effect2._shouldSchedule = true;
|
|
348
|
+
}
|
|
337
349
|
effect2._dirtyLevel = dirtyLevel;
|
|
338
350
|
}
|
|
339
351
|
if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
|
|
@@ -341,7 +353,7 @@ var VueReactivity = (function (exports) {
|
|
|
341
353
|
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
342
354
|
}
|
|
343
355
|
effect2.trigger();
|
|
344
|
-
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !==
|
|
356
|
+
if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
|
|
345
357
|
effect2._shouldSchedule = false;
|
|
346
358
|
if (effect2.scheduler) {
|
|
347
359
|
queueEffectSchedulers.push(effect2.scheduler);
|
|
@@ -433,7 +445,7 @@ var VueReactivity = (function (exports) {
|
|
|
433
445
|
if (dep) {
|
|
434
446
|
triggerEffects(
|
|
435
447
|
dep,
|
|
436
|
-
|
|
448
|
+
5,
|
|
437
449
|
{
|
|
438
450
|
target,
|
|
439
451
|
type,
|
|
@@ -486,8 +498,7 @@ var VueReactivity = (function (exports) {
|
|
|
486
498
|
return instrumentations;
|
|
487
499
|
}
|
|
488
500
|
function hasOwnProperty(key) {
|
|
489
|
-
if (!isSymbol(key))
|
|
490
|
-
key = String(key);
|
|
501
|
+
if (!isSymbol(key)) key = String(key);
|
|
491
502
|
const obj = toRaw(this);
|
|
492
503
|
track(obj, "has", key);
|
|
493
504
|
return obj.hasOwnProperty(key);
|
|
@@ -971,7 +982,11 @@ var VueReactivity = (function (exports) {
|
|
|
971
982
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
972
983
|
if (!isObject(target)) {
|
|
973
984
|
{
|
|
974
|
-
warn(
|
|
985
|
+
warn(
|
|
986
|
+
`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
|
|
987
|
+
target
|
|
988
|
+
)}`
|
|
989
|
+
);
|
|
975
990
|
}
|
|
976
991
|
return target;
|
|
977
992
|
}
|
|
@@ -1033,7 +1048,7 @@ var VueReactivity = (function (exports) {
|
|
|
1033
1048
|
() => getter(this._value),
|
|
1034
1049
|
() => triggerRefValue(
|
|
1035
1050
|
this,
|
|
1036
|
-
this.effect._dirtyLevel ===
|
|
1051
|
+
this.effect._dirtyLevel === 3 ? 3 : 4
|
|
1037
1052
|
)
|
|
1038
1053
|
);
|
|
1039
1054
|
this.effect.computed = this;
|
|
@@ -1043,7 +1058,7 @@ var VueReactivity = (function (exports) {
|
|
|
1043
1058
|
get value() {
|
|
1044
1059
|
const self = toRaw(this);
|
|
1045
1060
|
if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
|
|
1046
|
-
triggerRefValue(self,
|
|
1061
|
+
triggerRefValue(self, 5);
|
|
1047
1062
|
}
|
|
1048
1063
|
trackRefValue(self);
|
|
1049
1064
|
if (self.effect._dirtyLevel >= 2) {
|
|
@@ -1052,7 +1067,7 @@ var VueReactivity = (function (exports) {
|
|
|
1052
1067
|
|
|
1053
1068
|
getter: `, this.getter);
|
|
1054
1069
|
}
|
|
1055
|
-
triggerRefValue(self,
|
|
1070
|
+
triggerRefValue(self, 3);
|
|
1056
1071
|
}
|
|
1057
1072
|
return self._value;
|
|
1058
1073
|
}
|
|
@@ -1107,7 +1122,7 @@ getter: `, this.getter);
|
|
|
1107
1122
|
);
|
|
1108
1123
|
}
|
|
1109
1124
|
}
|
|
1110
|
-
function triggerRefValue(ref2, dirtyLevel =
|
|
1125
|
+
function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
|
|
1111
1126
|
ref2 = toRaw(ref2);
|
|
1112
1127
|
const dep = ref2.dep;
|
|
1113
1128
|
if (dep) {
|
|
@@ -1118,7 +1133,8 @@ getter: `, this.getter);
|
|
|
1118
1133
|
target: ref2,
|
|
1119
1134
|
type: "set",
|
|
1120
1135
|
key: "value",
|
|
1121
|
-
newValue: newVal
|
|
1136
|
+
newValue: newVal,
|
|
1137
|
+
oldValue: oldVal
|
|
1122
1138
|
}
|
|
1123
1139
|
);
|
|
1124
1140
|
}
|
|
@@ -1154,14 +1170,15 @@ getter: `, this.getter);
|
|
|
1154
1170
|
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
1155
1171
|
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
1156
1172
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1173
|
+
const oldVal = this._rawValue;
|
|
1157
1174
|
this._rawValue = newVal;
|
|
1158
1175
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1159
|
-
triggerRefValue(this,
|
|
1176
|
+
triggerRefValue(this, 5, newVal, oldVal);
|
|
1160
1177
|
}
|
|
1161
1178
|
}
|
|
1162
1179
|
}
|
|
1163
1180
|
function triggerRef(ref2) {
|
|
1164
|
-
triggerRefValue(ref2,
|
|
1181
|
+
triggerRefValue(ref2, 5, ref2.value );
|
|
1165
1182
|
}
|
|
1166
1183
|
function unref(ref2) {
|
|
1167
1184
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.4.
|
|
2
|
+
* @vue/reactivity v3.4.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
var VueReactivity=function(t){"use strict";
|
|
7
|
-
/*! #__NO_SIDE_EFFECTS__ */function e(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const s=()=>{},n=Object.assign,i=Object.prototype.hasOwnProperty,r=(t,e)=>i.call(t,e),c=Array.isArray,o=t=>"[object Map]"===f(t),u=t=>"function"==typeof t,a=t=>"symbol"==typeof t,l=t=>null!==t&&"object"==typeof t,h=Object.prototype.toString,f=t=>h.call(t),_=t=>f(t).slice(8,-1),d=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,p=(t,e)=>!Object.is(t,e);let v,g;class y{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=v,!t&&v&&(this.index=(v.scopes||(v.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=v;try{return v=this,t()}finally{v=e}}}on(){v=this}off(){v=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function w(t,e=v){e&&e.active&&e.effects.push(t)}class R{constructor(t,e,s,n){this.fn=t,this.trigger=e,this.scheduler=s,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,w(this,n)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,j();for(let t=0;t<this._depsLength;t++){const e=this.deps[t];if(e.computed&&(S(e.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),x()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=E,e=g;try{return E=!0,g=this,this._runnings++,b(this),this.fn()}finally{k(this),this._runnings--,g=e,E=t}}stop(){this.active&&(b(this),k(this),this.onStop&&this.onStop(),this.active=!1)}}function S(t){return t.value}function b(t){t._trackId++,t._depsLength=0}function k(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e<t.deps.length;e++)L(t.deps[e],t);t.deps.length=t._depsLength}}function L(t,e){const s=t.get(e);void 0!==s&&e._trackId!==s&&(t.delete(e),0===t.size&&t.cleanup())}let E=!0,O=0;const m=[];function j(){m.push(E),E=!1}function x(){const t=m.pop();E=void 0===t||t}function I(){O++}function P(){for(O--;!O&&A.length;)A.shift()()}function T(t,e,s){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const s=t.deps[t._depsLength];s!==e?(s&&L(s,t),t.deps[t._depsLength++]=e):t._depsLength++}}const A=[];function M(t,e,s){I();for(const n of t.keys()){let s;n._dirtyLevel<e&&(null!=s?s:s=t.get(n)===n._trackId)&&(n._shouldSchedule||(n._shouldSchedule=0===n._dirtyLevel),n._dirtyLevel=e),n._shouldSchedule&&(null!=s?s:s=t.get(n)===n._trackId)&&(n.trigger(),n._runnings&&!n.allowRecurse||2===n._dirtyLevel||(n._shouldSchedule=!1,n.scheduler&&A.push(n.scheduler)))}P()}const V=(t,e)=>{const s=new Map;return s.cleanup=t,s.computed=e,s},W=new WeakMap,z=Symbol(""),N=Symbol("");function D(t,e,s){if(E&&g){let e=W.get(t);e||W.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=V((()=>e.delete(s)))),T(g,n)}}function C(t,e,s,n,i,r){const u=W.get(t);if(!u)return;let l=[];if("clear"===e)l=[...u.values()];else if("length"===s&&c(t)){const t=Number(n);u.forEach(((e,s)=>{("length"===s||!a(s)&&s>=t)&&l.push(e)}))}else switch(void 0!==s&&l.push(u.get(s)),e){case"add":c(t)?d(s)&&l.push(u.get("length")):(l.push(u.get(z)),o(t)&&l.push(u.get(N)));break;case"delete":c(t)||(l.push(u.get(z)),o(t)&&l.push(u.get(N)));break;case"set":o(t)&&l.push(u.get(z))}I();for(const c of l)c&&M(c,4);P()}const K=e("__proto__,__v_isRef,__isVue"),H=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(a)),Y=F();function F(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const s=Pt(this);for(let e=0,i=this.length;e<i;e++)D(s,0,e+"");const n=s[e](...t);return-1===n||!1===n?s[e](...t.map(Pt)):n}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){j(),I();const s=Pt(this)[e].apply(this,t);return P(),x(),s}})),t}function G(t){a(t)||(t=String(t));const e=Pt(this);return D(e,0,t),e.hasOwnProperty(t)}class q{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,i=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return i;if("__v_raw"===e)return s===(n?i?Lt:kt:i?bt:St).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=c(t);if(!n){if(o&&r(Y,e))return Reflect.get(Y,e,s);if("hasOwnProperty"===e)return G}const u=Reflect.get(t,e,s);return(a(e)?H.has(e):K(e))?u:(n||D(t,0,e),i?u:Nt(u)?o&&d(e)?u:u.value:l(u)?n?Ot(u):Et(u):u)}}class B extends q{constructor(t=!1){super(!1,t)}set(t,e,s,n){let i=t[e];if(!this._isShallow){const e=xt(i);if(It(s)||xt(s)||(i=Pt(i),s=Pt(s)),!c(t)&&Nt(i)&&!Nt(s))return!e&&(i.value=s,!0)}const o=c(t)&&d(e)?Number(e)<t.length:r(t,e),u=Reflect.set(t,e,s,n);return t===Pt(n)&&(o?p(s,i)&&C(t,"set",e,s):C(t,"add",e,s)),u}deleteProperty(t,e){const s=r(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&C(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return a(e)&&H.has(e)||D(t,0,e),s}ownKeys(t){return D(t,0,c(t)?"length":z),Reflect.ownKeys(t)}}class J extends q{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const Q=new B,U=new J,X=new B(!0),Z=new J(!0),$=t=>t,tt=t=>Reflect.getPrototypeOf(t);function et(t,e,s=!1,n=!1){const i=Pt(t=t.__v_raw),r=Pt(e);s||(p(e,r)&&D(i,0,e),D(i,0,r));const{has:c}=tt(i),o=n?$:s?At:Tt;return c.call(i,e)?o(t.get(e)):c.call(i,r)?o(t.get(r)):void(t!==i&&t.get(e))}function st(t,e=!1){const s=this.__v_raw,n=Pt(s),i=Pt(t);return e||(p(t,i)&&D(n,0,t),D(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function nt(t,e=!1){return t=t.__v_raw,!e&&D(Pt(t),0,z),Reflect.get(t,"size",t)}function it(t){t=Pt(t);const e=Pt(this);return tt(e).has.call(e,t)||(e.add(t),C(e,"add",t,t)),this}function rt(t,e){e=Pt(e);const s=Pt(this),{has:n,get:i}=tt(s);let r=n.call(s,t);r||(t=Pt(t),r=n.call(s,t));const c=i.call(s,t);return s.set(t,e),r?p(e,c)&&C(s,"set",t,e):C(s,"add",t,e),this}function ct(t){const e=Pt(this),{has:s,get:n}=tt(e);let i=s.call(e,t);i||(t=Pt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&C(e,"delete",t,void 0),r}function ot(){const t=Pt(this),e=0!==t.size,s=t.clear();return e&&C(t,"clear",void 0,void 0),s}function ut(t,e){return function(s,n){const i=this,r=i.__v_raw,c=Pt(r),o=e?$:t?At:Tt;return!t&&D(c,0,z),r.forEach(((t,e)=>s.call(n,o(t),o(e),i)))}}function at(t,e,s){return function(...n){const i=this.__v_raw,r=Pt(i),c=o(r),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=i[t](...n),h=s?$:e?At:Tt;return!e&&D(r,0,a?N:z),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}function lt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function ht(){const t={get(t){return et(this,t)},get size(){return nt(this)},has:st,add:it,set:rt,delete:ct,clear:ot,forEach:ut(!1,!1)},e={get(t){return et(this,t,!1,!0)},get size(){return nt(this)},has:st,add:it,set:rt,delete:ct,clear:ot,forEach:ut(!1,!0)},s={get(t){return et(this,t,!0)},get size(){return nt(this,!0)},has(t){return st.call(this,t,!0)},add:lt("add"),set:lt("set"),delete:lt("delete"),clear:lt("clear"),forEach:ut(!0,!1)},n={get(t){return et(this,t,!0,!0)},get size(){return nt(this,!0)},has(t){return st.call(this,t,!0)},add:lt("add"),set:lt("set"),delete:lt("delete"),clear:lt("clear"),forEach:ut(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=at(i,!1,!1),s[i]=at(i,!0,!1),e[i]=at(i,!1,!0),n[i]=at(i,!0,!0)})),[t,s,e,n]}const[ft,_t,dt,pt]=ht();function vt(t,e){const s=e?t?pt:dt:t?_t:ft;return(e,n,i)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(r(s,n)&&n in e?s:e,n,i)}const gt={get:vt(!1,!1)},yt={get:vt(!1,!0)},wt={get:vt(!0,!1)},Rt={get:vt(!0,!0)},St=new WeakMap,bt=new WeakMap,kt=new WeakMap,Lt=new WeakMap;function Et(t){return xt(t)?t:mt(t,!1,Q,gt,St)}function Ot(t){return mt(t,!0,U,wt,kt)}function mt(t,e,s,n,i){if(!l(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const c=(o=t).__v_skip||!Object.isExtensible(o)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(_(o));var o;if(0===c)return t;const u=new Proxy(t,2===c?n:s);return i.set(t,u),u}function jt(t){return xt(t)?jt(t.__v_raw):!(!t||!t.__v_isReactive)}function xt(t){return!(!t||!t.__v_isReadonly)}function It(t){return!(!t||!t.__v_isShallow)}function Pt(t){const e=t&&t.__v_raw;return e?Pt(e):t}const Tt=t=>l(t)?Et(t):t,At=t=>l(t)?Ot(t):t;class Mt{constructor(t,e,s,n){this.getter=t,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new R((()=>t(this._value)),(()=>zt(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=s}get value(){const t=Pt(this);return t._cacheable&&!t.effect.dirty||!p(t._value,t._value=t.effect.run())||zt(t,4),Wt(t),t.effect._dirtyLevel>=2&&zt(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Vt(t,e,n=!1){let i,r;const c=u(t);c?(i=t,r=s):(i=t.get,r=t.set);return new Mt(i,r,c||!r,n)}function Wt(t){var e;E&&g&&(t=Pt(t),T(g,null!=(e=t.dep)?e:t.dep=V((()=>t.dep=void 0),t instanceof Mt?t:void 0)))}function zt(t,e=4,s){const n=(t=Pt(t)).dep;n&&M(n,e)}function Nt(t){return!(!t||!0!==t.__v_isRef)}function Dt(t){return Ct(t,!1)}function Ct(t,e){return Nt(t)?t:new Kt(t,e)}class Kt{constructor(t,e){this.__v_isShallow=e,this.dep=void 0,this.__v_isRef=!0,this._rawValue=e?t:Pt(t),this._value=e?t:Tt(t)}get value(){return Wt(this),this._value}set value(t){const e=this.__v_isShallow||It(t)||xt(t);t=e?t:Pt(t),p(t,this._rawValue)&&(this._rawValue=t,this._value=e?t:Tt(t),zt(this,4))}}function Ht(t){return Nt(t)?t.value:t}const Yt={get:(t,e,s)=>Ht(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Nt(i)&&!Nt(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};class Ft{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:e,set:s}=t((()=>Wt(this)),(()=>zt(this)));this._get=e,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}class Gt{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return function(t,e){const s=W.get(t);return s&&s.get(e)}(Pt(this._object),this._key)}}class qt{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Bt(t,e,s){const n=t[e];return Nt(n)?n:new Gt(t,e,s)}const Jt=Vt;return t.EffectScope=y,t.ITERATE_KEY=z,t.ReactiveEffect=R,t.ReactiveFlags={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"},t.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},t.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},t.computed=Vt,t.customRef=function(t){return new Ft(t)},t.deferredComputed=Jt,t.effect=function(t,e){t.effect instanceof R&&(t=t.effect.fn);const i=new R(t,s,(()=>{i.dirty&&i.run()}));e&&(n(i,e),e.scope&&w(i,e.scope)),e&&e.lazy||i.run();const r=i.run.bind(i);return r.effect=i,r},t.effectScope=function(t){return new y(t)},t.enableTracking=function(){m.push(E),E=!0},t.getCurrentScope=function(){return v},t.isProxy=function(t){return!!t&&!!t.__v_raw},t.isReactive=jt,t.isReadonly=xt,t.isRef=Nt,t.isShallow=It,t.markRaw=function(t){return Object.isExtensible(t)&&((t,e,s,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:s})})(t,"__v_skip",!0),t},t.onScopeDispose=function(t){v&&v.cleanups.push(t)},t.pauseScheduling=I,t.pauseTracking=j,t.proxyRefs=function(t){return jt(t)?t:new Proxy(t,Yt)},t.reactive=Et,t.readonly=Ot,t.ref=Dt,t.resetScheduling=P,t.resetTracking=x,t.shallowReactive=function(t){return mt(t,!1,X,yt,bt)},t.shallowReadonly=function(t){return mt(t,!0,Z,Rt,Lt)},t.shallowRef=function(t){return Ct(t,!0)},t.stop=function(t){t.effect.stop()},t.toRaw=Pt,t.toRef=function(t,e,s){return Nt(t)?t:u(t)?new qt(t):l(t)&&arguments.length>1?Bt(t,e,s):Dt(t)},t.toRefs=function(t){const e=c(t)?new Array(t.length):{};for(const s in t)e[s]=Bt(t,s);return e},t.toValue=function(t){return u(t)?t():Ht(t)},t.track=D,t.trigger=C,t.triggerRef=function(t){zt(t,4)},t.unref=Ht,t}({});
|
|
7
|
+
/*! #__NO_SIDE_EFFECTS__ */function e(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const s=()=>{},n=Object.assign,i=Object.prototype.hasOwnProperty,r=(t,e)=>i.call(t,e),c=Array.isArray,o=t=>"[object Map]"===f(t),u=t=>"function"==typeof t,a=t=>"symbol"==typeof t,l=t=>null!==t&&"object"==typeof t,h=Object.prototype.toString,f=t=>h.call(t),_=t=>f(t).slice(8,-1),d=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,p=(t,e)=>!Object.is(t,e);let v,g;class y{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=v,!t&&v&&(this.index=(v.scopes||(v.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=v;try{return v=this,t()}finally{v=e}}}on(){v=this}off(){v=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function w(t,e=v){e&&e.active&&e.effects.push(t)}class R{constructor(t,e,s,n){this.fn=t,this.trigger=e,this.scheduler=s,this.active=!0,this.deps=[],this._dirtyLevel=5,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,w(this,n)}get dirty(){if(2===this._dirtyLevel)return!1;if(3===this._dirtyLevel||4===this._dirtyLevel){this._dirtyLevel=1,j();for(let t=0;t<this._depsLength;t++){const e=this.deps[t];if(e.computed){if(2===e.computed.effect._dirtyLevel)return!0;if(S(e.computed),this._dirtyLevel>=5)break}}1===this._dirtyLevel&&(this._dirtyLevel=0),I()}return this._dirtyLevel>=5}set dirty(t){this._dirtyLevel=t?5:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=m,e=g;try{return m=!0,g=this,this._runnings++,b(this),this.fn()}finally{k(this),this._runnings--,g=e,m=t}}stop(){this.active&&(b(this),k(this),this.onStop&&this.onStop(),this.active=!1)}}function S(t){return t.value}function b(t){t._trackId++,t._depsLength=0}function k(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e<t.deps.length;e++)L(t.deps[e],t);t.deps.length=t._depsLength}}function L(t,e){const s=t.get(e);void 0!==s&&e._trackId!==s&&(t.delete(e),0===t.size&&t.cleanup())}let m=!0,E=0;const O=[];function j(){O.push(m),m=!1}function I(){const t=O.pop();m=void 0===t||t}function x(){E++}function P(){for(E--;!E&&A.length;)A.shift()()}function T(t,e,s){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const s=t.deps[t._depsLength];s!==e?(s&&L(s,t),t.deps[t._depsLength++]=e):t._depsLength++}}const A=[];function M(t,e,s){x();for(const n of t.keys()){if(!t.computed&&n.computed&&t.get(n)===n._trackId&&n._runnings>0){n._dirtyLevel=2;continue}let s;n._dirtyLevel<e&&(null!=s?s:s=t.get(n)===n._trackId)&&(n._shouldSchedule||(n._shouldSchedule=0===n._dirtyLevel),n.computed&&2===n._dirtyLevel&&(n._shouldSchedule=!0),n._dirtyLevel=e),n._shouldSchedule&&(null!=s?s:s=t.get(n)===n._trackId)&&(n.trigger(),n._runnings&&!n.allowRecurse||3===n._dirtyLevel||(n._shouldSchedule=!1,n.scheduler&&A.push(n.scheduler)))}P()}const V=(t,e)=>{const s=new Map;return s.cleanup=t,s.computed=e,s},W=new WeakMap,z=Symbol(""),N=Symbol("");function D(t,e,s){if(m&&g){let e=W.get(t);e||W.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=V((()=>e.delete(s)))),T(g,n)}}function C(t,e,s,n,i,r){const u=W.get(t);if(!u)return;let l=[];if("clear"===e)l=[...u.values()];else if("length"===s&&c(t)){const t=Number(n);u.forEach(((e,s)=>{("length"===s||!a(s)&&s>=t)&&l.push(e)}))}else switch(void 0!==s&&l.push(u.get(s)),e){case"add":c(t)?d(s)&&l.push(u.get("length")):(l.push(u.get(z)),o(t)&&l.push(u.get(N)));break;case"delete":c(t)||(l.push(u.get(z)),o(t)&&l.push(u.get(N)));break;case"set":o(t)&&l.push(u.get(z))}x();for(const c of l)c&&M(c,5);P()}const K=e("__proto__,__v_isRef,__isVue"),H=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(a)),Y=F();function F(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const s=Pt(this);for(let e=0,i=this.length;e<i;e++)D(s,0,e+"");const n=s[e](...t);return-1===n||!1===n?s[e](...t.map(Pt)):n}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){j(),x();const s=Pt(this)[e].apply(this,t);return P(),I(),s}})),t}function G(t){a(t)||(t=String(t));const e=Pt(this);return D(e,0,t),e.hasOwnProperty(t)}class q{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,i=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return i;if("__v_raw"===e)return s===(n?i?Lt:kt:i?bt:St).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=c(t);if(!n){if(o&&r(Y,e))return Reflect.get(Y,e,s);if("hasOwnProperty"===e)return G}const u=Reflect.get(t,e,s);return(a(e)?H.has(e):K(e))?u:(n||D(t,0,e),i?u:Nt(u)?o&&d(e)?u:u.value:l(u)?n?Et(u):mt(u):u)}}class B extends q{constructor(t=!1){super(!1,t)}set(t,e,s,n){let i=t[e];if(!this._isShallow){const e=It(i);if(xt(s)||It(s)||(i=Pt(i),s=Pt(s)),!c(t)&&Nt(i)&&!Nt(s))return!e&&(i.value=s,!0)}const o=c(t)&&d(e)?Number(e)<t.length:r(t,e),u=Reflect.set(t,e,s,n);return t===Pt(n)&&(o?p(s,i)&&C(t,"set",e,s):C(t,"add",e,s)),u}deleteProperty(t,e){const s=r(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&C(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return a(e)&&H.has(e)||D(t,0,e),s}ownKeys(t){return D(t,0,c(t)?"length":z),Reflect.ownKeys(t)}}class J extends q{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const Q=new B,U=new J,X=new B(!0),Z=new J(!0),$=t=>t,tt=t=>Reflect.getPrototypeOf(t);function et(t,e,s=!1,n=!1){const i=Pt(t=t.__v_raw),r=Pt(e);s||(p(e,r)&&D(i,0,e),D(i,0,r));const{has:c}=tt(i),o=n?$:s?At:Tt;return c.call(i,e)?o(t.get(e)):c.call(i,r)?o(t.get(r)):void(t!==i&&t.get(e))}function st(t,e=!1){const s=this.__v_raw,n=Pt(s),i=Pt(t);return e||(p(t,i)&&D(n,0,t),D(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function nt(t,e=!1){return t=t.__v_raw,!e&&D(Pt(t),0,z),Reflect.get(t,"size",t)}function it(t){t=Pt(t);const e=Pt(this);return tt(e).has.call(e,t)||(e.add(t),C(e,"add",t,t)),this}function rt(t,e){e=Pt(e);const s=Pt(this),{has:n,get:i}=tt(s);let r=n.call(s,t);r||(t=Pt(t),r=n.call(s,t));const c=i.call(s,t);return s.set(t,e),r?p(e,c)&&C(s,"set",t,e):C(s,"add",t,e),this}function ct(t){const e=Pt(this),{has:s,get:n}=tt(e);let i=s.call(e,t);i||(t=Pt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&C(e,"delete",t,void 0),r}function ot(){const t=Pt(this),e=0!==t.size,s=t.clear();return e&&C(t,"clear",void 0,void 0),s}function ut(t,e){return function(s,n){const i=this,r=i.__v_raw,c=Pt(r),o=e?$:t?At:Tt;return!t&&D(c,0,z),r.forEach(((t,e)=>s.call(n,o(t),o(e),i)))}}function at(t,e,s){return function(...n){const i=this.__v_raw,r=Pt(i),c=o(r),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=i[t](...n),h=s?$:e?At:Tt;return!e&&D(r,0,a?N:z),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}function lt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function ht(){const t={get(t){return et(this,t)},get size(){return nt(this)},has:st,add:it,set:rt,delete:ct,clear:ot,forEach:ut(!1,!1)},e={get(t){return et(this,t,!1,!0)},get size(){return nt(this)},has:st,add:it,set:rt,delete:ct,clear:ot,forEach:ut(!1,!0)},s={get(t){return et(this,t,!0)},get size(){return nt(this,!0)},has(t){return st.call(this,t,!0)},add:lt("add"),set:lt("set"),delete:lt("delete"),clear:lt("clear"),forEach:ut(!0,!1)},n={get(t){return et(this,t,!0,!0)},get size(){return nt(this,!0)},has(t){return st.call(this,t,!0)},add:lt("add"),set:lt("set"),delete:lt("delete"),clear:lt("clear"),forEach:ut(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=at(i,!1,!1),s[i]=at(i,!0,!1),e[i]=at(i,!1,!0),n[i]=at(i,!0,!0)})),[t,s,e,n]}const[ft,_t,dt,pt]=ht();function vt(t,e){const s=e?t?pt:dt:t?_t:ft;return(e,n,i)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(r(s,n)&&n in e?s:e,n,i)}const gt={get:vt(!1,!1)},yt={get:vt(!1,!0)},wt={get:vt(!0,!1)},Rt={get:vt(!0,!0)},St=new WeakMap,bt=new WeakMap,kt=new WeakMap,Lt=new WeakMap;function mt(t){return It(t)?t:Ot(t,!1,Q,gt,St)}function Et(t){return Ot(t,!0,U,wt,kt)}function Ot(t,e,s,n,i){if(!l(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const c=(o=t).__v_skip||!Object.isExtensible(o)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(_(o));var o;if(0===c)return t;const u=new Proxy(t,2===c?n:s);return i.set(t,u),u}function jt(t){return It(t)?jt(t.__v_raw):!(!t||!t.__v_isReactive)}function It(t){return!(!t||!t.__v_isReadonly)}function xt(t){return!(!t||!t.__v_isShallow)}function Pt(t){const e=t&&t.__v_raw;return e?Pt(e):t}const Tt=t=>l(t)?mt(t):t,At=t=>l(t)?Et(t):t;class Mt{constructor(t,e,s,n){this.getter=t,this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new R((()=>t(this._value)),(()=>zt(this,3===this.effect._dirtyLevel?3:4))),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=s}get value(){const t=Pt(this);return t._cacheable&&!t.effect.dirty||!p(t._value,t._value=t.effect.run())||zt(t,5),Wt(t),t.effect._dirtyLevel>=2&&zt(t,3),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Vt(t,e,n=!1){let i,r;const c=u(t);c?(i=t,r=s):(i=t.get,r=t.set);return new Mt(i,r,c||!r,n)}function Wt(t){var e;m&&g&&(t=Pt(t),T(g,null!=(e=t.dep)?e:t.dep=V((()=>t.dep=void 0),t instanceof Mt?t:void 0)))}function zt(t,e=5,s,n){const i=(t=Pt(t)).dep;i&&M(i,e)}function Nt(t){return!(!t||!0!==t.__v_isRef)}function Dt(t){return Ct(t,!1)}function Ct(t,e){return Nt(t)?t:new Kt(t,e)}class Kt{constructor(t,e){this.__v_isShallow=e,this.dep=void 0,this.__v_isRef=!0,this._rawValue=e?t:Pt(t),this._value=e?t:Tt(t)}get value(){return Wt(this),this._value}set value(t){const e=this.__v_isShallow||xt(t)||It(t);t=e?t:Pt(t),p(t,this._rawValue)&&(this._rawValue=t,this._value=e?t:Tt(t),zt(this,5))}}function Ht(t){return Nt(t)?t.value:t}const Yt={get:(t,e,s)=>Ht(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Nt(i)&&!Nt(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};class Ft{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:e,set:s}=t((()=>Wt(this)),(()=>zt(this)));this._get=e,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}class Gt{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return function(t,e){const s=W.get(t);return s&&s.get(e)}(Pt(this._object),this._key)}}class qt{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Bt(t,e,s){const n=t[e];return Nt(n)?n:new Gt(t,e,s)}const Jt=Vt;return t.EffectScope=y,t.ITERATE_KEY=z,t.ReactiveEffect=R,t.ReactiveFlags={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"},t.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},t.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},t.computed=Vt,t.customRef=function(t){return new Ft(t)},t.deferredComputed=Jt,t.effect=function(t,e){t.effect instanceof R&&(t=t.effect.fn);const i=new R(t,s,(()=>{i.dirty&&i.run()}));e&&(n(i,e),e.scope&&w(i,e.scope)),e&&e.lazy||i.run();const r=i.run.bind(i);return r.effect=i,r},t.effectScope=function(t){return new y(t)},t.enableTracking=function(){O.push(m),m=!0},t.getCurrentScope=function(){return v},t.isProxy=function(t){return!!t&&!!t.__v_raw},t.isReactive=jt,t.isReadonly=It,t.isRef=Nt,t.isShallow=xt,t.markRaw=function(t){return Object.isExtensible(t)&&((t,e,s,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:s})})(t,"__v_skip",!0),t},t.onScopeDispose=function(t){v&&v.cleanups.push(t)},t.pauseScheduling=x,t.pauseTracking=j,t.proxyRefs=function(t){return jt(t)?t:new Proxy(t,Yt)},t.reactive=mt,t.readonly=Et,t.ref=Dt,t.resetScheduling=P,t.resetTracking=I,t.shallowReactive=function(t){return Ot(t,!1,X,yt,bt)},t.shallowReadonly=function(t){return Ot(t,!0,Z,Rt,Lt)},t.shallowRef=function(t){return Ct(t,!0)},t.stop=function(t){t.effect.stop()},t.toRaw=Pt,t.toRef=function(t,e,s){return Nt(t)?t:u(t)?new qt(t):l(t)&&arguments.length>1?Bt(t,e,s):Dt(t)},t.toRefs=function(t){const e=c(t)?new Array(t.length):{};for(const s in t)e[s]=Bt(t,s);return e},t.toValue=function(t){return u(t)?t():Ht(t)},t.track=D,t.trigger=C,t.triggerRef=function(t){zt(t,5)},t.unref=Ht,t}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/reactivity",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.29",
|
|
4
4
|
"description": "@vue/reactivity",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/reactivity.esm-bundler.js",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@vue/shared": "3.4.
|
|
53
|
+
"@vue/shared": "3.4.29"
|
|
54
54
|
}
|
|
55
55
|
}
|