@vuact/runtime-dom 3.5.45-vuact.0 → 3.5.47-vuact.0

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.45
2
+ * @vue/runtime-dom v3.5.47
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -53,11 +53,18 @@ const isReservedProp = /* @__PURE__ */ makeMap(
53
53
  const isBuiltInDirective = /* @__PURE__ */ makeMap(
54
54
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
55
55
  );
56
+ const STRING_CACHE_MAX_SIZE = 1e4;
56
57
  const cacheStringFunction = (fn) => {
57
- const cache = /* @__PURE__ */ Object.create(null);
58
+ let cache = /* @__PURE__ */ Object.create(null);
59
+ let size = 0;
58
60
  return ((str) => {
59
61
  const hit = cache[str];
60
- return hit || (cache[str] = fn(str));
62
+ if (hit !== void 0) return hit;
63
+ if (++size > STRING_CACHE_MAX_SIZE) {
64
+ cache = /* @__PURE__ */ Object.create(null);
65
+ size = 1;
66
+ }
67
+ return cache[str] = fn(str);
61
68
  });
62
69
  };
63
70
  const camelizeRE = /-\w/g;
@@ -135,6 +142,7 @@ function parseStringStyle(cssText) {
135
142
  });
136
143
  return ret;
137
144
  }
145
+ const vendorPrefixRE = /^(?:webkit|moz|ms)-/;
138
146
  function stringifyStyle(styles) {
139
147
  if (!styles) return "";
140
148
  if (isString(styles)) return styles;
@@ -142,7 +150,10 @@ function stringifyStyle(styles) {
142
150
  for (const key in styles) {
143
151
  const value = styles[key];
144
152
  if (isString(value) || typeof value === "number") {
145
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
153
+ let normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
154
+ if (vendorPrefixRE.test(normalizedKey)) {
155
+ normalizedKey = `-${normalizedKey}`;
156
+ }
146
157
  ret += `${normalizedKey}:${value};`;
147
158
  }
148
159
  }
@@ -190,7 +201,7 @@ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
190
201
  const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
191
202
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
192
203
  const isBooleanAttr = /* @__PURE__ */ makeMap(
193
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
204
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected,webkitdirectory`
194
205
  );
195
206
  function includeBooleanAttr(value) {
196
207
  return !!value || value === "";
@@ -206,7 +217,9 @@ function isRenderableAttrValue(value) {
206
217
  return false;
207
218
  }
208
219
  const type = typeof value;
209
- return type === "string" || type === "number" || type === "boolean";
220
+ return type === "string" || type === "number" || type === "boolean" || // bigint stringifies the same way on both sides (`setAttribute`/property
221
+ // assignment on the client, `escapeHtml` during SSR)
222
+ type === "bigint";
210
223
  }
211
224
 
212
225
  const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
@@ -259,13 +272,13 @@ function looseCompareObjects(a, b, seen) {
259
272
  return false;
260
273
  }
261
274
  for (const key in a) {
262
- const aHasKey = a.hasOwnProperty(key);
263
- const bHasKey = b.hasOwnProperty(key);
275
+ const aHasKey = hasOwn(a, key);
276
+ const bHasKey = hasOwn(b, key);
264
277
  if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) {
265
278
  return false;
266
279
  }
267
280
  }
268
- return String(a) === String(b);
281
+ return toComparableString(a) === toComparableString(b);
269
282
  }
270
283
  function looseCompareNested(a, b, seen, compare) {
271
284
  if (!seen) {
@@ -312,6 +325,9 @@ function looseEqual(a, b, seen) {
312
325
  function looseIndexOf(arr, val) {
313
326
  return arr.findIndex((item) => looseEqual(item, val));
314
327
  }
328
+ function toComparableString(value) {
329
+ return Object.getPrototypeOf(value) === null && value[Symbol.toPrimitive] == null && typeof value.toString !== "function" && typeof value.valueOf !== "function" ? toTypeString(value) : String(value);
330
+ }
315
331
 
316
332
  const isRef$1 = (val) => {
317
333
  return !!(val && val["__v_isRef"] === true);
@@ -1118,16 +1134,17 @@ function shallowReadArray(arr) {
1118
1134
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
1119
1135
  return arr;
1120
1136
  }
1121
- function toWrapped(target, item) {
1137
+ const toReadonlyReactive = (item) => toReadonly(toReactive(item));
1138
+ function getWrapper(target) {
1122
1139
  if (isReadonly(target)) {
1123
- return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
1140
+ return isReactive(target) ? toReadonlyReactive : toReadonly;
1124
1141
  }
1125
- return toReactive(item);
1142
+ return toReactive;
1126
1143
  }
1127
1144
  const arrayInstrumentations = {
1128
1145
  __proto__: null,
1129
1146
  [Symbol.iterator]() {
1130
- return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
1147
+ return iterator(this, Symbol.iterator, getWrapper(this));
1131
1148
  },
1132
1149
  concat(...args) {
1133
1150
  return reactiveReadArray(this).concat(
@@ -1135,8 +1152,9 @@ const arrayInstrumentations = {
1135
1152
  );
1136
1153
  },
1137
1154
  entries() {
1155
+ const wrap = getWrapper(this);
1138
1156
  return iterator(this, "entries", (value) => {
1139
- value[1] = toWrapped(this, value[1]);
1157
+ value[1] = wrap(value[1]);
1140
1158
  return value;
1141
1159
  });
1142
1160
  },
@@ -1149,7 +1167,7 @@ const arrayInstrumentations = {
1149
1167
  "filter",
1150
1168
  fn,
1151
1169
  thisArg,
1152
- (v) => v.map((item) => toWrapped(this, item)),
1170
+ (v) => v.map(getWrapper(this)),
1153
1171
  arguments
1154
1172
  );
1155
1173
  },
@@ -1159,7 +1177,8 @@ const arrayInstrumentations = {
1159
1177
  "find",
1160
1178
  fn,
1161
1179
  thisArg,
1162
- (item) => toWrapped(this, item),
1180
+ // only the found item is wrapped, so read the flags only then
1181
+ (item) => getWrapper(this)(item),
1163
1182
  arguments
1164
1183
  );
1165
1184
  },
@@ -1172,7 +1191,8 @@ const arrayInstrumentations = {
1172
1191
  "findLast",
1173
1192
  fn,
1174
1193
  thisArg,
1175
- (item) => toWrapped(this, item),
1194
+ // only the found item is wrapped, so read the flags only then
1195
+ (item) => getWrapper(this)(item),
1176
1196
  arguments
1177
1197
  );
1178
1198
  },
@@ -1234,7 +1254,7 @@ const arrayInstrumentations = {
1234
1254
  return noTracking(this, "unshift", args);
1235
1255
  },
1236
1256
  values() {
1237
- return iterator(this, "values", (item) => toWrapped(this, item));
1257
+ return iterator(this, "values", getWrapper(this));
1238
1258
  }
1239
1259
  };
1240
1260
  function iterator(self, method, wrapValue) {
@@ -1286,8 +1306,9 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1286
1306
  let wrappedFn = fn;
1287
1307
  if (arr !== self) {
1288
1308
  if (needsWrap) {
1309
+ const wrap = getWrapper(self);
1289
1310
  wrappedFn = function(item, index) {
1290
- return fn.call(this, toWrapped(self, item), index, self);
1311
+ return fn.call(this, wrap(item), index, self);
1291
1312
  };
1292
1313
  } else if (fn.length > 2) {
1293
1314
  wrappedFn = function(item, index) {
@@ -1305,13 +1326,14 @@ function reduce(self, method, fn, args) {
1305
1326
  let wrapInitialAccumulator = false;
1306
1327
  if (arr !== self) {
1307
1328
  if (needsWrap) {
1329
+ const wrap = getWrapper(self);
1308
1330
  wrapInitialAccumulator = args.length === 0;
1309
1331
  wrappedFn = function(acc, item, index) {
1310
1332
  if (wrapInitialAccumulator) {
1311
1333
  wrapInitialAccumulator = false;
1312
- acc = toWrapped(self, acc);
1334
+ acc = wrap(acc);
1313
1335
  }
1314
- return fn.call(this, acc, toWrapped(self, item), index, self);
1336
+ return fn.call(this, acc, wrap(item), index, self);
1315
1337
  };
1316
1338
  } else if (fn.length > 3) {
1317
1339
  wrappedFn = function(acc, item, index) {
@@ -1320,7 +1342,7 @@ function reduce(self, method, fn, args) {
1320
1342
  }
1321
1343
  }
1322
1344
  const result = arr[method](wrappedFn, ...args);
1323
- return wrapInitialAccumulator ? toWrapped(self, result) : result;
1345
+ return wrapInitialAccumulator ? getWrapper(self)(result) : result;
1324
1346
  }
1325
1347
  function searchProxy(self, method, args) {
1326
1348
  const arr = toRaw(self);
@@ -2162,7 +2184,7 @@ function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher
2162
2184
  }
2163
2185
  }
2164
2186
  function watch$1(source, cb, options = EMPTY_OBJ) {
2165
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
2187
+ const { immediate, deep, once, scheduler, augmentJob, call, onStop } = options;
2166
2188
  const warnInvalidSource = (s) => {
2167
2189
  (options.onWarn || warn$2)(
2168
2190
  `Invalid watch source: `,
@@ -2231,7 +2253,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2231
2253
  if (cb && deep) {
2232
2254
  const baseGetter = getter;
2233
2255
  const depth = deep === true ? Infinity : deep;
2234
- getter = () => traverse(baseGetter(), depth);
2256
+ getter = () => traverse(baseGetter(), isMultiSource ? depth + 1 : depth);
2235
2257
  }
2236
2258
  const scope = getCurrentScope();
2237
2259
  const watchHandle = () => {
@@ -2240,9 +2262,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2240
2262
  remove(scope.effects, effect);
2241
2263
  }
2242
2264
  };
2265
+ let onceCallbackInvoked = false;
2243
2266
  if (once && cb) {
2244
2267
  const _cb = cb;
2245
2268
  cb = (...args) => {
2269
+ onceCallbackInvoked = true;
2246
2270
  try {
2247
2271
  return _cb(...args);
2248
2272
  } finally {
@@ -2252,7 +2276,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2252
2276
  }
2253
2277
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2254
2278
  const job = (immediateFirstRun) => {
2255
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2279
+ if (onceCallbackInvoked || !(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2256
2280
  return;
2257
2281
  }
2258
2282
  if (cb) {
@@ -2302,6 +2326,12 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2302
2326
  cleanupMap.delete(effect);
2303
2327
  }
2304
2328
  };
2329
+ if (onStop) {
2330
+ effect.onStop = () => {
2331
+ cleanup();
2332
+ onStop();
2333
+ };
2334
+ }
2305
2335
  {
2306
2336
  effect.onTrack = options.onTrack;
2307
2337
  effect.onTrigger = options.onTrigger;
@@ -2335,8 +2365,17 @@ function traverse(value, depth = Infinity, seen) {
2335
2365
  if (isRef(value)) {
2336
2366
  traverse(value.value, depth, seen);
2337
2367
  } else if (isArray(value)) {
2338
- for (let i = 0; i < value.length; i++) {
2339
- traverse(value[i], depth, seen);
2368
+ if (isReactive(value) && !isReadonly(value) && !isShallow(value)) {
2369
+ const raw = toRaw(value);
2370
+ track(raw, "iterate", ARRAY_ITERATE_KEY);
2371
+ for (let i = 0; i < raw.length; i++) {
2372
+ const item = raw[i];
2373
+ traverse(isRef(item) ? item : toReactive(item), depth, seen);
2374
+ }
2375
+ } else {
2376
+ for (let i = 0; i < value.length; i++) {
2377
+ traverse(value[i], depth, seen);
2378
+ }
2340
2379
  }
2341
2380
  } else if (isSet(value) || isMap(value)) {
2342
2381
  value.forEach((v) => {
@@ -2346,8 +2385,9 @@ function traverse(value, depth = Infinity, seen) {
2346
2385
  for (const key in value) {
2347
2386
  traverse(value[key], depth, seen);
2348
2387
  }
2349
- for (const key of Object.getOwnPropertySymbols(value)) {
2350
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
2388
+ const raw = toRaw(value);
2389
+ for (const key of Object.getOwnPropertySymbols(raw)) {
2390
+ if (Object.prototype.propertyIsEnumerable.call(raw, key)) {
2351
2391
  traverse(value[key], depth, seen);
2352
2392
  }
2353
2393
  }
@@ -3297,7 +3337,27 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
3297
3337
  return watchStopHandle;
3298
3338
  }
3299
3339
  }
3300
- const instance = currentInstance;
3340
+ let instance = currentInstance;
3341
+ let watcherJob;
3342
+ if (instance && getCurrentScope() !== instance.scope) {
3343
+ if (instance.scope.active) {
3344
+ const ownerScope = instance.scope.run(() => new EffectScope());
3345
+ ownerScope.run(
3346
+ () => onScopeDispose(
3347
+ () => (
3348
+ // deferred: the watchers this unmount stops still report to the owner
3349
+ Promise.resolve().then(() => {
3350
+ instance = null;
3351
+ if (watcherJob) watcherJob.i = null;
3352
+ })
3353
+ )
3354
+ )
3355
+ );
3356
+ baseWatchOptions.onStop = () => ownerScope.stop();
3357
+ } else {
3358
+ instance = null;
3359
+ }
3360
+ }
3301
3361
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3302
3362
  let isPre = false;
3303
3363
  if (flush === "post") {
@@ -3316,6 +3376,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
3316
3376
  };
3317
3377
  }
3318
3378
  baseWatchOptions.augmentJob = (job) => {
3379
+ watcherJob = job;
3319
3380
  if (cb) {
3320
3381
  job.flags |= 4;
3321
3382
  }
@@ -3669,8 +3730,8 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3669
3730
  const targetNode = target._lpa || target.firstChild;
3670
3731
  if (vnode.shapeFlag & 16) {
3671
3732
  if (disabled) {
3672
- hydrateDisabledTeleport(node, vnode);
3673
3733
  hydrateAnchor(target, targetNode);
3734
+ hydrateDisabledTeleport(node, vnode);
3674
3735
  if (!vnode.targetAnchor) {
3675
3736
  prepareAnchor(
3676
3737
  target,
@@ -3685,17 +3746,20 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3685
3746
  } else {
3686
3747
  vnode.anchor = nextSibling(node);
3687
3748
  hydrateAnchor(target, targetNode);
3688
- if (!vnode.targetAnchor) {
3749
+ const hasSSRAnchor = !!vnode.targetAnchor;
3750
+ if (!hasSSRAnchor) {
3689
3751
  prepareAnchor(target, vnode, createText, insert);
3690
3752
  }
3691
3753
  hydrateChildren(
3692
- targetNode && nextSibling(targetNode),
3754
+ // #15937 without SSR anchors, mount instead of hydrating unrelated nodes.
3755
+ hasSSRAnchor ? targetNode && nextSibling(targetNode) : null,
3693
3756
  vnode,
3694
3757
  target,
3695
3758
  parentComponent,
3696
3759
  parentSuspense,
3697
3760
  slotScopeIds,
3698
- optimized
3761
+ optimized,
3762
+ vnode.targetAnchor
3699
3763
  );
3700
3764
  }
3701
3765
  }
@@ -3713,19 +3777,11 @@ const Teleport = TeleportImpl;
3713
3777
  function updateCssVars(vnode, isDisabled) {
3714
3778
  const ctx = vnode.ctx;
3715
3779
  if (ctx && ctx.ut) {
3716
- let node, anchor;
3717
3780
  if (isDisabled) {
3718
- node = vnode.el;
3719
- anchor = vnode.anchor;
3781
+ ctx.ut(vnode.el, vnode.anchor);
3720
3782
  } else {
3721
- node = vnode.targetStart;
3722
- anchor = vnode.targetAnchor;
3783
+ ctx.ut(vnode.targetStart, vnode.targetAnchor);
3723
3784
  }
3724
- while (node && node !== anchor) {
3725
- if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3726
- node = node.nextSibling;
3727
- }
3728
- ctx.ut();
3729
3785
  }
3730
3786
  }
3731
3787
  function prepareAnchor(target, vnode, createText, insert, anchor = null) {
@@ -3855,11 +3911,13 @@ const BaseTransitionImpl = {
3855
3911
  earlyRemove();
3856
3912
  el[leaveCbKey] = void 0;
3857
3913
  delete enterHooks.delayedLeave;
3914
+ delete leavingHooks.delayLeave;
3858
3915
  oldInnerChild = void 0;
3859
3916
  };
3860
3917
  enterHooks.delayedLeave = () => {
3861
3918
  delayedLeave();
3862
3919
  delete enterHooks.delayedLeave;
3920
+ delete leavingHooks.delayLeave;
3863
3921
  oldInnerChild = void 0;
3864
3922
  };
3865
3923
  };
@@ -3971,7 +4029,10 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3971
4029
  callHook(hook, [el]);
3972
4030
  },
3973
4031
  enter(el) {
3974
- if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
4032
+ if (!isHmrUpdating && el[leaveCbKey]) {
4033
+ if (hooks.delayedLeave) hooks.delayedLeave();
4034
+ return;
4035
+ }
3975
4036
  let hook = onEnter;
3976
4037
  let afterHook = onAfterEnter;
3977
4038
  let cancelHook = onEnterCancelled;
@@ -4473,7 +4534,7 @@ function createHydrationFunctions(rendererInternals) {
4473
4534
  }
4474
4535
  return isFragmentStart ? nextSibling(nextNode) : nextNode;
4475
4536
  } else {
4476
- onMismatch();
4537
+ nextNode = onMismatch();
4477
4538
  }
4478
4539
  break;
4479
4540
  case Fragment:
@@ -4687,15 +4748,19 @@ Server rendered element contains more child nodes than client vdom.`
4687
4748
  }
4688
4749
  return el.nextSibling;
4689
4750
  };
4690
- const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4751
+ const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized, anchor) => {
4691
4752
  optimized = optimized || !!parentVNode.dynamicChildren;
4692
4753
  const children = parentVNode.children;
4693
4754
  const l = children.length;
4755
+ const isFragment = parentVNode.type === Fragment;
4694
4756
  let hasCheckedMismatch = false;
4695
4757
  for (let i = 0; i < l; i++) {
4696
4758
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4697
4759
  const isText = vnode.type === Text;
4698
- if (node) {
4760
+ if (isFragment && node && isComment(node) && node.data === "]") {
4761
+ anchor = node;
4762
+ }
4763
+ if (node && node !== anchor) {
4699
4764
  if (isText && !optimized) {
4700
4765
  if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4701
4766
  insert(
@@ -4717,7 +4782,7 @@ Server rendered element contains more child nodes than client vdom.`
4717
4782
  optimized
4718
4783
  );
4719
4784
  } else if (isText && !vnode.children) {
4720
- insert(vnode.el = createText(""), container);
4785
+ insert(vnode.el = createText(""), container, anchor);
4721
4786
  } else {
4722
4787
  if (!hasCheckedMismatch) {
4723
4788
  hasCheckedMismatch = true;
@@ -4735,7 +4800,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4735
4800
  null,
4736
4801
  vnode,
4737
4802
  container,
4738
- null,
4803
+ anchor,
4739
4804
  parentComponent,
4740
4805
  parentSuspense,
4741
4806
  getContainerType(container),
@@ -4978,7 +5043,7 @@ function isMapEqual(a, b) {
4978
5043
  }
4979
5044
  function resolveCssVars(instance, vnode, expectedMap) {
4980
5045
  const root = instance.subTree;
4981
- if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
5046
+ if (instance.getCssVars && isCssVarsRoot(root, vnode)) {
4982
5047
  const cssVars = instance.getCssVars();
4983
5048
  for (const key in cssVars) {
4984
5049
  const value = normalizeCssVarValue(cssVars[key]);
@@ -4989,6 +5054,9 @@ function resolveCssVars(instance, vnode, expectedMap) {
4989
5054
  resolveCssVars(instance.parent, instance.vnode, expectedMap);
4990
5055
  }
4991
5056
  }
5057
+ function isCssVarsRoot(root, vnode) {
5058
+ return root === vnode || !!(root && (root.type === Fragment || root.shapeFlag & 64) && root.children.some((child) => isCssVarsRoot(child, vnode)));
5059
+ }
4992
5060
  const allowMismatchAttr = "data-allow-mismatch";
4993
5061
  const MismatchTypeString = {
4994
5062
  [0 /* TEXT */]: "text",
@@ -5433,7 +5501,7 @@ const KeepAliveImpl = {
5433
5501
  const cached = cache.get(key);
5434
5502
  if (cached && (!current || !isSameVNodeType(cached, current))) {
5435
5503
  unmount(cached);
5436
- } else if (current) {
5504
+ } else if (current && (current.key == null ? current.type : current.key) === key) {
5437
5505
  resetShapeFlag(current);
5438
5506
  if (cached) resetShapeFlag(cached);
5439
5507
  }
@@ -9795,6 +9863,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9795
9863
  optimized
9796
9864
  );
9797
9865
  suspense.resolve(true);
9866
+ suspense.pendingId = suspenseId++;
9867
+ suspense.deps = 0;
9798
9868
  } else {
9799
9869
  patch(
9800
9870
  null,
@@ -9926,6 +9996,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9926
9996
  container: container2,
9927
9997
  isInFallback
9928
9998
  } = suspense;
9999
+ let pendingAncestor = suspense.parent;
10000
+ while (pendingAncestor && !pendingAncestor.pendingBranch) {
10001
+ pendingAncestor = pendingAncestor.parent;
10002
+ }
9929
10003
  let delayEnter = false;
9930
10004
  if (suspense.isHydrating) {
9931
10005
  suspense.isHydrating = false;
@@ -9942,7 +10016,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9942
10016
  anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
9943
10017
  0
9944
10018
  );
9945
- queuePostFlushCb(effects);
10019
+ let hidden = false;
10020
+ if (pendingAncestor) {
10021
+ let top = container2;
10022
+ let parent;
10023
+ while (parent = parentNode(top)) top = parent;
10024
+ hidden = top === pendingAncestor.hiddenContainer;
10025
+ }
10026
+ if (!hidden) {
10027
+ queuePostFlushCb(effects);
10028
+ }
9946
10029
  if (isInFallback && vnode2.ssFallback) {
9947
10030
  vnode2.ssFallback.el = null;
9948
10031
  }
@@ -9982,19 +10065,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9982
10065
  }
9983
10066
  }
9984
10067
  effects.length = kept;
9985
- let parent = suspense.parent;
9986
- let hasUnresolvedAncestor = false;
9987
- while (parent) {
9988
- if (parent.pendingBranch) {
9989
- for (let i = 0; i < effects.length; i++) {
9990
- parent.effects.push(effects[i]);
9991
- }
9992
- hasUnresolvedAncestor = true;
9993
- break;
10068
+ if (pendingAncestor) {
10069
+ for (let i = 0; i < effects.length; i++) {
10070
+ pendingAncestor.effects.push(effects[i]);
9994
10071
  }
9995
- parent = parent.parent;
9996
- }
9997
- if (!hasUnresolvedAncestor && !delayEnter) {
10072
+ } else if (!delayEnter) {
9998
10073
  queuePostFlushCb(effects);
9999
10074
  }
10000
10075
  suspense.effects = [];
@@ -10105,7 +10180,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
10105
10180
  }
10106
10181
  };
10107
10182
  instance.asyncDep.catch((err) => {
10108
- handleError(err, instance, 0, false, true);
10183
+ if (instance.scope.active) {
10184
+ handleError(err, instance, 0, false, true);
10185
+ }
10109
10186
  return () => null;
10110
10187
  }).then((asyncSetupResult) => {
10111
10188
  if (instance.isUnmounted || suspense.isUnmounted) {
@@ -11354,7 +11431,7 @@ function isMemoSame(cached, memo) {
11354
11431
  return true;
11355
11432
  }
11356
11433
 
11357
- const version = "3.5.45";
11434
+ const version = "3.5.47";
11358
11435
  const warn = warn$1 ;
11359
11436
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11360
11437
  const devtools = devtools$1 ;
@@ -11539,12 +11616,14 @@ function resolveTransitionProps(rawProps) {
11539
11616
  onAppearCancelled = onEnterCancelled
11540
11617
  } = baseProps;
11541
11618
  const finishEnter = (el, isAppear, done, isCancelled) => {
11619
+ el._enterResolve = void 0;
11542
11620
  el._enterCancelled = isCancelled;
11543
11621
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11544
11622
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11545
11623
  done && done();
11546
11624
  };
11547
11625
  const finishLeave = (el, done) => {
11626
+ el._leaveResolve = void 0;
11548
11627
  el._isLeaving = false;
11549
11628
  removeTransitionClass(el, leaveFromClass);
11550
11629
  removeTransitionClass(el, leaveToClass);
@@ -11554,10 +11633,18 @@ function resolveTransitionProps(rawProps) {
11554
11633
  const makeEnterHook = (isAppear) => {
11555
11634
  return (el, done) => {
11556
11635
  const hook = isAppear ? onAppear : onEnter;
11557
- const resolve = () => finishEnter(el, isAppear, done);
11636
+ const resolve = () => {
11637
+ if (el._enterResolve === resolve) {
11638
+ finishEnter(el, isAppear, done);
11639
+ }
11640
+ };
11641
+ el._enterResolve = resolve;
11558
11642
  callHook(hook, [el, resolve]);
11559
11643
  nextFrame(() => {
11560
11644
  removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11645
+ if (el._enterResolve !== resolve) {
11646
+ return;
11647
+ }
11561
11648
  addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11562
11649
  if (!hasExplicitCallback(hook)) {
11563
11650
  whenTransitionEnds(el, type, enterDuration, resolve);
@@ -11580,7 +11667,12 @@ function resolveTransitionProps(rawProps) {
11580
11667
  onAppear: makeEnterHook(true),
11581
11668
  onLeave(el, done) {
11582
11669
  el._isLeaving = true;
11583
- const resolve = () => finishLeave(el, done);
11670
+ const resolve = () => {
11671
+ if (el._leaveResolve === resolve) {
11672
+ finishLeave(el, done);
11673
+ }
11674
+ };
11675
+ el._leaveResolve = resolve;
11584
11676
  addTransitionClass(el, leaveFromClass);
11585
11677
  if (!el._enterCancelled) {
11586
11678
  forceReflow(el);
@@ -11590,7 +11682,7 @@ function resolveTransitionProps(rawProps) {
11590
11682
  forceReflow(el);
11591
11683
  }
11592
11684
  nextFrame(() => {
11593
- if (!el._isLeaving) {
11685
+ if (el._leaveResolve !== resolve) {
11594
11686
  return;
11595
11687
  }
11596
11688
  removeTransitionClass(el, leaveFromClass);
@@ -11809,11 +11901,24 @@ function useCssVars(getter) {
11809
11901
  warn(`useCssVars is called without current active component instance.`);
11810
11902
  return;
11811
11903
  }
11812
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11904
+ const updateTeleports = (vars = getter(instance.proxy)) => {
11813
11905
  Array.from(
11814
11906
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11815
11907
  ).forEach((node) => setVarsOnNode(node, vars));
11816
11908
  };
11909
+ const owner = {
11910
+ uid: String(instance.uid),
11911
+ update: updateTeleports
11912
+ };
11913
+ onScopeDispose(() => owner.update = void 0);
11914
+ instance.ut = (start, end) => {
11915
+ if (start) {
11916
+ start[TELEPORT_KEY] = [end, owner];
11917
+ observeTeleport(start);
11918
+ markTeleport(start);
11919
+ }
11920
+ updateTeleports();
11921
+ };
11817
11922
  {
11818
11923
  instance.getCssVars = () => getter(instance.proxy);
11819
11924
  }
@@ -11836,6 +11941,56 @@ function useCssVars(getter) {
11836
11941
  onUnmounted(() => ob.disconnect());
11837
11942
  });
11838
11943
  }
11944
+ const TELEPORT_KEY = /* @__PURE__ */ Symbol("TELEPORT_KEY" );
11945
+ function markTeleport(start, added) {
11946
+ const [end, owner] = start[TELEPORT_KEY];
11947
+ let update;
11948
+ if (owner.update) {
11949
+ for (let node = start; node && node !== end; node = node.nextSibling) {
11950
+ if (node.nodeType === 1 && (!added || (added === true || added.has(node)) && (node.getAttribute("data-v-owner") || owner.uid) === owner.uid)) {
11951
+ node.setAttribute("data-v-owner", owner.uid);
11952
+ update = owner.update;
11953
+ }
11954
+ }
11955
+ }
11956
+ return update;
11957
+ }
11958
+ function observeTeleport(start) {
11959
+ const container = start.parentNode;
11960
+ if (container) {
11961
+ let starts = container[TELEPORT_KEY];
11962
+ if (!starts) {
11963
+ starts = container[TELEPORT_KEY] = /* @__PURE__ */ new Set();
11964
+ new MutationObserver(onTeleportMutations).observe(container, {
11965
+ childList: true
11966
+ });
11967
+ }
11968
+ starts.add(start);
11969
+ }
11970
+ }
11971
+ function onTeleportMutations(records, ob) {
11972
+ const container = records[0].target;
11973
+ const starts = container[TELEPORT_KEY];
11974
+ const added = /* @__PURE__ */ new Set();
11975
+ for (const { addedNodes } of records) {
11976
+ addedNodes.forEach((node) => added.add(node));
11977
+ }
11978
+ const updates = /* @__PURE__ */ new Set();
11979
+ starts.forEach((start) => {
11980
+ if (start.parentNode !== container) {
11981
+ starts.delete(start);
11982
+ observeTeleport(start);
11983
+ updates.add(markTeleport(start, true));
11984
+ } else if (added.size) {
11985
+ updates.add(markTeleport(start, added));
11986
+ }
11987
+ });
11988
+ updates.forEach((update) => update && update());
11989
+ if (!starts.size) {
11990
+ ob.disconnect();
11991
+ container[TELEPORT_KEY] = void 0;
11992
+ }
11993
+ }
11839
11994
  function setVarsOnVNode(vnode, vars) {
11840
11995
  if (vnode.shapeFlag & 128) {
11841
11996
  const suspense = vnode.suspense;
@@ -13337,8 +13492,14 @@ const keyNames = {
13337
13492
  const withKeys = (fn, modifiers) => {
13338
13493
  const cache = fn._withKeys || (fn._withKeys = {});
13339
13494
  const cacheKey = modifiers.join(".");
13340
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
13495
+ const cached = cache[cacheKey];
13496
+ if (cached) return cached;
13497
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
13498
+ return cache[cacheKey] = ((event) => {
13341
13499
  if (!("key" in event)) {
13500
+ if (hasButtonModifier) {
13501
+ return fn(event);
13502
+ }
13342
13503
  return;
13343
13504
  }
13344
13505
  const eventKey = hyphenate(event.key);
@@ -13347,7 +13508,7 @@ const withKeys = (fn, modifiers) => {
13347
13508
  )) {
13348
13509
  return fn(event);
13349
13510
  }
13350
- }));
13511
+ });
13351
13512
  };
13352
13513
 
13353
13514
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);