@vue/compat 3.5.44 → 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.44
2
+ * @vue/compat 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 Vue = (function () {
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++) {
@@ -267,7 +263,7 @@ var Vue = (function () {
267
263
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
268
264
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
269
265
 
270
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
266
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
271
267
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
272
268
  const isBooleanAttr = /* @__PURE__ */ makeMap(
273
269
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -611,7 +607,11 @@ var Vue = (function () {
611
607
  }
612
608
  function onScopeDispose(fn, failSilently = false) {
613
609
  if (activeEffectScope) {
614
- activeEffectScope.cleanups.push(fn);
610
+ if (activeEffectScope.active) {
611
+ activeEffectScope.cleanups.push(fn);
612
+ } else {
613
+ fn();
614
+ }
615
615
  } else if (!failSilently) {
616
616
  warn$2(
617
617
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1418,7 +1418,7 @@ var Vue = (function () {
1418
1418
  }
1419
1419
 
1420
1420
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1421
- const builtInSymbols = new Set(
1421
+ const builtInSymbols = /* @__PURE__ */ new Set(
1422
1422
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1423
1423
  );
1424
1424
  function hasOwnProperty(key) {
@@ -2628,7 +2628,7 @@ var Vue = (function () {
2628
2628
  const res = callWithErrorHandling(fn, instance, type, args);
2629
2629
  if (res && isPromise(res)) {
2630
2630
  res.catch((err) => {
2631
- handleError(err, instance, type);
2631
+ handleError(err, instance, type, void 0, true);
2632
2632
  });
2633
2633
  }
2634
2634
  return res;
@@ -2645,7 +2645,7 @@ var Vue = (function () {
2645
2645
  );
2646
2646
  }
2647
2647
  }
2648
- function handleError(err, instance, type, throwInDev = true) {
2648
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2649
2649
  const contextVNode = instance ? instance.vnode : null;
2650
2650
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2651
2651
  if (instance) {
@@ -2654,7 +2654,9 @@ var Vue = (function () {
2654
2654
  const errorInfo = ErrorTypeStrings$1[type] ;
2655
2655
  while (cur) {
2656
2656
  const errorCapturedHooks = cur.ec;
2657
- if (errorCapturedHooks) {
2657
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2658
+ // are deferred or discarded by Suspense.
2659
+ (!isAsyncError || cur.scope.active)) {
2658
2660
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2659
2661
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2660
2662
  return;
@@ -2982,14 +2984,32 @@ var Vue = (function () {
2982
2984
  instance.ceReload(newComp.styles);
2983
2985
  dirtyInstances.delete(instance);
2984
2986
  } else if (instance.parent) {
2985
- queueJob(() => {
2986
- if (!(instance.job.flags & 8)) {
2987
- isHmrUpdating = true;
2987
+ const update = () => {
2988
+ if (!instance.scope.active) return;
2989
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2990
+ if (pending) {
2991
+ pending.asyncDep.catch(NOOP).then(() => {
2992
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2993
+ queueJob(update);
2994
+ }
2995
+ });
2996
+ return;
2997
+ }
2998
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2999
+ if (!dirtyInstances) {
3000
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3001
+ }
3002
+ dirtyInstances.add(instance);
3003
+ isHmrUpdating = true;
3004
+ try {
2988
3005
  instance.parent.update();
3006
+ } finally {
2989
3007
  isHmrUpdating = false;
2990
3008
  dirtyInstances.delete(instance);
3009
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2991
3010
  }
2992
- });
3011
+ };
3012
+ queueJob(update);
2993
3013
  } else if (instance.appContext.reload) {
2994
3014
  instance.appContext.reload();
2995
3015
  } else if (typeof window !== "undefined") {
@@ -3671,12 +3691,31 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3671
3691
  return vnode;
3672
3692
  }
3673
3693
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3674
- const bindings = vnode.dirs;
3694
+ let hookVNode = vnode;
3695
+ if (name === "beforeMount") {
3696
+ vnode._mount = vnode;
3697
+ } else if (name === "beforeUpdate") {
3698
+ const mount = prevVNode && prevVNode._mount;
3699
+ if (mount) {
3700
+ mount._latest = vnode;
3701
+ vnode._mount = mount;
3702
+ }
3703
+ } else if (name === "mounted") {
3704
+ const latest = vnode._latest;
3705
+ vnode._mount = vnode._latest = void 0;
3706
+ if (latest) {
3707
+ hookVNode = latest;
3708
+ latest._mount = void 0;
3709
+ }
3710
+ }
3711
+ const bindings = hookVNode.dirs;
3675
3712
  const oldBindings = prevVNode && prevVNode.dirs;
3676
3713
  for (let i = 0; i < bindings.length; i++) {
3677
- const binding = bindings[i];
3714
+ let binding = bindings[i];
3678
3715
  if (oldBindings) {
3679
3716
  binding.oldValue = oldBindings[i].value;
3717
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3718
+ binding = extend({}, binding, { oldValue: void 0 });
3680
3719
  }
3681
3720
  let hook = binding.dir[name];
3682
3721
  if (!hook) {
@@ -3687,7 +3726,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3687
3726
  callWithAsyncErrorHandling(hook, instance, 8, [
3688
3727
  vnode.el,
3689
3728
  binding,
3690
- vnode,
3729
+ hookVNode,
3691
3730
  prevVNode
3692
3731
  ]);
3693
3732
  resetTracking();
@@ -4283,13 +4322,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4283
4322
  if (!innerChild) {
4284
4323
  return emptyPlaceholder(child);
4285
4324
  }
4286
- let enterHooks = resolveTransitionHooks(
4325
+ const enterHooks = resolveTransitionHooks(
4287
4326
  innerChild,
4288
4327
  rawProps,
4289
4328
  state,
4290
- instance,
4291
- // #11061, ensure enterHooks is fresh after clone
4292
- (hooks) => enterHooks = hooks
4329
+ instance
4293
4330
  );
4294
4331
  if (innerChild.type !== Comment) {
4295
4332
  setTransitionHooks(innerChild, enterHooks);
@@ -4308,7 +4345,17 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4308
4345
  leavingHooks.afterLeave = () => {
4309
4346
  state.isLeaving = false;
4310
4347
  if (!(instance.job.flags & 8)) {
4311
- instance.update();
4348
+ if (instance.effect.flags & 2) {
4349
+ const job = () => {
4350
+ if (!(instance.job.flags & 8)) {
4351
+ instance.update();
4352
+ }
4353
+ };
4354
+ job.i = instance;
4355
+ queueJob(job);
4356
+ } else {
4357
+ instance.update();
4358
+ }
4312
4359
  }
4313
4360
  delete leavingHooks.afterLeave;
4314
4361
  oldInnerChild = void 0;
@@ -4375,7 +4422,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4375
4422
  }
4376
4423
  return leavingVNodesCache;
4377
4424
  }
4378
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4425
+ function resolveTransitionHooks(vnode, props, state, instance) {
4379
4426
  const {
4380
4427
  appear,
4381
4428
  mode,
@@ -4514,15 +4561,21 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4514
4561
  }
4515
4562
  },
4516
4563
  clone(vnode2) {
4517
- const hooks2 = resolveTransitionHooks(
4518
- vnode2,
4519
- props,
4520
- state,
4521
- instance,
4522
- postClone
4523
- );
4524
- if (postClone) postClone(hooks2);
4525
- return hooks2;
4564
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4565
+ cloned.afterLeave = () => {
4566
+ if (hooks.afterLeave) hooks.afterLeave();
4567
+ };
4568
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4569
+ if (hooks.delayLeave) {
4570
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4571
+ } else {
4572
+ delayedLeave();
4573
+ }
4574
+ };
4575
+ cloned.delayedLeave = () => {
4576
+ if (hooks.delayedLeave) hooks.delayedLeave();
4577
+ };
4578
+ return cloned;
4526
4579
  }
4527
4580
  };
4528
4581
  return hooks;
@@ -4563,8 +4616,16 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4563
4616
  hooks
4564
4617
  );
4565
4618
  } else if (vnode.shapeFlag & 128) {
4566
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4567
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4619
+ const suspense = vnode.suspense;
4620
+ if (suspense) {
4621
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4622
+ if (branch) {
4623
+ setTransitionHooks(branch, hooks.clone(branch));
4624
+ }
4625
+ } else {
4626
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4627
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4628
+ }
4568
4629
  } else {
4569
4630
  vnode.transition = hooks;
4570
4631
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -5265,7 +5326,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5265
5326
  getContainerType(container),
5266
5327
  slotScopeIds
5267
5328
  );
5268
- if (parentComponent) {
5329
+ if (parentComponent && parentComponent.vnode.el === node) {
5269
5330
  parentComponent.vnode.el = vnode.el;
5270
5331
  updateHOCHostEl(parentComponent, vnode.el);
5271
5332
  }
@@ -5699,7 +5760,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5699
5760
  err,
5700
5761
  instance,
5701
5762
  13,
5702
- !errorComponent
5763
+ !errorComponent,
5764
+ true
5703
5765
  );
5704
5766
  };
5705
5767
  if (suspensible && instance.suspense || false) {
@@ -5717,7 +5779,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5717
5779
  const delayed = ref(!!delay);
5718
5780
  let timeoutTimer;
5719
5781
  let delayTimer;
5720
- onUnmounted(() => {
5782
+ onScopeDispose(() => {
5721
5783
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5722
5784
  if (delayTimer != null) clearTimeout(delayTimer);
5723
5785
  });
@@ -5839,6 +5901,12 @@ Server rendered element contains fewer child nodes than client vdom.`
5839
5901
  }
5840
5902
  };
5841
5903
  sharedContext.deactivate = (vnode) => {
5904
+ const cached = cache.get(
5905
+ vnode.key == null ? vnode.type : vnode.key
5906
+ );
5907
+ if (!cached || cached.component !== vnode.component) {
5908
+ return false;
5909
+ }
5842
5910
  const instance2 = vnode.component;
5843
5911
  invalidateMount(instance2.m);
5844
5912
  invalidateMount(instance2.a);
@@ -5859,6 +5927,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5859
5927
  {
5860
5928
  instance2.__keepAliveStorageContainer = storageContainer;
5861
5929
  }
5930
+ return true;
5862
5931
  };
5863
5932
  function unmount(vnode) {
5864
5933
  resetShapeFlag(vnode);
@@ -5898,12 +5967,17 @@ Server rendered element contains fewer child nodes than client vdom.`
5898
5967
  const cacheSubtree = () => {
5899
5968
  if (pendingCacheKey != null) {
5900
5969
  if (isSuspense(instance.subTree.type)) {
5901
- queuePostRenderEffect(() => {
5970
+ const cacheInnerChild = () => {
5902
5971
  const vnode = getInnerChild(instance.subTree);
5903
5972
  if (vnode.component) {
5904
5973
  cache.set(pendingCacheKey, vnode);
5905
5974
  }
5906
- }, instance.subTree.suspense);
5975
+ };
5976
+ if (instance.subTree.suspense.pendingBranch) {
5977
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
5978
+ } else {
5979
+ cacheInnerChild();
5980
+ }
5907
5981
  } else {
5908
5982
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5909
5983
  }
@@ -6038,9 +6112,12 @@ Server rendered element contains fewer child nodes than client vdom.`
6038
6112
  true
6039
6113
  /* prepend */
6040
6114
  );
6041
- onUnmounted(() => {
6042
- remove(keepAliveRoot[type], injected);
6043
- }, target);
6115
+ const removal = injectHook(
6116
+ "um",
6117
+ () => remove(keepAliveRoot[type], injected),
6118
+ target
6119
+ );
6120
+ removal.flags = 16;
6044
6121
  }
6045
6122
  function resetShapeFlag(vnode) {
6046
6123
  vnode.shapeFlag &= -257;
@@ -7771,7 +7848,7 @@ If this is a native custom element, make sure to exclude it from component resol
7771
7848
  return vm;
7772
7849
  }
7773
7850
  }
7774
- Vue.version = `2.6.14-compat:${"3.5.44"}`;
7851
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
7775
7852
  Vue.config = singletonApp.config;
7776
7853
  Vue.use = (plugin, ...options) => {
7777
7854
  if (plugin && isFunction(plugin.install)) {
@@ -9880,6 +9957,8 @@ If you want to remount the same app, move your app creation logic into a factory
9880
9957
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
9881
9958
  if (needCallTransitionHooks) {
9882
9959
  transition.beforeEnter(el);
9960
+ } else if (transition && !transition.persisted) {
9961
+ el[deferredEnterKey] = true;
9883
9962
  }
9884
9963
  hostInsert(el, container, anchor);
9885
9964
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -10378,16 +10457,23 @@ If you want to remount the same app, move your app creation logic into a factory
10378
10457
  } else {
10379
10458
  let { next, bu, u, parent, vnode } = instance;
10380
10459
  {
10381
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
10382
- if (nonHydratedAsyncRoot) {
10460
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
10461
+ if (unresolvedAsyncRoot) {
10383
10462
  if (next) {
10384
10463
  next.el = vnode.el;
10385
10464
  updateComponentPreRender(instance, next, optimized);
10386
10465
  }
10387
- nonHydratedAsyncRoot.asyncDep.then(() => {
10388
- queuePostRenderEffect(() => {
10389
- if (!instance.isUnmounted) update();
10390
- }, parentSuspense);
10466
+ unresolvedAsyncRoot.asyncDep.then(() => {
10467
+ const retry = () => {
10468
+ if (instance.job.flags & 8) return;
10469
+ if (parentSuspense && parentSuspense.pendingBranch) {
10470
+ queuePostRenderEffect(retry, parentSuspense);
10471
+ } else {
10472
+ update();
10473
+ }
10474
+ };
10475
+ retry.flags = 16 | 32;
10476
+ queuePostRenderEffect(retry, parentSuspense);
10391
10477
  });
10392
10478
  return;
10393
10479
  }
@@ -10429,8 +10515,11 @@ If you want to remount the same app, move your app creation logic into a factory
10429
10515
  patch(
10430
10516
  prevTree,
10431
10517
  nextTree,
10432
- // parent may have changed if it's in a teleport
10433
- hostParentNode(prevTree.el),
10518
+ // parent may have changed if it's in a teleport. a root that is a
10519
+ // pending async component only has its placeholder comment
10520
+ hostParentNode(
10521
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
10522
+ ),
10434
10523
  // anchor may have changed if it's in a fragment
10435
10524
  getNextHostNode(prevTree),
10436
10525
  instance,
@@ -10876,8 +10965,7 @@ If you want to remount the same app, move your app creation logic into a factory
10876
10965
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
10877
10966
  parentComponent.renderCache[cacheIndex] = void 0;
10878
10967
  }
10879
- if (shapeFlag & 256) {
10880
- parentComponent.ctx.deactivate(vnode);
10968
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
10881
10969
  return;
10882
10970
  }
10883
10971
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -11002,7 +11090,7 @@ If you want to remount the same app, move your app creation logic into a factory
11002
11090
  if (job) {
11003
11091
  job.flags |= 8;
11004
11092
  unmount(subTree, instance, parentSuspense, doRemove);
11005
- } else if (instance.vnode.el && subTree) {
11093
+ } else if (subTree) {
11006
11094
  subTree.transition = instance.vnode.transition;
11007
11095
  unmount(subTree, instance, parentSuspense, doRemove);
11008
11096
  }
@@ -11015,9 +11103,11 @@ If you want to remount the same app, move your app creation logic into a factory
11015
11103
  parentSuspense
11016
11104
  );
11017
11105
  }
11018
- queuePostRenderEffect(() => {
11106
+ const markUnmounted = () => {
11019
11107
  instance.isUnmounted = true;
11020
- }, parentSuspense);
11108
+ };
11109
+ markUnmounted.flags = 16;
11110
+ queuePostRenderEffect(markUnmounted, parentSuspense);
11021
11111
  {
11022
11112
  devtoolsComponentRemoved(instance);
11023
11113
  }
@@ -11169,13 +11259,13 @@ If you want to remount the same app, move your app creation logic into a factory
11169
11259
  }
11170
11260
  return result;
11171
11261
  }
11172
- function locateNonHydratedAsyncRoot(instance) {
11262
+ function locateUnresolvedAsyncRoot(instance) {
11173
11263
  const subComponent = instance.subTree.component;
11174
11264
  if (subComponent) {
11175
11265
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
11176
11266
  return subComponent;
11177
11267
  } else {
11178
- return locateNonHydratedAsyncRoot(subComponent);
11268
+ return locateUnresolvedAsyncRoot(subComponent);
11179
11269
  }
11180
11270
  }
11181
11271
  }
@@ -11193,11 +11283,16 @@ If you want to remount the same app, move your app creation logic into a factory
11193
11283
  if (instance) {
11194
11284
  return resolveAsyncComponentPlaceholder(instance.subTree);
11195
11285
  }
11286
+ const suspense = anchorVnode.suspense;
11287
+ if (suspense && suspense.activeBranch) {
11288
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
11289
+ }
11196
11290
  return null;
11197
11291
  }
11198
11292
 
11199
11293
  const isSuspense = (type) => type.__isSuspense;
11200
11294
  let suspenseId = 0;
11295
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
11201
11296
  const SuspenseImpl = {
11202
11297
  name: "Suspense",
11203
11298
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -11219,11 +11314,22 @@ If you want to remount the same app, move your app creation logic into a factory
11219
11314
  rendererInternals
11220
11315
  );
11221
11316
  } else {
11222
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
11223
- n2.suspense = n1.suspense;
11224
- n2.suspense.vnode = n2;
11225
- n2.el = n1.el;
11226
- return;
11317
+ const suspense = n1.suspense;
11318
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
11319
+ const owner = suspense.parentComponent;
11320
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
11321
+ if (retained ? (
11322
+ // deps can outlive the pending branch: skip only while it exists
11323
+ parentSuspense.pendingBranch && !isSameVNodeType(
11324
+ n2.ssContent,
11325
+ suspense.pendingBranch || suspense.activeBranch
11326
+ )
11327
+ ) : !suspense.isInFallback) {
11328
+ n2.suspense = suspense;
11329
+ suspense.vnode = n2;
11330
+ n2.el = n1.el;
11331
+ return;
11332
+ }
11227
11333
  }
11228
11334
  patchSuspense(
11229
11335
  n1,
@@ -11248,6 +11354,38 @@ If you want to remount the same app, move your app creation logic into a factory
11248
11354
  eventListener();
11249
11355
  }
11250
11356
  }
11357
+ function enterDeferred(branch) {
11358
+ const enters = [];
11359
+ collectDeferredEnters(branch, enters, true);
11360
+ if (enters.length) {
11361
+ queuePostFlushCb(enters);
11362
+ }
11363
+ }
11364
+ function collectDeferredEnters(vnode, enters, isRoot) {
11365
+ const { el, transition, children, shapeFlag } = vnode;
11366
+ if (shapeFlag & 6) {
11367
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
11368
+ return;
11369
+ }
11370
+ if (shapeFlag & (128 | 64)) {
11371
+ return;
11372
+ }
11373
+ if (shapeFlag & 1) {
11374
+ if (!isRoot && el && el[deferredEnterKey]) {
11375
+ el[deferredEnterKey] = void 0;
11376
+ if (transition && !transition.persisted) {
11377
+ transition.beforeEnter(el);
11378
+ enters.push(() => transition.enter(el));
11379
+ }
11380
+ }
11381
+ isRoot = false;
11382
+ }
11383
+ if (shapeFlag & 16) {
11384
+ for (let i = 0; i < children.length; i++) {
11385
+ collectDeferredEnters(children[i], enters, isRoot);
11386
+ }
11387
+ }
11388
+ }
11251
11389
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
11252
11390
  const {
11253
11391
  p: patch,
@@ -11347,7 +11485,7 @@ If you want to remount the same app, move your app creation logic into a factory
11347
11485
  unmount(pendingBranch, parentComponent, suspense);
11348
11486
  }
11349
11487
  suspense.deps = 0;
11350
- suspense.effects.length = 0;
11488
+ discardEffects(suspense);
11351
11489
  suspense.hiddenContainer = createElement("div");
11352
11490
  if (isInFallback) {
11353
11491
  patch(
@@ -11425,11 +11563,7 @@ If you want to remount the same app, move your app creation logic into a factory
11425
11563
  } else {
11426
11564
  triggerEvent(n2, "onPending");
11427
11565
  suspense.pendingBranch = newBranch;
11428
- if (newBranch.shapeFlag & 512) {
11429
- suspense.pendingId = newBranch.component.suspenseId;
11430
- } else {
11431
- suspense.pendingId = suspenseId++;
11432
- }
11566
+ suspense.pendingId = suspenseId++;
11433
11567
  patch(
11434
11568
  null,
11435
11569
  newBranch,
@@ -11444,12 +11578,11 @@ If you want to remount the same app, move your app creation logic into a factory
11444
11578
  if (suspense.deps <= 0) {
11445
11579
  suspense.resolve();
11446
11580
  } else {
11447
- const { timeout, pendingId } = suspense;
11581
+ const { timeout } = suspense;
11448
11582
  if (timeout > 0) {
11449
- setTimeout(() => {
11450
- if (suspense.pendingId === pendingId) {
11451
- suspense.fallback(newFallback);
11452
- }
11583
+ suspense.timeoutTimer = setTimeout(() => {
11584
+ suspense.timeoutTimer = void 0;
11585
+ suspense.fallback(suspense.vnode.ssFallback);
11453
11586
  }, timeout);
11454
11587
  } else if (timeout === 0) {
11455
11588
  suspense.fallback(newFallback);
@@ -11496,6 +11629,7 @@ If you want to remount the same app, move your app creation logic into a factory
11496
11629
  deps: 0,
11497
11630
  pendingId: suspenseId++,
11498
11631
  timeout: typeof timeout === "number" ? timeout : -1,
11632
+ timeoutTimer: void 0,
11499
11633
  activeBranch: null,
11500
11634
  isFallbackMountPending: false,
11501
11635
  pendingBranch: null,
@@ -11534,7 +11668,8 @@ If you want to remount the same app, move your app creation logic into a factory
11534
11668
  let hasUpdatedAnchor = false;
11535
11669
  if (delayEnter) {
11536
11670
  activeBranch.transition.afterLeave = () => {
11537
- if (pendingId === suspense.pendingId) {
11671
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
11672
+ enterDeferred(pendingBranch);
11538
11673
  move(
11539
11674
  pendingBranch,
11540
11675
  container2,
@@ -11549,7 +11684,9 @@ If you want to remount the same app, move your app creation logic into a factory
11549
11684
  };
11550
11685
  }
11551
11686
  if (activeBranch && !suspense.isFallbackMountPending) {
11552
- if (parentNode(activeBranch.el) === container2) {
11687
+ if (parentNode(
11688
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
11689
+ ) === container2) {
11553
11690
  anchor = next(activeBranch);
11554
11691
  hasUpdatedAnchor = true;
11555
11692
  }
@@ -11559,13 +11696,26 @@ If you want to remount the same app, move your app creation logic into a factory
11559
11696
  }
11560
11697
  }
11561
11698
  if (!delayEnter) {
11699
+ enterDeferred(pendingBranch);
11562
11700
  move(pendingBranch, container2, anchor, 0);
11563
11701
  }
11564
11702
  }
11703
+ clearTimeout(suspense.timeoutTimer);
11704
+ suspense.timeoutTimer = void 0;
11565
11705
  suspense.isFallbackMountPending = false;
11566
11706
  setActiveBranch(suspense, pendingBranch);
11567
11707
  suspense.pendingBranch = null;
11568
11708
  suspense.isInFallback = false;
11709
+ let kept = 0;
11710
+ for (let i = 0; i < effects.length; i++) {
11711
+ const effect = effects[i];
11712
+ if (effect.flags & 32) {
11713
+ queuePostFlushCb(effect);
11714
+ } else {
11715
+ effects[kept++] = effect;
11716
+ }
11717
+ }
11718
+ effects.length = kept;
11569
11719
  let parent = suspense.parent;
11570
11720
  let hasUnresolvedAncestor = false;
11571
11721
  while (parent) {
@@ -11594,7 +11744,7 @@ If you want to remount the same app, move your app creation logic into a factory
11594
11744
  triggerEvent(vnode2, "onResolve");
11595
11745
  },
11596
11746
  fallback(fallbackVNode) {
11597
- if (!suspense.pendingBranch) {
11747
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
11598
11748
  return;
11599
11749
  }
11600
11750
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -11602,7 +11752,7 @@ If you want to remount the same app, move your app creation logic into a factory
11602
11752
  const anchor2 = next(activeBranch);
11603
11753
  const mountFallback = () => {
11604
11754
  suspense.isFallbackMountPending = false;
11605
- if (!suspense.isInFallback) {
11755
+ if (suspense.isUnmounted || !suspense.isInFallback) {
11606
11756
  return;
11607
11757
  }
11608
11758
  const latestFallback = suspense.vnode.ssFallback;
@@ -11654,19 +11804,7 @@ If you want to remount the same app, move your app creation logic into a factory
11654
11804
  suspense.deps++;
11655
11805
  }
11656
11806
  const hydratedEl = instance.vnode.el;
11657
- instance.asyncDep.catch((err) => {
11658
- handleError(err, instance, 0);
11659
- }).then((asyncSetupResult) => {
11660
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11661
- return;
11662
- }
11663
- unsetCurrentInstance();
11664
- if (!instance.scope.active) {
11665
- if (isInPendingSuspense && --suspense.deps === 0) {
11666
- suspense.resolve();
11667
- }
11668
- return;
11669
- }
11807
+ const render = (asyncSetupResult) => {
11670
11808
  instance.asyncResolved = true;
11671
11809
  const { vnode: vnode2 } = instance;
11672
11810
  {
@@ -11699,13 +11837,57 @@ If you want to remount the same app, move your app creation logic into a factory
11699
11837
  {
11700
11838
  popWarningContext();
11701
11839
  }
11702
- if (isInPendingSuspense && --suspense.deps === 0) {
11840
+ };
11841
+ instance.asyncDep.catch((err) => {
11842
+ handleError(err, instance, 0, false, true);
11843
+ return () => null;
11844
+ }).then((asyncSetupResult) => {
11845
+ if (instance.isUnmounted || suspense.isUnmounted) {
11846
+ return;
11847
+ }
11848
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
11849
+ unsetCurrentInstance();
11850
+ if (!instance.scope.active) {
11851
+ if (isPendingDep && --suspense.deps === 0) {
11852
+ suspense.resolve();
11853
+ }
11854
+ return;
11855
+ }
11856
+ if (!isPendingDep && suspense.pendingBranch) {
11857
+ const job = () => {
11858
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
11859
+ return;
11860
+ }
11861
+ if (suspense.pendingBranch) {
11862
+ queueEffectWithSuspense(job, suspense);
11863
+ } else {
11864
+ render(asyncSetupResult);
11865
+ }
11866
+ };
11867
+ job.flags = 16 | 32;
11868
+ queueEffectWithSuspense(job, suspense);
11869
+ return;
11870
+ }
11871
+ render(asyncSetupResult);
11872
+ if (isPendingDep && --suspense.deps === 0) {
11703
11873
  suspense.resolve();
11704
11874
  }
11705
11875
  });
11706
11876
  },
11707
11877
  unmount(parentSuspense2, doRemove) {
11708
11878
  suspense.isUnmounted = true;
11879
+ clearTimeout(suspense.timeoutTimer);
11880
+ suspense.timeoutTimer = void 0;
11881
+ if (parentSuspenseId !== void 0) {
11882
+ const parent = suspense.parent;
11883
+ const pendingId = parentSuspenseId;
11884
+ parentSuspenseId = void 0;
11885
+ queuePostFlushCb(() => {
11886
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
11887
+ parent.resolve();
11888
+ }
11889
+ });
11890
+ }
11709
11891
  if (suspense.activeBranch) {
11710
11892
  unmount(
11711
11893
  suspense.activeBranch,
@@ -11715,12 +11897,8 @@ If you want to remount the same app, move your app creation logic into a factory
11715
11897
  );
11716
11898
  }
11717
11899
  if (suspense.pendingBranch) {
11718
- unmount(
11719
- suspense.pendingBranch,
11720
- parentComponent,
11721
- parentSuspense2,
11722
- doRemove
11723
- );
11900
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
11901
+ discardEffects(suspense);
11724
11902
  }
11725
11903
  }
11726
11904
  };
@@ -11790,6 +11968,16 @@ If you want to remount the same app, move your app creation logic into a factory
11790
11968
  }
11791
11969
  return s;
11792
11970
  }
11971
+ function discardEffects(suspense) {
11972
+ const { effects } = suspense;
11973
+ for (let i = 0; i < effects.length; i++) {
11974
+ const effect = effects[i];
11975
+ if (effect.flags & 16) {
11976
+ queuePostFlushCb(effect);
11977
+ }
11978
+ }
11979
+ effects.length = 0;
11980
+ }
11793
11981
  function queueEffectWithSuspense(fn, suspense) {
11794
11982
  if (suspense && suspense.pendingBranch) {
11795
11983
  if (isArray(fn)) {
@@ -12105,7 +12293,8 @@ Component that was made reactive: `,
12105
12293
  }
12106
12294
  function guardReactiveProps(props) {
12107
12295
  if (!props) return null;
12108
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
12296
+ if (isProxy(props)) return extend({}, props);
12297
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
12109
12298
  }
12110
12299
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
12111
12300
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -12287,7 +12476,7 @@ Component that was made reactive: `,
12287
12476
  ]);
12288
12477
  }
12289
12478
 
12290
- const emptyAppContext = createAppContext();
12479
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
12291
12480
  let uid = 0;
12292
12481
  function getNextUid() {
12293
12482
  return uid;
@@ -12488,7 +12677,8 @@ Component that was made reactive: `,
12488
12677
  setInSSRSetupState(false);
12489
12678
  }
12490
12679
  }).catch((e) => {
12491
- handleError(e, instance, 0);
12680
+ handleError(e, instance, 0, void 0, true);
12681
+ instance.ssrRender = (_, push) => push("<!---->");
12492
12682
  });
12493
12683
  } else {
12494
12684
  instance.asyncDep = setupResult;
@@ -12606,11 +12796,12 @@ Component that was made reactive: `,
12606
12796
  }
12607
12797
  }
12608
12798
  }
12799
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
12609
12800
  const attrsProxyHandlers = {
12610
12801
  get(target, key) {
12611
12802
  markAttrsAccessed();
12612
12803
  track(target, "get", "");
12613
- return target[key];
12804
+ return key === rawAttrsKey ? target : target[key];
12614
12805
  },
12615
12806
  set() {
12616
12807
  warn$1(`setupContext.attrs is readonly.`);
@@ -12962,7 +13153,7 @@ Component that was made reactive: `,
12962
13153
  return true;
12963
13154
  }
12964
13155
 
12965
- const version = "3.5.44";
13156
+ const version = "3.5.45";
12966
13157
  const warn = warn$1 ;
12967
13158
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12968
13159
  const devtools = devtools$1 ;
@@ -14833,18 +15024,18 @@ Expected function or array of functions, received type ${typeof value}.`
14833
15024
  },
14834
15025
  // set value in mounted & updated because <select> relies on its children
14835
15026
  // <option>s.
14836
- mounted(el, { value }) {
14837
- setSelected(el, value);
15027
+ mounted(el, { value, modifiers: { number } }) {
15028
+ setSelected(el, value, number);
14838
15029
  },
14839
15030
  beforeUpdate(el, { value }, vnode) {
14840
15031
  el._modelValue = value;
14841
15032
  el[assignKey] = getModelAssigner(vnode);
14842
15033
  },
14843
- updated(el, { value }) {
15034
+ updated(el, { value, modifiers: { number } }) {
14844
15035
  const pending = el._pendingValue;
14845
15036
  el._pendingValue = void 0;
14846
15037
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14847
- setSelected(el, value);
15038
+ setSelected(el, value, number);
14848
15039
  }
14849
15040
  }
14850
15041
  };
@@ -14860,7 +15051,7 @@ Expected function or array of functions, received type ${typeof value}.`
14860
15051
  }
14861
15052
  return false;
14862
15053
  }
14863
- function setSelected(el, value) {
15054
+ function setSelected(el, value, number = false) {
14864
15055
  const isMultiple = el.multiple;
14865
15056
  const isArrayValue = isArray(value);
14866
15057
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -14881,7 +15072,7 @@ Expected function or array of functions, received type ${typeof value}.`
14881
15072
  option.selected = looseIndexOf(value, optionValue) > -1;
14882
15073
  }
14883
15074
  } else {
14884
- option.selected = value.has(optionValue);
15075
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
14885
15076
  }
14886
15077
  } else if (looseEqual(getValue(option), value)) {
14887
15078
  if (el.selectedIndex !== i) el.selectedIndex = i;
@@ -17525,7 +17716,11 @@ For props declared with defineModel(), assign the returned ref to a variable and
17525
17716
  };
17526
17717
  }
17527
17718
  function cloneLoc(loc) {
17528
- return getLoc(loc.start.offset, loc.end.offset);
17719
+ return {
17720
+ start: extend({}, loc.start),
17721
+ end: extend({}, loc.end),
17722
+ source: loc.source
17723
+ };
17529
17724
  }
17530
17725
  function setLocEnd(loc, end) {
17531
17726
  loc.end = tokenizer.getPos(end);