@vue/compat 3.5.11 → 3.5.13

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.11
2
+ * @vue/compat v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -158,10 +158,9 @@ function parseStringStyle(cssText) {
158
158
  return ret;
159
159
  }
160
160
  function stringifyStyle(styles) {
161
+ if (!styles) return "";
162
+ if (isString(styles)) return styles;
161
163
  let ret = "";
162
- if (!styles || isString(styles)) {
163
- return ret;
164
- }
165
164
  for (const key in styles) {
166
165
  const value = styles[key];
167
166
  if (isString(value) || typeof value === "number") {
@@ -446,17 +445,21 @@ class EffectScope {
446
445
  }
447
446
  stop(fromParent) {
448
447
  if (this._active) {
448
+ this._active = false;
449
449
  let i, l;
450
450
  for (i = 0, l = this.effects.length; i < l; i++) {
451
451
  this.effects[i].stop();
452
452
  }
453
+ this.effects.length = 0;
453
454
  for (i = 0, l = this.cleanups.length; i < l; i++) {
454
455
  this.cleanups[i]();
455
456
  }
457
+ this.cleanups.length = 0;
456
458
  if (this.scopes) {
457
459
  for (i = 0, l = this.scopes.length; i < l; i++) {
458
460
  this.scopes[i].stop(true);
459
461
  }
462
+ this.scopes.length = 0;
460
463
  }
461
464
  if (!this.detached && this.parent && !fromParent) {
462
465
  const last = this.parent.scopes.pop();
@@ -466,7 +469,6 @@ class EffectScope {
466
469
  }
467
470
  }
468
471
  this.parent = void 0;
469
- this._active = false;
470
472
  }
471
473
  }
472
474
  }
@@ -724,11 +726,11 @@ function removeSub(link, soft = false) {
724
726
  }
725
727
  if (dep.subs === link) {
726
728
  dep.subs = prevSub;
727
- }
728
- if (!dep.subs && dep.computed) {
729
- dep.computed.flags &= ~4;
730
- for (let l = dep.computed.deps; l; l = l.nextDep) {
731
- removeSub(l, true);
729
+ if (!prevSub && dep.computed) {
730
+ dep.computed.flags &= ~4;
731
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
732
+ removeSub(l, true);
733
+ }
732
734
  }
733
735
  }
734
736
  if (!soft && !--dep.sc && dep.map) {
@@ -948,7 +950,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
948
950
  }
949
951
  });
