@vue/runtime-core 3.2.36 → 3.2.39

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.
@@ -20,7 +20,7 @@ function warn(msg, ...args) {
20
20
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
21
21
  const trace = getComponentTrace();
22
22
  if (appWarnHandler) {
23
- callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
23
+ callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
24
24
  msg + args.join(''),
25
25
  instance && instance.proxy,
26
26
  trace
@@ -120,35 +120,35 @@ function formatProp(key, value, raw) {
120
120
  }
121
121
 
122
122
  const ErrorTypeStrings = {
123
- ["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook',
124
- ["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
125
- ["c" /* CREATED */]: 'created hook',
126
- ["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
127
- ["m" /* MOUNTED */]: 'mounted hook',
128
- ["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
129
- ["u" /* UPDATED */]: 'updated',
130
- ["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
131
- ["um" /* UNMOUNTED */]: 'unmounted hook',
132
- ["a" /* ACTIVATED */]: 'activated hook',
133
- ["da" /* DEACTIVATED */]: 'deactivated hook',
134
- ["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
135
- ["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
136
- ["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
137
- [0 /* SETUP_FUNCTION */]: 'setup function',
138
- [1 /* RENDER_FUNCTION */]: 'render function',
139
- [2 /* WATCH_GETTER */]: 'watcher getter',
140
- [3 /* WATCH_CALLBACK */]: 'watcher callback',
141
- [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
142
- [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
143
- [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
144
- [7 /* VNODE_HOOK */]: 'vnode hook',
145
- [8 /* DIRECTIVE_HOOK */]: 'directive hook',
146
- [9 /* TRANSITION_HOOK */]: 'transition hook',
147
- [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
148
- [11 /* APP_WARN_HANDLER */]: 'app warnHandler',
149
- [12 /* FUNCTION_REF */]: 'ref function',
150
- [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
151
- [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
123
+ ["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
124
+ ["bc" /* LifecycleHooks.BEFORE_CREATE */]: 'beforeCreate hook',
125
+ ["c" /* LifecycleHooks.CREATED */]: 'created hook',
126
+ ["bm" /* LifecycleHooks.BEFORE_MOUNT */]: 'beforeMount hook',
127
+ ["m" /* LifecycleHooks.MOUNTED */]: 'mounted hook',
128
+ ["bu" /* LifecycleHooks.BEFORE_UPDATE */]: 'beforeUpdate hook',
129
+ ["u" /* LifecycleHooks.UPDATED */]: 'updated',
130
+ ["bum" /* LifecycleHooks.BEFORE_UNMOUNT */]: 'beforeUnmount hook',
131
+ ["um" /* LifecycleHooks.UNMOUNTED */]: 'unmounted hook',
132
+ ["a" /* LifecycleHooks.ACTIVATED */]: 'activated hook',
133
+ ["da" /* LifecycleHooks.DEACTIVATED */]: 'deactivated hook',
134
+ ["ec" /* LifecycleHooks.ERROR_CAPTURED */]: 'errorCaptured hook',
135
+ ["rtc" /* LifecycleHooks.RENDER_TRACKED */]: 'renderTracked hook',
136
+ ["rtg" /* LifecycleHooks.RENDER_TRIGGERED */]: 'renderTriggered hook',
137
+ [0 /* ErrorCodes.SETUP_FUNCTION */]: 'setup function',
138
+ [1 /* ErrorCodes.RENDER_FUNCTION */]: 'render function',
139
+ [2 /* ErrorCodes.WATCH_GETTER */]: 'watcher getter',
140
+ [3 /* ErrorCodes.WATCH_CALLBACK */]: 'watcher callback',
141
+ [4 /* ErrorCodes.WATCH_CLEANUP */]: 'watcher cleanup function',
142
+ [5 /* ErrorCodes.NATIVE_EVENT_HANDLER */]: 'native event handler',
143
+ [6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */]: 'component event handler',
144
+ [7 /* ErrorCodes.VNODE_HOOK */]: 'vnode hook',
145
+ [8 /* ErrorCodes.DIRECTIVE_HOOK */]: 'directive hook',
146
+ [9 /* ErrorCodes.TRANSITION_HOOK */]: 'transition hook',
147
+ [10 /* ErrorCodes.APP_ERROR_HANDLER */]: 'app errorHandler',
148
+ [11 /* ErrorCodes.APP_WARN_HANDLER */]: 'app warnHandler',
149
+ [12 /* ErrorCodes.FUNCTION_REF */]: 'ref function',
150
+ [13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */]: 'async component loader',
151
+ [14 /* ErrorCodes.SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
152
152
  'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
153
153
  };
154
154
  function callWithErrorHandling(fn, instance, type, args) {
@@ -199,7 +199,7 @@ function handleError(err, instance, type, throwInDev = true) {
199
199
  // app-level handling
200
200
  const appErrorHandler = instance.appContext.config.errorHandler;
201
201
  if (appErrorHandler) {
202
- callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
202
+ callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
203
203
  return;
204
204
  }
205
205
  }
@@ -229,15 +229,11 @@ let isFlushing = false;
229
229
  let isFlushPending = false;
230
230
  const queue = [];
231
231
  let flushIndex = 0;
232
- const pendingPreFlushCbs = [];
233
- let activePreFlushCbs = null;
234
- let preFlushIndex = 0;
235
232
  const pendingPostFlushCbs = [];
236
233
  let activePostFlushCbs = null;
237
234
  let postFlushIndex = 0;
238
235
  const resolvedPromise = /*#__PURE__*/ Promise.resolve();
239
236
  let currentFlushPromise = null;
240
- let currentPreFlushParentJob = null;
241
237
  const RECURSION_LIMIT = 100;
242
238
  function nextTick(fn) {
243
239
  const p = currentFlushPromise || resolvedPromise;
@@ -265,9 +261,8 @@ function queueJob(job) {
265
261
  // if the job is a watch() callback, the search will start with a +1 index to
266
262
  // allow it recursively trigger itself - it is the user's responsibility to
267
263
  // ensure it doesn't end up in an infinite loop.
268
- if ((!queue.length ||
269
- !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&
270
- job !== currentPreFlushParentJob) {
264
+ if (!queue.length ||
265
+ !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
271
266
  if (job.id == null) {
272
267
  queue.push(job);
273
268
  }
@@ -289,51 +284,40 @@ function invalidateJob(job) {
289
284
  queue.splice(i, 1);
290
285
  }
291
286
  }
292
- function queueCb(cb, activeQueue, pendingQueue, index) {
287
+ function queuePostFlushCb(cb) {
293
288
  if (!shared.isArray(cb)) {
294
- if (!activeQueue ||
295
- !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
296
- pendingQueue.push(cb);
289
+ if (!activePostFlushCbs ||
290
+ !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
291
+ pendingPostFlushCbs.push(cb);
297
292
  }
298
293
  }
299
294
  else {
300
295
  // if cb is an array, it is a component lifecycle hook which can only be
301
296
  // triggered by a job, which is already deduped in the main queue, so
302
297
  // we can skip duplicate check here to improve perf
303
- pendingQueue.push(...cb);
298
+ pendingPostFlushCbs.push(...cb);
304
299
  }
305
300
  queueFlush();
306
301
  }
307
- function queuePreFlushCb(cb) {
308
- queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
309
- }
310
- function queuePostFlushCb(cb) {
311
- queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
312
- }
313
- function flushPreFlushCbs(seen, parentJob = null) {
314
- if (pendingPreFlushCbs.length) {
315
- currentPreFlushParentJob = parentJob;
316
- activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
317
- pendingPreFlushCbs.length = 0;
318
- {
319
- seen = seen || new Map();
320
- }
321
- for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
322
- if (checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
302
+ function flushPreFlushCbs(seen,
303
+ // if currently flushing, skip the current job itself
304
+ i = isFlushing ? flushIndex + 1 : 0) {
305
+ {
306
+ seen = seen || new Map();
307
+ }
308
+ for (; i < queue.length; i++) {
309
+ const cb = queue[i];
310
+ if (cb && cb.pre) {
311
+ if (checkRecursiveUpdates(seen, cb)) {
323
312
  continue;
324
313
  }
325
- activePreFlushCbs[preFlushIndex]();
314
+ queue.splice(i, 1);
315
+ i--;
316
+ cb();
326
317
  }
327
- activePreFlushCbs = null;
328
- preFlushIndex = 0;
329
- currentPreFlushParentJob = null;
330
- // recursively flush until it drains
331
- flushPreFlushCbs(seen, parentJob);
332
318
  }
333
319
  }
334
320
  function flushPostFlushCbs(seen) {
335
- // flush any pre cbs queued during the flush (e.g. pre watchers)
336
- flushPreFlushCbs();
337
321
  if (pendingPostFlushCbs.length) {
338
322
  const deduped = [...new Set(pendingPostFlushCbs)];
339
323
  pendingPostFlushCbs.length = 0;
@@ -358,13 +342,22 @@ function flushPostFlushCbs(seen) {
358
342
  }
359
343
  }
360
344
  const getId = (job) => job.id == null ? Infinity : job.id;
345
+ const comparator = (a, b) => {
346
+ const diff = getId(a) - getId(b);
347
+ if (diff === 0) {
348
+ if (a.pre && !b.pre)
349
+ return -1;
350
+ if (b.pre && !a.pre)
351
+ return 1;
352
+ }
353
+ return diff;
354
+ };
361
355
  function flushJobs(seen) {
362
356
  isFlushPending = false;
363
357
  isFlushing = true;
364
358
  {
365
359
  seen = seen || new Map();
366
360
  }
367
- flushPreFlushCbs(seen);
368
361
  // Sort queue before flush.
369
362
  // This ensures that:
370
363
  // 1. Components are updated from parent to child. (because parent is always
@@ -372,7 +365,7 @@ function flushJobs(seen) {
372
365
  // priority number)
373
366
  // 2. If a component is unmounted during a parent component's update,
374
367
  // its update can be skipped.
375
- queue.sort((a, b) => getId(a) - getId(b));
368
+ queue.sort(comparator);
376
369
  // conditional usage of checkRecursiveUpdate must be determined out of
377
370
  // try ... catch block since Rollup by default de-optimizes treeshaking
378
371
  // inside try-catch. This can leave all warning code unshaked. Although
@@ -388,7 +381,7 @@ function flushJobs(seen) {
388
381
  continue;
389
382
  }
390
383
  // console.log(`running:`, job.id)
391
- callWithErrorHandling(job, null, 14 /* SCHEDULER */);
384
+ callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */);
392
385
  }
393
386
  }
394
387
  }
@@ -400,9 +393,7 @@ function flushJobs(seen) {
400
393
  currentFlushPromise = null;
401
394
  // some postFlushCb queued jobs!
402
395
  // keep flushing until it drains.
403
- if (queue.length ||
404
- pendingPreFlushCbs.length ||
405
- pendingPostFlushCbs.length) {
396
+ if (queue.length || pendingPostFlushCbs.length) {
406
397
  flushJobs(seen);
407
398
  }
408
399
  }
@@ -619,7 +610,7 @@ function setDevtoolsHook(hook, target) {
619
610
  }
620
611
  }
621
612
  function devtoolsInitApp(app, version) {
622
- emit("app:init" /* APP_INIT */, app, version, {
613
+ emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
623
614
  Fragment,
624
615
  Text,
625
616
  Comment,
@@ -627,27 +618,27 @@ function devtoolsInitApp(app, version) {
627
618
  });
628
619
  }
629
620
  function devtoolsUnmountApp(app) {
630
- emit("app:unmount" /* APP_UNMOUNT */, app);
621
+ emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
631
622
  }
632
- const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
623
+ const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
633
624
  const devtoolsComponentUpdated =
634
- /*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
625
+ /*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* DevtoolsHooks.COMPONENT_UPDATED */);
635
626
  const devtoolsComponentRemoved =
636
- /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
627
+ /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* DevtoolsHooks.COMPONENT_REMOVED */);
637
628
  function createDevtoolsComponentHook(hook) {
638
629
  return (component) => {
639
630
  emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
640
631
  };
641
632
  }
642
- const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
643
- const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
633
+ const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
634
+ const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
644
635
  function createDevtoolsPerformanceHook(hook) {
645
636
  return (component, type, time) => {
646
637
  emit(hook, component.appContext.app, component.uid, component, type, time);
647
638
  };
648
639
  }
649
640
  function devtoolsComponentEmit(component, event, params) {
650
- emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
641
+ emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
651
642
  }
652
643
 
653
644
  function emit$1(instance, event, ...rawArgs) {
@@ -712,7 +703,7 @@ function emit$1(instance, event, ...rawArgs) {
712
703
  handler = props[(handlerName = shared.toHandlerKey(shared.hyphenate(event)))];
713
704
  }
714
705
  if (handler) {
715
- callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
706
+ callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
716
707
  }
717
708
  const onceHandler = props[handlerName + `Once`];
718
709
  if (onceHandler) {
@@ -723,7 +714,7 @@ function emit$1(instance, event, ...rawArgs) {
723
714
  return;
724
715
  }
725
716
  instance.emitted[handlerName] = true;
726
- callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
717
+ callWithAsyncErrorHandling(onceHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
727
718
  }
728
719
  }
729
720
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
@@ -755,7 +746,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
755
746
  }
756
747
  }
757
748
  if (!raw && !hasExtends) {
758
- cache.set(comp, null);
749
+ if (shared.isObject(comp)) {
750
+ cache.set(comp, null);
751
+ }
759
752
  return null;
760
753
  }
761
754
  if (shared.isArray(raw)) {
@@ -764,7 +757,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
764
757
  else {
765
758
  shared.extend(normalized, raw);
766
759
  }
767
- cache.set(comp, normalized);
760
+ if (shared.isObject(comp)) {
761
+ cache.set(comp, normalized);
762
+ }
768
763
  return normalized;
769
764
  }
770
765
  // Check if an incoming prop key is a declared emit event listener.
@@ -883,7 +878,7 @@ function renderComponentRoot(instance) {
883
878
  accessedAttrs = false;
884
879
  }
885
880
  try {
886
- if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
881
+ if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
887
882
  // withProxy is a proxy with a different `has` trap only for
888
883
  // runtime-compiled render functions using `with` block.
889
884
  const proxyToUse = withProxy || proxy;
@@ -916,7 +911,7 @@ function renderComponentRoot(instance) {
916
911
  }
917
912
  catch (err) {
918
913
  blockStack.length = 0;
919
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
914
+ handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
920
915
  result = createVNode(Comment);
921
916
  }
922
917
  // attr merging
@@ -925,14 +920,14 @@ function renderComponentRoot(instance) {
925
920
  let root = result;
926
921
  let setRoot = undefined;
927
922
  if (result.patchFlag > 0 &&
928
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
923
+ result.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
929
924
  [root, setRoot] = getChildRoot(result);
930
925
  }
931
926
  if (fallthroughAttrs && inheritAttrs !== false) {
932
927
  const keys = Object.keys(fallthroughAttrs);
933
928
  const { shapeFlag } = root;
934
929
  if (keys.length) {
935
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
930
+ if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
936
931
  if (propsOptions && keys.some(shared.isModelListener)) {
937
932
  // If a v-model listener (onUpdate:xxx) has a corresponding declared
938
933
  // prop, it indicates this component expects to handle v-model and
@@ -1073,7 +1068,7 @@ const filterModelListeners = (attrs, props) => {
1073
1068
  return res;
1074
1069
  };
1075
1070
  const isElementRoot = (vnode) => {
1076
- return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||
1071
+ return (vnode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 1 /* ShapeFlags.ELEMENT */) ||
1077
1072
  vnode.type === Comment // potential v-if branch switch
1078
1073
  );
1079
1074
  };
@@ -1092,19 +1087,19 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
1092
1087
  return true;
1093
1088
  }
1094
1089
  if (optimized && patchFlag >= 0) {
1095
- if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {
1090
+ if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) {
1096
1091
  // slot content that references values that might have changed,
1097
1092
  // e.g. in a v-for
1098
1093
  return true;
1099
1094
  }
1100
- if (patchFlag & 16 /* FULL_PROPS */) {
1095
+ if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
1101
1096
  if (!prevProps) {
1102
1097
  return !!nextProps;
1103
1098
  }
1104
1099
  // presence of this flag indicates props are always non-null
1105
1100
  return hasPropsChanged(prevProps, nextProps, emits);
1106
1101
  }
1107
- else if (patchFlag & 8 /* PROPS */) {
1102
+ else if (patchFlag & 8 /* PatchFlags.PROPS */) {
1108
1103
  const dynamicProps = nextVNode.dynamicProps;
1109
1104
  for (let i = 0; i < dynamicProps.length; i++) {
1110
1105
  const key = dynamicProps[i];
@@ -1362,7 +1357,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1362
1357
  if (delayEnter) {
1363
1358
  activeBranch.transition.afterLeave = () => {
1364
1359
  if (pendingId === suspense.pendingId) {
1365
- move(pendingBranch, container, anchor, 0 /* ENTER */);
1360
+ move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
1366
1361
  }
1367
1362
  };
1368
1363
  }
@@ -1377,7 +1372,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1377
1372
  }
1378
1373
  if (!delayEnter) {
1379
1374
  // move content from off-dom container to actual container
1380
- move(pendingBranch, container, anchor, 0 /* ENTER */);
1375
+ move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
1381
1376
  }
1382
1377
  }
1383
1378
  setActiveBranch(suspense, pendingBranch);
@@ -1451,7 +1446,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1451
1446
  const hydratedEl = instance.vnode.el;
1452
1447
  instance
1453
1448
  .asyncDep.catch(err => {
1454
- handleError(err, instance, 0 /* SETUP_FUNCTION */);
1449
+ handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
1455
1450
  })
1456
1451
  .then(asyncSetupResult => {
1457
1452
  // retry when the setup() promise resolves.
@@ -1525,7 +1520,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
1525
1520
  }
1526
1521
  function normalizeSuspenseChildren(vnode) {
1527
1522
  const { shapeFlag, children } = vnode;
1528
- const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;
1523
+ const isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */;
1529
1524
  vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
1530
1525
  vnode.ssFallback = isSlotChildren
1531
1526
  ? normalizeSuspenseSlot(children.fallback)
@@ -1698,7 +1693,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1698
1693
  return traverse(s);
1699
1694
  }
1700
1695
  else if (shared.isFunction(s)) {
1701
- return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
1696
+ return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */);
1702
1697
  }
1703
1698
  else {
1704
1699
  warnInvalidSource(s);
@@ -1708,7 +1703,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1708
1703
  else if (shared.isFunction(source)) {
1709
1704
  if (cb) {
1710
1705
  // getter with cb
1711
- getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
1706
+ getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */);
1712
1707
  }
1713
1708
  else {
1714
1709
  // no cb -> simple effect
@@ -1719,7 +1714,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1719
1714
  if (cleanup) {
1720
1715
  cleanup();
1721
1716
  }
1722
- return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onCleanup]);
1717
+ return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]);
1723
1718
  };
1724
1719
  }
1725
1720
  }
@@ -1734,7 +1729,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1734
1729
  let cleanup;
1735
1730
  let onCleanup = (fn) => {
1736
1731
  cleanup = effect.onStop = () => {
1737
- callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
1732
+ callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
1738
1733
  };
1739
1734
  };
1740
1735
  // in SSR there is no need to setup an actual effect, and it should be noop
@@ -1746,7 +1741,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1746
1741
  getter();
1747
1742
  }
1748
1743
  else if (immediate) {
1749
- callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
1744
+ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1750
1745
  getter(),
1751
1746
  isMultiSource ? [] : undefined,
1752
1747
  onCleanup
@@ -1772,7 +1767,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1772
1767
  if (cleanup) {
1773
1768
  cleanup();
1774
1769
  }
1775
- callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
1770
+ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1776
1771
  newValue,
1777
1772
  // pass undefined as the old value when it's changed for the first time
1778
1773
  oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
@@ -1798,7 +1793,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1798
1793
  }
1799
1794
  else {
1800
1795
  // default: 'pre'
1801
- scheduler = () => queuePreFlushCb(job);
1796
+ job.pre = true;
1797
+ if (instance)
1798
+ job.id = instance.uid;
1799
+ scheduler = () => queueJob(job);
1802
1800
  }
1803
1801
  const effect = new reactivity.ReactiveEffect(getter, scheduler);
1804
1802
  {
@@ -1865,7 +1863,7 @@ function createPathGetter(ctx, path) {
1865
1863
  };
1866
1864
  }
1867
1865
  function traverse(value, seen) {
1868
- if (!shared.isObject(value) || value["__v_skip" /* SKIP */]) {
1866
+ if (!shared.isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) {
1869
1867
  return value;
1870
1868
  }
1871
1869
  seen = seen || new Set();
@@ -2049,7 +2047,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
2049
2047
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
2050
2048
  const callHook = (hook, args) => {
2051
2049
  hook &&
2052
- callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
2050
+ callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args);
2053
2051
  };
2054
2052
  const callAsyncHook = (hook, args) => {
2055
2053
  const done = args[1];
@@ -2185,10 +2183,10 @@ function getKeepAliveChild(vnode) {
2185
2183
  : vnode;
2186
2184
  }
2187
2185
  function setTransitionHooks(vnode, hooks) {
2188
- if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
2186
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) {
2189
2187
  setTransitionHooks(vnode.component.subTree, hooks);
2190
2188
  }
2191
- else if (vnode.shapeFlag & 128 /* SUSPENSE */) {
2189
+ else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
2192
2190
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
2193
2191
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
2194
2192
  }
@@ -2207,7 +2205,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
2207
2205
  : String(parentKey) + String(child.key != null ? child.key : i);
2208
2206
  // handle fragment children case, e.g. v-for
2209
2207
  if (child.type === Fragment) {
2210
- if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
2208
+ if (child.patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */)
2211
2209
  keyedFragmentCount++;
2212
2210
  ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
2213
2211
  }
@@ -2222,7 +2220,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
2222
2220
  // these children to force full diffs to ensure correct behavior.
2223
2221
  if (keyedFragmentCount > 1) {
2224
2222
  for (let i = 0; i < ret.length; i++) {
2225
- ret[i].patchFlag = -2 /* BAIL */;
2223
+ ret[i].patchFlag = -2 /* PatchFlags.BAIL */;
2226
2224
  }
2227
2225
  }
2228
2226
  return ret;
@@ -2300,7 +2298,7 @@ function defineAsyncComponent(source) {
2300
2298
  }
2301
2299
  const onError = (err) => {
2302
2300
  pendingRequest = null;
2303
- handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
2301
+ handleError(err, instance, 13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
2304
2302
  };
2305
2303
  // suspense-controlled or SSR.
2306
2304
  if ((suspensible && instance.suspense) ||
@@ -2410,7 +2408,7 @@ const KeepAliveImpl = {
2410
2408
  const storageContainer = createElement('div');
2411
2409
  sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
2412
2410
  const instance = vnode.component;
2413
- move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
2411
+ move(vnode, container, anchor, 0 /* MoveType.ENTER */, parentSuspense);
2414
2412
  // in case props have changed
2415
2413
  patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);
2416
2414
  queuePostRenderEffect(() => {
@@ -2430,7 +2428,7 @@ const KeepAliveImpl = {
2430
2428
  };
2431
2429
  sharedContext.deactivate = (vnode) => {
2432
2430
  const instance = vnode.component;
2433
- move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
2431
+ move(vnode, storageContainer, null, 1 /* MoveType.LEAVE */, parentSuspense);
2434
2432
  queuePostRenderEffect(() => {
2435
2433
  if (instance.da) {
2436
2434
  shared.invokeArrayFns(instance.da);
@@ -2519,8 +2517,8 @@ const KeepAliveImpl = {
2519
2517
  return children;
2520
2518
  }
2521
2519
  else if (!isVNode(rawVNode) ||
2522
- (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&
2523
- !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {
2520
+ (!(rawVNode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) &&
2521
+ !(rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */))) {
2524
2522
  current = null;
2525
2523
  return rawVNode;
2526
2524
  }
@@ -2542,7 +2540,7 @@ const KeepAliveImpl = {
2542
2540
  // clone vnode if it's reused because we are going to mutate it
2543
2541
  if (vnode.el) {
2544
2542
  vnode = cloneVNode(vnode);
2545
- if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
2543
+ if (rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
2546
2544
  rawVNode.ssContent = vnode;
2547
2545
  }
2548
2546
  }
@@ -2561,7 +2559,7 @@ const KeepAliveImpl = {
2561
2559
  setTransitionHooks(vnode, vnode.transition);
2562
2560
  }
2563
2561
  // avoid vnode being mounted as fresh
2564
- vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
2562
+ vnode.shapeFlag |= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
2565
2563
  // make this key the freshest
2566
2564
  keys.delete(key);
2567
2565
  keys.add(key);
@@ -2574,7 +2572,7 @@ const KeepAliveImpl = {
2574
2572
  }
2575
2573
  }
2576
2574
  // avoid vnode being unmounted
2577
- vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
2575
+ vnode.shapeFlag |= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
2578
2576
  current = vnode;
2579
2577
  return isSuspense(rawVNode.type) ? rawVNode : vnode;
2580
2578
  };
@@ -2597,10 +2595,10 @@ function matches(pattern, name) {
2597
2595
  return false;
2598
2596
  }
2599
2597
  function onActivated(hook, target) {
2600
- registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);
2598
+ registerKeepAliveHook(hook, "a" /* LifecycleHooks.ACTIVATED */, target);
2601
2599
  }
2602
2600
  function onDeactivated(hook, target) {
2603
- registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);
2601
+ registerKeepAliveHook(hook, "da" /* LifecycleHooks.DEACTIVATED */, target);
2604
2602
  }
2605
2603
  function registerKeepAliveHook(hook, type, target = currentInstance) {
2606
2604
  // cache the deactivate branch check wrapper for injected hooks so the same
@@ -2644,16 +2642,16 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
2644
2642
  }
2645
2643
  function resetShapeFlag(vnode) {
2646
2644
  let shapeFlag = vnode.shapeFlag;
2647
- if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
2648
- shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
2645
+ if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
2646
+ shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
2649
2647
  }
2650
- if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
2651
- shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;
2648
+ if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
2649
+ shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
2652
2650
  }
2653
2651
  vnode.shapeFlag = shapeFlag;
2654
2652
  }
2655
2653
  function getInnerChild(vnode) {
2656
- return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
2654
+ return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
2657
2655
  }
2658
2656
 
2659
2657
  function injectHook(type, hook, target = currentInstance, prepend = false) {
@@ -2699,19 +2697,19 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2699
2697
  }
2700
2698
  const createHook = (lifecycle) => (hook, target = currentInstance) =>
2701
2699
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
2702
- (!isInSSRComponentSetup || lifecycle === "sp" /* SERVER_PREFETCH */) &&
2700
+ (!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
2703
2701
  injectHook(lifecycle, hook, target);
2704
- const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);
2705
- const onMounted = createHook("m" /* MOUNTED */);
2706
- const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);
2707
- const onUpdated = createHook("u" /* UPDATED */);
2708
- const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
2709
- const onUnmounted = createHook("um" /* UNMOUNTED */);
2710
- const onServerPrefetch = createHook("sp" /* SERVER_PREFETCH */);
2711
- const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);
2712
- const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);
2702
+ const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
2703
+ const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
2704
+ const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
2705
+ const onUpdated = createHook("u" /* LifecycleHooks.UPDATED */);
2706
+ const onBeforeUnmount = createHook("bum" /* LifecycleHooks.BEFORE_UNMOUNT */);
2707
+ const onUnmounted = createHook("um" /* LifecycleHooks.UNMOUNTED */);
2708
+ const onServerPrefetch = createHook("sp" /* LifecycleHooks.SERVER_PREFETCH */);
2709
+ const onRenderTriggered = createHook("rtg" /* LifecycleHooks.RENDER_TRIGGERED */);
2710
+ const onRenderTracked = createHook("rtc" /* LifecycleHooks.RENDER_TRACKED */);
2713
2711
  function onErrorCaptured(hook, target = currentInstance) {
2714
- injectHook("ec" /* ERROR_CAPTURED */, hook, target);
2712
+ injectHook("ec" /* LifecycleHooks.ERROR_CAPTURED */, hook, target);
2715
2713
  }
2716
2714
 
2717
2715
  /**
@@ -2778,7 +2776,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2778
2776
  // disable tracking inside all lifecycle hooks
2779
2777
  // since they can potentially be called inside effects.
2780
2778
  reactivity.pauseTracking();
2781
- callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [
2779
+ callWithAsyncErrorHandling(hook, instance, 8 /* ErrorCodes.DIRECTIVE_HOOK */, [
2782
2780
  vnode.el,
2783
2781
  binding,
2784
2782
  vnode,
@@ -2823,7 +2821,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
2823
2821
  const Component = instance.type;
2824
2822
  // explicit self name has highest priority
2825
2823
  if (type === COMPONENTS) {
2826
- const selfName = getComponentName(Component);
2824
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
2827
2825
  if (selfName &&
2828
2826
  (selfName === name ||
2829
2827
  selfName === shared.camelize(name) ||
@@ -2920,7 +2918,13 @@ function createSlots(slots, dynamicSlots) {
2920
2918
  }
2921
2919
  else if (slot) {
2922
2920
  // conditional single slot generated by <template v-if="..." #foo>
2923
- slots[slot.name] = slot.fn;
2921
+ slots[slot.name] = slot.key
2922
+ ? (...args) => {
2923
+ const res = slot.fn(...args);
2924
+ res.key = slot.key;
2925
+ return res;
2926
+ }
2927
+ : slot.fn;
2924
2928
  }
2925
2929
  }
2926
2930
  return slots;
@@ -2956,9 +2960,15 @@ fallback, noSlotted) {
2956
2960
  }
2957
2961
  openBlock();
2958
2962
  const validSlotContent = slot && ensureValidVNode(slot(props));
2959
- const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */
2960
- ? 64 /* STABLE_FRAGMENT */
2961
- : -2 /* BAIL */);
2963
+ const rendered = createBlock(Fragment, {
2964
+ key: props.key ||
2965
+ // slot content array of a dynamic conditional slot may have a branch
2966
+ // key attached in the `createSlots` helper, respect that
2967
+ (validSlotContent && validSlotContent.key) ||
2968
+ `_${name}`
2969
+ }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* SlotFlags.STABLE */
2970
+ ? 64 /* PatchFlags.STABLE_FRAGMENT */
2971
+ : -2 /* PatchFlags.BAIL */);
2962
2972
  if (!noSlotted && rendered.scopeId) {
2963
2973
  rendered.slotScopeIds = [rendered.scopeId + '-s'];
2964
2974
  }
@@ -2986,14 +2996,16 @@ function ensureValidVNode(vnodes) {
2986
2996
  * For prefixing keys in v-on="obj" with "on"
2987
2997
  * @private
2988
2998
  */
2989
- function toHandlers(obj) {
2999
+ function toHandlers(obj, preserveCaseIfNecessary) {
2990
3000
  const ret = {};
2991
3001
  if (!shared.isObject(obj)) {
2992
3002
  warn(`v-on with no argument expects an object value.`);
2993
3003
  return ret;
2994
3004
  }
2995
3005
  for (const key in obj) {
2996
- ret[shared.toHandlerKey(key)] = obj[key];
3006
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key)
3007
+ ? `on:${key}`
3008
+ : shared.toHandlerKey(key)] = obj[key];
2997
3009
  }
2998
3010
  return ret;
2999
3011
  }
@@ -3057,23 +3069,23 @@ const PublicInstanceProxyHandlers = {
3057
3069
  const n = accessCache[key];
3058
3070
  if (n !== undefined) {
3059
3071
  switch (n) {
3060
- case 1 /* SETUP */:
3072
+ case 1 /* AccessTypes.SETUP */:
3061
3073
  return setupState[key];
3062
- case 2 /* DATA */:
3074
+ case 2 /* AccessTypes.DATA */:
3063
3075
  return data[key];
3064
- case 4 /* CONTEXT */:
3076
+ case 4 /* AccessTypes.CONTEXT */:
3065
3077
  return ctx[key];
3066
- case 3 /* PROPS */:
3078
+ case 3 /* AccessTypes.PROPS */:
3067
3079
  return props[key];
3068
3080
  // default: just fallthrough
3069
3081
  }
3070
3082
  }
3071
3083
  else if (setupState !== shared.EMPTY_OBJ && shared.hasOwn(setupState, key)) {
3072
- accessCache[key] = 1 /* SETUP */;
3084
+ accessCache[key] = 1 /* AccessTypes.SETUP */;
3073
3085
  return setupState[key];
3074
3086
  }
3075
3087
  else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
3076
- accessCache[key] = 2 /* DATA */;
3088
+ accessCache[key] = 2 /* AccessTypes.DATA */;
3077
3089
  return data[key];
3078
3090
  }
3079
3091
  else if (
@@ -3081,15 +3093,15 @@ const PublicInstanceProxyHandlers = {
3081
3093
  // props
3082
3094
  (normalizedProps = instance.propsOptions[0]) &&
3083
3095
  shared.hasOwn(normalizedProps, key)) {
3084
- accessCache[key] = 3 /* PROPS */;
3096
+ accessCache[key] = 3 /* AccessTypes.PROPS */;
3085
3097
  return props[key];
3086
3098
  }
3087
3099
  else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
3088
- accessCache[key] = 4 /* CONTEXT */;
3100
+ accessCache[key] = 4 /* AccessTypes.CONTEXT */;
3089
3101
  return ctx[key];
3090
3102
  }
3091
3103
  else if (shouldCacheAccess) {
3092
- accessCache[key] = 0 /* OTHER */;
3104
+ accessCache[key] = 0 /* AccessTypes.OTHER */;
3093
3105
  }
3094
3106
  }
3095
3107
  const publicGetter = publicPropertiesMap[key];
@@ -3097,7 +3109,7 @@ const PublicInstanceProxyHandlers = {
3097
3109
  // public $xxx properties
3098
3110
  if (publicGetter) {
3099
3111
  if (key === '$attrs') {
3100
- reactivity.track(instance, "get" /* GET */, key);
3112
+ reactivity.track(instance, "get" /* TrackOpTypes.GET */, key);
3101
3113
  markAttrsAccessed();
3102
3114
  }
3103
3115
  return publicGetter(instance);
@@ -3110,7 +3122,7 @@ const PublicInstanceProxyHandlers = {
3110
3122
  }
3111
3123
  else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
3112
3124
  // user may set custom properties to `this` that start with `$`
3113
- accessCache[key] = 4 /* CONTEXT */;
3125
+ accessCache[key] = 4 /* AccessTypes.CONTEXT */;
3114
3126
  return ctx[key];
3115
3127
  }
3116
3128
  else if (
@@ -3293,7 +3305,7 @@ function applyOptions(instance) {
3293
3305
  // call beforeCreate first before accessing other options since
3294
3306
  // the hook may mutate resolved options (#2791)
3295
3307
  if (options.beforeCreate) {
3296
- callHook(options.beforeCreate, instance, "bc" /* BEFORE_CREATE */);
3308
+ callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
3297
3309
  }
3298
3310
  const {
3299
3311
  // state
@@ -3309,7 +3321,7 @@ function applyOptions(instance) {
3309
3321
  const [propsOptions] = instance.propsOptions;
3310
3322
  if (propsOptions) {
3311
3323
  for (const key in propsOptions) {
3312
- checkDuplicateProperties("Props" /* PROPS */, key);
3324
+ checkDuplicateProperties("Props" /* OptionTypes.PROPS */, key);
3313
3325
  }
3314
3326
  }
3315
3327
  }
@@ -3339,7 +3351,7 @@ function applyOptions(instance) {
3339
3351
  });
3340
3352
  }
3341
3353
  {
3342
- checkDuplicateProperties("Methods" /* METHODS */, key);
3354
+ checkDuplicateProperties("Methods" /* OptionTypes.METHODS */, key);
3343
3355
  }
3344
3356
  }
3345
3357
  else {
@@ -3366,7 +3378,7 @@ function applyOptions(instance) {
3366
3378
  instance.data = reactivity.reactive(data);
3367
3379
  {
3368
3380
  for (const key in data) {
3369
- checkDuplicateProperties("Data" /* DATA */, key);
3381
+ checkDuplicateProperties("Data" /* OptionTypes.DATA */, key);
3370
3382
  // expose data on ctx during dev
3371
3383
  if (!isReservedPrefix(key[0])) {
3372
3384
  Object.defineProperty(ctx, key, {
@@ -3410,7 +3422,7 @@ function applyOptions(instance) {
3410
3422
  set: v => (c.value = v)
3411
3423
  });
3412
3424
  {
3413
- checkDuplicateProperties("Computed" /* COMPUTED */, key);
3425
+ checkDuplicateProperties("Computed" /* OptionTypes.COMPUTED */, key);
3414
3426
  }
3415
3427
  }
3416
3428
  }
@@ -3428,7 +3440,7 @@ function applyOptions(instance) {
3428
3440
  });
3429
3441
  }
3430
3442
  if (created) {
3431
- callHook(created, instance, "c" /* CREATED */);
3443
+ callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
3432
3444
  }
3433
3445
  function registerLifecycleHook(register, hook) {
3434
3446
  if (shared.isArray(hook)) {
@@ -3521,7 +3533,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared
3521
3533
  ctx[key] = injected;
3522
3534
  }
3523
3535
  {
3524
- checkDuplicateProperties("Inject" /* INJECT */, key);
3536
+ checkDuplicateProperties("Inject" /* OptionTypes.INJECT */, key);
3525
3537
  }
3526
3538
  }
3527
3539
  }
@@ -3592,7 +3604,9 @@ function resolveMergedOptions(instance) {
3592
3604
  }
3593
3605
  mergeOptions(resolved, base, optionMergeStrategies);
3594
3606
  }
3595
- cache.set(base, resolved);
3607
+ if (shared.isObject(base)) {
3608
+ cache.set(base, resolved);
3609
+ }
3596
3610
  return resolved;
3597
3611
  }
3598
3612
  function mergeOptions(to, from, strats, asMixin = false) {
@@ -3721,6 +3735,13 @@ isSSR = false) {
3721
3735
  }
3722
3736
  instance.attrs = attrs;
3723
3737
  }
3738
+ function isInHmrContext(instance) {
3739
+ while (instance) {
3740
+ if (instance.type.__hmrId)
3741
+ return true;
3742
+ instance = instance.parent;
3743
+ }
3744
+ }
3724
3745
  function updateProps(instance, rawProps, rawPrevProps, optimized) {
3725
3746
  const { props, attrs, vnode: { patchFlag } } = instance;
3726
3747
  const rawCurrentProps = reactivity.toRaw(props);
@@ -3730,11 +3751,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3730
3751
  // always force full diff in dev
3731
3752
  // - #1942 if hmr is enabled with sfc component
3732
3753
  // - vite#872 non-sfc component used by sfc component
3733
- !((instance.type.__hmrId ||
3734
- (instance.parent && instance.parent.type.__hmrId))) &&
3754
+ !(isInHmrContext(instance)) &&
3735
3755
  (optimized || patchFlag > 0) &&
3736
- !(patchFlag & 16 /* FULL_PROPS */)) {
3737
- if (patchFlag & 8 /* PROPS */) {
3756
+ !(patchFlag & 16 /* PatchFlags.FULL_PROPS */)) {
3757
+ if (patchFlag & 8 /* PatchFlags.PROPS */) {
3738
3758
  // Compiler-generated props & no keys change, just set the updated
3739
3759
  // the props.
3740
3760
  const propsToUpdate = instance.vnode.dynamicProps;
@@ -3813,7 +3833,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3813
3833
  }
3814
3834
  // trigger updates for $attrs in case it's used in component slots
3815
3835
  if (hasAttrsChanged) {
3816
- reactivity.trigger(instance, "set" /* SET */, '$attrs');
3836
+ reactivity.trigger(instance, "set" /* TriggerOpTypes.SET */, '$attrs');
3817
3837
  }
3818
3838
  {
3819
3839
  validateProps(rawProps || {}, props, instance);
@@ -3882,11 +3902,11 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3882
3902
  }
3883
3903
  }
3884
3904
  // boolean casting
3885
- if (opt[0 /* shouldCast */]) {
3905
+ if (opt[0 /* BooleanFlags.shouldCast */]) {
3886
3906
  if (isAbsent && !hasDefault) {
3887
3907
  value = false;
3888
3908
  }
3889
- else if (opt[1 /* shouldCastTrue */] &&
3909
+ else if (opt[1 /* BooleanFlags.shouldCastTrue */] &&
3890
3910
  (value === '' || value === shared.hyphenate(key))) {
3891
3911
  value = true;
3892
3912
  }
@@ -3924,7 +3944,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
3924
3944
  }
3925
3945
  }
3926
3946
  if (!raw && !hasExtends) {
3927
- cache.set(comp, shared.EMPTY_ARR);
3947
+ if (shared.isObject(comp)) {
3948
+ cache.set(comp, shared.EMPTY_ARR);
3949
+ }
3928
3950
  return shared.EMPTY_ARR;
3929
3951
  }
3930
3952
  if (shared.isArray(raw)) {
@@ -3951,8 +3973,8 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
3951
3973
  if (prop) {
3952
3974
  const booleanIndex = getTypeIndex(Boolean, prop.type);
3953
3975
  const stringIndex = getTypeIndex(String, prop.type);
3954
- prop[0 /* shouldCast */] = booleanIndex > -1;
3955
- prop[1 /* shouldCastTrue */] =
3976
+ prop[0 /* BooleanFlags.shouldCast */] = booleanIndex > -1;
3977
+ prop[1 /* BooleanFlags.shouldCastTrue */] =
3956
3978
  stringIndex < 0 || booleanIndex < stringIndex;
3957
3979
  // if the prop needs boolean casting or default value
3958
3980
  if (booleanIndex > -1 || shared.hasOwn(prop, 'default')) {
@@ -3963,7 +3985,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
3963
3985
  }
3964
3986
  }
3965
3987
  const res = [normalized, needCastKeys];
3966
- cache.set(comp, res);
3988
+ if (shared.isObject(comp)) {
3989
+ cache.set(comp, res);
3990
+ }
3967
3991
  return res;
3968
3992
  }
3969
3993
  function validatePropName(key) {
@@ -4173,7 +4197,7 @@ const normalizeVNodeSlots = (instance, children) => {
4173
4197
  instance.slots.default = () => normalized;
4174
4198
  };
4175
4199
  const initSlots = (instance, children) => {
4176
- if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
4200
+ if (instance.vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
4177
4201
  const type = children._;
4178
4202
  if (type) {
4179
4203
  // users can get the shallow readonly version of the slots object through `this.$slots`,
@@ -4198,7 +4222,7 @@ const updateSlots = (instance, children, optimized) => {
4198
4222
  const { vnode, slots } = instance;
4199
4223
  let needDeletionCheck = true;
4200
4224
  let deletionComparisonTarget = shared.EMPTY_OBJ;
4201
- if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
4225
+ if (vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
4202
4226
  const type = children._;
4203
4227
  if (type) {
4204
4228
  // compiled slots.
@@ -4207,7 +4231,7 @@ const updateSlots = (instance, children, optimized) => {
4207
4231
  // force update slots and mark instance for hmr as well
4208
4232
  shared.extend(slots, children);
4209
4233
  }
4210
- else if (optimized && type === 1 /* STABLE */) {
4234
+ else if (optimized && type === 1 /* SlotFlags.STABLE */) {
4211
4235
  // compiled AND stable.
4212
4236
  // no need to update, and skip stale slots removal.
4213
4237
  needDeletionCheck = false;
@@ -4220,7 +4244,7 @@ const updateSlots = (instance, children, optimized) => {
4220
4244
  // when rendering the optimized slots by manually written render function,
4221
4245
  // we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
4222
4246
  // i.e. let the `renderSlot` create the bailed Fragment
4223
- if (!optimized && type === 1 /* STABLE */) {
4247
+ if (!optimized && type === 1 /* SlotFlags.STABLE */) {
4224
4248
  delete slots._;
4225
4249
  }
4226
4250
  }
@@ -4431,7 +4455,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4431
4455
  // because the template ref is forwarded to inner component
4432
4456
  return;
4433
4457
  }
4434
- const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
4458
+ const refValue = vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */
4435
4459
  ? getExposeProxy(vnode.component) || vnode.component.proxy
4436
4460
  : vnode.el;
4437
4461
  const value = isUnmount ? null : refValue;
@@ -4457,7 +4481,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4457
4481
  }
4458
4482
  }
4459
4483
  if (shared.isFunction(ref)) {
4460
- callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
4484
+ callWithErrorHandling(ref, owner, 12 /* ErrorCodes.FUNCTION_REF */, [value, refs]);
4461
4485
  }
4462
4486
  else {
4463
4487
  const _isString = shared.isString(ref);
@@ -4494,7 +4518,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4494
4518
  setupState[ref] = value;
4495
4519
  }
4496
4520
  }
4497
- else if (reactivity.isRef(ref)) {
4521
+ else if (_isRef) {
4498
4522
  ref.value = value;
4499
4523
  if (rawRef.k)
4500
4524
  refs[rawRef.k] = value;
@@ -4519,7 +4543,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4519
4543
 
4520
4544
  let hasMismatch = false;
4521
4545
  const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
4522
- const isComment = (node) => node.nodeType === 8 /* COMMENT */;
4546
+ const isComment = (node) => node.nodeType === 8 /* DOMNodeTypes.COMMENT */;
4523
4547
  // Note: hydration is DOM-specific
4524
4548
  // But we have to place it in core due to tight coupling with core - splitting
4525
4549
  // it out creates a ton of unnecessary complexity.
@@ -4533,11 +4557,13 @@ function createHydrationFunctions(rendererInternals) {
4533
4557
  `Performing full mount instead.`);
4534
4558
  patch(null, vnode, container);
4535
4559
  flushPostFlushCbs();
4560
+ container._vnode = vnode;
4536
4561
  return;
4537
4562
  }
4538
4563
  hasMismatch = false;
4539
4564
  hydrateNode(container.firstChild, vnode, null, null, null);
4540
4565
  flushPostFlushCbs();
4566
+ container._vnode = vnode;
4541
4567
  if (hasMismatch && !false) {
4542
4568
  // this error should show up in production
4543
4569
  console.error(`Hydration completed but contains mismatches.`);
@@ -4549,14 +4575,14 @@ function createHydrationFunctions(rendererInternals) {
4549
4575
  const { type, ref, shapeFlag, patchFlag } = vnode;
4550
4576
  const domType = node.nodeType;
4551
4577
  vnode.el = node;
4552
- if (patchFlag === -2 /* BAIL */) {
4578
+ if (patchFlag === -2 /* PatchFlags.BAIL */) {
4553
4579
  optimized = false;
4554
4580
  vnode.dynamicChildren = null;
4555
4581
  }
4556
4582
  let nextNode = null;
4557
4583
  switch (type) {
4558
4584
  case Text:
4559
- if (domType !== 3 /* TEXT */) {
4585
+ if (domType !== 3 /* DOMNodeTypes.TEXT */) {
4560
4586
  // #5728 empty text node inside a slot can cause hydration failure
4561
4587
  // because the server rendered HTML won't contain a text node
4562
4588
  if (vnode.children === '') {
@@ -4579,7 +4605,7 @@ function createHydrationFunctions(rendererInternals) {
4579
4605
  }
4580
4606
  break;
4581
4607
  case Comment:
4582
- if (domType !== 8 /* COMMENT */ || isFragmentStart) {
4608
+ if (domType !== 8 /* DOMNodeTypes.COMMENT */ || isFragmentStart) {
4583
4609
  nextNode = onMismatch();
4584
4610
  }
4585
4611
  else {
@@ -4587,7 +4613,7 @@ function createHydrationFunctions(rendererInternals) {
4587
4613
  }
4588
4614
  break;
4589
4615
  case Static:
4590
- if (domType !== 1 /* ELEMENT */) {
4616
+ if (domType !== 1 /* DOMNodeTypes.ELEMENT */ && domType !== 3 /* DOMNodeTypes.TEXT */) {
4591
4617
  nextNode = onMismatch();
4592
4618
  }
4593
4619
  else {
@@ -4598,7 +4624,10 @@ function createHydrationFunctions(rendererInternals) {
4598
4624
  const needToAdoptContent = !vnode.children.length;
4599
4625
  for (let i = 0; i < vnode.staticCount; i++) {
4600
4626
  if (needToAdoptContent)
4601
- vnode.children += nextNode.outerHTML;
4627
+ vnode.children +=
4628
+ nextNode.nodeType === 1 /* DOMNodeTypes.ELEMENT */
4629
+ ? nextNode.outerHTML
4630
+ : nextNode.data;
4602
4631
  if (i === vnode.staticCount - 1) {
4603
4632
  vnode.anchor = nextNode;
4604
4633
  }
@@ -4616,8 +4645,8 @@ function createHydrationFunctions(rendererInternals) {
4616
4645
  }
4617
4646
  break;
4618
4647
  default:
4619
- if (shapeFlag & 1 /* ELEMENT */) {
4620
- if (domType !== 1 /* ELEMENT */ ||
4648
+ if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
4649
+ if (domType !== 1 /* DOMNodeTypes.ELEMENT */ ||
4621
4650
  vnode.type.toLowerCase() !==
4622
4651
  node.tagName.toLowerCase()) {
4623
4652
  nextNode = onMismatch();
@@ -4626,7 +4655,7 @@ function createHydrationFunctions(rendererInternals) {
4626
4655
  nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4627
4656
  }
4628
4657
  }
4629
- else if (shapeFlag & 6 /* COMPONENT */) {
4658
+ else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
4630
4659
  // when setting up the render effect, if the initial vnode already
4631
4660
  // has .el set, the component will perform hydration instead of mount
4632
4661
  // on its sub-tree.
@@ -4665,15 +4694,15 @@ function createHydrationFunctions(rendererInternals) {
4665
4694
  vnode.component.subTree = subTree;
4666
4695
  }
4667
4696
  }
4668
- else if (shapeFlag & 64 /* TELEPORT */) {
4669
- if (domType !== 8 /* COMMENT */) {
4697
+ else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
4698
+ if (domType !== 8 /* DOMNodeTypes.COMMENT */) {
4670
4699
  nextNode = onMismatch();
4671
4700
  }
4672
4701
  else {
4673
4702
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
4674
4703
  }
4675
4704
  }
4676
- else if (shapeFlag & 128 /* SUSPENSE */) {
4705
+ else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
4677
4706
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
4678
4707
  }
4679
4708
  else {
@@ -4701,7 +4730,7 @@ function createHydrationFunctions(rendererInternals) {
4701
4730
  if (props) {
4702
4731
  if (forcePatchValue ||
4703
4732
  !optimized ||
4704
- patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {
4733
+ patchFlag & (16 /* PatchFlags.FULL_PROPS */ | 32 /* PatchFlags.HYDRATE_EVENTS */)) {
4705
4734
  for (const key in props) {
4706
4735
  if ((forcePatchValue && key.endsWith('value')) ||
4707
4736
  (shared.isOn(key) && !shared.isReservedProp(key))) {
@@ -4730,7 +4759,7 @@ function createHydrationFunctions(rendererInternals) {
4730
4759
  }, parentSuspense);
4731
4760
  }
4732
4761
  // children
4733
- if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&
4762
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */ &&
4734
4763
  // skip if element has innerHTML / textContent
4735
4764
  !(props && (props.innerHTML || props.textContent))) {
4736
4765
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -4748,7 +4777,7 @@ function createHydrationFunctions(rendererInternals) {
4748
4777
  remove(cur);
4749
4778
  }
4750
4779
  }
4751
- else if (shapeFlag & 8 /* TEXT_CHILDREN */) {
4780
+ else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
4752
4781
  if (el.textContent !== vnode.children) {
4753
4782
  hasMismatch = true;
4754
4783
  warn(`Hydration text content mismatch in <${vnode.type}>:\n` +
@@ -4811,7 +4840,7 @@ function createHydrationFunctions(rendererInternals) {
4811
4840
  };
4812
4841
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4813
4842
  hasMismatch = true;
4814
- warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */
4843
+ warn(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
4815
4844
  ? `(text)`
4816
4845
  : isComment(node) && node.data === '['
4817
4846
  ? `(start of fragment)`
@@ -4942,7 +4971,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4942
4971
  unmount(n1, parentComponent, parentSuspense, true);
4943
4972
  n1 = null;
4944
4973
  }
4945
- if (n2.patchFlag === -2 /* BAIL */) {
4974
+ if (n2.patchFlag === -2 /* PatchFlags.BAIL */) {
4946
4975
  optimized = false;
4947
4976
  n2.dynamicChildren = null;
4948
4977
  }
@@ -4966,16 +4995,16 @@ function baseCreateRenderer(options, createHydrationFns) {
4966
4995
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
4967
4996
  break;
4968
4997
  default:
4969
- if (shapeFlag & 1 /* ELEMENT */) {
4998
+ if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
4970
4999
  processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
4971
5000
  }
4972
- else if (shapeFlag & 6 /* COMPONENT */) {
5001
+ else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
4973
5002
  processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
4974
5003
  }
4975
- else if (shapeFlag & 64 /* TELEPORT */) {
5004
+ else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
4976
5005
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
4977
5006
  }
4978
- else if (shapeFlag & 128 /* SUSPENSE */) {
5007
+ else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
4979
5008
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
4980
5009
  }
4981
5010
  else {
@@ -5061,10 +5090,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5061
5090
  el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
5062
5091
  // mount children first, since some props may rely on child content
5063
5092
  // being already rendered, e.g. `<select value>`
5064
- if (shapeFlag & 8 /* TEXT_CHILDREN */) {
5093
+ if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
5065
5094
  hostSetElementText(el, vnode.children);
5066
5095
  }
5067
- else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
5096
+ else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
5068
5097
  mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
5069
5098
  }
5070
5099
  if (dirs) {
@@ -5140,7 +5169,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5140
5169
  if (parentComponent) {
5141
5170
  let subTree = parentComponent.subTree;
5142
5171
  if (subTree.patchFlag > 0 &&
5143
- subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
5172
+ subTree.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
5144
5173
  subTree =
5145
5174
  filterSingleRoot(subTree.children) || subTree;
5146
5175
  }
@@ -5163,7 +5192,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5163
5192
  let { patchFlag, dynamicChildren, dirs } = n2;
5164
5193
  // #1426 take the old vnode's patch flag into account since user may clone a
5165
5194
  // compiler-generated vnode, which de-opts to FULL_PROPS
5166
- patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;
5195
+ patchFlag |= n1.patchFlag & 16 /* PatchFlags.FULL_PROPS */;
5167
5196
  const oldProps = n1.props || shared.EMPTY_OBJ;
5168
5197
  const newProps = n2.props || shared.EMPTY_OBJ;
5169
5198
  let vnodeHook;
@@ -5198,21 +5227,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5198
5227
  // generated by the compiler and can take the fast path.
5199
5228
  // in this path old node and new node are guaranteed to have the same shape
5200
5229
  // (i.e. at the exact same position in the source template)
5201
- if (patchFlag & 16 /* FULL_PROPS */) {
5230
+ if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
5202
5231
  // element props contain dynamic keys, full diff needed
5203
5232
  patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
5204
5233
  }
5205
5234
  else {
5206
5235
  // class
5207
5236
  // this flag is matched when the element has dynamic class bindings.
5208
- if (patchFlag & 2 /* CLASS */) {
5237
+ if (patchFlag & 2 /* PatchFlags.CLASS */) {
5209
5238
  if (oldProps.class !== newProps.class) {
5210
5239
  hostPatchProp(el, 'class', null, newProps.class, isSVG);
5211
5240
  }
5212
5241
  }
5213
5242
  // style
5214
5243
  // this flag is matched when the element has dynamic style bindings
5215
- if (patchFlag & 4 /* STYLE */) {
5244
+ if (patchFlag & 4 /* PatchFlags.STYLE */) {
5216
5245
  hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);
5217
5246
  }
5218
5247
  // props
@@ -5221,7 +5250,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5221
5250
  // faster iteration.
5222
5251
  // Note dynamic keys like :[foo]="bar" will cause this optimization to
5223
5252
  // bail out and go through a full diff because we need to unset the old key
5224
- if (patchFlag & 8 /* PROPS */) {
5253
+ if (patchFlag & 8 /* PatchFlags.PROPS */) {
5225
5254
  // if the flag is present then dynamicProps must be non-null
5226
5255
  const propsToUpdate = n2.dynamicProps;
5227
5256
  for (let i = 0; i < propsToUpdate.length; i++) {
@@ -5237,7 +5266,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5237
5266
  }
5238
5267
  // text
5239
5268
  // This flag is matched when the element has only dynamic text children.
5240
- if (patchFlag & 1 /* TEXT */) {
5269
+ if (patchFlag & 1 /* PatchFlags.TEXT */) {
5241
5270
  if (n1.children !== n2.children) {
5242
5271
  hostSetElementText(el, n2.children);
5243
5272
  }
@@ -5271,7 +5300,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5271
5300
  // which also requires the correct parent container
5272
5301
  !isSameVNodeType(oldVNode, newVNode) ||
5273
5302
  // - In the case of a component, it could contain anything.
5274
- oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))
5303
+ oldVNode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 64 /* ShapeFlags.TELEPORT */))
5275
5304
  ? hostParentNode(oldVNode.el)
5276
5305
  : // In other cases, the parent container is not actually used so we
5277
5306
  // just pass the block element here to avoid a DOM parentNode call.
@@ -5309,7 +5338,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5309
5338
  const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
5310
5339
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
5311
5340
  if (// #5523 dev root fragment may inherit directives
5312
- (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
5341
+ (isHmrUpdating || patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */)) {
5313
5342
  // HMR updated / Dev root fragment (w/ comments), force full diff
5314
5343
  patchFlag = 0;
5315
5344
  optimized = false;
@@ -5331,7 +5360,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5331
5360
  }
5332
5361
  else {
5333
5362
  if (patchFlag > 0 &&
5334
- patchFlag & 64 /* STABLE_FRAGMENT */ &&
5363
+ patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */ &&
5335
5364
  dynamicChildren &&
5336
5365
  // #2715 the previous fragment could've been a BAILed one as a result
5337
5366
  // of renderSlot() with no valid children
@@ -5364,7 +5393,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5364
5393
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
5365
5394
  n2.slotScopeIds = slotScopeIds;
5366
5395
  if (n1 == null) {
5367
- if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
5396
+ if (n2.shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
5368
5397
  parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
5369
5398
  }
5370
5399
  else {
@@ -5526,10 +5555,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5526
5555
  // activated hook for keep-alive roots.
5527
5556
  // #1742 activated hook must be accessed after first render
5528
5557
  // since the hook may be injected by a child keep-alive
5529
- if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */ ||
5558
+ if (initialVNode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */ ||
5530
5559
  (parent &&
5531
5560
  isAsyncWrapper(parent.vnode) &&
5532
- parent.vnode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */)) {
5561
+ parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
5533
5562
  instance.a && queuePostRenderEffect(instance.a, parentSuspense);
5534
5563
  }
5535
5564
  instance.isMounted = true;
@@ -5640,7 +5669,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5640
5669
  reactivity.pauseTracking();
5641
5670
  // props update may have triggered pre-flush watchers.
5642
5671
  // flush them before the render update.
5643
- flushPreFlushCbs(undefined, instance.update);
5672
+ flushPreFlushCbs();
5644
5673
  reactivity.resetTracking();
5645
5674
  };
5646
5675
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -5650,22 +5679,22 @@ function baseCreateRenderer(options, createHydrationFns) {
5650
5679
  const { patchFlag, shapeFlag } = n2;
5651
5680
  // fast path
5652
5681
  if (patchFlag > 0) {
5653
- if (patchFlag & 128 /* KEYED_FRAGMENT */) {
5682
+ if (patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */) {
5654
5683
  // this could be either fully-keyed or mixed (some keyed some not)
5655
5684
  // presence of patchFlag means children are guaranteed to be arrays
5656
5685
  patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
5657
5686
  return;
5658
5687
  }
5659
- else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {
5688
+ else if (patchFlag & 256 /* PatchFlags.UNKEYED_FRAGMENT */) {
5660
5689
  // unkeyed
5661
5690
  patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
5662
5691
  return;
5663
5692
  }
5664
5693
  }
5665
5694
  // children has 3 possibilities: text, array or no children.
5666
- if (shapeFlag & 8 /* TEXT_CHILDREN */) {
5695
+ if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
5667
5696
  // text children fast path
5668
- if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
5697
+ if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
5669
5698
  unmountChildren(c1, parentComponent, parentSuspense);
5670
5699
  }
5671
5700
  if (c2 !== c1) {
@@ -5673,9 +5702,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5673
5702
  }
5674
5703
  }
5675
5704
  else {
5676
- if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
5705
+ if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
5677
5706
  // prev children was array
5678
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
5707
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
5679
5708
  // two arrays, cannot assume anything, do full diff
5680
5709
  patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
5681
5710
  }
@@ -5687,11 +5716,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5687
5716
  else {
5688
5717
  // prev children was text OR null
5689
5718
  // new children is array OR null
5690
- if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {
5719
+ if (prevShapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
5691
5720
  hostSetElementText(container, '');
5692
5721
  }
5693
5722
  // mount new if array
5694
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
5723
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
5695
5724
  mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
5696
5725
  }
5697
5726
  }
@@ -5882,7 +5911,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5882
5911
  // There is no stable subsequence (e.g. a reverse)
5883
5912
  // OR current node is not among the stable sequence
5884
5913
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
5885
- move(nextChild, container, anchor, 2 /* REORDER */);
5914
+ move(nextChild, container, anchor, 2 /* MoveType.REORDER */);
5886
5915
  }
5887
5916
  else {
5888
5917
  j--;
@@ -5893,15 +5922,15 @@ function baseCreateRenderer(options, createHydrationFns) {
5893
5922
  };
5894
5923
  const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
5895
5924
  const { el, type, transition, children, shapeFlag } = vnode;
5896
- if (shapeFlag & 6 /* COMPONENT */) {
5925
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
5897
5926
  move(vnode.component.subTree, container, anchor, moveType);
5898
5927
  return;
5899
5928
  }
5900
- if (shapeFlag & 128 /* SUSPENSE */) {
5929
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
5901
5930
  vnode.suspense.move(container, anchor, moveType);
5902
5931
  return;
5903
5932
  }
5904
- if (shapeFlag & 64 /* TELEPORT */) {
5933
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
5905
5934
  type.move(vnode, container, anchor, internals);
5906
5935
  return;
5907
5936
  }
@@ -5918,11 +5947,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5918
5947
  return;
5919
5948
  }
5920
5949
  // single nodes
5921
- const needTransition = moveType !== 2 /* REORDER */ &&
5922
- shapeFlag & 1 /* ELEMENT */ &&
5950
+ const needTransition = moveType !== 2 /* MoveType.REORDER */ &&
5951
+ shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
5923
5952
  transition;
5924
5953
  if (needTransition) {
5925
- if (moveType === 0 /* ENTER */) {
5954
+ if (moveType === 0 /* MoveType.ENTER */) {
5926
5955
  transition.beforeEnter(el);
5927
5956
  hostInsert(el, container, anchor);
5928
5957
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
@@ -5954,42 +5983,42 @@ function baseCreateRenderer(options, createHydrationFns) {
5954
5983
  if (ref != null) {
5955
5984
  setRef(ref, null, parentSuspense, vnode, true);
5956
5985
  }
5957
- if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
5986
+ if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
5958
5987
  parentComponent.ctx.deactivate(vnode);
5959
5988
  return;
5960
5989
  }
5961
- const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;
5990
+ const shouldInvokeDirs = shapeFlag & 1 /* ShapeFlags.ELEMENT */ && dirs;
5962
5991
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
5963
5992
  let vnodeHook;
5964
5993
  if (shouldInvokeVnodeHook &&
5965
5994
  (vnodeHook = props && props.onVnodeBeforeUnmount)) {
5966
5995
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
5967
5996
  }
5968
- if (shapeFlag & 6 /* COMPONENT */) {
5997
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
5969
5998
  unmountComponent(vnode.component, parentSuspense, doRemove);
5970
5999
  }
5971
6000
  else {
5972
- if (shapeFlag & 128 /* SUSPENSE */) {
6001
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
5973
6002
  vnode.suspense.unmount(parentSuspense, doRemove);
5974
6003
  return;
5975
6004
  }
5976
6005
  if (shouldInvokeDirs) {
5977
6006
  invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');
5978
6007
  }
5979
- if (shapeFlag & 64 /* TELEPORT */) {
6008
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
5980
6009
  vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
5981
6010
  }
5982
6011
  else if (dynamicChildren &&
5983
6012
  // #1153: fast path should not be taken for non-stable (v-for) fragments
5984
6013
  (type !== Fragment ||
5985
- (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {
6014
+ (patchFlag > 0 && patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */))) {
5986
6015
  // fast path for block nodes: only need to unmount dynamic children.
5987
6016
  unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
5988
6017
  }
5989
6018
  else if ((type === Fragment &&
5990
6019
  patchFlag &
5991
- (128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||
5992
- (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {
6020
+ (128 /* PatchFlags.KEYED_FRAGMENT */ | 256 /* PatchFlags.UNKEYED_FRAGMENT */)) ||
6021
+ (!optimized && shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */)) {
5993
6022
  unmountChildren(children, parentComponent, parentSuspense);
5994
6023
  }
5995
6024
  if (doRemove) {
@@ -6010,7 +6039,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6010
6039
  const { type, el, anchor, transition } = vnode;
6011
6040
  if (type === Fragment) {
6012
6041
  if (vnode.patchFlag > 0 &&
6013
- vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
6042
+ vnode.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */ &&
6014
6043
  transition &&
6015
6044
  !transition.persisted) {
6016
6045
  vnode.children.forEach(child => {
@@ -6037,7 +6066,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6037
6066
  transition.afterLeave();
6038
6067
  }
6039
6068
  };
6040
- if (vnode.shapeFlag & 1 /* ELEMENT */ &&
6069
+ if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
6041
6070
  transition &&
6042
6071
  !transition.persisted) {
6043
6072
  const { leave, delayLeave } = transition;
@@ -6113,10 +6142,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6113
6142
  }
6114
6143
  };
6115
6144
  const getNextHostNode = vnode => {
6116
- if (vnode.shapeFlag & 6 /* COMPONENT */) {
6145
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
6117
6146
  return getNextHostNode(vnode.component.subTree);
6118
6147
  }
6119
- if (vnode.shapeFlag & 128 /* SUSPENSE */) {
6148
+ if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
6120
6149
  return vnode.suspense.next();
6121
6150
  }
6122
6151
  return hostNextSibling((vnode.anchor || vnode.el));
@@ -6130,6 +6159,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6130
6159
  else {
6131
6160
  patch(container._vnode || null, vnode, container, null, null, null, isSVG);
6132
6161
  }
6162
+ flushPreFlushCbs();
6133
6163
  flushPostFlushCbs();
6134
6164
  container._vnode = vnode;
6135
6165
  };
@@ -6179,8 +6209,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6179
6209
  // guaranteed to be vnodes
6180
6210
  const c1 = ch1[i];
6181
6211
  let c2 = ch2[i];
6182
- if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {
6183
- if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {
6212
+ if (c2.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && !c2.dynamicChildren) {
6213
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* PatchFlags.HYDRATE_EVENTS */) {
6184
6214
  c2 = ch2[i] = cloneIfMounted(ch2[i]);
6185
6215
  c2.el = c1.el;
6186
6216
  }
@@ -6300,7 +6330,7 @@ const TeleportImpl = {
6300
6330
  const mount = (container, anchor) => {
6301
6331
  // Teleport *always* has Array children. This is enforced in both the
6302
6332
  // compiler and vnode children normalization.
6303
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
6333
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
6304
6334
  mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
6305
6335
  }
6306
6336
  };
@@ -6336,7 +6366,7 @@ const TeleportImpl = {
6336
6366
  if (!wasDisabled) {
6337
6367
  // enabled -> disabled
6338
6368
  // move into main container
6339
- moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);
6369
+ moveTeleport(n2, container, mainAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
6340
6370
  }
6341
6371
  }
6342
6372
  else {
@@ -6344,7 +6374,7 @@ const TeleportImpl = {
6344
6374
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
6345
6375
  const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));
6346
6376
  if (nextTarget) {
6347
- moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);
6377
+ moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
6348
6378
  }
6349
6379
  else {
6350
6380
  warn('Invalid Teleport target on update:', target, `(${typeof target})`);
@@ -6353,7 +6383,7 @@ const TeleportImpl = {
6353
6383
  else if (wasDisabled) {
6354
6384
  // disabled -> enabled
6355
6385
  // move into teleport target
6356
- moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);
6386
+ moveTeleport(n2, target, targetAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
6357
6387
  }
6358
6388
  }
6359
6389
  }
@@ -6366,7 +6396,7 @@ const TeleportImpl = {
6366
6396
  // an unmounted teleport should always remove its children if not disabled
6367
6397
  if (doRemove || !isTeleportDisabled(props)) {
6368
6398
  hostRemove(anchor);
6369
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
6399
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
6370
6400
  for (let i = 0; i < children.length; i++) {
6371
6401
  const child = children[i];
6372
6402
  unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
@@ -6377,13 +6407,13 @@ const TeleportImpl = {
6377
6407
  move: moveTeleport,
6378
6408
  hydrate: hydrateTeleport
6379
6409
  };
6380
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {
6410
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* TeleportMoveTypes.REORDER */) {
6381
6411
  // move target anchor if this is a target change.
6382
- if (moveType === 0 /* TARGET_CHANGE */) {
6412
+ if (moveType === 0 /* TeleportMoveTypes.TARGET_CHANGE */) {
6383
6413
  insert(vnode.targetAnchor, container, parentAnchor);
6384
6414
  }
6385
6415
  const { el, anchor, shapeFlag, children, props } = vnode;
6386
- const isReorder = moveType === 2 /* REORDER */;
6416
+ const isReorder = moveType === 2 /* TeleportMoveTypes.REORDER */;
6387
6417
  // move main view anchor if this is a re-order.
6388
6418
  if (isReorder) {
6389
6419
  insert(el, container, parentAnchor);
@@ -6393,9 +6423,9 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
6393
6423
  // is not a reorder, or the teleport is disabled
6394
6424
  if (!isReorder || isTeleportDisabled(props)) {
6395
6425
  // Teleport has either Array children or no children.
6396
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
6426
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
6397
6427
  for (let i = 0; i < children.length; i++) {
6398
- move(children[i], container, parentAnchor, 2 /* REORDER */);
6428
+ move(children[i], container, parentAnchor, 2 /* MoveType.REORDER */);
6399
6429
  }
6400
6430
  }
6401
6431
  }
@@ -6410,7 +6440,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
6410
6440
  // if multiple teleports rendered to the same target element, we need to
6411
6441
  // pick up from where the last teleport finished instead of the first node
6412
6442
  const targetNode = target._lpa || target.firstChild;
6413
- if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
6443
+ if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
6414
6444
  if (isTeleportDisabled(vnode.props)) {
6415
6445
  vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
6416
6446
  vnode.targetAnchor = targetNode;
@@ -6532,7 +6562,7 @@ function isVNode(value) {
6532
6562
  return value ? value.__v_isVNode === true : false;
6533
6563
  }
6534
6564
  function isSameVNodeType(n1, n2) {
6535
- if (n2.shapeFlag & 6 /* COMPONENT */ &&
6565
+ if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
6536
6566
  hmrDirtyComponents.has(n2.type)) {
6537
6567
  // HMR only: if the component has been hot-updated, force a reload.
6538
6568
  return false;
@@ -6563,7 +6593,7 @@ const normalizeRef = ({ ref, ref_key, ref_for }) => {
6563
6593
  : ref
6564
6594
  : null);
6565
6595
  };
6566
- function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
6596
+ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ShapeFlags.ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
6567
6597
  const vnode = {
6568
6598
  __v_isVNode: true,
6569
6599
  __v_skip: true,
@@ -6594,7 +6624,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
6594
6624
  if (needFullChildrenNormalization) {
6595
6625
  normalizeChildren(vnode, children);
6596
6626
  // normalize suspense children
6597
- if (shapeFlag & 128 /* SUSPENSE */) {
6627
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
6598
6628
  type.normalize(vnode);
6599
6629
  }
6600
6630
  }
@@ -6602,8 +6632,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
6602
6632
  // compiled element vnode - if children is passed, only possible types are
6603
6633
  // string or Array.
6604
6634
  vnode.shapeFlag |= shared.isString(children)
6605
- ? 8 /* TEXT_CHILDREN */
6606
- : 16 /* ARRAY_CHILDREN */;
6635
+ ? 8 /* ShapeFlags.TEXT_CHILDREN */
6636
+ : 16 /* ShapeFlags.ARRAY_CHILDREN */;
6607
6637
  }
6608
6638
  // validate key
6609
6639
  if (vnode.key !== vnode.key) {
@@ -6619,10 +6649,10 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
6619
6649
  // component nodes also should always be patched, because even if the
6620
6650
  // component doesn't need to update, it needs to persist the instance on to
6621
6651
  // the next vnode so that it can be properly unmounted later.
6622
- (vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
6652
+ (vnode.patchFlag > 0 || shapeFlag & 6 /* ShapeFlags.COMPONENT */) &&
6623
6653
  // the EVENTS flag is only for hydration and if it is the only flag, the
6624
6654
  // vnode should not be considered dynamic due to handler caching.
6625
- vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {
6655
+ vnode.patchFlag !== 32 /* PatchFlags.HYDRATE_EVENTS */) {
6626
6656
  currentBlock.push(vnode);
6627
6657
  }
6628
6658
  return vnode;
@@ -6644,14 +6674,14 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
6644
6674
  normalizeChildren(cloned, children);
6645
6675
  }
6646
6676
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
6647
- if (cloned.shapeFlag & 6 /* COMPONENT */) {
6677
+ if (cloned.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
6648
6678
  currentBlock[currentBlock.indexOf(type)] = cloned;
6649
6679
  }
6650
6680
  else {
6651
6681
  currentBlock.push(cloned);
6652
6682
  }
6653
6683
  }
6654
- cloned.patchFlag |= -2 /* BAIL */;
6684
+ cloned.patchFlag |= -2 /* PatchFlags.BAIL */;
6655
6685
  return cloned;
6656
6686
  }
6657
6687
  // class component normalization.
@@ -6677,17 +6707,17 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
6677
6707
  }
6678
6708
  // encode the vnode type information into a bitmap
6679
6709
  const shapeFlag = shared.isString(type)
6680
- ? 1 /* ELEMENT */
6710
+ ? 1 /* ShapeFlags.ELEMENT */
6681
6711
  : isSuspense(type)
6682
- ? 128 /* SUSPENSE */
6712
+ ? 128 /* ShapeFlags.SUSPENSE */
6683
6713
  : isTeleport(type)
6684
- ? 64 /* TELEPORT */
6714
+ ? 64 /* ShapeFlags.TELEPORT */
6685
6715
  : shared.isObject(type)
6686
- ? 4 /* STATEFUL_COMPONENT */
6716
+ ? 4 /* ShapeFlags.STATEFUL_COMPONENT */
6687
6717
  : shared.isFunction(type)
6688
- ? 2 /* FUNCTIONAL_COMPONENT */
6718
+ ? 2 /* ShapeFlags.FUNCTIONAL_COMPONENT */
6689
6719
  : 0;
6690
- if (shapeFlag & 4 /* STATEFUL_COMPONENT */ && reactivity.isProxy(type)) {
6720
+ if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && reactivity.isProxy(type)) {
6691
6721
  type = reactivity.toRaw(type);
6692
6722
  warn(`Vue received a Component which was made a reactive object. This can ` +
6693
6723
  `lead to unnecessary performance overhead, and should be avoided by ` +
@@ -6726,7 +6756,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
6726
6756
  : ref,
6727
6757
  scopeId: vnode.scopeId,
6728
6758
  slotScopeIds: vnode.slotScopeIds,
6729
- children: patchFlag === -1 /* HOISTED */ && shared.isArray(children)
6759
+ children: patchFlag === -1 /* PatchFlags.HOISTED */ && shared.isArray(children)
6730
6760
  ? children.map(deepCloneVNode)
6731
6761
  : children,
6732
6762
  target: vnode.target,
@@ -6739,8 +6769,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
6739
6769
  // fast paths only.
6740
6770
  patchFlag: extraProps && vnode.type !== Fragment
6741
6771
  ? patchFlag === -1 // hoisted node
6742
- ? 16 /* FULL_PROPS */
6743
- : patchFlag | 16 /* FULL_PROPS */
6772
+ ? 16 /* PatchFlags.FULL_PROPS */
6773
+ : patchFlag | 16 /* PatchFlags.FULL_PROPS */
6744
6774
  : patchFlag,
6745
6775
  dynamicProps: vnode.dynamicProps,
6746
6776
  dynamicChildren: vnode.dynamicChildren,
@@ -6830,10 +6860,10 @@ function normalizeChildren(vnode, children) {
6830
6860
  children = null;
6831
6861
  }
6832
6862
  else if (shared.isArray(children)) {
6833
- type = 16 /* ARRAY_CHILDREN */;
6863
+ type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
6834
6864
  }
6835
6865
  else if (typeof children === 'object') {
6836
- if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {
6866
+ if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 64 /* ShapeFlags.TELEPORT */)) {
6837
6867
  // Normalize slot to plain children for plain element and Teleport
6838
6868
  const slot = children.default;
6839
6869
  if (slot) {
@@ -6845,37 +6875,37 @@ function normalizeChildren(vnode, children) {
6845
6875
  return;
6846
6876
  }
6847
6877
  else {
6848
- type = 32 /* SLOTS_CHILDREN */;
6878
+ type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
6849
6879
  const slotFlag = children._;
6850
6880
  if (!slotFlag && !(InternalObjectKey in children)) {
6851
6881
  children._ctx = currentRenderingInstance;
6852
6882
  }
6853
- else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
6883
+ else if (slotFlag === 3 /* SlotFlags.FORWARDED */ && currentRenderingInstance) {
6854
6884
  // a child component receives forwarded slots from the parent.
6855
6885
  // its slot type is determined by its parent's slot type.
6856
- if (currentRenderingInstance.slots._ === 1 /* STABLE */) {
6857
- children._ = 1 /* STABLE */;
6886
+ if (currentRenderingInstance.slots._ === 1 /* SlotFlags.STABLE */) {
6887
+ children._ = 1 /* SlotFlags.STABLE */;
6858
6888
  }
6859
6889
  else {
6860
- children._ = 2 /* DYNAMIC */;
6861
- vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
6890
+ children._ = 2 /* SlotFlags.DYNAMIC */;
6891
+ vnode.patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
6862
6892
  }
6863
6893
  }
6864
6894
  }
6865
6895
  }
6866
6896
  else if (shared.isFunction(children)) {
6867
6897
  children = { default: children, _ctx: currentRenderingInstance };
6868
- type = 32 /* SLOTS_CHILDREN */;
6898
+ type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
6869
6899
  }
6870
6900
  else {
6871
6901
  children = String(children);
6872
6902
  // force teleport children to array so it can be moved around
6873
- if (shapeFlag & 64 /* TELEPORT */) {
6874
- type = 16 /* ARRAY_CHILDREN */;
6903
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
6904
+ type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
6875
6905
  children = [createTextVNode(children)];
6876
6906
  }
6877
6907
  else {
6878
- type = 8 /* TEXT_CHILDREN */;
6908
+ type = 8 /* ShapeFlags.TEXT_CHILDREN */;
6879
6909
  }
6880
6910
  }
6881
6911
  vnode.children = children;
@@ -6913,7 +6943,7 @@ function mergeProps(...args) {
6913
6943
  return ret;
6914
6944
  }
6915
6945
  function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
6916
- callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
6946
+ callWithAsyncErrorHandling(hook, instance, 7 /* ErrorCodes.VNODE_HOOK */, [
6917
6947
  vnode,
6918
6948
  prevVNode
6919
6949
  ]);
@@ -7021,7 +7051,7 @@ function validateComponentName(name, config) {
7021
7051
  }
7022
7052
  }
7023
7053
  function isStatefulComponent(instance) {
7024
- return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;
7054
+ return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
7025
7055
  }
7026
7056
  let isInSSRComponentSetup = false;
7027
7057
  function setupComponent(instance, isSSR = false) {
@@ -7076,7 +7106,7 @@ function setupStatefulComponent(instance, isSSR) {
7076
7106
  setup.length > 1 ? createSetupContext(instance) : null);
7077
7107
  setCurrentInstance(instance);
7078
7108
  reactivity.pauseTracking();
7079
- const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [reactivity.shallowReadonly(instance.props) , setupContext]);
7109
+ const setupResult = callWithErrorHandling(setup, instance, 0 /* ErrorCodes.SETUP_FUNCTION */, [reactivity.shallowReadonly(instance.props) , setupContext]);
7080
7110
  reactivity.resetTracking();
7081
7111
  unsetCurrentInstance();
7082
7112
  if (shared.isPromise(setupResult)) {
@@ -7088,7 +7118,7 @@ function setupStatefulComponent(instance, isSSR) {
7088
7118
  handleSetupResult(instance, resolvedResult, isSSR);
7089
7119
  })
7090
7120
  .catch(e => {
7091
- handleError(e, instance, 0 /* SETUP_FUNCTION */);
7121
+ handleError(e, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
7092
7122
  });
7093
7123
  }
7094
7124
  else {
@@ -7168,7 +7198,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
7168
7198
  // only do on-the-fly compile if not in SSR - SSR on-the-fly compilation
7169
7199
  // is done by server-renderer
7170
7200
  if (!isSSR && compile && !Component.render) {
7171
- const template = Component.template;
7201
+ const template = Component.template ||
7202
+ resolveMergedOptions(instance).template;
7172
7203
  if (template) {
7173
7204
  {
7174
7205
  startMeasure(instance, `compile`);
@@ -7219,7 +7250,7 @@ function createAttrsProxy(instance) {
7219
7250
  return new Proxy(instance.attrs, {
7220
7251
  get(target, key) {
7221
7252
  markAttrsAccessed();
7222
- reactivity.track(instance, "get" /* GET */, '$attrs');
7253
+ reactivity.track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
7223
7254
  return target[key];
7224
7255
  },
7225
7256
  set() {
@@ -7275,10 +7306,10 @@ function getExposeProxy(instance) {
7275
7306
  }
7276
7307
  const classifyRE = /(?:^|[-_])(\w)/g;
7277
7308
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
7278
- function getComponentName(Component) {
7309
+ function getComponentName(Component, includeInferred = true) {
7279
7310
  return shared.isFunction(Component)
7280
7311
  ? Component.displayName || Component.name
7281
- : Component.name;
7312
+ : Component.name || (includeInferred && Component.__name);
7282
7313
  }
7283
7314
  /* istanbul ignore next */
7284
7315
  function formatComponentName(instance, Component, isRoot = false) {
@@ -7506,7 +7537,7 @@ const useSSRContext = () => {
7506
7537
  };
7507
7538
 
7508
7539
  function isShallow(value) {
7509
- return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
7540
+ return !!(value && value["__v_isShallow" /* ReactiveFlags.IS_SHALLOW */]);
7510
7541
  }
7511
7542
 
7512
7543
  function initCustomFormatter() {
@@ -7726,7 +7757,7 @@ function isMemoSame(cached, memo) {
7726
7757
  }
7727
7758
 
7728
7759
  // Core API ------------------------------------------------------------------
7729
- const version = "3.2.36";
7760
+ const version = "3.2.39";
7730
7761
  const _ssrUtils = {
7731
7762
  createComponentInstance,
7732
7763
  setupComponent,
@@ -7736,7 +7767,7 @@ const _ssrUtils = {
7736
7767
  normalizeVNode
7737
7768
  };
7738
7769
  /**
7739
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
7770
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
7740
7771
  * @internal
7741
7772
  */
7742
7773
  const ssrUtils = (_ssrUtils );