@vue/runtime-dom 3.5.10 → 3.5.12

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/runtime-dom v3.5.10
2
+ * @vue/runtime-dom v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -557,8 +557,14 @@ class ReactiveEffect {
557
557
  }
558
558
  let batchDepth = 0;
559
559
  let batchedSub;
560
- function batch(sub) {
560
+ let batchedComputed;
561
+ function batch(sub, isComputed = false) {
561
562
  sub.flags |= 8;
563
+ if (isComputed) {
564
+ sub.next = batchedComputed;
565
+ batchedComputed = sub;
566
+ return;
567
+ }
562
568
  sub.next = batchedSub;
563
569
  batchedSub = sub;
564
570
  }
@@ -569,20 +575,22 @@ function endBatch() {
569
575
  if (--batchDepth > 0) {
570
576
  return;
571
577
  }
578
+ if (batchedComputed) {
579
+ let e = batchedComputed;
580
+ batchedComputed = void 0;
581
+ while (e) {
582
+ const next = e.next;
583
+ e.next = void 0;
584
+ e.flags &= ~8;
585
+ e = next;
586
+ }
587
+ }
572
588
  let error;
573
589
  while (batchedSub) {
574
590
  let e = batchedSub;
575
- let next;
576
- while (e) {
577
- if (!(e.flags & 1)) {
578
- e.flags &= ~8;
579
- }
580
- e = e.next;
581
- }
582
- e = batchedSub;
583
591
  batchedSub = void 0;
584
592
  while (e) {
585
- next = e.next;
593
+ const next = e.next;
586
594
  e.next = void 0;
587
595
  e.flags &= ~8;
588
596
  if (e.flags & 1) {
@@ -682,16 +690,16 @@ function removeSub(link, soft = false) {
682
690
  nextSub.prevSub = prevSub;
683
691
  link.nextSub = void 0;
684
692
  }
685
- if (dep.subs === link) {
686
- dep.subs = prevSub;
687
- }
688
693
  if (dep.subsHead === link) {
689
694
  dep.subsHead = nextSub;
690
695
  }
691
- if (!dep.subs && dep.computed) {
692
- dep.computed.flags &= ~4;
693
- for (let l = dep.computed.deps; l; l = l.nextDep) {
694
- removeSub(l, true);
696
+ if (dep.subs === link) {
697
+ dep.subs = prevSub;
698
+ if (!prevSub && dep.computed) {
699
+ dep.computed.flags &= ~4;
700
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
701
+ removeSub(l, true);
702
+ }
695
703
  }
696
704
  }
697
705
  if (!soft && !--dep.sc && dep.map) {
@@ -778,7 +786,6 @@ class Dep {
778
786
  /**
779
787
  * For object property deps cleanup
780
788
  */
781
- this.target = void 0;
782
789
  this.map = void 0;
783
790
  this.key = void 0;
784
791
  /**
@@ -906,7 +913,6 @@ function track(target, type, key) {
906
913
  let dep = depsMap.get(key);
907
914
  if (!dep) {
908
915
  depsMap.set(key, dep = new Dep());
909
- dep.target = target;
910
916
  dep.map = depsMap;
911
917
  dep.key = key;
912
918
  }
@@ -953,7 +959,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
953
959
  }
954
960
  });
955
961
  } else {
956
- if (key !== void 0) {
962
+ if (key !== void 0 || depsMap.has(void 0)) {
957
963
  run(depsMap.get(key));
958
964
  }
959
965
  if (isArrayIndex) {
@@ -1328,117 +1334,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1328
1334
 
1329
1335
  const toShallow = (value) => value;
1330
1336
  const getProto = (v) => Reflect.getPrototypeOf(v);
1331
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1332
- target = target["__v_raw"];
1333
- const rawTarget = toRaw(target);
1334
- const rawKey = toRaw(key);
1335
- if (!isReadonly2) {
1336
- if (hasChanged(key, rawKey)) {
1337
- track(rawTarget, "get", key);
1338
- }
1339
- track(rawTarget, "get", rawKey);
1340
- }
1341
- const { has: has2 } = getProto(rawTarget);
1342
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1343
- if (has2.call(rawTarget, key)) {
1344
- return wrap(target.get(key));
1345
- } else if (has2.call(rawTarget, rawKey)) {
1346
- return wrap(target.get(rawKey));
1347
- } else if (target !== rawTarget) {
1348
- target.get(key);
1349
- }
1350
- }
1351
- function has(key, isReadonly2 = false) {
1352
- const target = this["__v_raw"];
1353
- const rawTarget = toRaw(target);
1354
- const rawKey = toRaw(key);
1355
- if (!isReadonly2) {
1356
- if (hasChanged(key, rawKey)) {
1357
- track(rawTarget, "has", key);
1358
- }
1359
- track(rawTarget, "has", rawKey);
1360
- }
1361
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1362
- }
1363
- function size(target, isReadonly2 = false) {
1364
- target = target["__v_raw"];
1365
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1366
- return Reflect.get(target, "size", target);
1367
- }
1368
- function add(value, _isShallow = false) {
1369
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1370
- value = toRaw(value);
1371
- }
1372
- const target = toRaw(this);
1373
- const proto = getProto(target);
1374
- const hadKey = proto.has.call(target, value);
1375
- if (!hadKey) {
1376
- target.add(value);
1377
- trigger(target, "add", value, value);
1378
- }
1379
- return this;
1380
- }
1381
- function set(key, value, _isShallow = false) {
1382
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1383
- value = toRaw(value);
1384
- }
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
- } else {
1392
- checkIdentityKeys(target, has2, key);
1393
- }
1394
- const oldValue = get2.call(target, key);
1395
- target.set(key, value);
1396
- if (!hadKey) {
1397
- trigger(target, "add", key, value);
1398
- } else if (hasChanged(value, oldValue)) {
1399
- trigger(target, "set", key, value, oldValue);
1400
- }
1401
- return this;
1402
- }
1403
- function deleteEntry(key) {
1404
- const target = toRaw(this);
1405
- const { has: has2, get: get2 } = getProto(target);
1406
- let hadKey = has2.call(target, key);
1407
- if (!hadKey) {
1408
- key = toRaw(key);
1409
- hadKey = has2.call(target, key);
1410
- } else {
1411
- checkIdentityKeys(target, has2, key);
1412
- }
1413
- const oldValue = get2 ? get2.call(target, key) : void 0;
1414
- const result = target.delete(key);
1415
- if (hadKey) {
1416
- trigger(target, "delete", key, void 0, oldValue);
1417
- }
1418
- return result;
1419
- }
1420
- function clear() {
1421
- const target = toRaw(this);
1422
- const hadItems = target.size !== 0;
1423
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1424
- const result = target.clear();
1425
- if (hadItems) {
1426
- trigger(target, "clear", void 0, void 0, oldTarget);
1427
- }
1428
- return result;
1429
- }
1430
- function createForEach(isReadonly2, isShallow2) {
1431
- return function forEach(callback, thisArg) {
1432
- const observed = this;
1433
- const target = observed["__v_raw"];
1434
- const rawTarget = toRaw(target);
1435
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1436
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1437
- return target.forEach((value, key) => {
1438
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1439
- });
1440
- };
1441
- }
1442
1337
  function createIterableMethod(method, isReadonly2, isShallow2) {
1443
1338
  return function(...args) {
1444
1339
  const target = this["__v_raw"];
@@ -1481,71 +1376,134 @@ function createReadonlyMethod(type) {
1481
1376
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1482
1377
  };
1483
1378
  }
1484
- function createInstrumentations() {
1485
- const mutableInstrumentations2 = {
1486
- get(key) {
1487
- return get(this, key);
1488
- },
1489
- get size() {
1490
- return size(this);
1491
- },
1492
- has,
1493
- add,
1494
- set,
1495
- delete: deleteEntry,
1496
- clear,
1497
- forEach: createForEach(false, false)
1498
- };
1499
- const shallowInstrumentations2 = {
1500
- get(key) {
1501
- return get(this, key, false, true);
1502
- },
1503
- get size() {
1504
- return size(this);
1505
- },
1506
- has,
1507
- add(value) {
1508
- return add.call(this, value, true);
1509
- },
1510
- set(key, value) {
1511
- return set.call(this, key, value, true);
1512
- },
1513
- delete: deleteEntry,
1514
- clear,
1515
- forEach: createForEach(false, true)
1516
- };
1517
- const readonlyInstrumentations2 = {
1379
+ function createInstrumentations(readonly, shallow) {
1380
+ const instrumentations = {
1518
1381
  get(key) {
1519
- return get(this, key, true);
1520
- },
1521
- get size() {
1522
- return size(this, true);
1523
- },
1524
- has(key) {
1525
- return has.call(this, key, true);
1526
- },
1527
- add: createReadonlyMethod("add"),
1528
- set: createReadonlyMethod("set"),
1529
- delete: createReadonlyMethod("delete"),
1530
- clear: createReadonlyMethod("clear"),
1531
- forEach: createForEach(true, false)
1532
- };
1533
- const shallowReadonlyInstrumentations2 = {
1534
- get(key) {
1535
- return get(this, key, true, true);
1382
+ const target = this["__v_raw"];
1383
+ const rawTarget = toRaw(target);
1384
+ const rawKey = toRaw(key);
1385
+ if (!readonly) {
1386
+ if (hasChanged(key, rawKey)) {
1387
+ track(rawTarget, "get", key);
1388
+ }
1389
+ track(rawTarget, "get", rawKey);
1390
+ }
1391
+ const { has } = getProto(rawTarget);
1392
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1393
+ if (has.call(rawTarget, key)) {
1394
+ return wrap(target.get(key));
1395
+ } else if (has.call(rawTarget, rawKey)) {
1396
+ return wrap(target.get(rawKey));
1397
+ } else if (target !== rawTarget) {
1398
+ target.get(key);
1399
+ }
1536
1400
  },
1537
1401
  get size() {
1538
- return size(this, true);
1402
+ const target = this["__v_raw"];
1403
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1404
+ return Reflect.get(target, "size", target);
1539
1405
  },
1540
1406
  has(key) {
1541
- return has.call(this, key, true);
1407
+ const target = this["__v_raw"];
1408
+ const rawTarget = toRaw(target);
1409
+ const rawKey = toRaw(key);
1410
+ if (!readonly) {
1411
+ if (hasChanged(key, rawKey)) {
1412
+ track(rawTarget, "has", key);
1413
+ }
1414
+ track(rawTarget, "has", rawKey);
1415
+ }
1416
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1542
1417
  },
1543
- add: createReadonlyMethod("add"),
1544
- set: createReadonlyMethod("set"),
1545
- delete: createReadonlyMethod("delete"),
1546
- clear: createReadonlyMethod("clear"),
1547
- forEach: createForEach(true, true)
1418
+ forEach(callback, thisArg) {
1419
+ const observed = this;
1420
+ const target = observed["__v_raw"];
1421
+ const rawTarget = toRaw(target);
1422
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1423
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1424
+ return target.forEach((value, key) => {
1425
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1426
+ });
1427
+ }
1548
1428
  };
1429
+ extend(
1430
+ instrumentations,
1431
+ readonly ? {
1432
+ add: createReadonlyMethod("add"),
1433
+ set: createReadonlyMethod("set"),
1434
+ delete: createReadonlyMethod("delete"),
1435
+ clear: createReadonlyMethod("clear")
1436
+ } : {
1437
+ add(value) {
1438
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1439
+ value = toRaw(value);
1440
+ }
1441
+ const target = toRaw(this);
1442
+ const proto = getProto(target);
1443
+ const hadKey = proto.has.call(target, value);
1444
+ if (!hadKey) {
1445
+ target.add(value);
1446
+ trigger(target, "add", value, value);
1447
+ }
1448
+ return this;
1449
+ },
1450
+ set(key, value) {
1451
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1452
+ value = toRaw(value);
1453
+ }
1454
+ const target = toRaw(this);
1455
+ const { has, get } = getProto(target);
1456
+ let hadKey = has.call(target, key);
1457
+ if (!hadKey) {
1458
+ key = toRaw(key);
1459
+ hadKey = has.call(target, key);
1460
+ } else {
1461
+ checkIdentityKeys(target, has, key);
1462
+ }
1463
+ const oldValue = get.call(target, key);
1464
+ target.set(key, value);
1465
+ if (!hadKey) {
1466
+ trigger(target, "add", key, value);
1467
+ } else if (hasChanged(value, oldValue)) {
1468
+ trigger(target, "set", key, value, oldValue);
1469
+ }
1470
+ return this;
1471
+ },
1472
+ delete(key) {
1473
+ const target = toRaw(this);
1474
+ const { has, get } = getProto(target);
1475
+ let hadKey = has.call(target, key);
1476
+ if (!hadKey) {
1477
+ key = toRaw(key);
1478
+ hadKey = has.call(target, key);
1479
+ } else {
1480
+ checkIdentityKeys(target, has, key);
1481
+ }
1482
+ const oldValue = get ? get.call(target, key) : void 0;
1483
+ const result = target.delete(key);
1484
+ if (hadKey) {
1485
+ trigger(target, "delete", key, void 0, oldValue);
1486
+ }
1487
+ return result;
1488
+ },
1489
+ clear() {
1490
+ const target = toRaw(this);
1491
+ const hadItems = target.size !== 0;
1492
+ const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1493
+ const result = target.clear();
1494
+ if (hadItems) {
1495
+ trigger(
1496
+ target,
1497
+ "clear",
1498
+ void 0,
1499
+ void 0,
1500
+ oldTarget
1501
+ );
1502
+ }
1503
+ return result;
1504
+ }
1505
+ }
1506
+ );
1549
1507
  const iteratorMethods = [
1550
1508
  "keys",
1551
1509
  "values",
@@ -1553,30 +1511,12 @@ function createInstrumentations() {
1553
1511
  Symbol.iterator
1554
1512
  ];
1555
1513
  iteratorMethods.forEach((method) => {
1556
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1557
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1558
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1559
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1560
- method,
1561
- true,
1562
- true
1563
- );
1514
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1564
1515
  });
1565
- return [
1566
- mutableInstrumentations2,
1567
- readonlyInstrumentations2,
1568
- shallowInstrumentations2,
1569
- shallowReadonlyInstrumentations2
1570
- ];
1516
+ return instrumentations;
1571
1517
  }
1572
- const [
1573
- mutableInstrumentations,
1574
- readonlyInstrumentations,
1575
- shallowInstrumentations,
1576
- shallowReadonlyInstrumentations
1577
- ] = /* @__PURE__ */ createInstrumentations();
1578
1518
  function createInstrumentationGetter(isReadonly2, shallow) {
1579
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1519
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1580
1520
  return (target, key, receiver) => {
1581
1521
  if (key === "__v_isReactive") {
1582
1522
  return !isReadonly2;
@@ -1604,9 +1544,9 @@ const readonlyCollectionHandlers = {
1604
1544
  const shallowReadonlyCollectionHandlers = {
1605
1545
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1606
1546
  };
1607
- function checkIdentityKeys(target, has2, key) {
1547
+ function checkIdentityKeys(target, has, key) {
1608
1548
  const rawKey = toRaw(key);
1609
- if (rawKey !== key && has2.call(target, rawKey)) {
1549
+ if (rawKey !== key && has.call(target, rawKey)) {
1610
1550
  const type = toRawType(target);
1611
1551
  warn$2(
1612
1552
  `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.`
@@ -1942,7 +1882,7 @@ class ComputedRefImpl {
1942
1882
  this.flags |= 16;
1943
1883
  if (!(this.flags & 8) && // avoid infinite self recursion
1944
1884
  activeSub !== this) {
1945
- batch(this);
1885
+ batch(this, true);
1946
1886
  return true;
1947
1887
  }
1948
1888
  }
@@ -2464,10 +2404,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
2464
2404
  }
2465
2405
  }
2466
2406
 
2467
- let isFlushing = false;
2468
- let isFlushPending = false;
2469
2407
  const queue = [];
2470
- let flushIndex = 0;
2408
+ let flushIndex = -1;
2471
2409
  const pendingPostFlushCbs = [];
2472
2410
  let activePostFlushCbs = null;
2473
2411
  let postFlushIndex = 0;
@@ -2479,7 +2417,7 @@ function nextTick(fn) {
2479
2417
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2480
2418
  }
2481
2419
  function findInsertionIndex(id) {
2482
- let start = isFlushing ? flushIndex + 1 : 0;
2420
+ let start = flushIndex + 1;
2483
2421
  let end = queue.length;
2484
2422
  while (start < end) {
2485
2423
  const middle = start + end >>> 1;
@@ -2508,8 +2446,7 @@ function queueJob(job) {
2508
2446
  }
2509
2447
  }
2510
2448
  function queueFlush() {
2511
- if (!isFlushing && !isFlushPending) {
2512
- isFlushPending = true;
2449
+ if (!currentFlushPromise) {
2513
2450
  currentFlushPromise = resolvedPromise.then(flushJobs);
2514
2451
  }
2515
2452
  }
@@ -2526,7 +2463,7 @@ function queuePostFlushCb(cb) {
2526
2463
  }
2527
2464
  queueFlush();
2528
2465
  }
2529
- function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2466
+ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2530
2467
  {
2531
2468
  seen = seen || /* @__PURE__ */ new Map();
2532
2469
  }
@@ -2582,8 +2519,6 @@ function flushPostFlushCbs(seen) {
2582
2519
  }
2583
2520
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2584
2521
  function flushJobs(seen) {
2585
- isFlushPending = false;
2586
- isFlushing = true;
2587
2522
  {
2588
2523
  seen = seen || /* @__PURE__ */ new Map();
2589
2524
  }
@@ -2615,10 +2550,9 @@ function flushJobs(seen) {
2615
2550
  job.flags &= ~1;
2616
2551
  }
2617
2552
  }
2618
- flushIndex = 0;
2553
+ flushIndex = -1;
2619
2554
  queue.length = 0;
2620
2555
  flushPostFlushCbs(seen);
2621
- isFlushing = false;
2622
2556
  currentFlushPromise = null;
2623
2557
  if (queue.length || pendingPostFlushCbs.length) {
2624
2558
  flushJobs(seen);
@@ -3038,7 +2972,7 @@ const TeleportImpl = {
3038
2972
  }
3039
2973
  if (!disabled) {
3040
2974
  mount(target, targetAnchor);
3041
- updateCssVars(n2);
2975
+ updateCssVars(n2, false);
3042
2976
  }
3043
2977
  } else if (!disabled) {
3044
2978
  warn$1(
@@ -3050,7 +2984,7 @@ const TeleportImpl = {
3050
2984
  };
3051
2985
  if (disabled) {
3052
2986
  mount(container, mainAnchor);
3053
- updateCssVars(n2);
2987
+ updateCssVars(n2, true);
3054
2988
  }
3055
2989
  if (isTeleportDeferred(n2.props)) {
3056
2990
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3140,7 +3074,7 @@ const TeleportImpl = {
3140
3074
  );
3141
3075
  }
3142
3076
  }
3143
- updateCssVars(n2);
3077
+ updateCssVars(n2, disabled);
3144
3078
  }
3145
3079
  },
3146
3080
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3208,9 +3142,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3208
3142
  querySelector
3209
3143
  );
3210
3144
  if (target) {
3145
+ const disabled = isTeleportDisabled(vnode.props);
3211
3146
  const targetNode = target._lpa || target.firstChild;
3212
3147
  if (vnode.shapeFlag & 16) {
3213
- if (isTeleportDisabled(vnode.props)) {
3148
+ if (disabled) {
3214
3149
  vnode.anchor = hydrateChildren(
3215
3150
  nextSibling(node),
3216
3151
  vnode,
@@ -3251,16 +3186,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3251
3186
  );
3252
3187
  }
3253
3188
  }
3254
- updateCssVars(vnode);
3189
+ updateCssVars(vnode, disabled);
3255
3190
  }
3256
3191
  return vnode.anchor && nextSibling(vnode.anchor);
3257
3192
  }
3258
3193
  const Teleport = TeleportImpl;
3259
- function updateCssVars(vnode) {
3194
+ function updateCssVars(vnode, isDisabled) {
3260
3195
  const ctx = vnode.ctx;
3261
3196
  if (ctx && ctx.ut) {
3262
- let node = vnode.targetStart;
3263
- while (node && node !== vnode.targetAnchor) {
3197
+ let node, anchor;
3198
+ if (isDisabled) {
3199
+ node = vnode.el;
3200
+ anchor = vnode.anchor;
3201
+ } else {
3202
+ node = vnode.targetStart;
3203
+ anchor = vnode.targetAnchor;
3204
+ }
3205
+ while (node && node !== anchor) {
3264
3206
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3265
3207
  node = node.nextSibling;
3266
3208
  }
@@ -3710,8 +3652,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3710
3652
  const setupState = owner.setupState;
3711
3653
  const rawSetupState = toRaw(setupState);
3712
3654
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3713
- if (knownTemplateRefs.has(rawSetupState[key])) {
3714
- return false;
3655
+ {
3656
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3657
+ warn$1(
3658
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
3659
+ );
3660
+ }
3661
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3662
+ return false;
3663
+ }
3715
3664
  }
3716
3665
  return hasOwn(rawSetupState, key);
3717
3666
  };
@@ -4008,7 +3957,11 @@ function createHydrationFunctions(rendererInternals) {
4008
3957
  }
4009
3958
  let needCallTransitionHooks = false;
4010
3959
  if (isTemplateNode(el)) {
4011
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3960
+ needCallTransitionHooks = needTransition(
3961
+ null,
3962
+ // no need check parentSuspense in hydration
3963
+ transition
3964
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4012
3965
  const content = el.content.firstChild;
4013
3966
  if (needCallTransitionHooks) {
4014
3967
  transition.beforeEnter(content);
@@ -4401,6 +4354,8 @@ function isMismatchAllowed(el, allowedType) {
4401
4354
  }
4402
4355
  }
4403
4356
 
4357
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4358
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
4404
4359
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
4405
4360
  const id = requestIdleCallback(hydrate, { timeout });
4406
4361
  return () => cancelIdleCallback(id);
@@ -5103,12 +5058,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5103
5058
  }
5104
5059
  openBlock();
5105
5060
  const validSlotContent = slot && ensureValidVNode(slot(props));
5061
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5062
+ // key attached in the `createSlots` helper, respect that
5063
+ validSlotContent && validSlotContent.key;
5106
5064
  const rendered = createBlock(
5107
5065
  Fragment,
5108
5066
  {
5109
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
5110
- // key attached in the `createSlots` helper, respect that
5111
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5067
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5112
5068
  (!validSlotContent && fallback ? "_fb" : "")
5113
5069
  },
5114
5070
  validSlotContent || (fallback ? fallback() : []),
@@ -6466,6 +6422,7 @@ function getType(ctor) {
6466
6422
  function validateProps(rawProps, props, instance) {
6467
6423
  const resolvedValues = toRaw(props);
6468
6424
  const options = instance.propsOptions[0];
6425
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
6469
6426
  for (const key in options) {
6470
6427
  let opt = options[key];
6471
6428
  if (opt == null) continue;
@@ -6474,7 +6431,7 @@ function validateProps(rawProps, props, instance) {
6474
6431
  resolvedValues[key],
6475
6432
  opt,
6476
6433
  shallowReadonly(resolvedValues) ,
6477
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
6434
+ !camelizePropsKey.includes(key)
6478
6435
  );
6479
6436
  }
6480
6437
  }
@@ -8254,14 +8211,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
8254
8211
  }
8255
8212
  const baseWatchOptions = extend({}, options);
8256
8213
  baseWatchOptions.onWarn = warn$1;
8214
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
8257
8215
  let ssrCleanup;
8258
8216
  if (isInSSRComponentSetup) {
8259
8217
  if (flush === "sync") {
8260
8218
  const ctx = useSSRContext();
8261
8219
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
8262
- } else if (!cb || immediate) {
8263
- baseWatchOptions.once = true;
8264
- } else {
8220
+ } else if (!runsImmediately) {
8265
8221
  const watchStopHandle = () => {
8266
8222
  };
8267
8223
  watchStopHandle.stop = NOOP;
@@ -8300,7 +8256,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
8300
8256
  }
8301
8257
  };
8302
8258
  const watchHandle = watch$1(source, cb, baseWatchOptions);
8303
- if (ssrCleanup) ssrCleanup.push(watchHandle);
8259
+ if (isInSSRComponentSetup) {
8260
+ if (ssrCleanup) {
8261
+ ssrCleanup.push(watchHandle);
8262
+ } else if (runsImmediately) {
8263
+ watchHandle();
8264
+ }
8265
+ }
8304
8266
  return watchHandle;
8305
8267
  }
8306
8268
  function instanceWatch(source, value, options) {
@@ -8335,19 +8297,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
8335
8297
  warn$1(`useModel() called without active instance.`);
8336
8298
  return ref();
8337
8299
  }
8338
- if (!i.propsOptions[0][name]) {
8300
+ const camelizedName = camelize(name);
8301
+ if (!i.propsOptions[0][camelizedName]) {
8339
8302
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
8340
8303
  return ref();
8341
8304
  }
8342
- const camelizedName = camelize(name);
8343
8305
  const hyphenatedName = hyphenate(name);
8344
- const modifiers = getModelModifiers(props, name);
8306
+ const modifiers = getModelModifiers(props, camelizedName);
8345
8307
  const res = customRef((track, trigger) => {
8346
8308
  let localValue;
8347
8309
  let prevSetValue = EMPTY_OBJ;
8348
8310
  let prevEmittedValue;
8349
8311
  watchSyncEffect(() => {
8350
- const propValue = props[name];
8312
+ const propValue = props[camelizedName];
8351
8313
  if (hasChanged(localValue, propValue)) {
8352
8314
  localValue = propValue;
8353
8315
  trigger();
@@ -9974,9 +9936,9 @@ function setupStatefulComponent(instance, isSSR) {
9974
9936
  }
9975
9937
  const { setup } = Component;
9976
9938
  if (setup) {
9939
+ pauseTracking();
9977
9940
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
9978
9941
  const reset = setCurrentInstance(instance);
9979
- pauseTracking();
9980
9942
  const setupResult = callWithErrorHandling(
9981
9943
  setup,
9982
9944
  instance,
@@ -9986,10 +9948,13 @@ function setupStatefulComponent(instance, isSSR) {
9986
9948
  setupContext
9987
9949
  ]
9988
9950
  );
9951
+ const isAsyncSetup = isPromise(setupResult);
9989
9952
  resetTracking();
9990
9953
  reset();
9991
- if (isPromise(setupResult)) {
9992
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
9954
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
9955
+ markAsyncBoundary(instance);
9956
+ }
9957
+ if (isAsyncSetup) {
9993
9958
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9994
9959
  if (isSSR) {
9995
9960
  return setupResult.then((resolvedResult) => {
@@ -10452,7 +10417,7 @@ function isMemoSame(cached, memo) {
10452
10417
  return true;
10453
10418
  }
10454
10419
 
10455
- const version = "3.5.10";
10420
+ const version = "3.5.12";
10456
10421
  const warn = warn$1 ;
10457
10422
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10458
10423
  const devtools = devtools$1 ;
@@ -11085,7 +11050,7 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBoolean
11085
11050
  }
11086
11051
  }
11087
11052
 
11088
- function patchDOMProp(el, key, value, parentComponent) {
11053
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
11089
11054
  if (key === "innerHTML" || key === "textContent") {
11090
11055
  if (value != null) {
11091
11056
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -11133,7 +11098,7 @@ function patchDOMProp(el, key, value, parentComponent) {
11133
11098
  );
11134
11099
  }
11135
11100
  }
11136
- needRemove && el.removeAttribute(key);
11101
+ needRemove && el.removeAttribute(attrName || key);
11137
11102
  }
11138
11103
 
11139
11104
  function addEventListener(el, event, handler, options) {
@@ -11243,7 +11208,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
11243
11208
  // #11081 force set props for possible async custom element
11244
11209
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
11245
11210
  ) {
11246
- patchDOMProp(el, camelize(key), nextValue);
11211
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
11247
11212
  } else {
11248
11213
  if (key === "true-value") {
11249
11214
  el._trueValue = nextValue;
@@ -11961,7 +11926,7 @@ const vModelCheckbox = {
11961
11926
  setChecked(el, binding, vnode);
11962
11927
  }
11963
11928
  };
11964
- function setChecked(el, { value }, vnode) {
11929
+ function setChecked(el, { value, oldValue }, vnode) {
11965
11930
  el._modelValue = value;
11966
11931
  let checked;
11967
11932
  if (isArray(value)) {
@@ -11969,6 +11934,7 @@ function setChecked(el, { value }, vnode) {
11969
11934
  } else if (isSet(value)) {
11970
11935
  checked = value.has(vnode.props.value);
11971
11936
  } else {
11937
+ if (value === oldValue) return;
11972
11938
  checked = looseEqual(value, getCheckboxValue(el, true));
11973
11939
  }
11974
11940
  if (el.checked !== checked) {