@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
  **/
@@ -61,24 +61,20 @@ const cacheStringFunction = (fn) => {
61
61
  });
62
62
  };
63
63
  const camelizeRE = /-\w/g;
64
- const camelize = cacheStringFunction(
65
- (str) => {
66
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
67
- }
68
- );
64
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
65
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
66
+ });
69
67
  const hyphenateRE = /\B([A-Z])/g;
70
- const hyphenate = cacheStringFunction(
68
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
71
69
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
72
70
  );
73
- const capitalize = cacheStringFunction((str) => {
71
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
74
72
  return str.charAt(0).toUpperCase() + str.slice(1);
75
73
  });
76
- const toHandlerKey = cacheStringFunction(
77
- (str) => {
78
- const s = str ? `on${capitalize(str)}` : ``;
79
- return s;
80
- }
81
- );
74
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
75
+ const s = str ? `on${capitalize(str)}` : ``;
76
+ return s;
77
+ });
82
78
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
83
79
  const invokeArrayFns = (fns, ...arg) => {
84
80
  for (let i = 0; i < fns.length; i++) {
@@ -191,7 +187,7 @@ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
191
187
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
192
188
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
193
189
 
194
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
190
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
195
191
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
196
192
  const isBooleanAttr = /* @__PURE__ */ makeMap(
197
193
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -535,7 +531,11 @@ function getCurrentScope() {
535
531
  }
536
532
  function onScopeDispose(fn, failSilently = false) {
537
533
  if (activeEffectScope) {
538
- activeEffectScope.cleanups.push(fn);
534
+ if (activeEffectScope.active) {
535
+ activeEffectScope.cleanups.push(fn);
536
+ } else {
537
+ fn();
538
+ }
539
539
  } else if (!failSilently) {
540
540
  warn$2(
541
541
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1342,7 +1342,7 @@ function noTracking(self, method, args = []) {
1342
1342
  }
1343
1343
 
1344
1344
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1345
- const builtInSymbols = new Set(
1345
+ const builtInSymbols = /* @__PURE__ */ new Set(
1346
1346
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1347
1347
  );
1348
1348
  function hasOwnProperty(key) {
@@ -2552,7 +2552,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2552
2552
  const res = callWithErrorHandling(fn, instance, type, args);
2553
2553
  if (res && isPromise(res)) {
2554
2554
  res.catch((err) => {
2555
- handleError(err, instance, type);
2555
+ handleError(err, instance, type, void 0, true);
2556
2556
  });
2557
2557
  }
2558
2558
  return res;
@@ -2569,7 +2569,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2569
2569
  );
2570
2570
  }
2571
2571
  }
2572
- function handleError(err, instance, type, throwInDev = true) {
2572
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2573
2573
  const contextVNode = instance ? instance.vnode : null;
2574
2574
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2575
2575
  if (instance) {
@@ -2578,7 +2578,9 @@ function handleError(err, instance, type, throwInDev = true) {
2578
2578
  const errorInfo = ErrorTypeStrings$1[type] ;
2579
2579
  while (cur) {
2580
2580
  const errorCapturedHooks = cur.ec;
2581
- if (errorCapturedHooks) {
2581
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2582
+ // are deferred or discarded by Suspense.
2583
+ (!isAsyncError || cur.scope.active)) {
2582
2584
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2583
2585
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2584
2586
  return;
@@ -2906,14 +2908,32 @@ function reload(id, newComp) {
2906
2908
  instance.ceReload(newComp.styles);
2907
2909
  dirtyInstances.delete(instance);
2908
2910
  } else if (instance.parent) {
2909
- queueJob(() => {
2910
- if (!(instance.job.flags & 8)) {
2911
- isHmrUpdating = true;
2911
+ const update = () => {
2912
+ if (!instance.scope.active) return;
2913
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
2914
+ if (pending) {
2915
+ pending.asyncDep.catch(NOOP).then(() => {
2916
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
2917
+ queueJob(update);
2918
+ }
2919
+ });
2920
+ return;
2921
+ }
2922
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
2923
+ if (!dirtyInstances) {
2924
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2925
+ }
2926
+ dirtyInstances.add(instance);
2927
+ isHmrUpdating = true;
2928
+ try {
2912
2929
  instance.parent.update();
2930
+ } finally {
2913
2931
  isHmrUpdating = false;
2914
2932
  dirtyInstances.delete(instance);
2933
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
2915
2934
  }
2916
- });
2935
+ };
2936
+ queueJob(update);
2917
2937
  } else if (instance.appContext.reload) {
2918
2938
  instance.appContext.reload();
2919
2939
  } else if (typeof window !== "undefined") {
@@ -3595,12 +3615,31 @@ function withDirectives(vnode, directives) {
3595
3615
  return vnode;
3596
3616
  }
3597
3617
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3598
- const bindings = vnode.dirs;
3618
+ let hookVNode = vnode;
3619
+ if (name === "beforeMount") {
3620
+ vnode._mount = vnode;
3621
+ } else if (name === "beforeUpdate") {
3622
+ const mount = prevVNode && prevVNode._mount;
3623
+ if (mount) {
3624
+ mount._latest = vnode;
3625
+ vnode._mount = mount;
3626
+ }
3627
+ } else if (name === "mounted") {
3628
+ const latest = vnode._latest;
3629
+ vnode._mount = vnode._latest = void 0;
3630
+ if (latest) {
3631
+ hookVNode = latest;
3632
+ latest._mount = void 0;
3633
+ }
3634
+ }
3635
+ const bindings = hookVNode.dirs;
3599
3636
  const oldBindings = prevVNode && prevVNode.dirs;
3600
3637
  for (let i = 0; i < bindings.length; i++) {
3601
- const binding = bindings[i];
3638
+ let binding = bindings[i];
3602
3639
  if (oldBindings) {
3603
3640
  binding.oldValue = oldBindings[i].value;
3641
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3642
+ binding = extend({}, binding, { oldValue: void 0 });
3604
3643
  }
3605
3644
  let hook = binding.dir[name];
3606
3645
  if (!hook) {
@@ -3611,7 +3650,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3611
3650
  callWithAsyncErrorHandling(hook, instance, 8, [
3612
3651
  vnode.el,
3613
3652
  binding,
3614
- vnode,
3653
+ hookVNode,
3615
3654
  prevVNode
3616
3655
  ]);
3617
3656
  resetTracking();
@@ -4235,13 +4274,11 @@ const BaseTransitionImpl = {
4235
4274
  if (!innerChild) {
4236
4275
  return emptyPlaceholder(child);
4237
4276
  }
4238
- let enterHooks = resolveTransitionHooks(
4277
+ const enterHooks = resolveTransitionHooks(
4239
4278
  innerChild,
4240
4279
  rawProps,
4241
4280
  state,
4242
- instance,
4243
- // #11061, ensure enterHooks is fresh after clone
4244
- (hooks) => enterHooks = hooks
4281
+ instance
4245
4282
  );
4246
4283
  if (innerChild.type !== Comment) {
4247
4284
  setTransitionHooks(innerChild, enterHooks);
@@ -4260,7 +4297,17 @@ const BaseTransitionImpl = {
4260
4297
  leavingHooks.afterLeave = () => {
4261
4298
  state.isLeaving = false;
4262
4299
  if (!(instance.job.flags & 8)) {
4263
- instance.update();
4300
+ if (instance.effect.flags & 2) {
4301
+ const job = () => {
4302
+ if (!(instance.job.flags & 8)) {
4303
+ instance.update();
4304
+ }
4305
+ };
4306
+ job.i = instance;
4307
+ queueJob(job);
4308
+ } else {
4309
+ instance.update();
4310
+ }
4264
4311
  }
4265
4312
  delete leavingHooks.afterLeave;
4266
4313
  oldInnerChild = void 0;
@@ -4327,7 +4374,7 @@ function getLeavingNodesForType(state, vnode) {
4327
4374
  }
4328
4375
  return leavingVNodesCache;
4329
4376
  }
4330
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4377
+ function resolveTransitionHooks(vnode, props, state, instance) {
4331
4378
  const {
4332
4379
  appear,
4333
4380
  mode,
@@ -4466,15 +4513,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4466
4513
  }
4467
4514
  },
4468
4515
  clone(vnode2) {
4469
- const hooks2 = resolveTransitionHooks(
4470
- vnode2,
4471
- props,
4472
- state,
4473
- instance,
4474
- postClone
4475
- );
4476
- if (postClone) postClone(hooks2);
4477
- return hooks2;
4516
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4517
+ cloned.afterLeave = () => {
4518
+ if (hooks.afterLeave) hooks.afterLeave();
4519
+ };
4520
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4521
+ if (hooks.delayLeave) {
4522
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4523
+ } else {
4524
+ delayedLeave();
4525
+ }
4526
+ };
4527
+ cloned.delayedLeave = () => {
4528
+ if (hooks.delayedLeave) hooks.delayedLeave();
4529
+ };
4530
+ return cloned;
4478
4531
  }
4479
4532
  };
4480
4533
  return hooks;
@@ -4515,8 +4568,16 @@ function setTransitionHooks(vnode, hooks) {
4515
4568
  hooks
4516
4569
  );
4517
4570
  } else if (vnode.shapeFlag & 128) {
4518
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4519
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4571
+ const suspense = vnode.suspense;
4572
+ if (suspense) {
4573
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4574
+ if (branch) {
4575
+ setTransitionHooks(branch, hooks.clone(branch));
4576
+ }
4577
+ } else {
4578
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4579
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4580
+ }
4520
4581
  } else {
4521
4582
  vnode.transition = hooks;
4522
4583
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -5217,7 +5278,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5217
5278
  getContainerType(container),
5218
5279
  slotScopeIds
5219
5280
  );
5220
- if (parentComponent) {
5281
+ if (parentComponent && parentComponent.vnode.el === node) {
5221
5282
  parentComponent.vnode.el = vnode.el;
5222
5283
  updateHOCHostEl(parentComponent, vnode.el);
5223
5284
  }
@@ -5651,7 +5712,8 @@ function defineAsyncComponent(source) {
5651
5712
  err,
5652
5713
  instance,
5653
5714
  13,
5654
- !errorComponent
5715
+ !errorComponent,
5716
+ true
5655
5717
  );
5656
5718
  };
5657
5719
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -5669,7 +5731,7 @@ function defineAsyncComponent(source) {
5669
5731
  const delayed = ref(!!delay);
5670
5732
  let timeoutTimer;
5671
5733
  let delayTimer;
5672
- onUnmounted(() => {
5734
+ onScopeDispose(() => {
5673
5735
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5674
5736
  if (delayTimer != null) clearTimeout(delayTimer);
5675
5737
  });
@@ -5797,6 +5859,12 @@ const KeepAliveImpl = {
5797
5859
  }
5798
5860
  };
5799
5861
  sharedContext.deactivate = (vnode) => {
5862
+ const cached = cache.get(
5863
+ vnode.key == null ? vnode.type : vnode.key
5864
+ );
5865
+ if (!cached || cached.component !== vnode.component) {
5866
+ return false;
5867
+ }
5800
5868
  const instance2 = vnode.component;
5801
5869
  invalidateMount(instance2.m);
5802
5870
  invalidateMount(instance2.a);
@@ -5817,6 +5885,7 @@ const KeepAliveImpl = {
5817
5885
  {
5818
5886
  instance2.__keepAliveStorageContainer = storageContainer;
5819
5887
  }
5888
+ return true;
5820
5889
  };
5821
5890
  function unmount(vnode) {
5822
5891
  resetShapeFlag(vnode);
@@ -5856,12 +5925,17 @@ const KeepAliveImpl = {
5856
5925
  const cacheSubtree = () => {
5857
5926
  if (pendingCacheKey != null) {
5858
5927
  if (isSuspense(instance.subTree.type)) {
5859
- queuePostRenderEffect(() => {
5928
+ const cacheInnerChild = () => {
5860
5929
  const vnode = getInnerChild(instance.subTree);
5861
5930
  if (vnode.component) {
5862
5931
  cache.set(pendingCacheKey, vnode);
5863
5932
  }
5864
- }, instance.subTree.suspense);
5933
+ };
5934
+ if (instance.subTree.suspense.pendingBranch) {
5935
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
5936
+ } else {
5937
+ cacheInnerChild();
5938
+ }
5865
5939
  } else {
5866
5940
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5867
5941
  }
@@ -5996,9 +6070,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5996
6070
  true
5997
6071
  /* prepend */
5998
6072
  );
5999
- onUnmounted(() => {
6000
- remove(keepAliveRoot[type], injected);
6001
- }, target);
6073
+ const removal = injectHook(
6074
+ "um",
6075
+ () => remove(keepAliveRoot[type], injected),
6076
+ target
6077
+ );
6078
+ removal.flags = 16;
6002
6079
  }
6003
6080
  function resetShapeFlag(vnode) {
6004
6081
  vnode.shapeFlag &= -257;
@@ -7732,7 +7809,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7732
7809
  return vm;
7733
7810
  }
7734
7811
  }
7735
- Vue.version = `2.6.14-compat:${"3.5.44"}`;
7812
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
7736
7813
  Vue.config = singletonApp.config;
7737
7814
  Vue.use = (plugin, ...options) => {
7738
7815
  if (plugin && isFunction(plugin.install)) {
@@ -9841,6 +9918,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9841
9918
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
9842
9919
  if (needCallTransitionHooks) {
9843
9920
  transition.beforeEnter(el);
9921
+ } else if (transition && !transition.persisted) {
9922
+ el[deferredEnterKey] = true;
9844
9923
  }
9845
9924
  hostInsert(el, container, anchor);
9846
9925
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -10339,16 +10418,23 @@ function baseCreateRenderer(options, createHydrationFns) {
10339
10418
  } else {
10340
10419
  let { next, bu, u, parent, vnode } = instance;
10341
10420
  {
10342
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
10343
- if (nonHydratedAsyncRoot) {
10421
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
10422
+ if (unresolvedAsyncRoot) {
10344
10423
  if (next) {
10345
10424
  next.el = vnode.el;
10346
10425
  updateComponentPreRender(instance, next, optimized);
10347
10426
  }
10348
- nonHydratedAsyncRoot.asyncDep.then(() => {
10349
- queuePostRenderEffect(() => {
10350
- if (!instance.isUnmounted) update();
10351
- }, parentSuspense);
10427
+ unresolvedAsyncRoot.asyncDep.then(() => {
10428
+ const retry = () => {
10429
+ if (instance.job.flags & 8) return;
10430
+ if (parentSuspense && parentSuspense.pendingBranch) {
10431
+ queuePostRenderEffect(retry, parentSuspense);
10432
+ } else {
10433
+ update();
10434
+ }
10435
+ };
10436
+ retry.flags = 16 | 32;
10437
+ queuePostRenderEffect(retry, parentSuspense);
10352
10438
  });
10353
10439
  return;
10354
10440
  }
@@ -10390,8 +10476,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10390
10476
  patch(
10391
10477
  prevTree,
10392
10478
  nextTree,
10393
- // parent may have changed if it's in a teleport
10394
- hostParentNode(prevTree.el),
10479
+ // parent may have changed if it's in a teleport. a root that is a
10480
+ // pending async component only has its placeholder comment
10481
+ hostParentNode(
10482
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
10483
+ ),
10395
10484
  // anchor may have changed if it's in a fragment
10396
10485
  getNextHostNode(prevTree),
10397
10486
  instance,
@@ -10837,8 +10926,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10837
10926
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
10838
10927
  parentComponent.renderCache[cacheIndex] = void 0;
10839
10928
  }
10840
- if (shapeFlag & 256) {
10841
- parentComponent.ctx.deactivate(vnode);
10929
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
10842
10930
  return;
10843
10931
  }
10844
10932
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -10963,7 +11051,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10963
11051
  if (job) {
10964
11052
  job.flags |= 8;
10965
11053
  unmount(subTree, instance, parentSuspense, doRemove);
10966
- } else if (instance.vnode.el && subTree) {
11054
+ } else if (subTree) {
10967
11055
  subTree.transition = instance.vnode.transition;
10968
11056
  unmount(subTree, instance, parentSuspense, doRemove);
10969
11057
  }
@@ -10976,9 +11064,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10976
11064
  parentSuspense
10977
11065
  );
10978
11066
  }
10979
- queuePostRenderEffect(() => {
11067
+ const markUnmounted = () => {
10980
11068
  instance.isUnmounted = true;
10981
- }, parentSuspense);
11069
+ };
11070
+ markUnmounted.flags = 16;
11071
+ queuePostRenderEffect(markUnmounted, parentSuspense);
10982
11072
  {
10983
11073
  devtoolsComponentRemoved(instance);
10984
11074
  }
@@ -11130,13 +11220,13 @@ function getSequence(arr) {
11130
11220
  }
11131
11221
  return result;
11132
11222
  }
11133
- function locateNonHydratedAsyncRoot(instance) {
11223
+ function locateUnresolvedAsyncRoot(instance) {
11134
11224
  const subComponent = instance.subTree.component;
11135
11225
  if (subComponent) {
11136
11226
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
11137
11227
  return subComponent;
11138
11228
  } else {
11139
- return locateNonHydratedAsyncRoot(subComponent);
11229
+ return locateUnresolvedAsyncRoot(subComponent);
11140
11230
  }
11141
11231
  }
11142
11232
  }
@@ -11154,11 +11244,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
11154
11244
  if (instance) {
11155
11245
  return resolveAsyncComponentPlaceholder(instance.subTree);
11156
11246
  }
11247
+ const suspense = anchorVnode.suspense;
11248
+ if (suspense && suspense.activeBranch) {
11249
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
11250
+ }
11157
11251
  return null;
11158
11252
  }
11159
11253
 
11160
11254
  const isSuspense = (type) => type.__isSuspense;
11161
11255
  let suspenseId = 0;
11256
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
11162
11257
  const SuspenseImpl = {
11163
11258
  name: "Suspense",
11164
11259
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -11180,11 +11275,22 @@ const SuspenseImpl = {
11180
11275
  rendererInternals
11181
11276
  );
11182
11277
  } else {
11183
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
11184
- n2.suspense = n1.suspense;
11185
- n2.suspense.vnode = n2;
11186
- n2.el = n1.el;
11187
- return;
11278
+ const suspense = n1.suspense;
11279
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
11280
+ const owner = suspense.parentComponent;
11281
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
11282
+ if (retained ? (
11283
+ // deps can outlive the pending branch: skip only while it exists
11284
+ parentSuspense.pendingBranch && !isSameVNodeType(
11285
+ n2.ssContent,
11286
+ suspense.pendingBranch || suspense.activeBranch
11287
+ )
11288
+ ) : !suspense.isInFallback) {
11289
+ n2.suspense = suspense;
11290
+ suspense.vnode = n2;
11291
+ n2.el = n1.el;
11292
+ return;
11293
+ }
11188
11294
  }
11189
11295
  patchSuspense(
11190
11296
  n1,
@@ -11209,6 +11315,38 @@ function triggerEvent(vnode, name) {
11209
11315
  eventListener();
11210
11316
  }
11211
11317
  }
11318
+ function enterDeferred(branch) {
11319
+ const enters = [];
11320
+ collectDeferredEnters(branch, enters, true);
11321
+ if (enters.length) {
11322
+ queuePostFlushCb(enters);
11323
+ }
11324
+ }
11325
+ function collectDeferredEnters(vnode, enters, isRoot) {
11326
+ const { el, transition, children, shapeFlag } = vnode;
11327
+ if (shapeFlag & 6) {
11328
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
11329
+ return;
11330
+ }
11331
+ if (shapeFlag & (128 | 64)) {
11332
+ return;
11333
+ }
11334
+ if (shapeFlag & 1) {
11335
+ if (!isRoot && el && el[deferredEnterKey]) {
11336
+ el[deferredEnterKey] = void 0;
11337
+ if (transition && !transition.persisted) {
11338
+ transition.beforeEnter(el);
11339
+ enters.push(() => transition.enter(el));
11340
+ }
11341
+ }
11342
+ isRoot = false;
11343
+ }
11344
+ if (shapeFlag & 16) {
11345
+ for (let i = 0; i < children.length; i++) {
11346
+ collectDeferredEnters(children[i], enters, isRoot);
11347
+ }
11348
+ }
11349
+ }
11212
11350
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
11213
11351
  const {
11214
11352
  p: patch,
@@ -11308,7 +11446,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11308
11446
  unmount(pendingBranch, parentComponent, suspense);
11309
11447
  }
11310
11448
  suspense.deps = 0;
11311
- suspense.effects.length = 0;
11449
+ discardEffects(suspense);
11312
11450
  suspense.hiddenContainer = createElement("div");
11313
11451
  if (isInFallback) {
11314
11452
  patch(
@@ -11386,11 +11524,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11386
11524
  } else {
11387
11525
  triggerEvent(n2, "onPending");
11388
11526
  suspense.pendingBranch = newBranch;
11389
- if (newBranch.shapeFlag & 512) {
11390
- suspense.pendingId = newBranch.component.suspenseId;
11391
- } else {
11392
- suspense.pendingId = suspenseId++;
11393
- }
11527
+ suspense.pendingId = suspenseId++;
11394
11528
  patch(
11395
11529
  null,
11396
11530
  newBranch,
@@ -11405,12 +11539,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11405
11539
  if (suspense.deps <= 0) {
11406
11540
  suspense.resolve();
11407
11541
  } else {
11408
- const { timeout, pendingId } = suspense;
11542
+ const { timeout } = suspense;
11409
11543
  if (timeout > 0) {
11410
- setTimeout(() => {
11411
- if (suspense.pendingId === pendingId) {
11412
- suspense.fallback(newFallback);
11413
- }
11544
+ suspense.timeoutTimer = setTimeout(() => {
11545
+ suspense.timeoutTimer = void 0;
11546
+ suspense.fallback(suspense.vnode.ssFallback);
11414
11547
  }, timeout);
11415
11548
  } else if (timeout === 0) {
11416
11549
  suspense.fallback(newFallback);
@@ -11457,6 +11590,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11457
11590
  deps: 0,
11458
11591
  pendingId: suspenseId++,
11459
11592
  timeout: typeof timeout === "number" ? timeout : -1,
11593
+ timeoutTimer: void 0,
11460
11594
  activeBranch: null,
11461
11595
  isFallbackMountPending: false,
11462
11596
  pendingBranch: null,
@@ -11495,7 +11629,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11495
11629
  let hasUpdatedAnchor = false;
11496
11630
  if (delayEnter) {
11497
11631
  activeBranch.transition.afterLeave = () => {
11498
- if (pendingId === suspense.pendingId) {
11632
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
11633
+ enterDeferred(pendingBranch);
11499
11634
  move(
11500
11635
  pendingBranch,
11501
11636
  container2,
@@ -11510,7 +11645,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11510
11645
  };
11511
11646
  }
11512
11647
  if (activeBranch && !suspense.isFallbackMountPending) {
11513
- if (parentNode(activeBranch.el) === container2) {
11648
+ if (parentNode(
11649
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
11650
+ ) === container2) {
11514
11651
  anchor = next(activeBranch);
11515
11652
  hasUpdatedAnchor = true;
11516
11653
  }
@@ -11520,13 +11657,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11520
11657
  }
11521
11658
  }
11522
11659
  if (!delayEnter) {
11660
+ enterDeferred(pendingBranch);
11523
11661
  move(pendingBranch, container2, anchor, 0);
11524
11662
  }
11525
11663
  }
11664
+ clearTimeout(suspense.timeoutTimer);
11665
+ suspense.timeoutTimer = void 0;
11526
11666
  suspense.isFallbackMountPending = false;
11527
11667
  setActiveBranch(suspense, pendingBranch);
11528
11668
  suspense.pendingBranch = null;
11529
11669
  suspense.isInFallback = false;
11670
+ let kept = 0;
11671
+ for (let i = 0; i < effects.length; i++) {
11672
+ const effect = effects[i];
11673
+ if (effect.flags & 32) {
11674
+ queuePostFlushCb(effect);
11675
+ } else {
11676
+ effects[kept++] = effect;
11677
+ }
11678
+ }
11679
+ effects.length = kept;
11530
11680
  let parent = suspense.parent;
11531
11681
  let hasUnresolvedAncestor = false;
11532
11682
  while (parent) {
@@ -11555,7 +11705,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11555
11705
  triggerEvent(vnode2, "onResolve");
11556
11706
  },
11557
11707
  fallback(fallbackVNode) {
11558
- if (!suspense.pendingBranch) {
11708
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
11559
11709
  return;
11560
11710
  }
11561
11711
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -11563,7 +11713,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11563
11713
  const anchor2 = next(activeBranch);
11564
11714
  const mountFallback = () => {
11565
11715
  suspense.isFallbackMountPending = false;
11566
- if (!suspense.isInFallback) {
11716
+ if (suspense.isUnmounted || !suspense.isInFallback) {
11567
11717
  return;
11568
11718
  }
11569
11719
  const latestFallback = suspense.vnode.ssFallback;
@@ -11615,19 +11765,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11615
11765
  suspense.deps++;
11616
11766
  }
11617
11767
  const hydratedEl = instance.vnode.el;
11618
- instance.asyncDep.catch((err) => {
11619
- handleError(err, instance, 0);
11620
- }).then((asyncSetupResult) => {
11621
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11622
- return;
11623
- }
11624
- unsetCurrentInstance();
11625
- if (!instance.scope.active) {
11626
- if (isInPendingSuspense && --suspense.deps === 0) {
11627
- suspense.resolve();
11628
- }
11629
- return;
11630
- }
11768
+ const render = (asyncSetupResult) => {
11631
11769
  instance.asyncResolved = true;
11632
11770
  const { vnode: vnode2 } = instance;
11633
11771
  {
@@ -11660,13 +11798,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11660
11798
  {
11661
11799
  popWarningContext();
11662
11800
  }
11663
- if (isInPendingSuspense && --suspense.deps === 0) {
11801
+ };
11802
+ instance.asyncDep.catch((err) => {
11803
+ handleError(err, instance, 0, false, true);
11804
+ return () => null;
11805
+ }).then((asyncSetupResult) => {
11806
+ if (instance.isUnmounted || suspense.isUnmounted) {
11807
+ return;
11808
+ }
11809
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
11810
+ unsetCurrentInstance();
11811
+ if (!instance.scope.active) {
11812
+ if (isPendingDep && --suspense.deps === 0) {
11813
+ suspense.resolve();
11814
+ }
11815
+ return;
11816
+ }
11817
+ if (!isPendingDep && suspense.pendingBranch) {
11818
+ const job = () => {
11819
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
11820
+ return;
11821
+ }
11822
+ if (suspense.pendingBranch) {
11823
+ queueEffectWithSuspense(job, suspense);
11824
+ } else {
11825
+ render(asyncSetupResult);
11826
+ }
11827
+ };
11828
+ job.flags = 16 | 32;
11829
+ queueEffectWithSuspense(job, suspense);
11830
+ return;
11831
+ }
11832
+ render(asyncSetupResult);
11833
+ if (isPendingDep && --suspense.deps === 0) {
11664
11834
  suspense.resolve();
11665
11835
  }
11666
11836
  });
11667
11837
  },
11668
11838
  unmount(parentSuspense2, doRemove) {
11669
11839
  suspense.isUnmounted = true;
11840
+ clearTimeout(suspense.timeoutTimer);
11841
+ suspense.timeoutTimer = void 0;
11842
+ if (parentSuspenseId !== void 0) {
11843
+ const parent = suspense.parent;
11844
+ const pendingId = parentSuspenseId;
11845
+ parentSuspenseId = void 0;
11846
+ queuePostFlushCb(() => {
11847
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
11848
+ parent.resolve();
11849
+ }
11850
+ });
11851
+ }
11670
11852
  if (suspense.activeBranch) {
11671
11853
  unmount(
11672
11854
  suspense.activeBranch,
@@ -11676,12 +11858,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11676
11858
  );
11677
11859
  }
11678
11860
  if (suspense.pendingBranch) {
11679
- unmount(
11680
- suspense.pendingBranch,
11681
- parentComponent,
11682
- parentSuspense2,
11683
- doRemove
11684
- );
11861
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
11862
+ discardEffects(suspense);
11685
11863
  }
11686
11864
  }
11687
11865
  };
@@ -11751,6 +11929,16 @@ function normalizeSuspenseSlot(s) {
11751
11929
  }
11752
11930
  return s;
11753
11931
  }
11932
+ function discardEffects(suspense) {
11933
+ const { effects } = suspense;
11934
+ for (let i = 0; i < effects.length; i++) {
11935
+ const effect = effects[i];
11936
+ if (effect.flags & 16) {
11937
+ queuePostFlushCb(effect);
11938
+ }
11939
+ }
11940
+ effects.length = 0;
11941
+ }
11754
11942
  function queueEffectWithSuspense(fn, suspense) {
11755
11943
  if (suspense && suspense.pendingBranch) {
11756
11944
  if (isArray(fn)) {
@@ -12066,7 +12254,8 @@ Component that was made reactive: `,
12066
12254
  }
12067
12255
  function guardReactiveProps(props) {
12068
12256
  if (!props) return null;
12069
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
12257
+ if (isProxy(props)) return extend({}, props);
12258
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
12070
12259
  }
12071
12260
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
12072
12261
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -12248,7 +12437,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
12248
12437
  ]);
12249
12438
  }
12250
12439
 
12251
- const emptyAppContext = createAppContext();
12440
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
12252
12441
  let uid = 0;
12253
12442
  function getNextUid() {
12254
12443
  return uid;
@@ -12461,7 +12650,8 @@ function setupStatefulComponent(instance, isSSR) {
12461
12650
  setInSSRSetupState(false);
12462
12651
  }
12463
12652
  }).catch((e) => {
12464
- handleError(e, instance, 0);
12653
+ handleError(e, instance, 0, void 0, true);
12654
+ instance.ssrRender = (_, push) => push("<!---->");
12465
12655
  });
12466
12656
  } else {
12467
12657
  instance.asyncDep = setupResult;
@@ -12581,11 +12771,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
12581
12771
  }
12582
12772
  }
12583
12773
  }
12774
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
12584
12775
  const attrsProxyHandlers = {
12585
12776
  get(target, key) {
12586
12777
  markAttrsAccessed();
12587
12778
  track(target, "get", "");
12588
- return target[key];
12779
+ return key === rawAttrsKey ? target : target[key];
12589
12780
  },
12590
12781
  set() {
12591
12782
  warn$1(`setupContext.attrs is readonly.`);
@@ -12937,7 +13128,7 @@ function isMemoSame(cached, memo) {
12937
13128
  return true;
12938
13129
  }
12939
13130
 
12940
- const version = "3.5.44";
13131
+ const version = "3.5.45";
12941
13132
  const warn = warn$1 ;
12942
13133
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12943
13134
  const devtools = devtools$1 ;
@@ -14839,18 +15030,18 @@ const vModelSelect = {
14839
15030
  },
14840
15031
  // set value in mounted & updated because <select> relies on its children
14841
15032
  // <option>s.
14842
- mounted(el, { value }) {
14843
- setSelected(el, value);
15033
+ mounted(el, { value, modifiers: { number } }) {
15034
+ setSelected(el, value, number);
14844
15035
  },
14845
15036
  beforeUpdate(el, { value }, vnode) {
14846
15037
  el._modelValue = value;
14847
15038
  el[assignKey] = getModelAssigner(vnode);
14848
15039
  },
14849
- updated(el, { value }) {
15040
+ updated(el, { value, modifiers: { number } }) {
14850
15041
  const pending = el._pendingValue;
14851
15042
  el._pendingValue = void 0;
14852
15043
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14853
- setSelected(el, value);
15044
+ setSelected(el, value, number);
14854
15045
  }
14855
15046
  }
14856
15047
  };
@@ -14866,7 +15057,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
14866
15057
  }
14867
15058
  return false;
14868
15059
  }
14869
- function setSelected(el, value) {
15060
+ function setSelected(el, value, number = false) {
14870
15061
  const isMultiple = el.multiple;
14871
15062
  const isArrayValue = isArray(value);
14872
15063
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -14887,7 +15078,7 @@ function setSelected(el, value) {
14887
15078
  option.selected = looseIndexOf(value, optionValue) > -1;
14888
15079
  }
14889
15080
  } else {
14890
- option.selected = value.has(optionValue);
15081
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
14891
15082
  }
14892
15083
  } else if (looseEqual(getValue(option), value)) {
14893
15084
  if (el.selectedIndex !== i) el.selectedIndex = i;