@vue/runtime-dom 3.2.44 → 3.2.46

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.
@@ -96,7 +96,7 @@ function normalizeProps(props) {
96
96
  // These tag configs are shared between compiler-dom and runtime-dom, so they
97
97
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
98
98
  const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
99
- 'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
99
+ 'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
100
100
  'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
101
101
  'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
102
102
  'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
@@ -108,7 +108,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
108
108
  const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
109
109
  'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
110
110
  'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
111
- 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
111
+ 'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
112
112
  'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
113
113
  'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
114
114
  'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
@@ -259,12 +259,13 @@ const remove = (arr, el) => {
259
259
  arr.splice(i, 1);
260
260
  }
261
261
  };
262
- const hasOwnProperty = Object.prototype.hasOwnProperty;
263
- const hasOwn = (val, key) => hasOwnProperty.call(val, key);
262
+ const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
263
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
264
264
  const isArray = Array.isArray;
265
265
  const isMap = (val) => toTypeString(val) === '[object Map]';
266
266
  const isSet = (val) => toTypeString(val) === '[object Set]';
267
267
  const isDate = (val) => toTypeString(val) === '[object Date]';
268
+ const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
268
269
  const isFunction = (val) => typeof val === 'function';
269
270
  const isString = (val) => typeof val === 'string';
270
271
  const isSymbol = (val) => typeof val === 'symbol';
@@ -331,10 +332,22 @@ const def = (obj, key, value) => {
331
332
  value
332
333
  });
333
334
  };