950
952
  } else {
951
- if (key !== void 0) {
953
+ if (key !== void 0 || depsMap.has(void 0)) {
952
954
  run(depsMap.get(key));
953
955
  }
954
956
  if (isArrayIndex) {
@@ -1180,6 +1182,7 @@ class BaseReactiveHandler {
1180
1182
  this._isShallow = _isShallow;
1181
1183
  }
1182
1184
  get(target, key, receiver) {
1185
+ if (key === "__v_skip") return target["__v_skip"];
1183
1186
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1184
1187
  if (key === "__v_isReactive") {
1185
1188
  return !isReadonly2;
@@ -1311,112 +1314,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1311
1314
 
1312
1315
  const toShallow = (value) => value;
1313
1316
  const getProto = (v) => Reflect.getPrototypeOf(v);
1314
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1315
- target = target["__v_raw"];
1316
- const rawTarget = toRaw(target);
1317
- const rawKey = toRaw(key);
1318
- if (!isReadonly2) {
1319
- if (hasChanged(key, rawKey)) {
1320
- track(rawTarget, "get", key);
1321
- }
1322
- track(rawTarget, "get", rawKey);
1323
- }
1324
- const { has: has2 } = getProto(rawTarget);
1325
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1326
- if (has2.call(rawTarget, key)) {
1327
- return wrap(target.get(key));
1328
- } else if (has2.call(rawTarget, rawKey)) {
1329
- return wrap(target.get(rawKey));
1330
- } else if (target !== rawTarget) {
1331
- target.get(key);
1332
- }
1333
- }
1334
- function has(key, isReadonly2 = false) {
1335
- const target = this["__v_raw"];
1336
- const rawTarget = toRaw(target);
1337
- const rawKey = toRaw(key);
1338
- if (!isReadonly2) {
1339
- if (hasChanged(key, rawKey)) {
1340
- track(rawTarget, "has", key);
1341
- }
1342
- track(rawTarget, "has", rawKey);
1343
- }
1344
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1345
- }
1346
- function size(target, isReadonly2 = false) {
1347
- target = target["__v_raw"];
1348
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1349
- return Reflect.get(target, "size", target);
1350
- }
1351
- function add(value, _isShallow = false) {
1352
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1353
- value = toRaw(value);
1354
- }
1355
- const target = toRaw(this);
1356
- const proto = getProto(target);
1357
- const hadKey = proto.has.call(target, value);
1358
- if (!hadKey) {
1359
- target.add(value);
1360
- trigger(target, "add", value, value);
1361
- }
1362
- return this;
1363
- }
1364
- function set(key, value, _isShallow = false) {
1365
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1366
- value = toRaw(value);
1367
- }
1368
- const target = toRaw(this);
1369
- const { has: has2, get: get2 } = getProto(target);
1370
- let hadKey = has2.call(target, key);
1371
- if (!hadKey) {
1372
- key = toRaw(key);
1373
- hadKey = has2.call(target, key);
1374
- }
1375
- const oldValue = get2.call(target, key);
1376
- target.set(key, value);
1377
- if (!hadKey) {
1378
- trigger(target, "add", key, value);
1379
- } else if (hasChanged(value, oldValue)) {
1380
- trigger(target, "set", key, value);
1381
- }
1382
- return this;
1383
- }
1384
- function deleteEntry(key) {
1385
- const target = toRaw(this);
1386
- const { has: has2, get: get2 } = getProto(target);
1387
- let hadKey = has2.call(target, key);
1388
- if (!hadKey) {
1389
- key = toRaw(key);
1390
- hadKey = has2.call(target, key);
1391
- }
1392
- get2 ? get2.call(target, key) : void 0;
1393
- const result = target.delete(key);
1394
- if (hadKey) {
1395
- trigger(target, "delete", key, void 0);
1396
- }
1397
- return result;
1398
- }
1399
- function clear() {
1400
- const target = toRaw(this);
1401
- const hadItems = target.size !== 0;
1402
- const result = target.clear();
1403
- if (hadItems) {
1404
- trigger(target, "clear", void 0, void 0);
1405
- }
1406
- return result;
1407
- }
1408
- function createForEach(isReadonly2, isShallow2) {
1409
- return function forEach(callback, thisArg) {
1410
- const observed = this;
1411
- const target = observed["__v_raw"];
1412
- const rawTarget = toRaw(target);
1413
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1414
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1415
- return target.forEach((value, key) => {
1416
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1417
- });
1418
- };
1419
- }
1420
1317
  function createIterableMethod(method, isReadonly2, isShallow2) {
1421
1318
  return function(...args) {
1422
1319
  const target = this["__v_raw"];
@@ -1452,71 +1349,127 @@ function createReadonlyMethod(type) {
1452
1349
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1453
1350
  };
1454
1351
  }
1455
- function createInstrumentations() {
1456
- const mutableInstrumentations2 = {
1352
+ function createInstrumentations(readonly, shallow) {
1353
+ const instrumentations = {
1457
1354
  get(key) {
1458
- return get(this, key);
1459
- },
1460
- get size() {
1461
- return size(this);
1462
- },
1463
- has,
1464
- add,
1465
- set,
1466
- delete: deleteEntry,
1467
- clear,
1468
- forEach: createForEach(false, false)
1469
- };
1470
- const shallowInstrumentations2 = {
1471
- get(key) {
1472
- return get(this, key, false, true);
1473
- },
1474
- get size() {
1475
- return size(this);
1476
- },
1477
- has,
1478
- add(value) {
1479
- return add.call(this, value, true);
1480
- },
1481
- set(key, value) {
1482
- return set.call(this, key, value, true);
1483
- },
1484
- delete: deleteEntry,
1485
- clear,
1486
- forEach: createForEach(false, true)
1487
- };
1488
- const readonlyInstrumentations2 = {
1489
- get(key) {
1490
- return get(this, key, true);
1491
- },
1492
- get size() {
1493
- return size(this, true);
1494
- },
1495
- has(key) {
1496
- return has.call(this, key, true);
1497
- },
1498
- add: createReadonlyMethod("add"),
1499
- set: createReadonlyMethod("set"),
1500
- delete: createReadonlyMethod("delete"),
1501
- clear: createReadonlyMethod("clear"),
1502
- forEach: createForEach(true, false)
1503
- };
1504
- const shallowReadonlyInstrumentations2 = {
1505
- get(key) {
1506
- return get(this, key, true, true);
1355
+ const target = this["__v_raw"];
1356
+ const rawTarget = toRaw(target);
1357
+ const rawKey = toRaw(key);
1358
+ if (!readonly) {
1359
+ if (hasChanged(key, rawKey)) {
1360
+ track(rawTarget, "get", key);
1361
+ }
1362
+ track(rawTarget, "get", rawKey);
1363
+ }
1364
+ const { has } = getProto(rawTarget);
1365
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1366
+ if (has.call(rawTarget, key)) {
1367
+ return wrap(target.get(key));
1368
+ } else if (has.call(rawTarget, rawKey)) {
1369
+ return wrap(target.get(rawKey));
1370
+ } else if (target !== rawTarget) {
1371
+ target.get(key);
1372
+ }
1507
1373
  },
1508
1374
  get size() {
1509
- return size(this, true);
1375
+ const target = this["__v_raw"];
1376
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1377
+ return Reflect.get(target, "size", target);
1510
1378
  },
1511
1379
  has(key) {
1512
- return has.call(this, key, true);
1380
+ const target = this["__v_raw"];
1381
+ const rawTarget = toRaw(target);
1382
+ const rawKey = toRaw(key);
1383
+ if (!readonly) {
1384
+ if (hasChanged(key, rawKey)) {
1385
+ track(rawTarget, "has", key);
1386
+ }
1387
+ track(rawTarget, "has", rawKey);
1388
+ }
1389
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1513
1390
  },
1514
- add: createReadonlyMethod("add"),
1515
- set: createReadonlyMethod("set"),
1516
- delete: createReadonlyMethod("delete"),
1517
- clear: createReadonlyMethod("clear"),
1518
- forEach: createForEach(true, true)
1391
+ forEach(callback, thisArg) {
1392
+ const observed = this;
1393
+ const target = observed["__v_raw"];
1394
+ const rawTarget = toRaw(target);
1395
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1396
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1397
+ return target.forEach((value, key) => {
1398
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1399
+ });
1400
+ }
1519
1401
  };
1402
+ extend$1(
1403
+ instrumentations,
1404
+ readonly ? {
1405
+ add: createReadonlyMethod("add"),
1406
+ set: createReadonlyMethod("set"),
1407
+ delete: createReadonlyMethod("delete"),
1408
+ clear: createReadonlyMethod("clear")
1409
+ } : {
1410
+ add(value) {
1411
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1412
+ value = toRaw(value);
1413
+ }
1414
+ const target = toRaw(this);
1415
+ const proto = getProto(target);
1416
+ const hadKey = proto.has.call(target, value);
1417
+ if (!hadKey) {
1418
+ target.add(value);
1419
+ trigger(target, "add", value, value);
1420
+ }
1421
+ return this;
1422
+ },
1423
+ set(key, value) {
1424
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1425
+ value = toRaw(value);
1426
+ }
1427
+ const target = toRaw(this);
1428
+ const { has, get } = getProto(target);
1429
+ let hadKey = has.call(target, key);
1430
+ if (!hadKey) {
1431
+ key = toRaw(key);
1432
+ hadKey = has.call(target, key);
1433
+ }
1434
+ const oldValue = get.call(target, key);
1435
+ target.set(key, value);
1436
+ if (!hadKey) {
1437
+ trigger(target, "add", key, value);
1438
+ } else if (hasChanged(value, oldValue)) {
1439
+ trigger(target, "set", key, value);
1440
+ }
1441
+ return this;
1442
+ },
1443
+ delete(key) {
1444
+ const target = toRaw(this);
1445
+ const { has, get } = getProto(target);
1446
+ let hadKey = has.call(target, key);
1447
+ if (!hadKey) {
1448
+ key = toRaw(key);
1449
+ hadKey = has.call(target, key);
1450
+ }
1451
+ get ? get.call(target, key) : void 0;
1452
+ const result = target.delete(key);
1453
+ if (hadKey) {
1454
+ trigger(target, "delete", key, void 0);
1455
+ }
1456
+ return result;
1457
+ },
1458
+ clear() {
1459
+ const target = toRaw(this);
1460
+ const hadItems = target.size !== 0;
1461
+ const result = target.clear();
1462
+ if (hadItems) {
1463
+ trigger(
1464
+ target,
1465
+ "clear",
1466
+ void 0,
1467
+ void 0);
1468
+ }
1469
+ return result;
1470
+ }
1471
+ }
1472
+ );
1520
1473
  const iteratorMethods = [
1521
1474
  "keys",
1522
1475
  "values",
@@ -1524,30 +1477,12 @@ function createInstrumentations() {
1524
1477
  Symbol.iterator
1525
1478
  ];
1526
1479
  iteratorMethods.forEach((method) => {
1527
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1528
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1529
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1530
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1531
- method,
1532
- true,
1533
- true
1534
- );
1480
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1535
1481
  });
1536
- return [
1537
- mutableInstrumentations2,
1538
- readonlyInstrumentations2,
1539
- shallowInstrumentations2,
1540
- shallowReadonlyInstrumentations2
1541
- ];
1482
+ return instrumentations;
1542
1483
  }
1543
- const [
1544
- mutableInstrumentations,
1545
- readonlyInstrumentations,
1546
- shallowInstrumentations,
1547
- shallowReadonlyInstrumentations
1548
- ] = /* @__PURE__ */ createInstrumentations();
1549
1484
  function createInstrumentationGetter(isReadonly2, shallow) {
1550
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1485
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1551
1486
  return (target, key, receiver) => {
1552
1487
  if (key === "__v_isReactive") {
1553
1488
  return !isReadonly2;
@@ -2000,7 +1935,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2000
1935
  const scope = getCurrentScope();
2001
1936
  const watchHandle = () => {
2002
1937
  effect.stop();
2003
- if (scope) {
1938
+ if (scope && scope.active) {
2004
1939
  remove(scope.effects, effect);
2005
1940
  }
2006
1941
  };
@@ -2798,20 +2733,41 @@ const TeleportImpl = {
2798
2733
  }
2799
2734
  if (!disabled) {
2800
2735
  mount(target, targetAnchor);
2801
- updateCssVars(n2);
2736
+ updateCssVars(n2, false);
2802
2737
  }
2803
2738
  }
2804
2739
  };
2805
2740
  if (disabled) {
2806
2741
  mount(container, mainAnchor);
2807
- updateCssVars(n2);
2742
+ updateCssVars(n2, true);
2808
2743
  }
2809
2744
  if (isTeleportDeferred(n2.props)) {
2810
- queuePostRenderEffect(mountToTarget, parentSuspense);
2745
+ queuePostRenderEffect(() => {
2746
+ mountToTarget();
2747
+ n2.el.__isMounted = true;
2748
+ }, parentSuspense);
2811
2749
  } else {
2812
2750
  mountToTarget();
2813
2751
  }
2814
2752
  } else {
2753
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
2754
+ queuePostRenderEffect(() => {
2755
+ TeleportImpl.process(
2756
+ n1,
2757
+ n2,
2758
+ container,
2759
+ anchor,
2760
+ parentComponent,
2761
+ parentSuspense,
2762
+ namespace,
2763
+ slotScopeIds,
2764
+ optimized,
2765
+ internals
2766
+ );
2767
+ delete n1.el.__isMounted;
2768
+ }, parentSuspense);
2769
+ return;
2770
+ }
2815
2771
  n2.el = n1.el;
2816
2772
  n2.targetStart = n1.targetStart;
2817
2773
  const mainAnchor = n2.anchor = n1.anchor;
@@ -2888,7 +2844,7 @@ const TeleportImpl = {
2888
2844
  );
2889
2845
  }
2890
2846
  }
2891
- updateCssVars(n2);
2847
+ updateCssVars(n2, disabled);
2892
2848
  }
2893
2849
  },
