@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
  **/
@@ -212,10 +212,9 @@ function parseStringStyle(cssText) {
212
212
  return ret;
213
213
  }
214
214
  function stringifyStyle(styles) {
215
+ if (!styles) return "";
216
+ if (isString(styles)) return styles;
215
217
  let ret = "";
216
- if (!styles || isString(styles)) {
217
- return ret;
218
- }
219
218
  for (const key in styles) {
220
219
  const value = styles[key];
221
220
  if (isString(value) || typeof value === "number") {
@@ -478,17 +477,21 @@ class EffectScope {
478
477
  }
479
478
  stop(fromParent) {
480
479
  if (this._active) {
480
+ this._active = false;
481
481
  let i, l;
482
482
  for (i = 0, l = this.effects.length; i < l; i++) {
483
483
  this.effects[i].stop();
484
484
  }
485
+ this.effects.length = 0;
485
486
  for (i = 0, l = this.cleanups.length; i < l; i++) {
486
487
  this.cleanups[i]();
487
488
  }
489
+ this.cleanups.length = 0;
488
490
  if (this.scopes) {
489
491
  for (i = 0, l = this.scopes.length; i < l; i++) {
490
492
  this.scopes[i].stop(true);
491
493
  }
494
+ this.scopes.length = 0;
492
495
  }
493
496
  if (!this.detached && this.parent && !fromParent) {
494
497
  const last = this.parent.scopes.pop();
@@ -498,7 +501,6 @@ class EffectScope {
498
501
  }
499
502
  }
500
503
  this.parent = void 0;
501
- this._active = false;
502
504
  }
503
505
  }
504
506
  }
@@ -763,16 +765,16 @@ function removeSub(link, soft = false) {
763
765
  nextSub.prevSub = prevSub;
764
766
  link.nextSub = void 0;
765
767
  }
766
- if (dep.subs === link) {
767
- dep.subs = prevSub;
768
- }
769
768
  if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) {
770
769
  dep.subsHead = nextSub;
771
770
  }
772
- if (!dep.subs && dep.computed) {
773
- dep.computed.flags &= ~4;
774
- for (let l = dep.computed.deps; l; l = l.nextDep) {
775
- removeSub(l, true);
771
+ if (dep.subs === link) {
772
+ dep.subs = prevSub;
773
+ if (!prevSub && dep.computed) {
774
+ dep.computed.flags &= ~4;
775
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
776
+ removeSub(l, true);
777
+ }
776
778
  }
777
779
  }
778
780
  if (!soft && !--dep.sc && dep.map) {
@@ -1036,7 +1038,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
1036
1038
  }
1037
1039
  });
