vue 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.
@@ -169,7 +169,7 @@ function normalizeProps(props) {
169
169
  // These tag configs are shared between compiler-dom and runtime-dom, so they
170
170
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
171
171
  const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
172
- 'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
172
+ 'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
173
173
  'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
174
174
  'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
175
175
  'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
@@ -181,7 +181,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
181
181
  const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
182
182
  'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
183
183
  'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
184
- 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
184
+ 'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
185
185
  'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
186
186
  'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
187
187
  'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
@@ -338,12 +338,13 @@ const remove = (arr, el) => {
338
338
  arr.splice(i, 1);
339
339
  }
340
340
  };
341
- const hasOwnProperty = Object.prototype.hasOwnProperty;
342
- const hasOwn = (val, key) => hasOwnProperty.call(val, key);
341
+ const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
342
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
343
343
  const isArray = Array.isArray;
344
344
  const isMap = (val) => toTypeString(val) === '[object Map]';
345
345
  const isSet = (val) => toTypeString(val) === '[object Set]';
346
346
  const isDate = (val) => toTypeString(val) === '[object Date]';
347
+ const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
347
348
  const isFunction = (val) => typeof val === 'function';
348
349
  const isString = (val) => typeof val === 'string';
349
350
  const isSymbol = (val) => typeof val === 'symbol';
@@ -410,10 +411,22 @@ const def = (obj, key, value) => {
410
411
  value
411
412
  });
412
413
  };
