@vue/compat 3.5.43 → 3.5.45

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.43
2
+ * @vue/compat v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -61,24 +61,20 @@ const cacheStringFunction = (fn) => {
61
61
  });
62
62
  };
63
63
  const camelizeRE = /-\w/g;
64
- const camelize = cacheStringFunction(
65
- (str) => {
66
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
67
- }
68
- );
64
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
65
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
66
+ });
69
67
  const hyphenateRE = /\B([A-Z])/g;
70
- const hyphenate = cacheStringFunction(
68
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
71
69
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
72
70
  );
73
- const capitalize = cacheStringFunction((str) => {
71
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
74
72
  return str.charAt(0).toUpperCase() + str.slice(1);
75
73
  });
76
- const toHandlerKey = cacheStringFunction(
77
- (str) => {
78
- const s = str ? `on${capitalize(str)}` : ``;
79
- return s;
80
- }
81
- );
74
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
75
+ const s = str ? `on${capitalize(str)}` : ``;
76
+ return s;
77
+ });
82
78
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
83
79
  const invokeArrayFns = (fns, ...arg) => {
84
80
  for (let i = 0; i < fns.length; i++) {
@@ -191,7 +187,7 @@ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
191
187
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
192
188
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
193
189
 
194
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
190
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
195
191
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
196
192
  const isBooleanAttr = /* @__PURE__ */ makeMap(
197
193
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -535,7 +531,11 @@ function getCurrentScope() {
535
531
  }
536
532
  function onScopeDispose(fn, failSilently = false) {
537
533
  if (activeEffectScope) {
538
- activeEffectScope.cleanups.push(fn);
534
+ if (activeEffectScope.active) {
535
+ activeEffectScope.cleanups.push(fn);
536
+ } else {
537
+ fn();
538
+ }
539
539
  } else if (!failSilently) {
540
540
  warn$2(
541
541
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1239,19 +1239,41 @@ const arrayInstrumentations = {
1239
1239
  };
1240
1240
  function iterator(self, method, wrapValue) {
1241
1241
  const arr = shallowReadArray(self);
1242
- const iter = arr[method]();
1242
+ const methodFn = arr[method];
1243
+ const iter = methodFn.call(arr);
1243
1244
  if (arr !== self && !isShallow(self)) {
1244
- iter._next = iter.next;
1245
- iter.next = () => {
1246
- const result = iter._next();
1247
- if (!result.done) {
1248
- result.value = wrapValue(result.value);
1245
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
1246
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
1247
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
1248
+ if (methodFn !== arrayProto[method]) {
1249
+ Object.defineProperties(wrapped, {
1250
+ return: {
1251
+ get() {
1252
+ const fn = iter.return;
1253
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1254
+ }
1255
+ },
1256
+ throw: {
1257
+ get() {
1258
+ const fn = iter.throw;
1259
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1260
+ }
1261
+ }
1262
+ });
1249
1263
  }
1250
- return result;
1251
- };
1264
+ return wrapped;
1265
+ }
1266
+ iter._next = iter.next;
1267
+ iter.next = () => wrapResult(iter._next(), wrapValue);
1252
1268
  }
1253
1269
  return iter;
1254
1270
  }
1271
+ function wrapResult(result, wrapValue) {
1272
+ if (!result.done) {
1273
+ result.value = wrapValue(result.value);
1274
+ }
1275
+ return result;
1276
+ }
1255
1277
  const arrayProto = Array.prototype;
1256
1278
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1257
1279
  const arr = shallowReadArray(self);
@@ -1320,7 +1342,7 @@ function noTracking(self, method, args = []) {
1320
1342
  }
1321
1343
 
1322
1344
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1323
- const builtInSymbols = new Set(
1345
+ const builtInSymbols = /* @__PURE__ */ new Set(
1324
1346
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1325
1347
  );
1326
1348
  function hasOwnProperty(key) {
@@ -1674,6 +1696,8 @@ function createInstrumentationGetter(isReadonly2, shallow) {
1674
1696
  return !isReadonly2;
1675
1697
  } else if (key === "__v_isReadonly") {
1676
1698
  return isReadonly2;
1699
+ } else if (key === "__v_isShallow") {
1700
+ return shallow;
1677
1701
  } else if (key === "__v_raw") {
1678
1702
  return target;
1679
1703
  }
@@ -2219,9 +2243,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2219
2243
  if (once && cb) {
2220
2244
  const _cb = cb;
2221
2245
  cb = (...args) => {
2222
- const res = _cb(...args);
2223
- watchHandle();
2224
- return res;
2246
+ try {
2247
+ return _cb(...args);
2248
+ } finally {
2249
+ watchHandle();
2250
+ }
2225
2251
  };
2226
2252
  }
2227
2253
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2232,12 +2258,13 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2232
2258
  if (cb) {
2233
2259
  const newValue = effect.run();
2234
2260
  if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2235
- if (cleanup) {
2236
- cleanup();
2237
- }
2238
2261
  const currentWatcher = activeWatcher;
2239
- activeWatcher = effect;
2262
+ pauseTracking();
2240
2263
  try {
2264
+ if (cleanup) {
2265
+ cleanup();
2266
+ }
2267
+ activeWatcher = effect;
2241
2268
  const args = [
2242
2269
  newValue,
2243
2270
  // pass undefined as the old value when it's changed for the first time
@@ -2251,6 +2278,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2251
2278
  );
2252
2279
  } finally {
2253
2280
  activeWatcher = currentWatcher;
2281
+ resetTracking();
2254
2282
  }
2255
2283
  }
2256
2284
  } else {
@@ -2524,7 +2552,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2524
2552
  const res = callWithErrorHandling(fn, instance, type, args);
2525
2553
  if (res && isPromise(res)) {
2526
2554
  res.catch((err) => {
2527
- handleError(err, instance, type);
2555
+ handleError(err, instance, type, void 0, true);
2528
2556
  });
2529
2557
  }
2530
2558
  return res;
@@ -2541,7 +2569,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2541
2569
  );
2542
2570
  }
2543
2571
  }
2544
- function handleError(err, instance, type, throwInDev = true) {
2572
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2545
2573
  const contextVNode = instance ? instance.vnode : null;
2546
2574
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2547
2575
  if (instance) {
@@ -2550,7 +2578,9 @@ function handleError(err, instance, type, throwInDev = true) {
2550
2578
  const errorInfo = ErrorTypeStrings$1[type] ;
2551
2579
  while (cur) {
2552
2580
  const errorCapturedHooks = cur.ec;
2553
- if (errorCapturedHooks) {
2581
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2582
+ // are deferred or discarded by Suspense.
2583
+ (!isAsyncError || cur.scope.active)) {
2554
2584
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2555
2585
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2556
2586
  return;
@@ -2651,21 +2681,21 @@ function queuePostFlushCb(cb) {
2651
2681
  }
2652
2682
  queueFlush();
2653
2683
  }
2654
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2684
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
2655
2685
  {
2656
2686
  seen = seen || /* @__PURE__ */ new Map();
2657
2687
  }
2658
2688
  for (; i < queue.length; i++) {
2659
2689
  const cb = queue[i];
2660
2690
  if (cb && cb.flags & 2) {
2661
- if (instance && cb.id !== instance.uid) {
2691
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
2662
2692
  continue;
2663
2693
  }
2664
2694
  if (checkRecursiveUpdates(seen, cb)) {
2665
2695
  continue;
2666
2696
  }
2667
2697
  queue.splice(i, 1);
2668
- i--;
2698
+ i = instance ? i - 1 : flushIndex;
2669
2699
  if (cb.flags & 4) {
2670
2700
  cb.flags &= -2;
2671
2701
  }
@@ -2676,12 +2706,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2676
2706
  }
2677
2707
  }
2678
2708
  }
2679
- function flushPostFlushCbs(seen) {
2709
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2680
2710
  if (pendingPostFlushCbs.length) {
2681
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
2682
- (a, b) => getId(a) - getId(b)
2683
- );
2684
- pendingPostFlushCbs.length = 0;
2711
+ let cbs = pendingPostFlushCbs;
2712
+ let kept = 0;
2713
+ if (skip) {
2714
+ cbs = [];
2715
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
2716
+ const cb = pendingPostFlushCbs[i];
2717
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
2718
+ pendingPostFlushCbs[kept++] = cb;
2719
+ } else {
2720
+ cbs.push(cb);
2721
+ }
2722
+ }
2723
+ }
2724
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
2725
+ pendingPostFlushCbs.length = kept;
2685
2726
  if (activePostFlushCbs) {
2686
2727
  for (let i = 0; i < deduped.length; i++) {
2687
2728
  activePostFlushCbs.push(deduped[i]);
@@ -2707,6 +2748,22 @@ function flushPostFlushCbs(seen) {
2707
2748
  postFlushIndex = 0;
2708
2749
  }
2709
2750
  }
2751
+ let isFlushing = false;
2752
+ function flushOnAppMount(fn, minUid) {
2753
+ if (isFlushing) {
2754
+ fn();
2755
+ return;
2756
+ }
2757
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
2758
+ fn();
2759
+ isFlushing = true;
2760
+ try {
2761
+ flushPreFlushCbs(void 0, minUid);
2762
+ flushPostFlushCbs(void 0, queued, minUid);
2763
+ } finally {
2764
+ isFlushing = false;
2765
+ }
2766
+ }
2710
2767
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2711
2768
  function flushJobs(seen) {
2712
2769
  {
@@ -2851,14 +2908,32 @@ function reload(id, newComp) {
2851
2908
  instance.ceReload(newComp.styles);
2852
2909
  dirtyInstances.delete(instance);
2853
2910
  } else if (instance.parent) {
2854
- queueJob(() => {
2855
- if (!(instance.job.flags & 8)) {
2856
- isHmrUpdating = true;
2911
+ const update = () => {
2912
+ if (!instance.scope.active) return;
2913
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2914
+ if (pending) {
2915
+ pending.asyncDep.catch(NOOP).then(() => {
2916
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2917
+ queueJob(update);
2918
+ }
2919
+ });
2920
+ return;
2921
+ }
2922
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2923
+ if (!dirtyInstances) {
2924
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2925
+ }
2926
+ dirtyInstances.add(instance);
2927
+ isHmrUpdating = true;
2928
+ try {
2857
2929
  instance.parent.update();
2930
+ } finally {
2858
2931
  isHmrUpdating = false;
2859
2932
  dirtyInstances.delete(instance);
2933
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2860
2934
  }
2861
- });
2935
+ };
2936
+ queueJob(update);
2862
2937
  } else if (instance.appContext.reload) {
2863
2938
  instance.appContext.reload();
2864
2939
  } else if (typeof window !== "undefined") {
@@ -3540,12 +3615,31 @@ function withDirectives(vnode, directives) {
3540
3615
  return vnode;
3541
3616
  }
3542
3617
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3543
- const bindings = vnode.dirs;
3618
+ let hookVNode = vnode;
3619
+ if (name === "beforeMount") {
3620
+ vnode._mount = vnode;
3621
+ } else if (name === "beforeUpdate") {
3622
+ const mount = prevVNode && prevVNode._mount;
3623
+ if (mount) {
3624
+ mount._latest = vnode;
3625
+ vnode._mount = mount;
3626
+ }
3627
+ } else if (name === "mounted") {
3628
+ const latest = vnode._latest;
3629
+ vnode._mount = vnode._latest = void 0;
3630
+ if (latest) {
3631
+ hookVNode = latest;
3632
+ latest._mount = void 0;
3633
+ }
3634
+ }
3635
+ const bindings = hookVNode.dirs;
3544
3636
  const oldBindings = prevVNode && prevVNode.dirs;
3545
3637
  for (let i = 0; i < bindings.length; i++) {
3546
- const binding = bindings[i];
3638
+ let binding = bindings[i];
3547
3639
  if (oldBindings) {
3548
3640
  binding.oldValue = oldBindings[i].value;
3641
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3642
+ binding = extend({}, binding, { oldValue: void 0 });
3549
3643
  }
3550
3644
  let hook = binding.dir[name];
3551
3645
  if (!hook) {
@@ -3556,7 +3650,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3556
3650
  callWithAsyncErrorHandling(hook, instance, 8, [
3557
3651
  vnode.el,
3558
3652
  binding,
3559
- vnode,
3653
+ hookVNode,
3560
3654
  prevVNode
3561
3655
  ]);
3562
3656
  resetTracking();
@@ -3677,6 +3771,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
3677
3771
  let isPre = false;
3678
3772
  if (flush === "post") {
3679
3773
  baseWatchOptions.scheduler = (job) => {
3774
+ job.i = instance;
3680
3775
  queuePostRenderEffect(job, instance && instance.suspense);
3681
3776
  };
3682
3777
  } else if (flush !== "sync") {
@@ -3978,7 +4073,11 @@ const TeleportImpl = {
3978
4073
  };
3979
4074
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
3980
4075
  if (moveType === 0) {
4076
+ if (vnode.targetStart) {
4077
+ insert(vnode.targetStart, container, parentAnchor);
4078
+ }
3981
4079
  insert(vnode.targetAnchor, container, parentAnchor);
4080
+ parentAnchor = vnode.targetAnchor;
3982
4081
  }
3983
4082
  const { el, anchor, shapeFlag, children, props } = vnode;
3984
4083
  const isReorder = moveType === 2;
@@ -4147,10 +4246,6 @@ const BaseTransitionPropsValidators = {
4147
4246
  onAfterAppear: TransitionHookValidator,
4148
4247
  onAppearCancelled: TransitionHookValidator
4149
4248
  };
4150
- const recursiveGetSubtree = (instance) => {
4151
- const subTree = instance.subTree;
4152
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
4153
- };
4154
4249
  const BaseTransitionImpl = {
4155
4250
  name: `BaseTransition`,
4156
4251
  props: BaseTransitionPropsValidators,
@@ -4179,19 +4274,17 @@ const BaseTransitionImpl = {
4179
4274
  if (!innerChild) {
4180
4275
  return emptyPlaceholder(child);
4181
4276
  }
4182
- let enterHooks = resolveTransitionHooks(
4277
+ const enterHooks = resolveTransitionHooks(
4183
4278
  innerChild,
4184
4279
  rawProps,
4185
4280
  state,
4186
- instance,
4187
- // #11061, ensure enterHooks is fresh after clone
4188
- (hooks) => enterHooks = hooks
4281
+ instance
4189
4282
  );
4190
4283
  if (innerChild.type !== Comment) {
4191
4284
  setTransitionHooks(innerChild, enterHooks);
4192
4285
  }
4193
4286
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
4194
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
4287
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
4195
4288
  let leavingHooks = resolveTransitionHooks(
4196
4289
  oldInnerChild,
4197
4290
  rawProps,
@@ -4204,7 +4297,17 @@ const BaseTransitionImpl = {
4204
4297
  leavingHooks.afterLeave = () => {
4205
4298
  state.isLeaving = false;
4206
4299
  if (!(instance.job.flags & 8)) {
4207
- instance.update();
4300
+ if (instance.effect.flags & 2) {
4301
+ const job = () => {
4302
+ if (!(instance.job.flags & 8)) {
4303
+ instance.update();
4304
+ }
4305
+ };
4306
+ job.i = instance;
4307
+ queueJob(job);
4308
+ } else {
4309
+ instance.update();
4310
+ }
4208
4311
  }
4209
4312
  delete leavingHooks.afterLeave;
4210
4313
  oldInnerChild = void 0;
@@ -4271,7 +4374,7 @@ function getLeavingNodesForType(state, vnode) {
4271
4374
  }
4272
4375
  return leavingVNodesCache;
4273
4376
  }
4274
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4377
+ function resolveTransitionHooks(vnode, props, state, instance) {
4275
4378
  const {
4276
4379
  appear,
4277
4380
  mode,
@@ -4327,8 +4430,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4327
4430
  );
4328
4431
  }
4329
4432
  const leavingVNode = leavingVNodesCache[key];
4330
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
4331
- leavingVNode.el[leaveCbKey]();
4433
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
4434
+ let leavingCb = leavingVNode.el[leaveCbKey];
4435
+ if (!leavingCb) {
4436
+ const leavingRoot = getTransitionRoot(leavingVNode);
4437
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
4438
+ }
4439
+ if (leavingCb) {
4440
+ leavingCb();
4441
+ }
4332
4442
  }
4333
4443
  callHook(hook, [el]);
4334
4444
  },
@@ -4403,15 +4513,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4403
4513
  }
4404
4514
  },
4405
4515
  clone(vnode2) {
4406
- const hooks2 = resolveTransitionHooks(
4407
- vnode2,
4408
- props,
4409
- state,
4410
- instance,
4411
- postClone
4412
- );
4413
- if (postClone) postClone(hooks2);
4414
- return hooks2;
4516
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4517
+ cloned.afterLeave = () => {
4518
+ if (hooks.afterLeave) hooks.afterLeave();
4519
+ };
4520
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4521
+ if (hooks.delayLeave) {
4522
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4523
+ } else {
4524
+ delayedLeave();
4525
+ }
4526
+ };
4527
+ cloned.delayedLeave = () => {
4528
+ if (hooks.delayedLeave) hooks.delayedLeave();
4529
+ };
4530
+ return cloned;
4415
4531
  }
4416
4532
  };
4417
4533
  return hooks;
@@ -4452,10 +4568,24 @@ function setTransitionHooks(vnode, hooks) {
4452
4568
  hooks
4453
4569
  );
4454
4570
  } else if (vnode.shapeFlag & 128) {
4455
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4456
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4571
+ const suspense = vnode.suspense;
4572
+ if (suspense) {
4573
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4574
+ if (branch) {
4575
+ setTransitionHooks(branch, hooks.clone(branch));
4576
+ }
4577
+ } else {
4578
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4579
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4580
+ }
4457
4581
  } else {
4458
4582
  vnode.transition = hooks;
4583
+ if (vnode.type === Fragment && isArray(vnode.children)) {
4584
+ const child = filterSingleRoot(vnode.children, false);
4585
+ if (child) {
4586
+ setTransitionHooks(child, hooks);
4587
+ }
4588
+ }
4459
4589
  }
4460
4590
  }
4461
4591
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -4480,6 +4610,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4480
4610
  }
4481
4611
  return ret;
4482
4612
  }
4613
+ function getTransitionRoot(vnode) {
4614
+ if (vnode.component) {
4615
+ return getTransitionRoot(vnode.component.subTree);
4616
+ }
4617
+ if (vnode.type === Fragment) {
4618
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
4619
+ return child ? getTransitionRoot(child) : void 0;
4620
+ }
4621
+ if (vnode.type !== Comment) {
4622
+ return vnode;
4623
+ }
4624
+ }
4483
4625
 
4484
4626
  // @__NO_SIDE_EFFECTS__
4485
4627
  function defineComponent(options, extraOptions) {
@@ -5136,7 +5278,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5136
5278
  getContainerType(container),
5137
5279
  slotScopeIds
5138
5280
  );
5139
- if (parentComponent) {
5281
+ if (parentComponent && parentComponent.vnode.el === node) {
5140
5282
  parentComponent.vnode.el = vnode.el;
5141
5283
  updateHOCHostEl(parentComponent, vnode.el);
5142
5284
  }
@@ -5385,14 +5527,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
5385
5527
  break;
5386
5528
  }
5387
5529
  }, opts);
5388
- forEach((el) => {
5389
- if (!(el instanceof Element)) return;
5530
+ const observe = (el) => {
5390
5531
  if (elementIsVisibleInViewport(el)) {
5391
5532
  hydrate();
5392
5533
  ob.disconnect();
5393
5534
  return false;
5394
5535
  }
5536
+ if (getComputedStyle(el).display === "contents") {
5537
+ for (let i = 0; i < el.children.length; i++) {
5538
+ if (observe(el.children[i]) === false) return false;
5539
+ }
5540
+ }
5395
5541
  ob.observe(el);
5542
+ };
5543
+ forEach((el) => {
5544
+ if (!(el instanceof Element)) return;
5545
+ return observe(el);
5396
5546
  });
5397
5547
  return () => ob.disconnect();
5398
5548
  };
@@ -5562,7 +5712,8 @@ function defineAsyncComponent(source) {
5562
5712
  err,
5563
5713
  instance,
5564
5714
  13,
5565
- !errorComponent
5715
+ !errorComponent,
5716
+ true
5566
5717
  );
5567
5718
  };
5568
5719
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -5580,7 +5731,7 @@ function defineAsyncComponent(source) {
5580
5731
  const delayed = ref(!!delay);
5581
5732
  let timeoutTimer;
5582
5733
  let delayTimer;
5583
- onUnmounted(() => {
5734
+ onScopeDispose(() => {
5584
5735
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5585
5736
  if (delayTimer != null) clearTimeout(delayTimer);
5586
5737
  });
@@ -5708,6 +5859,12 @@ const KeepAliveImpl = {
5708
5859
  }
5709
5860
  };
5710
5861
  sharedContext.deactivate = (vnode) => {
5862
+ const cached = cache.get(
5863
+ vnode.key == null ? vnode.type : vnode.key
5864
+ );
5865
+ if (!cached || cached.component !== vnode.component) {
5866
+ return false;
5867
+ }
5711
5868
  const instance2 = vnode.component;
5712
5869
  invalidateMount(instance2.m);
5713
5870
  invalidateMount(instance2.a);
@@ -5728,6 +5885,7 @@ const KeepAliveImpl = {
5728
5885
  {
5729
5886
  instance2.__keepAliveStorageContainer = storageContainer;
5730
5887
  }
5888
+ return true;
5731
5889
  };
5732
5890
  function unmount(vnode) {
5733
5891
  resetShapeFlag(vnode);
@@ -5749,6 +5907,7 @@ const KeepAliveImpl = {
5749
5907
  unmount(cached);
5750
5908
  } else if (current) {
5751
5909
  resetShapeFlag(current);
5910
+ if (cached) resetShapeFlag(cached);
5752
5911
  }
5753
5912
  cache.delete(key);
5754
5913
  keys.delete(key);
@@ -5766,12 +5925,17 @@ const KeepAliveImpl = {
5766
5925
  const cacheSubtree = () => {
5767
5926
  if (pendingCacheKey != null) {
5768
5927
  if (isSuspense(instance.subTree.type)) {
5769
- queuePostRenderEffect(() => {
5928
+ const cacheInnerChild = () => {
5770
5929
  const vnode = getInnerChild(instance.subTree);
5771
5930
  if (vnode.component) {
5772
5931
  cache.set(pendingCacheKey, vnode);
5773
5932
  }
5774
- }, instance.subTree.suspense);
5933
+ };
5934
+ if (instance.subTree.suspense.pendingBranch) {
5935
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
5936
+ } else {
5937
+ cacheInnerChild();
5938
+ }
5775
5939
  } else {
5776
5940
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5777
5941
  }
@@ -5906,9 +6070,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5906
6070
  true
5907
6071
  /* prepend */
5908
6072
  );
5909
- onUnmounted(() => {
5910
- remove(keepAliveRoot[type], injected);
5911
- }, target);
6073
+ const removal = injectHook(
6074
+ "um",
6075
+ () => remove(keepAliveRoot[type], injected),
6076
+ target
6077
+ );
6078
+ removal.flags = 16;
5912
6079
  }
5913
6080
  function resetShapeFlag(vnode) {
5914
6081
  vnode.shapeFlag &= -257;
@@ -6331,9 +6498,11 @@ function renderList(source, renderItem, cache, index) {
6331
6498
  }
6332
6499
  } else if (typeof source === "number") {
6333
6500
  if (!Number.isInteger(source) || source < 0) {
6334
- warn$1(
6335
- `The v-for range expects a positive integer value but got ${source}.`
6336
- );
6501
+ {
6502
+ warn$1(
6503
+ `The v-for range expects a positive integer value but got ${source}.`
6504
+ );
6505
+ }
6337
6506
  ret = [];
6338
6507
  } else {
6339
6508
  ret = new Array(source);
@@ -6652,6 +6821,7 @@ function installCompatInstanceProperties(map) {
6652
6821
  $vnode: (i) => i.vnode,
6653
6822
  // some private properties that are likely accessed...
6654
6823
  _self: (i) => i.proxy,
6824
+ _setupProxy: (i) => i.setupState,
6655
6825
  _uid: (i) => i.uid,
6656
6826
  _data: (i) => i.data,
6657
6827
  _isMounted: (i) => i.isMounted,
@@ -7639,7 +7809,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7639
7809
  return vm;
7640
7810
  }
7641
7811
  }
7642
- Vue.version = `2.6.14-compat:${"3.5.43"}`;
7812
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
7643
7813
  Vue.config = singletonApp.config;
7644
7814
  Vue.use = (plugin, ...options) => {
7645
7815
  if (plugin && isFunction(plugin.install)) {
@@ -8796,7 +8966,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
8796
8966
  }
8797
8967
  for (let i = 0; i < nextKeys.length; i++) {
8798
8968
  const key = nextKeys[i];
8799
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
8969
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
8800
8970
  return true;
8801
8971
  }
8802
8972
  }
@@ -9748,6 +9918,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9748
9918
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
9749
9919
  if (needCallTransitionHooks) {
9750
9920
  transition.beforeEnter(el);
9921
+ } else if (transition && !transition.persisted) {
9922
+ el[deferredEnterKey] = true;
9751
9923
  }
9752
9924
  hostInsert(el, container, anchor);
9753
9925
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -9907,15 +10079,16 @@ function baseCreateRenderer(options, createHydrationFns) {
9907
10079
  for (let i = 0; i < newChildren.length; i++) {
9908
10080
  const oldVNode = oldChildren[i];
9909
10081
  const newVNode = newChildren[i];
10082
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
9910
10083
  const container = (
9911
10084
  // oldVNode may be an errored async setup() component inside Suspense
9912
10085
  // which will not have a mounted element
9913
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
10086
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
9914
10087
  // of the Fragment itself so it can move its children.
9915
10088
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
9916
10089
  // which also requires the correct parent container
9917
10090
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
9918
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
10091
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
9919
10092
  // In other cases, the parent container is not actually used so we
9920
10093
  // just pass the block element here to avoid a DOM parentNode call.
9921
10094
  fallbackContainer
@@ -10080,7 +10253,12 @@ function baseCreateRenderer(options, createHydrationFns) {
10080
10253
  }
10081
10254
  if (isHmrUpdating) initialVNode.el = null;
10082
10255
  if (instance.asyncDep) {
10083
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
10256
+ parentSuspense && parentSuspense.registerDep(
10257
+ instance,
10258
+ setupRenderEffect,
10259
+ optimized,
10260
+ namespace
10261
+ );
10084
10262
  if (!initialVNode.el) {
10085
10263
  const placeholder = instance.subTree = createVNode(Comment);
10086
10264
  processCommentNode(null, placeholder, container, anchor);
@@ -10110,6 +10288,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10110
10288
  pushWarningContext(n2);
10111
10289
  }
10112
10290
  n2.el = n1.el;
10291
+ n2.placeholder = n1.placeholder;
10113
10292
  updateComponentPreRender(instance, n2, optimized);
10114
10293
  {
10115
10294
  popWarningContext();
@@ -10121,6 +10300,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10121
10300
  }
10122
10301
  } else {
10123
10302
  n2.el = n1.el;
10303
+ n2.placeholder = n1.placeholder;
10124
10304
  instance.vnode = n2;
10125
10305
  }
10126
10306
  };
@@ -10238,16 +10418,23 @@ function baseCreateRenderer(options, createHydrationFns) {
10238
10418
  } else {
10239
10419
  let { next, bu, u, parent, vnode } = instance;
10240
10420
  {
10241
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
10242
- if (nonHydratedAsyncRoot) {
10421
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
10422
+ if (unresolvedAsyncRoot) {
10243
10423
  if (next) {
10244
10424
  next.el = vnode.el;
10245
10425
  updateComponentPreRender(instance, next, optimized);
10246
10426
  }
10247
- nonHydratedAsyncRoot.asyncDep.then(() => {
10248
- queuePostRenderEffect(() => {
10249
- if (!instance.isUnmounted) update();
10250
- }, parentSuspense);
10427
+ unresolvedAsyncRoot.asyncDep.then(() => {
10428
+ const retry = () => {
10429
+ if (instance.job.flags & 8) return;
10430
+ if (parentSuspense && parentSuspense.pendingBranch) {
10431
+ queuePostRenderEffect(retry, parentSuspense);
10432
+ } else {
10433
+ update();
10434
+ }
10435
+ };
10436
+ retry.flags = 16 | 32;
10437
+ queuePostRenderEffect(retry, parentSuspense);
10251
10438
  });
10252
10439
  return;
10253
10440
  }
@@ -10289,8 +10476,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10289
10476
  patch(
10290
10477
  prevTree,
10291
10478
  nextTree,
10292
- // parent may have changed if it's in a teleport
10293
- hostParentNode(prevTree.el),
10479
+ // parent may have changed if it's in a teleport. a root that is a
10480
+ // pending async component only has its placeholder comment
10481
+ hostParentNode(
10482
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
10483
+ ),
10294
10484
  // anchor may have changed if it's in a fragment
10295
10485
  getNextHostNode(prevTree),
10296
10486
  instance,
@@ -10736,8 +10926,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10736
10926
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
10737
10927
  parentComponent.renderCache[cacheIndex] = void 0;
10738
10928
  }
10739
- if (shapeFlag & 256) {
10740
- parentComponent.ctx.deactivate(vnode);
10929
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
10741
10930
  return;
10742
10931
  }
10743
10932
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -10798,18 +10987,9 @@ function baseCreateRenderer(options, createHydrationFns) {
10798
10987
  };
10799
10988
  const remove = (vnode) => {
10800
10989
  const { type, el, anchor, transition } = vnode;
10801
- if (type === Fragment) {
10802
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
10803
- vnode.children.forEach((child) => {
10804
- if (child.type === Comment) {
10805
- hostRemove(child.el);
10806
- } else {
10807
- remove(child);
10808
- }
10809
- });
10810
- } else {
10811
- removeFragment(el, anchor);
10812
- }
10990
+ const isFragment = type === Fragment;
10991
+ if (isFragment && !transition) {
10992
+ removeFragment(el, anchor);
10813
10993
  return;
10814
10994
  }
10815
10995
  if (type === Static) {
@@ -10819,17 +10999,25 @@ function baseCreateRenderer(options, createHydrationFns) {
10819
10999
  }
10820
11000
  return;
10821
11001
  }
11002
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
10822
11003
  const performRemove = () => {
10823
- hostRemove(el);
11004
+ if (isFragment) {
11005
+ if (hostParentNode(el)) {
11006
+ removeFragment(el, anchor);
11007
+ }
11008
+ } else {
11009
+ hostRemove(el);
11010
+ }
10824
11011
  if (transition && !transition.persisted && transition.afterLeave) {
10825
11012
  transition.afterLeave();
10826
11013
  }
10827
11014
  };
10828
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
11015
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
10829
11016
  const { leave, delayLeave } = transition;
10830
- const performLeave = () => leave(el, performRemove);
11017
+ const leavingEl = leavingNode.el;
11018
+ const performLeave = () => leave(leavingEl, performRemove);
10831
11019
  if (delayLeave) {
10832
- delayLeave(vnode.el, performRemove, performLeave);
11020
+ delayLeave(leavingEl, performRemove, performLeave);
10833
11021
  } else {
10834
11022
  performLeave();
10835
11023
  }
@@ -10863,7 +11051,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10863
11051
  if (job) {
10864
11052
  job.flags |= 8;
10865
11053
  unmount(subTree, instance, parentSuspense, doRemove);
10866
- } else if (instance.vnode.el && subTree) {
11054
+ } else if (subTree) {
10867
11055
  subTree.transition = instance.vnode.transition;
10868
11056
  unmount(subTree, instance, parentSuspense, doRemove);
10869
11057
  }
@@ -10876,9 +11064,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10876
11064
  parentSuspense
10877
11065
  );
10878
11066
  }
10879
- queuePostRenderEffect(() => {
11067
+ const markUnmounted = () => {
10880
11068
  instance.isUnmounted = true;
10881
- }, parentSuspense);
11069
+ };
11070
+ markUnmounted.flags = 16;
11071
+ queuePostRenderEffect(markUnmounted, parentSuspense);
10882
11072
  {
10883
11073
  devtoolsComponentRemoved(instance);
10884
11074
  }
@@ -10899,32 +11089,26 @@ function baseCreateRenderer(options, createHydrationFns) {
10899
11089
  const teleportEnd = el && el[TeleportEndKey];
10900
11090
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
10901
11091
  };
10902
- let isFlushing = false;
10903
11092
  const render = (vnode, container, namespace) => {
10904
- let instance;
10905
- if (vnode == null) {
10906
- if (container._vnode) {
10907
- unmount(container._vnode, null, null, true);
10908
- instance = container._vnode.component;
11093
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
11094
+ flushOnAppMount(() => {
11095
+ if (vnode == null) {
11096
+ if (container._vnode) {
11097
+ unmount(container._vnode, null, null, true);
11098
+ }
11099
+ } else {
11100
+ patch(
11101
+ container._vnode || null,
11102
+ vnode,
11103
+ container,
11104
+ null,
11105
+ null,
11106
+ null,
11107
+ namespace
11108
+ );
10909
11109
  }
10910
- } else {
10911
- patch(
10912
- container._vnode || null,
10913
- vnode,
10914
- container,
10915
- null,
10916
- null,
10917
- null,
10918
- namespace
10919
- );
10920
- }
10921
- container._vnode = vnode;
10922
- if (!isFlushing) {
10923
- isFlushing = true;
10924
- flushPreFlushCbs(instance);
10925
- flushPostFlushCbs();
10926
- isFlushing = false;
10927
- }
11110
+ container._vnode = vnode;
11111
+ }, minUid);
10928
11112
  };
10929
11113
  const internals = {
10930
11114
  p: patch,
@@ -11036,13 +11220,13 @@ function getSequence(arr) {
11036
11220
  }
11037
11221
  return result;
11038
11222
  }
11039
- function locateNonHydratedAsyncRoot(instance) {
11223
+ function locateUnresolvedAsyncRoot(instance) {
11040
11224
  const subComponent = instance.subTree.component;
11041
11225
  if (subComponent) {
11042
11226
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
11043
11227
  return subComponent;
11044
11228
  } else {
11045
- return locateNonHydratedAsyncRoot(subComponent);
11229
+ return locateUnresolvedAsyncRoot(subComponent);
11046
11230
  }
11047
11231
  }
11048
11232
  }
@@ -11060,11 +11244,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
11060
11244
  if (instance) {
11061
11245
  return resolveAsyncComponentPlaceholder(instance.subTree);
11062
11246
  }
11247
+ const suspense = anchorVnode.suspense;
11248
+ if (suspense && suspense.activeBranch) {
11249
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
11250
+ }
11063
11251
  return null;
11064
11252
  }
11065
11253
 
11066
11254
  const isSuspense = (type) => type.__isSuspense;
11067
11255
  let suspenseId = 0;
11256
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
11068
11257
  const SuspenseImpl = {
11069
11258
  name: "Suspense",
11070
11259
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -11086,11 +11275,22 @@ const SuspenseImpl = {
11086
11275
  rendererInternals
11087
11276
  );
11088
11277
  } else {
11089
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
11090
- n2.suspense = n1.suspense;
11091
- n2.suspense.vnode = n2;
11092
- n2.el = n1.el;
11093
- return;
11278
+ const suspense = n1.suspense;
11279
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
11280
+ const owner = suspense.parentComponent;
11281
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
11282
+ if (retained ? (
11283
+ // deps can outlive the pending branch: skip only while it exists
11284
+ parentSuspense.pendingBranch && !isSameVNodeType(
11285
+ n2.ssContent,
11286
+ suspense.pendingBranch || suspense.activeBranch
11287
+ )
11288
+ ) : !suspense.isInFallback) {
11289
+ n2.suspense = suspense;
11290
+ suspense.vnode = n2;
11291
+ n2.el = n1.el;
11292
+ return;
11293
+ }
11094
11294
  }
11095
11295
  patchSuspense(
11096
11296
  n1,
@@ -11115,6 +11315,38 @@ function triggerEvent(vnode, name) {
11115
11315
  eventListener();
11116
11316
  }
11117
11317
  }
11318
+ function enterDeferred(branch) {
11319
+ const enters = [];
11320
+ collectDeferredEnters(branch, enters, true);
11321
+ if (enters.length) {
11322
+ queuePostFlushCb(enters);
11323
+ }
11324
+ }
11325
+ function collectDeferredEnters(vnode, enters, isRoot) {
11326
+ const { el, transition, children, shapeFlag } = vnode;
11327
+ if (shapeFlag & 6) {
11328
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
11329
+ return;
11330
+ }
11331
+ if (shapeFlag & (128 | 64)) {
11332
+ return;
11333
+ }
11334
+ if (shapeFlag & 1) {
11335
+ if (!isRoot && el && el[deferredEnterKey]) {
11336
+ el[deferredEnterKey] = void 0;
11337
+ if (transition && !transition.persisted) {
11338
+ transition.beforeEnter(el);
11339
+ enters.push(() => transition.enter(el));
11340
+ }
11341
+ }
11342
+ isRoot = false;
11343
+ }
11344
+ if (shapeFlag & 16) {
11345
+ for (let i = 0; i < children.length; i++) {
11346
+ collectDeferredEnters(children[i], enters, isRoot);
11347
+ }
11348
+ }
11349
+ }
11118
11350
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
11119
11351
  const {
11120
11352
  p: patch,
@@ -11214,7 +11446,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11214
11446
  unmount(pendingBranch, parentComponent, suspense);
11215
11447
  }
11216
11448
  suspense.deps = 0;
11217
- suspense.effects.length = 0;
11449
+ discardEffects(suspense);
11218
11450
  suspense.hiddenContainer = createElement("div");
11219
11451
  if (isInFallback) {
11220
11452
  patch(
@@ -11292,11 +11524,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11292
11524
  } else {
11293
11525
  triggerEvent(n2, "onPending");
11294
11526
  suspense.pendingBranch = newBranch;
11295
- if (newBranch.shapeFlag & 512) {
11296
- suspense.pendingId = newBranch.component.suspenseId;
11297
- } else {
11298
- suspense.pendingId = suspenseId++;
11299
- }
11527
+ suspense.pendingId = suspenseId++;
11300
11528
  patch(
11301
11529
  null,
11302
11530
  newBranch,
@@ -11311,12 +11539,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11311
11539
  if (suspense.deps <= 0) {
11312
11540
  suspense.resolve();
11313
11541
  } else {
11314
- const { timeout, pendingId } = suspense;
11542
+ const { timeout } = suspense;
11315
11543
  if (timeout > 0) {
11316
- setTimeout(() => {
11317
- if (suspense.pendingId === pendingId) {
11318
- suspense.fallback(newFallback);
11319
- }
11544
+ suspense.timeoutTimer = setTimeout(() => {
11545
+ suspense.timeoutTimer = void 0;
11546
+ suspense.fallback(suspense.vnode.ssFallback);
11320
11547
  }, timeout);
11321
11548
  } else if (timeout === 0) {
11322
11549
  suspense.fallback(newFallback);
@@ -11363,6 +11590,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11363
11590
  deps: 0,
11364
11591
  pendingId: suspenseId++,
11365
11592
  timeout: typeof timeout === "number" ? timeout : -1,
11593
+ timeoutTimer: void 0,
11366
11594
  activeBranch: null,
11367
11595
  isFallbackMountPending: false,
11368
11596
  pendingBranch: null,
@@ -11401,7 +11629,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11401
11629
  let hasUpdatedAnchor = false;
11402
11630
  if (delayEnter) {
11403
11631
  activeBranch.transition.afterLeave = () => {
11404
- if (pendingId === suspense.pendingId) {
11632
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
11633
+ enterDeferred(pendingBranch);
11405
11634
  move(
11406
11635
  pendingBranch,
11407
11636
  container2,
@@ -11416,7 +11645,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11416
11645
  };
11417
11646
  }
11418
11647
  if (activeBranch && !suspense.isFallbackMountPending) {
11419
- if (parentNode(activeBranch.el) === container2) {
11648
+ if (parentNode(
11649
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
11650
+ ) === container2) {
11420
11651
  anchor = next(activeBranch);
11421
11652
  hasUpdatedAnchor = true;
11422
11653
  }
@@ -11426,13 +11657,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11426
11657
  }
11427
11658
  }
11428
11659
  if (!delayEnter) {
11660
+ enterDeferred(pendingBranch);
11429
11661
  move(pendingBranch, container2, anchor, 0);
11430
11662
  }
11431
11663
  }
11664
+ clearTimeout(suspense.timeoutTimer);
11665
+ suspense.timeoutTimer = void 0;
11432
11666
  suspense.isFallbackMountPending = false;
11433
11667
  setActiveBranch(suspense, pendingBranch);
11434
11668
  suspense.pendingBranch = null;
11435
11669
  suspense.isInFallback = false;
11670
+ let kept = 0;
11671
+ for (let i = 0; i < effects.length; i++) {
11672
+ const effect = effects[i];
11673
+ if (effect.flags & 32) {
11674
+ queuePostFlushCb(effect);
11675
+ } else {
11676
+ effects[kept++] = effect;
11677
+ }
11678
+ }
11679
+ effects.length = kept;
11436
11680
  let parent = suspense.parent;
11437
11681
  let hasUnresolvedAncestor = false;
11438
11682
  while (parent) {
@@ -11461,7 +11705,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11461
11705
  triggerEvent(vnode2, "onResolve");
11462
11706
  },
11463
11707
  fallback(fallbackVNode) {
11464
- if (!suspense.pendingBranch) {
11708
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
11465
11709
  return;
11466
11710
  }
11467
11711
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -11469,7 +11713,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11469
11713
  const anchor2 = next(activeBranch);
11470
11714
  const mountFallback = () => {
11471
11715
  suspense.isFallbackMountPending = false;
11472
- if (!suspense.isInFallback) {
11716
+ if (suspense.isUnmounted || !suspense.isInFallback) {
11473
11717
  return;
11474
11718
  }
11475
11719
  const latestFallback = suspense.vnode.ssFallback;
@@ -11512,25 +11756,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11512
11756
  next() {
11513
11757
  return suspense.activeBranch && next(suspense.activeBranch);
11514
11758
  },
11515
- registerDep(instance, setupRenderEffect, optimized2) {
11759
+ // `namespace` intentionally shadows the boundary's own: the dep must be
11760
+ // mounted with the namespace of the position it was rendered at, which can
11761
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
11762
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
11516
11763
  const isInPendingSuspense = !!suspense.pendingBranch;
11517
11764
  if (isInPendingSuspense) {
11518
11765
  suspense.deps++;
11519
11766
  }
11520
11767
  const hydratedEl = instance.vnode.el;
11521
- instance.asyncDep.catch((err) => {
11522
- handleError(err, instance, 0);
11523
- }).then((asyncSetupResult) => {
11524
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11525
- return;
11526
- }
11527
- unsetCurrentInstance();
11528
- if (hydratedEl && !instance.scope.active) {
11529
- if (isInPendingSuspense && --suspense.deps === 0) {
11530
- suspense.resolve();
11531
- }
11532
- return;
11533
- }
11768
+ const render = (asyncSetupResult) => {
11534
11769
  instance.asyncResolved = true;
11535
11770
  const { vnode: vnode2 } = instance;
11536
11771
  {
@@ -11552,7 +11787,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11552
11787
  // consider the comment placeholder case.
11553
11788
  hydratedEl ? null : next(instance.subTree),
11554
11789
  suspense,
11555
- namespace,
11790
+ namespace2,
11556
11791
  optimized2
11557
11792
  );
11558
11793
  if (placeholder) {
@@ -11563,13 +11798,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11563
11798
  {
11564
11799
  popWarningContext();
11565
11800
  }
11566
- if (isInPendingSuspense && --suspense.deps === 0) {
11801
+ };
11802
+ instance.asyncDep.catch((err) => {
11803
+ handleError(err, instance, 0, false, true);
11804
+ return () => null;
11805
+ }).then((asyncSetupResult) => {
11806
+ if (instance.isUnmounted || suspense.isUnmounted) {
11807
+ return;
11808
+ }
11809
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
11810
+ unsetCurrentInstance();
11811
+ if (!instance.scope.active) {
11812
+ if (isPendingDep && --suspense.deps === 0) {
11813
+ suspense.resolve();
11814
+ }
11815
+ return;
11816
+ }
11817
+ if (!isPendingDep && suspense.pendingBranch) {
11818
+ const job = () => {
11819
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
11820
+ return;
11821
+ }
11822
+ if (suspense.pendingBranch) {
11823
+ queueEffectWithSuspense(job, suspense);
11824
+ } else {
11825
+ render(asyncSetupResult);
11826
+ }
11827
+ };
11828
+ job.flags = 16 | 32;
11829
+ queueEffectWithSuspense(job, suspense);
11830
+ return;
11831
+ }
11832
+ render(asyncSetupResult);
11833
+ if (isPendingDep && --suspense.deps === 0) {
11567
11834
  suspense.resolve();
11568
11835
  }
11569
11836
  });
11570
11837
  },
11571
11838
  unmount(parentSuspense2, doRemove) {
11572
11839
  suspense.isUnmounted = true;
11840
+ clearTimeout(suspense.timeoutTimer);
11841
+ suspense.timeoutTimer = void 0;
11842
+ if (parentSuspenseId !== void 0) {
11843
+ const parent = suspense.parent;
11844
+ const pendingId = parentSuspenseId;
11845
+ parentSuspenseId = void 0;
11846
+ queuePostFlushCb(() => {
11847
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
11848
+ parent.resolve();
11849
+ }
11850
+ });
11851
+ }
11573
11852
  if (suspense.activeBranch) {
11574
11853
  unmount(
11575
11854
  suspense.activeBranch,
@@ -11579,12 +11858,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11579
11858
  );
11580
11859
  }
11581
11860
  if (suspense.pendingBranch) {
11582
- unmount(
11583
- suspense.pendingBranch,
11584
- parentComponent,
11585
- parentSuspense2,
11586
- doRemove
11587
- );
11861
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
11862
+ discardEffects(suspense);
11588
11863
  }
11589
11864
  }
11590
11865
  };
@@ -11654,6 +11929,16 @@ function normalizeSuspenseSlot(s) {
11654
11929
  }
11655
11930
  return s;
11656
11931
  }
11932
+ function discardEffects(suspense) {
11933
+ const { effects } = suspense;
11934
+ for (let i = 0; i < effects.length; i++) {
11935
+ const effect = effects[i];
11936
+ if (effect.flags & 16) {
11937
+ queuePostFlushCb(effect);
11938
+ }
11939
+ }
11940
+ effects.length = 0;
11941
+ }
11657
11942
  function queueEffectWithSuspense(fn, suspense) {
11658
11943
  if (suspense && suspense.pendingBranch) {
11659
11944
  if (isArray(fn)) {
@@ -11969,7 +12254,8 @@ Component that was made reactive: `,
11969
12254
  }
11970
12255
  function guardReactiveProps(props) {
11971
12256
  if (!props) return null;
11972
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
12257
+ if (isProxy(props)) return extend({}, props);
12258
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
11973
12259
  }
11974
12260
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
11975
12261
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -12151,8 +12437,11 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
12151
12437
  ]);
12152
12438
  }
12153
12439
 
12154
- const emptyAppContext = createAppContext();
12440
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
12155
12441
  let uid = 0;
12442
+ function getNextUid() {
12443
+ return uid;
12444
+ }
12156
12445
  function createComponentInstance(vnode, parent, suspense) {
12157
12446
  const type = vnode.type;
12158
12447
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -12361,7 +12650,8 @@ function setupStatefulComponent(instance, isSSR) {
12361
12650
  setInSSRSetupState(false);
12362
12651
  }
12363
12652
  }).catch((e) => {
12364
- handleError(e, instance, 0);
12653
+ handleError(e, instance, 0, void 0, true);
12654
+ instance.ssrRender = (_, push) => push("<!---->");
12365
12655
  });
12366
12656
  } else {
12367
12657
  instance.asyncDep = setupResult;
@@ -12481,11 +12771,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
12481
12771
  }
12482
12772
  }
12483
12773
  }
12774
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
12484
12775
  const attrsProxyHandlers = {
12485
12776
  get(target, key) {
12486
12777
  markAttrsAccessed();
12487
12778
  track(target, "get", "");
12488
- return target[key];
12779
+ return key === rawAttrsKey ? target : target[key];
12489
12780
  },
12490
12781
  set() {
12491
12782
  warn$1(`setupContext.attrs is readonly.`);
@@ -12837,7 +13128,7 @@ function isMemoSame(cached, memo) {
12837
13128
  return true;
12838
13129
  }
12839
13130
 
12840
- const version = "3.5.43";
13131
+ const version = "3.5.45";
12841
13132
  const warn = warn$1 ;
12842
13133
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12843
13134
  const devtools = devtools$1 ;
@@ -13457,7 +13748,9 @@ function patchStyle(el, prev, next) {
13457
13748
  }
13458
13749
  }
13459
13750
  if (vShowOriginalDisplay in el) {
13460
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
13751
+ if (!isCssString || prev !== next) {
13752
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
13753
+ }
13461
13754
  if (el[vShowHidden]) {
13462
13755
  style.display = "none";
13463
13756
  }
@@ -13983,7 +14276,9 @@ class VueElement extends BaseClass {
13983
14276
  "Custom element style injection is not supported when using shadowRoot: false"
13984
14277
  );
13985
14278
  }
13986
- this._mount(def);
14279
+ if (this._connected) {
14280
+ this._mount(def);
14281
+ }
13987
14282
  };
13988
14283
  const asyncDef = this._def.__asyncLoader;
13989
14284
  if (asyncDef) {
@@ -14353,6 +14648,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
14353
14648
  const newPositionMap = /* @__PURE__ */ new WeakMap();
14354
14649
  const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
14355
14650
  const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
14651
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
14356
14652
  const decorate = (t) => {
14357
14653
  delete t.props.mode;
14358
14654
  {
@@ -14371,21 +14667,30 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
14371
14667
  const state = useTransitionState();
14372
14668
  let prevChildren;
14373
14669
  let children;
14374
- onUpdated(() => {
14375
- if (!prevChildren.length) {
14376
- return;
14670
+ let origins;
14671
+ let moves;
14672
+ const willMove = () => {
14673
+ if (moves === void 0) {
14674
+ moves = prevChildren.length > 0 && hasCSSTransform(
14675
+ prevChildren[0].el,
14676
+ instance.vnode.el,
14677
+ resolveMoveClass(props)
14678
+ );
14377
14679
  }
14378
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
14379
- if (!hasCSSTransform(
14380
- prevChildren[0].el,
14381
- instance.vnode.el,
14382
- moveClass
14383
- )) {
14680
+ return moves;
14681
+ };
14682
+ onUpdated(() => {
14683
+ pendingGroups.delete(instance);
14684
+ if (!willMove()) {
14384
14685
  prevChildren = [];
14686
+ origins = void 0;
14385
14687
  return;
14386
14688
  }
14689
+ const moveClass = resolveMoveClass(props);
14387
14690
  prevChildren.forEach(callPendingCbs);
14388
- prevChildren.forEach(recordPosition);
14691
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
14692
+ origins = void 0;
14693
+ prevChildren.forEach((c) => recordPosition(c, shift));
14389
14694
  const movedChildren = prevChildren.filter(applyTranslation);
14390
14695
  forceReflow(instance.vnode.el);
14391
14696
  movedChildren.forEach((c) => {
@@ -14418,6 +14723,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
14418
14723
  tag = "span";
14419
14724
  }
14420
14725
  prevChildren = [];
14726
+ moves = void 0;
14421
14727
  if (children) {
14422
14728
  for (let i = 0; i < children.length; i++) {
14423
14729
  const child = children[i];
@@ -14449,6 +14755,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
14449
14755
  warn(`<TransitionGroup> children must be keyed.`);
14450
14756
  }
14451
14757
  }
14758
+ if (prevChildren.length) {
14759
+ origins = getOrigins(instance);
14760
+ pendingGroups.set(instance, willMove);
14761
+ }
14452
14762
  return createVNode(tag, null, children);
14453
14763
  };
14454
14764
  }
@@ -14463,8 +14773,11 @@ function callPendingCbs(c) {
14463
14773
  el[enterCbKey]();
14464
14774
  }
14465
14775
  }
14466
- function recordPosition(c) {
14467
- newPositionMap.set(c, getPosition(c.el));
14776
+ function resolveMoveClass(props) {
14777
+ return props.moveClass || `${props.name || "v"}-move`;
14778
+ }
14779
+ function recordPosition(c, shift) {
14780
+ newPositionMap.set(c, getPosition(c.el, shift));
14468
14781
  }
14469
14782
  function applyTranslation(c) {
14470
14783
  const oldPos = positionMap.get(c);
@@ -14488,13 +14801,41 @@ function applyTranslation(c) {
14488
14801
  return c;
14489
14802
  }
14490
14803
  }
14491
- function getPosition(el) {
14804
+ function getPosition(el, shift) {
14492
14805
  const rect = el.getBoundingClientRect();
14493
14806
  return {
14494
- left: rect.left,
14495
- top: rect.top
14807
+ left: rect.left - (shift ? shift.left : 0),
14808
+ top: rect.top - (shift ? shift.top : 0)
14496
14809
  };
14497
14810
  }
14811
+ function getOrigins(instance) {
14812
+ let origins;
14813
+ for (let group = instance.parent; group; group = group.parent) {
14814
+ const willMove = pendingGroups.get(group);
14815
+ if (willMove) {
14816
+ const item = findItem(group.vnode.el, instance.vnode.el);
14817
+ if (item) {
14818
+ (origins || (origins = [])).push(
14819
+ extend(getPosition(item), { item, willMove })
14820
+ );
14821
+ }
14822
+ }
14823
+ }
14824
+ return origins;
14825
+ }
14826
+ function findItem(root, node) {
14827
+ const container = root.nodeType === 1 ? root : root.parentNode;
14828
+ while (node && node.parentNode !== container) {
14829
+ node = node.parentNode;
14830
+ }
14831
+ if (node && node.nodeType === 1) {
14832
+ return node;
14833
+ }
14834
+ }
14835
+ function getOriginShift(origins, root) {
14836
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
14837
+ return origin && getPosition(origin.item, origin);
14838
+ }
14498
14839
  function hasCSSTransform(el, root, moveClass) {
14499
14840
  const clone = el.cloneNode();
14500
14841
  const _vtc = el[vtcKey];
@@ -14689,18 +15030,18 @@ const vModelSelect = {
14689
15030
  },
14690
15031
  // set value in mounted & updated because <select> relies on its children
14691
15032
  // <option>s.
14692
- mounted(el, { value }) {
14693
- setSelected(el, value);
15033
+ mounted(el, { value, modifiers: { number } }) {
15034
+ setSelected(el, value, number);
14694
15035
  },
14695
15036
  beforeUpdate(el, { value }, vnode) {
14696
15037
  el._modelValue = value;
14697
15038
  el[assignKey] = getModelAssigner(vnode);
14698
15039
  },
14699
- updated(el, { value }) {
15040
+ updated(el, { value, modifiers: { number } }) {
14700
15041
  const pending = el._pendingValue;
14701
15042
  el._pendingValue = void 0;
14702
15043
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14703
- setSelected(el, value);
15044
+ setSelected(el, value, number);
14704
15045
  }
14705
15046
  }
14706
15047
  };
@@ -14716,7 +15057,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
14716
15057
  }
14717
15058
  return false;
14718
15059
  }
14719
- function setSelected(el, value) {
15060
+ function setSelected(el, value, number = false) {
14720
15061
  const isMultiple = el.multiple;
14721
15062
  const isArrayValue = isArray(value);
14722
15063
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -14737,7 +15078,7 @@ function setSelected(el, value) {
14737
15078
  option.selected = looseIndexOf(value, optionValue) > -1;
14738
15079
  }
14739
15080
  } else {
14740
- option.selected = value.has(optionValue);
15081
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
14741
15082
  }
14742
15083
  } else if (looseEqual(getValue(option), value)) {
14743
15084
  if (el.selectedIndex !== i) el.selectedIndex = i;