2894
2850
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -2956,9 +2912,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
2956
2912
  querySelector
2957
2913
  );
2958
2914
  if (target) {
2915
+ const disabled = isTeleportDisabled(vnode.props);
2959
2916
  const targetNode = target._lpa || target.firstChild;
2960
2917
  if (vnode.shapeFlag & 16) {
2961
- if (isTeleportDisabled(vnode.props)) {
2918
+ if (disabled) {
2962
2919
  vnode.anchor = hydrateChildren(
2963
2920
  nextSibling(node),
2964
2921
  vnode,
@@ -2999,16 +2956,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
2999
2956
  );
3000
2957
  }
3001
2958
  }
3002
- updateCssVars(vnode);
2959
+ updateCssVars(vnode, disabled);
3003
2960
  }
3004
2961
  return vnode.anchor && nextSibling(vnode.anchor);
3005
2962
  }
3006
2963
  const Teleport = TeleportImpl;
3007
- function updateCssVars(vnode) {
2964
+ function updateCssVars(vnode, isDisabled) {
3008
2965
  const ctx = vnode.ctx;
3009
2966
  if (ctx && ctx.ut) {
3010
- let node = vnode.targetStart;
3011
- while (node && node !== vnode.targetAnchor) {
2967
+ let node, anchor;
2968
+ if (isDisabled) {
2969
+ node = vnode.el;
2970
+ anchor = vnode.anchor;
2971
+ } else {
2972
+ node = vnode.targetStart;
2973
+ anchor = vnode.targetAnchor;
2974
+ }
2975
+ while (node && node !== anchor) {
3012
2976
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3013
2977
  node = node.nextSibling;
3014
2978
  }
@@ -3100,10 +3064,9 @@ const BaseTransitionImpl = {
3100
3064
  if (innerChild.type !== Comment) {
3101
3065
  setTransitionHooks(innerChild, enterHooks);
3102
3066
  }
3103
- const oldChild = instance.subTree;
3104
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3067
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3105
3068
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3106
- const leavingHooks = resolveTransitionHooks(
3069
+ let leavingHooks = resolveTransitionHooks(
3107
3070
  oldInnerChild,
3108
3071
  rawProps,
3109
3072
  state,
@@ -3118,6 +3081,7 @@ const BaseTransitionImpl = {
3118
3081
  instance.update();
3119
3082
  }
3120
3083
  delete leavingHooks.afterLeave;
3084
+ oldInnerChild = void 0;
3121
3085
  };
3122
3086
  return emptyPlaceholder(child);
3123
3087
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3131,10 +3095,19 @@ const BaseTransitionImpl = {
3131
3095
  earlyRemove();
3132
3096
  el[leaveCbKey] = void 0;
3133
3097
  delete enterHooks.delayedLeave;
3098
+ oldInnerChild = void 0;
3099
+ };
3100
+ enterHooks.delayedLeave = () => {
3101
+ delayedLeave();
3102
+ delete enterHooks.delayedLeave;
3103
+ oldInnerChild = void 0;
3134
3104
  };
3135
- enterHooks.delayedLeave = delayedLeave;
3136
3105
  };
3106
+ } else {
3107
+ oldInnerChild = void 0;
3137
3108
  }
3109
+ } else if (oldInnerChild) {
3110
+ oldInnerChild = void 0;
3138
3111
  }
3139
3112
  return child;
3140
3113
  };
@@ -3417,6 +3390,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3417
3390
  return;
3418
3391
  }
3419
3392
  if (isAsyncWrapper(vnode) && !isUnmount) {
3393
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
3394
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
3395
+ }
3420
3396
  return;
3421
3397
  }
