@vue/compat 3.2.37 → 3.2.38

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.
@@ -640,7 +640,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
640
640
  return;
641
641
  }
642
642
  let deps = [];
643
- if (type === "clear" /* CLEAR */) {
643
+ if (type === "clear" /* TriggerOpTypes.CLEAR */) {
644
644
  // collection being cleared
645
645
  // trigger all effects for target
646
646
  deps = [...depsMap.values()];
@@ -659,7 +659,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
659
659
  }
660
660
  // also run for iteration key on ADD | DELETE | Map.SET
661
661
  switch (type) {
662
- case "add" /* ADD */:
662
+ case "add" /* TriggerOpTypes.ADD */:
663
663
  if (!isArray(target)) {
664
664
  deps.push(depsMap.get(ITERATE_KEY));
665
665
  if (isMap(target)) {
@@ -671,7 +671,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
671
671
  deps.push(depsMap.get('length'));
672
672
  }
673
673
  break;
674
- case "delete" /* DELETE */:
674
+ case "delete" /* TriggerOpTypes.DELETE */:
675
675
  if (!isArray(target)) {
676
676
  deps.push(depsMap.get(ITERATE_KEY));
677
677
  if (isMap(target)) {
@@ -679,7 +679,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
679
679
  }
680
680
  }
681
681
  break;
682
- case "set" /* SET */:
682
+ case "set" /* TriggerOpTypes.SET */:
683
683
  if (isMap(target)) {
684
684
  deps.push(depsMap.get(ITERATE_KEY));
685
685
  }
@@ -763,7 +763,7 @@ function createArrayInstrumentations() {
763
763
  instrumentations[key] = function (...args) {
764
764
  const arr = toRaw(this);
765
765
  for (let i = 0, l = this.length; i < l; i++) {
766
- track(arr, "get" /* GET */, i + '');
766
+ track(arr, "get" /* TrackOpTypes.GET */, i + '');
767
767
  }
768
768
  // we run the method using the original args first (which may be reactive)
769
769
  const res = arr[key](...args);
@@ -788,16 +788,16 @@ function createArrayInstrumentations() {
788
788
  }
789
789
  function createGetter(isReadonly = false, shallow = false) {
790
790
  return function get(target, key, receiver) {
791
- if (key === "__v_isReactive" /* IS_REACTIVE */) {
791
+ if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
792
792
  return !isReadonly;
793
793
  }
794
- else if (key === "__v_isReadonly" /* IS_READONLY */) {
794
+ else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
795
795
  return isReadonly;
796
796
  }
797
- else if (key === "__v_isShallow" /* IS_SHALLOW */) {
797
+ else if (key === "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */) {
798
798
  return shallow;
799
799
  }
800
- else if (key === "__v_raw" /* RAW */ &&
800
+ else if (key === "__v_raw" /* ReactiveFlags.RAW */ &&
801
801
  receiver ===
802
802
  (isReadonly
803
803
  ? shallow
@@ -817,7 +817,7 @@ function createGetter(isReadonly = false, shallow = false) {
817
817
  return res;
818
818
  }
819
819
  if (!isReadonly) {
820
- track(target, "get" /* GET */, key);
820
+ track(target, "get" /* TrackOpTypes.GET */, key);
821
821
  }
822
822
  if (shallow) {
823
823
  return res;
@@ -843,10 +843,10 @@ function createSetter(shallow = false) {
843
843
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
844
844
  return false;
845
845
  }
846
- if (!shallow && !isReadonly(value)) {
847
- if (!isShallow(value)) {
848
- value = toRaw(value);
846
+ if (!shallow) {
847
+ if (!isShallow(value) && !isReadonly(value)) {
849
848
  oldValue = toRaw(oldValue);
849
+ value = toRaw(value);
850
850
  }
851
851
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
852
852
  oldValue.value = value;
@@ -860,10 +860,10 @@ function createSetter(shallow = false) {
860
860
  // don't trigger if target is something up in the prototype chain of original
861
861
  if (target === toRaw(receiver)) {
862
862
  if (!hadKey) {
863
- trigger(target, "add" /* ADD */, key, value);
863
+ trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
864
864
  }
865
865
  else if (hasChanged(value, oldValue)) {
866
- trigger(target, "set" /* SET */, key, value, oldValue);
866
+ trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
867
867
  }
868
868
  }
869
869
  return result;
@@ -874,19 +874,19 @@ function deleteProperty(target, key) {
874
874
  const oldValue = target[key];
875
875
  const result = Reflect.deleteProperty(target, key);
876
876
  if (result && hadKey) {
877
- trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
877
+ trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
878
878
  }
879
879
  return result;
880
880
  }
881
881
  function has(target, key) {
882
882
  const result = Reflect.has(target, key);
883
883
  if (!isSymbol(key) || !builtInSymbols.has(key)) {
884
- track(target, "has" /* HAS */, key);
884
+ track(target, "has" /* TrackOpTypes.HAS */, key);
885
885
  }
886
886
  return result;
887
887
  }
888
888
  function ownKeys(target) {
889
- track(target, "iterate" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
889
+ track(target, "iterate" /* TrackOpTypes.ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
890
890
  return Reflect.ownKeys(target);
891
891
  }
892
892
  const mutableHandlers = {
@@ -927,14 +927,14 @@ const getProto = (v) => Reflect.getPrototypeOf(v);
927
927
  function get$1(target, key, isReadonly = false, isShallow = false) {
928
928
  // #1772: readonly(reactive(Map)) should return readonly + reactive version
929
929
  // of the value
930
- target = target["__v_raw" /* RAW */];
930
+ target = target["__v_raw" /* ReactiveFlags.RAW */];
931
931
  const rawTarget = toRaw(target);
932
932
  const rawKey = toRaw(key);
933
933
  if (!isReadonly) {
934
934
  if (key !== rawKey) {
935
- track(rawTarget, "get" /* GET */, key);
935
+ track(rawTarget, "get" /* TrackOpTypes.GET */, key);
936
936
  }
937
- track(rawTarget, "get" /* GET */, rawKey);
937
+ track(rawTarget, "get" /* TrackOpTypes.GET */, rawKey);
938
938
  }
939
939
  const { has } = getProto(rawTarget);
940
940
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
@@ -951,22 +951,22 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
951
951
  }
952
952
  }
953
953
  function has$1(key, isReadonly = false) {
954
- const target = this["__v_raw" /* RAW */];
954
+ const target = this["__v_raw" /* ReactiveFlags.RAW */];
955
955
  const rawTarget = toRaw(target);
956
956
  const rawKey = toRaw(key);
957
957
  if (!isReadonly) {
958
958
  if (key !== rawKey) {
959
- track(rawTarget, "has" /* HAS */, key);
959
+ track(rawTarget, "has" /* TrackOpTypes.HAS */, key);
960
960
  }
961
- track(rawTarget, "has" /* HAS */, rawKey);
961
+ track(rawTarget, "has" /* TrackOpTypes.HAS */, rawKey);
962
962
  }
963
963
  return key === rawKey
964
964
  ? target.has(key)
965
965
  : target.has(key) || target.has(rawKey);
966
966
  }
967
967
  function size(target, isReadonly = false) {
968
- target = target["__v_raw" /* RAW */];
969
- !isReadonly && track(toRaw(target), "iterate" /* ITERATE */, ITERATE_KEY);
968
+ target = target["__v_raw" /* ReactiveFlags.RAW */];
969
+ !isReadonly && track(toRaw(target), "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
970
970
  return Reflect.get(target, 'size', target);
971
971
  }
972
972
  function add(value) {
@@ -976,7 +976,7 @@ function add(value) {
976
976
  const hadKey = proto.has.call(target, value);
977
977
  if (!hadKey) {
978
978
  target.add(value);
979
- trigger(target, "add" /* ADD */, value, value);
979
+ trigger(target, "add" /* TriggerOpTypes.ADD */, value, value);
980
980
  }
981
981
  return this;
982
982
  }
@@ -995,10 +995,10 @@ function set$1(key, value) {
995
995
  const oldValue = get.call(target, key);
996
996
  target.set(key, value);
997
997
  if (!hadKey) {
998
- trigger(target, "add" /* ADD */, key, value);
998
+ trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
999
999
  }
1000
1000
  else if (hasChanged(value, oldValue)) {
1001
- trigger(target, "set" /* SET */, key, value, oldValue);
1001
+ trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
1002
1002
  }
1003
1003
  return this;
1004
1004
  }
@@ -1017,7 +1017,7 @@ function deleteEntry(key) {
1017
1017
  // forward the operation before queueing reactions
1018
1018
  const result = target.delete(key);
1019
1019
  if (hadKey) {
1020
- trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
1020
+ trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
1021
1021
  }
1022
1022
  return result;
1023
1023
  }
@@ -1032,17 +1032,17 @@ function clear() {
1032
1032
  // forward the operation before queueing reactions
1033
1033
  const result = target.clear();
1034
1034
  if (hadItems) {
1035
- trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);
1035
+ trigger(target, "clear" /* TriggerOpTypes.CLEAR */, undefined, undefined, oldTarget);
1036
1036
  }
1037
1037
  return result;
1038
1038
  }
1039
1039
  function createForEach(isReadonly, isShallow) {
1040
1040
  return function forEach(callback, thisArg) {
1041
1041
  const observed = this;
1042
- const target = observed["__v_raw" /* RAW */];
1042
+ const target = observed["__v_raw" /* ReactiveFlags.RAW */];
1043
1043
  const rawTarget = toRaw(target);
1044
1044
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1045
- !isReadonly && track(rawTarget, "iterate" /* ITERATE */, ITERATE_KEY);
1045
+ !isReadonly && track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
1046
1046
  return target.forEach((value, key) => {
1047
1047
  // important: make sure the callback is
1048
1048
  // 1. invoked with the reactive map as `this` and 3rd arg
@@ -1053,7 +1053,7 @@ function createForEach(isReadonly, isShallow) {
1053
1053
  }
1054
1054
  function createIterableMethod(method, isReadonly, isShallow) {
1055
1055
  return function (...args) {
1056
- const target = this["__v_raw" /* RAW */];
1056
+ const target = this["__v_raw" /* ReactiveFlags.RAW */];
1057
1057
  const rawTarget = toRaw(target);
1058
1058
  const targetIsMap = isMap(rawTarget);
1059
1059
  const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
@@ -1061,7 +1061,7 @@ function createIterableMethod(method, isReadonly, isShallow) {
1061
1061
  const innerIterator = target[method](...args);
1062
1062
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1063
1063
  !isReadonly &&
1064
- track(rawTarget, "iterate" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
1064
+ track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
1065
1065
  // return a wrapped iterator which returns observed versions of the
1066
1066
  // values emitted from the real iterator
1067
1067
  return {
@@ -1088,7 +1088,7 @@ function createReadonlyMethod(type) {
1088
1088
  const key = args[0] ? `on key "${args[0]}" ` : ``;
1089
1089
  console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
1090
1090
  }
1091
- return type === "delete" /* DELETE */ ? false : this;
1091
+ return type === "delete" /* TriggerOpTypes.DELETE */ ? false : this;
1092
1092
  };
1093
1093
  }
1094
1094
  function createInstrumentations() {
@@ -1130,10 +1130,10 @@ function createInstrumentations() {
1130
1130
  has(key) {
1131
1131
  return has$1.call(this, key, true);
1132
1132
  },
1133
- add: createReadonlyMethod("add" /* ADD */),
1134
- set: createReadonlyMethod("set" /* SET */),
1135
- delete: createReadonlyMethod("delete" /* DELETE */),
1136
- clear: createReadonlyMethod("clear" /* CLEAR */),
1133
+ add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1134
+ set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
1135
+ delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
1136
+ clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
1137
1137
  forEach: createForEach(true, false)
1138
1138
  };
1139
1139
  const shallowReadonlyInstrumentations = {
@@ -1146,10 +1146,10 @@ function createInstrumentations() {
1146
1146
  has(key) {
1147
1147
  return has$1.call(this, key, true);
1148
1148
  },
1149
- add: createReadonlyMethod("add" /* ADD */),
1150
- set: createReadonlyMethod("set" /* SET */),
1151
- delete: createReadonlyMethod("delete" /* DELETE */),
1152
- clear: createReadonlyMethod("clear" /* CLEAR */),
1149
+ add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1150
+ set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
1151
+ delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
1152
+ clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
1153
1153
  forEach: createForEach(true, true)
1154
1154
  };
1155
1155
  const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];
@@ -1176,13 +1176,13 @@ function createInstrumentationGetter(isReadonly, shallow) {
1176
1176
  ? readonlyInstrumentations
1177
1177
  : mutableInstrumentations;
1178
1178
  return (target, key, receiver) => {
1179
- if (key === "__v_isReactive" /* IS_REACTIVE */) {
1179
+ if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
1180
1180
  return !isReadonly;
1181
1181
  }
1182
- else if (key === "__v_isReadonly" /* IS_READONLY */) {
1182
+ else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
1183
1183
  return isReadonly;
1184
1184
  }
1185
- else if (key === "__v_raw" /* RAW */) {
1185
+ else if (key === "__v_raw" /* ReactiveFlags.RAW */) {
1186
1186
  return target;
1187
1187
  }
1188
1188
  return Reflect.get(hasOwn(instrumentations, key) && key in target
@@ -1222,19 +1222,19 @@ function targetTypeMap(rawType) {
1222
1222
  switch (rawType) {
1223
1223
  case 'Object':
1224
1224
  case 'Array':
1225
- return 1 /* COMMON */;
1225
+ return 1 /* TargetType.COMMON */;
1226
1226
  case 'Map':
1227
1227
  case 'Set':
1228
1228
  case 'WeakMap':
1229
1229
  case 'WeakSet':
1230
- return 2 /* COLLECTION */;
1230
+ return 2 /* TargetType.COLLECTION */;
1231
1231
  default:
1232
- return 0 /* INVALID */;
1232
+ return 0 /* TargetType.INVALID */;
1233
1233
  }
1234
1234
  }
1235
1235
  function getTargetType(value) {
1236
- return value["__v_skip" /* SKIP */] || !Object.isExtensible(value)
1237
- ? 0 /* INVALID */
1236
+ return value["__v_skip" /* ReactiveFlags.SKIP */] || !Object.isExtensible(value)
1237
+ ? 0 /* TargetType.INVALID */
1238
1238
  : targetTypeMap(toRawType(value));
1239
1239
  }
1240
1240
  function reactive(target) {
@@ -1277,8 +1277,8 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1277
1277
  }
1278
1278
  // target is already a Proxy, return it.
1279
1279
  // exception: calling readonly() on a reactive object
1280
- if (target["__v_raw" /* RAW */] &&
1281
- !(isReadonly && target["__v_isReactive" /* IS_REACTIVE */])) {
1280
+ if (target["__v_raw" /* ReactiveFlags.RAW */] &&
1281
+ !(isReadonly && target["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */])) {
1282
1282
  return target;
1283
1283
  }
1284
1284
  // target already has corresponding Proxy
@@ -1288,34 +1288,34 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1288
1288
  }
1289
1289
  // only specific value types can be observed.
1290
1290
  const targetType = getTargetType(target);
1291
- if (targetType === 0 /* INVALID */) {
1291
+ if (targetType === 0 /* TargetType.INVALID */) {
1292
1292
  return target;
1293
1293
  }
1294
- const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
1294
+ const proxy = new Proxy(target, targetType === 2 /* TargetType.COLLECTION */ ? collectionHandlers : baseHandlers);
1295
1295
  proxyMap.set(target, proxy);
1296
1296
  return proxy;
1297
1297
  }
1298
1298
  function isReactive(value) {
1299
1299
  if (isReadonly(value)) {
1300
- return isReactive(value["__v_raw" /* RAW */]);
1300
+ return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
1301
1301
  }
1302
- return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
1302
+ return !!(value && value["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */]);
1303
1303
  }
1304
1304
  function isReadonly(value) {
1305
- return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
1305
+ return !!(value && value["__v_isReadonly" /* ReactiveFlags.IS_READONLY */]);
1306
1306
  }
1307
1307
  function isShallow(value) {
1308
- return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
1308
+ return !!(value && value["__v_isShallow" /* ReactiveFlags.IS_SHALLOW */]);
1309
1309
  }
1310
1310
  function isProxy(value) {
1311
1311
  return isReactive(value) || isReadonly(value);
1312
1312
  }
1313
1313
  function toRaw(observed) {
1314
- const raw = observed && observed["__v_raw" /* RAW */];
1314
+ const raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
1315
1315
  return raw ? toRaw(raw) : observed;
1316
1316
  }
1317
1317
  function markRaw(value) {
1318
- def(value, "__v_skip" /* SKIP */, true);
1318
+ def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
1319
1319
  return value;
1320
1320
  }
1321
1321
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
@@ -1327,7 +1327,7 @@ function trackRefValue(ref) {
1327
1327
  if ((process.env.NODE_ENV !== 'production')) {
1328
1328
  trackEffects(ref.dep || (ref.dep = createDep()), {
1329
1329
  target: ref,
1330
- type: "get" /* GET */,
1330
+ type: "get" /* TrackOpTypes.GET */,
1331
1331
  key: 'value'
1332
1332
  });
1333
1333
  }
@@ -1342,7 +1342,7 @@ function triggerRefValue(ref, newVal) {
1342
1342
  if ((process.env.NODE_ENV !== 'production')) {
1343
1343
  triggerEffects(ref.dep, {
1344
1344
  target: ref,
1345
- type: "set" /* SET */,
1345
+ type: "set" /* TriggerOpTypes.SET */,
1346
1346
  key: 'value',
1347
1347
  newValue: newVal
1348
1348
  });
@@ -1380,10 +1380,11 @@ class RefImpl {
1380
1380
  return this._value;
1381
1381
  }
1382
1382
  set value(newVal) {
1383
- newVal = this.__v_isShallow ? newVal : toRaw(newVal);
1383
+ const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
1384
+ newVal = useDirectValue ? newVal : toRaw(newVal);
1384
1385
  if (hasChanged(newVal, this._rawValue)) {
1385
1386
  this._rawValue = newVal;
1386
- this._value = this.__v_isShallow ? newVal : toReactive(newVal);
1387
+ this._value = useDirectValue ? newVal : toReactive(newVal);
1387
1388
  triggerRefValue(this, newVal);
1388
1389
  }
1389
1390
  }
@@ -1462,11 +1463,13 @@ function toRef(object, key, defaultValue) {
1462
1463
  : new ObjectRefImpl(object, key, defaultValue);
1463
1464
  }
1464
1465
 
1466
+ var _a;
1465
1467
  class ComputedRefImpl {
1466
1468
  constructor(getter, _setter, isReadonly, isSSR) {
1467
1469
  this._setter = _setter;
1468
1470
  this.dep = undefined;
1469
1471
  this.__v_isRef = true;
1472
+ this[_a] = false;
1470
1473
  this._dirty = true;
1471
1474
  this.effect = new ReactiveEffect(getter, () => {
1472
1475
  if (!this._dirty) {
@@ -1476,7 +1479,7 @@ class ComputedRefImpl {
1476
1479
  });
1477
1480
  this.effect.computed = this;
1478
1481
  this.effect.active = this._cacheable = !isSSR;
1479
- this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
1482
+ this["__v_isReadonly" /* ReactiveFlags.IS_READONLY */] = isReadonly;
1480
1483
  }
1481
1484
  get value() {
1482
1485
  // the computed ref may get wrapped by other proxies e.g. readonly() #3376
@@ -1492,6 +1495,7 @@ class ComputedRefImpl {
1492
1495
  this._setter(newValue);
1493
1496
  }
1494
1497
  }
1498
+ _a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
1495
1499
  function computed(getterOrOptions, debugOptions, isSSR = false) {
1496
1500
  let getter;
1497
1501
  let setter;
@@ -1531,7 +1535,7 @@ function warn$1(msg, ...args) {
1531
1535
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
1532
1536
  const trace = getComponentTrace();
1533
1537
  if (appWarnHandler) {
1534
- callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
1538
+ callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
1535
1539
  msg + args.join(''),
1536
1540
  instance && instance.proxy,
1537
1541
  trace
@@ -1631,35 +1635,35 @@ function formatProp(key, value, raw) {
1631
1635
  }
1632
1636
 
1633
1637
  const ErrorTypeStrings = {
1634
- ["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook',
1635
- ["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
1636
- ["c" /* CREATED */]: 'created hook',
1637
- ["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
1638
- ["m" /* MOUNTED */]: 'mounted hook',
1639
- ["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
1640
- ["u" /* UPDATED */]: 'updated',
1641
- ["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
1642
- ["um" /* UNMOUNTED */]: 'unmounted hook',
1643
- ["a" /* ACTIVATED */]: 'activated hook',
1644
- ["da" /* DEACTIVATED */]: 'deactivated hook',
1645
- ["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
1646
- ["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
1647
- ["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
1648
- [0 /* SETUP_FUNCTION */]: 'setup function',
1649
- [1 /* RENDER_FUNCTION */]: 'render function',
1650
- [2 /* WATCH_GETTER */]: 'watcher getter',
1651
- [3 /* WATCH_CALLBACK */]: 'watcher callback',
1652
- [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
1653
- [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
1654
- [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
1655
- [7 /* VNODE_HOOK */]: 'vnode hook',
1656
- [8 /* DIRECTIVE_HOOK */]: 'directive hook',
1657
- [9 /* TRANSITION_HOOK */]: 'transition hook',
1658
- [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
1659
- [11 /* APP_WARN_HANDLER */]: 'app warnHandler',
1660
- [12 /* FUNCTION_REF */]: 'ref function',
1661
- [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
1662
- [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
1638
+ ["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
1639
+ ["bc" /* LifecycleHooks.BEFORE_CREATE */]: 'beforeCreate hook',
1640
+ ["c" /* LifecycleHooks.CREATED */]: 'created hook',
1641
+ ["bm" /* LifecycleHooks.BEFORE_MOUNT */]: 'beforeMount hook',
1642
+ ["m" /* LifecycleHooks.MOUNTED */]: 'mounted hook',
1643
+ ["bu" /* LifecycleHooks.BEFORE_UPDATE */]: 'beforeUpdate hook',
1644
+ ["u" /* LifecycleHooks.UPDATED */]: 'updated',
1645
+ ["bum" /* LifecycleHooks.BEFORE_UNMOUNT */]: 'beforeUnmount hook',
1646
+ ["um" /* LifecycleHooks.UNMOUNTED */]: 'unmounted hook',
1647
+ ["a" /* LifecycleHooks.ACTIVATED */]: 'activated hook',
1648
+ ["da" /* LifecycleHooks.DEACTIVATED */]: 'deactivated hook',
1649
+ ["ec" /* LifecycleHooks.ERROR_CAPTURED */]: 'errorCaptured hook',
1650
+ ["rtc" /* LifecycleHooks.RENDER_TRACKED */]: 'renderTracked hook',
1651
+ ["rtg" /* LifecycleHooks.RENDER_TRIGGERED */]: 'renderTriggered hook',
1652
+ [0 /* ErrorCodes.SETUP_FUNCTION */]: 'setup function',
1653
+ [1 /* ErrorCodes.RENDER_FUNCTION */]: 'render function',
1654
+ [2 /* ErrorCodes.WATCH_GETTER */]: 'watcher getter',
1655
+ [3 /* ErrorCodes.WATCH_CALLBACK */]: 'watcher callback',
1656
+ [4 /* ErrorCodes.WATCH_CLEANUP */]: 'watcher cleanup function',
1657
+ [5 /* ErrorCodes.NATIVE_EVENT_HANDLER */]: 'native event handler',
1658
+ [6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */]: 'component event handler',
1659
+ [7 /* ErrorCodes.VNODE_HOOK */]: 'vnode hook',
1660
+ [8 /* ErrorCodes.DIRECTIVE_HOOK */]: 'directive hook',
1661
+ [9 /* ErrorCodes.TRANSITION_HOOK */]: 'transition hook',
1662
+ [10 /* ErrorCodes.APP_ERROR_HANDLER */]: 'app errorHandler',
1663
+ [11 /* ErrorCodes.APP_WARN_HANDLER */]: 'app warnHandler',
1664
+ [12 /* ErrorCodes.FUNCTION_REF */]: 'ref function',
1665
+ [13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */]: 'async component loader',
1666
+ [14 /* ErrorCodes.SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
1663
1667
  'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
1664
1668
  };
1665
1669
  function callWithErrorHandling(fn, instance, type, args) {
@@ -1710,7 +1714,7 @@ function handleError(err, instance, type, throwInDev = true) {
1710
1714
  // app-level handling
1711
1715
  const appErrorHandler = instance.appContext.config.errorHandler;
1712
1716
  if (appErrorHandler) {
1713
- callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
1717
+ callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
1714
1718
  return;
1715
1719
  }
1716
1720
  }
@@ -1744,15 +1748,11 @@ let isFlushing = false;
1744
1748
  let isFlushPending = false;
1745
1749
  const queue = [];
1746
1750
  let flushIndex = 0;
1747
- const pendingPreFlushCbs = [];
1748
- let activePreFlushCbs = null;
1749
- let preFlushIndex = 0;
1750
1751
  const pendingPostFlushCbs = [];
1751
1752
  let activePostFlushCbs = null;
1752
1753
  let postFlushIndex = 0;
1753
1754
  const resolvedPromise = /*#__PURE__*/ Promise.resolve();
1754
1755
  let currentFlushPromise = null;
1755
- let currentPreFlushParentJob = null;
1756
1756
  const RECURSION_LIMIT = 100;
1757
1757
  function nextTick(fn) {
1758
1758
  const p = currentFlushPromise || resolvedPromise;
@@ -1780,9 +1780,8 @@ function queueJob(job) {
1780
1780
  // if the job is a watch() callback, the search will start with a +1 index to
1781
1781
  // allow it recursively trigger itself - it is the user's responsibility to
1782
1782
  // ensure it doesn't end up in an infinite loop.
1783
- if ((!queue.length ||
1784
- !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&
1785
- job !== currentPreFlushParentJob) {
1783
+ if (!queue.length ||
1784
+ !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
1786
1785
  if (job.id == null) {
1787
1786
  queue.push(job);
1788
1787
  }
@@ -1804,52 +1803,38 @@ function invalidateJob(job) {
1804
1803
  queue.splice(i, 1);
1805
1804
  }
1806
1805
  }
1807
- function queueCb(cb, activeQueue, pendingQueue, index) {
1806
+ function queuePostFlushCb(cb) {
1808
1807
  if (!isArray(cb)) {
1809
- if (!activeQueue ||
1810
- !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
1811
- pendingQueue.push(cb);
1808
+ if (!activePostFlushCbs ||
1809
+ !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
1810
+ pendingPostFlushCbs.push(cb);
1812
1811
  }
1813
1812
  }
1814
1813
  else {
1815
1814
  // if cb is an array, it is a component lifecycle hook which can only be
1816
1815
  // triggered by a job, which is already deduped in the main queue, so
1817
1816
  // we can skip duplicate check here to improve perf
1818
- pendingQueue.push(...cb);
1817
+ pendingPostFlushCbs.push(...cb);
1819
1818
  }
1820
1819
  queueFlush();
1821
1820
  }
1822
- function queuePreFlushCb(cb) {
1823
- queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
1824
- }
1825
- function queuePostFlushCb(cb) {
1826
- queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
1827
- }
1828
- function flushPreFlushCbs(seen, parentJob = null) {
1829
- if (pendingPreFlushCbs.length) {
1830
- currentPreFlushParentJob = parentJob;
1831
- activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
1832
- pendingPreFlushCbs.length = 0;
1833
- if ((process.env.NODE_ENV !== 'production')) {
1834
- seen = seen || new Map();
1835
- }
1836
- for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
1837
- if ((process.env.NODE_ENV !== 'production') &&
1838
- checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
1821
+ function flushPreFlushCbs(seen, i = flushIndex) {
1822
+ if ((process.env.NODE_ENV !== 'production')) {
1823
+ seen = seen || new Map();
1824
+ }
1825
+ for (; i < queue.length; i++) {
1826
+ const cb = queue[i];
1827
+ if (cb && cb.pre) {
1828
+ if ((process.env.NODE_ENV !== 'production') && checkRecursiveUpdates(seen, cb)) {
1839
1829
  continue;
1840
1830
  }
1841
- activePreFlushCbs[preFlushIndex]();
1831
+ queue.splice(i, 1);
1832
+ i--;
1833
+ cb();
1842
1834
  }
1843
- activePreFlushCbs = null;
1844
- preFlushIndex = 0;
1845
- currentPreFlushParentJob = null;
1846
- // recursively flush until it drains
1847
- flushPreFlushCbs(seen, parentJob);
1848
1835
  }
1849
1836
  }
1850
1837
  function flushPostFlushCbs(seen) {
1851
- // flush any pre cbs queued during the flush (e.g. pre watchers)
1852
- flushPreFlushCbs();
1853
1838
  if (pendingPostFlushCbs.length) {
1854
1839
  const deduped = [...new Set(pendingPostFlushCbs)];
1855
1840
  pendingPostFlushCbs.length = 0;
@@ -1875,13 +1860,22 @@ function flushPostFlushCbs(seen) {
1875
1860
  }
1876
1861
  }
1877
1862
  const getId = (job) => job.id == null ? Infinity : job.id;
1863
+ const comparator = (a, b) => {
1864
+ const diff = getId(a) - getId(b);
1865
+ if (diff === 0) {
1866
+ if (a.pre && !b.pre)
1867
+ return -1;
1868
+ if (b.pre && !a.pre)
1869
+ return 1;
1870
+ }
1871
+ return diff;
1872
+ };
1878
1873
  function flushJobs(seen) {
1879
1874
  isFlushPending = false;
1880
1875
  isFlushing = true;
1881
1876
  if ((process.env.NODE_ENV !== 'production')) {
1882
1877
  seen = seen || new Map();
1883
1878
  }
1884
- flushPreFlushCbs(seen);
1885
1879
  // Sort queue before flush.
1886
1880
  // This ensures that:
1887
1881
  // 1. Components are updated from parent to child. (because parent is always
@@ -1889,7 +1883,7 @@ function flushJobs(seen) {
1889
1883
  // priority number)
1890
1884
  // 2. If a component is unmounted during a parent component's update,
1891
1885
  // its update can be skipped.
1892
- queue.sort((a, b) => getId(a) - getId(b));
1886
+ queue.sort(comparator);
1893
1887
  // conditional usage of checkRecursiveUpdate must be determined out of
1894
1888
  // try ... catch block since Rollup by default de-optimizes treeshaking
1895
1889
  // inside try-catch. This can leave all warning code unshaked. Although
@@ -1906,7 +1900,7 @@ function flushJobs(seen) {
1906
1900
  continue;
1907
1901
  }
1908
1902
  // console.log(`running:`, job.id)
1909
- callWithErrorHandling(job, null, 14 /* SCHEDULER */);
1903
+ callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */);
1910
1904
  }
1911
1905
  }
1912
1906
  }
@@ -1918,9 +1912,7 @@ function flushJobs(seen) {
1918
1912
  currentFlushPromise = null;
1919
1913
  // some postFlushCb queued jobs!
1920
1914
  // keep flushing until it drains.
1921
- if (queue.length ||
1922
- pendingPreFlushCbs.length ||
1923
- pendingPostFlushCbs.length) {
1915
+ if (queue.length || pendingPostFlushCbs.length) {
1924
1916
  flushJobs(seen);
1925
1917
  }
1926
1918
  }
@@ -2138,7 +2130,7 @@ function setDevtoolsHook(hook, target) {
2138
2130
  }
2139
2131
  }
2140
2132
  function devtoolsInitApp(app, version) {
2141
- emit("app:init" /* APP_INIT */, app, version, {
2133
+ emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
2142
2134
  Fragment,
2143
2135
  Text,
2144
2136
  Comment,
@@ -2146,88 +2138,88 @@ function devtoolsInitApp(app, version) {
2146
2138
  });
2147
2139
  }
2148
2140
  function devtoolsUnmountApp(app) {
2149
- emit("app:unmount" /* APP_UNMOUNT */, app);
2141
+ emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
2150
2142
  }
2151
- const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
2143
+ const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
2152
2144
  const devtoolsComponentUpdated =
2153
- /*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
2145
+ /*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* DevtoolsHooks.COMPONENT_UPDATED */);
2154
2146
  const devtoolsComponentRemoved =
2155
- /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
2147
+ /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* DevtoolsHooks.COMPONENT_REMOVED */);
2156
2148
  function createDevtoolsComponentHook(hook) {
2157
2149
  return (component) => {
2158
2150
  emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
2159
2151
  };
2160
2152
  }
2161
- const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
2162
- const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
2153
+ const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
2154
+ const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
2163
2155
  function createDevtoolsPerformanceHook(hook) {
2164
2156
  return (component, type, time) => {
2165
2157
  emit(hook, component.appContext.app, component.uid, component, type, time);
2166
2158
  };
2167
2159
  }
2168
2160
  function devtoolsComponentEmit(component, event, params) {
2169
- emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
2161
+ emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
2170
2162
  }
2171
2163
 
2172
2164
  const deprecationData = {
2173
- ["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
2165
+ ["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
2174
2166
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
2175
2167
  `option have been removed. Use createApp(RootComponent).mount() instead.`,
2176
2168
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#mounting-app-instance`
2177
2169
  },
2178
- ["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
2170
+ ["GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */]: {
2179
2171
  message: `Vue detected directives on the mount container. ` +
2180
2172
  `In Vue 3, the container is no longer considered part of the template ` +
2181
2173
  `and will not be processed/replaced.`,
2182
2174
  link: `https://v3-migration.vuejs.org/breaking-changes/mount-changes.html`
2183
2175
  },
2184
- ["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
2176
+ ["GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */]: {
2185
2177
  message: `Vue.extend() has been removed in Vue 3. ` +
2186
2178
  `Use defineComponent() instead.`,
2187
2179
  link: `https://vuejs.org/api/general.html#definecomponent`
2188
2180
  },
2189
- ["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
2181
+ ["GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */]: {
2190
2182
  message: `Vue.prototype is no longer available in Vue 3. ` +
2191
2183
  `Use app.config.globalProperties instead.`,
2192
2184
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#vue-prototype-replaced-by-config-globalproperties`
2193
2185
  },
2194
- ["GLOBAL_SET" /* GLOBAL_SET */]: {
2186
+ ["GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */]: {
2195
2187
  message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
2196
2188
  `Simply use native JavaScript mutations.`
2197
2189
  },
2198
- ["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
2190
+ ["GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */]: {
2199
2191
  message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
2200
2192
  `Simply use native JavaScript mutations.`
2201
2193
  },
2202
- ["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
2194
+ ["GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */]: {
2203
2195
  message: `Vue.observable() has been removed. ` +
2204
2196
  `Use \`import { reactive } from "vue"\` from Composition API instead.`,
2205
2197
  link: `https://vuejs.org/api/reactivity-core.html#reactive`
2206
2198
  },
2207
- ["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
2199
+ ["GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */]: {
2208
2200
  message: `Vue.util has been removed. Please refactor to avoid its usage ` +
2209
2201
  `since it was an internal API even in Vue 2.`
2210
2202
  },
2211
- ["CONFIG_SILENT" /* CONFIG_SILENT */]: {
2203
+ ["CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */]: {
2212
2204
  message: `config.silent has been removed because it is not good practice to ` +
2213
2205
  `intentionally suppress warnings. You can use your browser console's ` +
2214
2206
  `filter features to focus on relevant messages.`
2215
2207
  },
2216
- ["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
2208
+ ["CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */]: {
2217
2209
  message: `config.devtools has been removed. To enable devtools for ` +
2218
2210
  `production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
2219
2211
  link: `https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags`
2220
2212
  },
2221
- ["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
2213
+ ["CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */]: {
2222
2214
  message: `config.keyCodes has been removed. ` +
2223
2215
  `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
2224
2216
  link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
2225
2217
  },
2226
- ["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
2218
+ ["CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */]: {
2227
2219
  message: `config.productionTip has been removed.`,
2228
2220
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed`
2229
2221
  },
2230
- ["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
2222
+ ["CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */]: {
2231
2223
  message: () => {
2232
2224
  let msg = `config.ignoredElements has been removed.`;
2233
2225
  if (isRuntimeOnly()) {
@@ -2240,35 +2232,35 @@ const deprecationData = {
2240
2232
  },
2241
2233
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
2242
2234
  },
2243
- ["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
2235
+ ["CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */]: {
2244
2236
  // this warning is only relevant in the full build when using runtime
2245
2237
  // compilation, so it's put in the runtime compatConfig list.
2246
2238
  message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
2247
2239
  `"preserve". To suppress this warning, provide an explicit value for ` +
2248
2240
  `\`config.compilerOptions.whitespace\`.`
2249
2241
  },
2250
- ["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
2242
+ ["CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */]: {
2251
2243
  message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
2252
2244
  `Use custom merge functions instead.`
2253
2245
  },
2254
- ["INSTANCE_SET" /* INSTANCE_SET */]: {
2246
+ ["INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */]: {
2255
2247
  message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
2256
2248
  `Simply use native JavaScript mutations.`
2257
2249
  },
2258
- ["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
2250
+ ["INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */]: {
2259
2251
  message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
2260
2252
  `Simply use native JavaScript mutations.`
2261
2253
  },
2262
- ["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
2254
+ ["INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */]: {
2263
2255
  message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
2264
2256
  link: `https://vuejs.org/api/application.html#app-unmount`
2265
2257
  },
2266
- ["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
2258
+ ["INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */]: {
2267
2259
  message: `vm.$on/$once/$off() have been removed. ` +
2268
2260
  `Use an external event emitter library instead.`,
2269
2261
  link: `https://v3-migration.vuejs.org/breaking-changes/events-api.html`
2270
2262
  },
2271
- ["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
2263
+ ["INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */]: {
2272
2264
  message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
2273
2265
  `use the "vnode" prefix instead of "hook:". For example, @${event} ` +
2274
2266
  `should be changed to @vnode-${event.slice(5)}. ` +
@@ -2276,23 +2268,23 @@ const deprecationData = {
2276
2268
  `hooks.`,
2277
2269
  link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
2278
2270
  },
2279
- ["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
2271
+ ["INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */]: {
2280
2272
  message: `vm.$children has been removed. Consider refactoring your logic ` +
2281
2273
  `to avoid relying on direct access to child components.`,
2282
2274
  link: `https://v3-migration.vuejs.org/breaking-changes/children.html`
2283
2275
  },
2284
- ["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
2276
+ ["INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */]: {
2285
2277
  message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
2286
2278
  `included in vm.$attrs and it is no longer necessary to separately use ` +
2287
2279
  `v-on="$listeners" if you are already using v-bind="$attrs". ` +
2288
2280
  `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
2289
2281
  link: `https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html`
2290
2282
  },
2291
- ["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
2283
+ ["INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */]: {
2292
2284
  message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
2293
2285
  link: `https://v3-migration.vuejs.org/breaking-changes/slots-unification.html`
2294
2286
  },
2295
- ["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
2287
+ ["INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */]: {
2296
2288
  message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
2297
2289
  `relying on class/style fallthrough from parent. In Vue 3, class/style ` +
2298
2290
  `are now included in $attrs and will no longer fallthrough when ` +
@@ -2303,75 +2295,75 @@ const deprecationData = {
2303
2295
  `them on root via :class="$attrs.class".`,
2304
2296
  link: `https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html`
2305
2297
  },
2306
- ["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
2298
+ ["OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */]: {
2307
2299
  message: `The "data" option can no longer be a plain object. ` +
2308
2300
  `Always use a function.`,
2309
2301
  link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html`
2310
2302
  },
2311
- ["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
2303
+ ["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */]: {
2312
2304
  message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
2313
2305
  `In Vue 3, data keys are merged shallowly and will override one another.`,
2314
2306
  link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change`
2315
2307
  },
2316
- ["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
2308
+ ["OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */]: {
2317
2309
  message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
2318
2310
  },
2319
- ["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
2311
+ ["OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */]: {
2320
2312
  message: `\`destroyed\` has been renamed to \`unmounted\`.`
2321
2313
  },
2322
- ["WATCH_ARRAY" /* WATCH_ARRAY */]: {
2314
+ ["WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */]: {
2323
2315
  message: `"watch" option or vm.$watch on an array value will no longer ` +
2324
2316
  `trigger on array mutation unless the "deep" option is specified. ` +
2325
2317
  `If current usage is intended, you can disable the compat behavior and ` +
2326
2318
  `suppress this warning with:` +
2327
- `\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
2319
+ `\n\n configureCompat({ ${"WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */}: false })\n`,
2328
2320
  link: `https://v3-migration.vuejs.org/breaking-changes/watch.html`
2329
2321
  },
2330
- ["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
2322
+ ["PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */]: {
2331
2323
  message: (key) => `props default value function no longer has access to "this". The compat ` +
2332
2324
  `build only offers access to this.$options.` +
2333
2325
  `(found in prop "${key}")`,
2334
2326
  link: `https://v3-migration.vuejs.org/breaking-changes/props-default-this.html`
2335
2327
  },
2336
- ["CUSTOM_DIR" /* CUSTOM_DIR */]: {
2328
+ ["CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */]: {
2337
2329
  message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
2338
2330
  `Use "${newHook}" instead.`,
2339
2331
  link: `https://v3-migration.vuejs.org/breaking-changes/custom-directives.html`
2340
2332
  },
2341
- ["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
2333
+ ["V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */]: {
2342
2334
  message: `Using keyCode as v-on modifier is no longer supported. ` +
2343
2335
  `Use kebab-case key name modifiers instead.`,
2344
2336
  link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
2345
2337
  },
2346
- ["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
2338
+ ["ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */]: {
2347
2339
  message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
2348
2340
  `${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
2349
2341
  `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
2350
2342
  `you can disable the compat behavior and suppress this warning with:` +
2351
- `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
2343
+ `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */}: false })\n`,
2352
2344
  link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
2353
2345
  },
2354
- ["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
2346
+ ["ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */]: {
2355
2347
  message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
2356
2348
  `${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
2357
2349
  `Always use explicit "true" or "false" values for enumerated attributes. ` +
2358
2350
  `If the usage is intended, ` +
2359
2351
  `you can disable the compat behavior and suppress this warning with:` +
2360
- `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
2352
+ `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */}: false })\n`,
2361
2353
  link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
2362
2354
  },
2363
- ["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
2355
+ ["TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */]: {
2364
2356
  message: `` // this feature cannot be runtime-detected
2365
2357
  },
2366
- ["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
2358
+ ["TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */]: {
2367
2359
  message: `<TransitionGroup> no longer renders a root <span> element by ` +
2368
2360
  `default if no "tag" prop is specified. If you do not rely on the span ` +
2369
2361
  `for styling, you can disable the compat behavior and suppress this ` +
2370
2362
  `warning with:` +
2371
- `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
2363
+ `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */}: false })\n`,
2372
2364
  link: `https://v3-migration.vuejs.org/breaking-changes/transition-group.html`
2373
2365
  },
2374
- ["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
2366
+ ["COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */]: {
2375
2367
  message: (comp) => {
2376
2368
  const name = getComponentName(comp);
2377
2369
  return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
@@ -2380,11 +2372,11 @@ const deprecationData = {
2380
2372
  `usage and intend to use plain functions for functional components, ` +
2381
2373
  `you can disable the compat behavior and suppress this ` +
2382
2374
  `warning with:` +
2383
- `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
2375
+ `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */}: false })\n`);
2384
2376
  },
2385
2377
  link: `https://v3-migration.vuejs.org/breaking-changes/async-components.html`
2386
2378
  },
2387
- ["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
2379
+ ["COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */]: {
2388
2380
  message: (comp) => {
2389
2381
  const name = getComponentName(comp);
2390
2382
  return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
@@ -2395,10 +2387,10 @@ const deprecationData = {
2395
2387
  },
2396
2388
  link: `https://v3-migration.vuejs.org/breaking-changes/functional-components.html`
2397
2389
  },
2398
- ["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
2390
+ ["COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */]: {
2399
2391
  message: (comp) => {
2400
2392
  const configMsg = `opt-in to ` +
2401
- `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
2393
+ `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */}: false }\`.`;
2402
2394
  if (comp.props &&
2403
2395
  (isArray(comp.props)
2404
2396
  ? comp.props.includes('modelValue')
@@ -2412,20 +2404,20 @@ const deprecationData = {
2412
2404
  },
2413
2405
  link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
2414
2406
  },
2415
- ["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
2407
+ ["RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */]: {
2416
2408
  message: `Vue 3's render function API has changed. ` +
2417
2409
  `You can opt-in to the new API with:` +
2418
- `\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
2410
+ `\n\n configureCompat({ ${"RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */}: false })\n` +
2419
2411
  `\n (This can also be done per-component via the "compatConfig" option.)`,
2420
2412
  link: `https://v3-migration.vuejs.org/breaking-changes/render-function-api.html`
2421
2413
  },
2422
- ["FILTERS" /* FILTERS */]: {
2414
+ ["FILTERS" /* DeprecationTypes.FILTERS */]: {
2423
2415
  message: `filters have been removed in Vue 3. ` +
2424
2416
  `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
2425
2417
  `Use method calls or computed properties instead.`,
2426
2418
  link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
2427
2419
  },
2428
- ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
2420
+ ["PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */]: {
2429
2421
  message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
2430
2422
  `If you are seeing this warning only due to a dependency, you can ` +
2431
2423
  `suppress this warning via { PRIVATE_APIS: 'suppress-warning' }.`
@@ -2503,8 +2495,8 @@ function validateCompatConfig(config, instance) {
2503
2495
  warnedInvalidKeys[key] = true;
2504
2496
  }
2505
2497
  }
2506
- if (instance && config["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */] != null) {
2507
- warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */}" can only be configured globally.`);
2498
+ if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
2499
+ warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
2508
2500
  }
2509
2501
  }
2510
2502
  function getCompatConfigForKey(key, instance) {
@@ -2579,10 +2571,10 @@ function on(instance, event, fn) {
2579
2571
  }
2580
2572
  else {
2581
2573
  if (event.startsWith('hook:')) {
2582
- assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, event);
2574
+ assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, event);
2583
2575
  }
2584
2576
  else {
2585
- assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
2577
+ assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
2586
2578
  }
2587
2579
  const events = getRegistry(instance);
2588
2580
  (events[event] || (events[event] = [])).push(fn);
@@ -2599,7 +2591,7 @@ function once(instance, event, fn) {
2599
2591
  return instance.proxy;
2600
2592
  }
2601
2593
  function off(instance, event, fn) {
2602
- assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
2594
+ assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
2603
2595
  const vm = instance.proxy;
2604
2596
  // all
2605
2597
  if (!event) {
@@ -2627,7 +2619,7 @@ function off(instance, event, fn) {
2627
2619
  function emit$1(instance, event, args) {
2628
2620
  const cbs = getRegistry(instance)[event];
2629
2621
  if (cbs) {
2630
- callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2622
+ callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2631
2623
  }
2632
2624
  return instance.proxy;
2633
2625
  }
@@ -2637,8 +2629,8 @@ const warnedTypes = new WeakSet();
2637
2629
  function convertLegacyVModelProps(vnode) {
2638
2630
  const { type, shapeFlag, props, dynamicProps } = vnode;
2639
2631
  const comp = type;
2640
- if (shapeFlag & 6 /* COMPONENT */ && props && 'modelValue' in props) {
2641
- if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */,
2632
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
2633
+ if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
2642
2634
  // this is a special case where we want to use the vnode component's
2643
2635
  // compat config instead of the current rendering instance (which is the
2644
2636
  // parent of the component that exposes v-model)
@@ -2647,7 +2639,7 @@ function convertLegacyVModelProps(vnode) {
2647
2639
  }
2648
2640
  if ((process.env.NODE_ENV !== 'production') && !warnedTypes.has(comp)) {
2649
2641
  pushWarningContext(vnode);
2650
- warnDeprecation("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, { type }, comp);
2642
+ warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
2651
2643
  popWarningContext();
2652
2644
  warnedTypes.add(comp);
2653
2645
  }
@@ -2680,13 +2672,13 @@ function applyModelFromMixins(model, mixins) {
2680
2672
  }
2681
2673
  }
2682
2674
  function compatModelEmit(instance, event, args) {
2683
- if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, instance)) {
2675
+ if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
2684
2676
  return;
2685
2677
  }
2686
2678
  const props = instance.vnode.props;
2687
2679
  const modelHandler = props && props[compatModelEventPrefix + event];
2688
2680
  if (modelHandler) {
2689
- callWithErrorHandling(modelHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2681
+ callWithErrorHandling(modelHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2690
2682
  }
2691
2683
  }
2692
2684
 
@@ -2753,7 +2745,7 @@ function emit$2(instance, event, ...rawArgs) {
2753
2745
  handler = props[(handlerName = toHandlerKey(hyphenate(event)))];
2754
2746
  }
2755
2747
  if (handler) {
2756
- callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2748
+ callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2757
2749
  }
2758
2750
  const onceHandler = props[handlerName + `Once`];
2759
2751
  if (onceHandler) {
@@ -2764,7 +2756,7 @@ function emit$2(instance, event, ...rawArgs) {
2764
2756
  return;
2765
2757
  }
2766
2758
  instance.emitted[handlerName] = true;
2767
- callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2759
+ callWithAsyncErrorHandling(onceHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2768
2760
  }
2769
2761
  {
2770
2762
  compatModelEmit(instance, event, args);
@@ -2800,7 +2792,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2800
2792
  }
2801
2793
  }
2802
2794
  if (!raw && !hasExtends) {
2803
- cache.set(comp, null);
2795
+ if (isObject(comp)) {
2796
+ cache.set(comp, null);
2797
+ }
2804
2798
  return null;
2805
2799
  }
2806
2800
  if (isArray(raw)) {
@@ -2809,7 +2803,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2809
2803
  else {
2810
2804
  extend(normalized, raw);
2811
2805
  }
2812
- cache.set(comp, normalized);
2806
+ if (isObject(comp)) {
2807
+ cache.set(comp, normalized);
2808
+ }
2813
2809
  return normalized;
2814
2810
  }
2815
2811
  // Check if an incoming prop key is a declared emit event listener.
@@ -2939,7 +2935,7 @@ function renderComponentRoot(instance) {
2939
2935
  accessedAttrs = false;
2940
2936
  }
2941
2937
  try {
2942
- if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2938
+ if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
2943
2939
  // withProxy is a proxy with a different `has` trap only for
2944
2940
  // runtime-compiled render functions using `with` block.
2945
2941
  const proxyToUse = withProxy || proxy;
@@ -2972,7 +2968,7 @@ function renderComponentRoot(instance) {
2972
2968
  }
2973
2969
  catch (err) {
2974
2970
  blockStack.length = 0;
2975
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2971
+ handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
2976
2972
  result = createVNode(Comment);
2977
2973
  }
2978
2974
  // attr merging
@@ -2982,14 +2978,14 @@ function renderComponentRoot(instance) {
2982
2978
  let setRoot = undefined;
2983
2979
  if ((process.env.NODE_ENV !== 'production') &&
2984
2980
  result.patchFlag > 0 &&
2985
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2981
+ result.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
2986
2982
  [root, setRoot] = getChildRoot(result);
2987
2983
  }
2988
2984
  if (fallthroughAttrs && inheritAttrs !== false) {
2989
2985
  const keys = Object.keys(fallthroughAttrs);
2990
2986
  const { shapeFlag } = root;
2991
2987
  if (keys.length) {
2992
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2988
+ if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
2993
2989
  if (propsOptions && keys.some(isModelListener)) {
2994
2990
  // If a v-model listener (onUpdate:xxx) has a corresponding declared
2995
2991
  // prop, it indicates this component expects to handle v-model and
@@ -3034,13 +3030,13 @@ function renderComponentRoot(instance) {
3034
3030
  }
3035
3031
  }
3036
3032
  }
3037
- if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
3038
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
3039
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
3033
+ if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
3034
+ vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
3035
+ root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
3040
3036
  const { class: cls, style } = vnode.props || {};
3041
3037
  if (cls || style) {
3042
3038
  if ((process.env.NODE_ENV !== 'production') && inheritAttrs === false) {
3043
- warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
3039
+ warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
3044
3040
  }
3045
3041
  root = cloneVNode(root, {
3046
3042
  class: cls,
@@ -3144,7 +3140,7 @@ const filterModelListeners = (attrs, props) => {
3144
3140
  return res;
3145
3141
  };
3146
3142
  const isElementRoot = (vnode) => {
3147
- return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||
3143
+ return (vnode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 1 /* ShapeFlags.ELEMENT */) ||
3148
3144
  vnode.type === Comment // potential v-if branch switch
3149
3145
  );
3150
3146
  };
@@ -3163,19 +3159,19 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
3163
3159
  return true;
3164
3160
  }
3165
3161
  if (optimized && patchFlag >= 0) {
3166
- if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {
3162
+ if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) {
3167
3163
  // slot content that references values that might have changed,
3168
3164
  // e.g. in a v-for
3169
3165
  return true;
3170
3166
  }
3171
- if (patchFlag & 16 /* FULL_PROPS */) {
3167
+ if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
3172
3168
  if (!prevProps) {
3173
3169
  return !!nextProps;
3174
3170
  }
3175
3171
  // presence of this flag indicates props are always non-null
3176
3172
  return hasPropsChanged(prevProps, nextProps, emits);
3177
3173
  }
3178
- else if (patchFlag & 8 /* PROPS */) {
3174
+ else if (patchFlag & 8 /* PatchFlags.PROPS */) {
3179
3175
  const dynamicProps = nextVNode.dynamicProps;
3180
3176
  for (let i = 0; i < dynamicProps.length; i++) {
3181
3177
  const key = dynamicProps[i];
@@ -3433,7 +3429,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3433
3429
  if (delayEnter) {
3434
3430
  activeBranch.transition.afterLeave = () => {
3435
3431
  if (pendingId === suspense.pendingId) {
3436
- move(pendingBranch, container, anchor, 0 /* ENTER */);
3432
+ move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
3437
3433
  }
3438
3434
  };
3439
3435
  }
@@ -3448,7 +3444,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3448
3444
  }
3449
3445
  if (!delayEnter) {
3450
3446
  // move content from off-dom container to actual container
3451
- move(pendingBranch, container, anchor, 0 /* ENTER */);
3447
+ move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
3452
3448
  }
3453
3449
  }
3454
3450
  setActiveBranch(suspense, pendingBranch);
@@ -3522,7 +3518,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3522
3518
  const hydratedEl = instance.vnode.el;
3523
3519
  instance
3524
3520
  .asyncDep.catch(err => {
3525
- handleError(err, instance, 0 /* SETUP_FUNCTION */);
3521
+ handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
3526
3522
  })
3527
3523
  .then(asyncSetupResult => {
3528
3524
  // retry when the setup() promise resolves.
@@ -3596,7 +3592,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3596
3592
  }
3597
3593
  function normalizeSuspenseChildren(vnode) {
3598
3594
  const { shapeFlag, children } = vnode;
3599
- const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;
3595
+ const isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */;
3600
3596
  vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
3601
3597
  vnode.ssFallback = isSlotChildren
3602
3598
  ? normalizeSuspenseSlot(children.fallback)
@@ -3769,7 +3765,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3769
3765
  return traverse(s);
3770
3766
  }
3771
3767
  else if (isFunction(s)) {
3772
- return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
3768
+ return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */);
3773
3769
  }
3774
3770
  else {
3775
3771
  (process.env.NODE_ENV !== 'production') && warnInvalidSource(s);
@@ -3779,7 +3775,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3779
3775
  else if (isFunction(source)) {
3780
3776
  if (cb) {
3781
3777
  // getter with cb
3782
- getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
3778
+ getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */);
3783
3779
  }
3784
3780
  else {
3785
3781
  // no cb -> simple effect
@@ -3790,7 +3786,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3790
3786
  if (cleanup) {
3791
3787
  cleanup();
3792
3788
  }
3793
- return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onCleanup]);
3789
+ return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]);
3794
3790
  };
3795
3791
  }
3796
3792
  }
@@ -3804,7 +3800,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3804
3800
  getter = () => {
3805
3801
  const val = baseGetter();
3806
3802
  if (isArray(val) &&
3807
- checkCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance)) {
3803
+ checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
3808
3804
  traverse(val);
3809
3805
  }
3810
3806
  return val;
@@ -3817,7 +3813,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3817
3813
  let cleanup;
3818
3814
  let onCleanup = (fn) => {
3819
3815
  cleanup = effect.onStop = () => {
3820
- callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
3816
+ callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
3821
3817
  };
3822
3818
  };
3823
3819
  // in SSR there is no need to setup an actual effect, and it should be noop
@@ -3829,7 +3825,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3829
3825
  getter();
3830
3826
  }
3831
3827
  else if (immediate) {
3832
- callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
3828
+ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
3833
3829
  getter(),
3834
3830
  isMultiSource ? [] : undefined,
3835
3831
  onCleanup
@@ -3851,12 +3847,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3851
3847
  ? newValue.some((v, i) => hasChanged(v, oldValue[i]))
3852
3848
  : hasChanged(newValue, oldValue)) ||
3853
3849
  (isArray(newValue) &&
3854
- isCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance))) {
3850
+ isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
3855
3851
  // cleanup before running cb again
3856
3852
  if (cleanup) {
3857
3853
  cleanup();
3858
3854
  }
3859
- callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
3855
+ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
3860
3856
  newValue,
3861
3857
  // pass undefined as the old value when it's changed for the first time
3862
3858
  oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
@@ -3882,7 +3878,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3882
3878
  }
3883
3879
  else {
3884
3880
  // default: 'pre'
3885
- scheduler = () => queuePreFlushCb(job);
3881
+ job.pre = true;
3882
+ if (instance)
3883
+ job.id = instance.uid;
3884
+ scheduler = () => queueJob(job);
3886
3885
  }
3887
3886
  const effect = new ReactiveEffect(getter, scheduler);
3888
3887
  if ((process.env.NODE_ENV !== 'production')) {
@@ -3949,7 +3948,7 @@ function createPathGetter(ctx, path) {
3949
3948
  };
3950
3949
  }
3951
3950
  function traverse(value, seen) {
3952
- if (!isObject(value) || value["__v_skip" /* SKIP */]) {
3951
+ if (!isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) {
3953
3952
  return value;
3954
3953
  }
3955
3954
  seen = seen || new Set();
@@ -4139,7 +4138,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4139
4138
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
4140
4139
  const callHook = (hook, args) => {
4141
4140
  hook &&
4142
- callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
4141
+ callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args);
4143
4142
  };
4144
4143
  const callAsyncHook = (hook, args) => {
4145
4144
  const done = args[1];
@@ -4275,10 +4274,10 @@ function getKeepAliveChild(vnode) {
4275
4274
  : vnode;
4276
4275
  }
4277
4276
  function setTransitionHooks(vnode, hooks) {
4278
- if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
4277
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) {
4279
4278
  setTransitionHooks(vnode.component.subTree, hooks);
4280
4279
  }
4281
- else if (vnode.shapeFlag & 128 /* SUSPENSE */) {
4280
+ else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
4282
4281
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4283
4282
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4284
4283
  }
@@ -4297,7 +4296,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4297
4296
  : String(parentKey) + String(child.key != null ? child.key : i);
4298
4297
  // handle fragment children case, e.g. v-for
4299
4298
  if (child.type === Fragment) {
4300
- if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
4299
+ if (child.patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */)
4301
4300
  keyedFragmentCount++;
4302
4301
  ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
4303
4302
  }
@@ -4312,7 +4311,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4312
4311
  // these children to force full diffs to ensure correct behavior.
4313
4312
  if (keyedFragmentCount > 1) {
4314
4313
  for (let i = 0; i < ret.length; i++) {
4315
- ret[i].patchFlag = -2 /* BAIL */;
4314
+ ret[i].patchFlag = -2 /* PatchFlags.BAIL */;
4316
4315
  }
4317
4316
  }
4318
4317
  return ret;
@@ -4390,7 +4389,7 @@ function defineAsyncComponent(source) {
4390
4389
  }
4391
4390
  const onError = (err) => {
4392
4391
  pendingRequest = null;
4393
- handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
4392
+ handleError(err, instance, 13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
4394
4393
  };
4395
4394
  // suspense-controlled or SSR.
4396
4395
  if ((suspensible && instance.suspense) ||
@@ -4500,7 +4499,7 @@ const KeepAliveImpl = {
4500
4499
  const storageContainer = createElement('div');
4501
4500
  sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4502
4501
  const instance = vnode.component;
4503
- move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
4502
+ move(vnode, container, anchor, 0 /* MoveType.ENTER */, parentSuspense);
4504
4503
  // in case props have changed
4505
4504
  patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);
4506
4505
  queuePostRenderEffect(() => {
@@ -4520,7 +4519,7 @@ const KeepAliveImpl = {
4520
4519
  };
4521
4520
  sharedContext.deactivate = (vnode) => {
4522
4521
  const instance = vnode.component;
4523
- move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
4522
+ move(vnode, storageContainer, null, 1 /* MoveType.LEAVE */, parentSuspense);
4524
4523
  queuePostRenderEffect(() => {
4525
4524
  if (instance.da) {
4526
4525
  invokeArrayFns(instance.da);
@@ -4609,8 +4608,8 @@ const KeepAliveImpl = {
4609
4608
  return children;
4610
4609
  }
4611
4610
  else if (!isVNode(rawVNode) ||
4612
- (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&
4613
- !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {
4611
+ (!(rawVNode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) &&
4612
+ !(rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */))) {
4614
4613
  current = null;
4615
4614
  return rawVNode;
4616
4615
  }
@@ -4632,7 +4631,7 @@ const KeepAliveImpl = {
4632
4631
  // clone vnode if it's reused because we are going to mutate it
4633
4632
  if (vnode.el) {
4634
4633
  vnode = cloneVNode(vnode);
4635
- if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
4634
+ if (rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
4636
4635
  rawVNode.ssContent = vnode;
4637
4636
  }
4638
4637
  }
@@ -4651,7 +4650,7 @@ const KeepAliveImpl = {
4651
4650
  setTransitionHooks(vnode, vnode.transition);
4652
4651
  }
4653
4652
  // avoid vnode being mounted as fresh
4654
- vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
4653
+ vnode.shapeFlag |= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4655
4654
  // make this key the freshest
4656
4655
  keys.delete(key);
4657
4656
  keys.add(key);
@@ -4664,7 +4663,7 @@ const KeepAliveImpl = {
4664
4663
  }
4665
4664
  }
4666
4665
  // avoid vnode being unmounted
4667
- vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
4666
+ vnode.shapeFlag |= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4668
4667
  current = vnode;
4669
4668
  return isSuspense(rawVNode.type) ? rawVNode : vnode;
4670
4669
  };
@@ -4690,10 +4689,10 @@ function matches(pattern, name) {
4690
4689
  return false;
4691
4690
  }
4692
4691
  function onActivated(hook, target) {
4693
- registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);
4692
+ registerKeepAliveHook(hook, "a" /* LifecycleHooks.ACTIVATED */, target);
4694
4693
  }
4695
4694
  function onDeactivated(hook, target) {
4696
- registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);
4695
+ registerKeepAliveHook(hook, "da" /* LifecycleHooks.DEACTIVATED */, target);
4697
4696
  }
4698
4697
  function registerKeepAliveHook(hook, type, target = currentInstance) {
4699
4698
  // cache the deactivate branch check wrapper for injected hooks so the same
@@ -4737,16 +4736,16 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4737
4736
  }
4738
4737
  function resetShapeFlag(vnode) {
4739
4738
  let shapeFlag = vnode.shapeFlag;
4740
- if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
4741
- shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
4739
+ if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
4740
+ shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4742
4741
  }
4743
- if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
4744
- shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;
4742
+ if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
4743
+ shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4745
4744
  }
4746
4745
  vnode.shapeFlag = shapeFlag;
4747
4746
  }
4748
4747
  function getInnerChild(vnode) {
4749
- return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
4748
+ return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
4750
4749
  }
4751
4750
 
4752
4751
  function injectHook(type, hook, target = currentInstance, prepend = false) {
@@ -4792,23 +4791,23 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4792
4791
  }
4793
4792
  const createHook = (lifecycle) => (hook, target = currentInstance) =>
4794
4793
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
4795
- (!isInSSRComponentSetup || lifecycle === "sp" /* SERVER_PREFETCH */) &&
4794
+ (!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
4796
4795
  injectHook(lifecycle, hook, target);
4797
- const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);
4798
- const onMounted = createHook("m" /* MOUNTED */);
4799
- const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);
4800
- const onUpdated = createHook("u" /* UPDATED */);
4801
- const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
4802
- const onUnmounted = createHook("um" /* UNMOUNTED */);
4803
- const onServerPrefetch = createHook("sp" /* SERVER_PREFETCH */);
4804
- const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);
4805
- const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);
4796
+ const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
4797
+ const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
4798
+ const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
4799
+ const onUpdated = createHook("u" /* LifecycleHooks.UPDATED */);
4800
+ const onBeforeUnmount = createHook("bum" /* LifecycleHooks.BEFORE_UNMOUNT */);
4801
+ const onUnmounted = createHook("um" /* LifecycleHooks.UNMOUNTED */);
4802
+ const onServerPrefetch = createHook("sp" /* LifecycleHooks.SERVER_PREFETCH */);
4803
+ const onRenderTriggered = createHook("rtg" /* LifecycleHooks.RENDER_TRIGGERED */);
4804
+ const onRenderTracked = createHook("rtc" /* LifecycleHooks.RENDER_TRACKED */);
4806
4805
  function onErrorCaptured(hook, target = currentInstance) {
4807
- injectHook("ec" /* ERROR_CAPTURED */, hook, target);
4806
+ injectHook("ec" /* LifecycleHooks.ERROR_CAPTURED */, hook, target);
4808
4807
  }
4809
4808
 
4810
4809
  function getCompatChildren(instance) {
4811
- assertCompatEnabled("INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */, instance);
4810
+ assertCompatEnabled("INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */, instance);
4812
4811
  const root = instance.subTree;
4813
4812
  const children = [];
4814
4813
  if (root) {
@@ -4820,7 +4819,7 @@ function walk(vnode, children) {
4820
4819
  if (vnode.component) {
4821
4820
  children.push(vnode.component.proxy);
4822
4821
  }
4823
- else if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
4822
+ else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
4824
4823
  const vnodes = vnode.children;
4825
4824
  for (let i = 0; i < vnodes.length; i++) {
4826
4825
  walk(vnodes[i], children);
@@ -4829,7 +4828,7 @@ function walk(vnode, children) {
4829
4828
  }
4830
4829
 
4831
4830
  function getCompatListeners(instance) {
4832
- assertCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance);
4831
+ assertCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance);
4833
4832
  const listeners = {};
4834
4833
  const rawProps = instance.vnode.props;
4835
4834
  if (!rawProps) {
@@ -4857,7 +4856,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
4857
4856
  mappedName.forEach(mapped => {
4858
4857
  const mappedHook = dir[mapped];
4859
4858
  if (mappedHook) {
4860
- softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mapped, name);
4859
+ softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mapped, name);
4861
4860
  hook.push(mappedHook);
4862
4861
  }
4863
4862
  });
@@ -4865,7 +4864,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
4865
4864
  }
4866
4865
  else {
4867
4866
  if (dir[mappedName]) {
4868
- softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mappedName, name);
4867
+ softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mappedName, name);
4869
4868
  }
4870
4869
  return dir[mappedName];
4871
4870
  }
@@ -4939,7 +4938,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
4939
4938
  // disable tracking inside all lifecycle hooks
4940
4939
  // since they can potentially be called inside effects.
4941
4940
  pauseTracking();
4942
- callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [
4941
+ callWithAsyncErrorHandling(hook, instance, 8 /* ErrorCodes.DIRECTIVE_HOOK */, [
4943
4942
  vnode.el,
4944
4943
  binding,
4945
4944
  vnode,
@@ -5046,7 +5045,7 @@ function convertLegacyRenderFn(instance) {
5046
5045
  return;
5047
5046
  }
5048
5047
  // v2 render function, try to provide compat
5049
- if (checkCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance)) {
5048
+ if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
5050
5049
  const wrapped = (Component.render = function compatRender() {
5051
5050
  // @ts-ignore
5052
5051
  return render.call(this, compatH);
@@ -5168,7 +5167,7 @@ function convertLegacyDirectives(vnode, props) {
5168
5167
  function convertLegacySlots(vnode) {
5169
5168
  const { props, children } = vnode;
5170
5169
  let slots;
5171
- if (vnode.shapeFlag & 6 /* COMPONENT */ && isArray(children)) {
5170
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && isArray(children)) {
5172
5171
  slots = {};
5173
5172
  // check "slot" property on vnodes and turn them into v3 function slots
5174
5173
  for (let i = 0; i < children.length; i++) {
@@ -5207,8 +5206,8 @@ function convertLegacySlots(vnode) {
5207
5206
  }
5208
5207
  function defineLegacyVNodeProperties(vnode) {
5209
5208
  /* istanbul ignore if */
5210
- if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
5211
- isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
5209
+ if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
5210
+ isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
5212
5211
  const context = currentRenderingInstance;
5213
5212
  const getInstance = () => vnode.component && vnode.component.proxy;
5214
5213
  let componentOptions;
@@ -5222,7 +5221,7 @@ function defineLegacyVNodeProperties(vnode) {
5222
5221
  context: { get: () => context && context.proxy },
5223
5222
  componentOptions: {
5224
5223
  get: () => {
5225
- if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
5224
+ if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
5226
5225
  if (componentOptions) {
5227
5226
  return componentOptions;
5228
5227
  }
@@ -5342,7 +5341,13 @@ function createSlots(slots, dynamicSlots) {
5342
5341
  }
5343
5342
  else if (slot) {
5344
5343
  // conditional single slot generated by <template v-if="..." #foo>
5345
- slots[slot.name] = slot.fn;
5344
+ slots[slot.name] = slot.key
5345
+ ? (...args) => {
5346
+ const res = slot.fn(...args);
5347
+ res.key = slot.key;
5348
+ return res;
5349
+ }
5350
+ : slot.fn;
5346
5351
  }
5347
5352
  }
5348
5353
  return slots;
@@ -5378,9 +5383,15 @@ fallback, noSlotted) {
5378
5383
  }
5379
5384
  openBlock();
5380
5385
  const validSlotContent = slot && ensureValidVNode(slot(props));
5381
- const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */
5382
- ? 64 /* STABLE_FRAGMENT */
5383
- : -2 /* BAIL */);
5386
+ const rendered = createBlock(Fragment, {
5387
+ key: props.key ||
5388
+ // slot content array of a dynamic conditional slot may have a branch
5389
+ // key attached in the `createSlots` helper, respect that
5390
+ (validSlotContent && validSlotContent.key) ||
5391
+ `_${name}`
5392
+ }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* SlotFlags.STABLE */
5393
+ ? 64 /* PatchFlags.STABLE_FRAGMENT */
5394
+ : -2 /* PatchFlags.BAIL */);
5384
5395
  if (!noSlotted && rendered.scopeId) {
5385
5396
  rendered.slotScopeIds = [rendered.scopeId + '-s'];
5386
5397
  }
@@ -5408,14 +5419,16 @@ function ensureValidVNode(vnodes) {
5408
5419
  * For prefixing keys in v-on="obj" with "on"
5409
5420
  * @private
5410
5421
  */
5411
- function toHandlers(obj) {
5422
+ function toHandlers(obj, preserveCaseIfNecessary) {
5412
5423
  const ret = {};
5413
5424
  if ((process.env.NODE_ENV !== 'production') && !isObject(obj)) {
5414
5425
  warn$1(`v-on with no argument expects an object value.`);
5415
5426
  return ret;
5416
5427
  }
5417
5428
  for (const key in obj) {
5418
- ret[toHandlerKey(key)] = obj[key];
5429
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key)
5430
+ ? `on:${key}`
5431
+ : toHandlerKey(key)] = obj[key];
5419
5432
  }
5420
5433
  return ret;
5421
5434
  }
@@ -5551,26 +5564,26 @@ function installCompatInstanceProperties(map) {
5551
5564
  };
5552
5565
  extend(map, {
5553
5566
  $set: i => {
5554
- assertCompatEnabled("INSTANCE_SET" /* INSTANCE_SET */, i);
5567
+ assertCompatEnabled("INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */, i);
5555
5568
  return set;
5556
5569
  },
5557
5570
  $delete: i => {
5558
- assertCompatEnabled("INSTANCE_DELETE" /* INSTANCE_DELETE */, i);
5571
+ assertCompatEnabled("INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */, i);
5559
5572
  return del;
5560
5573
  },
5561
5574
  $mount: i => {
5562
- assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null /* this warning is global */);
5575
+ assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null /* this warning is global */);
5563
5576
  // root mount override from ./global.ts in installCompatMount
5564
5577
  return i.ctx._compat_mount || NOOP;
5565
5578
  },
5566
5579
  $destroy: i => {
5567
- assertCompatEnabled("INSTANCE_DESTROY" /* INSTANCE_DESTROY */, i);
5580
+ assertCompatEnabled("INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */, i);
5568
5581
  // root destroy override from ./global.ts in installCompatMount
5569
5582
  return i.ctx._compat_destroy || NOOP;
5570
5583
  },
5571
5584
  // overrides existing accessor
5572
5585
  $slots: i => {
5573
- if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, i) &&
5586
+ if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
5574
5587
  i.render &&
5575
5588
  i.render._compatWrapped) {
5576
5589
  return new Proxy(i.slots, legacySlotProxyHandlers);
@@ -5578,7 +5591,7 @@ function installCompatInstanceProperties(map) {
5578
5591
  return (process.env.NODE_ENV !== 'production') ? shallowReadonly(i.slots) : i.slots;
5579
5592
  },
5580
5593
  $scopedSlots: i => {
5581
- assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */, i);
5594
+ assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */, i);
5582
5595
  const res = {};
5583
5596
  for (const key in i.slots) {
5584
5597
  const fn = i.slots[key];
@@ -5595,7 +5608,7 @@ function installCompatInstanceProperties(map) {
5595
5608
  $listeners: getCompatListeners
5596
5609
  });
5597
5610
  /* istanbul ignore if */
5598
- if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, null)) {
5611
+ if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
5599
5612
  extend(map, {
5600
5613
  // needed by many libs / render fns
5601
5614
  $vnode: i => i.vnode,
@@ -5700,23 +5713,23 @@ const PublicInstanceProxyHandlers = {
5700
5713
  const n = accessCache[key];
5701
5714
  if (n !== undefined) {
5702
5715
  switch (n) {
5703
- case 1 /* SETUP */:
5716
+ case 1 /* AccessTypes.SETUP */:
5704
5717
  return setupState[key];
5705
- case 2 /* DATA */:
5718
+ case 2 /* AccessTypes.DATA */:
5706
5719
  return data[key];
5707
- case 4 /* CONTEXT */:
5720
+ case 4 /* AccessTypes.CONTEXT */:
5708
5721
  return ctx[key];
5709
- case 3 /* PROPS */:
5722
+ case 3 /* AccessTypes.PROPS */:
5710
5723
  return props[key];
5711
5724
  // default: just fallthrough
5712
5725
  }
5713
5726
  }
5714
5727
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
5715
- accessCache[key] = 1 /* SETUP */;
5728
+ accessCache[key] = 1 /* AccessTypes.SETUP */;
5716
5729
  return setupState[key];
5717
5730
  }
5718
5731
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
5719
- accessCache[key] = 2 /* DATA */;
5732
+ accessCache[key] = 2 /* AccessTypes.DATA */;
5720
5733
  return data[key];
5721
5734
  }
5722
5735
  else if (
@@ -5724,15 +5737,15 @@ const PublicInstanceProxyHandlers = {
5724
5737
  // props
5725
5738
  (normalizedProps = instance.propsOptions[0]) &&
5726
5739
  hasOwn(normalizedProps, key)) {
5727
- accessCache[key] = 3 /* PROPS */;
5740
+ accessCache[key] = 3 /* AccessTypes.PROPS */;
5728
5741
  return props[key];
5729
5742
  }
5730
5743
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
5731
- accessCache[key] = 4 /* CONTEXT */;
5744
+ accessCache[key] = 4 /* AccessTypes.CONTEXT */;
5732
5745
  return ctx[key];
5733
5746
  }
5734
5747
  else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {
5735
- accessCache[key] = 0 /* OTHER */;
5748
+ accessCache[key] = 0 /* AccessTypes.OTHER */;
5736
5749
  }
5737
5750
  }
5738
5751
  const publicGetter = publicPropertiesMap[key];
@@ -5740,7 +5753,7 @@ const PublicInstanceProxyHandlers = {
5740
5753
  // public $xxx properties
5741
5754
  if (publicGetter) {
5742
5755
  if (key === '$attrs') {
5743
- track(instance, "get" /* GET */, key);
5756
+ track(instance, "get" /* TrackOpTypes.GET */, key);
5744
5757
  (process.env.NODE_ENV !== 'production') && markAttrsAccessed();
5745
5758
  }
5746
5759
  return publicGetter(instance);
@@ -5753,7 +5766,7 @@ const PublicInstanceProxyHandlers = {
5753
5766
  }
5754
5767
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
5755
5768
  // user may set custom properties to `this` that start with `$`
5756
- accessCache[key] = 4 /* CONTEXT */;
5769
+ accessCache[key] = 4 /* AccessTypes.CONTEXT */;
5757
5770
  return ctx[key];
5758
5771
  }
5759
5772
  else if (
@@ -5932,7 +5945,7 @@ function deepMergeData(to, from) {
5932
5945
  const toVal = to[key];
5933
5946
  const fromVal = from[key];
5934
5947
  if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
5935
- (process.env.NODE_ENV !== 'production') && warnDeprecation("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null, key);
5948
+ (process.env.NODE_ENV !== 'production') && warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
5936
5949
  deepMergeData(toVal, fromVal);
5937
5950
  }
5938
5951
  else {
@@ -5963,7 +5976,7 @@ function applyOptions(instance) {
5963
5976
  // call beforeCreate first before accessing other options since
5964
5977
  // the hook may mutate resolved options (#2791)
5965
5978
  if (options.beforeCreate) {
5966
- callHook(options.beforeCreate, instance, "bc" /* BEFORE_CREATE */);
5979
+ callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
5967
5980
  }
5968
5981
  const {
5969
5982
  // state
@@ -5979,7 +5992,7 @@ function applyOptions(instance) {
5979
5992
  const [propsOptions] = instance.propsOptions;
5980
5993
  if (propsOptions) {
5981
5994
  for (const key in propsOptions) {
5982
- checkDuplicateProperties("Props" /* PROPS */, key);
5995
+ checkDuplicateProperties("Props" /* OptionTypes.PROPS */, key);
5983
5996
  }
5984
5997
  }
5985
5998
  }
@@ -6012,7 +6025,7 @@ function applyOptions(instance) {
6012
6025
  ctx[key] = methodHandler.bind(publicThis);
6013
6026
  }
6014
6027
  if ((process.env.NODE_ENV !== 'production')) {
6015
- checkDuplicateProperties("Methods" /* METHODS */, key);
6028
+ checkDuplicateProperties("Methods" /* OptionTypes.METHODS */, key);
6016
6029
  }
6017
6030
  }
6018
6031
  else if ((process.env.NODE_ENV !== 'production')) {
@@ -6039,7 +6052,7 @@ function applyOptions(instance) {
6039
6052
  instance.data = reactive(data);
6040
6053
  if ((process.env.NODE_ENV !== 'production')) {
6041
6054
  for (const key in data) {
6042
- checkDuplicateProperties("Data" /* DATA */, key);
6055
+ checkDuplicateProperties("Data" /* OptionTypes.DATA */, key);
6043
6056
  // expose data on ctx during dev
6044
6057
  if (!isReservedPrefix(key[0])) {
6045
6058
  Object.defineProperty(ctx, key, {
@@ -6084,7 +6097,7 @@ function applyOptions(instance) {
6084
6097
  set: v => (c.value = v)
6085
6098
  });
6086
6099
  if ((process.env.NODE_ENV !== 'production')) {
6087
- checkDuplicateProperties("Computed" /* COMPUTED */, key);
6100
+ checkDuplicateProperties("Computed" /* OptionTypes.COMPUTED */, key);
6088
6101
  }
6089
6102
  }
6090
6103
  }
@@ -6102,7 +6115,7 @@ function applyOptions(instance) {
6102
6115
  });
6103
6116
  }
6104
6117
  if (created) {
6105
- callHook(created, instance, "c" /* CREATED */);
6118
+ callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
6106
6119
  }
6107
6120
  function registerLifecycleHook(register, hook) {
6108
6121
  if (isArray(hook)) {
@@ -6126,11 +6139,11 @@ function applyOptions(instance) {
6126
6139
  registerLifecycleHook(onServerPrefetch, serverPrefetch);
6127
6140
  {
6128
6141
  if (beforeDestroy &&
6129
- softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */, instance)) {
6142
+ softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */, instance)) {
6130
6143
  registerLifecycleHook(onBeforeUnmount, beforeDestroy);
6131
6144
  }
6132
6145
  if (destroyed &&
6133
- softAssertCompatEnabled("OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */, instance)) {
6146
+ softAssertCompatEnabled("OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */, instance)) {
6134
6147
  registerLifecycleHook(onUnmounted, destroyed);
6135
6148
  }
6136
6149
  }
@@ -6162,7 +6175,7 @@ function applyOptions(instance) {
6162
6175
  if (directives)
6163
6176
  instance.directives = directives;
6164
6177
  if (filters &&
6165
- isCompatEnabled("FILTERS" /* FILTERS */, instance)) {
6178
+ isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
6166
6179
  instance.filters = filters;
6167
6180
  }
6168
6181
  }
@@ -6209,7 +6222,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
6209
6222
  ctx[key] = injected;
6210
6223
  }
6211
6224
  if ((process.env.NODE_ENV !== 'production')) {
6212
- checkDuplicateProperties("Inject" /* INJECT */, key);
6225
+ checkDuplicateProperties("Inject" /* OptionTypes.INJECT */, key);
6213
6226
  }
6214
6227
  }
6215
6228
  }
@@ -6269,7 +6282,7 @@ function resolveMergedOptions(instance) {
6269
6282
  resolved = cached;
6270
6283
  }
6271
6284
  else if (!globalMixins.length && !mixins && !extendsOptions) {
6272
- if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, instance)) {
6285
+ if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
6273
6286
  resolved = extend({}, base);
6274
6287
  resolved.parent = instance.parent && instance.parent.proxy;
6275
6288
  resolved.propsData = instance.vnode.props;
@@ -6285,7 +6298,9 @@ function resolveMergedOptions(instance) {
6285
6298
  }
6286
6299
  mergeOptions(resolved, base, optionMergeStrategies);
6287
6300
  }
6288
- cache.set(base, resolved);
6301
+ if (isObject(base)) {
6302
+ cache.set(base, resolved);
6303
+ }
6289
6304
  return resolved;
6290
6305
  }
6291
6306
  function mergeOptions(to, from, strats, asMixin = false) {
@@ -6354,7 +6369,7 @@ function mergeDataFn(to, from) {
6354
6369
  return from;
6355
6370
  }
6356
6371
  return function mergedDataFn() {
6357
- return (isCompatEnabled("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null)
6372
+ return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
6358
6373
  ? deepMergeData
6359
6374
  : extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
6360
6375
  };
@@ -6394,7 +6409,7 @@ function createPropsDefaultThis(instance, rawProps, propKey) {
6394
6409
  return new Proxy({}, {
6395
6410
  get(_, key) {
6396
6411
  (process.env.NODE_ENV !== 'production') &&
6397
- warnDeprecation("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, null, propKey);
6412
+ warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
6398
6413
  // $options
6399
6414
  if (key === '$options') {
6400
6415
  return resolveMergedOptions(instance);
@@ -6424,11 +6439,11 @@ function shouldSkipAttr(key, instance) {
6424
6439
  return true;
6425
6440
  }
6426
6441
  if ((key === 'class' || key === 'style') &&
6427
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
6442
+ isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
6428
6443
  return true;
6429
6444
  }
6430
6445
  if (isOn(key) &&
6431
- isCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance)) {
6446
+ isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
6432
6447
  return true;
6433
6448
  }
6434
6449
  // vue-router
@@ -6471,6 +6486,13 @@ isSSR = false) {
6471
6486
  }
6472
6487
  instance.attrs = attrs;
6473
6488
  }
6489
+ function isInHmrContext(instance) {
6490
+ while (instance) {
6491
+ if (instance.type.__hmrId)
6492
+ return true;
6493
+ instance = instance.parent;
6494
+ }
6495
+ }
6474
6496
  function updateProps(instance, rawProps, rawPrevProps, optimized) {
6475
6497
  const { props, attrs, vnode: { patchFlag } } = instance;
6476
6498
  const rawCurrentProps = toRaw(props);
@@ -6480,12 +6502,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6480
6502
  // always force full diff in dev
6481
6503
  // - #1942 if hmr is enabled with sfc component
6482
6504
  // - vite#872 non-sfc component used by sfc component
6483
- !((process.env.NODE_ENV !== 'production') &&
6484
- (instance.type.__hmrId ||
6485
- (instance.parent && instance.parent.type.__hmrId))) &&
6505
+ !((process.env.NODE_ENV !== 'production') && isInHmrContext(instance)) &&
6486
6506
  (optimized || patchFlag > 0) &&
6487
- !(patchFlag & 16 /* FULL_PROPS */)) {
6488
- if (patchFlag & 8 /* PROPS */) {
6507
+ !(patchFlag & 16 /* PatchFlags.FULL_PROPS */)) {
6508
+ if (patchFlag & 8 /* PatchFlags.PROPS */) {
6489
6509
  // Compiler-generated props & no keys change, just set the updated
6490
6510
  // the props.
6491
6511
  const propsToUpdate = instance.vnode.dynamicProps;
@@ -6572,7 +6592,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6572
6592
  }
6573
6593
  // trigger updates for $attrs in case it's used in component slots
6574
6594
  if (hasAttrsChanged) {
6575
- trigger(instance, "set" /* SET */, '$attrs');
6595
+ trigger(instance, "set" /* TriggerOpTypes.SET */, '$attrs');
6576
6596
  }
6577
6597
  if ((process.env.NODE_ENV !== 'production')) {
6578
6598
  validateProps(rawProps || {}, props, instance);
@@ -6590,7 +6610,7 @@ function setFullProps(instance, rawProps, props, attrs) {
6590
6610
  }
6591
6611
  {
6592
6612
  if (key.startsWith('onHook:')) {
6593
- softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
6613
+ softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
6594
6614
  }
6595
6615
  if (key === 'inline-template') {
6596
6616
  continue;
@@ -6651,7 +6671,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6651
6671
  }
6652
6672
  else {
6653
6673
  setCurrentInstance(instance);
6654
- value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, instance)
6674
+ value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
6655
6675
  ? createPropsDefaultThis(instance, props, key)
6656
6676
  : null, props);
6657
6677
  unsetCurrentInstance();
@@ -6662,11 +6682,11 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6662
6682
  }
6663
6683
  }
6664
6684
  // boolean casting
6665
- if (opt[0 /* shouldCast */]) {
6685
+ if (opt[0 /* BooleanFlags.shouldCast */]) {
6666
6686
  if (isAbsent && !hasDefault) {
6667
6687
  value = false;
6668
6688
  }
6669
- else if (opt[1 /* shouldCastTrue */] &&
6689
+ else if (opt[1 /* BooleanFlags.shouldCastTrue */] &&
6670
6690
  (value === '' || value === hyphenate(key))) {
6671
6691
  value = true;
6672
6692
  }
@@ -6707,7 +6727,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6707
6727
  }
6708
6728
  }
6709
6729
  if (!raw && !hasExtends) {
6710
- cache.set(comp, EMPTY_ARR);
6730
+ if (isObject(comp)) {
6731
+ cache.set(comp, EMPTY_ARR);
6732
+ }
6711
6733
  return EMPTY_ARR;
6712
6734
  }
6713
6735
  if (isArray(raw)) {
@@ -6734,8 +6756,8 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6734
6756
  if (prop) {
6735
6757
  const booleanIndex = getTypeIndex(Boolean, prop.type);
6736
6758
  const stringIndex = getTypeIndex(String, prop.type);
6737
- prop[0 /* shouldCast */] = booleanIndex > -1;
6738
- prop[1 /* shouldCastTrue */] =
6759
+ prop[0 /* BooleanFlags.shouldCast */] = booleanIndex > -1;
6760
+ prop[1 /* BooleanFlags.shouldCastTrue */] =
6739
6761
  stringIndex < 0 || booleanIndex < stringIndex;
6740
6762
  // if the prop needs boolean casting or default value
6741
6763
  if (booleanIndex > -1 || hasOwn(prop, 'default')) {
@@ -6746,7 +6768,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6746
6768
  }
6747
6769
  }
6748
6770
  const res = [normalized, needCastKeys];
6749
- cache.set(comp, res);
6771
+ if (isObject(comp)) {
6772
+ cache.set(comp, res);
6773
+ }
6750
6774
  return res;
6751
6775
  }
6752
6776
  function validatePropName(key) {
@@ -6938,7 +6962,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
6938
6962
  }
6939
6963
  else if (value != null) {
6940
6964
  if ((process.env.NODE_ENV !== 'production') &&
6941
- !(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
6965
+ !(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
6942
6966
  warn$1(`Non-function value encountered for slot "${key}". ` +
6943
6967
  `Prefer function slots for better performance.`);
6944
6968
  }
@@ -6950,7 +6974,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
6950
6974
  const normalizeVNodeSlots = (instance, children) => {
6951
6975
  if ((process.env.NODE_ENV !== 'production') &&
6952
6976
  !isKeepAlive(instance.vnode) &&
6953
- !(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
6977
+ !(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
6954
6978
  warn$1(`Non-function value encountered for default slot. ` +
6955
6979
  `Prefer function slots for better performance.`);
6956
6980
  }
@@ -6958,7 +6982,7 @@ const normalizeVNodeSlots = (instance, children) => {
6958
6982
  instance.slots.default = () => normalized;
6959
6983
  };
6960
6984
  const initSlots = (instance, children) => {
6961
- if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
6985
+ if (instance.vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
6962
6986
  const type = children._;
6963
6987
  if (type) {
6964
6988
  // users can get the shallow readonly version of the slots object through `this.$slots`,
@@ -6983,7 +7007,7 @@ const updateSlots = (instance, children, optimized) => {
6983
7007
  const { vnode, slots } = instance;
6984
7008
  let needDeletionCheck = true;
6985
7009
  let deletionComparisonTarget = EMPTY_OBJ;
6986
- if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
7010
+ if (vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
6987
7011
  const type = children._;
6988
7012
  if (type) {
6989
7013
  // compiled slots.
@@ -6992,7 +7016,7 @@ const updateSlots = (instance, children, optimized) => {
6992
7016
  // force update slots and mark instance for hmr as well
6993
7017
  extend(slots, children);
6994
7018
  }
6995
- else if (optimized && type === 1 /* STABLE */) {
7019
+ else if (optimized && type === 1 /* SlotFlags.STABLE */) {
6996
7020
  // compiled AND stable.
6997
7021
  // no need to update, and skip stale slots removal.
6998
7022
  needDeletionCheck = false;
@@ -7005,7 +7029,7 @@ const updateSlots = (instance, children, optimized) => {
7005
7029
  // when rendering the optimized slots by manually written render function,
7006
7030
  // we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
7007
7031
  // i.e. let the `renderSlot` create the bailed Fragment
7008
- if (!optimized && type === 1 /* STABLE */) {
7032
+ if (!optimized && type === 1 /* SlotFlags.STABLE */) {
7009
7033
  delete slots._;
7010
7034
  }
7011
7035
  }
@@ -7034,11 +7058,11 @@ const updateSlots = (instance, children, optimized) => {
7034
7058
  // dev only
7035
7059
  function installLegacyConfigWarnings(config) {
7036
7060
  const legacyConfigOptions = {
7037
- silent: "CONFIG_SILENT" /* CONFIG_SILENT */,
7038
- devtools: "CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */,
7039
- ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */,
7040
- keyCodes: "CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */,
7041
- productionTip: "CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */
7061
+ silent: "CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */,
7062
+ devtools: "CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */,
7063
+ ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */,
7064
+ keyCodes: "CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */,
7065
+ productionTip: "CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */
7042
7066
  };
7043
7067
  Object.keys(legacyConfigOptions).forEach(key => {
7044
7068
  let val = config[key];
@@ -7063,7 +7087,7 @@ function installLegacyOptionMergeStrats(config) {
7063
7087
  return target[key];
7064
7088
  }
7065
7089
  if (key in internalOptionMergeStrats &&
7066
- softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */, null)) {
7090
+ softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */, null)) {
7067
7091
  return internalOptionMergeStrats[key];
7068
7092
  }
7069
7093
  }
@@ -7081,11 +7105,11 @@ function createCompatVue(createApp, createSingletonApp) {
7081
7105
  return createCompatApp(options, Vue);
7082
7106
  });
7083
7107
  function createCompatApp(options = {}, Ctor) {
7084
- assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null);
7108
+ assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null);
7085
7109
  const { data } = options;
7086
7110
  if (data &&
7087
7111
  !isFunction(data) &&
7088
- softAssertCompatEnabled("OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */, null)) {
7112
+ softAssertCompatEnabled("OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */, null)) {
7089
7113
  options.data = () => data;
7090
7114
  }
7091
7115
  const app = createApp(options);
@@ -7100,7 +7124,7 @@ function createCompatVue(createApp, createSingletonApp) {
7100
7124
  return vm;
7101
7125
  }
7102
7126
  }
7103
- Vue.version = `2.6.14-compat:${"3.2.37"}`;
7127
+ Vue.version = `2.6.14-compat:${"3.2.38"}`;
7104
7128
  Vue.config = singletonApp.config;
7105
7129
  Vue.use = (p, ...options) => {
7106
7130
  if (p && isFunction(p.install)) {
@@ -7139,7 +7163,7 @@ function createCompatVue(createApp, createSingletonApp) {
7139
7163
  Vue.nextTick = nextTick;
7140
7164
  const extendCache = new WeakMap();
7141
7165
  function extendCtor(extendOptions = {}) {
7142
- assertCompatEnabled("GLOBAL_EXTEND" /* GLOBAL_EXTEND */, null);
7166
+ assertCompatEnabled("GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */, null);
7143
7167
  if (isFunction(extendOptions)) {
7144
7168
  extendOptions = extendOptions.options;
7145
7169
  }
@@ -7180,15 +7204,15 @@ function createCompatVue(createApp, createSingletonApp) {
7180
7204
  }
7181
7205
  Vue.extend = extendCtor.bind(Vue);
7182
7206
  Vue.set = (target, key, value) => {
7183
- assertCompatEnabled("GLOBAL_SET" /* GLOBAL_SET */, null);
7207
+ assertCompatEnabled("GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */, null);
7184
7208
  target[key] = value;
7185
7209
  };
7186
7210
  Vue.delete = (target, key) => {
7187
- assertCompatEnabled("GLOBAL_DELETE" /* GLOBAL_DELETE */, null);
7211
+ assertCompatEnabled("GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */, null);
7188
7212
  delete target[key];
7189
7213
  };
7190
7214
  Vue.observable = (target) => {
7191
- assertCompatEnabled("GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */, null);
7215
+ assertCompatEnabled("GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */, null);
7192
7216
  return reactive(target);
7193
7217
  };
7194
7218
  Vue.filter = ((name, filter) => {
@@ -7209,7 +7233,7 @@ function createCompatVue(createApp, createSingletonApp) {
7209
7233
  };
7210
7234
  Object.defineProperty(Vue, 'util', {
7211
7235
  get() {
7212
- assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */, null);
7236
+ assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */, null);
7213
7237
  return util;
7214
7238
  }
7215
7239
  });
@@ -7233,7 +7257,7 @@ function installAppCompatProperties(app, context, render) {
7233
7257
  function installFilterMethod(app, context) {
7234
7258
  context.filters = {};
7235
7259
  app.filter = (name, filter) => {
7236
- assertCompatEnabled("FILTERS" /* FILTERS */, null);
7260
+ assertCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, null);
7237
7261
  if (!filter) {
7238
7262
  return context.filters[name];
7239
7263
  }
@@ -7250,7 +7274,7 @@ function installLegacyAPIs(app) {
7250
7274
  // so that app.use() can work with legacy plugins that extend prototypes
7251
7275
  prototype: {
7252
7276
  get() {
7253
- (process.env.NODE_ENV !== 'production') && warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
7277
+ (process.env.NODE_ENV !== 'production') && warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
7254
7278
  return app.config.globalProperties;
7255
7279
  }
7256
7280
  },
@@ -7287,7 +7311,7 @@ function applySingletonAppMutations(app) {
7287
7311
  app.config[key] = isObject(val) ? Object.create(val) : val;
7288
7312
  // compat for runtime ignoredElements -> isCustomElement
7289
7313
  if (key === 'ignoredElements' &&
7290
- isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
7314
+ isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
7291
7315
  !isRuntimeOnly() &&
7292
7316
  isArray(val)) {
7293
7317
  app.config.compilerOptions.isCustomElement = tag => {
@@ -7300,7 +7324,7 @@ function applySingletonAppMutations(app) {
7300
7324
  }
7301
7325
  function applySingletonPrototype(app, Ctor) {
7302
7326
  // copy prototype augmentations as config.globalProperties
7303
- const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
7327
+ const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
7304
7328
  if (enabled) {
7305
7329
  app.config.globalProperties = Object.create(Ctor.prototype);
7306
7330
  }
@@ -7315,7 +7339,7 @@ function applySingletonPrototype(app, Ctor) {
7315
7339
  }
7316
7340
  }
7317
7341
  if ((process.env.NODE_ENV !== 'production') && hasPrototypeAugmentations) {
7318
- warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
7342
+ warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
7319
7343
  }
7320
7344
  }
7321
7345
  function installCompatMount(app, context, render) {
@@ -7386,7 +7410,7 @@ function installCompatMount(app, context, render) {
7386
7410
  for (let i = 0; i < container.attributes.length; i++) {
7387
7411
  const attr = container.attributes[i];
7388
7412
  if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
7389
- warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
7413
+ warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
7390
7414
  break;
7391
7415
  }
7392
7416
  }
@@ -7425,7 +7449,7 @@ function installCompatMount(app, context, render) {
7425
7449
  if (bum) {
7426
7450
  invokeArrayFns(bum);
7427
7451
  }
7428
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
7452
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
7429
7453
  instance.emit('hook:beforeDestroy');
7430
7454
  }
7431
7455
  // stop effects
@@ -7436,7 +7460,7 @@ function installCompatMount(app, context, render) {
7436
7460
  if (um) {
7437
7461
  invokeArrayFns(um);
7438
7462
  }
7439
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
7463
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
7440
7464
  instance.emit('hook:destroyed');
7441
7465
  }
7442
7466
  }
@@ -7497,12 +7521,12 @@ function defineReactiveSimple(obj, key, val) {
7497
7521
  enumerable: true,
7498
7522
  configurable: true,
7499
7523
  get() {
7500
- track(obj, "get" /* GET */, key);
7524
+ track(obj, "get" /* TrackOpTypes.GET */, key);
7501
7525
  return val;
7502
7526
  },
7503
7527
  set(newVal) {
7504
7528
  val = isObject(newVal) ? reactive(newVal) : newVal;
7505
- trigger(obj, "set" /* SET */, key, newVal);
7529
+ trigger(obj, "set" /* TriggerOpTypes.SET */, key, newVal);
7506
7530
  }
7507
7531
  });
7508
7532
  }
@@ -7698,7 +7722,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7698
7722
  // because the template ref is forwarded to inner component
7699
7723
  return;
7700
7724
  }
7701
- const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
7725
+ const refValue = vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */
7702
7726
  ? getExposeProxy(vnode.component) || vnode.component.proxy
7703
7727
  : vnode.el;
7704
7728
  const value = isUnmount ? null : refValue;
@@ -7724,7 +7748,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7724
7748
  }
7725
7749
  }
7726
7750
  if (isFunction(ref)) {
7727
- callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
7751
+ callWithErrorHandling(ref, owner, 12 /* ErrorCodes.FUNCTION_REF */, [value, refs]);
7728
7752
  }
7729
7753
  else {
7730
7754
  const _isString = isString(ref);
@@ -7786,7 +7810,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7786
7810
 
7787
7811
  let hasMismatch = false;
7788
7812
  const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
7789
- const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7813
+ const isComment = (node) => node.nodeType === 8 /* DOMNodeTypes.COMMENT */;
7790
7814
  // Note: hydration is DOM-specific
7791
7815
  // But we have to place it in core due to tight coupling with core - splitting
7792
7816
  // it out creates a ton of unnecessary complexity.
@@ -7819,14 +7843,14 @@ function createHydrationFunctions(rendererInternals) {
7819
7843
  const { type, ref, shapeFlag, patchFlag } = vnode;
7820
7844
  const domType = node.nodeType;
7821
7845
  vnode.el = node;
7822
- if (patchFlag === -2 /* BAIL */) {
7846
+ if (patchFlag === -2 /* PatchFlags.BAIL */) {
7823
7847
  optimized = false;
7824
7848
  vnode.dynamicChildren = null;
7825
7849
  }
7826
7850
  let nextNode = null;
7827
7851
  switch (type) {
7828
7852
  case Text:
7829
- if (domType !== 3 /* TEXT */) {
7853
+ if (domType !== 3 /* DOMNodeTypes.TEXT */) {
7830
7854
  // #5728 empty text node inside a slot can cause hydration failure
7831
7855
  // because the server rendered HTML won't contain a text node
7832
7856
  if (vnode.children === '') {
@@ -7850,7 +7874,7 @@ function createHydrationFunctions(rendererInternals) {
7850
7874
  }
7851
7875
  break;
7852
7876
  case Comment:
7853
- if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7877
+ if (domType !== 8 /* DOMNodeTypes.COMMENT */ || isFragmentStart) {
7854
7878
  nextNode = onMismatch();
7855
7879
  }
7856
7880
  else {
@@ -7858,7 +7882,7 @@ function createHydrationFunctions(rendererInternals) {
7858
7882
  }
7859
7883
  break;
7860
7884
  case Static:
7861
- if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
7885
+ if (domType !== 1 /* DOMNodeTypes.ELEMENT */ && domType !== 3 /* DOMNodeTypes.TEXT */) {
7862
7886
  nextNode = onMismatch();
7863
7887
  }
7864
7888
  else {
@@ -7870,7 +7894,7 @@ function createHydrationFunctions(rendererInternals) {
7870
7894
  for (let i = 0; i < vnode.staticCount; i++) {
7871
7895
  if (needToAdoptContent)
7872
7896
  vnode.children +=
7873
- nextNode.nodeType === 1 /* ELEMENT */
7897
+ nextNode.nodeType === 1 /* DOMNodeTypes.ELEMENT */
7874
7898
  ? nextNode.outerHTML
7875
7899
  : nextNode.data;
7876
7900
  if (i === vnode.staticCount - 1) {
@@ -7890,8 +7914,8 @@ function createHydrationFunctions(rendererInternals) {
7890
7914
  }
7891
7915
  break;
7892
7916
  default:
7893
- if (shapeFlag & 1 /* ELEMENT */) {
7894
- if (domType !== 1 /* ELEMENT */ ||
7917
+ if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
7918
+ if (domType !== 1 /* DOMNodeTypes.ELEMENT */ ||
7895
7919
  vnode.type.toLowerCase() !==
7896
7920
  node.tagName.toLowerCase()) {
7897
7921
  nextNode = onMismatch();
@@ -7900,7 +7924,7 @@ function createHydrationFunctions(rendererInternals) {
7900
7924
  nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
7901
7925
  }
7902
7926
  }
7903
- else if (shapeFlag & 6 /* COMPONENT */) {
7927
+ else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
7904
7928
  // when setting up the render effect, if the initial vnode already
7905
7929
  // has .el set, the component will perform hydration instead of mount
7906
7930
  // on its sub-tree.
@@ -7939,15 +7963,15 @@ function createHydrationFunctions(rendererInternals) {
7939
7963
  vnode.component.subTree = subTree;
7940
7964
  }
7941
7965
  }
7942
- else if (shapeFlag & 64 /* TELEPORT */) {
7943
- if (domType !== 8 /* COMMENT */) {
7966
+ else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
7967
+ if (domType !== 8 /* DOMNodeTypes.COMMENT */) {
7944
7968
  nextNode = onMismatch();
7945
7969
  }
7946
7970
  else {
7947
7971
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
7948
7972
  }
7949
7973
  }
7950
- else if (shapeFlag & 128 /* SUSPENSE */) {
7974
+ else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
7951
7975
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
7952
7976
  }
7953
7977
  else if ((process.env.NODE_ENV !== 'production')) {
@@ -7967,7 +7991,7 @@ function createHydrationFunctions(rendererInternals) {
7967
7991
  const forcePatchValue = (type === 'input' && dirs) || type === 'option';
7968
7992
  // skip props & children if this is hoisted static nodes
7969
7993
  // #5405 in dev, always hydrate children for HMR
7970
- if ((process.env.NODE_ENV !== 'production') || forcePatchValue || patchFlag !== -1 /* HOISTED */) {
7994
+ if ((process.env.NODE_ENV !== 'production') || forcePatchValue || patchFlag !== -1 /* PatchFlags.HOISTED */) {
7971
7995
  if (dirs) {
7972
7996
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
7973
7997
  }
@@ -7975,7 +7999,7 @@ function createHydrationFunctions(rendererInternals) {
7975
7999
  if (props) {
7976
8000
  if (forcePatchValue ||
7977
8001
  !optimized ||
7978
- patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {
8002
+ patchFlag & (16 /* PatchFlags.FULL_PROPS */ | 32 /* PatchFlags.HYDRATE_EVENTS */)) {
7979
8003
  for (const key in props) {
7980
8004
  if ((forcePatchValue && key.endsWith('value')) ||
7981
8005
  (isOn(key) && !isReservedProp(key))) {
@@ -8004,7 +8028,7 @@ function createHydrationFunctions(rendererInternals) {
8004
8028
  }, parentSuspense);
8005
8029
  }
8006
8030
  // children
8007
- if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&
8031
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */ &&
8008
8032
  // skip if element has innerHTML / textContent
8009
8033
  !(props && (props.innerHTML || props.textContent))) {
8010
8034
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -8022,7 +8046,7 @@ function createHydrationFunctions(rendererInternals) {
8022
8046
  remove(cur);
8023
8047
  }
8024
8048
  }
8025
- else if (shapeFlag & 8 /* TEXT_CHILDREN */) {
8049
+ else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
8026
8050
  if (el.textContent !== vnode.children) {
8027
8051
  hasMismatch = true;
8028
8052
  (process.env.NODE_ENV !== 'production') &&
@@ -8087,7 +8111,7 @@ function createHydrationFunctions(rendererInternals) {
8087
8111
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
8088
8112
  hasMismatch = true;
8089
8113
  (process.env.NODE_ENV !== 'production') &&
8090
- warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */
8114
+ warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
8091
8115
  ? `(text)`
8092
8116
  : isComment(node) && node.data === '['
8093
8117
  ? `(start of fragment)`
@@ -8249,7 +8273,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8249
8273
  unmount(n1, parentComponent, parentSuspense, true);
8250
8274
  n1 = null;
8251
8275
  }
8252
- if (n2.patchFlag === -2 /* BAIL */) {
8276
+ if (n2.patchFlag === -2 /* PatchFlags.BAIL */) {
8253
8277
  optimized = false;
8254
8278
  n2.dynamicChildren = null;
8255
8279
  }
@@ -8273,16 +8297,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8273
8297
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8274
8298
  break;
8275
8299
  default:
8276
- if (shapeFlag & 1 /* ELEMENT */) {
8300
+ if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
8277
8301
  processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8278
8302
  }
8279
- else if (shapeFlag & 6 /* COMPONENT */) {
8303
+ else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
8280
8304
  processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8281
8305
  }
8282
- else if (shapeFlag & 64 /* TELEPORT */) {
8306
+ else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
8283
8307
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
8284
8308
  }
8285
- else if (shapeFlag & 128 /* SUSPENSE */) {
8309
+ else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
8286
8310
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
8287
8311
  }
8288
8312
  else if ((process.env.NODE_ENV !== 'production')) {
@@ -8367,7 +8391,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8367
8391
  if (!(process.env.NODE_ENV !== 'production') &&
8368
8392
  vnode.el &&
8369
8393
  hostCloneNode !== undefined &&
8370
- patchFlag === -1 /* HOISTED */) {
8394
+ patchFlag === -1 /* PatchFlags.HOISTED */) {
8371
8395
  // If a vnode has non-null el, it means it's being reused.
8372
8396
  // Only static vnodes can be reused, so its mounted DOM nodes should be
8373
8397
  // exactly the same, and we can simply do a clone here.
@@ -8378,10 +8402,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8378
8402
  el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
8379
8403
  // mount children first, since some props may rely on child content
8380
8404
  // being already rendered, e.g. `<select value>`
8381
- if (shapeFlag & 8 /* TEXT_CHILDREN */) {
8405
+ if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
8382
8406
  hostSetElementText(el, vnode.children);
8383
8407
  }
8384
- else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
8408
+ else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
8385
8409
  mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
8386
8410
  }
8387
8411
  if (dirs) {
@@ -8458,7 +8482,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8458
8482
  let subTree = parentComponent.subTree;
8459
8483
  if ((process.env.NODE_ENV !== 'production') &&
8460
8484
  subTree.patchFlag > 0 &&
8461
- subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
8485
+ subTree.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
8462
8486
  subTree =
8463
8487
  filterSingleRoot(subTree.children) || subTree;
8464
8488
  }
@@ -8481,7 +8505,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8481
8505
  let { patchFlag, dynamicChildren, dirs } = n2;
8482
8506
  // #1426 take the old vnode's patch flag into account since user may clone a
8483
8507
  // compiler-generated vnode, which de-opts to FULL_PROPS
8484
- patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;
8508
+ patchFlag |= n1.patchFlag & 16 /* PatchFlags.FULL_PROPS */;
8485
8509
  const oldProps = n1.props || EMPTY_OBJ;
8486
8510
  const newProps = n2.props || EMPTY_OBJ;
8487
8511
  let vnodeHook;
@@ -8516,21 +8540,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8516
8540
  // generated by the compiler and can take the fast path.
8517
8541
  // in this path old node and new node are guaranteed to have the same shape
8518
8542
  // (i.e. at the exact same position in the source template)
8519
- if (patchFlag & 16 /* FULL_PROPS */) {
8543
+ if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
8520
8544
  // element props contain dynamic keys, full diff needed
8521
8545
  patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
8522
8546
  }
8523
8547
  else {
8524
8548
  // class
8525
8549
  // this flag is matched when the element has dynamic class bindings.
8526
- if (patchFlag & 2 /* CLASS */) {
8550
+ if (patchFlag & 2 /* PatchFlags.CLASS */) {
8527
8551
  if (oldProps.class !== newProps.class) {
8528
8552
  hostPatchProp(el, 'class', null, newProps.class, isSVG);
8529
8553
  }
8530
8554
  }
8531
8555
  // style
8532
8556
  // this flag is matched when the element has dynamic style bindings
8533
- if (patchFlag & 4 /* STYLE */) {
8557
+ if (patchFlag & 4 /* PatchFlags.STYLE */) {
8534
8558
  hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);
8535
8559
  }
8536
8560
  // props
@@ -8539,7 +8563,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8539
8563
  // faster iteration.
8540
8564
  // Note dynamic keys like :[foo]="bar" will cause this optimization to
8541
8565
  // bail out and go through a full diff because we need to unset the old key
8542
- if (patchFlag & 8 /* PROPS */) {
8566
+ if (patchFlag & 8 /* PatchFlags.PROPS */) {
8543
8567
  // if the flag is present then dynamicProps must be non-null
8544
8568
  const propsToUpdate = n2.dynamicProps;
8545
8569
  for (let i = 0; i < propsToUpdate.length; i++) {
@@ -8555,7 +8579,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8555
8579
  }
8556
8580
  // text
8557
8581
  // This flag is matched when the element has only dynamic text children.
8558
- if (patchFlag & 1 /* TEXT */) {
8582
+ if (patchFlag & 1 /* PatchFlags.TEXT */) {
8559
8583
  if (n1.children !== n2.children) {
8560
8584
  hostSetElementText(el, n2.children);
8561
8585
  }
@@ -8589,7 +8613,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8589
8613
  // which also requires the correct parent container
8590
8614
  !isSameVNodeType(oldVNode, newVNode) ||
8591
8615
  // - In the case of a component, it could contain anything.
8592
- oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))
8616
+ oldVNode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 64 /* ShapeFlags.TELEPORT */))
8593
8617
  ? hostParentNode(oldVNode.el)
8594
8618
  : // In other cases, the parent container is not actually used so we
8595
8619
  // just pass the block element here to avoid a DOM parentNode call.
@@ -8628,7 +8652,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8628
8652
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
8629
8653
  if ((process.env.NODE_ENV !== 'production') &&
8630
8654
  // #5523 dev root fragment may inherit directives
8631
- (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
8655
+ (isHmrUpdating || patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */)) {
8632
8656
  // HMR updated / Dev root fragment (w/ comments), force full diff
8633
8657
  patchFlag = 0;
8634
8658
  optimized = false;
@@ -8650,7 +8674,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8650
8674
  }
8651
8675
  else {
8652
8676
  if (patchFlag > 0 &&
8653
- patchFlag & 64 /* STABLE_FRAGMENT */ &&
8677
+ patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */ &&
8654
8678
  dynamicChildren &&
8655
8679
  // #2715 the previous fragment could've been a BAILed one as a result
8656
8680
  // of renderSlot() with no valid children
@@ -8683,7 +8707,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8683
8707
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8684
8708
  n2.slotScopeIds = slotScopeIds;
8685
8709
  if (n1 == null) {
8686
- if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
8710
+ if (n2.shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
8687
8711
  parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
8688
8712
  }
8689
8713
  else {
@@ -8788,7 +8812,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8788
8812
  (vnodeHook = props && props.onVnodeBeforeMount)) {
8789
8813
  invokeVNodeHook(vnodeHook, parent, initialVNode);
8790
8814
  }
8791
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8815
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8792
8816
  instance.emit('hook:beforeMount');
8793
8817
  }
8794
8818
  toggleRecurse(instance, true);
@@ -8849,18 +8873,18 @@ function baseCreateRenderer(options, createHydrationFns) {
8849
8873
  const scopedInitialVNode = initialVNode;
8850
8874
  queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
8851
8875
  }
8852
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8876
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8853
8877
  queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
8854
8878
  }
8855
8879
  // activated hook for keep-alive roots.
8856
8880
  // #1742 activated hook must be accessed after first render
8857
8881
  // since the hook may be injected by a child keep-alive
8858
- if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */ ||
8882
+ if (initialVNode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */ ||
8859
8883
  (parent &&
8860
8884
  isAsyncWrapper(parent.vnode) &&
8861
- parent.vnode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */)) {
8885
+ parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
8862
8886
  instance.a && queuePostRenderEffect(instance.a, parentSuspense);
8863
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8887
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8864
8888
  queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
8865
8889
  }
8866
8890
  }
@@ -8898,7 +8922,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8898
8922
  if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
8899
8923
  invokeVNodeHook(vnodeHook, parent, next, vnode);
8900
8924
  }
8901
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8925
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8902
8926
  instance.emit('hook:beforeUpdate');
8903
8927
  }
8904
8928
  toggleRecurse(instance, true);
@@ -8938,7 +8962,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8938
8962
  if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
8939
8963
  queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
8940
8964
  }
8941
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8965
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8942
8966
  queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
8943
8967
  }
8944
8968
  if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
@@ -8978,7 +9002,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8978
9002
  pauseTracking();
8979
9003
  // props update may have triggered pre-flush watchers.
8980
9004
  // flush them before the render update.
8981
- flushPreFlushCbs(undefined, instance.update);
9005
+ flushPreFlushCbs();
8982
9006
  resetTracking();
8983
9007
  };
8984
9008
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -8988,22 +9012,22 @@ function baseCreateRenderer(options, createHydrationFns) {
8988
9012
  const { patchFlag, shapeFlag } = n2;
8989
9013
  // fast path
8990
9014
  if (patchFlag > 0) {
8991
- if (patchFlag & 128 /* KEYED_FRAGMENT */) {
9015
+ if (patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */) {
8992
9016
  // this could be either fully-keyed or mixed (some keyed some not)
8993
9017
  // presence of patchFlag means children are guaranteed to be arrays
8994
9018
  patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8995
9019
  return;
8996
9020
  }
8997
- else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {
9021
+ else if (patchFlag & 256 /* PatchFlags.UNKEYED_FRAGMENT */) {
8998
9022
  // unkeyed
8999
9023
  patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
9000
9024
  return;
9001
9025
  }
9002
9026
  }
9003
9027
  // children has 3 possibilities: text, array or no children.
9004
- if (shapeFlag & 8 /* TEXT_CHILDREN */) {
9028
+ if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
9005
9029
  // text children fast path
9006
- if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
9030
+ if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9007
9031
  unmountChildren(c1, parentComponent, parentSuspense);
9008
9032
  }
9009
9033
  if (c2 !== c1) {
@@ -9011,9 +9035,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9011
9035
  }
9012
9036
  }
9013
9037
  else {
9014
- if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
9038
+ if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9015
9039
  // prev children was array
9016
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9040
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9017
9041
  // two arrays, cannot assume anything, do full diff
9018
9042
  patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
9019
9043
  }
@@ -9025,11 +9049,11 @@ function baseCreateRenderer(options, createHydrationFns) {
9025
9049
  else {
9026
9050
  // prev children was text OR null
9027
9051
  // new children is array OR null
9028
- if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {
9052
+ if (prevShapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
9029
9053
  hostSetElementText(container, '');
9030
9054
  }
9031
9055
  // mount new if array
9032
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9056
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9033
9057
  mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
9034
9058
  }
9035
9059
  }
@@ -9220,7 +9244,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9220
9244
  // There is no stable subsequence (e.g. a reverse)
9221
9245
  // OR current node is not among the stable sequence
9222
9246
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
9223
- move(nextChild, container, anchor, 2 /* REORDER */);
9247
+ move(nextChild, container, anchor, 2 /* MoveType.REORDER */);
9224
9248
  }
9225
9249
  else {
9226
9250
  j--;
@@ -9231,15 +9255,15 @@ function baseCreateRenderer(options, createHydrationFns) {
9231
9255
  };
9232
9256
  const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
9233
9257
  const { el, type, transition, children, shapeFlag } = vnode;
9234
- if (shapeFlag & 6 /* COMPONENT */) {
9258
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9235
9259
  move(vnode.component.subTree, container, anchor, moveType);
9236
9260
  return;
9237
9261
  }
9238
- if (shapeFlag & 128 /* SUSPENSE */) {
9262
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9239
9263
  vnode.suspense.move(container, anchor, moveType);
9240
9264
  return;
9241
9265
  }
9242
- if (shapeFlag & 64 /* TELEPORT */) {
9266
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
9243
9267
  type.move(vnode, container, anchor, internals);
9244
9268
  return;
9245
9269
  }
@@ -9256,11 +9280,11 @@ function baseCreateRenderer(options, createHydrationFns) {
9256
9280
  return;
9257
9281
  }
9258
9282
  // single nodes
9259
- const needTransition = moveType !== 2 /* REORDER */ &&
9260
- shapeFlag & 1 /* ELEMENT */ &&
9283
+ const needTransition = moveType !== 2 /* MoveType.REORDER */ &&
9284
+ shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
9261
9285
  transition;
9262
9286
  if (needTransition) {
9263
- if (moveType === 0 /* ENTER */) {
9287
+ if (moveType === 0 /* MoveType.ENTER */) {
9264
9288
  transition.beforeEnter(el);
9265
9289
  hostInsert(el, container, anchor);
9266
9290
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
@@ -9292,42 +9316,42 @@ function baseCreateRenderer(options, createHydrationFns) {
9292
9316
  if (ref != null) {
9293
9317
  setRef(ref, null, parentSuspense, vnode, true);
9294
9318
  }
9295
- if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
9319
+ if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
9296
9320
  parentComponent.ctx.deactivate(vnode);
9297
9321
  return;
9298
9322
  }
9299
- const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;
9323
+ const shouldInvokeDirs = shapeFlag & 1 /* ShapeFlags.ELEMENT */ && dirs;
9300
9324
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
9301
9325
  let vnodeHook;
9302
9326
  if (shouldInvokeVnodeHook &&
9303
9327
  (vnodeHook = props && props.onVnodeBeforeUnmount)) {
9304
9328
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
9305
9329
  }
9306
- if (shapeFlag & 6 /* COMPONENT */) {
9330
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9307
9331
  unmountComponent(vnode.component, parentSuspense, doRemove);
9308
9332
  }
9309
9333
  else {
9310
- if (shapeFlag & 128 /* SUSPENSE */) {
9334
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9311
9335
  vnode.suspense.unmount(parentSuspense, doRemove);
9312
9336
  return;
9313
9337
  }
9314
9338
  if (shouldInvokeDirs) {
9315
9339
  invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');
9316
9340
  }
9317
- if (shapeFlag & 64 /* TELEPORT */) {
9341
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
9318
9342
  vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
9319
9343
  }
9320
9344
  else if (dynamicChildren &&
9321
9345
  // #1153: fast path should not be taken for non-stable (v-for) fragments
9322
9346
  (type !== Fragment ||
9323
- (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {
9347
+ (patchFlag > 0 && patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */))) {
9324
9348
  // fast path for block nodes: only need to unmount dynamic children.
9325
9349
  unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
9326
9350
  }
9327
9351
  else if ((type === Fragment &&
9328
9352
  patchFlag &
9329
- (128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||
9330
- (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {
9353
+ (128 /* PatchFlags.KEYED_FRAGMENT */ | 256 /* PatchFlags.UNKEYED_FRAGMENT */)) ||
9354
+ (!optimized && shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */)) {
9331
9355
  unmountChildren(children, parentComponent, parentSuspense);
9332
9356
  }
9333
9357
  if (doRemove) {
@@ -9349,7 +9373,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9349
9373
  if (type === Fragment) {
9350
9374
  if ((process.env.NODE_ENV !== 'production') &&
9351
9375
  vnode.patchFlag > 0 &&
9352
- vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
9376
+ vnode.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */ &&
9353
9377
  transition &&
9354
9378
  !transition.persisted) {
9355
9379
  vnode.children.forEach(child => {
@@ -9376,7 +9400,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9376
9400
  transition.afterLeave();
9377
9401
  }
9378
9402
  };
9379
- if (vnode.shapeFlag & 1 /* ELEMENT */ &&
9403
+ if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
9380
9404
  transition &&
9381
9405
  !transition.persisted) {
9382
9406
  const { leave, delayLeave } = transition;
@@ -9412,7 +9436,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9412
9436
  if (bum) {
9413
9437
  invokeArrayFns(bum);
9414
9438
  }
9415
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
9439
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
9416
9440
  instance.emit('hook:beforeDestroy');
9417
9441
  }
9418
9442
  // stop effects in component scope
@@ -9428,7 +9452,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9428
9452
  if (um) {
9429
9453
  queuePostRenderEffect(um, parentSuspense);
9430
9454
  }
9431
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
9455
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
9432
9456
  queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
9433
9457
  }
9434
9458
  queuePostRenderEffect(() => {
@@ -9458,10 +9482,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9458
9482
  }
9459
9483
  };
9460
9484
  const getNextHostNode = vnode => {
9461
- if (vnode.shapeFlag & 6 /* COMPONENT */) {
9485
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9462
9486
  return getNextHostNode(vnode.component.subTree);
9463
9487
  }
9464
- if (vnode.shapeFlag & 128 /* SUSPENSE */) {
9488
+ if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9465
9489
  return vnode.suspense.next();
9466
9490
  }
9467
9491
  return hostNextSibling((vnode.anchor || vnode.el));
@@ -9475,6 +9499,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9475
9499
  else {
9476
9500
  patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9477
9501
  }
9502
+ flushPreFlushCbs();
9478
9503
  flushPostFlushCbs();
9479
9504
  container._vnode = vnode;
9480
9505
  };
@@ -9524,8 +9549,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
9524
9549
  // guaranteed to be vnodes
9525
9550
  const c1 = ch1[i];
9526
9551
  let c2 = ch2[i];
9527
- if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {
9528
- if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {
9552
+ if (c2.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && !c2.dynamicChildren) {
9553
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* PatchFlags.HYDRATE_EVENTS */) {
9529
9554
  c2 = ch2[i] = cloneIfMounted(ch2[i]);
9530
9555
  c2.el = c1.el;
9531
9556
  }
@@ -9649,7 +9674,7 @@ const TeleportImpl = {
9649
9674
  const mount = (container, anchor) => {
9650
9675
  // Teleport *always* has Array children. This is enforced in both the
9651
9676
  // compiler and vnode children normalization.
9652
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9677
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9653
9678
  mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
9654
9679
  }
9655
9680
  };
@@ -9685,7 +9710,7 @@ const TeleportImpl = {
9685
9710
  if (!wasDisabled) {
9686
9711
  // enabled -> disabled
9687
9712
  // move into main container
9688
- moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);
9713
+ moveTeleport(n2, container, mainAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
9689
9714
  }
9690
9715
  }
9691
9716
  else {
@@ -9693,7 +9718,7 @@ const TeleportImpl = {
9693
9718
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
9694
9719
  const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));
9695
9720
  if (nextTarget) {
9696
- moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);
9721
+ moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
9697
9722
  }
9698
9723
  else if ((process.env.NODE_ENV !== 'production')) {
9699
9724
  warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
@@ -9702,7 +9727,7 @@ const TeleportImpl = {
9702
9727
  else if (wasDisabled) {
9703
9728
  // disabled -> enabled
9704
9729
  // move into teleport target
9705
- moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);
9730
+ moveTeleport(n2, target, targetAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
9706
9731
  }
9707
9732
  }
9708
9733
  }
@@ -9715,7 +9740,7 @@ const TeleportImpl = {
9715
9740
  // an unmounted teleport should always remove its children if not disabled
9716
9741
  if (doRemove || !isTeleportDisabled(props)) {
9717
9742
  hostRemove(anchor);
9718
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9743
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9719
9744
  for (let i = 0; i < children.length; i++) {
9720
9745
  const child = children[i];
9721
9746
  unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
@@ -9726,13 +9751,13 @@ const TeleportImpl = {
9726
9751
  move: moveTeleport,
9727
9752
  hydrate: hydrateTeleport
9728
9753
  };
9729
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {
9754
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* TeleportMoveTypes.REORDER */) {
9730
9755
  // move target anchor if this is a target change.
9731
- if (moveType === 0 /* TARGET_CHANGE */) {
9756
+ if (moveType === 0 /* TeleportMoveTypes.TARGET_CHANGE */) {
9732
9757
  insert(vnode.targetAnchor, container, parentAnchor);
9733
9758
  }
9734
9759
  const { el, anchor, shapeFlag, children, props } = vnode;
9735
- const isReorder = moveType === 2 /* REORDER */;
9760
+ const isReorder = moveType === 2 /* TeleportMoveTypes.REORDER */;
9736
9761
  // move main view anchor if this is a re-order.
9737
9762
  if (isReorder) {
9738
9763
  insert(el, container, parentAnchor);
@@ -9742,9 +9767,9 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
9742
9767
  // is not a reorder, or the teleport is disabled
9743
9768
  if (!isReorder || isTeleportDisabled(props)) {
9744
9769
  // Teleport has either Array children or no children.
9745
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9770
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9746
9771
  for (let i = 0; i < children.length; i++) {
9747
- move(children[i], container, parentAnchor, 2 /* REORDER */);
9772
+ move(children[i], container, parentAnchor, 2 /* MoveType.REORDER */);
9748
9773
  }
9749
9774
  }
9750
9775
  }
@@ -9759,7 +9784,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
9759
9784
  // if multiple teleports rendered to the same target element, we need to
9760
9785
  // pick up from where the last teleport finished instead of the first node
9761
9786
  const targetNode = target._lpa || target.firstChild;
9762
- if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
9787
+ if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9763
9788
  if (isTeleportDisabled(vnode.props)) {
9764
9789
  vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
9765
9790
  vnode.targetAnchor = targetNode;
@@ -9836,7 +9861,7 @@ function convertLegacyComponent(comp, instance) {
9836
9861
  }
9837
9862
  // 2.x async component
9838
9863
  if (isFunction(comp) &&
9839
- checkCompatEnabled("COMPONENT_ASYNC" /* COMPONENT_ASYNC */, instance, comp)) {
9864
+ checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
9840
9865
  // since after disabling this, plain functions are still valid usage, do not
9841
9866
  // use softAssert here.
9842
9867
  return convertLegacyAsyncComponent(comp);
@@ -9844,7 +9869,7 @@ function convertLegacyComponent(comp, instance) {
9844
9869
  // 2.x functional component
9845
9870
  if (isObject(comp) &&
9846
9871
  comp.functional &&
9847
- softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */, instance, comp)) {
9872
+ softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */, instance, comp)) {
9848
9873
  return convertLegacyFunctionalComponent(comp);
9849
9874
  }
9850
9875
  return comp;
@@ -9942,7 +9967,7 @@ function isVNode(value) {
9942
9967
  }
9943
9968
  function isSameVNodeType(n1, n2) {
9944
9969
  if ((process.env.NODE_ENV !== 'production') &&
9945
- n2.shapeFlag & 6 /* COMPONENT */ &&
9970
+ n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
9946
9971
  hmrDirtyComponents.has(n2.type)) {
9947
9972
  // HMR only: if the component has been hot-updated, force a reload.
9948
9973
  return false;
@@ -9973,7 +9998,7 @@ const normalizeRef = ({ ref, ref_key, ref_for }) => {
9973
9998
  : ref
9974
9999
  : null);
9975
10000
  };
9976
- function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
10001
+ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ShapeFlags.ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
9977
10002
  const vnode = {
9978
10003
  __v_isVNode: true,
9979
10004
  __v_skip: true,
@@ -10004,7 +10029,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
10004
10029
  if (needFullChildrenNormalization) {
10005
10030
  normalizeChildren(vnode, children);
10006
10031
  // normalize suspense children
10007
- if (shapeFlag & 128 /* SUSPENSE */) {
10032
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
10008
10033
  type.normalize(vnode);
10009
10034
  }
10010
10035
  }
@@ -10012,8 +10037,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
10012
10037
  // compiled element vnode - if children is passed, only possible types are
10013
10038
  // string or Array.
10014
10039
  vnode.shapeFlag |= isString(children)
10015
- ? 8 /* TEXT_CHILDREN */
10016
- : 16 /* ARRAY_CHILDREN */;
10040
+ ? 8 /* ShapeFlags.TEXT_CHILDREN */
10041
+ : 16 /* ShapeFlags.ARRAY_CHILDREN */;
10017
10042
  }
10018
10043
  // validate key
10019
10044
  if ((process.env.NODE_ENV !== 'production') && vnode.key !== vnode.key) {
@@ -10029,10 +10054,10 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
10029
10054
  // component nodes also should always be patched, because even if the
10030
10055
  // component doesn't need to update, it needs to persist the instance on to
10031
10056
  // the next vnode so that it can be properly unmounted later.
10032
- (vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
10057
+ (vnode.patchFlag > 0 || shapeFlag & 6 /* ShapeFlags.COMPONENT */) &&
10033
10058
  // the EVENTS flag is only for hydration and if it is the only flag, the
10034
10059
  // vnode should not be considered dynamic due to handler caching.
10035
- vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {
10060
+ vnode.patchFlag !== 32 /* PatchFlags.HYDRATE_EVENTS */) {
10036
10061
  currentBlock.push(vnode);
10037
10062
  }
10038
10063
  {
@@ -10058,14 +10083,14 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
10058
10083
  normalizeChildren(cloned, children);
10059
10084
  }
10060
10085
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
10061
- if (cloned.shapeFlag & 6 /* COMPONENT */) {
10086
+ if (cloned.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
10062
10087
  currentBlock[currentBlock.indexOf(type)] = cloned;
10063
10088
  }
10064
10089
  else {
10065
10090
  currentBlock.push(cloned);
10066
10091
  }
10067
10092
  }
10068
- cloned.patchFlag |= -2 /* BAIL */;
10093
+ cloned.patchFlag |= -2 /* PatchFlags.BAIL */;
10069
10094
  return cloned;
10070
10095
  }
10071
10096
  // class component normalization.
@@ -10095,17 +10120,17 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
10095
10120
  }
10096
10121
  // encode the vnode type information into a bitmap
10097
10122
  const shapeFlag = isString(type)
10098
- ? 1 /* ELEMENT */
10123
+ ? 1 /* ShapeFlags.ELEMENT */
10099
10124
  : isSuspense(type)
10100
- ? 128 /* SUSPENSE */
10125
+ ? 128 /* ShapeFlags.SUSPENSE */
10101
10126
  : isTeleport(type)
10102
- ? 64 /* TELEPORT */
10127
+ ? 64 /* ShapeFlags.TELEPORT */
10103
10128
  : isObject(type)
10104
- ? 4 /* STATEFUL_COMPONENT */
10129
+ ? 4 /* ShapeFlags.STATEFUL_COMPONENT */
10105
10130
  : isFunction(type)
10106
- ? 2 /* FUNCTIONAL_COMPONENT */
10131
+ ? 2 /* ShapeFlags.FUNCTIONAL_COMPONENT */
10107
10132
  : 0;
10108
- if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
10133
+ if ((process.env.NODE_ENV !== 'production') && shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
10109
10134
  type = toRaw(type);
10110
10135
  warn$1(`Vue received a Component which was made a reactive object. This can ` +
10111
10136
  `lead to unnecessary performance overhead, and should be avoided by ` +
@@ -10144,7 +10169,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
10144
10169
  : ref,
10145
10170
  scopeId: vnode.scopeId,
10146
10171
  slotScopeIds: vnode.slotScopeIds,
10147
- children: (process.env.NODE_ENV !== 'production') && patchFlag === -1 /* HOISTED */ && isArray(children)
10172
+ children: (process.env.NODE_ENV !== 'production') && patchFlag === -1 /* PatchFlags.HOISTED */ && isArray(children)
10148
10173
  ? children.map(deepCloneVNode)
10149
10174
  : children,
10150
10175
  target: vnode.target,
@@ -10157,8 +10182,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
10157
10182
  // fast paths only.
10158
10183
  patchFlag: extraProps && vnode.type !== Fragment
10159
10184
  ? patchFlag === -1 // hoisted node
10160
- ? 16 /* FULL_PROPS */
10161
- : patchFlag | 16 /* FULL_PROPS */
10185
+ ? 16 /* PatchFlags.FULL_PROPS */
10186
+ : patchFlag | 16 /* PatchFlags.FULL_PROPS */
10162
10187
  : patchFlag,
10163
10188
  dynamicProps: vnode.dynamicProps,
10164
10189
  dynamicChildren: vnode.dynamicChildren,
@@ -10251,10 +10276,10 @@ function normalizeChildren(vnode, children) {
10251
10276
  children = null;
10252
10277
  }
10253
10278
  else if (isArray(children)) {
10254
- type = 16 /* ARRAY_CHILDREN */;
10279
+ type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
10255
10280
  }
10256
10281
  else if (typeof children === 'object') {
10257
- if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {
10282
+ if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 64 /* ShapeFlags.TELEPORT */)) {
10258
10283
  // Normalize slot to plain children for plain element and Teleport
10259
10284
  const slot = children.default;
10260
10285
  if (slot) {
@@ -10266,37 +10291,37 @@ function normalizeChildren(vnode, children) {
10266
10291
  return;
10267
10292
  }
10268
10293
  else {
10269
- type = 32 /* SLOTS_CHILDREN */;
10294
+ type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
10270
10295
  const slotFlag = children._;
10271
10296
  if (!slotFlag && !(InternalObjectKey in children)) {
10272
10297
  children._ctx = currentRenderingInstance;
10273
10298
  }
10274
- else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
10299
+ else if (slotFlag === 3 /* SlotFlags.FORWARDED */ && currentRenderingInstance) {
10275
10300
  // a child component receives forwarded slots from the parent.
10276
10301
  // its slot type is determined by its parent's slot type.
10277
- if (currentRenderingInstance.slots._ === 1 /* STABLE */) {
10278
- children._ = 1 /* STABLE */;
10302
+ if (currentRenderingInstance.slots._ === 1 /* SlotFlags.STABLE */) {
10303
+ children._ = 1 /* SlotFlags.STABLE */;
10279
10304
  }
10280
10305
  else {
10281
- children._ = 2 /* DYNAMIC */;
10282
- vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
10306
+ children._ = 2 /* SlotFlags.DYNAMIC */;
10307
+ vnode.patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
10283
10308
  }
10284
10309
  }
10285
10310
  }
10286
10311
  }
10287
10312
  else if (isFunction(children)) {
10288
10313
  children = { default: children, _ctx: currentRenderingInstance };
10289
- type = 32 /* SLOTS_CHILDREN */;
10314
+ type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
10290
10315
  }
10291
10316
  else {
10292
10317
  children = String(children);
10293
10318
  // force teleport children to array so it can be moved around
10294
- if (shapeFlag & 64 /* TELEPORT */) {
10295
- type = 16 /* ARRAY_CHILDREN */;
10319
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
10320
+ type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
10296
10321
  children = [createTextVNode(children)];
10297
10322
  }
10298
10323
  else {
10299
- type = 8 /* TEXT_CHILDREN */;
10324
+ type = 8 /* ShapeFlags.TEXT_CHILDREN */;
10300
10325
  }
10301
10326
  }
10302
10327
  vnode.children = children;
@@ -10334,7 +10359,7 @@ function mergeProps(...args) {
10334
10359
  return ret;
10335
10360
  }
10336
10361
  function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
10337
- callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
10362
+ callWithAsyncErrorHandling(hook, instance, 7 /* ErrorCodes.VNODE_HOOK */, [
10338
10363
  vnode,
10339
10364
  prevVNode
10340
10365
  ]);
@@ -10445,7 +10470,7 @@ function validateComponentName(name, config) {
10445
10470
  }
10446
10471
  }
10447
10472
  function isStatefulComponent(instance) {
10448
- return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;
10473
+ return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
10449
10474
  }
10450
10475
  let isInSSRComponentSetup = false;
10451
10476
  function setupComponent(instance, isSSR = false) {
@@ -10500,7 +10525,7 @@ function setupStatefulComponent(instance, isSSR) {
10500
10525
  setup.length > 1 ? createSetupContext(instance) : null);
10501
10526
  setCurrentInstance(instance);
10502
10527
  pauseTracking();
10503
- const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [(process.env.NODE_ENV !== 'production') ? shallowReadonly(instance.props) : instance.props, setupContext]);
10528
+ const setupResult = callWithErrorHandling(setup, instance, 0 /* ErrorCodes.SETUP_FUNCTION */, [(process.env.NODE_ENV !== 'production') ? shallowReadonly(instance.props) : instance.props, setupContext]);
10504
10529
  resetTracking();
10505
10530
  unsetCurrentInstance();
10506
10531
  if (isPromise(setupResult)) {
@@ -10512,7 +10537,7 @@ function setupStatefulComponent(instance, isSSR) {
10512
10537
  handleSetupResult(instance, resolvedResult, isSSR);
10513
10538
  })
10514
10539
  .catch(e => {
10515
- handleError(e, instance, 0 /* SETUP_FUNCTION */);
10540
+ handleError(e, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
10516
10541
  });
10517
10542
  }
10518
10543
  else {
@@ -10615,6 +10640,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10615
10640
  // pass runtime compat config into the compiler
10616
10641
  finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
10617
10642
  if (Component.compatConfig) {
10643
+ // @ts-expect-error types are not compatible
10618
10644
  extend(finalCompilerOptions.compatConfig, Component.compatConfig);
10619
10645
  }
10620
10646
  }
@@ -10660,7 +10686,7 @@ function createAttrsProxy(instance) {
10660
10686
  ? {
10661
10687
  get(target, key) {
10662
10688
  markAttrsAccessed();
10663
- track(instance, "get" /* GET */, '$attrs');
10689
+ track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
10664
10690
  return target[key];
10665
10691
  },
10666
10692
  set() {
@@ -10674,7 +10700,7 @@ function createAttrsProxy(instance) {
10674
10700
  }
10675
10701
  : {
10676
10702
  get(target, key) {
10677
- track(instance, "get" /* GET */, '$attrs');
10703
+ track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
10678
10704
  return target[key];
10679
10705
  }
10680
10706
  });
@@ -11178,7 +11204,7 @@ function isMemoSame(cached, memo) {
11178
11204
  }
11179
11205
 
11180
11206
  // Core API ------------------------------------------------------------------
11181
- const version = "3.2.37";
11207
+ const version = "3.2.38";
11182
11208
  const _ssrUtils = {
11183
11209
  createComponentInstance,
11184
11210
  setupComponent,
@@ -11436,14 +11462,14 @@ function compatCoerceAttr(el, key, value, instance = null) {
11436
11462
  ? 'true'
11437
11463
  : null;
11438
11464
  if (v2CocercedValue &&
11439
- compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
11465
+ compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
11440
11466
  el.setAttribute(key, v2CocercedValue);
11441
11467
  return true;
11442
11468
  }
11443
11469
  }
11444
11470
  else if (value === false &&
11445
11471
  !isSpecialBooleanAttr(key) &&
11446
- compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, instance, key)) {
11472
+ compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, instance, key)) {
11447
11473
  el.removeAttribute(key);
11448
11474
  return true;
11449
11475
  }
@@ -11505,11 +11531,11 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11505
11531
  }
11506
11532
  else {
11507
11533
  if (value === false &&
11508
- compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
11534
+ compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent)) {
11509
11535
  const type = typeof el[key];
11510
11536
  if (type === 'string' || type === 'number') {
11511
11537
  (process.env.NODE_ENV !== 'production') &&
11512
- compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
11538
+ compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent, key);
11513
11539
  value = type === 'number' ? 0 : '';
11514
11540
  needRemove = true;
11515
11541
  }
@@ -11599,7 +11625,8 @@ function parseName(name) {
11599
11625
  options[m[0].toLowerCase()] = true;
11600
11626
  }
11601
11627
  }
11602
- return [hyphenate(name.slice(2)), options];
11628
+ const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2));
11629
+ return [event, options];
11603
11630
  }
11604
11631
  function createInvoker(initialValue, instance) {
11605
11632
  const invoker = (e) => {
@@ -11611,7 +11638,7 @@ function createInvoker(initialValue, instance) {
11611
11638
  // AFTER it was attached.
11612
11639
  const timeStamp = e.timeStamp || _getNow();
11613
11640
  if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
11614
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
11641
+ callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* ErrorCodes.NATIVE_EVENT_HANDLER */, [e]);
11615
11642
  }
11616
11643
  };
11617
11644
  invoker.value = initialValue;
@@ -11968,7 +11995,7 @@ function useCssVars(getter) {
11968
11995
  });
11969
11996
  }
11970
11997
  function setVarsOnVNode(vnode, vars) {
11971
- if (vnode.shapeFlag & 128 /* SUSPENSE */) {
11998
+ if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
11972
11999
  const suspense = vnode.suspense;
11973
12000
  vnode = suspense.activeBranch;
11974
12001
  if (suspense.pendingBranch && !suspense.isHydrating) {
@@ -11981,7 +12008,7 @@ function setVarsOnVNode(vnode, vars) {
11981
12008
  while (vnode.component) {
11982
12009
  vnode = vnode.component.subTree;
11983
12010
  }
11984
- if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {
12011
+ if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && vnode.el) {
11985
12012
  setVarsOnNode(vnode.el, vars);
11986
12013
  }
11987
12014
  else if (vnode.type === Fragment) {
@@ -12070,7 +12097,7 @@ function resolveTransitionProps(rawProps) {
12070
12097
  }
12071
12098
  const { name = 'v', type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
12072
12099
  // legacy transition class compat
12073
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* TRANSITION_CLASSES */, null);
12100
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */, null);
12074
12101
  let legacyEnterFromClass;
12075
12102
  let legacyAppearFromClass;
12076
12103
  let legacyLeaveFromClass;
@@ -12380,7 +12407,7 @@ const TransitionGroupImpl = {
12380
12407
  const cssTransitionProps = resolveTransitionProps(rawProps);
12381
12408
  let tag = rawProps.tag || Fragment;
12382
12409
  if (!rawProps.tag &&
12383
- compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */, instance.parent)) {
12410
+ compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */, instance.parent)) {
12384
12411
  tag = 'span';
12385
12412
  }
12386
12413
  prevChildren = children;
@@ -12787,13 +12814,13 @@ const withKeys = (fn, modifiers) => {
12787
12814
  let instance = null;
12788
12815
  {
12789
12816
  instance = getCurrentInstance();
12790
- if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */, instance)) {
12817
+ if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */, instance)) {
12791
12818
  if (instance) {
12792
12819
  globalKeyCodes = instance.appContext.config.keyCodes;
12793
12820
  }
12794
12821
  }
12795
12822
  if ((process.env.NODE_ENV !== 'production') && modifiers.some(m => /^\d+$/.test(m))) {
12796
- compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance);
12823
+ compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance);
12797
12824
  }
12798
12825
  }
12799
12826
  return (event) => {
@@ -12806,7 +12833,7 @@ const withKeys = (fn, modifiers) => {
12806
12833
  }
12807
12834
  {
12808
12835
  const keyCode = String(event.keyCode);
12809
- if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance) &&
12836
+ if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance) &&
12810
12837
  modifiers.some(mod => mod == keyCode)) {
12811
12838
  return fn(event);
12812
12839
  }
@@ -12924,7 +12951,7 @@ const createApp = ((...args) => {
12924
12951
  for (let i = 0; i < container.attributes.length; i++) {
12925
12952
  const attr = container.attributes[i];
12926
12953
  if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
12927
- compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
12954
+ compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
12928
12955
  break;
12929
12956
  }
12930
12957
  }
@@ -13186,7 +13213,7 @@ if ((process.env.NODE_ENV !== 'production')) {
13186
13213
  function wrappedCreateApp(...args) {
13187
13214
  // @ts-ignore
13188
13215
  const app = createApp(...args);
13189
- if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, null)) {
13216
+ if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, null)) {
13190
13217
  // register built-in components so that they can be resolved via strings
13191
13218
  // in the legacy h() call. The __compat__ prefix is to ensure that v3 h()
13192
13219
  // doesn't get affected.