413
- const toNumber = (val) => {
414
+ /**
415
+ * "123-foo" will be parsed to 123
416
+ * This is used for the .number modifier in v-model
417
+ */
418
+ const looseToNumber = (val) => {
414
419
  const n = parseFloat(val);
415
420
  return isNaN(n) ? val : n;
416
421
  };
422
+ /**
423
+ * Only conerces number-like strings
424
+ * "123-foo" will be returned as-is
425
+ */
426
+ const toNumber = (val) => {
427
+ const n = isString(val) ? Number(val) : NaN;
428
+ return isNaN(n) ? val : n;
429
+ };
417
430
  let _globalThis;
418
431
  const getGlobalThis = () => {
419
432
  return (_globalThis ||
@@ -429,7 +442,7 @@ const getGlobalThis = () => {
429
442
  : {}));
430
443
  };
431
444
 
432
- function warn(msg, ...args) {
445
+ function warn$1(msg, ...args) {
433
446
  console.warn(`[Vue warn] ${msg}`, ...args);
434
447
  }
435
448
 
@@ -440,7 +453,7 @@ class EffectScope {
440
453
  /**
441
454
  * @internal
442
455
  */
443
- this.active = true;
456
+ this._active = true;
444
457
  /**
445
458
  * @internal
446
459
  */
@@ -455,8 +468,11 @@ class EffectScope {
455
468
  (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
456
469
  }
457
470
  }
471
+ get active() {
472
+ return this._active;
473
+ }
458
474
  run(fn) {
459
- if (this.active) {
475
+ if (this._active) {
460
476
  const currentEffectScope = activeEffectScope;
461
477
  try {
462
478
  activeEffectScope = this;
@@ -467,7 +483,7 @@ class EffectScope {
467
483
  }
468
484
  }
469
485
  else {
470
- warn(`cannot run an inactive effect scope.`);
486
+ warn$1(`cannot run an inactive effect scope.`);
471
487
  }
472
488
  }
473
489
  /**
@@ -485,7 +501,7 @@ class EffectScope {
485
501
  activeEffectScope = this.parent;
486
502
  }
487
503
  stop(fromParent) {
488
- if (this.active) {
504
+ if (this._active) {
489
505
  let i, l;
490
506
  for (i = 0, l = this.effects.length; i < l; i++) {
491
507
  this.effects[i].stop();
@@ -508,7 +524,7 @@ class EffectScope {
508
524
  }
509
525
  }
510
526
  this.parent = undefined;
511
- this.active = false;
527
+ this._active = false;
512
528
  }
513
529
  }
514
530
  }
@@ -528,7 +544,7 @@ function onScopeDispose(fn) {
528
544
  activeEffectScope.cleanups.push(fn);
529
545
  }
530
546
  else {
531
- warn(`onScopeDispose() is called when there is no active effect scope` +
547
+ warn$1(`onScopeDispose() is called when there is no active effect scope` +
532
548
  ` to be associated with.`);
533
549
  }
534
550
  }
@@ -729,7 +745,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
729
745
  deps = [...depsMap.values()];
730
746
  }
731
747
  else if (key === 'length' && isArray(target)) {
732
- const newLength = toNumber(newValue);
748
+ const newLength = Number(newValue);
733
749
  depsMap.forEach((dep, key) => {
734
750
  if (key === 'length' || key >= newLength) {
735
751
  deps.push(dep);
@@ -818,6 +834,10 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
818
834
  }
819
835
  }
820
836
  }
837
+ function getDepFromReactive(object, key) {
838
+ var _a;
839
+ return (_a = targetMap.get(object)) === null || _a === void 0 ? void 0 : _a.get(key);
840
+ }
821
841
 
822
842
  const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
823
843
  const builtInSymbols = new Set(
@@ -829,7 +849,7 @@ Object.getOwnPropertyNames(Symbol)
829
849
  .filter(key => key !== 'arguments' && key !== 'caller')
830
850
  .map(key => Symbol[key])
831
851
  .filter(isSymbol));
832
- const get = /*#__PURE__*/ createGetter();
852
+ const get$1 = /*#__PURE__*/ createGetter();
833
853
  const shallowGet = /*#__PURE__*/ createGetter(false, true);
834
854
  const readonlyGet = /*#__PURE__*/ createGetter(true);
835
855
  const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
@@ -863,6 +883,11 @@ function createArrayInstrumentations() {
863
883
  });
864
884
  return instrumentations;
865
885
  }
886
+ function hasOwnProperty(key) {
887
+ const obj = toRaw(this);
888
+ track(obj, "has" /* TrackOpTypes.HAS */, key);
889
+ return obj.hasOwnProperty(key);
890
+ }
866
891
  function createGetter(isReadonly = false, shallow = false) {
867
892
  return function get(target, key, receiver) {
868
893
  if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
@@ -886,8 +911,13 @@ function createGetter(isReadonly = false, shallow = false) {
886
911
  return target;
887
912
  }
888
913
  const targetIsArray = isArray(target);
889
- if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {
890
- return Reflect.get(arrayInstrumentations, key, receiver);
914
+ if (!isReadonly) {
915
+ if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
916
+ return Reflect.get(arrayInstrumentations, key, receiver);
917
+ }
918
+ if (key === 'hasOwnProperty') {
919
+ return hasOwnProperty;
920
+ }
891
921
  }
892
922
  const res = Reflect.get(target, key, receiver);
893
923
  if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
@@ -912,7 +942,7 @@ function createGetter(isReadonly = false, shallow = false) {
912
942
  return res;
913
943
  };
914
944
  }
915
- const set = /*#__PURE__*/ createSetter();
945
+ const set$1 = /*#__PURE__*/ createSetter();
916
946
  const shallowSet = /*#__PURE__*/ createSetter(true);
917
947
  function createSetter(shallow = false) {
918
948
  return function set(target, key, value, receiver) {
@@ -955,7 +985,7 @@ function deleteProperty(target, key) {
955
985
  }
956
986
  return result;
957
987
  }
958
- function has(target, key) {
988
+ function has$1(target, key) {
959
989
  const result = Reflect.has(target, key);
960
990
  if (!isSymbol(key) || !builtInSymbols.has(key)) {
961
991
  track(target, "has" /* TrackOpTypes.HAS */, key);
@@ -967,23 +997,23 @@ function ownKeys(target) {
967
997
  return Reflect.ownKeys(target);
968
998
  }
969
999
  const mutableHandlers = {
970
- get,
971
- set,
1000
+ get: get$1,
1001
+ set: set$1,
972
1002
  deleteProperty,
973
- has,
1003
+ has: has$1,
974
1004
  ownKeys
975
1005
  };
976
1006
  const readonlyHandlers = {
977
1007
  get: readonlyGet,
978
1008
  set(target, key) {
979
1009
  {
980
- warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
1010
+ warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
981
1011
  }
982
1012
  return true;
983
1013
  },
984
1014
  deleteProperty(target, key) {
985
1015
  {
986
- warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
1016
+ warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
987
1017
  }
988
1018
  return true;
989
1019
  }
@@ -1001,7 +1031,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
1001
1031
 
1002
1032
  const toShallow = (value) => value;
1003
1033
  const getProto = (v) => Reflect.getPrototypeOf(v);
1004
- function get$1(target, key, isReadonly = false, isShallow = false) {
1034
+ function get(target, key, isReadonly = false, isShallow = false) {
1005
1035
  // #1772: readonly(reactive(Map)) should return readonly + reactive version
1006
1036
  // of the value
1007
1037
  target = target["__v_raw" /* ReactiveFlags.RAW */];
@@ -1027,7 +1057,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
1027
1057
  target.get(key);
1028
1058
  }
1029
1059
  }
1030
- function has$1(key, isReadonly = false) {
1060
+ function has(key, isReadonly = false) {
1031
1061
  const target = this["__v_raw" /* ReactiveFlags.RAW */];
1032
1062
  const rawTarget = toRaw(target);
1033
1063
  const rawKey = toRaw(key);
@@ -1057,7 +1087,7 @@ function add(value) {
1057
1087
  }
1058
1088
  return this;
1059
1089
  }
1060
- function set$1(key, value) {
1090
+ function set(key, value) {
1061
1091
  value = toRaw(value);
1062
1092
  const target = toRaw(this);
1063
1093
  const { has, get } = getProto(target);
@@ -1170,41 +1200,41 @@ function createReadonlyMethod(type) {
1170
1200
  function createInstrumentations() {
1171
1201
  const mutableInstrumentations = {
1172
1202
  get(key) {
1173
- return get$1(this, key);
1203
+ return get(this, key);
1174
1204
  },
1175
1205
  get size() {
1176
1206
  return size(this);
1177
1207
  },
1178
- has: has$1,
1208
+ has,
1179
1209
  add,
1180
- set: set$1,
1210
+ set,
1181
1211
  delete: deleteEntry,
1182
1212
  clear,
1183
1213
  forEach: createForEach(false, false)
1184
1214
  };
1185
1215
  const shallowInstrumentations = {
1186
1216
  get(key) {
1187
- return get$1(this, key, false, true);
1217
+ return get(this, key, false, true);
1188
1218
  },
1189
1219
  get size() {
1190
1220
  return size(this);
1191
1221
  },
1192
- has: has$1,
1222
+ has,
1193
1223
  add,
1194
- set: set$1,
1224
+ set,
1195
1225
  delete: deleteEntry,
1196
1226
  clear,
1197
1227
  forEach: createForEach(false, true)
1198
1228
  };
1199
1229
  const readonlyInstrumentations = {
1200
1230
  get(key) {
1201
- return get$1(this, key, true);
1231
+ return get(this, key, true);
1202
1232
  },
1203
1233
  get size() {
1204
1234
  return size(this, true);
1205
1235
  },
1206
1236
  has(key) {
1207
- return has$1.call(this, key, true);
1237
+ return has.call(this, key, true);
1208
1238
  },
1209
1239
  add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1210
1240
  set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
@@ -1214,13 +1244,13 @@ function createInstrumentations() {
1214
1244
  };
1215
1245
  const shallowReadonlyInstrumentations = {
1216
1246
  get(key) {
1217
- return get$1(this, key, true, true);
1247
+ return get(this, key, true, true);
1218
1248
  },
1219
1249
  get size() {
1220
1250
  return size(this, true);
1221
1251
  },
1222
1252
  has(key) {
1223
- return has$1.call(this, key, true);
1253
+ return has.call(this, key, true);
1224
1254
  },
1225
1255
  add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1226
1256
  set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
@@ -1411,9 +1441,10 @@ function trackRefValue(ref) {
1411
1441
  }
1412
1442
  function triggerRefValue(ref, newVal) {
1413
1443
  ref = toRaw(ref);
1414
- if (ref.dep) {
1444
+ const dep = ref.dep;
1445
+ if (dep) {
1415
1446
  {
1416
- triggerEffects(ref.dep, {
1447
+ triggerEffects(dep, {
1417
1448
  target: ref,
1418
1449
  type: "set" /* TriggerOpTypes.SET */,
1419
1450
  key: 'value',
@@ -1525,6 +1556,9 @@ class ObjectRefImpl {
1525
1556
  set value(newVal) {
1526
1557
  this._object[this._key] = newVal;
1527
1558
  }
1559
+ get dep() {
1560
+ return getDepFromReactive(toRaw(this._object), this._key);
1561
+ }
1528
1562
  }
1529
1563
  function toRef(object, key, defaultValue) {
1530
1564
  const val = object[key];
@@ -1566,7 +1600,7 @@ class ComputedRefImpl {
1566
1600
  }
1567
1601
  }
1568
1602
  _a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
1569
- function computed(getterOrOptions, debugOptions, isSSR = false) {
1603
+ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1570
1604
  let getter;
1571
1605
  let setter;
1572
1606
  const onlyGetter = isFunction(getterOrOptions);
@@ -1596,7 +1630,7 @@ function pushWarningContext(vnode) {
1596
1630
  function popWarningContext() {
1597
1631
  stack.pop();
1598
1632
  }
1599
- function warn$1(msg, ...args) {
1633
+ function warn(msg, ...args) {
1600
1634
  // avoid props formatting or warn handler tracking deps that might be mutated
1601
1635
  // during patch, leading to infinite recursion.
1602
1636
  pauseTracking();
@@ -1702,6 +1736,20 @@ function formatProp(key, value, raw) {
1702
1736
  return raw ? value : [`${key}=`, value];
1703
1737
  }
1704
1738
  }
1739
+ /**
1740
+ * @internal
1741
+ */
1742
+ function assertNumber(val, type) {
1743
+ if (val === undefined) {
1744
+ return;
1745
+ }
1746
+ else if (typeof val !== 'number') {
1747
+ warn(`${type} is not a valid number - ` + `got ${JSON.stringify(val)}.`);
1748
+ }
1749
+ else if (isNaN(val)) {
1750
+ warn(`${type} is NaN - ` + 'the duration expression might be incorrect.');
1751
+ }
1752
+ }
1705
1753
 
1706
1754
  const ErrorTypeStrings = {
1707
1755
  ["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
@@ -1795,7 +1843,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
1795
1843
  if (contextVNode) {
1796
1844
  pushWarningContext(contextVNode);
1797
1845
  }
1798
- warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1846
+ warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1799
1847
  if (contextVNode) {
1800
1848
  popWarningContext();
1801
1849
  }
@@ -1991,7 +2039,7 @@ function checkRecursiveUpdates(seen, fn) {
1991
2039
  if (count > RECURSION_LIMIT) {
1992
2040
  const instance = fn.ownerInstance;
1993
2041
  const componentName = instance && getComponentName(instance.type);
1994
- warn$1(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
2042
+ warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
1995
2043
  `This means you have a reactive effect that is mutating its own ` +
1996
2044
  `dependencies and thus recursively triggering itself. Possible sources ` +
1997
2045
  `include component template, render function, updated hook or ` +
@@ -2098,12 +2146,6 @@ function reload(id, newComp) {
2098
2146
  // components to be unmounted and re-mounted. Queue the update so that we
2099
2147
  // don't end up forcing the same parent to re-render multiple times.
2100
2148
  queueJob(instance.parent.update);
2101
- // instance is the inner component of an async custom element
2102
- // invoke to reset styles
2103
- if (instance.parent.type.__asyncLoader &&
2104
- instance.parent.ceReload) {
2105
- instance.parent.ceReload(newComp.styles);
2106
- }
2107
2149
  }
2108
2150
  else if (instance.appContext.reload) {
2109
2151
  // root instance mounted via createApp() has a reload method
@@ -2148,7 +2190,7 @@ function tryWrap(fn) {
2148
2190
  let devtools;
2149
2191
  let buffer = [];
2150
2192
  let devtoolsNotInstalled = false;
2151
- function emit(event, ...args) {
2193
+ function emit$1(event, ...args) {
2152
2194
  if (devtools) {
2153
2195
  devtools.emit(event, ...args);
2154
2196
  }
@@ -2195,7 +2237,7 @@ function setDevtoolsHook(hook, target) {
2195
2237
  }
2196
2238
  }
2197
2239
  function devtoolsInitApp(app, version) {
2198
- emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
2240
+ emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
2199
2241
  Fragment,
2200
2242
  Text,
2201
2243
  Comment,
@@ -2203,7 +2245,7 @@ function devtoolsInitApp(app, version) {
2203
2245
  });
2204
2246
  }
2205
2247
  function devtoolsUnmountApp(app) {
2206
- emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
2248
+ emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
2207
2249
  }
2208
2250
  const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
2209
2251
  const devtoolsComponentUpdated =
@@ -2219,21 +2261,21 @@ const devtoolsComponentRemoved = (component) => {
2219
2261
  };
2220
2262
  function createDevtoolsComponentHook(hook) {
2221
2263
  return (component) => {
2222
- emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
2264
+ emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
2223
2265
  };
2224
2266
  }
2225
2267
  const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
2226
2268
  const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
2227
2269
  function createDevtoolsPerformanceHook(hook) {
2228
2270
  return (component, type, time) => {
2229
- emit(hook, component.appContext.app, component.uid, component, type, time);
2271
+ emit$1(hook, component.appContext.app, component.uid, component, type, time);
2230
2272
  };
2231
2273
  }
2232
2274
  function devtoolsComponentEmit(component, event, params) {
2233
- emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
2275
+ emit$1("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
2234
2276
  }
2235
2277
 
2236
- function emit$1(instance, event, ...rawArgs) {
2278
+ function emit(instance, event, ...rawArgs) {
2237
2279
  if (instance.isUnmounted)
2238
2280
  return;
2239
2281
  const props = instance.vnode.props || EMPTY_OBJ;
@@ -2243,7 +2285,7 @@ function emit$1(instance, event, ...rawArgs) {
2243
2285
  if (!(event in emitsOptions) &&
2244
2286
  !(false )) {
2245
2287
  if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
2246
- warn$1(`Component emitted event "${event}" but it is neither declared in ` +
2288
+ warn(`Component emitted event "${event}" but it is neither declared in ` +
2247
2289
  `the emits option nor as an "${toHandlerKey(event)}" prop.`);
2248
2290
  }
2249
2291
  }
@@ -2252,7 +2294,7 @@ function emit$1(instance, event, ...rawArgs) {
2252
2294
  if (isFunction(validator)) {
2253
2295
  const isValid = validator(...rawArgs);
2254
2296
  if (!isValid) {
2255
- warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
2297
+ warn(`Invalid event arguments: event validation failed for event "${event}".`);
2256
2298
  }
2257
2299
  }
2258
2300
  }
@@ -2269,7 +2311,7 @@ function emit$1(instance, event, ...rawArgs) {
2269
2311
  args = rawArgs.map(a => (isString(a) ? a.trim() : a));
2270
2312
  }
2271
2313
  if (number) {
2272
- args = rawArgs.map(toNumber);
2314
+ args = rawArgs.map(looseToNumber);
2273
2315
  }
2274
2316
  }
2275
2317
  {
@@ -2278,7 +2320,7 @@ function emit$1(instance, event, ...rawArgs) {
2278
2320
  {
2279
2321
  const lowerCaseEvent = event.toLowerCase();
2280
2322
  if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
2281
- warn$1(`Event "${lowerCaseEvent}" is emitted in component ` +
2323
+ warn(`Event "${lowerCaseEvent}" is emitted in component ` +
2282
2324
  `${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
2283
2325
  `Note that HTML attributes are case-insensitive and you cannot use ` +
2284
2326
  `v-on to listen to camelCase events when using in-DOM templates. ` +
@@ -2553,13 +2595,13 @@ function renderComponentRoot(instance) {
2553
2595
  }
2554
2596
  }
2555
2597
  if (extraAttrs.length) {
2556
- warn$1(`Extraneous non-props attributes (` +
2598
+ warn(`Extraneous non-props attributes (` +
2557
2599
  `${extraAttrs.join(', ')}) ` +
2558
2600
  `were passed to component but could not be automatically inherited ` +
2559
2601
  `because component renders fragment or text root nodes.`);
2560
2602
  }
2561
2603
  if (eventAttrs.length) {
2562
- warn$1(`Extraneous non-emits event listeners (` +
2604
+ warn(`Extraneous non-emits event listeners (` +
2563
2605
  `${eventAttrs.join(', ')}) ` +
2564
2606
  `were passed to component but could not be automatically inherited ` +
2565
2607
  `because component renders fragment or text root nodes. ` +
@@ -2572,7 +2614,7 @@ function renderComponentRoot(instance) {
2572
2614
  // inherit directives
2573
2615
  if (vnode.dirs) {
2574
2616
  if (!isElementRoot(root)) {
2575
- warn$1(`Runtime directive used on component with non-element root node. ` +
2617
+ warn(`Runtime directive used on component with non-element root node. ` +
2576
2618
  `The directives will not function as intended.`);
2577
2619
  }
2578
2620
  // clone before mutating since the root may be a hoisted vnode
@@ -2582,7 +2624,7 @@ function renderComponentRoot(instance) {
2582
2624
  // inherit transition data
2583
2625
  if (vnode.transition) {
2584
2626
  if (!isElementRoot(root)) {
2585
- warn$1(`Component inside <Transition> renders non-element root node ` +
2627
+ warn(`Component inside <Transition> renders non-element root node ` +
2586
2628
  `that cannot be animated.`);
2587
2629
  }
2588
2630
  root.transition = vnode.transition;
@@ -2917,7 +2959,10 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2917
2959
  console[console.info ? 'info' : 'log'](`<Suspense> is an experimental feature and its API will likely change.`);
2918
2960
  }
2919
2961
  const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;
2920
- const timeout = toNumber(vnode.props && vnode.props.timeout);
2962
+ const timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined;
2963
+ {
2964
+ assertNumber(timeout, `Suspense timeout`);
2965
+ }
2921
2966
  const suspense = {
2922
2967
  vnode,
2923
2968
  parent,
@@ -3145,7 +3190,7 @@ function normalizeSuspenseSlot(s) {
3145
3190
  if (isArray(s)) {
3146
3191
  const singleChild = filterSingleRoot(s);
3147
3192
  if (!singleChild) {
3148
- warn$1(`<Suspense> slots expect a single root node.`);
3193
+ warn(`<Suspense> slots expect a single root node.`);
3149
3194
  }
3150
3195
  s = singleChild;
3151
3196
  }
@@ -3183,7 +3228,7 @@ function setActiveBranch(suspense, branch) {
3183
3228
  function provide(key, value) {
3184
3229
  if (!currentInstance) {
3185
3230
  {
3186
- warn$1(`provide() can only be used inside setup().`);
3231
+ warn(`provide() can only be used inside setup().`);
3187
3232
  }
3188
3233
  }
3189
3234
  else {
@@ -3222,11 +3267,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3222
3267
  : defaultValue;
3223
3268
  }
3224
3269
  else {
3225
- warn$1(`injection "${String(key)}" not found.`);
3270
+ warn(`injection "${String(key)}" not found.`);
3226
3271
  }
3227
3272
  }
3228
3273
  else {
3229
- warn$1(`inject() can only be used inside setup() or functional components.`);
3274
+ warn(`inject() can only be used inside setup() or functional components.`);
3230
3275
  }
3231
3276
  }
3232
3277
 
@@ -3235,17 +3280,17 @@ function watchEffect(effect, options) {
3235
3280
  return doWatch(effect, null, options);
3236
3281
  }
3237
3282
  function watchPostEffect(effect, options) {
3238
- return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
3283
+ return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'post' }) );
3239
3284
  }
3240
3285
  function watchSyncEffect(effect, options) {
3241
- return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
3286
+ return doWatch(effect, null, Object.assign(Object.assign({}, options), { flush: 'sync' }) );
3242
3287
  }
3243
3288
  // initial value for watchers to trigger on undefined initial values
3244
3289
  const INITIAL_WATCHER_VALUE = {};
3245
3290
  // implementation
3246
3291
  function watch(source, cb, options) {
3247
3292
  if (!isFunction(cb)) {
3248
- warn$1(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
3293
+ warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
3249
3294
  `Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
3250
3295
  `supports \`watch(source, cb, options?) signature.`);
3251
3296
  }
@@ -3254,19 +3299,20 @@ function watch(source, cb, options) {
3254
3299
  function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
3255
3300
  if (!cb) {
3256
3301
  if (immediate !== undefined) {
3257
- warn$1(`watch() "immediate" option is only respected when using the ` +
3302
+ warn(`watch() "immediate" option is only respected when using the ` +
3258
3303
  `watch(source, callback, options?) signature.`);
3259
3304
  }
3260
3305
  if (deep !== undefined) {
3261
- warn$1(`watch() "deep" option is only respected when using the ` +
3306
+ warn(`watch() "deep" option is only respected when using the ` +
3262
3307
  `watch(source, callback, options?) signature.`);
3263
3308
  }
3264
3309
  }
3265
3310
  const warnInvalidSource = (s) => {
3266
- warn$1(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
3311
+ warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
3267
3312
  `a reactive object, or an array of these types.`);
3268
3313
  };
3269
- const instance = currentInstance;
3314
+ const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
3315
+ // const instance = currentInstance
3270
3316
  let getter;
3271
3317
  let forceTrigger = false;
3272
3318
  let isMultiSource = false;
@@ -3353,7 +3399,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3353
3399
  // pass undefined as the old value when it's changed for the first time
3354
3400
  oldValue === INITIAL_WATCHER_VALUE
3355
3401
  ? undefined
3356
- : (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
3402
+ : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
3357
3403
  ? []
3358
3404
  : oldValue,
3359
3405
  onCleanup
@@ -3533,7 +3579,7 @@ const BaseTransitionImpl = {
3533
3579
  if (c.type !== Comment) {
3534
3580
  if (hasFound) {
3535
3581
  // warn more than one non-comment child
3536
- warn$1('<transition> can only be used on a single element or component. ' +
3582
+ warn('<transition> can only be used on a single element or component. ' +
3537
3583
  'Use <transition-group> for lists.');
3538
3584
  break;
3539
3585
  }
@@ -3551,7 +3597,7 @@ const BaseTransitionImpl = {
3551
3597
  mode !== 'in-out' &&
3552
3598
  mode !== 'out-in' &&
3553
3599
  mode !== 'default') {
3554
- warn$1(`invalid <transition> mode: ${mode}`);
3600
+ warn(`invalid <transition> mode: ${mode}`);
3555
3601
  }
3556
3602
  if (state.isLeaving) {
3557
3603
  return emptyPlaceholder(child);
@@ -3859,7 +3905,7 @@ function defineAsyncComponent(source) {
3859
3905
  return pendingRequest;
3860
3906
  }
3861
3907
  if (!comp) {
3862
- warn$1(`Async component loader resolved to undefined. ` +
3908
+ warn(`Async component loader resolved to undefined. ` +
3863
3909
  `If you are using retry(), make sure to return its return value.`);
3864
3910
  }
3865
3911
  // interop module default
@@ -3952,10 +3998,15 @@ function defineAsyncComponent(source) {
3952
3998
  }
3953
3999
  });
3954
4000
  }
3955
- function createInnerComp(comp, { vnode: { ref, props, children, shapeFlag }, parent }) {
4001
+ function createInnerComp(comp, parent) {
4002
+ const { ref, props, children, ce } = parent.vnode;
3956
4003
  const vnode = createVNode(comp, props, children);
3957
4004
  // ensure inner component inherits the async wrapper's ref owner
3958
4005
  vnode.ref = ref;
4006
+ // pass the custom element callback on to the inner comp
4007
+ // and remove it from the async wrapper
4008
+ vnode.ce = ce;
4009
+ delete parent.vnode.ce;
3959
4010
  return vnode;
3960
4011
  }
3961
4012
 
@@ -4041,7 +4092,7 @@ const KeepAliveImpl = {
4041
4092
  }
4042
4093
  function pruneCacheEntry(key) {
4043
4094
  const cached = cache.get(key);
4044
- if (!current || cached.type !== current.type) {
4095
+ if (!current || !isSameVNodeType(cached, current)) {
4045
4096
  unmount(cached);
4046
4097
  }
4047
4098
  else if (current) {
@@ -4073,7 +4124,7 @@ const KeepAliveImpl = {
4073
4124
  cache.forEach(cached => {
4074
4125
  const { subTree, suspense } = instance;
4075
4126
  const vnode = getInnerChild(subTree);
4076
- if (cached.type === vnode.type) {
4127
+ if (cached.type === vnode.type && cached.key === vnode.key) {
4077
4128
  // current instance will be unmounted as part of keep-alive's unmount
4078
4129
  resetShapeFlag(vnode);
4079
4130
  // but invoke its deactivated hook here
@@ -4093,7 +4144,7 @@ const KeepAliveImpl = {
4093
4144
  const rawVNode = children[0];
4094
4145
  if (children.length > 1) {
4095
4146
  {
4096
- warn$1(`KeepAlive should contain exactly one component child.`);
4147
+ warn(`KeepAlive should contain exactly one component child.`);
4097
4148
  }
4098
4149
  current = null;
4099
4150
  return children;
@@ -4113,8 +4164,7 @@ const KeepAliveImpl = {
4113
4164
  : comp);
4114
4165
  const { include, exclude, max } = props;
4115
4166
  if ((include && (!name || !matches(include, name))) ||
4116
- (exclude && name && matches(exclude, name)) ||
4117
- (hmrDirtyComponents.has(comp))) {
4167
+ (exclude && name && matches(exclude, name))) {
4118
4168
  current = vnode;
4119
4169
  return rawVNode;
4120
4170
  }
@@ -4171,7 +4221,7 @@ function matches(pattern, name) {
4171
4221
  else if (isString(pattern)) {
4172
4222
  return pattern.split(',').includes(name);
4173
4223
  }
4174
- else if (pattern.test) {
4224
+ else if (isRegExp(pattern)) {
4175
4225
  return pattern.test(name);
4176
4226
  }
4177
4227
  /* istanbul ignore next */
@@ -4224,14 +4274,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4224
4274
  }, target);
4225
4275
  }
4226
4276
  function resetShapeFlag(vnode) {
4227
- let shapeFlag = vnode.shapeFlag;
4228
- if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
4229
- shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4230
- }
4231
- if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
4232
- shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4233
- }
4234
- vnode.shapeFlag = shapeFlag;
4277
+ // bitwise operations to remove keep alive flags
4278
+ vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4279
+ vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4235
4280
  }
4236
4281
  function getInnerChild(vnode) {
4237
4282
  return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
@@ -4270,7 +4315,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4270
4315
  }
4271
4316
  else {
4272
4317
  const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
4273
- warn$1(`${apiName} is called when there is no active component instance to be ` +
4318
+ warn(`${apiName} is called when there is no active component instance to be ` +
4274
4319
  `associated with. ` +
4275
4320
  `Lifecycle injection APIs can only be used during execution of setup().` +
4276
4321
  (` If you are using async setup(), make sure to register lifecycle ` +
@@ -4309,7 +4354,7 @@ return withDirectives(h(comp), [
4309
4354
  */
4310
4355
  function validateDirectiveName(name) {
4311
4356
  if (isBuiltInDirective(name)) {
4312
- warn$1('Do not use built-in directive ids as custom directive id: ' + name);
4357
+ warn('Do not use built-in directive ids as custom directive id: ' + name);
4313
4358
  }
4314
4359
  }
4315
4360
  /**
@@ -4318,7 +4363,7 @@ function validateDirectiveName(name) {
4318
4363
  function withDirectives(vnode, directives) {
4319
4364
  const internalInstance = currentRenderingInstance;
4320
4365
  if (internalInstance === null) {
4321
- warn$1(`withDirectives can only be used inside render functions.`);
4366
+ warn(`withDirectives can only be used inside render functions.`);
4322
4367
  return vnode;
4323
4368
  }
4324
4369
  const instance = getExposeProxy(internalInstance) ||
@@ -4429,12 +4474,12 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4429
4474
  ? `\nIf this is a native custom element, make sure to exclude it from ` +
4430
4475
  `component resolution via compilerOptions.isCustomElement.`
4431
4476
  : ``;
4432
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
4477
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
4433
4478
  }
4434
4479
  return res;
4435
4480
  }
4436
4481
  else {
4437
- warn$1(`resolve${capitalize(type.slice(0, -1))} ` +
4482
+ warn(`resolve${capitalize(type.slice(0, -1))} ` +
4438
4483
  `can only be used in render() or setup().`);
4439
4484
  }
4440
4485
  }
@@ -4459,7 +4504,7 @@ function renderList(source, renderItem, cache, index) {
4459
4504
  }
4460
4505
  else if (typeof source === 'number') {
4461
4506
  if (!Number.isInteger(source)) {
4462
- warn$1(`The v-for range expect an integer value but got ${source}.`);
4507
+ warn(`The v-for range expect an integer value but got ${source}.`);
4463
4508
  }
4464
4509
  ret = new Array(source);
4465
4510
  for (let i = 0; i < source; i++) {
@@ -4530,11 +4575,13 @@ fallback, noSlotted) {
4530
4575
  (currentRenderingInstance.parent &&
4531
4576
  isAsyncWrapper(currentRenderingInstance.parent) &&
4532
4577
  currentRenderingInstance.parent.isCE)) {
4533
- return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
4578
+ if (name !== 'default')
4579
+ props.name = name;
4580
+ return createVNode('slot', props, fallback && fallback());
4534
4581
  }
4535
4582
  let slot = slots[name];
4536
4583
  if (slot && slot.length > 1) {
4537
- warn$1(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
4584
+ warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +
4538
4585
  `function. You need to mark this component with $dynamic-slots in the ` +
4539
4586
  `parent template.`);
4540
4587
  slot = () => [];
@@ -4587,7 +4634,7 @@ function ensureValidVNode(vnodes) {
4587
4634
  function toHandlers(obj, preserveCaseIfNecessary) {
4588
4635
  const ret = {};
4589
4636
  if (!isObject(obj)) {
4590
- warn$1(`v-on with no argument expects an object value.`);
4637
+ warn(`v-on with no argument expects an object value.`);
4591
4638
  return ret;
4592
4639
  }
4593
4640
  for (const key in obj) {
@@ -4630,6 +4677,7 @@ const publicPropertiesMap =
4630
4677
  $watch: i => (instanceWatch.bind(i) )
4631
4678
  });
4632
4679
  const isReservedPrefix = (key) => key === '_' || key === '$';
4680
+ const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
4633
4681
  const PublicInstanceProxyHandlers = {
4634
4682
  get({ _: instance }, key) {
4635
4683
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
@@ -4637,15 +4685,6 @@ const PublicInstanceProxyHandlers = {
4637
4685
  if (key === '__isVue') {
4638
4686
  return true;
4639
4687
  }
4640
- // prioritize <script setup> bindings during dev.
4641
- // this allows even properties that start with _ or $ to be used - so that
4642
- // it aligns with the production behavior where the render fn is inlined and
4643
- // indeed has access to all declared variables.
4644
- if (setupState !== EMPTY_OBJ &&
4645
- setupState.__isScriptSetup &&
4646
- hasOwn(setupState, key)) {
4647
- return setupState[key];
4648
- }
4649
4688
  // data / props / ctx
4650
4689
  // This getter gets called for every property access on the render context
4651
4690
  // during render and is a major hotspot. The most expensive part of this
@@ -4668,7 +4707,7 @@ const PublicInstanceProxyHandlers = {
4668
4707
  // default: just fallthrough
4669
4708
  }
4670
4709
  }
4671
- else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
4710
+ else if (hasSetupBinding(setupState, key)) {
4672
4711
  accessCache[key] = 1 /* AccessTypes.SETUP */;
4673
4712
  return setupState[key];
4674
4713
  }
@@ -4727,32 +4766,37 @@ const PublicInstanceProxyHandlers = {
4727
4766
  // to infinite warning loop
4728
4767
  key.indexOf('__v') !== 0)) {
4729
4768
  if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
4730
- warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
4769
+ warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
4731
4770
  `character ("$" or "_") and is not proxied on the render context.`);
4732
4771
  }
4733
4772
  else if (instance === currentRenderingInstance) {
4734
- warn$1(`Property ${JSON.stringify(key)} was accessed during render ` +
4773
+ warn(`Property ${JSON.stringify(key)} was accessed during render ` +
4735
4774
  `but is not defined on instance.`);
4736
4775
  }
4737
4776
  }
4738
4777
  },
4739
4778
  set({ _: instance }, key, value) {
4740
4779
  const { data, setupState, ctx } = instance;
4741
- if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
4780
+ if (hasSetupBinding(setupState, key)) {
4742
4781
  setupState[key] = value;
4743
4782
  return true;
4744
4783
  }
4784
+ else if (setupState.__isScriptSetup &&
4785
+ hasOwn(setupState, key)) {
4786
+ warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
4787
+ return false;
4788
+ }
4745
4789
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4746
4790
  data[key] = value;
4747
4791
  return true;
4748
4792
  }
4749
4793
  else if (hasOwn(instance.props, key)) {
4750
- warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
4794
+ warn(`Attempting to mutate prop "${key}". Props are readonly.`);
4751
4795
  return false;
4752
4796
  }
4753
4797
  if (key[0] === '$' && key.slice(1) in instance) {
4754
- warn$1(`Attempting to mutate public property "${key}". ` +
4755
- `Properties starting with $ are reserved and readonly.`, instance);
4798
+ warn(`Attempting to mutate public property "${key}". ` +
4799
+ `Properties starting with $ are reserved and readonly.`);
4756
4800
  return false;
4757
4801
  }
4758
4802
  else {
@@ -4773,7 +4817,7 @@ const PublicInstanceProxyHandlers = {
4773
4817
  let normalizedProps;
4774
4818
  return (!!accessCache[key] ||
4775
4819
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
4776
- (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
4820
+ hasSetupBinding(setupState, key) ||
4777
4821
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
4778
4822
  hasOwn(ctx, key) ||
4779
4823
  hasOwn(publicPropertiesMap, key) ||
@@ -4792,7 +4836,7 @@ const PublicInstanceProxyHandlers = {
4792
4836
  };
4793
4837
  {
4794
4838
  PublicInstanceProxyHandlers.ownKeys = (target) => {
4795
- warn$1(`Avoid app logic that relies on enumerating keys on a component instance. ` +
4839
+ warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
4796
4840
  `The keys will be empty in production mode to avoid performance overhead.`);
4797
4841
  return Reflect.ownKeys(target);
4798
4842
  };
@@ -4808,7 +4852,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend({}, Publ
4808
4852
  has(_, key) {
4809
4853
  const has = key[0] !== '_' && !isGloballyWhitelisted(key);
4810
4854
  if (!has && PublicInstanceProxyHandlers.has(_, key)) {
4811
- warn$1(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
4855
+ warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);
4812
4856
  }
4813
4857
  return has;
4814
4858
  }
@@ -4858,7 +4902,7 @@ function exposeSetupStateOnRenderContext(instance) {
4858
4902
  Object.keys(toRaw(setupState)).forEach(key => {
4859
4903
  if (!setupState.__isScriptSetup) {
4860
4904
  if (isReservedPrefix(key[0])) {
4861
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
4905
+ warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
4862
4906
  `which are reserved prefixes for Vue internals.`);
4863
4907
  return;
4864
4908
  }
@@ -4876,7 +4920,7 @@ function createDuplicateChecker() {
4876
4920
  const cache = Object.create(null);
4877
4921
  return (type, key) => {
4878
4922
  if (cache[key]) {
4879
- warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
4923
+ warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
4880
4924
  }
4881
4925
  else {
4882
4926
  cache[key] = type;
@@ -4893,7 +4937,7 @@ function applyOptions(instance) {
4893
4937
  // call beforeCreate first before accessing other options since
4894
4938
  // the hook may mutate resolved options (#2791)
4895
4939
  if (options.beforeCreate) {
4896
- callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
4940
+ callHook$1(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
4897
4941
  }
4898
4942
  const {
4899
4943
  // state
@@ -4943,24 +4987,24 @@ function applyOptions(instance) {
4943
4987
  }
4944
4988
  }
4945
4989
  else {
4946
- warn$1(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
4990
+ warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
4947
4991
  `Did you reference the function correctly?`);
4948
4992
  }
4949
4993
  }
4950
4994
  }
4951
4995
  if (dataOptions) {
4952
4996
  if (!isFunction(dataOptions)) {
4953
- warn$1(`The data option must be a function. ` +
4997
+ warn(`The data option must be a function. ` +
4954
4998
  `Plain object usage is no longer supported.`);
4955
4999
  }
4956
5000
  const data = dataOptions.call(publicThis, publicThis);
4957
5001
  if (isPromise(data)) {
4958
- warn$1(`data() returned a Promise - note data() cannot be async; If you ` +
5002
+ warn(`data() returned a Promise - note data() cannot be async; If you ` +
4959
5003
  `intend to perform data fetching before component renders, use ` +
4960
5004
  `async setup() + <Suspense>.`);
4961
5005
  }
4962
5006
  if (!isObject(data)) {
4963
- warn$1(`data() should return an object.`);
5007
+ warn(`data() should return an object.`);
4964
5008
  }
4965
5009
  else {
4966
5010
  instance.data = reactive(data);
@@ -4991,15 +5035,15 @@ function applyOptions(instance) {
4991
5035
  ? opt.get.bind(publicThis, publicThis)
4992
5036
  : NOOP;
4993
5037
  if (get === NOOP) {
4994
- warn$1(`Computed property "${key}" has no getter.`);
5038
+ warn(`Computed property "${key}" has no getter.`);
4995
5039
  }
4996
5040
  const set = !isFunction(opt) && isFunction(opt.set)
4997
5041
  ? opt.set.bind(publicThis)
4998
5042
  : () => {
4999
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
5043
+ warn(`Write operation failed: computed property "${key}" is readonly.`);
5000
5044
  }
5001
5045
  ;
5002
- const c = computed$1({
5046
+ const c = computed({
5003
5047
  get,
5004
5048
  set
5005
5049
  });
@@ -5028,7 +5072,7 @@ function applyOptions(instance) {
5028
5072
  });
5029
5073
  }
5030
5074
  if (created) {
5031
- callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
5075
+ callHook$1(created, instance, "c" /* LifecycleHooks.CREATED */);
5032
5076
  }
5033
5077
  function registerLifecycleHook(register, hook) {
5034
5078
  if (isArray(hook)) {
@@ -5108,7 +5152,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
5108
5152
  }
5109
5153
  else {
5110
5154
  {
5111
- warn$1(`injected property "${key}" is a ref and will be auto-unwrapped ` +
5155
+ warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
5112
5156
  `and no longer needs \`.value\` in the next minor release. ` +
5113
5157
  `To opt-in to the new behavior now, ` +
5114
5158
  `set \`app.config.unwrapInjectedRef = true\` (this config is ` +
@@ -5125,7 +5169,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
5125
5169
  }
5126
5170
  }
5127
5171
  }
5128
- function callHook(hook, instance, type) {
5172
+ function callHook$1(hook, instance, type) {
5129
5173
  callWithAsyncErrorHandling(isArray(hook)
5130
5174
  ? hook.map(h => h.bind(instance.proxy))
5131
5175
  : hook.bind(instance.proxy), instance, type);
@@ -5140,7 +5184,7 @@ function createWatcher(raw, ctx, publicThis, key) {
5140
5184
  watch(getter, handler);
5141
5185
  }
5142
5186
  else {
5143
- warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
5187
+ warn(`Invalid watch handler specified by key "${raw}"`, handler);
5144
5188
  }
5145
5189
  }
5146
5190
  else if (isFunction(raw)) {
@@ -5158,12 +5202,12 @@ function createWatcher(raw, ctx, publicThis, key) {
5158
5202
  watch(getter, handler, raw);
5159
5203
  }
5160
5204
  else {
5161
- warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5205
+ warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5162
5206
  }
5163
5207
  }
5164
5208
  }
5165
5209
  else {
5166
- warn$1(`Invalid watch option: "${key}"`, raw);
5210
+ warn(`Invalid watch option: "${key}"`, raw);
5167
5211
  }
5168
5212
  }
5169
5213
  /**
@@ -5207,7 +5251,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
5207
5251
  }
5208
5252
  for (const key in from) {
5209
5253
  if (asMixin && key === 'expose') {
5210
- warn$1(`"expose" option is ignored when declared in mixins or extends. ` +
5254
+ warn(`"expose" option is ignored when declared in mixins or extends. ` +
5211
5255
  `It should only be declared in the base component itself.`);
5212
5256
  }
5213
5257
  else {
@@ -5225,20 +5269,20 @@ const internalOptionMergeStrats = {
5225
5269
  methods: mergeObjectOptions,
5226
5270
  computed: mergeObjectOptions,
5227
5271
  // lifecycle
5228
- beforeCreate: mergeAsArray,
5229
- created: mergeAsArray,
5230
- beforeMount: mergeAsArray,
5231
- mounted: mergeAsArray,
5232
- beforeUpdate: mergeAsArray,
5233
- updated: mergeAsArray,
5234
- beforeDestroy: mergeAsArray,
5235
- beforeUnmount: mergeAsArray,
5236
- destroyed: mergeAsArray,
5237
- unmounted: mergeAsArray,
5238
- activated: mergeAsArray,
5239
- deactivated: mergeAsArray,
5240
- errorCaptured: mergeAsArray,
5241
- serverPrefetch: mergeAsArray,
5272
+ beforeCreate: mergeAsArray$1,
5273
+ created: mergeAsArray$1,
5274
+ beforeMount: mergeAsArray$1,
5275
+ mounted: mergeAsArray$1,
5276
+ beforeUpdate: mergeAsArray$1,
5277
+ updated: mergeAsArray$1,
5278
+ beforeDestroy: mergeAsArray$1,
5279
+ beforeUnmount: mergeAsArray$1,
5280
+ destroyed: mergeAsArray$1,
5281
+ unmounted: mergeAsArray$1,
5282
+ activated: mergeAsArray$1,
5283
+ deactivated: mergeAsArray$1,
5284
+ errorCaptured: mergeAsArray$1,
5285
+ serverPrefetch: mergeAsArray$1,
5242
5286
  // assets
5243
5287
  components: mergeObjectOptions,
5244
5288
  directives: mergeObjectOptions,
@@ -5272,7 +5316,7 @@ function normalizeInject(raw) {
5272
5316
  }
5273
5317
  return raw;
5274
5318
  }
5275
- function mergeAsArray(to, from) {
5319
+ function mergeAsArray$1(to, from) {
5276
5320
  return to ? [...new Set([].concat(to, from))] : from;
5277
5321
  }
5278
5322
  function mergeObjectOptions(to, from) {
@@ -5285,7 +5329,7 @@ function mergeWatchOptions(to, from) {
5285
5329
  return to;
5286
5330
  const merged = extend(Object.create(null), to);
5287
5331
  for (const key in from) {
5288
- merged[key] = mergeAsArray(to[key], from[key]);
5332
+ merged[key] = mergeAsArray$1(to[key], from[key]);
5289
5333
  }
5290
5334
  return merged;
5291
5335
  }
@@ -5540,7 +5584,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5540
5584
  if (isArray(raw)) {
5541
5585
  for (let i = 0; i < raw.length; i++) {
5542
5586
  if (!isString(raw[i])) {
5543
- warn$1(`props must be strings when using array syntax.`, raw[i]);
5587
+ warn(`props must be strings when using array syntax.`, raw[i]);
5544
5588
  }
5545
5589
  const normalizedKey = camelize(raw[i]);
5546
5590
  if (validatePropName(normalizedKey)) {
@@ -5550,7 +5594,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5550
5594
  }
5551
5595
  else if (raw) {
5552
5596
  if (!isObject(raw)) {
5553
- warn$1(`invalid props options`, raw);
5597
+ warn(`invalid props options`, raw);
5554
5598
  }
5555
5599
  for (const key in raw) {
5556
5600
  const normalizedKey = camelize(key);
@@ -5583,15 +5627,15 @@ function validatePropName(key) {
5583
5627
  return true;
5584
5628
  }
5585
5629
  else {
5586
- warn$1(`Invalid prop name: "${key}" is a reserved property.`);
5630
+ warn(`Invalid prop name: "${key}" is a reserved property.`);
5587
5631
  }
5588
5632
  return false;
5589
5633
  }
5590
5634
  // use function string name to check type constructors
5591
5635
  // so that it works across vms / iframes.
5592
5636
  function getType(ctor) {
5593
- const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
5594
- return match ? match[1] : ctor === null ? 'null' : '';
5637
+ const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
5638
+ return match ? match[2] : ctor === null ? 'null' : '';
5595
5639
  }
5596
5640
  function isSameType(a, b) {
5597
5641
  return getType(a) === getType(b);
@@ -5625,7 +5669,7 @@ function validateProp(name, value, prop, isAbsent) {
5625
5669
  const { type, required, validator } = prop;
5626
5670
  // required!
5627
5671
  if (required && isAbsent) {
5628
- warn$1('Missing required prop: "' + name + '"');
5672
+ warn('Missing required prop: "' + name + '"');
5629
5673
  return;
5630
5674
  }
5631
5675
  // missing but optional
@@ -5644,13 +5688,13 @@ function validateProp(name, value, prop, isAbsent) {
5644
5688
  isValid = valid;
5645
5689
  }
5646
5690
  if (!isValid) {
5647
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
5691
+ warn(getInvalidTypeMessage(name, value, expectedTypes));
5648
5692
  return;
5649
5693
  }
5650
5694
  }
5651
5695
  // custom validator
5652
5696
  if (validator && !validator(value)) {
5653
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
5697
+ warn('Invalid prop: custom validator check failed for prop "' + name + '".');
5654
5698
  }
5655
5699
  }
5656
5700
  const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
@@ -5747,7 +5791,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
5747
5791
  }
5748
5792
  const normalized = withCtx((...args) => {
5749
5793
  if (true && currentInstance) {
5750
- warn$1(`Slot "${key}" invoked outside of the render function: ` +
5794
+ warn(`Slot "${key}" invoked outside of the render function: ` +
5751
5795
  `this will not track dependencies used in the slot. ` +
5752
5796
  `Invoke the slot function inside the render function instead.`);
5753
5797
  }
@@ -5767,7 +5811,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
5767
5811
  }
5768
5812
  else if (value != null) {
5769
5813
  {
5770
- warn$1(`Non-function value encountered for slot "${key}". ` +
5814
+ warn(`Non-function value encountered for slot "${key}". ` +
5771
5815
  `Prefer function slots for better performance.`);
5772
5816
  }
5773
5817
  const normalized = normalizeSlotValue(value);
@@ -5778,7 +5822,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
5778
5822
  const normalizeVNodeSlots = (instance, children) => {
5779
5823
  if (!isKeepAlive(instance.vnode) &&
5780
5824
  !(false )) {
5781
- warn$1(`Non-function value encountered for default slot. ` +
5825
+ warn(`Non-function value encountered for default slot. ` +
5782
5826
  `Prefer function slots for better performance.`);
5783
5827
  }
5784
5828
  const normalized = normalizeSlotValue(children);
@@ -5879,21 +5923,21 @@ function createAppContext() {
5879
5923
  emitsCache: new WeakMap()
5880
5924
  };
5881
5925
  }
5882
- let uid = 0;
5926
+ let uid$1 = 0;
5883
5927
  function createAppAPI(render, hydrate) {
5884
5928
  return function createApp(rootComponent, rootProps = null) {
5885
5929
  if (!isFunction(rootComponent)) {
5886
5930
  rootComponent = Object.assign({}, rootComponent);
5887
5931
  }
5888
5932
  if (rootProps != null && !isObject(rootProps)) {
5889
- warn$1(`root props passed to app.mount() must be an object.`);
5933
+ warn(`root props passed to app.mount() must be an object.`);
5890
5934
  rootProps = null;
5891
5935
  }
5892
5936
  const context = createAppContext();
5893
5937
  const installedPlugins = new Set();
5894
5938
  let isMounted = false;
5895
5939
  const app = (context.app = {
5896
- _uid: uid++,
5940
+ _uid: uid$1++,
5897
5941
  _component: rootComponent,
5898
5942
  _props: rootProps,
5899
5943
  _container: null,
@@ -5905,12 +5949,12 @@ function createAppAPI(render, hydrate) {
5905
5949
  },
5906
5950
  set config(v) {
5907
5951
  {
5908
- warn$1(`app.config cannot be replaced. Modify individual options instead.`);
5952
+ warn(`app.config cannot be replaced. Modify individual options instead.`);
5909
5953
  }
5910
5954
  },
5911
5955
  use(plugin, ...options) {
5912
5956
  if (installedPlugins.has(plugin)) {
5913
- warn$1(`Plugin has already been applied to target app.`);
5957
+ warn(`Plugin has already been applied to target app.`);
5914
5958
  }
5915
5959
  else if (plugin && isFunction(plugin.install)) {
5916
5960
  installedPlugins.add(plugin);
@@ -5921,7 +5965,7 @@ function createAppAPI(render, hydrate) {
5921
5965
  plugin(app, ...options);
5922
5966
  }
5923
5967
  else {
5924
- warn$1(`A plugin must either be a function or an object with an "install" ` +
5968
+ warn(`A plugin must either be a function or an object with an "install" ` +
5925
5969
  `function.`);
5926
5970
  }
5927
5971
  return app;
@@ -5932,7 +5976,7 @@ function createAppAPI(render, hydrate) {
5932
5976
  context.mixins.push(mixin);
5933
5977
  }
5934
5978
  else {
5935
- warn$1('Mixin has already been applied to target app' +
5979
+ warn('Mixin has already been applied to target app' +
5936
5980
  (mixin.name ? `: ${mixin.name}` : ''));
5937
5981
  }
5938
5982
  }
@@ -5946,7 +5990,7 @@ function createAppAPI(render, hydrate) {
5946
5990
  return context.components[name];
5947
5991
  }
5948
5992
  if (context.components[name]) {
5949
- warn$1(`Component "${name}" has already been registered in target app.`);
5993
+ warn(`Component "${name}" has already been registered in target app.`);
5950
5994
  }
5951
5995
  context.components[name] = component;
5952
5996
  return app;
@@ -5959,7 +6003,7 @@ function createAppAPI(render, hydrate) {
5959
6003
  return context.directives[name];
5960
6004
  }
5961
6005
  if (context.directives[name]) {
5962
- warn$1(`Directive "${name}" has already been registered in target app.`);
6006
+ warn(`Directive "${name}" has already been registered in target app.`);
5963
6007
  }
5964
6008
  context.directives[name] = directive;
5965
6009
  return app;
@@ -5968,7 +6012,7 @@ function createAppAPI(render, hydrate) {
5968
6012
  if (!isMounted) {
5969
6013
  // #5571
5970
6014
  if (rootContainer.__vue_app__) {
5971
- warn$1(`There is already an app instance mounted on the host container.\n` +
6015
+ warn(`There is already an app instance mounted on the host container.\n` +
5972
6016
  ` If you want to mount another app on the same host container,` +
5973
6017
  ` you need to unmount the previous app by calling \`app.unmount()\` first.`);
5974
6018
  }
@@ -5998,7 +6042,7 @@ function createAppAPI(render, hydrate) {
5998
6042
  return getExposeProxy(vnode.component) || vnode.component.proxy;
5999
6043
  }
6000
6044
  else {
6001
- warn$1(`App has already been mounted.\n` +
6045
+ warn(`App has already been mounted.\n` +
6002
6046
  `If you want to remount the same app, move your app creation logic ` +
6003
6047
  `into a factory function and create fresh app instances for each ` +
6004
6048
  `mount - e.g. \`const createMyApp = () => createApp(App)\``);
@@ -6014,12 +6058,12 @@ function createAppAPI(render, hydrate) {
6014
6058
  delete app._container.__vue_app__;
6015
6059
  }
6016
6060
  else {
6017
- warn$1(`Cannot unmount an app that is not mounted.`);
6061
+ warn(`Cannot unmount an app that is not mounted.`);
6018
6062
  }
6019
6063
  },
6020
6064
  provide(key, value) {
6021
6065
  if (key in context.provides) {
6022
- warn$1(`App already provides property with key "${String(key)}". ` +
6066
+ warn(`App already provides property with key "${String(key)}". ` +
6023
6067
  `It will be overwritten with the new value.`);
6024
6068
  }
6025
6069
  context.provides[key] = value;
@@ -6049,7 +6093,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6049
6093
  const value = isUnmount ? null : refValue;
6050
6094
  const { i: owner, r: ref } = rawRef;
6051
6095
  if (!owner) {
6052
- warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
6096
+ warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
6053
6097
  `A vnode with ref must be created inside the render function.`);
6054
6098
  return;
6055
6099
  }
@@ -6116,7 +6160,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6116
6160
  refs[rawRef.k] = value;
6117
6161
  }
6118
6162
  else {
6119
- warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
6163
+ warn('Invalid template ref type:', ref, `(${typeof ref})`);
6120
6164
  }
6121
6165
  };
6122
6166
  if (value) {
@@ -6128,7 +6172,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6128
6172
  }
6129
6173
  }
6130
6174
  else {
6131
- warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
6175
+ warn('Invalid template ref type:', ref, `(${typeof ref})`);
6132
6176
  }
6133
6177
  }
6134
6178
  }
@@ -6145,7 +6189,7 @@ function createHydrationFunctions(rendererInternals) {
6145
6189
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
6146
6190
  const hydrate = (vnode, container) => {
6147
6191
  if (!container.hasChildNodes()) {
6148
- warn$1(`Attempting to hydrate existing markup but container is empty. ` +
6192
+ warn(`Attempting to hydrate existing markup but container is empty. ` +
6149
6193
  `Performing full mount instead.`);
6150
6194
  patch(null, vnode, container);
6151
6195
  flushPostFlushCbs();
@@ -6188,7 +6232,7 @@ function createHydrationFunctions(rendererInternals) {
6188
6232
  else {
6189
6233
  if (node.data !== vnode.children) {
6190
6234
  hasMismatch = true;
6191
- warn$1(`Hydration text mismatch:` +
6235
+ warn(`Hydration text mismatch:` +
6192
6236
  `\n- Client: ${JSON.stringify(node.data)}` +
6193
6237
  `\n- Server: ${JSON.stringify(vnode.children)}`);
6194
6238
  node.data = vnode.children;
@@ -6303,7 +6347,7 @@ function createHydrationFunctions(rendererInternals) {
6303
6347
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
6304
6348
  }
6305
6349
  else {
6306
- warn$1('Invalid HostVNode type:', type, `(${typeof type})`);
6350
+ warn('Invalid HostVNode type:', type, `(${typeof type})`);
6307
6351
  }
6308
6352
  }
6309
6353
  if (ref != null) {
@@ -6364,7 +6408,7 @@ function createHydrationFunctions(rendererInternals) {
6364
6408
  while (next) {
6365
6409
  hasMismatch = true;
6366
6410
  if (!hasWarned) {
6367
- warn$1(`Hydration children mismatch in <${vnode.type}>: ` +
6411
+ warn(`Hydration children mismatch in <${vnode.type}>: ` +
6368
6412
  `server rendered element contains more child nodes than client vdom.`);
6369
6413
  hasWarned = true;
6370
6414
  }
@@ -6377,7 +6421,7 @@ function createHydrationFunctions(rendererInternals) {
6377
6421
  else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
6378
6422
  if (el.textContent !== vnode.children) {
6379
6423
  hasMismatch = true;
6380
- warn$1(`Hydration text content mismatch in <${vnode.type}>:\n` +
6424
+ warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
6381
6425
  `- Client: ${el.textContent}\n` +
6382
6426
  `- Server: ${vnode.children}`);
6383
6427
  el.textContent = vnode.children;
@@ -6404,7 +6448,7 @@ function createHydrationFunctions(rendererInternals) {
6404
6448
  else {
6405
6449
  hasMismatch = true;
6406
6450
  if (!hasWarned) {
6407
- warn$1(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
6451
+ warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
6408
6452
  `server rendered element contains fewer child nodes than client vdom.`);
6409
6453
  hasWarned = true;
6410
6454
  }
@@ -6437,7 +6481,7 @@ function createHydrationFunctions(rendererInternals) {
6437
6481
  };
6438
6482
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
6439
6483
  hasMismatch = true;
6440
- warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
6484
+ warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
6441
6485
  ? `(text)`
6442
6486
  : isComment(node) && node.data === '['
6443
6487
  ? `(start of fragment)`
@@ -6605,7 +6649,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6605
6649
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
6606
6650
  }
6607
6651
  else {
6608
- warn$1('Invalid VNode type:', type, `(${typeof type})`);
6652
+ warn('Invalid VNode type:', type, `(${typeof type})`);
6609
6653
  }
6610
6654
  }
6611
6655
  // set ref
@@ -6695,6 +6739,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6695
6739
  if (dirs) {
6696
6740
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
6697
6741
  }
6742
+ // scopeId
6743
+ setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
6698
6744
  // props
6699
6745
  if (props) {
6700
6746
  for (const key in props) {
@@ -6718,8 +6764,6 @@ function baseCreateRenderer(options, createHydrationFns) {
6718
6764
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
6719
6765
  }
6720
6766
  }
6721
- // scopeId
6722
- setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
6723
6767
  {
6724
6768
  Object.defineProperty(el, '__vnode', {
6725
6769
  value: vnode,
@@ -7429,7 +7473,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7429
7473
  : normalizeVNode(c2[i]));
7430
7474
  if (nextChild.key != null) {
7431
7475
  if (keyToNewIndexMap.has(nextChild.key)) {
7432
- warn$1(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
7476
+ warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
7433
7477
  }
7434
7478
  keyToNewIndexMap.set(nextChild.key, i);
7435
7479
  }
@@ -7812,6 +7856,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7812
7856
  if (!shallow)
7813
7857
  traverseStaticChildren(c1, c2);
7814
7858
  }
7859
+ // #6852 also inherit for text nodes
7860
+ if (c2.type === Text) {
7861
+ c2.el = c1.el;
7862
+ }
7815
7863
  // also inherit for comment nodes, but not placeholders (e.g. v-if which
7816
7864
  // would have received .el during block patch)
7817
7865
  if (c2.type === Comment && !c2.el) {
@@ -7870,14 +7918,14 @@ const resolveTarget = (props, select) => {
7870
7918
  const targetSelector = props && props.to;
7871
7919
  if (isString(targetSelector)) {
7872
7920
  if (!select) {
7873
- warn$1(`Current renderer does not support string target for Teleports. ` +
7921
+ warn(`Current renderer does not support string target for Teleports. ` +
7874
7922
  `(missing querySelector renderer option)`);
7875
7923
  return null;
7876
7924
  }
7877
7925
  else {
7878
7926
  const target = select(targetSelector);
7879
7927
  if (!target) {
7880
- warn$1(`Failed to locate Teleport target with selector "${targetSelector}". ` +
7928
+ warn(`Failed to locate Teleport target with selector "${targetSelector}". ` +
7881
7929
  `Note the target element must exist before the component is mounted - ` +
7882
7930
  `i.e. the target cannot be rendered by the component itself, and ` +
7883
7931
  `ideally should be outside of the entire Vue component tree.`);
@@ -7887,7 +7935,7 @@ const resolveTarget = (props, select) => {
7887
7935
  }
7888
7936
  else {
7889
7937
  if (!targetSelector && !isTeleportDisabled(props)) {
7890
- warn$1(`Invalid Teleport target: ${targetSelector}`);
7938
+ warn(`Invalid Teleport target: ${targetSelector}`);
7891
7939
  }
7892
7940
  return targetSelector;
7893
7941
  }
@@ -7920,7 +7968,7 @@ const TeleportImpl = {
7920
7968
  isSVG = isSVG || isTargetSVG(target);
7921
7969
  }
7922
7970
  else if (!disabled) {
7923
- warn$1('Invalid Teleport target on mount:', target, `(${typeof target})`);
7971
+ warn('Invalid Teleport target on mount:', target, `(${typeof target})`);
7924
7972
  }
7925
7973
  const mount = (container, anchor) => {
7926
7974
  // Teleport *always* has Array children. This is enforced in both the
@@ -7972,7 +8020,7 @@ const TeleportImpl = {
7972
8020
  moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
7973
8021
  }
7974
8022
  else {
7975
- warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
8023
+ warn('Invalid Teleport target on update:', target, `(${typeof target})`);
7976
8024
  }
7977
8025
  }
7978
8026
  else if (wasDisabled) {
@@ -7982,6 +8030,7 @@ const TeleportImpl = {
7982
8030
  }
7983
8031
  }
7984
8032
  }
8033
+ updateCssVars(n2);
7985
8034
  },
7986
8035
  remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
7987
8036
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
@@ -8060,11 +8109,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
8060
8109
  hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
8061
8110
  }
8062
8111
  }
8112
+ updateCssVars(vnode);
8063
8113
  }
8064
8114
  return vnode.anchor && nextSibling(vnode.anchor);
8065
8115
  }
8066
8116
  // Force-casted public typing for h and TSX props inference
8067
8117
  const Teleport = TeleportImpl;
8118
+ function updateCssVars(vnode) {
8119
+ // presence of .ut method indicates owner component uses css vars.
8120
+ // code path here can assume browser environment.
8121
+ const ctx = vnode.ctx;
8122
+ if (ctx && ctx.ut) {
8123
+ let node = vnode.children[0].el;
8124
+ while (node !== vnode.targetAnchor) {
8125
+ if (node.nodeType === 1)
8126
+ node.setAttribute('data-v-owner', ctx.uid);
8127
+ node = node.nextSibling;
8128
+ }
8129
+ ctx.ut();
8130
+ }
8131
+ }
8068
8132
 
8069
8133
  const Fragment = Symbol('Fragment' );
8070
8134
  const Text = Symbol('Text' );
@@ -8159,6 +8223,10 @@ function isVNode(value) {
8159
8223
  function isSameVNodeType(n1, n2) {
8160
8224
  if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
8161
8225
  hmrDirtyComponents.has(n2.type)) {
8226
+ // #7042, ensure the vnode being unmounted during HMR
8227
+ // bitwise operations to remove keep alive flags
8228
+ n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
8229
+ n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
8162
8230
  // HMR only: if the component has been hot-updated, force a reload.
8163
8231
  return false;
8164
8232
  }
@@ -8214,7 +8282,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
8214
8282
  patchFlag,
8215
8283
  dynamicProps,
8216
8284
  dynamicChildren: null,
8217
- appContext: null
8285
+ appContext: null,
8286
+ ctx: currentRenderingInstance
8218
8287
  };
8219
8288
  if (needFullChildrenNormalization) {
8220
8289
  normalizeChildren(vnode, children);
@@ -8232,7 +8301,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
8232
8301
  }
8233
8302
  // validate key
8234
8303
  if (vnode.key !== vnode.key) {
8235
- warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8304
+ warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8236
8305
  }
8237
8306
  // track vnode for block tree
8238
8307
  if (isBlockTreeEnabled > 0 &&
@@ -8256,7 +8325,7 @@ const createVNode = (createVNodeWithArgsTransform );
8256
8325
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
8257
8326
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
8258
8327
  if (!type) {
8259
- warn$1(`Invalid vnode type when creating vnode: ${type}.`);
8328
+ warn(`Invalid vnode type when creating vnode: ${type}.`);
8260
8329
  }
8261
8330
  type = Comment;
8262
8331
  }
@@ -8314,7 +8383,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8314
8383
  : 0;
8315
8384
  if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
8316
8385
  type = toRaw(type);
8317
- warn$1(`Vue received a Component which was made a reactive object. This can ` +
8386
+ warn(`Vue received a Component which was made a reactive object. This can ` +
8318
8387
  `lead to unnecessary performance overhead, and should be avoided by ` +
8319
8388
  `marking the component with \`markRaw\` or using \`shallowRef\` ` +
8320
8389
  `instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
@@ -8381,7 +8450,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
8381
8450
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
8382
8451
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8383
8452
  el: vnode.el,
8384
- anchor: vnode.anchor
8453
+ anchor: vnode.anchor,
8454
+ ctx: vnode.ctx,
8455
+ ce: vnode.ce
8385
8456
  };
8386
8457
  return cloned;
8387
8458
  }
@@ -8548,13 +8619,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8548
8619
  }
8549
8620
 
8550
8621
  const emptyAppContext = createAppContext();
8551
- let uid$1 = 0;
8622
+ let uid = 0;
8552
8623
  function createComponentInstance(vnode, parent, suspense) {
8553
8624
  const type = vnode.type;
8554
8625
  // inherit parent app context - or - if root, adopt from root vnode
8555
8626
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
8556
8627
  const instance = {
8557
- uid: uid$1++,
8628
+ uid: uid++,
8558
8629
  vnode,
8559
8630
  type,
8560
8631
  parent,
@@ -8624,7 +8695,7 @@ function createComponentInstance(vnode, parent, suspense) {
8624
8695
  instance.ctx = createDevRenderContext(instance);
8625
8696
  }
8626
8697
  instance.root = parent ? parent.root : instance;
8627
- instance.emit = emit$1.bind(null, instance);
8698
+ instance.emit = emit.bind(null, instance);
8628
8699
  // apply custom element special handling
8629
8700
  if (vnode.ce) {
8630
8701
  vnode.ce(instance);
@@ -8645,7 +8716,7 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
8645
8716
  function validateComponentName(name, config) {
8646
8717
  const appIsNativeTag = config.isNativeTag || NO;
8647
8718
  if (isBuiltInTag(name) || appIsNativeTag(name)) {
8648
- warn$1('Do not use built-in or reserved HTML elements as component id: ' + name);
8719
+ warn('Do not use built-in or reserved HTML elements as component id: ' + name);
8649
8720
  }
8650
8721
  }
8651
8722
  function isStatefulComponent(instance) {
@@ -8684,7 +8755,7 @@ function setupStatefulComponent(instance, isSSR) {
8684
8755
  }
8685
8756
  }
8686
8757
  if (Component.compilerOptions && isRuntimeOnly()) {
8687
- warn$1(`"compilerOptions" is only supported when using a build of Vue that ` +
8758
+ warn(`"compilerOptions" is only supported when using a build of Vue that ` +
8688
8759
  `includes the runtime compiler. Since you are using a runtime-only ` +
8689
8760
  `build, the options should be passed via your build tool config instead.`);
8690
8761
  }
@@ -8725,7 +8796,7 @@ function setupStatefulComponent(instance, isSSR) {
8725
8796
  instance.asyncDep = setupResult;
8726
8797
  if (!instance.suspense) {
8727
8798
  const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
8728
- warn$1(`Component <${name}>: setup function returned a promise, but no ` +
8799
+ warn(`Component <${name}>: setup function returned a promise, but no ` +
8729
8800
  `<Suspense> boundary was found in the parent component tree. ` +
8730
8801
  `A component with async setup() must be nested in a <Suspense> ` +
8731
8802
  `in order to be rendered.`);
@@ -8749,7 +8820,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
8749
8820
  }
8750
8821
  else if (isObject(setupResult)) {
8751
8822
  if (isVNode(setupResult)) {
8752
- warn$1(`setup() should not return VNodes directly - ` +
8823
+ warn(`setup() should not return VNodes directly - ` +
8753
8824
  `return a render function instead.`);
8754
8825
  }
8755
8826
  // setup returned bindings.
@@ -8763,18 +8834,18 @@ function handleSetupResult(instance, setupResult, isSSR) {
8763
8834
  }
8764
8835
  }
8765
8836
  else if (setupResult !== undefined) {
8766
- warn$1(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
8837
+ warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
8767
8838
  }
8768
8839
  finishComponentSetup(instance, isSSR);
8769
8840
  }
8770
- let compile;
8841
+ let compile$1;
8771
8842
  let installWithProxy;
8772
8843
  /**
8773
8844
  * For runtime-dom to register the compiler.
8774
8845
  * Note the exported method uses any to avoid d.ts relying on the compiler types.
8775
8846
  */
8776
8847
  function registerRuntimeCompiler(_compile) {
8777
- compile = _compile;
8848
+ compile$1 = _compile;
8778
8849
  installWithProxy = i => {
8779
8850
  if (i.render._rc) {
8780
8851
  i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
@@ -8782,7 +8853,7 @@ function registerRuntimeCompiler(_compile) {
8782
8853
  };
8783
8854
  }
8784
8855
  // dev only
8785
- const isRuntimeOnly = () => !compile;
8856
+ const isRuntimeOnly = () => !compile$1;
8786
8857
  function finishComponentSetup(instance, isSSR, skipOptions) {
8787
8858
  const Component = instance.type;
8788
8859
  // template / render function normalization
@@ -8790,7 +8861,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8790
8861
  if (!instance.render) {
8791
8862
  // only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
8792
8863
  // is done by server-renderer
8793
- if (!isSSR && compile && !Component.render) {
8864
+ if (!isSSR && compile$1 && !Component.render) {
8794
8865
  const template = Component.template ||
8795
8866
  resolveMergedOptions(instance).template;
8796
8867
  if (template) {
@@ -8803,7 +8874,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8803
8874
  isCustomElement,
8804
8875
  delimiters
8805
8876
  }, compilerOptions), componentCompilerOptions);
8806
- Component.render = compile(template, finalCompilerOptions);
8877
+ Component.render = compile$1(template, finalCompilerOptions);
8807
8878
  {
8808
8879
  endMeasure(instance, `compile`);
8809
8880
  }
@@ -8829,14 +8900,14 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8829
8900
  // the runtime compilation of template in SSR is done by server-render
8830
8901
  if (!Component.render && instance.render === NOOP && !isSSR) {
8831
8902
  /* istanbul ignore if */
8832
- if (!compile && Component.template) {
8833
- warn$1(`Component provided template option but ` +
8903
+ if (!compile$1 && Component.template) {
8904
+ warn(`Component provided template option but ` +
8834
8905
  `runtime compilation is not supported in this build of Vue.` +
8835
8906
  (` Use "vue.esm-browser.js" instead.`
8836
8907
  ) /* should not happen */);
8837
8908
  }
8838
8909
  else {
8839
- warn$1(`Component is missing template or render function.`);
8910
+ warn(`Component is missing template or render function.`);
8840
8911
  }
8841
8912
  }
8842
8913
  }
@@ -8848,11 +8919,11 @@ function createAttrsProxy(instance) {
8848
8919
  return target[key];
8849
8920
  },
8850
8921
  set() {
8851
- warn$1(`setupContext.attrs is readonly.`);
8922
+ warn(`setupContext.attrs is readonly.`);
8852
8923
  return false;
8853
8924
  },
8854
8925
  deleteProperty() {
8855
- warn$1(`setupContext.attrs is readonly.`);
8926
+ warn(`setupContext.attrs is readonly.`);
8856
8927
  return false;
8857
8928
  }
8858
8929
  }
@@ -8860,8 +8931,24 @@ function createAttrsProxy(instance) {
8860
8931
  }
8861
8932
  function createSetupContext(instance) {
8862
8933
  const expose = exposed => {
8863
- if (instance.exposed) {
8864
- warn$1(`expose() should be called only once per setup().`);
8934
+ {
8935
+ if (instance.exposed) {
8936
+ warn(`expose() should be called only once per setup().`);
8937
+ }
8938
+ if (exposed != null) {
8939
+ let exposedType = typeof exposed;
8940
+ if (exposedType === 'object') {
8941
+ if (isArray(exposed)) {
8942
+ exposedType = 'array';
8943
+ }
8944
+ else if (isRef(exposed)) {
8945
+ exposedType = 'ref';
8946
+ }
8947
+ }
8948
+ if (exposedType !== 'object') {
8949
+ warn(`expose() should be passed a plain object, received ${exposedType}.`);
8950
+ }
8951
+ }
8865
8952
  }
8866
8953
  instance.exposed = exposed || {};
8867
8954
  };
@@ -8936,13 +9023,13 @@ function isClassComponent(value) {
8936
9023
  return isFunction(value) && '__vccOpts' in value;
8937
9024
  }
8938
9025
 
8939
- const computed$1 = ((getterOrOptions, debugOptions) => {
9026
+ const computed = ((getterOrOptions, debugOptions) => {
8940
9027
  // @ts-ignore
8941
- return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
9028
+ return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
8942
9029
  });
8943
9030
 
8944
9031
  // dev only
8945
- const warnRuntimeUsage = (method) => warn$1(`${method}() is a compiler-hint helper that is only usable inside ` +
9032
+ const warnRuntimeUsage = (method) => warn(`${method}() is a compiler-hint helper that is only usable inside ` +
8946
9033
  `<script setup> of a single file component. Its arguments should be ` +
8947
9034
  `compiled away and passing it at runtime has no effect.`);
8948
9035
  // implementation
@@ -9009,7 +9096,7 @@ function useAttrs() {
9009
9096
  function getContext() {
9010
9097
  const i = getCurrentInstance();
9011
9098
  if (!i) {
9012
- warn$1(`useContext() called without active instance.`);
9099
+ warn(`useContext() called without active instance.`);
9013
9100
  }
9014
9101
  return i.setupContext || (i.setupContext = createSetupContext(i));
9015
9102
  }
@@ -9036,7 +9123,7 @@ function mergeDefaults(raw, defaults) {
9036
9123
  props[key] = { default: defaults[key] };
9037
9124
  }
9038
9125
  else {
9039
- warn$1(`props default key "${key}" has no corresponding declaration.`);
9126
+ warn(`props default key "${key}" has no corresponding declaration.`);
9040
9127
  }
9041
9128
  }
9042
9129
  return props;
@@ -9079,7 +9166,7 @@ function createPropsRestProxy(props, excludedKeys) {
9079
9166
  function withAsyncContext(getAwaitable) {
9080
9167
  const ctx = getCurrentInstance();
9081
9168
  if (!ctx) {
9082
- warn$1(`withAsyncContext called without active current instance. ` +
9169
+ warn(`withAsyncContext called without active current instance. ` +
9083
9170
  `This is likely a bug.`);
9084
9171
  }
9085
9172
  let awaitable = getAwaitable();
@@ -9126,7 +9213,7 @@ const useSSRContext = () => {
9126
9213
  {
9127
9214
  const ctx = inject(ssrContextKey);
9128
9215
  if (!ctx) {
9129
- warn$1(`Server rendering context not provided. Make sure to only call ` +
9216
+ warn(`Server rendering context not provided. Make sure to only call ` +
9130
9217
  `useSSRContext() conditionally in the server build.`);
9131
9218
  }
9132
9219
  return ctx;
@@ -9350,7 +9437,7 @@ function isMemoSame(cached, memo) {
9350
9437
  }
9351
9438
 
9352
9439
  // Core API ------------------------------------------------------------------
9353
- const version = "3.2.44";
9440
+ const version = "3.2.46";
9354
9441
  /**
9355
9442
  * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
9356
9443
  * @internal
@@ -9467,9 +9554,6 @@ function patchStyle(el, prev, next) {
9467
9554
  const style = el.style;
9468
9555
  const isCssString = isString(next);
9469
9556
  if (next && !isCssString) {
9470
- for (const key in next) {
9471
- setStyle(style, key, next[key]);
9472
- }
9473
9557
  if (prev && !isString(prev)) {
9474
9558
  for (const key in prev) {
9475
9559
  if (next[key] == null) {
@@ -9477,6 +9561,9 @@ function patchStyle(el, prev, next) {
9477
9561
  }
9478
9562
  }
9479
9563
  }
9564
+ for (const key in next) {
9565
+ setStyle(style, key, next[key]);
9566
+ }
9480
9567
  }
9481
9568
  else {
9482
9569
  const currentDisplay = style.display;
@@ -9507,7 +9594,7 @@ function setStyle(style, name, val) {
9507
9594
  val = '';
9508
9595
  {
9509
9596
  if (semicolonRE.test(val)) {
9510
- warn$1(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
9597
+ warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
9511
9598
  }
9512
9599
  }
9513
9600
  if (name.startsWith('--')) {
@@ -9631,7 +9718,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
9631
9718
  catch (e) {
9632
9719
  // do not warn if value is auto-coerced from nullish values
9633
9720
  if (!needRemove) {
9634
- warn$1(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
9721
+ warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
9635
9722
  `value ${value} is invalid.`, e);
9636
9723
  }
9637
9724
  }
@@ -9835,16 +9922,25 @@ class VueElement extends BaseClass {
9835
9922
  }
9836
9923
  else {
9837
9924
  if (this.shadowRoot) {
9838
- warn$1(`Custom element has pre-rendered declarative shadow root but is not ` +
9925
+ warn(`Custom element has pre-rendered declarative shadow root but is not ` +
9839
9926
  `defined as hydratable. Use \`defineSSRCustomElement\`.`);
9840
9927
  }
9841
9928
  this.attachShadow({ mode: 'open' });
9929
+ if (!this._def.__asyncLoader) {
9930
+ // for sync component defs we can immediately resolve props
9931
+ this._resolveProps(this._def);
9932
+ }
9842
9933
  }
9843
9934
  }
9844
9935
  connectedCallback() {
9845
9936
  this._connected = true;
9846
9937
  if (!this._instance) {
9847
- this._resolveDef();
9938
+ if (this._resolved) {
9939
+ this._update();
9940
+ }
9941
+ else {
9942
+ this._resolveDef();
9943
+ }
9848
9944
  }
9849
9945
  }
9850
9946
  disconnectedCallback() {
@@ -9860,9 +9956,6 @@ class VueElement extends BaseClass {
9860
9956
  * resolve inner component definition (handle possible async component)
9861
9957
  */
9862
9958
  _resolveDef() {
9863
- if (this._resolved) {
9864
- return;
9865
- }
9866
9959
  this._resolved = true;
9867
9960
  // set initial attrs
9868
9961
  for (let i = 0; i < this.attributes.length; i++) {
@@ -9874,38 +9967,26 @@ class VueElement extends BaseClass {
9874
9967
  this._setAttr(m.attributeName);
9875
9968
  }
9876
9969
  }).observe(this, { attributes: true });
9877
- const resolve = (def) => {
9878
- const { props = {}, styles } = def;
9879
- const hasOptions = !isArray(props);
9880
- const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9970
+ const resolve = (def, isAsync = false) => {
9971
+ const { props, styles } = def;
9881
9972
  // cast Number-type props set before resolve
9882
9973
  let numberProps;
9883
- if (hasOptions) {
9884
- for (const key in this._props) {
9974
+ if (props && !isArray(props)) {
9975
+ for (const key in props) {
9885
9976
  const opt = props[key];
9886
9977
  if (opt === Number || (opt && opt.type === Number)) {
9887
- this._props[key] = toNumber(this._props[key]);
9888
- (numberProps || (numberProps = Object.create(null)))[key] = true;
9978
+ if (key in this._props) {
9979
+ this._props[key] = toNumber(this._props[key]);
9980
+ }
9981
+ (numberProps || (numberProps = Object.create(null)))[camelize(key)] = true;
9889
9982
  }
9890
9983
  }
9891
9984
  }
9892
9985
  this._numberProps = numberProps;
9893
- // check if there are props set pre-upgrade or connect
9894
- for (const key of Object.keys(this)) {
9895
- if (key[0] !== '_') {
9896
- this._setProp(key, this[key], true, false);
9897
- }
9898
- }
9899
- // defining getter/setters on prototype
9900
- for (const key of rawKeys.map(camelize)) {
9901
- Object.defineProperty(this, key, {
9902
- get() {
9903
- return this._getProp(key);
9904
- },
9905
- set(val) {
9906
- this._setProp(key, val);
9907
- }
9908
- });
9986
+ if (isAsync) {
9987
+ // defining getter/setters on prototype
9988
+ // for sync defs, this already happened in the constructor
9989
+ this._resolveProps(def);
9909
9990
  }
9910
9991
  // apply CSS
9911
9992
  this._applyStyles(styles);
@@ -9914,12 +9995,33 @@ class VueElement extends BaseClass {
9914
9995
  };
9915
9996
  const asyncDef = this._def.__asyncLoader;
9916
9997
  if (asyncDef) {
9917
- asyncDef().then(resolve);
9998
+ asyncDef().then(def => resolve(def, true));
9918
9999
  }
9919
10000
  else {
9920
10001
  resolve(this._def);
9921
10002
  }
9922
10003
  }
10004
+ _resolveProps(def) {
10005
+ const { props } = def;
10006
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10007
+ // check if there are props set pre-upgrade or connect
10008
+ for (const key of Object.keys(this)) {
10009
+ if (key[0] !== '_' && declaredPropKeys.includes(key)) {
10010
+ this._setProp(key, this[key], true, false);
10011
+ }
10012
+ }
10013
+ // defining getter/setters on prototype
10014
+ for (const key of declaredPropKeys.map(camelize)) {
10015
+ Object.defineProperty(this, key, {
10016
+ get() {
10017
+ return this._getProp(key);
10018
+ },
10019
+ set(val) {
10020
+ this._setProp(key, val);
10021
+ }
10022
+ });
10023
+ }
10024
+ }
9923
10025
  _setAttr(key) {
9924
10026
  let value = this.getAttribute(key);
9925
10027
  const camelKey = camelize(key);
@@ -9975,27 +10077,31 @@ class VueElement extends BaseClass {
9975
10077
  this._styles.length = 0;
9976
10078
  }
9977
10079
  this._applyStyles(newStyles);
9978
- // if this is an async component, ceReload is called from the inner
9979
- // component so no need to reload the async wrapper
9980
- if (!this._def.__asyncLoader) {
9981
- // reload
9982
- this._instance = null;
9983
- this._update();
9984
- }
10080
+ this._instance = null;
10081
+ this._update();
9985
10082
  };
9986
10083
  }
9987
- // intercept emit
9988
- instance.emit = (event, ...args) => {
10084
+ const dispatch = (event, args) => {
9989
10085
  this.dispatchEvent(new CustomEvent(event, {
9990
10086
  detail: args
9991
10087
  }));
9992
10088
  };
10089
+ // intercept emit
10090
+ instance.emit = (event, ...args) => {
10091
+ // dispatch both the raw and hyphenated versions of an event
10092
+ // to match Vue behavior
10093
+ dispatch(event, args);
10094
+ if (hyphenate(event) !== event) {
10095
+ dispatch(hyphenate(event), args);
10096
+ }
10097
+ };
9993
10098
  // locate nearest Vue custom element parent for provide/inject
9994
10099
  let parent = this;
9995
10100
  while ((parent =
9996
10101
  parent && (parent.parentNode || parent.host))) {
9997
10102
  if (parent instanceof VueElement) {
9998
10103
  instance.parent = parent._instance;
10104
+ instance.provides = parent._instance.provides;
9999
10105
  break;
10000
10106
  }
10001
10107
  }
@@ -10023,17 +10129,17 @@ function useCssModule(name = '$style') {
10023
10129
  {
10024
10130
  const instance = getCurrentInstance();
10025
10131
  if (!instance) {
10026
- warn$1(`useCssModule must be called inside setup()`);
10132
+ warn(`useCssModule must be called inside setup()`);
10027
10133
  return EMPTY_OBJ;
10028
10134
  }
10029
10135
  const modules = instance.type.__cssModules;
10030
10136
  if (!modules) {
10031
- warn$1(`Current instance does not have CSS modules injected.`);
10137
+ warn(`Current instance does not have CSS modules injected.`);
10032
10138
  return EMPTY_OBJ;
10033
10139
  }
10034
10140
  const mod = modules[name];
10035
10141
  if (!mod) {
10036
- warn$1(`Current instance does not have CSS module named "${name}".`);
10142
+ warn(`Current instance does not have CSS module named "${name}".`);
10037
10143
  return EMPTY_OBJ;
10038
10144
  }
10039
10145
  return mod;
@@ -10048,10 +10154,17 @@ function useCssVars(getter) {
10048
10154
  const instance = getCurrentInstance();
10049
10155
  /* istanbul ignore next */
10050
10156
  if (!instance) {
10051
- warn$1(`useCssVars is called without current active component instance.`);
10157
+ warn(`useCssVars is called without current active component instance.`);
10052
10158
  return;
10053
10159
  }
10054
- const setVars = () => setVarsOnVNode(instance.subTree, getter(instance.proxy));
10160
+ const updateTeleports = (instance.ut = (vars = getter(instance.proxy)) => {
10161
+ Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node => setVarsOnNode(node, vars));
10162
+ });
10163
+ const setVars = () => {
10164
+ const vars = getter(instance.proxy);
10165
+ setVarsOnVNode(instance.subTree, vars);
10166
+ updateTeleports(vars);
10167
+ };
10055
10168
  watchPostEffect(setVars);
10056
10169
  onMounted(() => {
10057
10170
  const ob = new MutationObserver(setVars);
@@ -10098,7 +10211,7 @@ function setVarsOnNode(el, vars) {
10098
10211
  }
10099
10212
  }
10100
10213
 
10101
- const TRANSITION = 'transition';
10214
+ const TRANSITION$1 = 'transition';
10102
10215
  const ANIMATION = 'animation';
10103
10216
  // DOM Transition is a higher-order-component based on the platform-agnostic
10104
10217
  // base Transition component, with DOM-specific logic.
@@ -10128,7 +10241,7 @@ const TransitionPropsValidators = (Transition.props =
10128
10241
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
10129
10242
  * with custom HOCs.
10130
10243
  */
10131
- const callHook$1 = (hook, args = []) => {
10244
+ const callHook = (hook, args = []) => {
10132
10245
  if (isArray(hook)) {
10133
10246
  hook.forEach(h => h(...args));
10134
10247
  }
@@ -10178,7 +10291,7 @@ function resolveTransitionProps(rawProps) {
10178
10291
  return (el, done) => {
10179
10292
  const hook = isAppear ? onAppear : onEnter;
10180
10293
  const resolve = () => finishEnter(el, isAppear, done);
10181
- callHook$1(hook, [el, resolve]);
10294
+ callHook(hook, [el, resolve]);
10182
10295
  nextFrame(() => {
10183
10296
  removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
10184
10297
  addTransitionClass(el, isAppear ? appearToClass : enterToClass);
@@ -10190,12 +10303,12 @@ function resolveTransitionProps(rawProps) {
10190
10303
  };
10191
10304
  return extend(baseProps, {
10192
10305
  onBeforeEnter(el) {
10193
- callHook$1(onBeforeEnter, [el]);
10306
+ callHook(onBeforeEnter, [el]);
10194
10307
  addTransitionClass(el, enterFromClass);
10195
10308
  addTransitionClass(el, enterActiveClass);
10196
10309
  },
10197
10310
  onBeforeAppear(el) {
10198
- callHook$1(onBeforeAppear, [el]);
10311
+ callHook(onBeforeAppear, [el]);
10199
10312
  addTransitionClass(el, appearFromClass);
10200
10313
  addTransitionClass(el, appearActiveClass);
10201
10314
  },
@@ -10219,19 +10332,19 @@ function resolveTransitionProps(rawProps) {
10219
10332
  whenTransitionEnds(el, type, leaveDuration, resolve);
10220
10333
  }
10221
10334
  });
10222
- callHook$1(onLeave, [el, resolve]);
10335
+ callHook(onLeave, [el, resolve]);
10223
10336
  },
10224
10337
  onEnterCancelled(el) {
10225
10338
  finishEnter(el, false);
10226
- callHook$1(onEnterCancelled, [el]);
10339
+ callHook(onEnterCancelled, [el]);
10227
10340
  },
10228
10341
  onAppearCancelled(el) {
10229
10342
  finishEnter(el, true);
10230
- callHook$1(onAppearCancelled, [el]);
10343
+ callHook(onAppearCancelled, [el]);
10231
10344
  },
10232
10345
  onLeaveCancelled(el) {
10233
10346
  finishLeave(el);
10234
- callHook$1(onLeaveCancelled, [el]);
10347
+ callHook(onLeaveCancelled, [el]);
10235
10348
  }
10236
10349
  });
10237
10350
  }
@@ -10249,18 +10362,10 @@ function normalizeDuration(duration) {
10249
10362
  }
10250
10363
  function NumberOf(val) {
10251
10364
  const res = toNumber(val);
10252
- validateDuration(res);
10253
- return res;
10254
- }
10255
- function validateDuration(val) {
10256
- if (typeof val !== 'number') {
10257
- warn$1(`<transition> explicit duration is not a valid number - ` +
10258
- `got ${JSON.stringify(val)}.`);
10259
- }
10260
- else if (isNaN(val)) {
10261
- warn$1(`<transition> explicit duration is NaN - ` +
10262
- 'the duration expression might be incorrect.');
10365
+ {
10366
+ assertNumber(res, '<transition> explicit duration');
10263
10367
  }
10368
+ return res;
10264
10369
  }
10265
10370
  function addTransitionClass(el, cls) {
10266
10371
  cls.split(/\s+/).forEach(c => c && el.classList.add(c));
@@ -10319,8 +10424,8 @@ function getTransitionInfo(el, expectedType) {
10319
10424
  const styles = window.getComputedStyle(el);
10320
10425
  // JSDOM may return undefined for transition properties
10321
10426
  const getStyleProperties = (key) => (styles[key] || '').split(', ');
10322
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
10323
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
10427
+ const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
10428
+ const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
10324
10429
  const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
10325
10430
  const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
10326
10431
  const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
@@ -10329,9 +10434,9 @@ function getTransitionInfo(el, expectedType) {
10329
10434
  let timeout = 0;
10330
10435
  let propCount = 0;
10331
10436
  /* istanbul ignore if */
10332
- if (expectedType === TRANSITION) {
10437
+ if (expectedType === TRANSITION$1) {
10333
10438
  if (transitionTimeout > 0) {
10334
- type = TRANSITION;
10439
+ type = TRANSITION$1;
10335
10440
  timeout = transitionTimeout;
10336
10441
  propCount = transitionDurations.length;
10337
10442
  }
@@ -10348,17 +10453,17 @@ function getTransitionInfo(el, expectedType) {
10348
10453
  type =
10349
10454
  timeout > 0
10350
10455
  ? transitionTimeout > animationTimeout
10351
- ? TRANSITION
10456
+ ? TRANSITION$1
10352
10457
  : ANIMATION
10353
10458
  : null;
10354
10459
  propCount = type
10355
- ? type === TRANSITION
10460
+ ? type === TRANSITION$1
10356
10461
  ? transitionDurations.length
10357
10462
  : animationDurations.length
10358
10463
  : 0;
10359
10464
  }
10360
- const hasTransform = type === TRANSITION &&
10361
- /\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
10465
+ const hasTransform = type === TRANSITION$1 &&
10466
+ /\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());
10362
10467
  return {
10363
10468
  type,
10364
10469
  timeout,
@@ -10443,7 +10548,7 @@ const TransitionGroupImpl = {
10443
10548
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10444
10549
  }
10445
10550
  else {
10446
- warn$1(`<TransitionGroup> children must be keyed.`);
10551
+ warn(`<TransitionGroup> children must be keyed.`);
10447
10552
  }
10448
10553
  }
10449
10554
  if (prevChildren) {
@@ -10457,6 +10562,14 @@ const TransitionGroupImpl = {
10457
10562
  };
10458
10563
  }
10459
10564
  };
10565
+ /**
10566
+ * TransitionGroup does not support "mode" so we need to remove it from the
10567
+ * props declarations, but direct delete operation is considered a side effect
10568
+ * and will make the entire transition feature non-tree-shakeable, so we do it
10569
+ * in a function and mark the function's invocation as pure.
10570
+ */
10571
+ const removeMode = (props) => delete props.mode;
10572
+ /*#__PURE__*/ removeMode(TransitionGroupImpl.props);
10460
10573
  const TransitionGroup = TransitionGroupImpl;
10461
10574
  function callPendingCbs(c) {
10462
10575
  const el = c.el;
@@ -10532,7 +10645,7 @@ const vModelText = {
10532
10645
  domValue = domValue.trim();
10533
10646
  }
10534
10647
  if (castToNumber) {
10535
- domValue = toNumber(domValue);
10648
+ domValue = looseToNumber(domValue);
10536
10649
  }
10537
10650
  el._assign(domValue);
10538
10651
  });
@@ -10567,7 +10680,8 @@ const vModelText = {
10567
10680
  if (trim && el.value.trim() === value) {
10568
10681
  return;
10569
10682
  }
10570
- if ((number || el.type === 'number') && toNumber(el.value) === value) {
10683
+ if ((number || el.type === 'number') &&
10684
+ looseToNumber(el.value) === value) {
10571
10685
  return;
10572
10686
  }
10573
10687
  }
@@ -10656,7 +10770,7 @@ const vModelSelect = {
10656
10770
  addEventListener(el, 'change', () => {
10657
10771
  const selectedVal = Array.prototype.filter
10658
10772
  .call(el.options, (o) => o.selected)
10659
- .map((o) => number ? toNumber(getValue(o)) : getValue(o));
10773
+ .map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
10660
10774
  el._assign(el.multiple
10661
10775
  ? isSetModel
10662
10776
  ? new Set(selectedVal)
@@ -10680,7 +10794,7 @@ const vModelSelect = {
10680
10794
  function setSelected(el, value) {
10681
10795
  const isMultiple = el.multiple;
10682
10796
  if (isMultiple && !isArray(value) && !isSet(value)) {
10683
- warn$1(`<select multiple v-model> expects an Array or Set value for its binding, ` +
10797
+ warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
10684
10798
  `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
10685
10799
  return;
10686
10800
  }
@@ -10933,7 +11047,7 @@ function injectCompilerOptionsCheck(app) {
10933
11047
  return isCustomElement;
10934
11048
  },
10935
11049
  set() {
10936
- warn$1(`The \`isCustomElement\` config option is deprecated. Use ` +
11050
+ warn(`The \`isCustomElement\` config option is deprecated. Use ` +
10937
11051
  `\`compilerOptions.isCustomElement\` instead.`);
10938
11052
  }
10939
11053
  });
@@ -10947,11 +11061,11 @@ function injectCompilerOptionsCheck(app) {
10947
11061
  `- 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`;
10948
11062
  Object.defineProperty(app.config, 'compilerOptions', {
10949
11063
  get() {
10950
- warn$1(msg);
11064
+ warn(msg);
10951
11065
  return compilerOptions;
10952
11066
  },
10953
11067
  set() {
10954
- warn$1(msg);
11068
+ warn(msg);
10955
11069
  }
10956
11070
  });
10957
11071
  }
@@ -10960,14 +11074,14 @@ function normalizeContainer(container) {
10960
11074
  if (isString(container)) {
10961
11075
  const res = document.querySelector(container);
10962
11076
  if (!res) {
10963
- warn$1(`Failed to mount app: mount target selector "${container}" returned null.`);
11077
+ warn(`Failed to mount app: mount target selector "${container}" returned null.`);
10964
11078
  }
10965
11079
  return res;
10966
11080
  }
10967
11081
  if (window.ShadowRoot &&
10968
11082
  container instanceof window.ShadowRoot &&
10969
11083
  container.mode === 'closed') {
10970
- warn$1(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
11084
+ warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
10971
11085
  }
10972
11086
  return container;
10973
11087
  }
@@ -10978,154 +11092,156 @@ const initDirectivesForSSR = NOOP;
10978
11092
 
10979
11093
  var runtimeDom = /*#__PURE__*/Object.freeze({
10980
11094
  __proto__: null,
10981
- render: render,
10982
- hydrate: hydrate,
11095
+ BaseTransition: BaseTransition,
11096
+ Comment: Comment,
11097
+ EffectScope: EffectScope,
11098
+ Fragment: Fragment,
11099
+ KeepAlive: KeepAlive,
11100
+ ReactiveEffect: ReactiveEffect,
11101
+ Static: Static,
11102
+ Suspense: Suspense,
11103
+ Teleport: Teleport,
11104
+ Text: Text,
11105
+ Transition: Transition,
11106
+ TransitionGroup: TransitionGroup,
11107
+ VueElement: VueElement,
11108
+ assertNumber: assertNumber,
11109
+ callWithAsyncErrorHandling: callWithAsyncErrorHandling,
11110
+ callWithErrorHandling: callWithErrorHandling,
11111
+ camelize: camelize,
11112
+ capitalize: capitalize,
11113
+ cloneVNode: cloneVNode,
11114
+ compatUtils: compatUtils,
11115
+ computed: computed,
10983
11116
  createApp: createApp,
11117
+ createBlock: createBlock,
11118
+ createCommentVNode: createCommentVNode,
11119
+ createElementBlock: createElementBlock,
11120
+ createElementVNode: createBaseVNode,
11121
+ createHydrationRenderer: createHydrationRenderer,
11122
+ createPropsRestProxy: createPropsRestProxy,
11123
+ createRenderer: createRenderer,
10984
11124
  createSSRApp: createSSRApp,
10985
- initDirectivesForSSR: initDirectivesForSSR,
11125
+ createSlots: createSlots,
11126
+ createStaticVNode: createStaticVNode,
11127
+ createTextVNode: createTextVNode,
11128
+ createVNode: createVNode,
11129
+ customRef: customRef,
11130
+ defineAsyncComponent: defineAsyncComponent,
11131
+ defineComponent: defineComponent,
10986
11132
  defineCustomElement: defineCustomElement,
11133
+ defineEmits: defineEmits,
11134
+ defineExpose: defineExpose,
11135
+ defineProps: defineProps,
10987
11136
  defineSSRCustomElement: defineSSRCustomElement,
10988
- VueElement: VueElement,
10989
- useCssModule: useCssModule,
10990
- useCssVars: useCssVars,
10991
- Transition: Transition,
10992
- TransitionGroup: TransitionGroup,
10993
- vModelText: vModelText,
10994
- vModelCheckbox: vModelCheckbox,
10995
- vModelRadio: vModelRadio,
10996
- vModelSelect: vModelSelect,
10997
- vModelDynamic: vModelDynamic,
10998
- withModifiers: withModifiers,
10999
- withKeys: withKeys,
11000
- vShow: vShow,
11001
- reactive: reactive,
11002
- ref: ref,
11003
- readonly: readonly,
11004
- unref: unref,
11005
- proxyRefs: proxyRefs,
11006
- isRef: isRef,
11007
- toRef: toRef,
11008
- toRefs: toRefs,
11137
+ get devtools () { return devtools; },
11138
+ effect: effect,
11139
+ effectScope: effectScope,
11140
+ getCurrentInstance: getCurrentInstance,
11141
+ getCurrentScope: getCurrentScope,
11142
+ getTransitionRawChildren: getTransitionRawChildren,
11143
+ guardReactiveProps: guardReactiveProps,
11144
+ h: h,
11145
+ handleError: handleError,
11146
+ hydrate: hydrate,
11147
+ initCustomFormatter: initCustomFormatter,
11148
+ initDirectivesForSSR: initDirectivesForSSR,
11149
+ inject: inject,
11150
+ isMemoSame: isMemoSame,
11009
11151
  isProxy: isProxy,
11010
11152
  isReactive: isReactive,
11011
11153
  isReadonly: isReadonly,
11154
+ isRef: isRef,
11155
+ isRuntimeOnly: isRuntimeOnly,
11012
11156
  isShallow: isShallow,
11013
- customRef: customRef,
11014
- triggerRef: triggerRef,
11015
- shallowRef: shallowRef,
11016
- shallowReactive: shallowReactive,
11017
- shallowReadonly: shallowReadonly,
11157
+ isVNode: isVNode,
11018
11158
  markRaw: markRaw,
11019
- toRaw: toRaw,
11020
- effect: effect,
11021
- stop: stop,
11022
- ReactiveEffect: ReactiveEffect,
11023
- effectScope: effectScope,
11024
- EffectScope: EffectScope,
11025
- getCurrentScope: getCurrentScope,
11026
- onScopeDispose: onScopeDispose,
11027
- computed: computed$1,
11028
- watch: watch,
11029
- watchEffect: watchEffect,
11030
- watchPostEffect: watchPostEffect,
11031
- watchSyncEffect: watchSyncEffect,
11159
+ mergeDefaults: mergeDefaults,
11160
+ mergeProps: mergeProps,
11161
+ nextTick: nextTick,
11162
+ normalizeClass: normalizeClass,
11163
+ normalizeProps: normalizeProps,
11164
+ normalizeStyle: normalizeStyle,
11165
+ onActivated: onActivated,
11032
11166
  onBeforeMount: onBeforeMount,
11033
- onMounted: onMounted,
11034
- onBeforeUpdate: onBeforeUpdate,
11035
- onUpdated: onUpdated,
11036
11167
  onBeforeUnmount: onBeforeUnmount,
11037
- onUnmounted: onUnmounted,
11038
- onActivated: onActivated,
11168
+ onBeforeUpdate: onBeforeUpdate,
11039
11169
  onDeactivated: onDeactivated,
11170
+ onErrorCaptured: onErrorCaptured,
11171
+ onMounted: onMounted,
11040
11172
  onRenderTracked: onRenderTracked,
11041
11173
  onRenderTriggered: onRenderTriggered,
11042
- onErrorCaptured: onErrorCaptured,
11174
+ onScopeDispose: onScopeDispose,
11043
11175
  onServerPrefetch: onServerPrefetch,
11176
+ onUnmounted: onUnmounted,
11177
+ onUpdated: onUpdated,
11178
+ openBlock: openBlock,
11179
+ popScopeId: popScopeId,
11044
11180
  provide: provide,
11045
- inject: inject,
11046
- nextTick: nextTick,
11047
- defineComponent: defineComponent,
11048
- defineAsyncComponent: defineAsyncComponent,
11049
- useAttrs: useAttrs,
11050
- useSlots: useSlots,
11051
- defineProps: defineProps,
11052
- defineEmits: defineEmits,
11053
- defineExpose: defineExpose,
11054
- withDefaults: withDefaults,
11055
- mergeDefaults: mergeDefaults,
11056
- createPropsRestProxy: createPropsRestProxy,
11057
- withAsyncContext: withAsyncContext,
11058
- getCurrentInstance: getCurrentInstance,
11059
- h: h,
11060
- createVNode: createVNode,
11061
- cloneVNode: cloneVNode,
11062
- mergeProps: mergeProps,
11063
- isVNode: isVNode,
11064
- Fragment: Fragment,
11065
- Text: Text,
11066
- Comment: Comment,
11067
- Static: Static,
11068
- Teleport: Teleport,
11069
- Suspense: Suspense,
11070
- KeepAlive: KeepAlive,
11071
- BaseTransition: BaseTransition,
11072
- withDirectives: withDirectives,
11073
- useSSRContext: useSSRContext,
11074
- ssrContextKey: ssrContextKey,
11075
- createRenderer: createRenderer,
11076
- createHydrationRenderer: createHydrationRenderer,
11181
+ proxyRefs: proxyRefs,
11182
+ pushScopeId: pushScopeId,
11077
11183
  queuePostFlushCb: queuePostFlushCb,
11078
- warn: warn$1,
11079
- handleError: handleError,
11080
- callWithErrorHandling: callWithErrorHandling,
11081
- callWithAsyncErrorHandling: callWithAsyncErrorHandling,
11184
+ reactive: reactive,
11185
+ readonly: readonly,
11186
+ ref: ref,
11187
+ registerRuntimeCompiler: registerRuntimeCompiler,
11188
+ render: render,
11189
+ renderList: renderList,
11190
+ renderSlot: renderSlot,
11082
11191
  resolveComponent: resolveComponent,
11083
11192
  resolveDirective: resolveDirective,
11084
11193
  resolveDynamicComponent: resolveDynamicComponent,
11085
- registerRuntimeCompiler: registerRuntimeCompiler,
11086
- isRuntimeOnly: isRuntimeOnly,
11087
- useTransitionState: useTransitionState,
11194
+ resolveFilter: resolveFilter,
11088
11195
  resolveTransitionHooks: resolveTransitionHooks,
11089
- setTransitionHooks: setTransitionHooks,
11090
- getTransitionRawChildren: getTransitionRawChildren,
11091
- initCustomFormatter: initCustomFormatter,
11092
- get devtools () { return devtools; },
11093
- setDevtoolsHook: setDevtoolsHook,
11094
- withCtx: withCtx,
11095
- pushScopeId: pushScopeId,
11096
- popScopeId: popScopeId,
11097
- withScopeId: withScopeId,
11098
- renderList: renderList,
11099
- toHandlers: toHandlers,
11100
- renderSlot: renderSlot,
11101
- createSlots: createSlots,
11102
- withMemo: withMemo,
11103
- isMemoSame: isMemoSame,
11104
- openBlock: openBlock,
11105
- createBlock: createBlock,
11106
11196
  setBlockTracking: setBlockTracking,
11107
- createTextVNode: createTextVNode,
11108
- createCommentVNode: createCommentVNode,
11109
- createStaticVNode: createStaticVNode,
11110
- createElementVNode: createBaseVNode,
11111
- createElementBlock: createElementBlock,
11112
- guardReactiveProps: guardReactiveProps,
11197
+ setDevtoolsHook: setDevtoolsHook,
11198
+ setTransitionHooks: setTransitionHooks,
11199
+ shallowReactive: shallowReactive,
11200
+ shallowReadonly: shallowReadonly,
11201
+ shallowRef: shallowRef,
11202
+ ssrContextKey: ssrContextKey,
11203
+ ssrUtils: ssrUtils,
11204
+ stop: stop,
11113
11205
  toDisplayString: toDisplayString,
11114
- camelize: camelize,
11115
- capitalize: capitalize,
11116
11206
  toHandlerKey: toHandlerKey,
11117
- normalizeProps: normalizeProps,
11118
- normalizeClass: normalizeClass,
11119
- normalizeStyle: normalizeStyle,
11207
+ toHandlers: toHandlers,
11208
+ toRaw: toRaw,
11209
+ toRef: toRef,
11210
+ toRefs: toRefs,
11120
11211
  transformVNodeArgs: transformVNodeArgs,
11212
+ triggerRef: triggerRef,
11213
+ unref: unref,
11214
+ useAttrs: useAttrs,
11215
+ useCssModule: useCssModule,
11216
+ useCssVars: useCssVars,
11217
+ useSSRContext: useSSRContext,
11218
+ useSlots: useSlots,
11219
+ useTransitionState: useTransitionState,
11220
+ vModelCheckbox: vModelCheckbox,
11221
+ vModelDynamic: vModelDynamic,
11222
+ vModelRadio: vModelRadio,
11223
+ vModelSelect: vModelSelect,
11224
+ vModelText: vModelText,
11225
+ vShow: vShow,
11121
11226
  version: version,
11122
- ssrUtils: ssrUtils,
11123
- resolveFilter: resolveFilter,
11124
- compatUtils: compatUtils
11227
+ warn: warn,
11228
+ watch: watch,
11229
+ watchEffect: watchEffect,
11230
+ watchPostEffect: watchPostEffect,
11231
+ watchSyncEffect: watchSyncEffect,
11232
+ withAsyncContext: withAsyncContext,
11233
+ withCtx: withCtx,
11234
+ withDefaults: withDefaults,
11235
+ withDirectives: withDirectives,
11236
+ withKeys: withKeys,
11237
+ withMemo: withMemo,
11238
+ withModifiers: withModifiers,
11239
+ withScopeId: withScopeId
11125
11240
  });
11126
11241
 
11127
11242
  function initDev() {
11128
11243
  {
11244
+ /* istanbul ignore if */
11129
11245
  {
11130
11246
  console.info(`You are running a development build of Vue.\n` +
11131
11247
  `Make sure to use the production build (*.prod.js) when deploying for production.`);
@@ -11190,7 +11306,7 @@ const errorMessages = {
11190
11306
  [34 /* ErrorCodes.X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
11191
11307
  [35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
11192
11308
  [36 /* ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
11193
- [37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>.` +
11309
+ [37 /* ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>. ` +
11194
11310
  `When there are multiple named slots, all slots should use <template> ` +
11195
11311
  `syntax to avoid scope ambiguity.`,
11196
11312
  [38 /* ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
@@ -11200,15 +11316,16 @@ const errorMessages = {
11200
11316
  [41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
11201
11317
  [42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
11202
11318
  [43 /* ErrorCodes.X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
11203
- [44 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
11204
- [45 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
11319
+ [44 /* ErrorCodes.X_V_MODEL_ON_PROPS */]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
11320
+ [45 /* ErrorCodes.X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
11321
+ [46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
11205
11322
  // generic errors
11206
- [46 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
11207
- [47 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
11208
- [48 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
11209
- [49 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
11323
+ [47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
11324
+ [48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
11325
+ [49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
11326
+ [50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
11210
11327
  // just to fulfill types
11211
- [50 /* ErrorCodes.__EXTEND_POINT__ */]: ``
11328
+ [51 /* ErrorCodes.__EXTEND_POINT__ */]: ``
11212
11329
  };
11213
11330
 
11214
11331
  const FRAGMENT = Symbol(`Fragment` );
@@ -11312,7 +11429,7 @@ function createRoot(children, loc = locStub) {
11312
11429
  return {
11313
11430
  type: 0 /* NodeTypes.ROOT */,
11314
11431
  children,
11315
- helpers: [],
11432
+ helpers: new Set(),
11316
11433
  components: [],
11317
11434
  directives: [],
11318
11435
  hoists: [],
@@ -11610,7 +11727,7 @@ function hasDynamicKeyVBind(node) {
11610
11727
  !p.arg.isStatic) // v-bind:[foo]
11611
11728
  );
11612
11729
  }
11613
- function isText(node) {
11730
+ function isText$1(node) {
11614
11731
  return node.type === 5 /* NodeTypes.INTERPOLATION */ || node.type === 2 /* NodeTypes.TEXT */;
11615
11732
  }
11616
11733
  function isVSlot(p) {
@@ -13034,7 +13151,7 @@ function transform(root, options) {
13034
13151
  createRootCodegen(root, context);
13035
13152
  }
13036
13153
  // finalize meta information
13037
- root.helpers = [...context.helpers.keys()];
13154
+ root.helpers = new Set([...context.helpers.keys()]);
13038
13155
  root.components = [...context.components];
13039
13156
  root.directives = [...context.directives];
13040
13157
  root.imports = context.imports;
@@ -13237,12 +13354,16 @@ function generate(ast, options = {}) {
13237
13354
  if (options.onContextCreated)
13238
13355
  options.onContextCreated(context);
13239
13356
  const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
13240
- const hasHelpers = ast.helpers.length > 0;
13357
+ const helpers = Array.from(ast.helpers);
13358
+ const hasHelpers = helpers.length > 0;
13241
13359
  const useWithBlock = !prefixIdentifiers && mode !== 'module';
13360
+ const isSetupInlined = !true ;
13242
13361
  // preambles
13243
13362
  // in setup() inline mode, the preamble is generated in a sub context
13244
13363
  // and returned separately.
13245
- const preambleContext = context;
13364
+ const preambleContext = isSetupInlined
13365
+ ? createCodegenContext(ast, options)
13366
+ : context;
13246
13367
  {
13247
13368
  genFunctionPreamble(ast, preambleContext);
13248
13369
  }
@@ -13260,7 +13381,7 @@ function generate(ast, options = {}) {
13260
13381
  // function mode const declarations should be inside with block
13261
13382
  // also they should be renamed to avoid collision with user properties
13262
13383
  if (hasHelpers) {
13263
- push(`const { ${ast.helpers.map(aliasHelper).join(', ')} } = _Vue`);
13384
+ push(`const { ${helpers.map(aliasHelper).join(', ')} } = _Vue`);
13264
13385
  push(`\n`);
13265
13386
  newline();
13266
13387
  }
@@ -13307,7 +13428,7 @@ function generate(ast, options = {}) {
13307
13428
  return {
13308
13429
  ast,
13309
13430
  code: context.code,
13310
- preamble: ``,
13431
+ preamble: isSetupInlined ? preambleContext.code : ``,
13311
13432
  // SourceMapGenerator does have toJSON() method but it's not in the types
13312
13433
  map: context.map ? context.map.toJSON() : undefined
13313
13434
  };
@@ -13319,7 +13440,8 @@ function genFunctionPreamble(ast, context) {
13319
13440
  // In prefix mode, we place the const declaration at top so it's done
13320
13441
  // only once; But if we not prefixing, we place the declaration inside the
13321
13442
  // with block so it doesn't incur the `in` check cost for every helper access.
13322
- if (ast.helpers.length > 0) {
13443
+ const helpers = Array.from(ast.helpers);
13444
+ if (helpers.length > 0) {
13323
13445
  {
13324
13446
  // "with" mode.
13325
13447
  // save Vue in a separate variable to avoid collision
@@ -13335,7 +13457,7 @@ function genFunctionPreamble(ast, context) {
13335
13457
  CREATE_TEXT,
13336
13458
  CREATE_STATIC
13337
13459
  ]
13338
- .filter(helper => ast.helpers.includes(helper))
13460
+ .filter(helper => helpers.includes(helper))
13339
13461
  .map(aliasHelper)
13340
13462
  .join(', ');
13341
13463
  push(`const { ${staticHelpers} } = _Vue\n`);
@@ -13380,7 +13502,7 @@ function genHoists(hoists, context) {
13380
13502
  }
13381
13503
  context.pure = false;
13382
13504
  }
13383
- function isText$1(n) {
13505
+ function isText(n) {
13384
13506
  return (isString(n) ||
13385
13507
  n.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ||
13386
13508
  n.type === 2 /* NodeTypes.TEXT */ ||
@@ -13389,7 +13511,7 @@ function isText$1(n) {
13389
13511
  }
13390
13512
  function genNodeListAsArray(nodes, context) {
13391
13513
  const multilines = nodes.length > 3 ||
13392
- (nodes.some(n => isArray(n) || !isText$1(n)));
13514
+ (nodes.some(n => isArray(n) || !isText(n)));
13393
13515
  context.push(`[`);
13394
13516
  multilines && context.indent();
13395
13517
  genNodeList(nodes, context, multilines);
@@ -13726,11 +13848,11 @@ function genCacheExpression(node, context) {
13726
13848
  }
13727
13849
 
13728
13850
  // these keywords should not appear inside expressions, but operators like
13729
- // typeof, instanceof and in are allowed
13851
+ // 'typeof', 'instanceof', and 'in' are allowed
13730
13852
  const prohibitedKeywordRE = new RegExp('\\b' +
13731
- ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
13732
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
13733
- 'extends,finally,continue,debugger,function,arguments,typeof,void')
13853
+ ('arguments,await,break,case,catch,class,const,continue,debugger,default,' +
13854
+ 'delete,do,else,export,extends,finally,for,function,if,import,let,new,' +
13855
+ 'return,super,switch,throw,try,var,void,while,with,yield')
13734
13856
  .split(',')
13735
13857
  .join('\\b|\\b') +
13736
13858
  '\\b');
@@ -13761,7 +13883,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
13761
13883
  if (keywordMatch) {
13762
13884
  message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
13763
13885
  }
13764
- context.onError(createCompilerError(44 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
13886
+ context.onError(createCompilerError(45 /* ErrorCodes.X_INVALID_EXPRESSION */, node.loc, undefined, message));
13765
13887
  }
13766
13888
  }
13767
13889
 
@@ -14552,7 +14674,7 @@ const transformElement = (node, context) => {
14552
14674
  // 2. Force keep-alive to always be updated, since it uses raw children.
14553
14675
  patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
14554
14676
  if (node.children.length > 1) {
14555
- context.onError(createCompilerError(45 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
14677
+ context.onError(createCompilerError(46 /* ErrorCodes.X_KEEP_ALIVE_INVALID_CHILDREN */, {
14556
14678
  start: node.children[0].loc.start,
14557
14679
  end: node.children[node.children.length - 1].loc.end,
14558
14680
  source: ''
@@ -14979,7 +15101,7 @@ function dedupeProperties(properties) {
14979
15101
  const existing = knownProps.get(name);
14980
15102
  if (existing) {
14981
15103
  if (name === 'style' || name === 'class' || isOn(name)) {
14982
- mergeAsArray$1(existing, prop);
15104
+ mergeAsArray(existing, prop);
14983
15105
  }
14984
15106
  // unexpected duplicate, should have emitted error during parse
14985
15107
  }
@@ -14990,7 +15112,7 @@ function dedupeProperties(properties) {
14990
15112
  }
14991
15113
  return deduped;
14992
15114
  }
14993
- function mergeAsArray$1(existing, incoming) {
15115
+ function mergeAsArray(existing, incoming) {
14994
15116
  if (existing.value.type === 17 /* NodeTypes.JS_ARRAY_EXPRESSION */) {
14995
15117
  existing.value.elements.push(incoming.value);
14996
15118
  }
@@ -15118,7 +15240,7 @@ function processSlotOutlet(node, context) {
15118
15240
  }
15119
15241
 
15120
15242
  const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15121
- const transformOn = (dir, node, context, augmentor) => {
15243
+ const transformOn$1 = (dir, node, context, augmentor) => {
15122
15244
  const { loc, modifiers, arg } = dir;
15123
15245
  if (!dir.exp && !modifiers.length) {
15124
15246
  context.onError(createCompilerError(35 /* ErrorCodes.X_V_ON_NO_EXPRESSION */, loc));
@@ -15278,11 +15400,11 @@ const transformText = (node, context) => {
15278
15400
  let hasText = false;
15279
15401
  for (let i = 0; i < children.length; i++) {
15280
15402
  const child = children[i];
15281
- if (isText(child)) {
15403
+ if (isText$1(child)) {
15282
15404
  hasText = true;
15283
15405
  for (let j = i + 1; j < children.length; j++) {
15284
15406
  const next = children[j];
15285
- if (isText(next)) {
15407
+ if (isText$1(next)) {
15286
15408
  if (!currentContainer) {
15287
15409
  currentContainer = children[i] = createCompoundExpression([child], child.loc);
15288
15410
  }
@@ -15324,7 +15446,7 @@ const transformText = (node, context) => {
15324
15446
  // runtime normalization.
15325
15447
  for (let i = 0; i < children.length; i++) {
15326
15448
  const child = children[i];
15327
- if (isText(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
15449
+ if (isText$1(child) || child.type === 8 /* NodeTypes.COMPOUND_EXPRESSION */) {
15328
15450
  const callArgs = [];
15329
15451
  // createTextVNode defaults to single whitespace, so if it is a
15330
15452
  // single space the code could be an empty call to save bytes.
@@ -15349,13 +15471,13 @@ const transformText = (node, context) => {
15349
15471
  }
15350
15472
  };
15351
15473
 
15352
- const seen = new WeakSet();
15474
+ const seen$1 = new WeakSet();
15353
15475
  const transformOnce = (node, context) => {
15354
15476
  if (node.type === 1 /* NodeTypes.ELEMENT */ && findDir(node, 'once', true)) {
15355
- if (seen.has(node) || context.inVOnce) {
15477
+ if (seen$1.has(node) || context.inVOnce) {
15356
15478
  return;
15357
15479
  }
15358
- seen.add(node);
15480
+ seen$1.add(node);
15359
15481
  context.inVOnce = true;
15360
15482
  context.helper(SET_BLOCK_TRACKING);
15361
15483
  return () => {
@@ -15368,7 +15490,7 @@ const transformOnce = (node, context) => {
15368
15490
  }
15369
15491
  };
15370
15492
 
15371
- const transformModel = (dir, node, context) => {
15493
+ const transformModel$1 = (dir, node, context) => {
15372
15494
  const { exp, arg } = dir;
15373
15495
  if (!exp) {
15374
15496
  context.onError(createCompilerError(41 /* ErrorCodes.X_V_MODEL_NO_EXPRESSION */, dir.loc));
@@ -15378,8 +15500,14 @@ const transformModel = (dir, node, context) => {
15378
15500
  const expString = exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ ? exp.content : rawExp;
15379
15501
  // im SFC <script setup> inline mode, the exp may have been transformed into
15380
15502
  // _unref(exp)
15381
- context.bindingMetadata[rawExp];
15382
- const maybeRef = !true /* BindingTypes.SETUP_CONST */;
15503
+ const bindingType = context.bindingMetadata[rawExp];
15504
+ // check props
15505
+ if (bindingType === "props" /* BindingTypes.PROPS */ ||
15506
+ bindingType === "props-aliased" /* BindingTypes.PROPS_ALIASED */) {
15507
+ context.onError(createCompilerError(44 /* ErrorCodes.X_V_MODEL_ON_PROPS */, exp.loc));
15508
+ return createTransformProps();
15509
+ }
15510
+ const maybeRef = !true ;
15383
15511
  if (!expString.trim() ||
15384
15512
  (!isMemberExpression(expString) && !maybeRef)) {
15385
15513
  context.onError(createCompilerError(42 /* ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
@@ -15388,7 +15516,7 @@ const transformModel = (dir, node, context) => {
15388
15516
  const propName = arg ? arg : createSimpleExpression('modelValue', true);
15389
15517
  const eventName = arg
15390
15518
  ? isStaticExp(arg)
15391
- ? `onUpdate:${arg.content}`
15519
+ ? `onUpdate:${camelize(arg.content)}`
15392
15520
  : createCompoundExpression(['"onUpdate:" + ', arg])
15393
15521
  : `onUpdate:modelValue`;
15394
15522
  let assignmentExp;
@@ -15424,14 +15552,14 @@ function createTransformProps(props = []) {
15424
15552
  return { props };
15425
15553
  }
15426
15554
 
15427
- const seen$1 = new WeakSet();
15555
+ const seen = new WeakSet();
15428
15556
  const transformMemo = (node, context) => {
15429
15557
  if (node.type === 1 /* NodeTypes.ELEMENT */) {
15430
15558
  const dir = findDir(node, 'memo');
15431
- if (!dir || seen$1.has(node)) {
15559
+ if (!dir || seen.has(node)) {
15432
15560
  return;
15433
15561
  }
15434
- seen$1.add(node);
15562
+ seen.add(node);
15435
15563
  return () => {
15436
15564
  const codegenNode = node.codegenNode ||
15437
15565
  context.currentNode.codegenNode;
@@ -15467,9 +15595,9 @@ function getBaseTransformPreset(prefixIdentifiers) {
15467
15595
  transformText
15468
15596
  ],
15469
15597
  {
15470
- on: transformOn,
15598
+ on: transformOn$1,
15471
15599
  bind: transformBind,
15472
- model: transformModel
15600
+ model: transformModel$1
15473
15601
  }
15474
15602
  ];
15475
15603
  }
@@ -15481,18 +15609,18 @@ function baseCompile(template, options = {}) {
15481
15609
  /* istanbul ignore if */
15482
15610
  {
15483
15611
  if (options.prefixIdentifiers === true) {
15484
- onError(createCompilerError(46 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
15612
+ onError(createCompilerError(47 /* ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED */));
15485
15613
  }
15486
15614
  else if (isModuleMode) {
15487
- onError(createCompilerError(47 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
15615
+ onError(createCompilerError(48 /* ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED */));
15488
15616
  }
15489
15617
  }
15490
15618
  const prefixIdentifiers = !true ;
15491
15619
  if (options.cacheHandlers) {
15492
- onError(createCompilerError(48 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
15620
+ onError(createCompilerError(49 /* ErrorCodes.X_CACHE_HANDLER_NOT_SUPPORTED */));
15493
15621
  }
15494
15622
  if (options.scopeId && !isModuleMode) {
15495
- onError(createCompilerError(49 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
15623
+ onError(createCompilerError(50 /* ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED */));
15496
15624
  }
15497
15625
  const ast = isString(template) ? baseParse(template, options) : template;
15498
15626
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
@@ -15520,7 +15648,7 @@ const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
15520
15648
  const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
15521
15649
  const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
15522
15650
  const V_SHOW = Symbol(`vShow` );
15523
- const TRANSITION$1 = Symbol(`Transition` );
15651
+ const TRANSITION = Symbol(`Transition` );
15524
15652
  const TRANSITION_GROUP = Symbol(`TransitionGroup` );
15525
15653
  registerRuntimeHelpers({
15526
15654
  [V_MODEL_RADIO]: `vModelRadio`,
@@ -15531,7 +15659,7 @@ registerRuntimeHelpers({
15531
15659
  [V_ON_WITH_MODIFIERS]: `withModifiers`,
15532
15660
  [V_ON_WITH_KEYS]: `withKeys`,
15533
15661
  [V_SHOW]: `vShow`,
15534
- [TRANSITION$1]: `Transition`,
15662
+ [TRANSITION]: `Transition`,
15535
15663
  [TRANSITION_GROUP]: `TransitionGroup`
15536
15664
  });
15537
15665
 
@@ -15559,7 +15687,7 @@ const parserOptions = {
15559
15687
  decodeEntities: decodeHtmlBrowser ,
15560
15688
  isBuiltInComponent: (tag) => {
15561
15689
  if (isBuiltInType(tag, `Transition`)) {
15562
- return TRANSITION$1;
15690
+ return TRANSITION;
15563
15691
  }
15564
15692
  else if (isBuiltInType(tag, `TransitionGroup`)) {
15565
15693
  return TRANSITION_GROUP;
@@ -15650,26 +15778,26 @@ function createDOMCompilerError(code, loc) {
15650
15778
  return createCompilerError(code, loc, DOMErrorMessages );
15651
15779
  }
15652
15780
  const DOMErrorMessages = {
15653
- [50 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
15654
- [51 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
15655
- [52 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
15656
- [53 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
15657
- [54 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
15658
- [55 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
15659
- [56 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
15660
- [57 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
15661
- [58 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
15662
- [59 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
15663
- [60 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
15781
+ [51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
15782
+ [52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
15783
+ [53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
15784
+ [54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
15785
+ [55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
15786
+ [56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
15787
+ [57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
15788
+ [58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
15789
+ [59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
15790
+ [60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
15791
+ [61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
15664
15792
  };
15665
15793
 
15666
15794
  const transformVHtml = (dir, node, context) => {
15667
15795
  const { exp, loc } = dir;
15668
15796
  if (!exp) {
15669
- context.onError(createDOMCompilerError(50 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
15797
+ context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_NO_EXPRESSION */, loc));
15670
15798
  }
15671
15799
  if (node.children.length) {
15672
- context.onError(createDOMCompilerError(51 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
15800
+ context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_HTML_WITH_CHILDREN */, loc));
15673
15801
  node.children.length = 0;
15674
15802
  }
15675
15803
  return {
@@ -15682,10 +15810,10 @@ const transformVHtml = (dir, node, context) => {
15682
15810
  const transformVText = (dir, node, context) => {
15683
15811
  const { exp, loc } = dir;
15684
15812
  if (!exp) {
15685
- context.onError(createDOMCompilerError(52 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
15813
+ context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_NO_EXPRESSION */, loc));
15686
15814
  }
15687
15815
  if (node.children.length) {
15688
- context.onError(createDOMCompilerError(53 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
15816
+ context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_TEXT_WITH_CHILDREN */, loc));
15689
15817
  node.children.length = 0;
15690
15818
  }
15691
15819
  return {
@@ -15699,19 +15827,19 @@ const transformVText = (dir, node, context) => {
15699
15827
  };
15700
15828
  };
15701
15829
 
15702
- const transformModel$1 = (dir, node, context) => {
15703
- const baseResult = transformModel(dir, node, context);
15830
+ const transformModel = (dir, node, context) => {
15831
+ const baseResult = transformModel$1(dir, node, context);
15704
15832
  // base transform has errors OR component v-model (only need props)
15705
15833
  if (!baseResult.props.length || node.tagType === 1 /* ElementTypes.COMPONENT */) {
15706
15834
  return baseResult;
15707
15835
  }
15708
15836
  if (dir.arg) {
15709
- context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
15837
+ context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
15710
15838
  }
15711
15839
  function checkDuplicatedValue() {
15712
15840
  const value = findProp(node, 'value');
15713
15841
  if (value) {
15714
- context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
15842
+ context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
15715
15843
  }
15716
15844
  }
15717
15845
  const { tag } = node;
@@ -15739,7 +15867,7 @@ const transformModel$1 = (dir, node, context) => {
15739
15867
  break;
15740
15868
  case 'file':
15741
15869
  isInvalidType = true;
15742
- context.onError(createDOMCompilerError(56 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
15870
+ context.onError(createDOMCompilerError(57 /* DOMErrorCodes.X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
15743
15871
  break;
15744
15872
  default:
15745
15873
  // text type
@@ -15773,7 +15901,7 @@ const transformModel$1 = (dir, node, context) => {
15773
15901
  }
15774
15902
  }
15775
15903
  else {
15776
- context.onError(createDOMCompilerError(54 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
15904
+ context.onError(createDOMCompilerError(55 /* DOMErrorCodes.X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
15777
15905
  }
15778
15906
  // native vmodel doesn't need the `modelValue` props since they are also
15779
15907
  // passed to the runtime as `binding.value`. removing it reduces code size.
@@ -15850,8 +15978,8 @@ const transformClick = (key, event) => {
15850
15978
  ])
15851
15979
  : key;
15852
15980
  };
15853
- const transformOn$1 = (dir, node, context) => {
15854
- return transformOn(dir, node, context, baseResult => {
15981
+ const transformOn = (dir, node, context) => {
15982
+ return transformOn$1(dir, node, context, baseResult => {
15855
15983
  const { modifiers } = dir;
15856
15984
  if (!modifiers.length)
15857
15985
  return baseResult;
@@ -15893,7 +16021,7 @@ const transformOn$1 = (dir, node, context) => {
15893
16021
  const transformShow = (dir, node, context) => {
15894
16022
  const { exp, loc } = dir;
15895
16023
  if (!exp) {
15896
- context.onError(createDOMCompilerError(58 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
16024
+ context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_V_SHOW_NO_EXPRESSION */, loc));
15897
16025
  }
15898
16026
  return {
15899
16027
  props: [],
@@ -15905,14 +16033,14 @@ const transformTransition = (node, context) => {
15905
16033
  if (node.type === 1 /* NodeTypes.ELEMENT */ &&
15906
16034
  node.tagType === 1 /* ElementTypes.COMPONENT */) {
15907
16035
  const component = context.isBuiltInComponent(node.tag);
15908
- if (component === TRANSITION$1) {
16036
+ if (component === TRANSITION) {
15909
16037
  return () => {
15910
16038
  if (!node.children.length) {
15911
16039
  return;
15912
16040
  }
15913
16041
  // warn multiple transition children
15914
16042
  if (hasMultipleChildren(node)) {
15915
- context.onError(createDOMCompilerError(59 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
16043
+ context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_TRANSITION_INVALID_CHILDREN */, {
15916
16044
  start: node.children[0].loc.start,
15917
16045
  end: node.children[node.children.length - 1].loc.end,
15918
16046
  source: ''
@@ -15951,7 +16079,7 @@ const ignoreSideEffectTags = (node, context) => {
15951
16079
  if (node.type === 1 /* NodeTypes.ELEMENT */ &&
15952
16080
  node.tagType === 0 /* ElementTypes.ELEMENT */ &&
15953
16081
  (node.tag === 'script' || node.tag === 'style')) {
15954
- context.onError(createDOMCompilerError(60 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
16082
+ context.onError(createDOMCompilerError(61 /* DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
15955
16083
  context.removeNode();
15956
16084
  }
15957
16085
  };
@@ -15964,11 +16092,11 @@ const DOMDirectiveTransforms = {
15964
16092
  cloak: noopDirectiveTransform,
15965
16093
  html: transformVHtml,
15966
16094
  text: transformVText,
15967
- model: transformModel$1,
15968
- on: transformOn$1,
16095
+ model: transformModel,
16096
+ on: transformOn,
15969
16097
  show: transformShow
15970
16098
  };
15971
- function compile$1(template, options = {}) {
16099
+ function compile(template, options = {}) {
15972
16100
  return baseCompile(template, extend({}, parserOptions, options, {
15973
16101
  nodeTransforms: [
15974
16102
  // ignore <script> and <tag>
@@ -15994,7 +16122,7 @@ function compileToFunction(template, options) {
15994
16122
  template = template.innerHTML;
15995
16123
  }
15996
16124
  else {
15997
- warn$1(`invalid template option: `, template);
16125
+ warn(`invalid template option: `, template);
15998
16126
  return NOOP;
15999
16127
  }
16000
16128
  }
@@ -16006,7 +16134,7 @@ function compileToFunction(template, options) {
16006
16134
  if (template[0] === '#') {
16007
16135
  const el = document.querySelector(template);
16008
16136
  if (!el) {
16009
- warn$1(`Template element not found or is empty: ${template}`);
16137
+ warn(`Template element not found or is empty: ${template}`);
16010
16138
  }
16011
16139
  // __UNSAFE__
16012
16140
  // Reason: potential execution of JS expressions in in-DOM template.
@@ -16022,14 +16150,14 @@ function compileToFunction(template, options) {
16022
16150
  if (!opts.isCustomElement && typeof customElements !== 'undefined') {
16023
16151
  opts.isCustomElement = tag => !!customElements.get(tag);
16024
16152
  }
16025
- const { code } = compile$1(template, opts);
16153
+ const { code } = compile(template, opts);
16026
16154
  function onError(err, asWarning = false) {
16027
16155
  const message = asWarning
16028
16156
  ? err.message
16029
16157
  : `Template compilation error: ${err.message}`;
16030
16158
  const codeFrame = err.loc &&
16031
16159
  generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
16032
- warn$1(codeFrame ? `${message}\n${codeFrame}` : message);
16160
+ warn(codeFrame ? `${message}\n${codeFrame}` : message);
16033
16161
  }
16034
16162
  // The wildcard import results in a huge object with every export
16035
16163
  // with keys that cannot be mangled, and can be quite heavy size-wise.
@@ -16041,4 +16169,4 @@ function compileToFunction(template, options) {
16041
16169
  }
16042
16170
  registerRuntimeCompiler(compileToFunction);
16043
16171
 
16044
- export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, 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 };
16172
+ export { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, 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 };