3422
3398
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -3645,7 +3621,7 @@ function createHydrationFunctions(rendererInternals) {
3645
3621
  getContainerType(container),
3646
3622
  optimized
3647
3623
  );
3648
- if (isAsyncWrapper(vnode)) {
3624
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3649
3625
  let subTree;
3650
3626
  if (isFragmentStart) {
3651
3627
  subTree = createVNode(Fragment);
@@ -3700,7 +3676,11 @@ function createHydrationFunctions(rendererInternals) {
3700
3676
  }
3701
3677
  let needCallTransitionHooks = false;
3702
3678
  if (isTemplateNode(el)) {
3703
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3679
+ needCallTransitionHooks = needTransition(
3680
+ null,
3681
+ // no need check parentSuspense in hydration
3682
+ transition
3683
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3704
3684
  const content = el.content.firstChild;
3705
3685
  if (needCallTransitionHooks) {
3706
3686
  transition.beforeEnter(content);
@@ -3878,6 +3858,10 @@ function createHydrationFunctions(rendererInternals) {
3878
3858
  getContainerType(container),
3879
3859
  slotScopeIds
3880
3860
  );
3861
+ if (parentComponent) {
3862
+ parentComponent.vnode.el = vnode.el;
3863
+ updateHOCHostEl(parentComponent, vnode.el);
3864
+ }
3881
3865
  return next;
3882
3866
  };
3883
3867
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -3943,6 +3927,8 @@ function isMismatchAllowed(el, allowedType) {
3943
3927
  }
3944
3928
  }
3945
3929
 
3930
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
3931
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
3946
3932
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
3947
3933
  const id = requestIdleCallback(hydrate, { timeout });
3948
3934
  return () => cancelIdleCallback(id);
@@ -4893,12 +4879,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4893
4879
  }
4894
4880
  openBlock();
4895
4881
  const validSlotContent = slot && ensureValidVNode(slot(props));
4882
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
4883
+ // key attached in the `createSlots` helper, respect that
4884
+ validSlotContent && validSlotContent.key;
4896
4885
  const rendered = createBlock(
4897
4886
  Fragment,
4898
4887
  {
4899
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
4900
- // key attached in the `createSlots` helper, respect that
4901
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
4888
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
4902
4889
  (!validSlotContent && fallback ? "_fb" : "")
4903
4890
  },
4904
4891
  validSlotContent || (fallback ? fallback() : []),
@@ -5814,7 +5801,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5814
5801
  return vm;
5815
5802
  }
5816
5803
  }
5817
- Vue.version = `2.6.14-compat:${"3.5.11"}`;
5804
+ Vue.version = `2.6.14-compat:${"3.5.13"}`;
5818
5805
  Vue.config = singletonApp.config;
5819
5806
  Vue.use = (plugin, ...options) => {
5820
5807
  if (plugin && isFunction(plugin.install)) {
@@ -8153,14 +8140,13 @@ function watch(source, cb, options) {
8153
8140
  function doWatch(source, cb, options = EMPTY_OBJ) {
8154
8141
  const { immediate, deep, flush, once } = options;
8155
8142
  const baseWatchOptions = extend$1({}, options);
8143
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
8156
8144
  let ssrCleanup;
8157
8145
  if (isInSSRComponentSetup) {
8158
8146
  if (flush === "sync") {
8159
8147
  const ctx = useSSRContext();
8160
8148
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
8161
- } else if (!cb || immediate) {
8162
- baseWatchOptions.once = true;
8163
- } else {
8149
+ } else if (!runsImmediately) {
8164
8150
  const watchStopHandle = () => {
8165
8151
  };
8166
8152
  watchStopHandle.stop = NOOP;
@@ -8199,7 +8185,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
8199
8185
  }
8200
8186
  };
8201
8187
  const watchHandle = watch$1(source, cb, baseWatchOptions);
8202
- if (ssrCleanup) ssrCleanup.push(watchHandle);
8188
+ if (isInSSRComponentSetup) {
8189
+ if (ssrCleanup) {
8190
+ ssrCleanup.push(watchHandle);
8191
+ } else if (runsImmediately) {
8192
+ watchHandle();
8193
+ }
8194
+ }
8203
8195
  return watchHandle;
8204
8196
  }
8205
8197
  function instanceWatch(source, value, options) {
@@ -8232,13 +8224,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
8232
8224
  const i = getCurrentInstance();
8233
8225
  const camelizedName = camelize(name);
8234
8226
  const hyphenatedName = hyphenate(name);
8235
- const modifiers = getModelModifiers(props, name);
8227
+ const modifiers = getModelModifiers(props, camelizedName);
8236
8228
  const res = customRef((track, trigger) => {
8237
8229
  let localValue;
8238
8230
  let prevSetValue = EMPTY_OBJ;
8239
8231
  let prevEmittedValue;
8240
8232
  watchSyncEffect(() => {
8241
- const propValue = props[name];
8233
+ const propValue = props[camelizedName];
8242
8234
  if (hasChanged(localValue, propValue)) {
8243
8235
  localValue = propValue;
8244
8236
  trigger();
@@ -9247,9 +9239,9 @@ function closeBlock() {
9247
9239
  currentBlock = blockStack[blockStack.length - 1] || null;
9248
9240
  }
9249
9241
  let isBlockTreeEnabled = 1;
9250
- function setBlockTracking(value) {
9242
+ function setBlockTracking(value, inVOnce = false) {
9251
9243
  isBlockTreeEnabled += value;
9252
- if (value < 0 && currentBlock) {
9244
+ if (value < 0 && currentBlock && inVOnce) {
9253
9245
  currentBlock.hasOnce = true;
9254
9246
  }
9255
9247
  }
@@ -9731,9 +9723,9 @@ function setupStatefulComponent(instance, isSSR) {
9731
9723
  instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
9732
9724
  const { setup } = Component;
9733
9725
  if (setup) {
9726
+ pauseTracking();
9734
9727
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
9735
9728
  const reset = setCurrentInstance(instance);
9736
- pauseTracking();
9737
9729
  const setupResult = callWithErrorHandling(
9738
9730
  setup,
9739
9731
  instance,
@@ -9743,10 +9735,13 @@ function setupStatefulComponent(instance, isSSR) {
9743
9735
  setupContext
9744
9736
  ]
9745
9737
  );
9738
+ const isAsyncSetup = isPromise(setupResult);
9746
9739
  resetTracking();
9747
9740
  reset();
9748
- if (isPromise(setupResult)) {
9749
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
9741
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
9742
+ markAsyncBoundary(instance);
9743
+ }
9744
+ if (isAsyncSetup) {
9750
9745
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9751
9746
  if (isSSR) {
9752
9747
  return setupResult.then((resolvedResult) => {
@@ -9935,7 +9930,7 @@ function isMemoSame(cached, memo) {
9935
9930
  return true;
9936
9931
  }
9937
9932
 
9938
- const version = "3.5.11";
9933
+ const version = "3.5.13";
9939
9934
  const warn$1 = NOOP;
9940
9935
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9941
9936
  const devtools = void 0;
@@ -10144,7 +10139,8 @@ function resolveTransitionProps(rawProps) {
10144
10139
  onAppear = onEnter,
10145
10140
  onAppearCancelled = onEnterCancelled
10146
10141
  } = baseProps;
10147
- const finishEnter = (el, isAppear, done) => {
10142
+ const finishEnter = (el, isAppear, done, isCancelled) => {
10143
+ el._enterCancelled = isCancelled;
10148
10144
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10149
10145
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10150
10146
  done && done();
@@ -10202,8 +10198,13 @@ function resolveTransitionProps(rawProps) {
10202
10198
  if (legacyClassEnabled && legacyLeaveFromClass) {
10203
10199
  addTransitionClass(el, legacyLeaveFromClass);
10204
10200
  }
10205
- addTransitionClass(el, leaveActiveClass);
10206
- forceReflow();
10201
+ if (!el._enterCancelled) {
10202
+ forceReflow();
10203
+ addTransitionClass(el, leaveActiveClass);
10204
+ } else {
10205
+ addTransitionClass(el, leaveActiveClass);
10206
+ forceReflow();
10207
+ }
10207
10208
  nextFrame(() => {
10208
10209
  if (!el._isLeaving) {
10209
10210
  return;
@@ -10220,11 +10221,11 @@ function resolveTransitionProps(rawProps) {
10220
10221
  callHook(onLeave, [el, resolve]);
10221
10222
  },
10222
10223
  onEnterCancelled(el) {
10223
- finishEnter(el, false);
10224
+ finishEnter(el, false, void 0, true);
10224
10225
  callHook(onEnterCancelled, [el]);
10225
10226
  },
10226
10227
  onAppearCancelled(el) {
10227
- finishEnter(el, true);
10228
+ finishEnter(el, true, void 0, true);
10228
10229
  callHook(onAppearCancelled, [el]);
10229
10230
  },
10230
10231
  onLeaveCancelled(el) {
@@ -10559,7 +10560,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
10559
10560
  return false;
10560
10561
  }
10561
10562
 
10562
- function patchDOMProp(el, key, value, parentComponent) {
10563
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
10563
10564
  if (key === "innerHTML" || key === "textContent") {
10564
10565
  if (value != null) {
10565
10566
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -10612,7 +10613,7 @@ function patchDOMProp(el, key, value, parentComponent) {
10612
10613
  el[key] = value;
10613
10614
  } catch (e) {
10614
10615
  }
10615
- needRemove && el.removeAttribute(key);
10616
+ needRemove && el.removeAttribute(attrName || key);
10616
10617
  }
10617
10618
 
10618
10619
  function addEventListener(el, event, handler, options) {
@@ -10712,7 +10713,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
10712
10713
  // #11081 force set props for possible async custom element
10713
10714
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
10714
10715
  ) {
10715
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
10716
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
10716
10717
  } else {
10717
10718
  if (key === "true-value") {
10718
10719
  el._trueValue = nextValue;
@@ -10983,6 +10984,8 @@ class VueElement extends BaseClass {
10983
10984
  this._update();
10984
10985
  }
10985
10986
  if (shouldReflect) {
10987
+ const ob = this._ob;
10988
+ ob && ob.disconnect();
10986
10989
  if (val === true) {
10987
10990
  this.setAttribute(hyphenate(key), "");
10988
10991
  } else if (typeof val === "string" || typeof val === "number") {
@@ -10990,6 +10993,7 @@ class VueElement extends BaseClass {
10990
10993
  } else if (!val) {
10991
10994
  this.removeAttribute(hyphenate(key));
10992
10995
  }
10996
+ ob && ob.observe(this, { attributes: true });
10993
10997
  }
10994
10998
  }
10995
10999
  }
@@ -11375,7 +11379,7 @@ const vModelCheckbox = {
11375
11379
  setChecked(el, binding, vnode);
11376
11380
  }
11377
11381
  };
11378
- function setChecked(el, { value }, vnode) {
11382
+ function setChecked(el, { value, oldValue }, vnode) {
11379
11383
  el._modelValue = value;
11380
11384
  let checked;
11381
11385
  if (isArray(value)) {
@@ -11383,6 +11387,7 @@ function setChecked(el, { value }, vnode) {
11383
11387
  } else if (isSet(value)) {
11384
11388
  checked = value.has(vnode.props.value);
11385
11389
  } else {
11390
+ if (value === oldValue) return;
11386
11391
  checked = looseEqual(value, getCheckboxValue(el, true));
11387
11392
  }
11388
11393
  if (el.checked !== checked) {
@@ -12125,12 +12130,13 @@ function createConditionalExpression(test, consequent, alternate, newline = true
12125
12130
  loc: locStub
12126
12131
  };
12127
12132
  }
12128
- function createCacheExpression(index, value, needPauseTracking = false) {
12133
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
12129
12134
  return {
12130
12135
  type: 20,
12131
12136
  index,
12132
12137
  value,
12133
12138
  needPauseTracking,
12139
+ inVOnce,
12134
12140
  needArraySpread: false,
12135
12141
  loc: locStub
12136
12142
  };
@@ -14359,6 +14365,9 @@ function getLoc(start, end) {
14359
14365
  source: end == null ? end : getSlice(start, end)
14360
14366
  };
14361
14367
  }
14368
+ function cloneLoc(loc) {
14369
+ return getLoc(loc.start.offset, loc.end.offset);
14370
+ }
14362
14371
  function setLocEnd(loc, end) {
14363
14372
  loc.end = tokenizer.getPos(end);
14364
14373
  loc.source = getSlice(loc.start.offset, end);
@@ -14886,11 +14895,12 @@ function createTransformContext(root, {
14886
14895
  identifier.hoisted = exp;
14887
14896
  return identifier;
14888
14897
  },
14889
- cache(exp, isVNode = false) {
14898
+ cache(exp, isVNode = false, inVOnce = false) {
14890
14899
  const cacheExp = createCacheExpression(
14891
14900
  context.cached.length,
14892
14901
  exp,
14893
- isVNode
14902
+ isVNode,
14903
+ inVOnce
14894
14904
  );
14895
14905
  context.cached.push(cacheExp);
14896
14906
  return cacheExp;
@@ -15725,7 +15735,9 @@ function genCacheExpression(node, context) {
15725
15735
  push(`_cache[${node.index}] || (`);
15726
15736
  if (needPauseTracking) {
15727
15737
  indent();
15728
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
15738
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
15739
+ if (node.inVOnce) push(`, true`);
15740
+ push(`),`);
15729
15741
  newline();
15730
15742
  push(`(`);
15731
15743
  }
@@ -15813,12 +15825,14 @@ const transformExpression = (node, context) => {
15813
15825
  context
15814
15826
  );
15815
15827
  } else if (node.type === 1) {
15828
+ const memo = findDir(node, "memo");
15816
15829
  for (let i = 0; i < node.props.length; i++) {
15817
15830
  const dir = node.props[i];
15818
15831
  if (dir.type === 7 && dir.name !== "for") {
15819
15832
  const exp = dir.exp;
15820
15833
  const arg = dir.arg;
15821
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
15834
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
15835
+ !(memo && arg && arg.type === 4 && arg.content === "key")) {
15822
15836
  dir.exp = processExpression(
15823
15837
  exp,
15824
15838
  context,
@@ -16079,7 +16093,7 @@ function processIf(node, dir, context, processCodegen) {
16079
16093
  const branch = createIfBranch(node, dir);
16080
16094
  const ifNode = {
16081
16095
  type: 9,
16082
- loc: node.loc,
16096
+ loc: cloneLoc(node.loc),
16083
16097
  branches: [branch]
16084
16098
  };
16085
16099
  context.replaceNode(ifNode);
@@ -16337,10 +16351,19 @@ const transformFor = createStructuralDirectiveTransform(
16337
16351
  const isTemplate = isTemplateNode(node);
16338
16352
  const memo = findDir(node, "memo");
16339
16353
  const keyProp = findProp(node, `key`, false, true);
16340
- if (keyProp && keyProp.type === 7 && !keyProp.exp) {
16354
+ const isDirKey = keyProp && keyProp.type === 7;
16355
+ if (isDirKey && !keyProp.exp) {
16341
16356
  transformBindShorthand(keyProp, context);
16342
16357
  }
16343
- const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16358
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16359
+ if (memo && keyExp && isDirKey) {
16360
+ {
16361
+ keyProp.exp = keyExp = processExpression(
16362
+ keyExp,
16363
+ context
16364
+ );
16365
+ }
16366
+ }
16344
16367
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
16345
16368
  if (isTemplate) {
16346
16369
  if (memo) {
@@ -17699,8 +17722,8 @@ const transformOnce = (node, context) => {
17699
17722
  if (cur.codegenNode) {
17700
17723
  cur.codegenNode = context.cache(
17701
17724
  cur.codegenNode,
17725
+ true,
17702
17726
  true
17703
- /* isVNode */
17704
17727
  );
17705
17728
  }
17706
17729
  };
@@ -18483,7 +18506,7 @@ function analyzeNode(node) {
18483
18506
  if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
18484
18507
  return bail();
18485
18508
  }
18486
- if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && p.exp.ast && p.exp.ast.type !== "StringLiteral") {
18509
+ if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) {
18487
18510
  return bail();
18488
18511
  }
18489
18512
  }