@vue/runtime-dom 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/runtime-dom v3.5.43
2
+ * @vue/runtime-dom v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -64,24 +64,20 @@ var VueRuntimeDOM = (function (exports) {
64
64
  });
65
65
  };
66
66
  const camelizeRE = /-\w/g;
67
- const camelize = cacheStringFunction(
68
- (str) => {
69
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
70
- }
71
- );
67
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
68
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
69
+ });
72
70
  const hyphenateRE = /\B([A-Z])/g;
73
- const hyphenate = cacheStringFunction(
71
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
74
72
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
75
73
  );
76
- const capitalize = cacheStringFunction((str) => {
74
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
77
75
  return str.charAt(0).toUpperCase() + str.slice(1);
78
76
  });
79
- const toHandlerKey = cacheStringFunction(
80
- (str) => {
81
- const s = str ? `on${capitalize(str)}` : ``;
82
- return s;
83
- }
84
- );
77
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
78
+ const s = str ? `on${capitalize(str)}` : ``;
79
+ return s;
80
+ });
85
81
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
86
82
  const invokeArrayFns = (fns, ...arg) => {
87
83
  for (let i = 0; i < fns.length; i++) {
@@ -194,7 +190,7 @@ var VueRuntimeDOM = (function (exports) {
194
190
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
195
191
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
196
192
 
197
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
193
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
198
194
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
199
195
  const isBooleanAttr = /* @__PURE__ */ makeMap(
200
196
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -538,7 +534,11 @@ var VueRuntimeDOM = (function (exports) {
538
534
  }
539
535
  function onScopeDispose(fn, failSilently = false) {
540
536
  if (activeEffectScope) {
541
- activeEffectScope.cleanups.push(fn);
537
+ if (activeEffectScope.active) {
538
+ activeEffectScope.cleanups.push(fn);
539
+ } else {
540
+ fn();
541
+ }
542
542
  } else if (!failSilently) {
543
543
  warn$2(
544
544
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1242,19 +1242,41 @@ var VueRuntimeDOM = (function (exports) {
1242
1242
  };
1243
1243
  function iterator(self, method, wrapValue) {
1244
1244
  const arr = shallowReadArray(self);
1245
- const iter = arr[method]();
1245
+ const methodFn = arr[method];
1246
+ const iter = methodFn.call(arr);
1246
1247
  if (arr !== self && !isShallow(self)) {
1247
- iter._next = iter.next;
1248
- iter.next = () => {
1249
- const result = iter._next();
1250
- if (!result.done) {
1251
- result.value = wrapValue(result.value);
1248
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
1249
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
1250
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
1251
+ if (methodFn !== arrayProto[method]) {
1252
+ Object.defineProperties(wrapped, {
1253
+ return: {
1254
+ get() {
1255
+ const fn = iter.return;
1256
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1257
+ }
1258
+ },
1259
+ throw: {
1260
+ get() {
1261
+ const fn = iter.throw;
1262
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1263
+ }
1264
+ }
1265
+ });
1252
1266
  }
1253
- return result;
1254
- };
1267
+ return wrapped;
1268
+ }
1269
+ iter._next = iter.next;
1270
+ iter.next = () => wrapResult(iter._next(), wrapValue);
1255
1271
  }
1256
1272
  return iter;
1257
1273
  }
1274
+ function wrapResult(result, wrapValue) {
1275
+ if (!result.done) {
1276
+ result.value = wrapValue(result.value);
1277
+ }
1278
+ return result;
1279
+ }
1258
1280
  const arrayProto = Array.prototype;
1259
1281
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1260
1282
  const arr = shallowReadArray(self);
@@ -1323,7 +1345,7 @@ var VueRuntimeDOM = (function (exports) {
1323
1345
  }
1324
1346
 
1325
1347
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1326
- const builtInSymbols = new Set(
1348
+ const builtInSymbols = /* @__PURE__ */ new Set(
1327
1349
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1328
1350
  );
1329
1351
  function hasOwnProperty(key) {
@@ -1677,6 +1699,8 @@ var VueRuntimeDOM = (function (exports) {
1677
1699
  return !isReadonly2;
1678
1700
  } else if (key === "__v_isReadonly") {
1679
1701
  return isReadonly2;
1702
+ } else if (key === "__v_isShallow") {
1703
+ return shallow;
1680
1704
  } else if (key === "__v_raw") {
1681
1705
  return target;
1682
1706
  }
@@ -2222,9 +2246,11 @@ var VueRuntimeDOM = (function (exports) {
2222
2246
  if (once && cb) {
2223
2247
  const _cb = cb;
2224
2248
  cb = (...args) => {
2225
- const res = _cb(...args);
2226
- watchHandle();
2227
- return res;
2249
+ try {
2250
+ return _cb(...args);
2251
+ } finally {
2252
+ watchHandle();
2253
+ }
2228
2254
  };
2229
2255
  }
2230
2256
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2235,12 +2261,13 @@ var VueRuntimeDOM = (function (exports) {
2235
2261
  if (cb) {
2236
2262
  const newValue = effect.run();
2237
2263
  if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2238
- if (cleanup) {
2239
- cleanup();
2240
- }
2241
2264
  const currentWatcher = activeWatcher;
2242
- activeWatcher = effect;
2265
+ pauseTracking();
2243
2266
  try {
2267
+ if (cleanup) {
2268
+ cleanup();
2269
+ }
2270
+ activeWatcher = effect;
2244
2271
  const args = [
2245
2272
  newValue,
2246
2273
  // pass undefined as the old value when it's changed for the first time
@@ -2254,6 +2281,7 @@ var VueRuntimeDOM = (function (exports) {
2254
2281
  );
2255
2282
  } finally {
2256
2283
  activeWatcher = currentWatcher;
2284
+ resetTracking();
2257
2285
  }
2258
2286
  }
2259
2287
  } else {
@@ -2527,7 +2555,7 @@ var VueRuntimeDOM = (function (exports) {
2527
2555
  const res = callWithErrorHandling(fn, instance, type, args);
2528
2556
  if (res && isPromise(res)) {
2529
2557
  res.catch((err) => {
2530
- handleError(err, instance, type);
2558
+ handleError(err, instance, type, void 0, true);
2531
2559
  });
2532
2560
  }
2533
2561
  return res;
@@ -2544,7 +2572,7 @@ var VueRuntimeDOM = (function (exports) {
2544
2572
  );
2545
2573
  }
2546
2574
  }
2547
- function handleError(err, instance, type, throwInDev = true) {
2575
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2548
2576
  const contextVNode = instance ? instance.vnode : null;
2549
2577
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2550
2578
  if (instance) {
@@ -2553,7 +2581,9 @@ var VueRuntimeDOM = (function (exports) {
2553
2581
  const errorInfo = ErrorTypeStrings$1[type] ;
2554
2582
  while (cur) {
2555
2583
  const errorCapturedHooks = cur.ec;
2556
- if (errorCapturedHooks) {
2584
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2585
+ // are deferred or discarded by Suspense.
2586
+ (!isAsyncError || cur.scope.active)) {
2557
2587
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2558
2588
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2559
2589
  return;
@@ -2654,21 +2684,21 @@ var VueRuntimeDOM = (function (exports) {
2654
2684
  }
2655
2685
  queueFlush();
2656
2686
  }
2657
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2687
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
2658
2688
  {
2659
2689
  seen = seen || /* @__PURE__ */ new Map();
2660
2690
  }
2661
2691
  for (; i < queue.length; i++) {
2662
2692
  const cb = queue[i];
2663
2693
  if (cb && cb.flags & 2) {
2664
- if (instance && cb.id !== instance.uid) {
2694
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
2665
2695
  continue;
2666
2696
  }
2667
2697
  if (checkRecursiveUpdates(seen, cb)) {
2668
2698
  continue;
2669
2699
  }
2670
2700
  queue.splice(i, 1);
2671
- i--;
2701
+ i = instance ? i - 1 : flushIndex;
2672
2702
  if (cb.flags & 4) {
2673
2703
  cb.flags &= -2;
2674
2704
  }
@@ -2679,12 +2709,23 @@ var VueRuntimeDOM = (function (exports) {
2679
2709
  }
2680
2710
  }
2681
2711
  }
2682
- function flushPostFlushCbs(seen) {
2712
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2683
2713
  if (pendingPostFlushCbs.length) {
2684
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
2685
- (a, b) => getId(a) - getId(b)
2686
- );
2687
- pendingPostFlushCbs.length = 0;
2714
+ let cbs = pendingPostFlushCbs;
2715
+ let kept = 0;
2716
+ if (skip) {
2717
+ cbs = [];
2718
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
2719
+ const cb = pendingPostFlushCbs[i];
2720
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
2721
+ pendingPostFlushCbs[kept++] = cb;
2722
+ } else {
2723
+ cbs.push(cb);
2724
+ }
2725
+ }
2726
+ }
2727
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
2728
+ pendingPostFlushCbs.length = kept;
2688
2729
  if (activePostFlushCbs) {
2689
2730
  for (let i = 0; i < deduped.length; i++) {
2690
2731
  activePostFlushCbs.push(deduped[i]);
@@ -2710,6 +2751,22 @@ var VueRuntimeDOM = (function (exports) {
2710
2751
  postFlushIndex = 0;
2711
2752
  }
2712
2753
  }
2754
+ let isFlushing = false;
2755
+ function flushOnAppMount(fn, minUid) {
2756
+ if (isFlushing) {
2757
+ fn();
2758
+ return;
2759
+ }
2760
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
2761
+ fn();
2762
+ isFlushing = true;
2763
+ try {
2764
+ flushPreFlushCbs(void 0, minUid);
2765
+ flushPostFlushCbs(void 0, queued, minUid);
2766
+ } finally {
2767
+ isFlushing = false;
2768
+ }
2769
+ }
2713
2770
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2714
2771
  function flushJobs(seen) {
2715
2772
  {
@@ -2854,14 +2911,32 @@ var VueRuntimeDOM = (function (exports) {
2854
2911
  instance.ceReload(newComp.styles);
2855
2912
  dirtyInstances.delete(instance);
2856
2913
  } else if (instance.parent) {
2857
- queueJob(() => {
2858
- if (!(instance.job.flags & 8)) {
2859
- isHmrUpdating = true;
2914
+ const update = () => {
2915
+ if (!instance.scope.active) return;
2916
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2917
+ if (pending) {
2918
+ pending.asyncDep.catch(NOOP).then(() => {
2919
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2920
+ queueJob(update);
2921
+ }
2922
+ });
2923
+ return;
2924
+ }
2925
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2926
+ if (!dirtyInstances) {
2927
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2928
+ }
2929
+ dirtyInstances.add(instance);
2930
+ isHmrUpdating = true;
2931
+ try {
2860
2932
  instance.parent.update();
2933
+ } finally {
2861
2934
  isHmrUpdating = false;
2862
2935
  dirtyInstances.delete(instance);
2936
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2863
2937
  }
2864
- });
2938
+ };
2939
+ queueJob(update);
2865
2940
  } else if (instance.appContext.reload) {
2866
2941
  instance.appContext.reload();
2867
2942
  } else if (typeof window !== "undefined") {
@@ -3077,12 +3152,31 @@ var VueRuntimeDOM = (function (exports) {
3077
3152
  return vnode;
3078
3153
  }
3079
3154
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3080
- const bindings = vnode.dirs;
3155
+ let hookVNode = vnode;
3156
+ if (name === "beforeMount") {
3157
+ vnode._mount = vnode;
3158
+ } else if (name === "beforeUpdate") {
3159
+ const mount = prevVNode && prevVNode._mount;
3160
+ if (mount) {
3161
+ mount._latest = vnode;
3162
+ vnode._mount = mount;
3163
+ }
3164
+ } else if (name === "mounted") {
3165
+ const latest = vnode._latest;
3166
+ vnode._mount = vnode._latest = void 0;
3167
+ if (latest) {
3168
+ hookVNode = latest;
3169
+ latest._mount = void 0;
3170
+ }
3171
+ }
3172
+ const bindings = hookVNode.dirs;
3081
3173
  const oldBindings = prevVNode && prevVNode.dirs;
3082
3174
  for (let i = 0; i < bindings.length; i++) {
3083
- const binding = bindings[i];
3175
+ let binding = bindings[i];
3084
3176
  if (oldBindings) {
3085
3177
  binding.oldValue = oldBindings[i].value;
3178
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3179
+ binding = extend({}, binding, { oldValue: void 0 });
3086
3180
  }
3087
3181
  let hook = binding.dir[name];
3088
3182
  if (hook) {
@@ -3090,7 +3184,7 @@ var VueRuntimeDOM = (function (exports) {
3090
3184
  callWithAsyncErrorHandling(hook, instance, 8, [
3091
3185
  vnode.el,
3092
3186
  binding,
3093
- vnode,
3187
+ hookVNode,
3094
3188
  prevVNode
3095
3189
  ]);
3096
3190
  resetTracking();
@@ -3190,6 +3284,7 @@ var VueRuntimeDOM = (function (exports) {
3190
3284
  let isPre = false;
3191
3285
  if (flush === "post") {
3192
3286
  baseWatchOptions.scheduler = (job) => {
3287
+ job.i = instance;
3193
3288
  queuePostRenderEffect(job, instance && instance.suspense);
3194
3289
  };
3195
3290
  } else if (flush !== "sync") {
@@ -3484,7 +3579,11 @@ var VueRuntimeDOM = (function (exports) {
3484
3579
  };
3485
3580
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
3486
3581
  if (moveType === 0) {
3582
+ if (vnode.targetStart) {
3583
+ insert(vnode.targetStart, container, parentAnchor);
3584
+ }
3487
3585
  insert(vnode.targetAnchor, container, parentAnchor);
3586
+ parentAnchor = vnode.targetAnchor;
3488
3587
  }
3489
3588
  const { el, anchor, shapeFlag, children, props } = vnode;
3490
3589
  const isReorder = moveType === 2;
@@ -3653,10 +3752,6 @@ var VueRuntimeDOM = (function (exports) {
3653
3752
  onAfterAppear: TransitionHookValidator,
3654
3753
  onAppearCancelled: TransitionHookValidator
3655
3754
  };
3656
- const recursiveGetSubtree = (instance) => {
3657
- const subTree = instance.subTree;
3658
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3659
- };
3660
3755
  const BaseTransitionImpl = {
3661
3756
  name: `BaseTransition`,
3662
3757
  props: BaseTransitionPropsValidators,
@@ -3685,19 +3780,17 @@ var VueRuntimeDOM = (function (exports) {
3685
3780
  if (!innerChild) {
3686
3781
  return emptyPlaceholder(child);
3687
3782
  }
3688
- let enterHooks = resolveTransitionHooks(
3783
+ const enterHooks = resolveTransitionHooks(
3689
3784
  innerChild,
3690
3785
  rawProps,
3691
3786
  state,
3692
- instance,
3693
- // #11061, ensure enterHooks is fresh after clone
3694
- (hooks) => enterHooks = hooks
3787
+ instance
3695
3788
  );
3696
3789
  if (innerChild.type !== Comment) {
3697
3790
  setTransitionHooks(innerChild, enterHooks);
3698
3791
  }
3699
3792
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3700
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3793
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
3701
3794
  let leavingHooks = resolveTransitionHooks(
3702
3795
  oldInnerChild,
3703
3796
  rawProps,
@@ -3710,7 +3803,17 @@ var VueRuntimeDOM = (function (exports) {
3710
3803
  leavingHooks.afterLeave = () => {
3711
3804
  state.isLeaving = false;
3712
3805
  if (!(instance.job.flags & 8)) {
3713
- instance.update();
3806
+ if (instance.effect.flags & 2) {
3807
+ const job = () => {
3808
+ if (!(instance.job.flags & 8)) {
3809
+ instance.update();
3810
+ }
3811
+ };
3812
+ job.i = instance;
3813
+ queueJob(job);
3814
+ } else {
3815
+ instance.update();
3816
+ }
3714
3817
  }
3715
3818
  delete leavingHooks.afterLeave;
3716
3819
  oldInnerChild = void 0;
@@ -3774,7 +3877,7 @@ var VueRuntimeDOM = (function (exports) {
3774
3877
  }
3775
3878
  return leavingVNodesCache;
3776
3879
  }
3777
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3880
+ function resolveTransitionHooks(vnode, props, state, instance) {
3778
3881
  const {
3779
3882
  appear,
3780
3883
  mode,
@@ -3830,8 +3933,15 @@ var VueRuntimeDOM = (function (exports) {
3830
3933
  );
3831
3934
  }
3832
3935
  const leavingVNode = leavingVNodesCache[key];
3833
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3834
- leavingVNode.el[leaveCbKey]();
3936
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
3937
+ let leavingCb = leavingVNode.el[leaveCbKey];
3938
+ if (!leavingCb) {
3939
+ const leavingRoot = getTransitionRoot(leavingVNode);
3940
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
3941
+ }
3942
+ if (leavingCb) {
3943
+ leavingCb();
3944
+ }
3835
3945
  }
3836
3946
  callHook(hook, [el]);
3837
3947
  },
@@ -3906,15 +4016,21 @@ var VueRuntimeDOM = (function (exports) {
3906
4016
  }
3907
4017
  },
3908
4018
  clone(vnode2) {
3909
- const hooks2 = resolveTransitionHooks(
3910
- vnode2,
3911
- props,
3912
- state,
3913
- instance,
3914
- postClone
3915
- );
3916
- if (postClone) postClone(hooks2);
3917
- return hooks2;
4019
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4020
+ cloned.afterLeave = () => {
4021
+ if (hooks.afterLeave) hooks.afterLeave();
4022
+ };
4023
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4024
+ if (hooks.delayLeave) {
4025
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4026
+ } else {
4027
+ delayedLeave();
4028
+ }
4029
+ };
4030
+ cloned.delayedLeave = () => {
4031
+ if (hooks.delayedLeave) hooks.delayedLeave();
4032
+ };
4033
+ return cloned;
3918
4034
  }
3919
4035
  };
3920
4036
  return hooks;
@@ -3955,10 +4071,24 @@ var VueRuntimeDOM = (function (exports) {
3955
4071
  hooks
3956
4072
  );
3957
4073
  } else if (vnode.shapeFlag & 128) {
3958
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3959
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4074
+ const suspense = vnode.suspense;
4075
+ if (suspense) {
4076
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4077
+ if (branch) {
4078
+ setTransitionHooks(branch, hooks.clone(branch));
4079
+ }
4080
+ } else {
4081
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4082
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4083
+ }
3960
4084
  } else {
3961
4085
  vnode.transition = hooks;
4086
+ if (vnode.type === Fragment && isArray(vnode.children)) {
4087
+ const child = filterSingleRoot(vnode.children, false);
4088
+ if (child) {
4089
+ setTransitionHooks(child, hooks);
4090
+ }
4091
+ }
3962
4092
  }
3963
4093
  }
3964
4094
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -3983,6 +4113,18 @@ var VueRuntimeDOM = (function (exports) {
3983
4113
  }
3984
4114
  return ret;
3985
4115
  }
4116
+ function getTransitionRoot(vnode) {
4117
+ if (vnode.component) {
4118
+ return getTransitionRoot(vnode.component.subTree);
4119
+ }
4120
+ if (vnode.type === Fragment) {
4121
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
4122
+ return child ? getTransitionRoot(child) : void 0;
4123
+ }
4124
+ if (vnode.type !== Comment) {
4125
+ return vnode;
4126
+ }
4127
+ }
3986
4128
 
3987
4129
  // @__NO_SIDE_EFFECTS__
3988
4130
  function defineComponent(options, extraOptions) {
@@ -4639,7 +4781,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4639
4781
  getContainerType(container),
4640
4782
  slotScopeIds
4641
4783
  );
4642
- if (parentComponent) {
4784
+ if (parentComponent && parentComponent.vnode.el === node) {
4643
4785
  parentComponent.vnode.el = vnode.el;
4644
4786
  updateHOCHostEl(parentComponent, vnode.el);
4645
4787
  }
@@ -4888,14 +5030,22 @@ Server rendered element contains fewer child nodes than client vdom.`
4888
5030
  break;
4889
5031
  }
4890
5032
  }, opts);
4891
- forEach((el) => {
4892
- if (!(el instanceof Element)) return;
5033
+ const observe = (el) => {
4893
5034
  if (elementIsVisibleInViewport(el)) {
4894
5035
  hydrate();
4895
5036
  ob.disconnect();
4896
5037
  return false;
4897
5038
  }
5039
+ if (getComputedStyle(el).display === "contents") {
5040
+ for (let i = 0; i < el.children.length; i++) {
5041
+ if (observe(el.children[i]) === false) return false;
5042
+ }
5043
+ }
4898
5044
  ob.observe(el);
5045
+ };
5046
+ forEach((el) => {
5047
+ if (!(el instanceof Element)) return;
5048
+ return observe(el);
4899
5049
  });
4900
5050
  return () => ob.disconnect();
4901
5051
  };
@@ -5065,7 +5215,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5065
5215
  err,
5066
5216
  instance,
5067
5217
  13,
5068
- !errorComponent
5218
+ !errorComponent,
5219
+ true
5069
5220
  );
5070
5221
  };
5071
5222
  if (suspensible && instance.suspense || false) {
@@ -5083,7 +5234,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5083
5234
  const delayed = ref(!!delay);
5084
5235
  let timeoutTimer;
5085
5236
  let delayTimer;
5086
- onUnmounted(() => {
5237
+ onScopeDispose(() => {
5087
5238
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5088
5239
  if (delayTimer != null) clearTimeout(delayTimer);
5089
5240
  });
@@ -5205,6 +5356,12 @@ Server rendered element contains fewer child nodes than client vdom.`
5205
5356
  }
5206
5357
  };
5207
5358
  sharedContext.deactivate = (vnode) => {
5359
+ const cached = cache.get(
5360
+ vnode.key == null ? vnode.type : vnode.key
5361
+ );
5362
+ if (!cached || cached.component !== vnode.component) {
5363
+ return false;
5364
+ }
5208
5365
  const instance2 = vnode.component;
5209
5366
  invalidateMount(instance2.m);
5210
5367
  invalidateMount(instance2.a);
@@ -5225,6 +5382,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5225
5382
  {
5226
5383
  instance2.__keepAliveStorageContainer = storageContainer;
5227
5384
  }
5385
+ return true;
5228
5386
  };
5229
5387
  function unmount(vnode) {
5230
5388
  resetShapeFlag(vnode);
@@ -5246,6 +5404,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5246
5404
  unmount(cached);
5247
5405
  } else if (current) {
5248
5406
  resetShapeFlag(current);
5407
+ if (cached) resetShapeFlag(cached);
5249
5408
  }
5250
5409
  cache.delete(key);
5251
5410
  keys.delete(key);
@@ -5263,12 +5422,17 @@ Server rendered element contains fewer child nodes than client vdom.`
5263
5422
  const cacheSubtree = () => {
5264
5423
  if (pendingCacheKey != null) {
5265
5424
  if (isSuspense(instance.subTree.type)) {
5266
- queuePostRenderEffect(() => {
5425
+ const cacheInnerChild = () => {
5267
5426
  const vnode = getInnerChild(instance.subTree);
5268
5427
  if (vnode.component) {
5269
5428
  cache.set(pendingCacheKey, vnode);
5270
5429
  }
5271
- }, instance.subTree.suspense);
5430
+ };
5431
+ if (instance.subTree.suspense.pendingBranch) {
5432
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
5433
+ } else {
5434
+ cacheInnerChild();
5435
+ }
5272
5436
  } else {
5273
5437
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5274
5438
  }
@@ -5399,9 +5563,12 @@ Server rendered element contains fewer child nodes than client vdom.`
5399
5563
  true
5400
5564
  /* prepend */
5401
5565
  );
5402
- onUnmounted(() => {
5403
- remove(keepAliveRoot[type], injected);
5404
- }, target);
5566
+ const removal = injectHook(
5567
+ "um",
5568
+ () => remove(keepAliveRoot[type], injected),
5569
+ target
5570
+ );
5571
+ removal.flags = 16;
5405
5572
  }
5406
5573
  function resetShapeFlag(vnode) {
5407
5574
  vnode.shapeFlag &= -257;
@@ -5537,9 +5704,11 @@ If this is a native custom element, make sure to exclude it from component resol
5537
5704
  }
5538
5705
  } else if (typeof source === "number") {
5539
5706
  if (!Number.isInteger(source) || source < 0) {
5540
- warn$1(
5541
- `The v-for range expects a positive integer value but got ${source}.`
5542
- );
5707
+ {
5708
+ warn$1(
5709
+ `The v-for range expects a positive integer value but got ${source}.`
5710
+ );
5711
+ }
5543
5712
  ret = [];
5544
5713
  } else {
5545
5714
  ret = new Array(source);
@@ -7174,7 +7343,7 @@ If you want to remount the same app, move your app creation logic into a factory
7174
7343
  }
7175
7344
  for (let i = 0; i < nextKeys.length; i++) {
7176
7345
  const key = nextKeys[i];
7177
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
7346
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
7178
7347
  return true;
7179
7348
  }
7180
7349
  }
@@ -8054,6 +8223,8 @@ If you want to remount the same app, move your app creation logic into a factory
8054
8223
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
8055
8224
  if (needCallTransitionHooks) {
8056
8225
  transition.beforeEnter(el);
8226
+ } else if (transition && !transition.persisted) {
8227
+ el[deferredEnterKey] = true;
8057
8228
  }
8058
8229
  hostInsert(el, container, anchor);
8059
8230
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -8213,15 +8384,16 @@ If you want to remount the same app, move your app creation logic into a factory
8213
8384
  for (let i = 0; i < newChildren.length; i++) {
8214
8385
  const oldVNode = oldChildren[i];
8215
8386
  const newVNode = newChildren[i];
8387
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
8216
8388
  const container = (
8217
8389
  // oldVNode may be an errored async setup() component inside Suspense
8218
8390
  // which will not have a mounted element
8219
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
8391
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
8220
8392
  // of the Fragment itself so it can move its children.
8221
8393
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
8222
8394
  // which also requires the correct parent container
8223
8395
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
8224
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
8396
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
8225
8397
  // In other cases, the parent container is not actually used so we
8226
8398
  // just pass the block element here to avoid a DOM parentNode call.
8227
8399
  fallbackContainer
@@ -8385,7 +8557,12 @@ If you want to remount the same app, move your app creation logic into a factory
8385
8557
  }
8386
8558
  if (isHmrUpdating) initialVNode.el = null;
8387
8559
  if (instance.asyncDep) {
8388
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8560
+ parentSuspense && parentSuspense.registerDep(
8561
+ instance,
8562
+ setupRenderEffect,
8563
+ optimized,
8564
+ namespace
8565
+ );
8389
8566
  if (!initialVNode.el) {
8390
8567
  const placeholder = instance.subTree = createVNode(Comment);
8391
8568
  processCommentNode(null, placeholder, container, anchor);
@@ -8415,6 +8592,7 @@ If you want to remount the same app, move your app creation logic into a factory
8415
8592
  pushWarningContext(n2);
8416
8593
  }
8417
8594
  n2.el = n1.el;
8595
+ n2.placeholder = n1.placeholder;
8418
8596
  updateComponentPreRender(instance, n2, optimized);
8419
8597
  {
8420
8598
  popWarningContext();
@@ -8426,6 +8604,7 @@ If you want to remount the same app, move your app creation logic into a factory
8426
8604
  }
8427
8605
  } else {
8428
8606
  n2.el = n1.el;
8607
+ n2.placeholder = n1.placeholder;
8429
8608
  instance.vnode = n2;
8430
8609
  }
8431
8610
  };
@@ -8528,16 +8707,23 @@ If you want to remount the same app, move your app creation logic into a factory
8528
8707
  } else {
8529
8708
  let { next, bu, u, parent, vnode } = instance;
8530
8709
  {
8531
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
8532
- if (nonHydratedAsyncRoot) {
8710
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
8711
+ if (unresolvedAsyncRoot) {
8533
8712
  if (next) {
8534
8713
  next.el = vnode.el;
8535
8714
  updateComponentPreRender(instance, next, optimized);
8536
8715
  }
8537
- nonHydratedAsyncRoot.asyncDep.then(() => {
8538
- queuePostRenderEffect(() => {
8539
- if (!instance.isUnmounted) update();
8540
- }, parentSuspense);
8716
+ unresolvedAsyncRoot.asyncDep.then(() => {
8717
+ const retry = () => {
8718
+ if (instance.job.flags & 8) return;
8719
+ if (parentSuspense && parentSuspense.pendingBranch) {
8720
+ queuePostRenderEffect(retry, parentSuspense);
8721
+ } else {
8722
+ update();
8723
+ }
8724
+ };
8725
+ retry.flags = 16 | 32;
8726
+ queuePostRenderEffect(retry, parentSuspense);
8541
8727
  });
8542
8728
  return;
8543
8729
  }
@@ -8576,8 +8762,11 @@ If you want to remount the same app, move your app creation logic into a factory
8576
8762
  patch(
8577
8763
  prevTree,
8578
8764
  nextTree,
8579
- // parent may have changed if it's in a teleport
8580
- hostParentNode(prevTree.el),
8765
+ // parent may have changed if it's in a teleport. a root that is a
8766
+ // pending async component only has its placeholder comment
8767
+ hostParentNode(
8768
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
8769
+ ),
8581
8770
  // anchor may have changed if it's in a fragment
8582
8771
  getNextHostNode(prevTree),
8583
8772
  instance,
@@ -9017,8 +9206,7 @@ If you want to remount the same app, move your app creation logic into a factory
9017
9206
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
9018
9207
  parentComponent.renderCache[cacheIndex] = void 0;
9019
9208
  }
9020
- if (shapeFlag & 256) {
9021
- parentComponent.ctx.deactivate(vnode);
9209
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
9022
9210
  return;
9023
9211
  }
9024
9212
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -9079,18 +9267,9 @@ If you want to remount the same app, move your app creation logic into a factory
9079
9267
  };
9080
9268
  const remove = (vnode) => {
9081
9269
  const { type, el, anchor, transition } = vnode;
9082
- if (type === Fragment) {
9083
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
9084
- vnode.children.forEach((child) => {
9085
- if (child.type === Comment) {
9086
- hostRemove(child.el);
9087
- } else {
9088
- remove(child);
9089
- }
9090
- });
9091
- } else {
9092
- removeFragment(el, anchor);
9093
- }
9270
+ const isFragment = type === Fragment;
9271
+ if (isFragment && !transition) {
9272
+ removeFragment(el, anchor);
9094
9273
  return;
9095
9274
  }
9096
9275
  if (type === Static) {
@@ -9100,17 +9279,25 @@ If you want to remount the same app, move your app creation logic into a factory
9100
9279
  }
9101
9280
  return;
9102
9281
  }
9282
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
9103
9283
  const performRemove = () => {
9104
- hostRemove(el);
9284
+ if (isFragment) {
9285
+ if (hostParentNode(el)) {
9286
+ removeFragment(el, anchor);
9287
+ }
9288
+ } else {
9289
+ hostRemove(el);
9290
+ }
9105
9291
  if (transition && !transition.persisted && transition.afterLeave) {
9106
9292
  transition.afterLeave();
9107
9293
  }
9108
9294
  };
9109
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
9295
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
9110
9296
  const { leave, delayLeave } = transition;
9111
- const performLeave = () => leave(el, performRemove);
9297
+ const leavingEl = leavingNode.el;
9298
+ const performLeave = () => leave(leavingEl, performRemove);
9112
9299
  if (delayLeave) {
9113
- delayLeave(vnode.el, performRemove, performLeave);
9300
+ delayLeave(leavingEl, performRemove, performLeave);
9114
9301
  } else {
9115
9302
  performLeave();
9116
9303
  }
@@ -9141,16 +9328,18 @@ If you want to remount the same app, move your app creation logic into a factory
9141
9328
  if (job) {
9142
9329
  job.flags |= 8;
9143
9330
  unmount(subTree, instance, parentSuspense, doRemove);
9144
- } else if (instance.vnode.el && subTree) {
9331
+ } else if (subTree) {
9145
9332
  subTree.transition = instance.vnode.transition;
9146
9333
  unmount(subTree, instance, parentSuspense, doRemove);
9147
9334
  }
9148
9335
  if (um) {
9149
9336
  queuePostRenderEffect(um, parentSuspense);
9150
9337
  }
9151
- queuePostRenderEffect(() => {
9338
+ const markUnmounted = () => {
9152
9339
  instance.isUnmounted = true;
9153
- }, parentSuspense);
9340
+ };
9341
+ markUnmounted.flags = 16;
9342
+ queuePostRenderEffect(markUnmounted, parentSuspense);
9154
9343
  {
9155
9344
  devtoolsComponentRemoved(instance);
9156
9345
  }
@@ -9171,32 +9360,26 @@ If you want to remount the same app, move your app creation logic into a factory
9171
9360
  const teleportEnd = el && el[TeleportEndKey];
9172
9361
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
9173
9362
  };
9174
- let isFlushing = false;
9175
9363
  const render = (vnode, container, namespace) => {
9176
- let instance;
9177
- if (vnode == null) {
9178
- if (container._vnode) {
9179
- unmount(container._vnode, null, null, true);
9180
- instance = container._vnode.component;
9364
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
9365
+ flushOnAppMount(() => {
9366
+ if (vnode == null) {
9367
+ if (container._vnode) {
9368
+ unmount(container._vnode, null, null, true);
9369
+ }
9370
+ } else {
9371
+ patch(
9372
+ container._vnode || null,
9373
+ vnode,
9374
+ container,
9375
+ null,
9376
+ null,
9377
+ null,
9378
+ namespace
9379
+ );
9181
9380
  }
9182
- } else {
9183
- patch(
9184
- container._vnode || null,
9185
- vnode,
9186
- container,
9187
- null,
9188
- null,
9189
- null,
9190
- namespace
9191
- );
9192
- }
9193
- container._vnode = vnode;
9194
- if (!isFlushing) {
9195
- isFlushing = true;
9196
- flushPreFlushCbs(instance);
9197
- flushPostFlushCbs();
9198
- isFlushing = false;
9199
- }
9381
+ container._vnode = vnode;
9382
+ }, minUid);
9200
9383
  };
9201
9384
  const internals = {
9202
9385
  p: patch,
@@ -9308,13 +9491,13 @@ If you want to remount the same app, move your app creation logic into a factory
9308
9491
  }
9309
9492
  return result;
9310
9493
  }
9311
- function locateNonHydratedAsyncRoot(instance) {
9494
+ function locateUnresolvedAsyncRoot(instance) {
9312
9495
  const subComponent = instance.subTree.component;
9313
9496
  if (subComponent) {
9314
9497
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
9315
9498
  return subComponent;
9316
9499
  } else {
9317
- return locateNonHydratedAsyncRoot(subComponent);
9500
+ return locateUnresolvedAsyncRoot(subComponent);
9318
9501
  }
9319
9502
  }
9320
9503
  }
@@ -9332,11 +9515,16 @@ If you want to remount the same app, move your app creation logic into a factory
9332
9515
  if (instance) {
9333
9516
  return resolveAsyncComponentPlaceholder(instance.subTree);
9334
9517
  }
9518
+ const suspense = anchorVnode.suspense;
9519
+ if (suspense && suspense.activeBranch) {
9520
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
9521
+ }
9335
9522
  return null;
9336
9523
  }
9337
9524
 
9338
9525
  const isSuspense = (type) => type.__isSuspense;
9339
9526
  let suspenseId = 0;
9527
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
9340
9528
  const SuspenseImpl = {
9341
9529
  name: "Suspense",
9342
9530
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -9358,11 +9546,22 @@ If you want to remount the same app, move your app creation logic into a factory
9358
9546
  rendererInternals
9359
9547
  );
9360
9548
  } else {
9361
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9362
- n2.suspense = n1.suspense;
9363
- n2.suspense.vnode = n2;
9364
- n2.el = n1.el;
9365
- return;
9549
+ const suspense = n1.suspense;
9550
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
9551
+ const owner = suspense.parentComponent;
9552
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
9553
+ if (retained ? (
9554
+ // deps can outlive the pending branch: skip only while it exists
9555
+ parentSuspense.pendingBranch && !isSameVNodeType(
9556
+ n2.ssContent,
9557
+ suspense.pendingBranch || suspense.activeBranch
9558
+ )
9559
+ ) : !suspense.isInFallback) {
9560
+ n2.suspense = suspense;
9561
+ suspense.vnode = n2;
9562
+ n2.el = n1.el;
9563
+ return;
9564
+ }
9366
9565
  }
9367
9566
  patchSuspense(
9368
9567
  n1,
@@ -9387,6 +9586,38 @@ If you want to remount the same app, move your app creation logic into a factory
9387
9586
  eventListener();
9388
9587
  }
9389
9588
  }
9589
+ function enterDeferred(branch) {
9590
+ const enters = [];
9591
+ collectDeferredEnters(branch, enters, true);
9592
+ if (enters.length) {
9593
+ queuePostFlushCb(enters);
9594
+ }
9595
+ }
9596
+ function collectDeferredEnters(vnode, enters, isRoot) {
9597
+ const { el, transition, children, shapeFlag } = vnode;
9598
+ if (shapeFlag & 6) {
9599
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
9600
+ return;
9601
+ }
9602
+ if (shapeFlag & (128 | 64)) {
9603
+ return;
9604
+ }
9605
+ if (shapeFlag & 1) {
9606
+ if (!isRoot && el && el[deferredEnterKey]) {
9607
+ el[deferredEnterKey] = void 0;
9608
+ if (transition && !transition.persisted) {
9609
+ transition.beforeEnter(el);
9610
+ enters.push(() => transition.enter(el));
9611
+ }
9612
+ }
9613
+ isRoot = false;
9614
+ }
9615
+ if (shapeFlag & 16) {
9616
+ for (let i = 0; i < children.length; i++) {
9617
+ collectDeferredEnters(children[i], enters, isRoot);
9618
+ }
9619
+ }
9620
+ }
9390
9621
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
9391
9622
  const {
9392
9623
  p: patch,
@@ -9486,7 +9717,7 @@ If you want to remount the same app, move your app creation logic into a factory
9486
9717
  unmount(pendingBranch, parentComponent, suspense);
9487
9718
  }
9488
9719
  suspense.deps = 0;
9489
- suspense.effects.length = 0;
9720
+ discardEffects(suspense);
9490
9721
  suspense.hiddenContainer = createElement("div");
9491
9722
  if (isInFallback) {
9492
9723
  patch(
@@ -9564,11 +9795,7 @@ If you want to remount the same app, move your app creation logic into a factory
9564
9795
  } else {
9565
9796
  triggerEvent(n2, "onPending");
9566
9797
  suspense.pendingBranch = newBranch;
9567
- if (newBranch.shapeFlag & 512) {
9568
- suspense.pendingId = newBranch.component.suspenseId;
9569
- } else {
9570
- suspense.pendingId = suspenseId++;
9571
- }
9798
+ suspense.pendingId = suspenseId++;
9572
9799
  patch(
9573
9800
  null,
9574
9801
  newBranch,
@@ -9583,12 +9810,11 @@ If you want to remount the same app, move your app creation logic into a factory
9583
9810
  if (suspense.deps <= 0) {
9584
9811
  suspense.resolve();
9585
9812
  } else {
9586
- const { timeout, pendingId } = suspense;
9813
+ const { timeout } = suspense;
9587
9814
  if (timeout > 0) {
9588
- setTimeout(() => {
9589
- if (suspense.pendingId === pendingId) {
9590
- suspense.fallback(newFallback);
9591
- }
9815
+ suspense.timeoutTimer = setTimeout(() => {
9816
+ suspense.timeoutTimer = void 0;
9817
+ suspense.fallback(suspense.vnode.ssFallback);
9592
9818
  }, timeout);
9593
9819
  } else if (timeout === 0) {
9594
9820
  suspense.fallback(newFallback);
@@ -9635,6 +9861,7 @@ If you want to remount the same app, move your app creation logic into a factory
9635
9861
  deps: 0,
9636
9862
  pendingId: suspenseId++,
9637
9863
  timeout: typeof timeout === "number" ? timeout : -1,
9864
+ timeoutTimer: void 0,
9638
9865
  activeBranch: null,
9639
9866
  isFallbackMountPending: false,
9640
9867
  pendingBranch: null,
@@ -9673,7 +9900,8 @@ If you want to remount the same app, move your app creation logic into a factory
9673
9900
  let hasUpdatedAnchor = false;
9674
9901
  if (delayEnter) {
9675
9902
  activeBranch.transition.afterLeave = () => {
9676
- if (pendingId === suspense.pendingId) {
9903
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
9904
+ enterDeferred(pendingBranch);
9677
9905
  move(
9678
9906
  pendingBranch,
9679
9907
  container2,
@@ -9688,7 +9916,9 @@ If you want to remount the same app, move your app creation logic into a factory
9688
9916
  };
9689
9917
  }
9690
9918
  if (activeBranch && !suspense.isFallbackMountPending) {
9691
- if (parentNode(activeBranch.el) === container2) {
9919
+ if (parentNode(
9920
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
9921
+ ) === container2) {
9692
9922
  anchor = next(activeBranch);
9693
9923
  hasUpdatedAnchor = true;
9694
9924
  }
@@ -9698,13 +9928,26 @@ If you want to remount the same app, move your app creation logic into a factory
9698
9928
  }
9699
9929
  }
9700
9930
  if (!delayEnter) {
9931
+ enterDeferred(pendingBranch);
9701
9932
  move(pendingBranch, container2, anchor, 0);
9702
9933
  }
9703
9934
  }
9935
+ clearTimeout(suspense.timeoutTimer);
9936
+ suspense.timeoutTimer = void 0;
9704
9937
  suspense.isFallbackMountPending = false;
9705
9938
  setActiveBranch(suspense, pendingBranch);
9706
9939
  suspense.pendingBranch = null;
9707
9940
  suspense.isInFallback = false;
9941
+ let kept = 0;
9942
+ for (let i = 0; i < effects.length; i++) {
9943
+ const effect = effects[i];
9944
+ if (effect.flags & 32) {
9945
+ queuePostFlushCb(effect);
9946
+ } else {
9947
+ effects[kept++] = effect;
9948
+ }
9949
+ }
9950
+ effects.length = kept;
9708
9951
  let parent = suspense.parent;
9709
9952
  let hasUnresolvedAncestor = false;
9710
9953
  while (parent) {
@@ -9733,7 +9976,7 @@ If you want to remount the same app, move your app creation logic into a factory
9733
9976
  triggerEvent(vnode2, "onResolve");
9734
9977
  },
9735
9978
  fallback(fallbackVNode) {
9736
- if (!suspense.pendingBranch) {
9979
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
9737
9980
  return;
9738
9981
  }
9739
9982
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -9741,7 +9984,7 @@ If you want to remount the same app, move your app creation logic into a factory
9741
9984
  const anchor2 = next(activeBranch);
9742
9985
  const mountFallback = () => {
9743
9986
  suspense.isFallbackMountPending = false;
9744
- if (!suspense.isInFallback) {
9987
+ if (suspense.isUnmounted || !suspense.isInFallback) {
9745
9988
  return;
9746
9989
  }
9747
9990
  const latestFallback = suspense.vnode.ssFallback;
@@ -9784,25 +10027,16 @@ If you want to remount the same app, move your app creation logic into a factory
9784
10027
  next() {
9785
10028
  return suspense.activeBranch && next(suspense.activeBranch);
9786
10029
  },
9787
- registerDep(instance, setupRenderEffect, optimized2) {
10030
+ // `namespace` intentionally shadows the boundary's own: the dep must be
10031
+ // mounted with the namespace of the position it was rendered at, which can
10032
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
10033
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
9788
10034
  const isInPendingSuspense = !!suspense.pendingBranch;
9789
10035
  if (isInPendingSuspense) {
9790
10036
  suspense.deps++;
9791
10037
  }
9792
10038
  const hydratedEl = instance.vnode.el;
9793
- instance.asyncDep.catch((err) => {
9794
- handleError(err, instance, 0);
9795
- }).then((asyncSetupResult) => {
9796
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9797
- return;
9798
- }
9799
- unsetCurrentInstance();
9800
- if (hydratedEl && !instance.scope.active) {
9801
- if (isInPendingSuspense && --suspense.deps === 0) {
9802
- suspense.resolve();
9803
- }
9804
- return;
9805
- }
10039
+ const render = (asyncSetupResult) => {
9806
10040
  instance.asyncResolved = true;
9807
10041
  const { vnode: vnode2 } = instance;
9808
10042
  {
@@ -9824,7 +10058,7 @@ If you want to remount the same app, move your app creation logic into a factory
9824
10058
  // consider the comment placeholder case.
9825
10059
  hydratedEl ? null : next(instance.subTree),
9826
10060
  suspense,
9827
- namespace,
10061
+ namespace2,
9828
10062
  optimized2
9829
10063
  );
9830
10064
  if (placeholder) {
@@ -9835,13 +10069,57 @@ If you want to remount the same app, move your app creation logic into a factory
9835
10069
  {
9836
10070
  popWarningContext();
9837
10071
  }
9838
- if (isInPendingSuspense && --suspense.deps === 0) {
10072
+ };
10073
+ instance.asyncDep.catch((err) => {
10074
+ handleError(err, instance, 0, false, true);
10075
+ return () => null;
10076
+ }).then((asyncSetupResult) => {
10077
+ if (instance.isUnmounted || suspense.isUnmounted) {
10078
+ return;
10079
+ }
10080
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
10081
+ unsetCurrentInstance();
10082
+ if (!instance.scope.active) {
10083
+ if (isPendingDep && --suspense.deps === 0) {
10084
+ suspense.resolve();
10085
+ }
10086
+ return;
10087
+ }
10088
+ if (!isPendingDep && suspense.pendingBranch) {
10089
+ const job = () => {
10090
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
10091
+ return;
10092
+ }
10093
+ if (suspense.pendingBranch) {
10094
+ queueEffectWithSuspense(job, suspense);
10095
+ } else {
10096
+ render(asyncSetupResult);
10097
+ }
10098
+ };
10099
+ job.flags = 16 | 32;
10100
+ queueEffectWithSuspense(job, suspense);
10101
+ return;
10102
+ }
10103
+ render(asyncSetupResult);
10104
+ if (isPendingDep && --suspense.deps === 0) {
9839
10105
  suspense.resolve();
9840
10106
  }
9841
10107
  });
9842
10108
  },
9843
10109
  unmount(parentSuspense2, doRemove) {
9844
10110
  suspense.isUnmounted = true;
10111
+ clearTimeout(suspense.timeoutTimer);
10112
+ suspense.timeoutTimer = void 0;
10113
+ if (parentSuspenseId !== void 0) {
10114
+ const parent = suspense.parent;
10115
+ const pendingId = parentSuspenseId;
10116
+ parentSuspenseId = void 0;
10117
+ queuePostFlushCb(() => {
10118
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
10119
+ parent.resolve();
10120
+ }
10121
+ });
10122
+ }
9845
10123
  if (suspense.activeBranch) {
9846
10124
  unmount(
9847
10125
  suspense.activeBranch,
@@ -9851,12 +10129,8 @@ If you want to remount the same app, move your app creation logic into a factory
9851
10129
  );
9852
10130
  }
9853
10131
  if (suspense.pendingBranch) {
9854
- unmount(
9855
- suspense.pendingBranch,
9856
- parentComponent,
9857
- parentSuspense2,
9858
- doRemove
9859
- );
10132
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
10133
+ discardEffects(suspense);
9860
10134
  }
9861
10135
  }
9862
10136
  };
@@ -9926,6 +10200,16 @@ If you want to remount the same app, move your app creation logic into a factory
9926
10200
  }
9927
10201
  return s;
9928
10202
  }
10203
+ function discardEffects(suspense) {
10204
+ const { effects } = suspense;
10205
+ for (let i = 0; i < effects.length; i++) {
10206
+ const effect = effects[i];
10207
+ if (effect.flags & 16) {
10208
+ queuePostFlushCb(effect);
10209
+ }
10210
+ }
10211
+ effects.length = 0;
10212
+ }
9929
10213
  function queueEffectWithSuspense(fn, suspense) {
9930
10214
  if (suspense && suspense.pendingBranch) {
9931
10215
  if (isArray(fn)) {
@@ -10177,7 +10461,8 @@ Component that was made reactive: `,
10177
10461
  }
10178
10462
  function guardReactiveProps(props) {
10179
10463
  if (!props) return null;
10180
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10464
+ if (isProxy(props)) return extend({}, props);
10465
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
10181
10466
  }
10182
10467
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
10183
10468
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -10356,8 +10641,11 @@ Component that was made reactive: `,
10356
10641
  ]);
10357
10642
  }
10358
10643
 
10359
- const emptyAppContext = createAppContext();
10644
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
10360
10645
  let uid = 0;
10646
+ function getNextUid() {
10647
+ return uid;
10648
+ }
10361
10649
  function createComponentInstance(vnode, parent, suspense) {
10362
10650
  const type = vnode.type;
10363
10651
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -10554,7 +10842,8 @@ Component that was made reactive: `,
10554
10842
  setInSSRSetupState(false);
10555
10843
  }
10556
10844
  }).catch((e) => {
10557
- handleError(e, instance, 0);
10845
+ handleError(e, instance, 0, void 0, true);
10846
+ instance.ssrRender = (_, push) => push("<!---->");
10558
10847
  });
10559
10848
  } else {
10560
10849
  instance.asyncDep = setupResult;
@@ -10660,11 +10949,12 @@ Component that was made reactive: `,
10660
10949
  }
10661
10950
  }
10662
10951
  }
10952
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
10663
10953
  const attrsProxyHandlers = {
10664
10954
  get(target, key) {
10665
10955
  markAttrsAccessed();
10666
10956
  track(target, "get", "");
10667
- return target[key];
10957
+ return key === rawAttrsKey ? target : target[key];
10668
10958
  },
10669
10959
  set() {
10670
10960
  warn$1(`setupContext.attrs is readonly.`);
@@ -11016,7 +11306,7 @@ Component that was made reactive: `,
11016
11306
  return true;
11017
11307
  }
11018
11308
 
11019
- const version = "3.5.43";
11309
+ const version = "3.5.45";
11020
11310
  const warn = warn$1 ;
11021
11311
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11022
11312
  const devtools = devtools$1 ;
@@ -11573,7 +11863,9 @@ Component that was made reactive: `,
11573
11863
  }
11574
11864
  }
11575
11865
  if (vShowOriginalDisplay in el) {
11576
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
11866
+ if (!isCssString || prev !== next) {
11867
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
11868
+ }
11577
11869
  if (el[vShowHidden]) {
11578
11870
  style.display = "none";
11579
11871
  }
@@ -12055,7 +12347,9 @@ Expected function or array of functions, received type ${typeof value}.`
12055
12347
  "Custom element style injection is not supported when using shadowRoot: false"
12056
12348
  );
12057
12349
  }
12058
- this._mount(def);
12350
+ if (this._connected) {
12351
+ this._mount(def);
12352
+ }
12059
12353
  };
12060
12354
  const asyncDef = this._def.__asyncLoader;
12061
12355
  if (asyncDef) {
@@ -12413,6 +12707,7 @@ Expected function or array of functions, received type ${typeof value}.`
12413
12707
  const newPositionMap = /* @__PURE__ */ new WeakMap();
12414
12708
  const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
12415
12709
  const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
12710
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
12416
12711
  const decorate = (t) => {
12417
12712
  delete t.props.mode;
12418
12713
  return t;
@@ -12428,21 +12723,30 @@ Expected function or array of functions, received type ${typeof value}.`
12428
12723
  const state = useTransitionState();
12429
12724
  let prevChildren;
12430
12725
  let children;
12431
- onUpdated(() => {
12432
- if (!prevChildren.length) {
12433
- return;
12726
+ let origins;
12727
+ let moves;
12728
+ const willMove = () => {
12729
+ if (moves === void 0) {
12730
+ moves = prevChildren.length > 0 && hasCSSTransform(
12731
+ prevChildren[0].el,
12732
+ instance.vnode.el,
12733
+ resolveMoveClass(props)
12734
+ );
12434
12735
  }
12435
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
12436
- if (!hasCSSTransform(
12437
- prevChildren[0].el,
12438
- instance.vnode.el,
12439
- moveClass
12440
- )) {
12736
+ return moves;
12737
+ };
12738
+ onUpdated(() => {
12739
+ pendingGroups.delete(instance);
12740
+ if (!willMove()) {
12441
12741
  prevChildren = [];
12742
+ origins = void 0;
12442
12743
  return;
12443
12744
  }
12745
+ const moveClass = resolveMoveClass(props);
12444
12746
  prevChildren.forEach(callPendingCbs);
12445
- prevChildren.forEach(recordPosition);
12747
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
12748
+ origins = void 0;
12749
+ prevChildren.forEach((c) => recordPosition(c, shift));
12446
12750
  const movedChildren = prevChildren.filter(applyTranslation);
12447
12751
  forceReflow(instance.vnode.el);
12448
12752
  movedChildren.forEach((c) => {
@@ -12469,6 +12773,7 @@ Expected function or array of functions, received type ${typeof value}.`
12469
12773
  const cssTransitionProps = resolveTransitionProps(rawProps);
12470
12774
  let tag = rawProps.tag || Fragment;
12471
12775
  prevChildren = [];
12776
+ moves = void 0;
12472
12777
  if (children) {
12473
12778
  for (let i = 0; i < children.length; i++) {
12474
12779
  const child = children[i];
@@ -12500,6 +12805,10 @@ Expected function or array of functions, received type ${typeof value}.`
12500
12805
  warn(`<TransitionGroup> children must be keyed.`);
12501
12806
  }
12502
12807
  }
12808
+ if (prevChildren.length) {
12809
+ origins = getOrigins(instance);
12810
+ pendingGroups.set(instance, willMove);
12811
+ }
12503
12812
  return createVNode(tag, null, children);
12504
12813
  };
12505
12814
  }
@@ -12514,8 +12823,11 @@ Expected function or array of functions, received type ${typeof value}.`
12514
12823
  el[enterCbKey]();
12515
12824
  }
12516
12825
  }
12517
- function recordPosition(c) {
12518
- newPositionMap.set(c, getPosition(c.el));
12826
+ function resolveMoveClass(props) {
12827
+ return props.moveClass || `${props.name || "v"}-move`;
12828
+ }
12829
+ function recordPosition(c, shift) {
12830
+ newPositionMap.set(c, getPosition(c.el, shift));
12519
12831
  }
12520
12832
  function applyTranslation(c) {
12521
12833
  const oldPos = positionMap.get(c);
@@ -12539,13 +12851,41 @@ Expected function or array of functions, received type ${typeof value}.`
12539
12851
  return c;
12540
12852
  }
12541
12853
  }
12542
- function getPosition(el) {
12854
+ function getPosition(el, shift) {
12543
12855
  const rect = el.getBoundingClientRect();
12544
12856
  return {
12545
- left: rect.left,
12546
- top: rect.top
12857
+ left: rect.left - (shift ? shift.left : 0),
12858
+ top: rect.top - (shift ? shift.top : 0)
12547
12859
  };
12548
12860
  }
12861
+ function getOrigins(instance) {
12862
+ let origins;
12863
+ for (let group = instance.parent; group; group = group.parent) {
12864
+ const willMove = pendingGroups.get(group);
12865
+ if (willMove) {
12866
+ const item = findItem(group.vnode.el, instance.vnode.el);
12867
+ if (item) {
12868
+ (origins || (origins = [])).push(
12869
+ extend(getPosition(item), { item, willMove })
12870
+ );
12871
+ }
12872
+ }
12873
+ }
12874
+ return origins;
12875
+ }
12876
+ function findItem(root, node) {
12877
+ const container = root.nodeType === 1 ? root : root.parentNode;
12878
+ while (node && node.parentNode !== container) {
12879
+ node = node.parentNode;
12880
+ }
12881
+ if (node && node.nodeType === 1) {
12882
+ return node;
12883
+ }
12884
+ }
12885
+ function getOriginShift(origins, root) {
12886
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
12887
+ return origin && getPosition(origin.item, origin);
12888
+ }
12549
12889
  function hasCSSTransform(el, root, moveClass) {
12550
12890
  const clone = el.cloneNode();
12551
12891
  const _vtc = el[vtcKey];
@@ -12740,18 +13080,18 @@ Expected function or array of functions, received type ${typeof value}.`
12740
13080
  },
12741
13081
  // set value in mounted & updated because <select> relies on its children
12742
13082
  // <option>s.
12743
- mounted(el, { value }) {
12744
- setSelected(el, value);
13083
+ mounted(el, { value, modifiers: { number } }) {
13084
+ setSelected(el, value, number);
12745
13085
  },
12746
13086
  beforeUpdate(el, { value }, vnode) {
12747
13087
  el._modelValue = value;
12748
13088
  el[assignKey] = getModelAssigner(vnode);
12749
13089
  },
12750
- updated(el, { value }) {
13090
+ updated(el, { value, modifiers: { number } }) {
12751
13091
  const pending = el._pendingValue;
12752
13092
  el._pendingValue = void 0;
12753
13093
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
12754
- setSelected(el, value);
13094
+ setSelected(el, value, number);
12755
13095
  }
12756
13096
  }
12757
13097
  };
@@ -12767,7 +13107,7 @@ Expected function or array of functions, received type ${typeof value}.`
12767
13107
  }
12768
13108
  return false;
12769
13109
  }
12770
- function setSelected(el, value) {
13110
+ function setSelected(el, value, number = false) {
12771
13111
  const isMultiple = el.multiple;
12772
13112
  const isArrayValue = isArray(value);
12773
13113
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -12788,7 +13128,7 @@ Expected function or array of functions, received type ${typeof value}.`
12788
13128
  option.selected = looseIndexOf(value, optionValue) > -1;
12789
13129
  }
12790
13130
  } else {
12791
- option.selected = value.has(optionValue);
13131
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
12792
13132
  }
12793
13133
  } else if (looseEqual(getValue(option), value)) {
12794
13134
  if (el.selectedIndex !== i) el.selectedIndex = i;