1038
1040
  } else {
1039
- if (key !== void 0) {
1041
+ if (key !== void 0 || depsMap.has(void 0)) {
1040
1042
  run(depsMap.get(key));
1041
1043
  }
1042
1044
  if (isArrayIndex) {
@@ -1268,6 +1270,7 @@ class BaseReactiveHandler {
1268
1270
  this._isShallow = _isShallow;
1269
1271
  }
1270
1272
  get(target, key, receiver) {
1273
+ if (key === "__v_skip") return target["__v_skip"];
1271
1274
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1272
1275
  if (key === "__v_isReactive") {
1273
1276
  return !isReadonly2;
@@ -1411,117 +1414,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1411
1414
 
1412
1415
  const toShallow = (value) => value;
1413
1416
  const getProto = (v) => Reflect.getPrototypeOf(v);
1414
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1415
- target = target["__v_raw"];
1416
- const rawTarget = toRaw(target);
1417
- const rawKey = toRaw(key);
1418
- if (!isReadonly2) {
1419
- if (hasChanged(key, rawKey)) {
1420
- track(rawTarget, "get", key);
1421
- }
1422
- track(rawTarget, "get", rawKey);
1423
- }
1424
- const { has: has2 } = getProto(rawTarget);
1425
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1426
- if (has2.call(rawTarget, key)) {
1427
- return wrap(target.get(key));
1428
- } else if (has2.call(rawTarget, rawKey)) {
1429
- return wrap(target.get(rawKey));
1430
- } else if (target !== rawTarget) {
1431
- target.get(key);
1432
- }
1433
- }
1434
- function has(key, isReadonly2 = false) {
1435
- const target = this["__v_raw"];
1436
- const rawTarget = toRaw(target);
1437
- const rawKey = toRaw(key);
1438
- if (!isReadonly2) {
1439
- if (hasChanged(key, rawKey)) {
1440
- track(rawTarget, "has", key);
1441
- }
1442
- track(rawTarget, "has", rawKey);
1443
- }
1444
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1445
- }
1446
- function size(target, isReadonly2 = false) {
1447
- target = target["__v_raw"];
1448
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1449
- return Reflect.get(target, "size", target);
1450
- }
1451
- function add(value, _isShallow = false) {
1452
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1453
- value = toRaw(value);
1454
- }
1455
- const target = toRaw(this);
1456
- const proto = getProto(target);
1457
- const hadKey = proto.has.call(target, value);
1458
- if (!hadKey) {
1459
- target.add(value);
1460
- trigger(target, "add", value, value);
1461
- }
1462
- return this;
1463
- }
1464
- function set(key, value, _isShallow = false) {
1465
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1466
- value = toRaw(value);
1467
- }
1468
- const target = toRaw(this);
1469
- const { has: has2, get: get2 } = getProto(target);
1470
- let hadKey = has2.call(target, key);
1471
- if (!hadKey) {
1472
- key = toRaw(key);
1473
- hadKey = has2.call(target, key);
1474
- } else if (!!(process.env.NODE_ENV !== "production")) {
1475
- checkIdentityKeys(target, has2, key);
1476
- }
1477
- const oldValue = get2.call(target, key);
1478
- target.set(key, value);
1479
- if (!hadKey) {
1480
- trigger(target, "add", key, value);
1481
- } else if (hasChanged(value, oldValue)) {
1482
- trigger(target, "set", key, value, oldValue);
1483
- }
1484
- return this;
1485
- }
1486
- function deleteEntry(key) {
1487
- const target = toRaw(this);
1488
- const { has: has2, get: get2 } = getProto(target);
1489
- let hadKey = has2.call(target, key);
1490
- if (!hadKey) {
1491
- key = toRaw(key);
1492
- hadKey = has2.call(target, key);
1493
- } else if (!!(process.env.NODE_ENV !== "production")) {
1494
- checkIdentityKeys(target, has2, key);
1495
- }
1496
- const oldValue = get2 ? get2.call(target, key) : void 0;
1497
- const result = target.delete(key);
1498
- if (hadKey) {
1499
- trigger(target, "delete", key, void 0, oldValue);
1500
- }
1501
- return result;
1502
- }
1503
- function clear() {
1504
- const target = toRaw(this);
1505
- const hadItems = target.size !== 0;
1506
- const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1507
- const result = target.clear();
1508
- if (hadItems) {
1509
- trigger(target, "clear", void 0, void 0, oldTarget);
1510
- }
1511
- return result;
1512
- }
1513
- function createForEach(isReadonly2, isShallow2) {
1514
- return function forEach(callback, thisArg) {
1515
- const observed = this;
1516
- const target = observed["__v_raw"];
1517
- const rawTarget = toRaw(target);
1518
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1519
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1520
- return target.forEach((value, key) => {
1521
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1522
- });
1523
- };
1524
- }
1525
1417
  function createIterableMethod(method, isReadonly2, isShallow2) {
1526
1418
  return function(...args) {
1527
1419
  const target = this["__v_raw"];
@@ -1564,71 +1456,134 @@ function createReadonlyMethod(type) {
1564
1456
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1565
1457
  };
1566
1458
  }
1567
- function createInstrumentations() {
1568
- const mutableInstrumentations2 = {
1569
- get(key) {
1570
- return get(this, key);
1571
- },
1572
- get size() {
1573
- return size(this);
1574
- },
1575
- has,
1576
- add,
1577
- set,
1578
- delete: deleteEntry,
1579
- clear,
1580
- forEach: createForEach(false, false)
1581
- };
1582
- const shallowInstrumentations2 = {
1583
- get(key) {
1584
- return get(this, key, false, true);
1585
- },
1586
- get size() {
1587
- return size(this);
1588
- },
1589
- has,
1590
- add(value) {
1591
- return add.call(this, value, true);
1592
- },
1593
- set(key, value) {
1594
- return set.call(this, key, value, true);
1595
- },
1596
- delete: deleteEntry,
1597
- clear,
1598
- forEach: createForEach(false, true)
1599
- };
1600
- const readonlyInstrumentations2 = {
1459
+ function createInstrumentations(readonly, shallow) {
1460
+ const instrumentations = {
1601
1461
  get(key) {
1602
- return get(this, key, true);
1603
- },
1604
- get size() {
1605
- return size(this, true);
1606
- },
1607
- has(key) {
1608
- return has.call(this, key, true);
1609
- },
1610
- add: createReadonlyMethod("add"),
1611
- set: createReadonlyMethod("set"),
1612
- delete: createReadonlyMethod("delete"),
1613
- clear: createReadonlyMethod("clear"),
1614
- forEach: createForEach(true, false)
1615
- };
1616
- const shallowReadonlyInstrumentations2 = {
1617
- get(key) {
1618
- return get(this, key, true, true);
1462
+ const target = this["__v_raw"];
1463
+ const rawTarget = toRaw(target);
1464
+ const rawKey = toRaw(key);
1465
+ if (!readonly) {
1466
+ if (hasChanged(key, rawKey)) {
1467
+ track(rawTarget, "get", key);
1468
+ }
1469
+ track(rawTarget, "get", rawKey);
1470
+ }
1471
+ const { has } = getProto(rawTarget);
1472
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1473
+ if (has.call(rawTarget, key)) {
1474
+ return wrap(target.get(key));
1475
+ } else if (has.call(rawTarget, rawKey)) {
1476
+ return wrap(target.get(rawKey));
1477
+ } else if (target !== rawTarget) {
1478
+ target.get(key);
1479
+ }
1619
1480
  },
1620
1481
  get size() {
1621
- return size(this, true);
1482
+ const target = this["__v_raw"];
1483
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1484
+ return Reflect.get(target, "size", target);
1622
1485
  },
1623
1486
  has(key) {
1624
- return has.call(this, key, true);
1487
+ const target = this["__v_raw"];
1488
+ const rawTarget = toRaw(target);
1489
+ const rawKey = toRaw(key);
1490
+ if (!readonly) {
1491
+ if (hasChanged(key, rawKey)) {
1492
+ track(rawTarget, "has", key);
1493
+ }
1494
+ track(rawTarget, "has", rawKey);
1495
+ }
1496
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1625
1497
  },
1626
- add: createReadonlyMethod("add"),
1627
- set: createReadonlyMethod("set"),
1628
- delete: createReadonlyMethod("delete"),
1629
- clear: createReadonlyMethod("clear"),
1630
- forEach: createForEach(true, true)
1498
+ forEach(callback, thisArg) {
1499
+ const observed = this;
1500
+ const target = observed["__v_raw"];
1501
+ const rawTarget = toRaw(target);
1502
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1503
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1504
+ return target.forEach((value, key) => {
1505
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1506
+ });
1507
+ }
1631
1508
  };
1509
+ extend(
1510
+ instrumentations,
1511
+ readonly ? {
1512
+ add: createReadonlyMethod("add"),
1513
+ set: createReadonlyMethod("set"),
1514
+ delete: createReadonlyMethod("delete"),
1515
+ clear: createReadonlyMethod("clear")
1516
+ } : {
1517
+ add(value) {
1518
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1519
+ value = toRaw(value);
1520
+ }
1521
+ const target = toRaw(this);
1522
+ const proto = getProto(target);
1523
+ const hadKey = proto.has.call(target, value);
1524
+ if (!hadKey) {
1525
+ target.add(value);
1526
+ trigger(target, "add", value, value);
1527
+ }
1528
+ return this;
1529
+ },
1530
+ set(key, value) {
1531
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1532
+ value = toRaw(value);
1533
+ }
1534
+ const target = toRaw(this);
1535
+ const { has, get } = getProto(target);
1536
+ let hadKey = has.call(target, key);
1537
+ if (!hadKey) {
1538
+ key = toRaw(key);
1539
+ hadKey = has.call(target, key);
1540
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1541
+ checkIdentityKeys(target, has, key);
1542
+ }
1543
+ const oldValue = get.call(target, key);
1544
+ target.set(key, value);
1545
+ if (!hadKey) {
1546
+ trigger(target, "add", key, value);
1547
+ } else if (hasChanged(value, oldValue)) {
1548
+ trigger(target, "set", key, value, oldValue);
1549
+ }
1550
+ return this;
1551
+ },
1552
+ delete(key) {
1553
+ const target = toRaw(this);
1554
+ const { has, get } = getProto(target);
1555
+ let hadKey = has.call(target, key);
1556
+ if (!hadKey) {
1557
+ key = toRaw(key);
1558
+ hadKey = has.call(target, key);
1559
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1560
+ checkIdentityKeys(target, has, key);
1561
+ }
1562
+ const oldValue = get ? get.call(target, key) : void 0;
1563
+ const result = target.delete(key);
1564
+ if (hadKey) {
1565
+ trigger(target, "delete", key, void 0, oldValue);
1566
+ }
1567
+ return result;
1568
+ },
1569
+ clear() {
1570
+ const target = toRaw(this);
1571
+ const hadItems = target.size !== 0;
1572
+ const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1573
+ const result = target.clear();
1574
+ if (hadItems) {
1575
+ trigger(
1576
+ target,
1577
+ "clear",
1578
+ void 0,
1579
+ void 0,
1580
+ oldTarget
1581
+ );
1582
+ }
1583
+ return result;
1584
+ }
1585
+ }
1586
+ );
1632
1587
  const iteratorMethods = [
1633
1588
  "keys",
1634
1589
  "values",
@@ -1636,30 +1591,12 @@ function createInstrumentations() {
1636
1591
  Symbol.iterator
1637
1592
  ];
1638
1593
  iteratorMethods.forEach((method) => {
1639
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1640
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1641
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1642
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1643
- method,
1644
- true,
1645
- true
1646
- );
1594
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1647
1595
  });
1648
- return [
1649
- mutableInstrumentations2,
1650
- readonlyInstrumentations2,
1651
- shallowInstrumentations2,
1652
- shallowReadonlyInstrumentations2
1653
- ];
1596
+ return instrumentations;
1654
1597
  }
1655
- const [
1656
- mutableInstrumentations,
1657
- readonlyInstrumentations,
1658
- shallowInstrumentations,
1659
- shallowReadonlyInstrumentations
1660
- ] = /* @__PURE__ */ createInstrumentations();
1661
1598
  function createInstrumentationGetter(isReadonly2, shallow) {
1662
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1599
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1663
1600
  return (target, key, receiver) => {
1664
1601
  if (key === "__v_isReactive") {
1665
1602
  return !isReadonly2;
@@ -1687,9 +1624,9 @@ const readonlyCollectionHandlers = {
1687
1624
  const shallowReadonlyCollectionHandlers = {
1688
1625
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1689
1626
  };
1690
- function checkIdentityKeys(target, has2, key) {
1627
+ function checkIdentityKeys(target, has, key) {
1691
1628
  const rawKey = toRaw(key);
1692
- if (rawKey !== key && has2.call(target, rawKey)) {
1629
+ if (rawKey !== key && has.call(target, rawKey)) {
1693
1630
  const type = toRawType(target);
1694
1631
  warn$2(
1695
1632
  `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
@@ -2176,7 +2113,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2176
2113
  const scope = getCurrentScope();
2177
2114
  const watchHandle = () => {
2178
2115
  effect.stop();
2179
- if (scope) {
2116
+ if (scope && scope.active) {
2180
2117
  remove(scope.effects, effect);
2181
2118
  }
2182
2119
  };
@@ -3657,7 +3594,7 @@ const TeleportImpl = {
3657
3594
  }
3658
3595
  if (!disabled) {
3659
3596
  mount(target, targetAnchor);
3660
- updateCssVars(n2);
3597
+ updateCssVars(n2, false);
3661
3598
  }
3662
3599
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
3663
3600
  warn$1(
@@ -3669,14 +3606,35 @@ const TeleportImpl = {
3669
3606
  };
3670
3607
  if (disabled) {
3671
3608
  mount(container, mainAnchor);
3672
- updateCssVars(n2);
3609
+ updateCssVars(n2, true);
3673
3610
  }
3674
3611
  if (isTeleportDeferred(n2.props)) {
3675
- queuePostRenderEffect(mountToTarget, parentSuspense);
3612
+ queuePostRenderEffect(() => {
3613
+ mountToTarget();
3614
+ n2.el.__isMounted = true;
3615
+ }, parentSuspense);
3676
3616
  } else {
3677
3617
  mountToTarget();
3678
3618
  }
3679
3619
  } else {
3620
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3621
+ queuePostRenderEffect(() => {
3622
+ TeleportImpl.process(
3623
+ n1,
3624
+ n2,
3625
+ container,
3626
+ anchor,
3627
+ parentComponent,
3628
+ parentSuspense,
3629
+ namespace,
3630
+ slotScopeIds,
3631
+ optimized,
3632
+ internals
3633
+ );
3634
+ delete n1.el.__isMounted;
3635
+ }, parentSuspense);
3636
+ return;
3637
+ }
3680
3638
  n2.el = n1.el;
3681
3639
  n2.targetStart = n1.targetStart;
3682
3640
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3759,7 +3717,7 @@ const TeleportImpl = {
3759
3717
  );
3760
3718
  }
3761
3719
  }
3762
- updateCssVars(n2);
3720
+ updateCssVars(n2, disabled);
3763
3721
  }
3764
3722
  },
3765
3723
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3827,9 +3785,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3827
3785
  querySelector
3828
3786
  );
3829
3787
  if (target) {
3788
+ const disabled = isTeleportDisabled(vnode.props);
3830
3789
  const targetNode = target._lpa || target.firstChild;
3831
3790
  if (vnode.shapeFlag & 16) {
3832
- if (isTeleportDisabled(vnode.props)) {
3791
+ if (disabled) {
3833
3792
  vnode.anchor = hydrateChildren(
3834
3793
  nextSibling(node),
3835
3794
  vnode,
@@ -3870,16 +3829,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3870
3829
  );
3871
3830
  }
3872
3831
  }
3873
- updateCssVars(vnode);
3832
+ updateCssVars(vnode, disabled);
3874
3833
  }
3875
3834
  return vnode.anchor && nextSibling(vnode.anchor);
3876
3835
  }
3877
3836
  const Teleport = TeleportImpl;
3878
- function updateCssVars(vnode) {
3837
+ function updateCssVars(vnode, isDisabled) {
3879
3838
  const ctx = vnode.ctx;
3880
3839
  if (ctx && ctx.ut) {
3881
- let node = vnode.targetStart;
3882
- while (node && node !== vnode.targetAnchor) {
3840
+ let node, anchor;
3841
+ if (isDisabled) {
3842
+ node = vnode.el;
3843
+ anchor = vnode.anchor;
3844
+ } else {
3845
+ node = vnode.targetStart;
3846
+ anchor = vnode.targetAnchor;
3847
+ }
3848
+ while (node && node !== anchor) {
3883
3849
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3884
3850
  node = node.nextSibling;
3885
3851
  }
@@ -3974,10 +3940,9 @@ const BaseTransitionImpl = {
3974
3940
  if (innerChild.type !== Comment) {
3975
3941
  setTransitionHooks(innerChild, enterHooks);
3976
3942
  }
3977
- const oldChild = instance.subTree;
3978
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3943
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3979
3944
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3980
- const leavingHooks = resolveTransitionHooks(
3945
+ let leavingHooks = resolveTransitionHooks(
3981
3946
  oldInnerChild,
3982
3947
  rawProps,
3983
3948
  state,
@@ -3992,6 +3957,7 @@ const BaseTransitionImpl = {
3992
3957
  instance.update();
3993
3958
  }
3994
3959
  delete leavingHooks.afterLeave;
3960
+ oldInnerChild = void 0;
3995
3961
  };
3996
3962
  return emptyPlaceholder(child);
3997
3963
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -4005,10 +3971,19 @@ const BaseTransitionImpl = {
4005
3971
  earlyRemove();
4006
3972
  el[leaveCbKey] = void 0;
4007
3973
  delete enterHooks.delayedLeave;
3974
+ oldInnerChild = void 0;
3975
+ };
3976
+ enterHooks.delayedLeave = () => {
3977
+ delayedLeave();
3978
+ delete enterHooks.delayedLeave;
3979
+ oldInnerChild = void 0;
4008
3980
  };
4009
- enterHooks.delayedLeave = delayedLeave;
4010
3981
  };
3982
+ } else {
3983
+ oldInnerChild = void 0;
4011
3984
  }
3985
+ } else if (oldInnerChild) {
3986
+ oldInnerChild = void 0;
4012
3987
  }
4013
3988
  return child;
4014
3989
  };
@@ -4317,6 +4292,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4317
4292
  return;
4318
4293
  }
4319
4294
  if (isAsyncWrapper(vnode) && !isUnmount) {
4295
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
4296
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
4297
+ }
4320
4298
  return;
4321
4299
  }
4322
4300
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -4333,8 +4311,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4333
4311
  const setupState = owner.setupState;
4334
4312
  const rawSetupState = toRaw(setupState);
4335
4313
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4336
- if (!!(process.env.NODE_ENV !== "production") && knownTemplateRefs.has(rawSetupState[key])) {
4337
- return false;
4314
+ if (!!(process.env.NODE_ENV !== "production")) {
4315
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4316
+ warn$1(
4317
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4318
+ );
4319
+ }
4320
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4321
+ return false;
4322
+ }
4338
4323
  }
4339
4324
  return hasOwn(rawSetupState, key);
4340
4325
  };
@@ -4574,7 +4559,7 @@ function createHydrationFunctions(rendererInternals) {
4574
4559
  getContainerType(container),
4575
4560
  optimized
4576
4561
  );
4577
- if (isAsyncWrapper(vnode)) {
4562
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4578
4563
  let subTree;
4579
4564
  if (isFragmentStart) {
4580
4565
  subTree = createVNode(Fragment);
@@ -4631,7 +4616,11 @@ function createHydrationFunctions(rendererInternals) {
4631
4616
  }
4632
4617
  let needCallTransitionHooks = false;
4633
4618
  if (isTemplateNode(el)) {
4634
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4619
+ needCallTransitionHooks = needTransition(
4620
+ null,
4621
+ // no need check parentSuspense in hydration
4622
+ transition
4623
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4635
4624
  const content = el.content.firstChild;
4636
4625
  if (needCallTransitionHooks) {
4637
4626
  transition.beforeEnter(content);
@@ -4850,6 +4839,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4850
4839
  getContainerType(container),
4851
4840
  slotScopeIds
4852
4841
  );
4842
+ if (parentComponent) {
4843
+ parentComponent.vnode.el = vnode.el;
4844
+ updateHOCHostEl(parentComponent, vnode.el);
4845
+ }
4853
4846
  return next;
4854
4847
  };
4855
4848
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -5035,6 +5028,8 @@ function isMismatchAllowed(el, allowedType) {
5035
5028
  }
5036
5029
  }
5037
5030
 
5031
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
5032
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
5038
5033
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
5039
5034
  const id = requestIdleCallback(hydrate, { timeout });
5040
5035
  return () => cancelIdleCallback(id);
@@ -6028,12 +6023,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6028
6023
  }
6029
6024
  openBlock();
6030
6025
  const validSlotContent = slot && ensureValidVNode(slot(props));
6026
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
6027
+ // key attached in the `createSlots` helper, respect that
6028
+ validSlotContent && validSlotContent.key;
6031
6029
  const rendered = createBlock(
6032
6030
  Fragment,
6033
6031
  {
6034
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
6035
- // key attached in the `createSlots` helper, respect that
6036
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
6032
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6037
6033
  (!validSlotContent && fallback ? "_fb" : "")
6038
6034
  },
6039
6035
  validSlotContent || (fallback ? fallback() : []),
@@ -7204,7 +7200,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7204
7200
  return vm;
7205
7201
  }
7206
7202
  }
7207
- Vue.version = `2.6.14-compat:${"3.5.11"}`;
7203
+ Vue.version = `2.6.14-compat:${"3.5.13"}`;
7208
7204
  Vue.config = singletonApp.config;
7209
7205
  Vue.use = (plugin, ...options) => {
7210
7206
  if (plugin && isFunction(plugin.install)) {
@@ -8194,6 +8190,7 @@ function getType(ctor) {
8194
8190
  function validateProps(rawProps, props, instance) {
8195
8191
  const resolvedValues = toRaw(props);
8196
8192
  const options = instance.propsOptions[0];
8193
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8197
8194
  for (const key in options) {
8198
8195
  let opt = options[key];
8199
8196
  if (opt == null) continue;
@@ -8202,7 +8199,7 @@ function validateProps(rawProps, props, instance) {
8202
8199
  resolvedValues[key],
8203
8200
  opt,
8204
8201
  !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
8205
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8202
+ !camelizePropsKey.includes(key)
8206
8203
  );
8207
8204
  }
8208
8205
  }
@@ -10054,14 +10051,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10054
10051
  }
10055
10052
  const baseWatchOptions = extend({}, options);
10056
10053
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
10054
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
10057
10055
  let ssrCleanup;
10058
10056
  if (isInSSRComponentSetup) {
10059
10057
  if (flush === "sync") {
10060
10058
  const ctx = useSSRContext();
10061
10059
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
10062
- } else if (!cb || immediate) {
10063
- baseWatchOptions.once = true;
10064
- } else {
10060
+ } else if (!runsImmediately) {
10065
10061
  const watchStopHandle = () => {
10066
10062
  };
10067
10063
  watchStopHandle.stop = NOOP;
@@ -10100,7 +10096,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10100
10096
  }
10101
10097
  };
10102
10098
  const watchHandle = watch$1(source, cb, baseWatchOptions);
10103
- if (ssrCleanup) ssrCleanup.push(watchHandle);
10099
+ if (isInSSRComponentSetup) {
10100
+ if (ssrCleanup) {
10101
+ ssrCleanup.push(watchHandle);
10102
+ } else if (runsImmediately) {
10103
+ watchHandle();
10104
+ }
10105
+ }
10104
10106
  return watchHandle;
10105
10107
  }
10106
10108
  function instanceWatch(source, value, options) {
@@ -10135,19 +10137,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
10135
10137
  warn$1(`useModel() called without active instance.`);
10136
10138
  return ref();
10137
10139
  }
10138
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
10140
+ const camelizedName = camelize(name);
10141
+ if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
10139
10142
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10140
10143
  return ref();
10141
10144
  }
10142
- const camelizedName = camelize(name);
10143
10145
  const hyphenatedName = hyphenate(name);
10144
- const modifiers = getModelModifiers(props, name);
10146
+ const modifiers = getModelModifiers(props, camelizedName);
10145
10147
  const res = customRef((track, trigger) => {
10146
10148
  let localValue;
10147
10149
  let prevSetValue = EMPTY_OBJ;
10148
10150
  let prevEmittedValue;
10149
10151
  watchSyncEffect(() => {
10150
- const propValue = props[name];
10152
+ const propValue = props[camelizedName];
10151
10153
  if (hasChanged(localValue, propValue)) {
10152
10154
  localValue = propValue;
10153
10155
  trigger();
@@ -10453,7 +10455,7 @@ function renderComponentRoot(instance) {
10453
10455
  }
10454
10456
  if (extraAttrs.length) {
10455
10457
  warn$1(
10456
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
10458
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
10457
10459
  );
10458
10460
  }
10459
10461
  if (eventAttrs.length) {
@@ -11314,9 +11316,9 @@ function closeBlock() {
11314
11316
  currentBlock = blockStack[blockStack.length - 1] || null;
11315
11317
  }
11316
11318
  let isBlockTreeEnabled = 1;
11317
- function setBlockTracking(value) {
11319
+ function setBlockTracking(value, inVOnce = false) {
11318
11320
  isBlockTreeEnabled += value;
11319
- if (value < 0 && currentBlock) {
11321
+ if (value < 0 && currentBlock && inVOnce) {
11320
11322
  currentBlock.hasOnce = true;
11321
11323
  }
11322
11324
  }
@@ -11871,9 +11873,9 @@ function setupStatefulComponent(instance, isSSR) {
11871
11873
  }
11872
11874
  const { setup } = Component;
11873
11875
  if (setup) {
11876
+ pauseTracking();
11874
11877
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11875
11878
  const reset = setCurrentInstance(instance);
11876
- pauseTracking();
11877
11879
  const setupResult = callWithErrorHandling(
11878
11880
  setup,
11879
11881
  instance,
@@ -11883,10 +11885,13 @@ function setupStatefulComponent(instance, isSSR) {
11883
11885
  setupContext
11884
11886
  ]
11885
11887
  );
11888
+ const isAsyncSetup = isPromise(setupResult);
11886
11889
  resetTracking();
11887
11890
  reset();
11888
- if (isPromise(setupResult)) {
11889
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11891
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11892
+ markAsyncBoundary(instance);
11893
+ }
11894
+ if (isAsyncSetup) {
11890
11895
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11891
11896
  if (isSSR) {
11892
11897
  return setupResult.then((resolvedResult) => {
@@ -11958,7 +11963,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
11958
11963
  }
11959
11964
  if (!instance.render) {
11960
11965
  if (!isSSR && compile$1 && !Component.render) {
11961
- const template = instance.vnode.props && instance.vnode.props["inline-template"] || Component.template || resolveMergedOptions(instance).template;
11966
+ const template = instance.vnode.props && instance.vnode.props["inline-template"] || Component.template || __VUE_OPTIONS_API__ && resolveMergedOptions(instance).template;
11962
11967
  if (template) {
11963
11968
  if (!!(process.env.NODE_ENV !== "production")) {
11964
11969
  startMeasure(instance, `compile`);
@@ -12373,7 +12378,7 @@ function isMemoSame(cached, memo) {
12373
12378
  return true;
12374
12379
  }
12375
12380
 
12376
- const version = "3.5.11";
12381
+ const version = "3.5.13";
12377
12382
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12378
12383
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12379
12384
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -12583,7 +12588,8 @@ function resolveTransitionProps(rawProps) {
12583
12588
  onAppear = onEnter,
12584
12589
  onAppearCancelled = onEnterCancelled
12585
12590
  } = baseProps;
12586
- const finishEnter = (el, isAppear, done) => {
12591
+ const finishEnter = (el, isAppear, done, isCancelled) => {
12592
+ el._enterCancelled = isCancelled;
12587
12593
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
12588
12594
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
12589
12595
  done && done();
@@ -12641,8 +12647,13 @@ function resolveTransitionProps(rawProps) {
12641
12647
  if (legacyClassEnabled && legacyLeaveFromClass) {
12642
12648
  addTransitionClass(el, legacyLeaveFromClass);
12643
12649
  }
12644
- addTransitionClass(el, leaveActiveClass);
12645
- forceReflow();
12650
+ if (!el._enterCancelled) {
12651
+ forceReflow();
12652
+ addTransitionClass(el, leaveActiveClass);
12653
+ } else {
12654
+ addTransitionClass(el, leaveActiveClass);
12655
+ forceReflow();
12656
+ }
12646
12657
  nextFrame(() => {
12647
12658
  if (!el._isLeaving) {
12648
12659
  return;
@@ -12659,11 +12670,11 @@ function resolveTransitionProps(rawProps) {
12659
12670
  callHook(onLeave, [el, resolve]);
12660
12671
  },
12661
12672
  onEnterCancelled(el) {
12662
- finishEnter(el, false);
12673
+ finishEnter(el, false, void 0, true);
12663
12674
  callHook(onEnterCancelled, [el]);
12664
12675
  },
12665
12676
  onAppearCancelled(el) {
12666
- finishEnter(el, true);
12677
+ finishEnter(el, true, void 0, true);
12667
12678
  callHook(onAppearCancelled, [el]);
12668
12679
  },
12669
12680
  onLeaveCancelled(el) {
@@ -12883,10 +12894,11 @@ function useCssVars(getter) {
12883
12894
  }
12884
12895
  updateTeleports(vars);
12885
12896
  };
12886
- onBeforeMount(() => {
12887
- watchPostEffect(setVars);
12897
+ onBeforeUpdate(() => {
12898
+ queuePostFlushCb(setVars);
12888
12899
  });
12889
12900
  onMounted(() => {
12901
+ watch(setVars, NOOP, { flush: "post" });
12890
12902
  const ob = new MutationObserver(setVars);
12891
12903
  ob.observe(instance.subTree.el.parentNode, { childList: true });
12892
12904
  onUnmounted(() => ob.disconnect());
@@ -13078,7 +13090,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
13078
13090
  return false;
13079
13091
  }
13080
13092
 
13081
- function patchDOMProp(el, key, value, parentComponent) {
13093
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
13082
13094
  if (key === "innerHTML" || key === "textContent") {
13083
13095
  if (value != null) {
13084
13096
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -13142,7 +13154,7 @@ function patchDOMProp(el, key, value, parentComponent) {
13142
13154
  );
13143
13155
  }
13144
13156
  }
13145
- needRemove && el.removeAttribute(key);
13157
+ needRemove && el.removeAttribute(attrName || key);
13146
13158
  }
13147
13159
 
13148
13160
  function addEventListener(el, event, handler, options) {
@@ -13252,7 +13264,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13252
13264
  // #11081 force set props for possible async custom element
13253
13265
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13254
13266
  ) {
13255
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13267
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13256
13268
  } else {
13257
13269
  if (key === "true-value") {
13258
13270
  el._trueValue = nextValue;
@@ -13537,6 +13549,8 @@ class VueElement extends BaseClass {
13537
13549
  this._update();
13538
13550
  }
13539
13551
  if (shouldReflect) {
13552
+ const ob = this._ob;
13553
+ ob && ob.disconnect();
13540
13554
  if (val === true) {
13541
13555
  this.setAttribute(hyphenate(key), "");
13542
13556
  } else if (typeof val === "string" || typeof val === "number") {
@@ -13544,6 +13558,7 @@ class VueElement extends BaseClass {
13544
13558
  } else if (!val) {
13545
13559
  this.removeAttribute(hyphenate(key));
13546
13560
  }
13561
+ ob && ob.observe(this, { attributes: true });
13547
13562
  }
13548
13563
  }
13549
13564
  }
@@ -13979,7 +13994,7 @@ const vModelCheckbox = {
13979
13994
  setChecked(el, binding, vnode);
13980
13995
  }
13981
13996
  };
13982
- function setChecked(el, { value }, vnode) {
13997
+ function setChecked(el, { value, oldValue }, vnode) {
13983
13998
  el._modelValue = value;
13984
13999
  let checked;
13985
14000
  if (isArray(value)) {
@@ -13987,6 +14002,7 @@ function setChecked(el, { value }, vnode) {
13987
14002
  } else if (isSet(value)) {
13988
14003
  checked = value.has(vnode.props.value);
13989
14004
  } else {
14005
+ if (value === oldValue) return;
13990
14006
  checked = looseEqual(value, getCheckboxValue(el, true));
13991
14007
  }
13992
14008
  if (el.checked !== checked) {
@@ -14812,12 +14828,13 @@ function createConditionalExpression(test, consequent, alternate, newline = true
14812
14828
  loc: locStub
14813
14829
  };
14814
14830
  }
14815
- function createCacheExpression(index, value, needPauseTracking = false) {
14831
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
14816
14832
  return {
14817
14833
  type: 20,
14818
14834
  index,
14819
14835
  value,
14820
14836
  needPauseTracking,
14837
+ inVOnce,
14821
14838
  needArraySpread: false,
14822
14839
  loc: locStub
14823
14840
  };
@@ -16690,6 +16707,9 @@ function getLoc(start, end) {
16690
16707
  source: end == null ? end : getSlice(start, end)
16691
16708
  };
16692
16709
  }
16710
+ function cloneLoc(loc) {
16711
+ return getLoc(loc.start.offset, loc.end.offset);
16712
+ }
16693
16713
  function setLocEnd(loc, end) {
16694
16714
  loc.end = tokenizer.getPos(end);
16695
16715
  loc.source = getSlice(loc.start.offset, end);
@@ -17199,11 +17219,12 @@ function createTransformContext(root, {
17199
17219
  identifier.hoisted = exp;
17200
17220
  return identifier;
17201
17221
  },
17202
- cache(exp, isVNode = false) {
17222
+ cache(exp, isVNode = false, inVOnce = false) {
17203
17223
  const cacheExp = createCacheExpression(
17204
17224
  context.cached.length,
17205
17225
  exp,
17206
- isVNode
17226
+ isVNode,
17227
+ inVOnce
17207
17228
  );
17208
17229
  context.cached.push(cacheExp);
17209
17230
  return cacheExp;
@@ -17918,7 +17939,9 @@ function genCacheExpression(node, context) {
17918
17939
  push(`_cache[${node.index}] || (`);
17919
17940
  if (needPauseTracking) {
17920
17941
  indent();
17921
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
17942
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
17943
+ if (node.inVOnce) push(`, true`);
17944
+ push(`),`);
17922
17945
  newline();
17923
17946
  push(`(`);
17924
17947
  }
@@ -17975,12 +17998,14 @@ const transformExpression = (node, context) => {
17975
17998
  context
17976
17999
  );
17977
18000
  } else if (node.type === 1) {
18001
+ const memo = findDir(node, "memo");
17978
18002
  for (let i = 0; i < node.props.length; i++) {
17979
18003
  const dir = node.props[i];
17980
18004
  if (dir.type === 7 && dir.name !== "for") {
17981
18005
  const exp = dir.exp;
17982
18006
  const arg = dir.arg;
17983
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
18007
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
18008
+ !(memo && arg && arg.type === 4 && arg.content === "key")) {
17984
18009
  dir.exp = processExpression(
17985
18010
  exp,
17986
18011
  context,
@@ -18051,7 +18076,7 @@ function processIf(node, dir, context, processCodegen) {
18051
18076
  const branch = createIfBranch(node, dir);
18052
18077
  const ifNode = {
18053
18078
  type: 9,
18054
- loc: node.loc,
18079
+ loc: cloneLoc(node.loc),
18055
18080
  branches: [branch]
18056
18081
  };
18057
18082
  context.replaceNode(ifNode);
@@ -18308,10 +18333,11 @@ const transformFor = createStructuralDirectiveTransform(
18308
18333
  const isTemplate = isTemplateNode(node);
18309
18334
  const memo = findDir(node, "memo");
18310
18335
  const keyProp = findProp(node, `key`, false, true);
18311
- if (keyProp && keyProp.type === 7 && !keyProp.exp) {
18336
+ const isDirKey = keyProp && keyProp.type === 7;
18337
+ if (isDirKey && !keyProp.exp) {
18312
18338
  transformBindShorthand(keyProp);
18313
18339
  }
18314
- const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
18340
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
18315
18341
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
18316
18342
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
18317
18343
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
@@ -19550,8 +19576,8 @@ const transformOnce = (node, context) => {
19550
19576
  if (cur.codegenNode) {
19551
19577
  cur.codegenNode = context.cache(
19552
19578
  cur.codegenNode,
19579
+ true,
19553
19580
  true
19554
- /* isVNode */
19555
19581
  );
19556
19582
  }
19557
19583
  };