334
- const toNumber = (val) => {
335
+ /**
336
+ * "123-foo" will be parsed to 123
337
+ * This is used for the .number modifier in v-model
338
+ */
339
+ const looseToNumber = (val) => {
335
340
  const n = parseFloat(val);
336
341
  return isNaN(n) ? val : n;
337
342
  };
343
+ /**
344
+ * Only conerces number-like strings
345
+ * "123-foo" will be returned as-is
346
+ */
347
+ const toNumber = (val) => {
348
+ const n = isString(val) ? Number(val) : NaN;
349
+ return isNaN(n) ? val : n;
350
+ };
338
351
  let _globalThis;
339
352
  const getGlobalThis = () => {
340
353
  return (_globalThis ||
@@ -350,7 +363,7 @@ const getGlobalThis = () => {
350
363
  : {}));
351
364
  };
352
365
 
353
- function warn(msg, ...args) {
366
+ function warn$1(msg, ...args) {
354
367
  console.warn(`[Vue warn] ${msg}`, ...args);
355
368
  }
356
369
 
@@ -361,7 +374,7 @@ class EffectScope {
361
374
  /**
362
375
  * @internal
363
376
  */
364
- this.active = true;
377
+ this._active = true;
365
378
  /**
366
379
  * @internal
367
380
  */
@@ -376,8 +389,11 @@ class EffectScope {
376
389
  (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
377
390
  }
378
391
  }
392
+ get active() {
393
+ return this._active;
394
+ }
379
395
  run(fn) {
380
- if (this.active) {
396
+ if (this._active) {
381
397
  const currentEffectScope = activeEffectScope;
382
398
  try {
383
399
  activeEffectScope = this;
@@ -388,7 +404,7 @@ class EffectScope {
388
404
  }
389
405
  }
390
406
  else {
391
- warn(`cannot run an inactive effect scope.`);
407
+ warn$1(`cannot run an inactive effect scope.`);
392
408
  }
393
409
  }
394
410
  /**
@@ -406,7 +422,7 @@ class EffectScope {
406
422
  activeEffectScope = this.parent;
407
423
  }
408
424
  stop(fromParent) {
409
- if (this.active) {
425
+ if (this._active) {
410
426
  let i, l;
411
427
  for (i = 0, l = this.effects.length; i < l; i++) {
412
428
  this.effects[i].stop();
@@ -429,7 +445,7 @@ class EffectScope {
429
445
  }
430
446
  }
431
447
  this.parent = undefined;
432
- this.active = false;
448
+ this._active = false;
433
449
  }
434
450
  }
435
451
  }
@@ -449,7 +465,7 @@ function onScopeDispose(fn) {
449
465
  activeEffectScope.cleanups.push(fn);
450
466
  }
451
467
  else {
452
- warn(`onScopeDispose() is called when there is no active effect scope` +
468
+ warn$1(`onScopeDispose() is called when there is no active effect scope` +
453
469
  ` to be associated with.`);
454
470
  }
455
471
  }
@@ -650,7 +666,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
650
666
  deps = [...depsMap.values()];
651
667
  }
652
668
  else if (key === 'length' && isArray(target)) {
653
- const newLength = toNumber(newValue);
669
+ const newLength = Number(newValue);
654
670
  depsMap.forEach((dep, key) => {
655
671
  if (key === 'length' || key >= newLength) {
656
672
  deps.push(dep);
@@ -739,6 +755,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
739
755
  }
740
756
  }
741
757
  }
758
+ function getDepFromReactive(object, key) {
759
+ var _a;
760
+ return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
761
+ }
742
762
 
743
763
  const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
744
764
  const builtInSymbols = new Set(
@@ -750,7 +770,7 @@ Object.getOwnPropertyNames(Symbol)
750
770
  .filter(key => key !== 'arguments' && key !== 'caller')
751
771
  .map(key => Symbol[key])
752
772
  .filter(isSymbol));
753
- const get = /*#__PURE__*/ createGetter();
773
+ const get$1 = /*#__PURE__*/ createGetter();
754
774
  const shallowGet = /*#__PURE__*/ createGetter(false, true);
755
775
  const readonlyGet = /*#__PURE__*/ createGetter(true);
756
776
  const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
@@ -784,6 +804,11 @@ function createArrayInstrumentations() {
784
804
  });
785
805
  return instrumentations;
786
806
  }
807
+ function hasOwnProperty(key) {
808
+ const obj = toRaw(this);
809
+ track(obj, "has" /* TrackOpTypes.HAS */, key);
810
+ return obj.hasOwnProperty(key);
811
+ }
787
812
  function createGetter(isReadonly = false, shallow = false) {
788
813
  return function get(target, key, receiver) {
789
814
  if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
@@ -807,8 +832,13 @@ function createGetter(isReadonly = false, shallow = false) {
807
832
  return target;
808
833
  }
809
834
  const targetIsArray = isArray(target);
810
- if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {
811
- return Reflect.get(arrayInstrumentations, key, receiver);
835
+ if (!isReadonly) {
836
+ if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
837
+ return Reflect.get(arrayInstrumentations, key, receiver);
838
+ }
839
+ if (key === 'hasOwnProperty') {
840
+ return hasOwnProperty;
841
+ }
812
842
  }
813
843
  const res = Reflect.get(target, key, receiver);
814
844
  if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
@@ -833,7 +863,7 @@ function createGetter(isReadonly = false, shallow = false) {
833
863
  return res;
834
864
  };
835
865
  }
836
- const set = /*#__PURE__*/ createSetter();
866
+ const set$1 = /*#__PURE__*/ createSetter();
837
867
  const shallowSet = /*#__PURE__*/ createSetter(true);
838
868
  function createSetter(shallow = false) {
839
869
  return function set(target, key, value, receiver) {
@@ -876,7 +906,7 @@ function deleteProperty(target, key) {
876
906
  }
877
907
  return result;
878
908
  }
879
- function has(target, key) {
909
+ function has$1(target, key) {
880
910
  const result = Reflect.has(target, key);
881
911
  if (!isSymbol(key) || !builtInSymbols.has(key)) {
882
912
  track(target, "has" /* TrackOpTypes.HAS */, key);
@@ -888,23 +918,23 @@ function ownKeys(target) {
888
918
  return Reflect.ownKeys(target);
889
919
  }
890
920
  const mutableHandlers = {
891
- get,
892
- set,
921
+ get: get$1,
922
+ set: set$1,
893
923
  deleteProperty,
894
- has,
924
+ has: has$1,
895
925
  ownKeys
896
926
  };
897
927
  const readonlyHandlers = {
898
928
  get: readonlyGet,
899
929
  set(target, key) {
900
930
  {
901
- warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
931
+ warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
902
932
  }
903
933
  return true;
904
934
  },
905
935
  deleteProperty(target, key) {
906
936
  {
907
- warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
937
+ warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
908
938
  }
909
939
  return true;
910
940
  }
@@ -922,7 +952,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
922
952
 
923
953
  const toShallow = (value) => value;
924
954
  const getProto = (v) => Reflect.getPrototypeOf(v);
925
- function get$1(target, key, isReadonly = false, isShallow = false) {
955
+ function get(target, key, isReadonly = false, isShallow = false) {
926
956
  // #1772: readonly(reactive(Map)) should return readonly + reactive version
927
957
  // of the value
928
958
  target = target["__v_raw" /* ReactiveFlags.RAW */];
@@ -948,7 +978,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
948
978
  target.get(key);
949
979
  }
950
980
  }
951
- function has$1(key, isReadonly = false) {
981
+ function has(key, isReadonly = false) {
952
982
  const target = this["__v_raw" /* ReactiveFlags.RAW */];
953
983
  const rawTarget = toRaw(target);
954
984
  const rawKey = toRaw(key);
@@ -978,7 +1008,7 @@ function add(value) {
978
1008
  }
979
1009
  return this;
980
1010
  }
981
- function set$1(key, value) {
1011
+ function set(key, value) {
982
1012
  value = toRaw(value);
983
1013
  const target = toRaw(this);
984
1014
  const { has, get } = getProto(target);
@@ -1091,41 +1121,41 @@ function createReadonlyMethod(type) {
1091
1121
  function createInstrumentations() {
1092
1122
  const mutableInstrumentations = {
1093
1123
  get(key) {
1094
- return get$1(this, key);
1124
+ return get(this, key);
1095
1125
  },
1096
1126
  get size() {
1097
1127
  return size(this);
1098
1128
  },
1099
- has: has$1,
1129
+ has,
1100
1130
  add,
1101
- set: set$1,
1131
+ set,
1102
1132
  delete: deleteEntry,
1103
1133
  clear,
1104
1134
  forEach: createForEach(false, false)
1105
1135
  };
1106
1136
  const shallowInstrumentations = {
1107
1137
  get(key) {
1108
- return get$1(this, key, false, true);
1138
+ return get(this, key, false, true);
1109
1139
  },
1110
1140
  get size() {
1111
1141
  return size(this);
1112
1142
  },
1113
- has: has$1,
1143
+ has,
1114
1144
  add,
1115
- set: set$1,
1145
+ set,
1116
1146
  delete: deleteEntry,
1117
1147
  clear,
1118
1148
  forEach: createForEach(false, true)
1119
1149
  };
1120
1150
  const readonlyInstrumentations = {
1121
1151
  get(key) {
1122
- return get$1(this, key, true);
1152
+ return get(this, key, true);
1123
1153
  },
1124
1154
  get size() {
1125
1155
  return size(this, true);
1126
1156
  },
1127
1157
  has(key) {
1128
- return has$1.call(this, key, true);
1158
+ return has.call(this, key, true);
1129
1159
  },
1130
1160
  add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1131
1161
  set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
@@ -1135,13 +1165,13 @@ function createInstrumentations() {
1135
1165
  };
1136
1166
  const shallowReadonlyInstrumentations = {
1137
1167
  get(key) {
1138
- return get$1(this, key, true, true);
1168
+ return get(this, key, true, true);
1139
1169
  },
1140
1170
  get size() {
1141
1171
  return size(this, true);
1142
1172
  },
1143
1173
  has(key) {
1144
- return has$1.call(this, key, true);
1174
+ return has.call(this, key, true);
1145
1175
  },
1146
1176
  add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1147
1177
  set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
@@ -1332,9 +1362,10 @@ function trackRefValue(ref) {
1332
1362
  }
1333
1363
  function triggerRefValue(ref, newVal) {
1334
1364
  ref = toRaw(ref);
1335
- if (ref.dep) {
1365
+ const dep = ref.dep;
1366
+ if (dep) {
1336
1367
  {
1337
- triggerEffects(ref.dep, {
1368
+ triggerEffects(dep, {
1338
1369
  target: ref,
1339
1370
  type: "set" /* TriggerOpTypes.SET */,
1340
1371
  key: 'value',
@@ -1446,6 +1477,9 @@ class ObjectRefImpl {
1446
1477
  set value(newVal) {
1447
1478
  this._object[this._key] = newVal;
1448
1479
  }
1480
+ get dep() {
1481
+ return getDepFromReactive(toRaw(this._object), this._key);
1482
+ }
1449
1483
  }
1450
1484
  function toRef(object, key, defaultValue) {
1451
1485
  const val = object[key];
@@ -1487,7 +1521,7 @@ class ComputedRefImpl {
1487
1521
  }
1488
1522
  }
1489
1523
  _a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
1490
- function computed(getterOrOptions, debugOptions, isSSR = false) {
1524
+ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1491
1525
  let getter;
1492
1526
  let setter;
1493
1527
  const onlyGetter = isFunction(getterOrOptions);
@@ -1517,7 +1551,7 @@ function pushWarningContext(vnode) {
1517
1551
  function popWarningContext() {
1518
1552
  stack.pop();
1519
1553
  }
1520
- function warn$1(msg, ...args) {
1554
+ function warn(msg, ...args) {
1521
1555
  // avoid props formatting or warn handler tracking deps that might be mutated
1522
1556
  // during patch, leading to infinite recursion.
1523
1557
  pauseTracking();
@@ -1623,6 +1657,20 @@ function formatProp(key, value, raw) {
1623
1657
  return raw ? value : [`${key}=`, value];
1624
1658
  }
1625
1659
  }
1660
+ /**
1661
+ * @internal
1662
+ */
1663
+ function assertNumber(val, type) {
1664
+ if (val === undefined) {
1665
+ return;
1666
+ }
1667
+ else if (typeof val !== 'number') {
1668
+ warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
1669
+ }
1670
+ else if (isNaN(val)) {
1671
+ warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
1672
+ }
1673
+ }
1626
1674
 
1627
1675
  const ErrorTypeStrings = {
1628
1676
  ["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
@@ -1716,7 +1764,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
1716
1764
  if (contextVNode) {
1717
1765
  pushWarningContext(contextVNode);
1718
1766
  }
1719
- warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1767
+ warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1720
1768
  if (contextVNode) {
1721
1769
  popWarningContext();
1722
1770
  }
@@ -1912,7 +1960,7 @@ function checkRecursiveUpdates(seen, fn) {
1912
1960
  if (count > RECURSION_LIMIT) {
1913
1961
  const instance = fn.ownerInstance;
1914
1962
  const componentName = instance && getComponentName(instance.type);
1915
- warn$1(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
1963
+ warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
1916
1964
  `This means you have a reactive effect that is mutating its own ` +
1917
1965
  `dependencies and thus recursively triggering itself. Possible sources ` +
1918
1966
  `include component template, render function, updated hook or ` +
@@ -2019,12 +2067,6 @@ function reload(id, newComp) {
2019
2067
  // components to be unmounted and re-mounted. Queue the update so that we
2020
2068
  // don't end up forcing the same parent to re-render multiple times.
2021
2069
  queueJob(instance.parent.update);
2022
- // instance is the inner component of an async custom element
2023
- // invoke to reset styles
2024
- if (instance.parent.type.__asyncLoader &&
2025
- instance.parent.ceReload) {
2026
- instance.parent.ceReload(newComp.styles);
2027
- }
2028
2070
  }
2029
2071
  else if (instance.appContext.reload) {
2030
2072
  // root instance mounted via createApp() has a reload method
@@ -2069,7 +2111,7 @@ function tryWrap(fn) {
2069
2111
  let devtools;
2070
2112
  let buffer = [];
2071
2113
  let devtoolsNotInstalled = false;
2072
- function emit(event, ...args) {
2114
+ function emit$1(event, ...args) {
2073
2115
  if (devtools) {
2074
2116
  devtools.emit(event, ...args);
2075
2117
  }
@@ -2116,7 +2158,7 @@ function setDevtoolsHook(hook, target) {
2116
2158
  }
2117
2159
  }
2118
2160
  function devtoolsInitApp(app, version) {
2119
- emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
2161
+ emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
2120
2162
  Fragment,
2121
2163
  Text,
2122
2164
  Comment,
@@ -2124,7 +2166,7 @@ function devtoolsInitApp(app, version) {
2124
2166
  });
2125
2167
  }
2126
2168
  function devtoolsUnmountApp(app) {
2127
- emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
2169
+ emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
2128
2170
  }
2129
2171
  const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
2130
2172
  const devtoolsComponentUpdated =
@@ -2140,21 +2182,21 @@ const devtoolsComponentRemoved = (component) => {
2140
2182
  };
2141
2183
  function createDevtoolsComponentHook(hook) {
2142
2184
  return (component) => {
2143
- emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
2185
+ emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
2144
2186
  };
2145
2187
  }
2146
2188
  const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
2147
2189
  const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
2148
2190
  function createDevtoolsPerformanceHook(hook) {
2149
2191
  return (component, type, time) => {
2150
- emit(hook, component.appContext.app, component.uid, component, type, time);
2192
+ emit$1(hook, component.appContext.app, component.uid, component, type, time);
2151
2193
  };
2152
2194
  }
2153
2195
  function devtoolsComponentEmit(component, event, params) {
2154
- emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
2196
+ emit$1("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
2155
2197
  }
2156
2198
 
2157
- function emit$1(instance, event, ...rawArgs) {
2199
+ function emit(instance, event, ...rawArgs) {
2158
2200
  if (instance.isUnmounted)
2159
2201
  return;
2160
2202
  const props = instance.vnode.props || EMPTY_OBJ;
@@ -2164,7 +2206,7 @@ function emit$1(instance, event, ...rawArgs) {
2164
2206
  if (!(event in emitsOptions) &&
2165
2207
  !(false )) {
2166
2208
  if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
2167
- warn$1(`Component emitted event "${event}" but it is neither declared in ` +
2209
+ warn(`Component emitted event "${event}" but it is neither declared in ` +
2168
2210
  `the emits option nor as an "${toHandlerKey(event)}" prop.`);
2169
2211
  }
2170
2212
  }
@@ -2173,7 +2215,7 @@ function emit$1(instance, event, ...rawArgs) {
2173
2215
  if (isFunction(validator)) {
2174
2216
  const isValid = validator(...rawArgs);
2175
2217
  if (!isValid) {
2176
- warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
2218
+ warn(`Invalid event arguments: event validation failed for event "${event}".`);
2177
2219
  }
2178
2220
  }
2179
2221
  }
@@ -2190,7 +2232,7 @@ function emit$1(instance, event, ...rawArgs) {
2190
2232
  args = rawArgs.map(a => (isString(a) ? a.trim() : a));
2191
2233
  }
2192
2234
  if (number) {
2193
- args = rawArgs.map(toNumber);
2235
+ args = rawArgs.map(looseToNumber);
2194
2236
  }
2195
2237
  }
2196
2238
  {
@@ -2199,7 +2241,7 @@ function emit$1(instance, event, ...rawArgs) {
2199
2241
  {
2200
2242
  const lowerCaseEvent = event.toLowerCase();
2201
2243
  if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
2202
- warn$1(`Event "${lowerCaseEvent}" is emitted in component ` +
2244
+ warn(`Event "${lowerCaseEvent}" is emitted in component ` +
2203
2245
  `${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
2204
2246
  `Note that HTML attributes are case-insensitive and you cannot use ` +
2205
2247
  `v-on to listen to camelCase events when using in-DOM templates. ` +
@@ -2474,13 +2516,13 @@ function renderComponentRoot(instance) {
2474
2516
  }
2475
2517
  }
2476
2518
  if (extraAttrs.length) {
2477
- warn$1(`Extraneous non-props attributes (` +
2519
+ warn(`Extraneous non-props attributes (` +
2478
2520
  `${extraAttrs.join(', ')}) ` +
2479
2521
  `were passed to component but could not be automatically inherited ` +
2480
2522
  `because component renders fragment or text root nodes.`);
2481
2523
  }
2482
2524
  if (eventAttrs.length) {
2483
- warn$1(`Extraneous non-emits event listeners (` +
2525
+ warn(`Extraneous non-emits event listeners (` +
2484
2526
  `${eventAttrs.join(', ')}) ` +
2485
2527
  `were passed to component but could not be automatically inherited ` +
2486
2528
  `because component renders fragment or text root nodes. ` +
@@ -2493,7 +2535,7 @@ function renderComponentRoot(instance) {
2493
2535
  // inherit directives
2494
2536
  if (vnode.dirs) {
2495
2537
  if (!isElementRoot(root)) {
2496
- warn$1(`Runtime directive used on component with non-element root node. ` +
2538
+ warn(`Runtime directive used on component with non-element root node. ` +
2497
2539
  `The directives will not function as intended.`);
2498
2540
  }
2499
2541
  // clone before mutating since the root may be a hoisted vnode
@@ -2503,7 +2545,7 @@ function renderComponentRoot(instance) {
2503
2545
  // inherit transition data
2504
2546
  if (vnode.transition) {
2505
2547
  if (!isElementRoot(root)) {
2506
- warn$1(`Component inside <Transition> renders non-element root node ` +
2548
+ warn(`Component inside <Transition> renders non-element root node ` +
2507
2549
  `that cannot be animated.`);
2508
2550
  }
2509
2551
  root.transition = vnode.transition;
@@ -2838,7 +2880,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2838
2880
  console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
2839
2881
  }
2840
2882
  const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
2841
- const timeout = toNumber(vnode.props && vnode.props.timeout);
2883
+ const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
2884
+ {
2885
+ assertNumber(timeout, `Suspense timeout`);
2886
+ }
2842
2887
  const suspense = {
2843
2888
  vnode,
2844
2889
  parent,
@@ -3066,7 +3111,7 @@ function normalizeSuspenseSlot(s) {
3066
3111
  if (isArray(s)) {
3067
3112
  const singleChild = filterSingleRoot(s);
3068
3113
  if (!singleChild) {
3069
- warn$1(`<Suspense> slots expect a single root node.`);
3114
+ warn(`<Suspense> slots expect a single root node.`);
3070
3115
  }
3071
3116
  s = singleChild;
3072
3117
  }
@@ -3104,7 +3149,7 @@ function setActiveBranch(suspense, branch) {
3104
3149
  function provide(key, value) {
3105
3150
  if (!currentInstance) {
3106
3151
  {
3107
- warn$1(`provide() can only be used inside setup().`);
3152
+ warn(`provide() can only be used inside setup().`);
3108
3153
  }
3109
3154
  }
3110
3155
  else {
@@ -3143,11 +3188,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3143
3188
  : defaultValue;
3144
3189
  }
3145
3190
  else {
3146
- warn$1(`injection "${String(key)}" not found.`);
3191
+ warn(`injection "${String(key)}" not found.`);
3147
3192
  }
3148
3193
  }
3149
3194
  else {
3150
- warn$1(`inject() can only be used inside setup() or functional components.`);
3195
+ warn(`inject() can only be used inside setup() or functional components.`);
3151
3196
  }
3152
3197
  }
3153
3198
 
@@ -3156,17 +3201,17 @@ function watchEffect(effect, options) {
3156
3201
  return doWatch(effect, null, options);
3157
3202
  }
3158
3203
  function watchPostEffect(effect, options) {
3159
- return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
3204
+ return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'post' }) );
3160
3205
  }
3161
3206
  function watchSyncEffect(effect, options) {
3162
- return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
3207
+ return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'sync' }) );
3163
3208
  }
3164
3209
  // initial value for watchers to trigger on undefined initial values
3165
3210
  const INITIAL_WATCHER_VALUE = {};
3166
3211
  // implementation
3167
3212
  function watch(source, cb, options) {
3168
3213
  if (!isFunction(cb)) {
3169
- warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
3214
+ warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
3170
3215
  `Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
3171
3216
  `supports \`watch(source, cb, options?) signature.`);
3172
3217
  }
@@ -3175,19 +3220,20 @@ function watch(source, cb, options) {
3175
3220
  function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
3176
3221
  if (!cb) {
3177
3222
  if (immediate !== undefined) {
3178
- warn$1(`watch() "immediate" option is only respected when using the ` +
3223
+ warn(`watch() "immediate" option is only respected when using the ` +
3179
3224
  `watch(source, callback, options?) signature.`);
3180
3225
  }
3181
3226
  if (deep !== undefined) {
3182
- warn$1(`watch() "deep" option is only respected when using the ` +
3227
+ warn(`watch() "deep" option is only respected when using the ` +
3183
3228
  `watch(source, callback, options?) signature.`);
3184
3229
  }
3185
3230
  }
3186
3231
  const warnInvalidSource = (s) => {
3187
- warn$1(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
3232
+ warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
3188
3233
  `a reactive object, or an array of these types.`);
3189
3234
  };
3190
- const instance = currentInstance;
3235
+ const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
3236
+ // const instance = currentInstance
3191
3237
  let getter;
3192
3238
  let forceTrigger = false;
3193
3239
  let isMultiSource = false;
@@ -3274,7 +3320,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3274
3320
  // pass undefined as the old value when it's changed for the first time
3275
3321
  oldValue === INITIAL_WATCHER_VALUE
3276
3322
  ? undefined
3277
- : (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
3323
+ : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
3278
3324
  ? []
3279
3325
  : oldValue,
3280
3326
  onCleanup
@@ -3454,7 +3500,7 @@ const BaseTransitionImpl = {
3454
3500
  if (c.type !== Comment) {
3455
3501
  if (hasFound) {
3456
3502
  // warn more than one non-comment child
3457
- warn$1('<transition> can only be used on a single element or component. ' +
3503
+ warn('<transition> can only be used on a single element or component. ' +
3458
3504
  'Use <transition-group> for lists.');
3459
3505
  break;
3460
3506
  }
@@ -3472,7 +3518,7 @@ const BaseTransitionImpl = {
3472
3518
  mode !== 'in-out' &&
3473
3519
  mode !== 'out-in' &&
3474
3520
  mode !== 'default') {
3475
- warn$1(`invalid <transition> mode: ${mode}`);
3521
+ warn(`invalid <transition> mode: ${mode}`);
3476
3522
  }
3477
3523
  if (state.isLeaving) {
3478
3524
  return emptyPlaceholder(child);
@@ -3780,7 +3826,7 @@ function defineAsyncComponent(source) {
3780
3826
  return pendingRequest;
3781
3827
  }
3782
3828
  if (!comp) {
3783
- warn$1(`Async component loader resolved to undefined. ` +
3829
+ warn(`Async component loader resolved to undefined. ` +
3784
3830
  `If you are using retry(), make sure to return its return value.`);
3785
3831
  }
3786
3832
  // interop module default
@@ -3873,10 +3919,15 @@ function defineAsyncComponent(source) {
3873
3919
  }
3874
3920
  });
3875
3921
  }
3876
- function createInnerComp(comp, { vnode: { ref, props, children, shapeFlag }, parent }) {
3922
+ function createInnerComp(comp, parent) {
3923
+ const { ref, props, children, ce } = parent.vnode;
3877
3924
  const vnode = createVNode(comp, props, children);
3878
3925
  // ensure inner component inherits the async wrapper's ref owner
3879
3926
  vnode.ref = ref;
3927
+ // pass the custom element callback on to the inner comp
3928
+ // and remove it from the async wrapper
3929
+ vnode.ce = ce;
3930
+ delete parent.vnode.ce;
3880
3931
  return vnode;
3881
3932
  }
3882
3933
 
@@ -3962,7 +4013,7 @@ const KeepAliveImpl = {
3962
4013
  }
3963
4014
  function pruneCacheEntry(key) {
3964
4015
  const cached = cache.get(key);
3965
- if (!current || cached.type !== current.type) {
4016
+ if (!current || !isSameVNodeType(cached, current)) {
3966
4017
  unmount(cached);
3967
4018
  }
3968
4019
  else if (current) {
@@ -3994,7 +4045,7 @@ const KeepAliveImpl = {
3994
4045
  cache.forEach(cached => {
3995
4046
  const { subTree, suspense } = instance;
3996
4047
  const vnode = getInnerChild(subTree);
3997
- if (cached.type === vnode.type) {
4048
+ if (cached.type === vnode.type && cached.key === vnode.key) {
3998
4049
  // current instance will be unmounted as part of keep-alive's unmount
3999
4050
  resetShapeFlag(vnode);
4000
4051
  // but invoke its deactivated hook here
@@ -4014,7 +4065,7 @@ const KeepAliveImpl = {
4014
4065
  const rawVNode = children[0];
4015
4066
  if (children.length > 1) {
4016
4067
  {
4017
- warn$1(`KeepAlive should contain exactly one component child.`);
4068
+ warn(`KeepAlive should contain exactly one component child.`);
4018
4069
  }
4019
4070
  current = null;
4020
4071
  return children;
@@ -4034,8 +4085,7 @@ const KeepAliveImpl = {
4034
4085
  : comp);
4035
4086
  const { include, exclude, max } = props;
4036
4087
  if ((include && (!name || !matches(include, name))) ||
4037
- (exclude && name && matches(exclude, name)) ||
4038
- (hmrDirtyComponents.has(comp))) {
4088
+ (exclude && name && matches(exclude, name))) {
4039
4089
  current = vnode;
4040
4090
  return rawVNode;
4041
4091
  }
@@ -4092,7 +4142,7 @@ function matches(pattern, name) {
4092
4142
  else if (isString(pattern)) {
4093
4143
  return pattern.split(',').includes(name);
4094
4144
  }
4095
- else if (pattern.test) {
4145
+ else if (isRegExp(pattern)) {
4096
4146
  return pattern.test(name);
4097
4147
  }
4098
4148
  /* istanbul ignore next */
@@ -4145,14 +4195,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4145
4195
  }, target);
4146
4196
  }
4147
4197
  function resetShapeFlag(vnode) {
4148
- let shapeFlag = vnode.shapeFlag;
4149
- if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
4150
- shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4151
- }
4152
- if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
4153
- shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4154
- }
4155
- vnode.shapeFlag = shapeFlag;
4198
+ // bitwise operations to remove keep alive flags
4199
+ vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4200
+ vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4156
4201
  }
4157
4202
  function getInnerChild(vnode) {
4158
4203
  return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
@@ -4191,7 +4236,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4191
4236
  }
4192
4237
  else {
4193
4238
  const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
4194
- warn$1(`${apiName} is called when there is no active component instance to be ` +
4239
+ warn(`${apiName} is called when there is no active component instance to be ` +
4195
4240
  `associated with. ` +
4196
4241
  `Lifecycle injection APIs can only be used during execution of setup().` +
4197
4242
  (` If you are using async setup(), make sure to register lifecycle ` +
@@ -4230,7 +4275,7 @@ return withDirectives(h(comp), [
4230
4275
  */
4231
4276
  function validateDirectiveName(name) {
4232
4277
  if (isBuiltInDirective(name)) {
4233
- warn$1('Do not use built-in directive ids as custom directive id: ' + name);
4278
+ warn('Do not use built-in directive ids as custom directive id: ' + name);
4234
4279
  }
4235
4280
  }
4236
4281
  /**
@@ -4239,7 +4284,7 @@ function validateDirectiveName(name) {
4239
4284
  function withDirectives(vnode, directives) {
4240
4285
  const internalInstance = currentRenderingInstance;
4241
4286
  if (internalInstance === null) {
4242
- warn$1(`withDirectives can only be used inside render functions.`);
4287
+ warn(`withDirectives can only be used inside render functions.`);
4243
4288
  return vnode;
4244
4289
  }
4245
4290
  const instance = getExposeProxy(internalInstance) ||
@@ -4350,12 +4395,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4350
4395
  ? `\nIf this is a native custom element, make sure to exclude it from ` +
4351
4396
  `component resolution via compilerOptions.isCustomElement.`
4352
4397
  : ``;
4353
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
4398
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
4354
4399
  }
4355
4400
  return res;
4356
4401
  }
4357
4402
  else {
4358
- warn$1(`resolve${capitalize(type.slice(0, -1))} ` +
4403
+ warn(`resolve${capitalize(type.slice(0, -1))} ` +
4359
4404
  `can only be used in render() or setup().`);
4360
4405
  }
4361
4406
  }
@@ -4380,7 +4425,7 @@ function renderList(source, renderItem, cache, index) {
4380
4425
  }
4381
4426
  else if (typeof source === 'number') {
4382
4427
  if (!Number.isInteger(source)) {
4383
- warn$1(`The v-for range expect an integer value but got ${source}.`);
4428
+ warn(`The v-for range expect an integer value but got ${source}.`);
4384
4429
  }
4385
4430
  ret = new Array(source);
4386
4431
  for (let i = 0; i < source; i++) {
@@ -4451,11 +4496,13 @@ fallback, noSlotted) {
4451
4496
  (currentRenderingInstance.parent &&
4452
4497
  isAsyncWrapper(currentRenderingInstance.parent) &&
4453
4498
  currentRenderingInstance.parent.isCE)) {
4454
- return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
4499
+ if (name !== 'default')
4500
+ props.name = name;
4501
+ return createVNode('slot', props, fallback && fallback());
4455
4502
  }
4456
4503
  let slot = slots[name];
4457
4504
  if (slot && slot.length > 1) {
4458
- warn$1(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
4505
+ warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
4459
4506
  `function. You need to mark this component with $dynamic-slots in the ` +
4460
4507
  `parent template.`);
4461
4508
  slot = () => [];
@@ -4508,7 +4555,7 @@ function ensureValidVNode(vnodes) {
4508
4555
  function toHandlers(obj, preserveCaseIfNecessary) {
4509
4556
  const ret = {};
4510
4557
  if (!isObject(obj)) {
4511
- warn$1(`v-on with no argument expects an object value.`);
4558
+ warn(`v-on with no argument expects an object value.`);
4512
4559
  return ret;
4513
4560
  }
4514
4561
  for (const key in obj) {
@@ -4551,6 +4598,7 @@ const publicPropertiesMap =
4551
4598
  $watch: i => (instanceWatch.bind(i) )
4552
4599
  });
4553
4600
  const isReservedPrefix = (key) => key === '_' || key === '$';
4601
+ const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
4554
4602
  const PublicInstanceProxyHandlers = {
4555
4603
  get({ _: instance }, key) {
4556
4604
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
@@ -4558,15 +4606,6 @@ const PublicInstanceProxyHandlers = {
4558
4606
  if (key === '__isVue') {
4559
4607
  return true;
4560
4608
  }
4561
- // prioritize <script setup> bindings during dev.
4562
- // this allows even properties that start with _ or $ to be used - so that
4563
- // it aligns with the production behavior where the render fn is inlined and
4564
- // indeed has access to all declared variables.
4565
- if (setupState !== EMPTY_OBJ &&
4566
- setupState.__isScriptSetup &&
4567
- hasOwn(setupState, key)) {
4568
- return setupState[key];
4569
- }
4570
4609
  // data / props / ctx
4571
4610
  // This getter gets called for every property access on the render context
4572
4611
  // during render and is a major hotspot. The most expensive part of this
@@ -4589,7 +4628,7 @@ const PublicInstanceProxyHandlers = {
4589
4628
  // default: just fallthrough
4590
4629
  }
4591
4630
  }
4592
- else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
4631
+ else if (hasSetupBinding(setupState, key)) {
4593
4632
  accessCache[key] = 1 /* AccessTypes.SETUP */;
4594
4633
  return setupState[key];
4595
4634
  }
@@ -4648,32 +4687,37 @@ const PublicInstanceProxyHandlers = {
4648
4687
  // to infinite warning loop
4649
4688
  key.indexOf('__v') !== 0)) {
4650
4689
  if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
4651
- warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
4690
+ warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
4652
4691
  `character ("$" or "_") and is not proxied on the render context.`);
4653
4692
  }
4654
4693
  else if (instance === currentRenderingInstance) {
4655
- warn$1(`Property ${JSON.stringify(key)} was accessed during render ` +
4694
+ warn(`Property ${JSON.stringify(key)} was accessed during render ` +
4656
4695
  `but is not defined on instance.`);
4657
4696
  }
4658
4697
  }
4659
4698
  },
4660
4699
  set({ _: instance }, key, value) {
4661
4700
  const { data, setupState, ctx } = instance;
4662
- if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
4701
+ if (hasSetupBinding(setupState, key)) {
4663
4702
  setupState[key] = value;
4664
4703
  return true;
4665
4704
  }
4705
+ else if (setupState.__isScriptSetup &&
4706
+ hasOwn(setupState, key)) {
4707
+ warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
4708
+ return false;
4709
+ }
4666
4710
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4667
4711
  data[key] = value;
4668
4712
  return true;
4669
4713
  }
4670
4714
  else if (hasOwn(instance.props, key)) {
4671
- warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
4715
+ warn(`Attempting to mutate prop "${key}". Props are readonly.`);
4672
4716
  return false;
4673
4717
  }
4674
4718
  if (key[0] === '$' && key.slice(1) in instance) {
4675
- warn$1(`Attempting to mutate public property "${key}". ` +
4676
- `Properties starting with $ are reserved and readonly.`, instance);
4719
+ warn(`Attempting to mutate public property "${key}". ` +
4720
+ `Properties starting with $ are reserved and readonly.`);
4677
4721
  return false;
4678
4722
  }
4679
4723
  else {
@@ -4694,7 +4738,7 @@ const PublicInstanceProxyHandlers = {
4694
4738
  let normalizedProps;
4695
4739
  return (!!accessCache[key] ||
4696
4740
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
4697
- (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
4741
+ hasSetupBinding(setupState, key) ||
4698
4742
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
4699
4743
  hasOwn(ctx, key) ||
4700
4744
  hasOwn(publicPropertiesMap, key) ||
@@ -4713,7 +4757,7 @@ const PublicInstanceProxyHandlers = {
4713
4757
  };
4714
4758
  {
4715
4759
  PublicInstanceProxyHandlers.ownKeys = (target) => {
4716
- warn$1(`Avoid app logic that relies on enumerating keys on a component instance. ` +
4760
+ warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
4717
4761
  `The keys will be empty in production mode to avoid performance overhead.`);
4718
4762
  return Reflect.ownKeys(target);
4719
4763
  };
@@ -4729,7 +4773,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
4729
4773
  has(_, key) {
4730
4774
  const has = key[0] !== '_' && !isGloballyWhitelisted(key);
4731
4775
  if (!has && PublicInstanceProxyHandlers.has(_, key)) {
4732
- warn$1(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
4776
+ warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
4733
4777
  }
4734
4778
  return has;
4735
4779
  }
@@ -4779,7 +4823,7 @@ function exposeSetupStateOnRenderContext(instance) {
4779
4823
  Object.keys(toRaw(setupState)).forEach(key => {
4780
4824
  if (!setupState.__isScriptSetup) {
4781
4825
  if (isReservedPrefix(key[0])) {
4782
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
4826
+ warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
4783
4827
  `which are reserved prefixes for Vue internals.`);
4784
4828
  return;
4785
4829
  }
@@ -4797,7 +4841,7 @@ function createDuplicateChecker() {
4797
4841
  const cache = Object.create(null);
4798
4842
  return (type, key) => {
4799
4843
  if (cache[key]) {
4800
- warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
4844
+ warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
4801
4845
  }
4802
4846
  else {
4803
4847
  cache[key] = type;
@@ -4814,7 +4858,7 @@ function applyOptions(instance) {
4814
4858
  // call beforeCreate first before accessing other options since
4815
4859
  // the hook may mutate resolved options (#2791)
4816
4860
  if (options.beforeCreate) {
4817
- callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
4861
+ callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
4818
4862
  }
4819
4863
  const {
4820
4864
  // state
@@ -4864,24 +4908,24 @@ function applyOptions(instance) {
4864
4908
  }
4865
4909
  }
4866
4910
  else {
4867
- warn$1(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
4911
+ warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
4868
4912
  `Did you reference the function correctly?`);
4869
4913
  }
4870
4914
  }
4871
4915
  }
4872
4916
  if (dataOptions) {
4873
4917
  if (!isFunction(dataOptions)) {
4874
- warn$1(`The data option must be a function. ` +
4918
+ warn(`The data option must be a function. ` +
4875
4919
  `Plain object usage is no longer supported.`);
4876
4920
  }
4877
4921
  const data = dataOptions.call(publicThis, publicThis);
4878
4922
  if (isPromise(data)) {
4879
- warn$1(`data() returned a Promise - note data() cannot be async; If you ` +
4923
+ warn(`data() returned a Promise - note data() cannot be async; If you ` +
4880
4924
  `intend to perform data fetching before component renders, use ` +
4881
4925
  `async setup() + <Suspense>.`);
4882
4926
  }
4883
4927
  if (!isObject(data)) {
4884
- warn$1(`data() should return an object.`);
4928
+ warn(`data() should return an object.`);
4885
4929
  }
4886
4930
  else {
4887
4931
  instance.data = reactive(data);
@@ -4912,15 +4956,15 @@ function applyOptions(instance) {
4912
4956
  ? opt.get.bind(publicThis, publicThis)
4913
4957
  : NOOP;
4914
4958
  if (get === NOOP) {
4915
- warn$1(`Computed property "${key}" has no getter.`);
4959
+ warn(`Computed property "${key}" has no getter.`);
4916
4960
  }
4917
4961
  const set = !isFunction(opt) && isFunction(opt.set)
4918
4962
  ? opt.set.bind(publicThis)
4919
4963
  : () => {
4920
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
4964
+ warn(`Write operation failed: computed property "${key}" is readonly.`);
4921
4965
  }
4922
4966
  ;
4923
- const c = computed$1({
4967
+ const c = computed({
4924
4968
  get,
4925
4969
  set
4926
4970
  });
@@ -4949,7 +4993,7 @@ function applyOptions(instance) {
4949
4993
  });
4950
4994
  }
4951
4995
  if (created) {
4952
- callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
4996
+ callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
4953
4997
  }
4954
4998
  function registerLifecycleHook(register, hook) {
4955
4999
  if (isArray(hook)) {
@@ -5029,7 +5073,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
5029
5073
  }
5030
5074
  else {
5031
5075
  {
5032
- warn$1(`injected property "${key}" is a ref and will be auto-unwrapped ` +
5076
+ warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
5033
5077
  `and no longer needs \`.value\` in the next minor release. ` +
5034
5078
  `To opt-in to the new behavior now, ` +
5035
5079
  `set \`app.config.unwrapInjectedRef = true\` (this config is ` +
@@ -5046,7 +5090,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
5046
5090
  }
5047
5091
  }
5048
5092
  }
5049
- function callHook(hook, instance, type) {
5093
+ function callHook$1(hook, instance, type) {
5050
5094
  callWithAsyncErrorHandling(isArray(hook)
5051
5095
  ? hook.map(h => h.bind(instance.proxy))
5052
5096
  : hook.bind(instance.proxy), instance, type);
@@ -5061,7 +5105,7 @@ function createWatcher(raw, ctx, publicThis, key) {
5061
5105
  watch(getter, handler);
5062
5106
  }
5063
5107
  else {
5064
- warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
5108
+ warn(`Invalid watch handler specified by key "${raw}"`, handler);
5065
5109
  }
5066
5110
  }
5067
5111
  else if (isFunction(raw)) {
@@ -5079,12 +5123,12 @@ function createWatcher(raw, ctx, publicThis, key) {
5079
5123
  watch(getter, handler, raw);
5080
5124
  }
5081
5125
  else {
5082
- warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5126
+ warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5083
5127
  }
5084
5128
  }
5085
5129
  }
5086
5130
  else {
5087
- warn$1(`Invalid watch option: "${key}"`, raw);
5131
+ warn(`Invalid watch option: "${key}"`, raw);
5088
5132
  }
5089
5133
  }
5090
5134
  /**
@@ -5128,7 +5172,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
5128
5172
  }
5129
5173
  for (const key in from) {
5130
5174
  if (asMixin && key === 'expose') {
5131
- warn$1(`"expose" option is ignored when declared in mixins or extends. ` +
5175
+ warn(`"expose" option is ignored when declared in mixins or extends. ` +
5132
5176
  `It should only be declared in the base component itself.`);
5133
5177
  }
5134
5178
  else {
@@ -5461,7 +5505,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5461
5505
  if (isArray(raw)) {
5462
5506
  for (let i = 0; i < raw.length; i++) {
5463
5507
  if (!isString(raw[i])) {
5464
- warn$1(`props must be strings when using array syntax.`, raw[i]);
5508
+ warn(`props must be strings when using array syntax.`, raw[i]);
5465
5509
  }
5466
5510
  const normalizedKey = camelize(raw[i]);
5467
5511
  if (validatePropName(normalizedKey)) {
@@ -5471,7 +5515,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5471
5515
  }
5472
5516
  else if (raw) {
5473
5517
  if (!isObject(raw)) {
5474
- warn$1(`invalid props options`, raw);
5518
+ warn(`invalid props options`, raw);
5475
5519
  }
5476
5520
  for (const key in raw) {
5477
5521
  const normalizedKey = camelize(key);
@@ -5504,15 +5548,15 @@ function validatePropName(key) {
5504
5548
  return true;
5505
5549
  }
5506
5550
  else {
5507
- warn$1(`Invalid prop name: "${key}" is a reserved property.`);
5551
+ warn(`Invalid prop name: "${key}" is a reserved property.`);
5508
5552
  }
5509
5553
  return false;
5510
5554
  }
5511
5555
  // use function string name to check type constructors
5512
5556
  // so that it works across vms / iframes.
5513
5557
  function getType(ctor) {
5514
- const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
5515
- return match ? match[1] : ctor === null ? 'null' : '';
5558
+ const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
5559
+ return match ? match[2] : ctor === null ? 'null' : '';
5516
5560
  }
5517
5561
  function isSameType(a, b) {
5518
5562
  return getType(a) === getType(b);
@@ -5546,7 +5590,7 @@ function validateProp(name, value, prop, isAbsent) {
5546
5590
  const { type, required, validator } = prop;
5547
5591
  // required!
5548
5592
  if (required && isAbsent) {
5549
- warn$1('Missing required prop: "' + name + '"');
5593
+ warn('Missing required prop: "' + name + '"');
5550
5594
  return;
5551
5595
  }
5552
5596
  // missing but optional
@@ -5565,13 +5609,13 @@ function validateProp(name, value, prop, isAbsent) {
5565
5609
  isValid = valid;
5566
5610
  }
5567
5611
  if (!isValid) {
5568
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
5612
+ warn(getInvalidTypeMessage(name, value, expectedTypes));
5569
5613
  return;
5570
5614
  }
5571
5615
  }
5572
5616
  // custom validator
5573
5617
  if (validator && !validator(value)) {
5574
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
5618
+ warn('Invalid prop: custom validator check failed for prop "' + name + '".');
5575
5619
  }
5576
5620
  }
5577
5621
  const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
@@ -5668,7 +5712,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
5668
5712
  }
5669
5713
  const normalized = withCtx((...args) => {
5670
5714
  if (true && currentInstance) {
5671
- warn$1(`Slot "${key}" invoked outside of the render function: ` +
5715
+ warn(`Slot "${key}" invoked outside of the render function: ` +
5672
5716
  `this will not track dependencies used in the slot. ` +
5673
5717
  `Invoke the slot function inside the render function instead.`);
5674
5718
  }
@@ -5688,7 +5732,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
5688
5732
  }
5689
5733
  else if (value != null) {
5690
5734
  {
5691
- warn$1(`Non-function value encountered for slot "${key}". ` +
5735
+ warn(`Non-function value encountered for slot "${key}". ` +
5692
5736
  `Prefer function slots for better performance.`);
5693
5737
  }
5694
5738
  const normalized = normalizeSlotValue(value);
@@ -5699,7 +5743,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
5699
5743
  const normalizeVNodeSlots = (instance, children) => {
5700
5744
  if (!isKeepAlive(instance.vnode) &&
5701
5745
  !(false )) {
5702
- warn$1(`Non-function value encountered for default slot. ` +
5746
+ warn(`Non-function value encountered for default slot. ` +
5703
5747
  `Prefer function slots for better performance.`);
5704
5748
  }
5705
5749
  const normalized = normalizeSlotValue(children);
@@ -5800,21 +5844,21 @@ function createAppContext() {
5800
5844
  emitsCache: new WeakMap()
5801
5845
  };
5802
5846
  }
5803
- let uid = 0;
5847
+ let uid$1 = 0;
5804
5848
  function createAppAPI(render, hydrate) {
5805
5849
  return function createApp(rootComponent, rootProps = null) {
5806
5850
  if (!isFunction(rootComponent)) {
5807
5851
  rootComponent = Object.assign({}, rootComponent);
5808
5852
  }
5809
5853
  if (rootProps != null && !isObject(rootProps)) {
5810
- warn$1(`root props passed to app.mount() must be an object.`);
5854
+ warn(`root props passed to app.mount() must be an object.`);
5811
5855
  rootProps = null;
5812
5856
  }
5813
5857
  const context = createAppContext();
5814
5858
  const installedPlugins = new Set();
5815
5859
  let isMounted = false;
5816
5860
  const app = (context.app = {
5817
- _uid: uid++,
5861
+ _uid: uid$1++,
5818
5862
  _component: rootComponent,
5819
5863
  _props: rootProps,
5820
5864
  _container: null,
@@ -5826,12 +5870,12 @@ function createAppAPI(render, hydrate) {
5826
5870
  },
5827
5871
  set config(v) {
5828
5872
  {
5829
- warn$1(`app.config cannot be replaced. Modify individual options instead.`);
5873
+ warn(`app.config cannot be replaced. Modify individual options instead.`);
5830
5874
  }
5831
5875
  },
5832
5876
  use(plugin, ...options) {
5833
5877
  if (installedPlugins.has(plugin)) {
5834
- warn$1(`Plugin has already been applied to target app.`);
5878
+ warn(`Plugin has already been applied to target app.`);
5835
5879
  }
5836
5880
  else if (plugin && isFunction(plugin.install)) {
5837
5881
  installedPlugins.add(plugin);
@@ -5842,7 +5886,7 @@ function createAppAPI(render, hydrate) {
5842
5886
  plugin(app, ...options);
5843
5887
  }
5844
5888
  else {
5845
- warn$1(`A plugin must either be a function or an object with an "install" ` +
5889
+ warn(`A plugin must either be a function or an object with an "install" ` +
5846
5890
  `function.`);
5847
5891
  }
5848
5892
  return app;
@@ -5853,7 +5897,7 @@ function createAppAPI(render, hydrate) {
5853
5897
  context.mixins.push(mixin);
5854
5898
  }
5855
5899
  else {
5856
- warn$1('Mixin has already been applied to target app' +
5900
+ warn('Mixin has already been applied to target app' +
5857
5901
  (mixin.name ? `: ${mixin.name}` : ''));
5858
5902
  }
5859
5903
  }
@@ -5867,7 +5911,7 @@ function createAppAPI(render, hydrate) {
5867
5911
  return context.components[name];
5868
5912
  }
5869
5913
  if (context.components[name]) {
5870
- warn$1(`Component "${name}" has already been registered in target app.`);
5914
+ warn(`Component "${name}" has already been registered in target app.`);
5871
5915
  }
5872
5916
  context.components[name] = component;
5873
5917
  return app;
@@ -5880,7 +5924,7 @@ function createAppAPI(render, hydrate) {
5880
5924
  return context.directives[name];
5881
5925
  }
5882
5926
  if (context.directives[name]) {
5883
- warn$1(`Directive "${name}" has already been registered in target app.`);
5927
+ warn(`Directive "${name}" has already been registered in target app.`);
5884
5928
  }
5885
5929
  context.directives[name] = directive;
5886
5930
  return app;
@@ -5889,7 +5933,7 @@ function createAppAPI(render, hydrate) {
5889
5933
  if (!isMounted) {
5890
5934
  // #5571
5891
5935
  if (rootContainer.__vue_app__) {
5892
- warn$1(`There is already an app instance mounted on the host container.\n` +
5936
+ warn(`There is already an app instance mounted on the host container.\n` +
5893
5937
  ` If you want to mount another app on the same host container,` +
5894
5938
  ` you need to unmount the previous app by calling \`app.unmount()\` first.`);
5895
5939
  }
@@ -5919,7 +5963,7 @@ function createAppAPI(render, hydrate) {
5919
5963
  return getExposeProxy(vnode.component) || vnode.component.proxy;
5920
5964
  }
5921
5965
  else {
5922
- warn$1(`App has already been mounted.\n` +
5966
+ warn(`App has already been mounted.\n` +
5923
5967
  `If you want to remount the same app, move your app creation logic ` +
5924
5968
  `into a factory function and create fresh app instances for each ` +
5925
5969
  `mount - e.g. \`const createMyApp = () => createApp(App)\``);
@@ -5935,12 +5979,12 @@ function createAppAPI(render, hydrate) {
5935
5979
  delete app._container.__vue_app__;
5936
5980
  }
5937
5981
  else {
5938
- warn$1(`Cannot unmount an app that is not mounted.`);
5982
+ warn(`Cannot unmount an app that is not mounted.`);
5939
5983
  }
5940
5984
  },
5941
5985
  provide(key, value) {
5942
5986
  if (key in context.provides) {
5943
- warn$1(`App already provides property with key "${String(key)}". ` +
5987
+ warn(`App already provides property with key "${String(key)}". ` +
5944
5988
  `It will be overwritten with the new value.`);
5945
5989
  }
5946
5990
  context.provides[key] = value;
@@ -5970,7 +6014,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5970
6014
  const value = isUnmount ? null : refValue;
5971
6015
  const { i: owner, r: ref } = rawRef;
5972
6016
  if (!owner) {
5973
- warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
6017
+ warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
5974
6018
  `A vnode with ref must be created inside the render function.`);
5975
6019
  return;
5976
6020
  }
@@ -6037,7 +6081,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6037
6081
  refs[rawRef.k] = value;
6038
6082
  }
6039
6083
  else {
6040
- warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
6084
+ warn('Invalid template ref type:', ref, `(${typeof ref})`);
6041
6085
  }
6042
6086
  };
6043
6087
  if (value) {
@@ -6049,7 +6093,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6049
6093
  }
6050
6094
  }
6051
6095
  else {
6052
- warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
6096
+ warn('Invalid template ref type:', ref, `(${typeof ref})`);
6053
6097
  }
6054
6098
  }
6055
6099
  }
@@ -6066,7 +6110,7 @@ function createHydrationFunctions(rendererInternals) {
6066
6110
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
6067
6111
  const hydrate = (vnode, container) => {
6068
6112
  if (!container.hasChildNodes()) {
6069
- warn$1(`Attempting to hydrate existing markup but container is empty. ` +
6113
+ warn(`Attempting to hydrate existing markup but container is empty. ` +
6070
6114
  `Performing full mount instead.`);
6071
6115
  patch(null, vnode, container);
6072
6116
  flushPostFlushCbs();
@@ -6109,7 +6153,7 @@ function createHydrationFunctions(rendererInternals) {
6109
6153
  else {
6110
6154
  if (node.data !== vnode.children) {
6111
6155
  hasMismatch = true;
6112
- warn$1(`Hydration text mismatch:` +
6156
+ warn(`Hydration text mismatch:` +
6113
6157
  `\n- Client: ${JSON.stringify(node.data)}` +
6114
6158
  `\n- Server: ${JSON.stringify(vnode.children)}`);
6115
6159
  node.data = vnode.children;
@@ -6224,7 +6268,7 @@ function createHydrationFunctions(rendererInternals) {
6224
6268
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
6225
6269
  }
6226
6270
  else {
6227
- warn$1('Invalid HostVNode type:', type, `(${typeof type})`);
6271
+ warn('Invalid HostVNode type:', type, `(${typeof type})`);
6228
6272
  }
6229
6273
  }
6230
6274
  if (ref != null) {
@@ -6285,7 +6329,7 @@ function createHydrationFunctions(rendererInternals) {
6285
6329
  while (next) {
6286
6330
  hasMismatch = true;
6287
6331
  if (!hasWarned) {
6288
- warn$1(`Hydration children mismatch in <${vnode.type}>: ` +
6332
+ warn(`Hydration children mismatch in <${vnode.type}>: ` +
6289
6333
  `server rendered element contains more child nodes than client vdom.`);
6290
6334
  hasWarned = true;
6291
6335
  }
@@ -6298,7 +6342,7 @@ function createHydrationFunctions(rendererInternals) {
6298
6342
  else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
6299
6343
  if (el.textContent !== vnode.children) {
6300
6344
  hasMismatch = true;
6301
- warn$1(`Hydration text content mismatch in <${vnode.type}>:\n` +
6345
+ warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
6302
6346
  `- Client: ${el.textContent}\n` +
6303
6347
  `- Server: ${vnode.children}`);
6304
6348
  el.textContent = vnode.children;
@@ -6325,7 +6369,7 @@ function createHydrationFunctions(rendererInternals) {
6325
6369
  else {
6326
6370
  hasMismatch = true;
6327
6371
  if (!hasWarned) {
6328
- warn$1(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
6372
+ warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
6329
6373
  `server rendered element contains fewer child nodes than client vdom.`);
6330
6374
  hasWarned = true;
6331
6375
  }
@@ -6358,7 +6402,7 @@ function createHydrationFunctions(rendererInternals) {
6358
6402
  };
6359
6403
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
6360
6404
  hasMismatch = true;
6361
- warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
6405
+ warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
6362
6406
  ? `(text)`
6363
6407
  : isComment(node) && node.data === '['
6364
6408
  ? `(start of fragment)`
@@ -6526,7 +6570,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6526
6570
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
6527
6571
  }
6528
6572
  else {
6529
- warn$1('Invalid VNode type:', type, `(${typeof type})`);
6573
+ warn('Invalid VNode type:', type, `(${typeof type})`);
6530
6574
  }
6531
6575
  }
6532
6576
  // set ref
@@ -6616,6 +6660,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6616
6660
  if (dirs) {
6617
6661
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
6618
6662
  }
6663
+ // scopeId
6664
+ setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
6619
6665
  // props
6620
6666
  if (props) {
6621
6667
  for (const key in props) {
@@ -6639,8 +6685,6 @@ function baseCreateRenderer(options, createHydrationFns) {
6639
6685
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
6640
6686
  }
6641
6687
  }
6642
- // scopeId
6643
- setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
6644
6688
  {
6645
6689
  Object.defineProperty(el, '__vnode', {
6646
6690
  value: vnode,
@@ -7350,7 +7394,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7350
7394
  : normalizeVNode(c2[i]));
7351
7395
  if (nextChild.key != null) {
7352
7396
  if (keyToNewIndexMap.has(nextChild.key)) {
7353
- warn$1(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
7397
+ warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
7354
7398
  }
7355
7399
  keyToNewIndexMap.set(nextChild.key, i);
7356
7400
  }
@@ -7733,6 +7777,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7733
7777
  if (!shallow)
7734
7778
  traverseStaticChildren(c1, c2);
7735
7779
  }
7780
+ // #6852 also inherit for text nodes
7781
+ if (c2.type === Text) {
7782
+ c2.el = c1.el;
7783
+ }
7736
7784
  // also inherit for comment nodes, but not placeholders (e.g. v-if which
7737
7785
  // would have received .el during block patch)
7738
7786
  if (c2.type === Comment && !c2.el) {
@@ -7791,14 +7839,14 @@ const resolveTarget = (props, select) => {
7791
7839
  const targetSelector = props && props.to;
7792
7840
  if (isString(targetSelector)) {
7793
7841
  if (!select) {
7794
- warn$1(`Current renderer does not support string target for Teleports. ` +
7842
+ warn(`Current renderer does not support string target for Teleports. ` +
7795
7843
  `(missing querySelector renderer option)`);
7796
7844
  return null;
7797
7845
  }
7798
7846
  else {
7799
7847
  const target = select(targetSelector);
7800
7848
  if (!target) {
7801
- warn$1(`Failed to locate Teleport target with selector "${targetSelector}". ` +
7849
+ warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
7802
7850
  `Note the target element must exist before the component is mounted - ` +
7803
7851
  `i.e. the target cannot be rendered by the component itself, and ` +
7804
7852
  `ideally should be outside of the entire Vue component tree.`);
@@ -7808,7 +7856,7 @@ const resolveTarget = (props, select) => {
7808
7856
  }
7809
7857
  else {
7810
7858
  if (!targetSelector && !isTeleportDisabled(props)) {
7811
- warn$1(`Invalid Teleport target: ${targetSelector}`);
7859
+ warn(`Invalid Teleport target: ${targetSelector}`);
7812
7860
  }
7813
7861
  return targetSelector;
7814
7862
  }
@@ -7841,7 +7889,7 @@ const TeleportImpl = {
7841
7889
  isSVG = isSVG || isTargetSVG(target);
7842
7890
  }
7843
7891
  else if (!disabled) {
7844
- warn$1('Invalid Teleport target on mount:', target, `(${typeof target})`);
7892
+ warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
7845
7893
  }
7846
7894
  const mount = (container, anchor) => {
7847
7895
  // Teleport *always* has Array children. This is enforced in both the
@@ -7893,7 +7941,7 @@ const TeleportImpl = {
7893
7941
  moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
7894
7942
  }
7895
7943
  else {
7896
- warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
7944
+ warn('Invalid Teleport target on update:', target, `(${typeof target})`);
7897
7945
  }
7898
7946
  }
7899
7947
  else if (wasDisabled) {
@@ -7903,6 +7951,7 @@ const TeleportImpl = {
7903
7951
  }
7904
7952
  }
7905
7953
  }
7954
+ updateCssVars(n2);
7906
7955
  },
7907
7956
  remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
7908
7957
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
@@ -7981,11 +8030,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
7981
8030
  hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
7982
8031
  }
7983
8032
  }
8033
+ updateCssVars(vnode);
7984
8034
  }
7985
8035
  return vnode.anchor && nextSibling(vnode.anchor);
7986
8036
  }
7987
8037
  // Force-casted public typing for h and TSX props inference
7988
8038
  const Teleport = TeleportImpl;
8039
+ function updateCssVars(vnode) {
8040
+ // presence of .ut method indicates owner component uses css vars.
8041
+ // code path here can assume browser environment.
8042
+ const ctx = vnode.ctx;
8043
+ if (ctx && ctx.ut) {
8044
+ let node = vnode.children[0].el;
8045
+ while (node !== vnode.targetAnchor) {
8046
+ if (node.nodeType === 1)
8047
+ node.setAttribute('data-v-owner', ctx.uid);
8048
+ node = node.nextSibling;
8049
+ }
8050
+ ctx.ut();
8051
+ }
8052
+ }
7989
8053
 
7990
8054
  const Fragment = Symbol('Fragment' );
7991
8055
  const Text = Symbol('Text' );
@@ -8080,6 +8144,10 @@ function isVNode(value) {
8080
8144
  function isSameVNodeType(n1, n2) {
8081
8145
  if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
8082
8146
  hmrDirtyComponents.has(n2.type)) {
8147
+ // #7042, ensure the vnode being unmounted during HMR
8148
+ // bitwise operations to remove keep alive flags
8149
+ n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
8150
+ n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
8083
8151
  // HMR only: if the component has been hot-updated, force a reload.
8084
8152
  return false;
8085
8153
  }
@@ -8135,7 +8203,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
8135
8203
  patchFlag,
8136
8204
  dynamicProps,
8137
8205
  dynamicChildren: null,
8138
- appContext: null
8206
+ appContext: null,
8207
+ ctx: currentRenderingInstance
8139
8208
  };
8140
8209
  if (needFullChildrenNormalization) {
8141
8210
  normalizeChildren(vnode, children);
@@ -8153,7 +8222,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
8153
8222
  }
8154
8223
  // validate key
8155
8224
  if (vnode.key !== vnode.key) {
8156
- warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8225
+ warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8157
8226
  }
8158
8227
  // track vnode for block tree
8159
8228
  if (isBlockTreeEnabled > 0 &&
@@ -8177,7 +8246,7 @@ const createVNode = (createVNodeWithArgsTransform );
8177
8246
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
8178
8247
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
8179
8248
  if (!type) {
8180
- warn$1(`Invalid vnode type when creating vnode: ${type}.`);
8249
+ warn(`Invalid vnode type when creating vnode: ${type}.`);
8181
8250
  }
8182
8251
  type = Comment;
8183
8252
  }
@@ -8235,7 +8304,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8235
8304
  : 0;
8236
8305
  if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
8237
8306
  type = toRaw(type);
8238
- warn$1(`Vue received a Component which was made a reactive object. This can ` +
8307
+ warn(`Vue received a Component which was made a reactive object. This can ` +
8239
8308
  `lead to unnecessary performance overhead, and should be avoided by ` +
8240
8309
  `marking the component with \`markRaw\` or using \`shallowRef\` ` +
8241
8310
  `instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
@@ -8302,7 +8371,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
8302
8371
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
8303
8372
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8304
8373
  el: vnode.el,
8305
- anchor: vnode.anchor
8374
+ anchor: vnode.anchor,
8375
+ ctx: vnode.ctx,
8376
+ ce: vnode.ce
8306
8377
  };
8307
8378
  return cloned;
8308
8379
  }
@@ -8469,13 +8540,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8469
8540
  }
8470
8541
 
8471
8542
  const emptyAppContext = createAppContext();
8472
- let uid$1 = 0;
8543
+ let uid = 0;
8473
8544
  function createComponentInstance(vnode, parent, suspense) {
8474
8545
  const type = vnode.type;
8475
8546
  // inherit parent app context - or - if root, adopt from root vnode
8476
8547
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
8477
8548
  const instance = {
8478
- uid: uid$1++,
8549
+ uid: uid++,
8479
8550
  vnode,
8480
8551
  type,
8481
8552
  parent,
@@ -8545,7 +8616,7 @@ function createComponentInstance(vnode, parent, suspense) {
8545
8616
  instance.ctx = createDevRenderContext(instance);
8546
8617
  }
8547
8618
  instance.root = parent ? parent.root : instance;
8548
- instance.emit = emit$1.bind(null, instance);
8619
+ instance.emit = emit.bind(null, instance);
8549
8620
  // apply custom element special handling
8550
8621
  if (vnode.ce) {
8551
8622
  vnode.ce(instance);
@@ -8566,7 +8637,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
8566
8637
  function validateComponentName(name, config) {
8567
8638
  const appIsNativeTag = config.isNativeTag || NO;
8568
8639
  if (isBuiltInTag(name) || appIsNativeTag(name)) {
8569
- warn$1('Do not use built-in or reserved HTML elements as component id: ' + name);
8640
+ warn('Do not use built-in or reserved HTML elements as component id: ' + name);
8570
8641
  }
8571
8642
  }
8572
8643
  function isStatefulComponent(instance) {
@@ -8605,7 +8676,7 @@ function setupStatefulComponent(instance, isSSR) {
8605
8676
  }
8606
8677
  }
8607
8678
  if (Component.compilerOptions && isRuntimeOnly()) {
8608
- warn$1(`"compilerOptions" is only supported when using a build of Vue that ` +
8679
+ warn(`"compilerOptions" is only supported when using a build of Vue that ` +
8609
8680
  `includes the runtime compiler. Since you are using a runtime-only ` +
8610
8681
  `build, the options should be passed via your build tool config instead.`);
8611
8682
  }
@@ -8646,7 +8717,7 @@ function setupStatefulComponent(instance, isSSR) {
8646
8717
  instance.asyncDep = setupResult;
8647
8718
  if (!instance.suspense) {
8648
8719
  const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
8649
- warn$1(`Component <${name}>: setup function returned a promise, but no ` +
8720
+ warn(`Component <${name}>: setup function returned a promise, but no ` +
8650
8721
  `<Suspense> boundary was found in the parent component tree. ` +
8651
8722
  `A component with async setup() must be nested in a <Suspense> ` +
8652
8723
  `in order to be rendered.`);
@@ -8670,7 +8741,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
8670
8741
  }
8671
8742
  else if (isObject(setupResult)) {
8672
8743
  if (isVNode(setupResult)) {
8673
- warn$1(`setup() should not return VNodes directly - ` +
8744
+ warn(`setup() should not return VNodes directly - ` +
8674
8745
  `return a render function instead.`);
8675
8746
  }
8676
8747
  // setup returned bindings.
@@ -8684,7 +8755,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
8684
8755
  }
8685
8756
  }
8686
8757
  else if (setupResult !== undefined) {
8687
- warn$1(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
8758
+ warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
8688
8759
  }
8689
8760
  finishComponentSetup(instance, isSSR);
8690
8761
  }
@@ -8751,13 +8822,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8751
8822
  if (!Component.render && instance.render === NOOP && !isSSR) {
8752
8823
  /* istanbul ignore if */
8753
8824
  if (!compile && Component.template) {
8754
- warn$1(`Component provided template option but ` +
8825
+ warn(`Component provided template option but ` +
8755
8826
  `runtime compilation is not supported in this build of Vue.` +
8756
8827
  (` Use "vue.esm-browser.js" instead.`
8757
8828
  ) /* should not happen */);
8758
8829
  }
8759
8830
  else {
8760
- warn$1(`Component is missing template or render function.`);
8831
+ warn(`Component is missing template or render function.`);
8761
8832
  }
8762
8833
  }
8763
8834
  }
@@ -8769,11 +8840,11 @@ function createAttrsProxy(instance) {
8769
8840
  return target[key];
8770
8841
  },
8771
8842
  set() {
8772
- warn$1(`setupContext.attrs is readonly.`);
8843
+ warn(`setupContext.attrs is readonly.`);
8773
8844
  return false;
8774
8845
  },
8775
8846
  deleteProperty() {
8776
- warn$1(`setupContext.attrs is readonly.`);
8847
+ warn(`setupContext.attrs is readonly.`);
8777
8848
  return false;
8778
8849
  }
8779
8850
  }
@@ -8781,8 +8852,24 @@ function createAttrsProxy(instance) {
8781
8852
  }
8782
8853
  function createSetupContext(instance) {
8783
8854
  const expose = exposed => {
8784
- if (instance.exposed) {
8785
- warn$1(`expose() should be called only once per setup().`);
8855
+ {
8856
+ if (instance.exposed) {
8857
+ warn(`expose() should be called only once per setup().`);
8858
+ }
8859
+ if (exposed != null) {
8860
+ let exposedType = typeof exposed;
8861
+ if (exposedType === 'object') {
8862
+ if (isArray(exposed)) {
8863
+ exposedType = 'array';
8864
+ }
8865
+ else if (isRef(exposed)) {
8866
+ exposedType = 'ref';
8867
+ }
8868
+ }
8869
+ if (exposedType !== 'object') {
8870
+ warn(`expose() should be passed a plain object, received ${exposedType}.`);
8871
+ }
8872
+ }
8786
8873
  }
8787
8874
  instance.exposed = exposed || {};
8788
8875
  };
@@ -8857,13 +8944,13 @@ function isClassComponent(value) {
8857
8944
  return isFunction(value) && '__vccOpts' in value;
8858
8945
  }
8859
8946
 
8860
- const computed$1 = ((getterOrOptions, debugOptions) => {
8947
+ const computed = ((getterOrOptions, debugOptions) => {
8861
8948
  // @ts-ignore
8862
- return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
8949
+ return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
8863
8950
  });
8864
8951
 
8865
8952
  // dev only
8866
- const warnRuntimeUsage = (method) => warn$1(`${method}() is a compiler-hint helper that is only usable inside ` +
8953
+ const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
8867
8954
  `<script setup> of a single file component. Its arguments should be ` +
8868
8955
  `compiled away and passing it at runtime has no effect.`);
8869
8956
  // implementation
@@ -8930,7 +9017,7 @@ function useAttrs() {
8930
9017
  function getContext() {
8931
9018
  const i = getCurrentInstance();
8932
9019
  if (!i) {
8933
- warn$1(`useContext() called without active instance.`);
9020
+ warn(`useContext() called without active instance.`);
8934
9021
  }
8935
9022
  return i.setupContext || (i.setupContext = createSetupContext(i));
8936
9023
  }
@@ -8957,7 +9044,7 @@ function mergeDefaults(raw, defaults) {
8957
9044
  props[key] = { default: defaults[key] };
8958
9045
  }
8959
9046
  else {
8960
- warn$1(`props default key "${key}" has no corresponding declaration.`);
9047
+ warn(`props default key "${key}" has no corresponding declaration.`);
8961
9048
  }
8962
9049
  }
8963
9050
  return props;
@@ -9000,7 +9087,7 @@ function createPropsRestProxy(props, excludedKeys) {
9000
9087
  function withAsyncContext(getAwaitable) {
9001
9088
  const ctx = getCurrentInstance();
9002
9089
  if (!ctx) {
9003
- warn$1(`withAsyncContext called without active current instance. ` +
9090
+ warn(`withAsyncContext called without active current instance. ` +
9004
9091
  `This is likely a bug.`);
9005
9092
  }
9006
9093
  let awaitable = getAwaitable();
@@ -9047,7 +9134,7 @@ const useSSRContext = () => {
9047
9134
  {
9048
9135
  const ctx = inject(ssrContextKey);
9049
9136
  if (!ctx) {
9050
- warn$1(`Server rendering context not provided. Make sure to only call ` +
9137
+ warn(`Server rendering context not provided. Make sure to only call ` +
9051
9138
  `useSSRContext() conditionally in the server build.`);
9052
9139
  }
9053
9140
  return ctx;
@@ -9271,7 +9358,7 @@ function isMemoSame(cached, memo) {
9271
9358
  }
9272
9359
 
9273
9360
  // Core API ------------------------------------------------------------------
9274
- const version = "3.2.44";
9361
+ const version = "3.2.46";
9275
9362
  /**
9276
9363
  * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
9277
9364
  * @internal
@@ -9388,9 +9475,6 @@ function patchStyle(el, prev, next) {
9388
9475
  const style = el.style;
9389
9476
  const isCssString = isString(next);
9390
9477
  if (next && !isCssString) {
9391
- for (const key in next) {
9392
- setStyle(style, key, next[key]);
9393
- }
9394
9478
  if (prev && !isString(prev)) {
9395
9479
  for (const key in prev) {
9396
9480
  if (next[key] == null) {
@@ -9398,6 +9482,9 @@ function patchStyle(el, prev, next) {
9398
9482
  }
9399
9483
  }
9400
9484
  }
9485
+ for (const key in next) {
9486
+ setStyle(style, key, next[key]);
9487
+ }
9401
9488
  }
9402
9489
  else {
9403
9490
  const currentDisplay = style.display;
@@ -9428,7 +9515,7 @@ function setStyle(style, name, val) {
9428
9515
  val = '';
9429
9516
  {
9430
9517
  if (semicolonRE.test(val)) {
9431
- warn$1(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
9518
+ warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
9432
9519
  }
9433
9520
  }
9434
9521
  if (name.startsWith('--')) {
@@ -9552,7 +9639,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
9552
9639
  catch (e) {
9553
9640
  // do not warn if value is auto-coerced from nullish values
9554
9641
  if (!needRemove) {
9555
- warn$1(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
9642
+ warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
9556
9643
  `value ${value} is invalid.`, e);
9557
9644
  }
9558
9645
  }
@@ -9756,16 +9843,25 @@ class VueElement extends BaseClass {
9756
9843
  }
9757
9844
  else {
9758
9845
  if (this.shadowRoot) {
9759
- warn$1(`Custom element has pre-rendered declarative shadow root but is not ` +
9846
+ warn(`Custom element has pre-rendered declarative shadow root but is not ` +
9760
9847
  `defined as hydratable. Use \`defineSSRCustomElement\`.`);
9761
9848
  }
9762
9849
  this.attachShadow({ mode: 'open' });
9850
+ if (!this._def.__asyncLoader) {
9851
+ // for sync component defs we can immediately resolve props
9852
+ this._resolveProps(this._def);
9853
+ }
9763
9854
  }
9764
9855
  }
9765
9856
  connectedCallback() {
9766
9857
  this._connected = true;
9767
9858
  if (!this._instance) {
9768
- this._resolveDef();
9859
+ if (this._resolved) {
9860
+ this._update();
9861
+ }
9862
+ else {
9863
+ this._resolveDef();
9864
+ }
9769
9865
  }
9770
9866
  }
9771
9867
  disconnectedCallback() {
@@ -9781,9 +9877,6 @@ class VueElement extends BaseClass {
9781
9877
  * resolve inner component definition (handle possible async component)
9782
9878
  */
9783
9879
  _resolveDef() {
9784
- if (this._resolved) {
9785
- return;
9786
- }
9787
9880
  this._resolved = true;
9788
9881
  // set initial attrs
9789
9882
  for (let i = 0; i < this.attributes.length; i++) {
@@ -9795,38 +9888,26 @@ class VueElement extends BaseClass {
9795
9888
  this._setAttr(m.attributeName);
9796
9889
  }
9797
9890
  }).observe(this, { attributes: true });
9798
- const resolve = (def) => {
9799
- const { props = {}, styles } = def;
9800
- const hasOptions = !isArray(props);
9801
- const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9891
+ const resolve = (def, isAsync = false) => {
9892
+ const { props, styles } = def;
9802
9893
  // cast Number-type props set before resolve
9803
9894
  let numberProps;
9804
- if (hasOptions) {
9805
- for (const key in this._props) {
9895
+ if (props && !isArray(props)) {
9896
+ for (const key in props) {
9806
9897
  const opt = props[key];
9807
9898
  if (opt === Number || (opt && opt.type === Number)) {
9808
- this._props[key] = toNumber(this._props[key]);
9809
- (numberProps || (numberProps = Object.create(null)))[key] = true;
9899
+ if (key in this._props) {
9900
+ this._props[key] = toNumber(this._props[key]);
9901
+ }
9902
+ (numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
9810
9903
  }
9811
9904
  }
9812
9905
  }
9813
9906
  this._numberProps = numberProps;
9814
- // check if there are props set pre-upgrade or connect
9815
- for (const key of Object.keys(this)) {
9816
- if (key[0] !== '_') {
9817
- this._setProp(key, this[key], true, false);
9818
- }
9819
- }
9820
- // defining getter/setters on prototype
9821
- for (const key of rawKeys.map(camelize)) {
9822
- Object.defineProperty(this, key, {
9823
- get() {
9824
- return this._getProp(key);
9825
- },
9826
- set(val) {
9827
- this._setProp(key, val);
9828
- }
9829
- });
9907
+ if (isAsync) {
9908
+ // defining getter/setters on prototype
9909
+ // for sync defs, this already happened in the constructor
9910
+ this._resolveProps(def);
9830
9911
  }
9831
9912
  // apply CSS
9832
9913
  this._applyStyles(styles);
@@ -9835,12 +9916,33 @@ class VueElement extends BaseClass {
9835
9916
  };
9836
9917
  const asyncDef = this._def.__asyncLoader;
9837
9918
  if (asyncDef) {
9838
- asyncDef().then(resolve);
9919
+ asyncDef().then(def => resolve(def, true));
9839
9920
  }
9840
9921
  else {
9841
9922
  resolve(this._def);
9842
9923
  }
9843
9924
  }
9925
+ _resolveProps(def) {
9926
+ const { props } = def;
9927
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9928
+ // check if there are props set pre-upgrade or connect
9929
+ for (const key of Object.keys(this)) {
9930
+ if (key[0] !== '_' && declaredPropKeys.includes(key)) {
9931
+ this._setProp(key, this[key], true, false);
9932
+ }
9933
+ }
9934
+ // defining getter/setters on prototype
9935
+ for (const key of declaredPropKeys.map(camelize)) {
9936
+ Object.defineProperty(this, key, {
9937
+ get() {
9938
+ return this._getProp(key);
9939
+ },
9940
+ set(val) {
9941
+ this._setProp(key, val);
9942
+ }
9943
+ });
9944
+ }
9945
+ }
9844
9946
  _setAttr(key) {
9845
9947
  let value = this.getAttribute(key);
9846
9948
  const camelKey = camelize(key);
@@ -9896,27 +9998,31 @@ class VueElement extends BaseClass {
9896
9998
  this._styles.length = 0;
9897
9999
  }
9898
10000
  this._applyStyles(newStyles);
9899
- // if this is an async component, ceReload is called from the inner
9900
- // component so no need to reload the async wrapper
9901
- if (!this._def.__asyncLoader) {
9902
- // reload
9903
- this._instance = null;
9904
- this._update();
9905
- }
10001
+ this._instance = null;
10002
+ this._update();
9906
10003
  };
9907
10004
  }
9908
- // intercept emit
9909
- instance.emit = (event, ...args) => {
10005
+ const dispatch = (event, args) => {
9910
10006
  this.dispatchEvent(new CustomEvent(event, {
9911
10007
  detail: args
9912
10008
  }));
9913
10009
  };
10010
+ // intercept emit
10011
+ instance.emit = (event, ...args) => {
10012
+ // dispatch both the raw and hyphenated versions of an event
10013
+ // to match Vue behavior
10014
+ dispatch(event, args);
10015
+ if (hyphenate(event) !== event) {
10016
+ dispatch(hyphenate(event), args);
10017
+ }
10018
+ };
9914
10019
  // locate nearest Vue custom element parent for provide/inject
9915
10020
  let parent = this;
9916
10021
  while ((parent =
9917
10022
  parent && (parent.parentNode || parent.host))) {
9918
10023
  if (parent instanceof VueElement) {
9919
10024
  instance.parent = parent._instance;
10025
+ instance.provides = parent._instance.provides;
9920
10026
  break;
9921
10027
  }
9922
10028
  }
@@ -9944,17 +10050,17 @@ function useCssModule(name = '$style') {
9944
10050
  {
9945
10051
  const instance = getCurrentInstance();
9946
10052
  if (!instance) {
9947
- warn$1(`useCssModule must be called inside setup()`);
10053
+ warn(`useCssModule must be called inside setup()`);
9948
10054
  return EMPTY_OBJ;
9949
10055
  }
9950
10056
  const modules = instance.type.__cssModules;
9951
10057
  if (!modules) {
9952
- warn$1(`Current instance does not have CSS modules injected.`);
10058
+ warn(`Current instance does not have CSS modules injected.`);
9953
10059
  return EMPTY_OBJ;
9954
10060
  }
9955
10061
  const mod = modules[name];
9956
10062
  if (!mod) {
9957
- warn$1(`Current instance does not have CSS module named "${name}".`);
10063
+ warn(`Current instance does not have CSS module named "${name}".`);
9958
10064
  return EMPTY_OBJ;
9959
10065
  }
9960
10066
  return mod;
@@ -9969,10 +10075,17 @@ function useCssVars(getter) {
9969
10075
  const instance = getCurrentInstance();
9970
10076
  /* istanbul ignore next */
9971
10077
  if (!instance) {
9972
- warn$1(`useCssVars is called without current active component instance.`);
10078
+ warn(`useCssVars is called without current active component instance.`);
9973
10079
  return;
9974
10080
  }
9975
- const setVars = () => setVarsOnVNode(instance.subTree, getter(instance.proxy));
10081
+ const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
10082
+ Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
10083
+ });
10084
+ const setVars = () => {
10085
+ const vars = getter(instance.proxy);
10086
+ setVarsOnVNode(instance.subTree, vars);
10087
+ updateTeleports(vars);
10088
+ };
9976
10089
  watchPostEffect(setVars);
9977
10090
  onMounted(() => {
9978
10091
  const ob = new MutationObserver(setVars);
@@ -10049,7 +10162,7 @@ const TransitionPropsValidators = (Transition.props =
10049
10162
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
10050
10163
  * with custom HOCs.
10051
10164
  */
10052
- const callHook$1 = (hook, args = []) => {
10165
+ const callHook = (hook, args = []) => {
10053
10166
  if (isArray(hook)) {
10054
10167
  hook.forEach(h => h(...args));
10055
10168
  }
@@ -10099,7 +10212,7 @@ function resolveTransitionProps(rawProps) {
10099
10212
  return (el, done) => {
10100
10213
  const hook = isAppear ? onAppear : onEnter;
10101
10214
  const resolve = () => finishEnter(el, isAppear, done);
10102
- callHook$1(hook, [el, resolve]);
10215
+ callHook(hook, [el, resolve]);
10103
10216
  nextFrame(() => {
10104
10217
  removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
10105
10218
  addTransitionClass(el, isAppear ? appearToClass : enterToClass);
@@ -10111,12 +10224,12 @@ function resolveTransitionProps(rawProps) {
10111
10224
  };
10112
10225
  return extend(baseProps, {
10113
10226
  onBeforeEnter(el) {
10114
- callHook$1(onBeforeEnter, [el]);
10227
+ callHook(onBeforeEnter, [el]);
10115
10228
  addTransitionClass(el, enterFromClass);
10116
10229
  addTransitionClass(el, enterActiveClass);
10117
10230
  },
10118
10231
  onBeforeAppear(el) {
10119
- callHook$1(onBeforeAppear, [el]);
10232
+ callHook(onBeforeAppear, [el]);
10120
10233
  addTransitionClass(el, appearFromClass);
10121
10234
  addTransitionClass(el, appearActiveClass);
10122
10235
  },
@@ -10140,19 +10253,19 @@ function resolveTransitionProps(rawProps) {
10140
10253
  whenTransitionEnds(el, type, leaveDuration, resolve);
10141
10254
  }
10142
10255
  });
10143
- callHook$1(onLeave, [el, resolve]);
10256
+ callHook(onLeave, [el, resolve]);
10144
10257
  },
10145
10258
  onEnterCancelled(el) {
10146
10259
  finishEnter(el, false);
10147
- callHook$1(onEnterCancelled, [el]);
10260
+ callHook(onEnterCancelled, [el]);
10148
10261
  },
10149
10262
  onAppearCancelled(el) {
10150
10263
  finishEnter(el, true);
10151
- callHook$1(onAppearCancelled, [el]);
10264
+ callHook(onAppearCancelled, [el]);
10152
10265
  },
10153
10266
  onLeaveCancelled(el) {
10154
10267
  finishLeave(el);
10155
- callHook$1(onLeaveCancelled, [el]);
10268
+ callHook(onLeaveCancelled, [el]);
10156
10269
  }
10157
10270
  });
10158
10271
  }
@@ -10170,18 +10283,10 @@ function normalizeDuration(duration) {
10170
10283
  }
10171
10284
  function NumberOf(val) {
10172
10285
  const res = toNumber(val);
10173
- validateDuration(res);
10174
- return res;
10175
- }
10176
- function validateDuration(val) {
10177
- if (typeof val !== 'number') {
10178
- warn$1(`<transition> explicit duration is not a valid number - ` +
10179
- `got ${JSON.stringify(val)}.`);
10180
- }
10181
- else if (isNaN(val)) {
10182
- warn$1(`<transition> explicit duration is NaN - ` +
10183
- 'the duration expression might be incorrect.');
10286
+ {
10287
+ assertNumber(res, '<transition> explicit duration');
10184
10288
  }
10289
+ return res;
10185
10290
  }
10186
10291
  function addTransitionClass(el, cls) {
10187
10292
  cls.split(/\s+/).forEach(c => c && el.classList.add(c));
@@ -10364,7 +10469,7 @@ const TransitionGroupImpl = {
10364
10469
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10365
10470
  }
10366
10471
  else {
10367
- warn$1(`<TransitionGroup> children must be keyed.`);
10472
+ warn(`<TransitionGroup> children must be keyed.`);
10368
10473
  }
10369
10474
  }
10370
10475
  if (prevChildren) {
@@ -10378,6 +10483,14 @@ const TransitionGroupImpl = {
10378
10483
  };
10379
10484
  }
10380
10485
  };
10486
+ /**
10487
+ * TransitionGroup does not support "mode" so we need to remove it from the
10488
+ * props declarations, but direct delete operation is considered a side effect
10489
+ * and will make the entire transition feature non-tree-shakeable, so we do it
10490
+ * in a function and mark the function's invocation as pure.
10491
+ */
10492
+ const removeMode = (props) => delete props.mode;
10493
+ /*#__PURE__*/ removeMode(TransitionGroupImpl.props);
10381
10494
  const TransitionGroup = TransitionGroupImpl;
10382
10495
  function callPendingCbs(c) {
10383
10496
  const el = c.el;
@@ -10453,7 +10566,7 @@ const vModelText = {
10453
10566
  domValue = domValue.trim();
10454
10567
  }
10455
10568
  if (castToNumber) {
10456
- domValue = toNumber(domValue);
10569
+ domValue = looseToNumber(domValue);
10457
10570
  }
10458
10571
  el._assign(domValue);
10459
10572
  });
@@ -10488,7 +10601,8 @@ const vModelText = {
10488
10601
  if (trim && el.value.trim() === value) {
10489
10602
  return;
10490
10603
  }
10491
- if ((number || el.type === 'number') && toNumber(el.value) === value) {
10604
+ if ((number || el.type === 'number') &&
10605
+ looseToNumber(el.value) === value) {
10492
10606
  return;
10493
10607
  }
10494
10608
  }
@@ -10577,7 +10691,7 @@ const vModelSelect = {
10577
10691
  addEventListener(el, 'change', () => {
10578
10692
  const selectedVal = Array.prototype.filter
10579
10693
  .call(el.options, (o) => o.selected)
10580
- .map((o) => number ? toNumber(getValue(o)) : getValue(o));
10694
+ .map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
10581
10695
  el._assign(el.multiple
10582
10696
  ? isSetModel
10583
10697
  ? new Set(selectedVal)
@@ -10601,7 +10715,7 @@ const vModelSelect = {
10601
10715
  function setSelected(el, value) {
10602
10716
  const isMultiple = el.multiple;
10603
10717
  if (isMultiple && !isArray(value) && !isSet(value)) {
10604
- warn$1(`<select multiple v-model> expects an Array or Set value for its binding, ` +
10718
+ warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
10605
10719
  `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
10606
10720
  return;
10607
10721
  }
@@ -10854,7 +10968,7 @@ function injectCompilerOptionsCheck(app) {
10854
10968
  return isCustomElement;
10855
10969
  },
10856
10970
  set() {
10857
- warn$1(`The \`isCustomElement\` config option is deprecated. Use ` +
10971
+ warn(`The \`isCustomElement\` config option is deprecated. Use ` +
10858
10972
  `\`compilerOptions.isCustomElement\` instead.`);
10859
10973
  }
10860
10974
  });
@@ -10868,11 +10982,11 @@ function injectCompilerOptionsCheck(app) {
10868
10982
  `- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
10869
10983
  Object.defineProperty(app.config, 'compilerOptions', {
10870
10984
  get() {
10871
- warn$1(msg);
10985
+ warn(msg);
10872
10986
  return compilerOptions;
10873
10987
  },
10874
10988
  set() {
10875
- warn$1(msg);
10989
+ warn(msg);
10876
10990
  }
10877
10991
  });
10878
10992
  }
@@ -10881,14 +10995,14 @@ function normalizeContainer(container) {
10881
10995
  if (isString(container)) {
10882
10996
  const res = document.querySelector(container);
10883
10997
  if (!res) {
10884
- warn$1(`Failed to mount app: mount target selector "${container}" returned null.`);
10998
+ warn(`Failed to mount app: mount target selector "${container}" returned null.`);
10885
10999
  }
10886
11000
  return res;
10887
11001
  }
10888
11002
  if (window.ShadowRoot &&
10889
11003
  container instanceof window.ShadowRoot &&
10890
11004
  container.mode === 'closed') {
10891
- warn$1(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
11005
+ warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
10892
11006
  }
10893
11007
  return container;
10894
11008
  }
@@ -10897,4 +11011,4 @@ function normalizeContainer(container) {
10897
11011
  */
10898
11012
  const initDirectivesForSSR = NOOP;
10899
11013
 
10900
- export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed$1 as computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
11014
+ export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };