vue 3.5.42 → 3.5.44

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 v3.5.42
2
+ * vue v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -199,10 +199,10 @@ function normalizeStyle(value) {
199
199
  }
200
200
  const listDelimiterRE = /;(?![^(]*\))/g;
201
201
  const propertyDelimiterRE = /:([^]+)/;
202
- const styleCommentRE = /\/\*[^]*?\*\//g;
202
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
203
203
  function parseStringStyle(cssText) {
204
204
  const ret = {};
205
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
205
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
206
206
  if (item) {
207
207
  const tmp = item.split(propertyDelimiterRE);
208
208
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -264,7 +264,7 @@ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
264
264
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
265
265
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
266
266
 
267
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
267
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
268
268
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
269
269
  const isBooleanAttr = /* @__PURE__ */ makeMap(
270
270
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -294,22 +294,22 @@ function getEscapedCssVarName(key, doubleEscape) {
294
294
  );
295
295
  }
296
296
 
297
- function looseCompareArrays(a, b) {
297
+ function looseCompareArrays(a, b, seen) {
298
298
  if (a.length !== b.length) return false;
299
299
  let equal = true;
300
300
  for (let i = 0; equal && i < a.length; i++) {
301
- equal = looseEqual(a[i], b[i]);
301
+ equal = looseEqual(a[i], b[i], seen);
302
302
  }
303
303
  return equal;
304
304
  }
305
- function looseCompareCollections(a, b) {
305
+ function looseCompareCollections(a, b, seen) {
306
306
  if (a.size !== b.size) return false;
307
307
  const candidates = Array.from(b);
308
308
  const matched = new Uint8Array(candidates.length);
309
309
  for (const item of a) {
310
310
  let index = -1;
311
311
  for (let i = 0; i < candidates.length; i++) {
312
- if (!matched[i] && looseEqual(item, candidates[i])) {
312
+ if (!matched[i] && looseEqual(item, candidates[i], seen)) {
313
313
  index = i;
314
314
  break;
315
315
  }
@@ -319,7 +319,47 @@ function looseCompareCollections(a, b) {
319
319
  }
320
320
  return true;
321
321
  }
322
- function looseEqual(a, b) {
322
+ function looseCompareObjects(a, b, seen) {
323
+ let aValidType = isMap(a);
324
+ let bValidType = isMap(b);
325
+ if (aValidType || bValidType) {
326
+ return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
327
+ }
328
+ aValidType = isSet(a);
329
+ bValidType = isSet(b);
330
+ if (aValidType || bValidType) {
331
+ return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
332
+ }
333
+ const aKeysCount = Object.keys(a).length;
334
+ const bKeysCount = Object.keys(b).length;
335
+ if (aKeysCount !== bKeysCount) {
336
+ return false;
337
+ }
338
+ for (const key in a) {
339
+ const aHasKey = a.hasOwnProperty(key);
340
+ const bHasKey = b.hasOwnProperty(key);
341
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) {
342
+ return false;
343
+ }
344
+ }
345
+ return String(a) === String(b);
346
+ }
347
+ function looseCompareNested(a, b, seen, compare) {
348
+ if (!seen) {
349
+ seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
350
+ }
351
+ const [seenA, seenB] = seen;
352
+ if (seenA.has(a) || seenB.has(b)) {
353
+ return seenA.get(a) === b && seenB.get(b) === a;
354
+ }
355
+ seenA.set(a, b);
356
+ seenB.set(b, a);
357
+ const equal = compare(a, b, seen);
358
+ seenA.delete(a);
359
+ seenB.delete(b);
360
+ return equal;
361
+ }
362
+ function looseEqual(a, b, seen) {
323
363
  if (a === b) return true;
324
364
  let aValidType = isDate(a);
325
365
  let bValidType = isDate(b);
@@ -334,7 +374,7 @@ function looseEqual(a, b) {
334
374
  aValidType = isArray(a);
335
375
  bValidType = isArray(b);
336
376
  if (aValidType || bValidType) {
337
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
377
+ return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
338
378
  }
339
379
  aValidType = isObject(a);
340
380
  bValidType = isObject(b);
@@ -342,28 +382,7 @@ function looseEqual(a, b) {
342
382
  if (!aValidType || !bValidType) {
343
383
  return false;
344
384
  }
345
- aValidType = isMap(a);
346
- bValidType = isMap(b);
347
- if (aValidType || bValidType) {
348
- return aValidType && bValidType ? looseCompareCollections(a, b) : false;
349
- }
350
- aValidType = isSet(a);
351
- bValidType = isSet(b);
352
- if (aValidType || bValidType) {
353
- return aValidType && bValidType ? looseCompareCollections(a, b) : false;
354
- }
355
- const aKeysCount = Object.keys(a).length;
356
- const bKeysCount = Object.keys(b).length;
357
- if (aKeysCount !== bKeysCount) {
358
- return false;
359
- }
360
- for (const key in a) {
361
- const aHasKey = a.hasOwnProperty(key);
362
- const bHasKey = b.hasOwnProperty(key);
363
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
364
- return false;
365
- }
366
- }
385
+ return looseCompareNested(a, b, seen, looseCompareObjects);
367
386
  }
368
387
  return String(a) === String(b);
369
388
  }
@@ -1164,7 +1183,9 @@ function reactiveReadArray(array) {
1164
1183
  const raw = toRaw(array);
1165
1184
  if (raw === array) return raw;
1166
1185
  track(raw, "iterate", ARRAY_ITERATE_KEY);
1167
- return isShallow(array) ? raw : raw.map(toReactive);
1186
+ if (isShallow(array)) return raw;
1187
+ if (!isReadonly(array)) return raw.map(toReactive);
1188
+ return isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
1168
1189
  }
1169
1190
  function shallowReadArray(arr) {
1170
1191
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
@@ -1291,19 +1312,41 @@ const arrayInstrumentations = {
1291
1312
  };
1292
1313
  function iterator(self, method, wrapValue) {
1293
1314
  const arr = shallowReadArray(self);
1294
- const iter = arr[method]();
1315
+ const methodFn = arr[method];
1316
+ const iter = methodFn.call(arr);
1295
1317
  if (arr !== self && !isShallow(self)) {
1296
- iter._next = iter.next;
1297
- iter.next = () => {
1298
- const result = iter._next();
1299
- if (!result.done) {
1300
- result.value = wrapValue(result.value);
1318
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
1319
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
1320
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
1321
+ if (methodFn !== arrayProto[method]) {
1322
+ Object.defineProperties(wrapped, {
1323
+ return: {
1324
+ get() {
1325
+ const fn = iter.return;
1326
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1327
+ }
1328
+ },
1329
+ throw: {
1330
+ get() {
1331
+ const fn = iter.throw;
1332
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1333
+ }
1334
+ }
1335
+ });
1301
1336
  }
1302
- return result;
1303
- };
1337
+ return wrapped;
1338
+ }
1339
+ iter._next = iter.next;
1340
+ iter.next = () => wrapResult(iter._next(), wrapValue);
1304
1341
  }
1305
1342
  return iter;
1306
1343
  }
1344
+ function wrapResult(result, wrapValue) {
1345
+ if (!result.done) {
1346
+ result.value = wrapValue(result.value);
1347
+ }
1348
+ return result;
1349
+ }
1307
1350
  const arrayProto = Array.prototype;
1308
1351
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1309
1352
  const arr = shallowReadArray(self);
@@ -1726,6 +1769,8 @@ function createInstrumentationGetter(isReadonly2, shallow) {
1726
1769
  return !isReadonly2;
1727
1770
  } else if (key === "__v_isReadonly") {
1728
1771
  return isReadonly2;
1772
+ } else if (key === "__v_isShallow") {
1773
+ return shallow;
1729
1774
  } else if (key === "__v_raw") {
1730
1775
  return target;
1731
1776
  }
@@ -2271,9 +2316,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2271
2316
  if (once && cb) {
2272
2317
  const _cb = cb;
2273
2318
  cb = (...args) => {
2274
- const res = _cb(...args);
2275
- watchHandle();
2276
- return res;
2319
+ try {
2320
+ return _cb(...args);
2321
+ } finally {
2322
+ watchHandle();
2323
+ }
2277
2324
  };
2278
2325
  }
2279
2326
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2284,12 +2331,13 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2284
2331
  if (cb) {
2285
2332
  const newValue = effect.run();
2286
2333
  if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2287
- if (cleanup) {
2288
- cleanup();
2289
- }
2290
2334
  const currentWatcher = activeWatcher;
2291
- activeWatcher = effect;
2335
+ pauseTracking();
2292
2336
  try {
2337
+ if (cleanup) {
2338
+ cleanup();
2339
+ }
2340
+ activeWatcher = effect;
2293
2341
  const args = [
2294
2342
  newValue,
2295
2343
  // pass undefined as the old value when it's changed for the first time
@@ -2303,6 +2351,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2303
2351
  );
2304
2352
  } finally {
2305
2353
  activeWatcher = currentWatcher;
2354
+ resetTracking();
2306
2355
  }
2307
2356
  }
2308
2357
  } else {
@@ -2703,21 +2752,21 @@ function queuePostFlushCb(cb) {
2703
2752
  }
2704
2753
  queueFlush();
2705
2754
  }
2706
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2755
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
2707
2756
  {
2708
2757
  seen = seen || /* @__PURE__ */ new Map();
2709
2758
  }
2710
2759
  for (; i < queue.length; i++) {
2711
2760
  const cb = queue[i];
2712
2761
  if (cb && cb.flags & 2) {
2713
- if (instance && cb.id !== instance.uid) {
2762
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
2714
2763
  continue;
2715
2764
  }
2716
2765
  if (checkRecursiveUpdates(seen, cb)) {
2717
2766
  continue;
2718
2767
  }
2719
2768
  queue.splice(i, 1);
2720
- i--;
2769
+ i = instance ? i - 1 : flushIndex;
2721
2770
  if (cb.flags & 4) {
2722
2771
  cb.flags &= -2;
2723
2772
  }
@@ -2728,12 +2777,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2728
2777
  }
2729
2778
  }
2730
2779
  }
2731
- function flushPostFlushCbs(seen) {
2780
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2732
2781
  if (pendingPostFlushCbs.length) {
2733
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
2734
- (a, b) => getId(a) - getId(b)
2735
- );
2736
- pendingPostFlushCbs.length = 0;
2782
+ let cbs = pendingPostFlushCbs;
2783
+ let kept = 0;
2784
+ if (skip) {
2785
+ cbs = [];
2786
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
2787
+ const cb = pendingPostFlushCbs[i];
2788
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
2789
+ pendingPostFlushCbs[kept++] = cb;
2790
+ } else {
2791
+ cbs.push(cb);
2792
+ }
2793
+ }
2794
+ }
2795
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
2796
+ pendingPostFlushCbs.length = kept;
2737
2797
  if (activePostFlushCbs) {
2738
2798
  for (let i = 0; i < deduped.length; i++) {
2739
2799
  activePostFlushCbs.push(deduped[i]);
@@ -2759,6 +2819,22 @@ function flushPostFlushCbs(seen) {
2759
2819
  postFlushIndex = 0;
2760
2820
  }
2761
2821
  }
2822
+ let isFlushing = false;
2823
+ function flushOnAppMount(fn, minUid) {
2824
+ if (isFlushing) {
2825
+ fn();
2826
+ return;
2827
+ }
2828
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
2829
+ fn();
2830
+ isFlushing = true;
2831
+ try {
2832
+ flushPreFlushCbs(void 0, minUid);
2833
+ flushPostFlushCbs(void 0, queued, minUid);
2834
+ } finally {
2835
+ isFlushing = false;
2836
+ }
2837
+ }
2762
2838
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2763
2839
  function flushJobs(seen) {
2764
2840
  {
@@ -3260,6 +3336,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
3260
3336
  let isPre = false;
3261
3337
  if (flush === "post") {
3262
3338
  baseWatchOptions.scheduler = (job) => {
3339
+ job.i = instance;
3263
3340
  queuePostRenderEffect(job, instance && instance.suspense);
3264
3341
  };
3265
3342
  } else if (flush !== "sync") {
@@ -3561,7 +3638,11 @@ const TeleportImpl = {
3561
3638
  };
3562
3639
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
3563
3640
  if (moveType === 0) {
3641
+ if (vnode.targetStart) {
3642
+ insert(vnode.targetStart, container, parentAnchor);
3643
+ }
3564
3644
  insert(vnode.targetAnchor, container, parentAnchor);
3645
+ parentAnchor = vnode.targetAnchor;
3565
3646
  }
3566
3647
  const { el, anchor, shapeFlag, children, props } = vnode;
3567
3648
  const isReorder = moveType === 2;
@@ -3730,10 +3811,6 @@ const BaseTransitionPropsValidators = {
3730
3811
  onAfterAppear: TransitionHookValidator,
3731
3812
  onAppearCancelled: TransitionHookValidator
3732
3813
  };
3733
- const recursiveGetSubtree = (instance) => {
3734
- const subTree = instance.subTree;
3735
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3736
- };
3737
3814
  const BaseTransitionImpl = {
3738
3815
  name: `BaseTransition`,
3739
3816
  props: BaseTransitionPropsValidators,
@@ -3774,7 +3851,7 @@ const BaseTransitionImpl = {
3774
3851
  setTransitionHooks(innerChild, enterHooks);
3775
3852
  }
3776
3853
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3777
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3854
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
3778
3855
  let leavingHooks = resolveTransitionHooks(
3779
3856
  oldInnerChild,
3780
3857
  rawProps,
@@ -3907,8 +3984,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3907
3984
  );
3908
3985
  }
3909
3986
  const leavingVNode = leavingVNodesCache[key];
3910
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3911
- leavingVNode.el[leaveCbKey]();
3987
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
3988
+ let leavingCb = leavingVNode.el[leaveCbKey];
3989
+ if (!leavingCb) {
3990
+ const leavingRoot = getTransitionRoot(leavingVNode);
3991
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
3992
+ }
3993
+ if (leavingCb) {
3994
+ leavingCb();
3995
+ }
3912
3996
  }
3913
3997
  callHook(hook, [el]);
3914
3998
  },
@@ -4036,6 +4120,12 @@ function setTransitionHooks(vnode, hooks) {
4036
4120
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4037
4121
  } else {
4038
4122
  vnode.transition = hooks;
4123
+ if (vnode.type === Fragment && isArray(vnode.children)) {
4124
+ const child = filterSingleRoot(vnode.children, false);
4125
+ if (child) {
4126
+ setTransitionHooks(child, hooks);
4127
+ }
4128
+ }
4039
4129
  }
4040
4130
  }
4041
4131
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -4060,6 +4150,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4060
4150
  }
4061
4151
  return ret;
4062
4152
  }
4153
+ function getTransitionRoot(vnode) {
4154
+ if (vnode.component) {
4155
+ return getTransitionRoot(vnode.component.subTree);
4156
+ }
4157
+ if (vnode.type === Fragment) {
4158
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
4159
+ return child ? getTransitionRoot(child) : void 0;
4160
+ }
4161
+ if (vnode.type !== Comment) {
4162
+ return vnode;
4163
+ }
4164
+ }
4063
4165
 
4064
4166
  // @__NO_SIDE_EFFECTS__
4065
4167
  function defineComponent(options, extraOptions) {
@@ -4433,13 +4535,15 @@ function createHydrationFunctions(rendererInternals) {
4433
4535
  getContainerType(container),
4434
4536
  optimized
4435
4537
  );
4436
- if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4538
+ if ((isAsyncWrapper(vnode) || vnode.component.asyncDep) && !vnode.component.subTree) {
4437
4539
  let subTree;
4438
4540
  if (isFragmentStart) {
4439
4541
  subTree = createVNode(Static);
4440
4542
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4441
4543
  } else {
4442
- subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4544
+ subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(
4545
+ node.nodeType === 8 ? Comment : "div"
4546
+ );
4443
4547
  }
4444
4548
  subTree.el = node;
4445
4549
  vnode.component.subTree = subTree;
@@ -4963,14 +5067,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
4963
5067
  break;
4964
5068
  }
4965
5069
  }, opts);
4966
- forEach((el) => {
4967
- if (!(el instanceof Element)) return;
5070
+ const observe = (el) => {
4968
5071
  if (elementIsVisibleInViewport(el)) {
4969
5072
  hydrate();
4970
5073
  ob.disconnect();
4971
5074
  return false;
4972
5075
  }
5076
+ if (getComputedStyle(el).display === "contents") {
5077
+ for (let i = 0; i < el.children.length; i++) {
5078
+ if (observe(el.children[i]) === false) return false;
5079
+ }
5080
+ }
4973
5081
  ob.observe(el);
5082
+ };
5083
+ forEach((el) => {
5084
+ if (!(el instanceof Element)) return;
5085
+ return observe(el);
4974
5086
  });
4975
5087
  return () => ob.disconnect();
4976
5088
  };
@@ -5327,6 +5439,7 @@ const KeepAliveImpl = {
5327
5439
  unmount(cached);
5328
5440
  } else if (current) {
5329
5441
  resetShapeFlag(current);
5442
+ if (cached) resetShapeFlag(cached);
5330
5443
  }
5331
5444
  cache.delete(key);
5332
5445
  keys.delete(key);
@@ -5618,9 +5731,11 @@ function renderList(source, renderItem, cache, index) {
5618
5731
  }
5619
5732
  } else if (typeof source === "number") {
5620
5733
  if (!Number.isInteger(source) || source < 0) {
5621
- warn$1(
5622
- `The v-for range expects a positive integer value but got ${source}.`
5623
- );
5734
+ {
5735
+ warn$1(
5736
+ `The v-for range expects a positive integer value but got ${source}.`
5737
+ );
5738
+ }
5624
5739
  ret = [];
5625
5740
  } else {
5626
5741
  ret = new Array(source);
@@ -7258,7 +7373,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
7258
7373
  }
7259
7374
  for (let i = 0; i < nextKeys.length; i++) {
7260
7375
  const key = nextKeys[i];
7261
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
7376
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
7262
7377
  return true;
7263
7378
  }
7264
7379
  }
@@ -7885,6 +8000,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7885
8000
  optimized = false;
7886
8001
  n2.dynamicChildren = null;
7887
8002
  }
8003
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
8004
+ if (n2.dynamicChildren === EMPTY_ARR) {
8005
+ n2.dynamicChildren = [];
8006
+ }
8007
+ n2.dynamicChildren.hasOnce = true;
8008
+ }
7888
8009
  const { type, ref, shapeFlag } = n2;
7889
8010
  switch (type) {
7890
8011
  case Text:
@@ -8291,15 +8412,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8291
8412
  for (let i = 0; i < newChildren.length; i++) {
8292
8413
  const oldVNode = oldChildren[i];
8293
8414
  const newVNode = newChildren[i];
8415
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
8294
8416
  const container = (
8295
8417
  // oldVNode may be an errored async setup() component inside Suspense
8296
8418
  // which will not have a mounted element
8297
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
8419
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
8298
8420
  // of the Fragment itself so it can move its children.
8299
8421
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
8300
8422
  // which also requires the correct parent container
8301
8423
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
8302
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
8424
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
8303
8425
  // In other cases, the parent container is not actually used so we
8304
8426
  // just pass the block element here to avoid a DOM parentNode call.
8305
8427
  fallbackContainer
@@ -8463,7 +8585,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8463
8585
  }
8464
8586
  if (isHmrUpdating) initialVNode.el = null;
8465
8587
  if (instance.asyncDep) {
8466
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8588
+ parentSuspense && parentSuspense.registerDep(
8589
+ instance,
8590
+ setupRenderEffect,
8591
+ optimized,
8592
+ namespace
8593
+ );
8467
8594
  if (!initialVNode.el) {
8468
8595
  const placeholder = instance.subTree = createVNode(Comment);
8469
8596
  processCommentNode(null, placeholder, container, anchor);
@@ -8492,6 +8619,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8492
8619
  {
8493
8620
  pushWarningContext(n2);
8494
8621
  }
8622
+ n2.el = n1.el;
8623
+ n2.placeholder = n1.placeholder;
8495
8624
  updateComponentPreRender(instance, n2, optimized);
8496
8625
  {
8497
8626
  popWarningContext();
@@ -8503,6 +8632,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8503
8632
  }
8504
8633
  } else {
8505
8634
  n2.el = n1.el;
8635
+ n2.placeholder = n1.placeholder;
8506
8636
  instance.vnode = n2;
8507
8637
  }
8508
8638
  };
@@ -9083,7 +9213,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9083
9213
  cacheIndex,
9084
9214
  memo
9085
9215
  } = vnode;
9086
- if (patchFlag === -2) {
9216
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) {
9087
9217
  optimized = false;
9088
9218
  }
9089
9219
  if (ref != null) {
@@ -9091,7 +9221,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9091
9221
  setRef(ref, null, parentSuspense, vnode, true);
9092
9222
  resetTracking();
9093
9223
  }
9094
- if (cacheIndex != null) {
9224
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
9095
9225
  parentComponent.renderCache[cacheIndex] = void 0;
9096
9226
  }
9097
9227
  if (shapeFlag & 256) {
@@ -9156,35 +9286,37 @@ function baseCreateRenderer(options, createHydrationFns) {
9156
9286
  };
9157
9287
  const remove = (vnode) => {
9158
9288
  const { type, el, anchor, transition } = vnode;
9159
- if (type === Fragment) {
9160
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
9161
- vnode.children.forEach((child) => {
9162
- if (child.type === Comment) {
9163
- hostRemove(child.el);
9164
- } else {
9165
- remove(child);
9166
- }
9167
- });
9168
- } else {
9169
- removeFragment(el, anchor);
9170
- }
9289
+ const isFragment = type === Fragment;
9290
+ if (isFragment && !transition) {
9291
+ removeFragment(el, anchor);
9171
9292
  return;
9172
9293
  }
9173
9294
  if (type === Static) {
9174
9295
  removeStaticNode(vnode);
9296
+ if (transition && !transition.persisted && transition.afterLeave) {
9297
+ transition.afterLeave();
9298
+ }
9175
9299
  return;
9176
9300
  }
9301
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
9177
9302
  const performRemove = () => {
9178
- hostRemove(el);
9303
+ if (isFragment) {
9304
+ if (hostParentNode(el)) {
9305
+ removeFragment(el, anchor);
9306
+ }
9307
+ } else {
9308
+ hostRemove(el);
9309
+ }
9179
9310
  if (transition && !transition.persisted && transition.afterLeave) {
9180
9311
  transition.afterLeave();
9181
9312
  }
9182
9313
  };
9183
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
9314
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
9184
9315
  const { leave, delayLeave } = transition;
9185
- const performLeave = () => leave(el, performRemove);
9316
+ const leavingEl = leavingNode.el;
9317
+ const performLeave = () => leave(leavingEl, performRemove);
9186
9318
  if (delayLeave) {
9187
- delayLeave(vnode.el, performRemove, performLeave);
9319
+ delayLeave(leavingEl, performRemove, performLeave);
9188
9320
  } else {
9189
9321
  performLeave();
9190
9322
  }
@@ -9215,6 +9347,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9215
9347
  if (job) {
9216
9348
  job.flags |= 8;
9217
9349
  unmount(subTree, instance, parentSuspense, doRemove);
9350
+ } else if (instance.vnode.el && subTree) {
9351
+ subTree.transition = instance.vnode.transition;
9352
+ unmount(subTree, instance, parentSuspense, doRemove);
9218
9353
  }
9219
9354
  if (um) {
9220
9355
  queuePostRenderEffect(um, parentSuspense);
@@ -9242,32 +9377,26 @@ function baseCreateRenderer(options, createHydrationFns) {
9242
9377
  const teleportEnd = el && el[TeleportEndKey];
9243
9378
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
9244
9379
  };
9245
- let isFlushing = false;
9246
9380
  const render = (vnode, container, namespace) => {
9247
- let instance;
9248
- if (vnode == null) {
9249
- if (container._vnode) {
9250
- unmount(container._vnode, null, null, true);
9251
- instance = container._vnode.component;
9381
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
9382
+ flushOnAppMount(() => {
9383
+ if (vnode == null) {
9384
+ if (container._vnode) {
9385
+ unmount(container._vnode, null, null, true);
9386
+ }
9387
+ } else {
9388
+ patch(
9389
+ container._vnode || null,
9390
+ vnode,
9391
+ container,
9392
+ null,
9393
+ null,
9394
+ null,
9395
+ namespace
9396
+ );
9252
9397
  }
9253
- } else {
9254
- patch(
9255
- container._vnode || null,
9256
- vnode,
9257
- container,
9258
- null,
9259
- null,
9260
- null,
9261
- namespace
9262
- );
9263
- }
9264
- container._vnode = vnode;
9265
- if (!isFlushing) {
9266
- isFlushing = true;
9267
- flushPreFlushCbs(instance);
9268
- flushPostFlushCbs();
9269
- isFlushing = false;
9270
- }
9398
+ container._vnode = vnode;
9399
+ }, minUid);
9271
9400
  };
9272
9401
  const internals = {
9273
9402
  p: patch,
@@ -9429,7 +9558,7 @@ const SuspenseImpl = {
9429
9558
  rendererInternals
9430
9559
  );
9431
9560
  } else {
9432
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
9561
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9433
9562
  n2.suspense = n1.suspense;
9434
9563
  n2.suspense.vnode = n2;
9435
9564
  n2.el = n1.el;
@@ -9515,10 +9644,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9515
9644
  if (pendingBranch) {
9516
9645
  suspense.pendingBranch = newBranch;
9517
9646
  if (isSameVNodeType(pendingBranch, newBranch)) {
9647
+ suspense.deps++;
9518
9648
  patch(
9519
9649
  pendingBranch,
9520
9650
  newBranch,
9521
- suspense.hiddenContainer,
9651
+ // a hydrating pending branch is adopted SSR DOM, already in place
9652
+ isHydrating ? container : suspense.hiddenContainer,
9522
9653
  null,
9523
9654
  parentComponent,
9524
9655
  suspense,
@@ -9526,6 +9657,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9526
9657
  slotScopeIds,
9527
9658
  optimized
9528
9659
  );
9660
+ suspense.deps--;
9529
9661
  if (suspense.deps <= 0) {
9530
9662
  suspense.resolve();
9531
9663
  } else if (isInFallback) {
@@ -9791,6 +9923,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9791
9923
  suspense.effects = [];
9792
9924
  if (isSuspensible) {
9793
9925
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
9926
+ parentSuspenseId = void 0;
9794
9927
  parentSuspense.deps--;
9795
9928
  if (parentSuspense.deps === 0 && !sync) {
9796
9929
  parentSuspense.resolve();
@@ -9851,7 +9984,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9851
9984
  next() {
9852
9985
  return suspense.activeBranch && next(suspense.activeBranch);
9853
9986
  },
9854
- registerDep(instance, setupRenderEffect, optimized2) {
9987
+ // `namespace` intentionally shadows the boundary's own: the dep must be
9988
+ // mounted with the namespace of the position it was rendered at, which can
9989
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
9990
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
9855
9991
  const isInPendingSuspense = !!suspense.pendingBranch;
9856
9992
  if (isInPendingSuspense) {
9857
9993
  suspense.deps++;
@@ -9864,6 +10000,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9864
10000
  return;
9865
10001
  }
9866
10002
  unsetCurrentInstance();
10003
+ if (!instance.scope.active) {
10004
+ if (isInPendingSuspense && --suspense.deps === 0) {
10005
+ suspense.resolve();
10006
+ }
10007
+ return;
10008
+ }
9867
10009
  instance.asyncResolved = true;
9868
10010
  const { vnode: vnode2 } = instance;
9869
10011
  {
@@ -9885,7 +10027,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9885
10027
  // consider the comment placeholder case.
9886
10028
  hydratedEl ? null : next(instance.subTree),
9887
10029
  suspense,
9888
- namespace,
10030
+ namespace2,
9889
10031
  optimized2
9890
10032
  );
9891
10033
  if (placeholder) {
@@ -10285,7 +10427,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
10285
10427
  el: vnode.el,
10286
10428
  anchor: vnode.anchor,
10287
10429
  ctx: vnode.ctx,
10288
- ce: vnode.ce
10430
+ ce: vnode.ce,
10431
+ cacheIndex: vnode.cacheIndex
10289
10432
  };
10290
10433
  if (transition && cloneTransition) {
10291
10434
  setTransitionHooks(
@@ -10418,6 +10561,9 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
10418
10561
 
10419
10562
  const emptyAppContext = createAppContext();
10420
10563
  let uid = 0;
10564
+ function getNextUid() {
10565
+ return uid;
10566
+ }
10421
10567
  function createComponentInstance(vnode, parent, suspense) {
10422
10568
  const type = vnode.type;
10423
10569
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -11090,7 +11236,7 @@ function isMemoSame(cached, memo) {
11090
11236
  return true;
11091
11237
  }
11092
11238
 
11093
- const version = "3.5.42";
11239
+ const version = "3.5.44";
11094
11240
  const warn = warn$1 ;
11095
11241
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11096
11242
  const devtools = devtools$1 ;
@@ -11666,7 +11812,9 @@ function patchStyle(el, prev, next) {
11666
11812
  }
11667
11813
  }
11668
11814
  if (vShowOriginalDisplay in el) {
11669
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
11815
+ if (!isCssString || prev !== next) {
11816
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
11817
+ }
11670
11818
  if (el[vShowHidden]) {
11671
11819
  style.display = "none";
11672
11820
  }
@@ -12148,7 +12296,9 @@ class VueElement extends BaseClass {
12148
12296
  "Custom element style injection is not supported when using shadowRoot: false"
12149
12297
  );
12150
12298
  }
12151
- this._mount(def);
12299
+ if (this._connected) {
12300
+ this._mount(def);
12301
+ }
12152
12302
  };
12153
12303
  const asyncDef = this._def.__asyncLoader;
12154
12304
  if (asyncDef) {
@@ -12518,6 +12668,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
12518
12668
  const newPositionMap = /* @__PURE__ */ new WeakMap();
12519
12669
  const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
12520
12670
  const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
12671
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
12521
12672
  const decorate = (t) => {
12522
12673
  delete t.props.mode;
12523
12674
  return t;
@@ -12533,21 +12684,30 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12533
12684
  const state = useTransitionState();
12534
12685
  let prevChildren;
12535
12686
  let children;
12536
- onUpdated(() => {
12537
- if (!prevChildren.length) {
12538
- return;
12687
+ let origins;
12688
+ let moves;
12689
+ const willMove = () => {
12690
+ if (moves === void 0) {
12691
+ moves = prevChildren.length > 0 && hasCSSTransform(
12692
+ prevChildren[0].el,
12693
+ instance.vnode.el,
12694
+ resolveMoveClass(props)
12695
+ );
12539
12696
  }
12540
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
12541
- if (!hasCSSTransform(
12542
- prevChildren[0].el,
12543
- instance.vnode.el,
12544
- moveClass
12545
- )) {
12697
+ return moves;
12698
+ };
12699
+ onUpdated(() => {
12700
+ pendingGroups.delete(instance);
12701
+ if (!willMove()) {
12546
12702
  prevChildren = [];
12703
+ origins = void 0;
12547
12704
  return;
12548
12705
  }
12706
+ const moveClass = resolveMoveClass(props);
12549
12707
  prevChildren.forEach(callPendingCbs);
12550
- prevChildren.forEach(recordPosition);
12708
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
12709
+ origins = void 0;
12710
+ prevChildren.forEach((c) => recordPosition(c, shift));
12551
12711
  const movedChildren = prevChildren.filter(applyTranslation);
12552
12712
  forceReflow(instance.vnode.el);
12553
12713
  movedChildren.forEach((c) => {
@@ -12574,6 +12734,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12574
12734
  const cssTransitionProps = resolveTransitionProps(rawProps);
12575
12735
  let tag = rawProps.tag || Fragment;
12576
12736
  prevChildren = [];
12737
+ moves = void 0;
12577
12738
  if (children) {
12578
12739
  for (let i = 0; i < children.length; i++) {
12579
12740
  const child = children[i];
@@ -12605,6 +12766,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12605
12766
  warn(`<TransitionGroup> children must be keyed.`);
12606
12767
  }
12607
12768
  }
12769
+ if (prevChildren.length) {
12770
+ origins = getOrigins(instance);
12771
+ pendingGroups.set(instance, willMove);
12772
+ }
12608
12773
  return createVNode(tag, null, children);
12609
12774
  };
12610
12775
  }
@@ -12619,8 +12784,11 @@ function callPendingCbs(c) {
12619
12784
  el[enterCbKey]();
12620
12785
  }
12621
12786
  }
12622
- function recordPosition(c) {
12623
- newPositionMap.set(c, getPosition(c.el));
12787
+ function resolveMoveClass(props) {
12788
+ return props.moveClass || `${props.name || "v"}-move`;
12789
+ }
12790
+ function recordPosition(c, shift) {
12791
+ newPositionMap.set(c, getPosition(c.el, shift));
12624
12792
  }
12625
12793
  function applyTranslation(c) {
12626
12794
  const oldPos = positionMap.get(c);
@@ -12644,13 +12812,41 @@ function applyTranslation(c) {
12644
12812
  return c;
12645
12813
  }
12646
12814
  }
12647
- function getPosition(el) {
12815
+ function getPosition(el, shift) {
12648
12816
  const rect = el.getBoundingClientRect();
12649
12817
  return {
12650
- left: rect.left,
12651
- top: rect.top
12818
+ left: rect.left - (shift ? shift.left : 0),
12819
+ top: rect.top - (shift ? shift.top : 0)
12652
12820
  };
12653
12821
  }
12822
+ function getOrigins(instance) {
12823
+ let origins;
12824
+ for (let group = instance.parent; group; group = group.parent) {
12825
+ const willMove = pendingGroups.get(group);
12826
+ if (willMove) {
12827
+ const item = findItem(group.vnode.el, instance.vnode.el);
12828
+ if (item) {
12829
+ (origins || (origins = [])).push(
12830
+ extend(getPosition(item), { item, willMove })
12831
+ );
12832
+ }
12833
+ }
12834
+ }
12835
+ return origins;
12836
+ }
12837
+ function findItem(root, node) {
12838
+ const container = root.nodeType === 1 ? root : root.parentNode;
12839
+ while (node && node.parentNode !== container) {
12840
+ node = node.parentNode;
12841
+ }
12842
+ if (node && node.nodeType === 1) {
12843
+ return node;
12844
+ }
12845
+ }
12846
+ function getOriginShift(origins, root) {
12847
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
12848
+ return origin && getPosition(origin.item, origin);
12849
+ }
12654
12850
  function hasCSSTransform(el, root, moveClass) {
12655
12851
  const clone = el.cloneNode();
12656
12852
  const _vtc = el[vtcKey];
@@ -14498,7 +14694,8 @@ const errorMessages = {
14498
14694
  [42]: `v-model value must be a valid JavaScript member expression.`,
14499
14695
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
14500
14696
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
14501
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
14697
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.
14698
+ For props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
14502
14699
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
14503
14700
  [46]: `Error parsing JavaScript expression: `,
14504
14701
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -16992,7 +17189,7 @@ const transformFor = createStructuralDirectiveTransform(
16992
17189
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
16993
17190
  createCompoundExpression([
16994
17191
  `if (_cached && _cached.el`,
16995
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
17192
+ ...keyExp ? [` && _cached.key === (`, keyExp, `)`] : [],
16996
17193
  ` && ${context.helperString(
16997
17194
  IS_MEMO_SAME
16998
17195
  )}(_cached, _memo)) return _cached`
@@ -18733,7 +18930,8 @@ const transformTransition = (node, context) => {
18733
18930
  if (!node.children.length) {
18734
18931
  return;
18735
18932
  }
18736
- if (hasMultipleChildren(node)) {
18933
+ const multipleChildren = hasMultipleChildren(node);
18934
+ if (multipleChildren) {
18737
18935
  context.onError(
18738
18936
  createDOMCompilerError(
18739
18937
  63,
@@ -18960,7 +19158,8 @@ const validateHtmlNesting = (node, context) => {
18960
19158
 
18961
19159
  const DOMNodeTransforms = [
18962
19160
  transformStyle,
18963
- ...[transformTransition, validateHtmlNesting]
19161
+ transformTransition,
19162
+ ...[validateHtmlNesting]
18964
19163
  ];
18965
19164
  const DOMDirectiveTransforms = {
18966
19165
  cloak: noopDirectiveTransform,