@vue/runtime-dom 3.6.0-alpha.2 → 3.6.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,11 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-alpha.2
2
+ * @vue/runtime-dom v3.6.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
6
  var VueRuntimeDOM = (function (exports) {
7
7
  'use strict';
8
8
 
9
- /*! #__NO_SIDE_EFFECTS__ */
10
9
  // @__NO_SIDE_EFFECTS__
11
10
  function makeMap(str) {
12
11
  const map = /* @__PURE__ */ Object.create(null);
@@ -62,10 +61,10 @@ var VueRuntimeDOM = (function (exports) {
62
61
  );
63
62
  const cacheStringFunction = (fn) => {
64
63
  const cache = /* @__PURE__ */ Object.create(null);
65
- return (str) => {
64
+ return ((str) => {
66
65
  const hit = cache[str];
67
66
  return hit || (cache[str] = fn(str));
68
- };
67
+ });
69
68
  };
70
69
  const camelizeRE = /-(\w)/g;
71
70
  const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
@@ -85,6 +84,9 @@ var VueRuntimeDOM = (function (exports) {
85
84
  return s;
86
85
  }
87
86
  );
87
+ const getModifierPropName = (name) => {
88
+ return `${name === "modelValue" || name === "model-value" ? "model" : name}Modifiers${name === "model" ? "$" : ""}`;
89
+ };
88
90
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
89
91
  const invokeArrayFns = (fns, ...arg) => {
90
92
  for (let i = 0; i < fns.length; i++) {
@@ -238,6 +240,9 @@ var VueRuntimeDOM = (function (exports) {
238
240
  if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
239
241
  return true;
240
242
  }
243
+ if (key === "sandbox" && tagName === "IFRAME") {
244
+ return true;
245
+ }
241
246
  return false;
242
247
  }
243
248
 
@@ -427,6 +432,7 @@ var VueRuntimeDOM = (function (exports) {
427
432
  const notifyBuffer = [];
428
433
  let batchDepth = 0;
429
434
  let activeSub = void 0;
435
+ let globalVersion = 0;
430
436
  let notifyIndex = 0;
431
437
  let notifyBufferLength = 0;
432
438
  function setActiveSub(sub) {
@@ -449,17 +455,18 @@ var VueRuntimeDOM = (function (exports) {
449
455
  if (prevDep !== void 0 && prevDep.dep === dep) {
450
456
  return;
451
457
  }
452
- let nextDep = void 0;
453
- const recursedCheck = sub.flags & 4 /* RecursedCheck */;
454
- if (recursedCheck) {
455
- nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
456
- if (nextDep !== void 0 && nextDep.dep === dep) {
457
- sub.depsTail = nextDep;
458
- return;
459
- }
458
+ const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
459
+ if (nextDep !== void 0 && nextDep.dep === dep) {
460
+ nextDep.version = globalVersion;
461
+ sub.depsTail = nextDep;
462
+ return;
460
463
  }
461
464
  const prevSub = dep.subsTail;
465
+ if (prevSub !== void 0 && prevSub.version === globalVersion && prevSub.sub === sub) {
466
+ return;
467
+ }
462
468
  const newLink = sub.depsTail = dep.subsTail = {
469
+ version: globalVersion,
463
470
  dep,
464
471
  sub,
465
472
  prevDep,
@@ -565,6 +572,7 @@ var VueRuntimeDOM = (function (exports) {
565
572
  } while (true);
566
573
  }
567
574
  function startTracking(sub) {
575
+ ++globalVersion;
568
576
  sub.depsTail = void 0;
569
577
  sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
570
578
  return setActiveSub(sub);
@@ -665,18 +673,12 @@ var VueRuntimeDOM = (function (exports) {
665
673
  } while (link2 !== void 0);
666
674
  }
667
675
  function isValidLink(checkLink, sub) {
668
- const depsTail = sub.depsTail;
669
- if (depsTail !== void 0) {
670
- let link2 = sub.deps;
671
- do {
672
- if (link2 === checkLink) {
673
- return true;
674
- }
675
- if (link2 === depsTail) {
676
- break;
677
- }
678
- link2 = link2.nextDep;
679
- } while (link2 !== void 0);
676
+ let link2 = sub.depsTail;
677
+ while (link2 !== void 0) {
678
+ if (link2 === checkLink) {
679
+ return true;
680
+ }
681
+ link2 = link2.prevDep;
680
682
  }
681
683
  return false;
682
684
  }
@@ -916,7 +918,7 @@ var VueRuntimeDOM = (function (exports) {
916
918
  join(separator) {
917
919
  return reactiveReadArray(this).join(separator);
918
920
  },
919
- // keys() iterator only reads `length`, no optimisation required
921
+ // keys() iterator only reads `length`, no optimization required
920
922
  lastIndexOf(...args) {
921
923
  return searchProxy(this, "lastIndexOf", args);
922
924
  },
@@ -968,7 +970,7 @@ var VueRuntimeDOM = (function (exports) {
968
970
  iter._next = iter.next;
969
971
  iter.next = () => {
970
972
  const result = iter._next();
971
- if (result.value) {
973
+ if (!result.done) {
972
974
  result.value = wrapValue(result.value);
973
975
  }
974
976
  return result;
@@ -1099,7 +1101,8 @@ var VueRuntimeDOM = (function (exports) {
1099
1101
  return res;
1100
1102
  }
1101
1103
  if (isRef(res)) {
1102
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1104
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1105
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1103
1106
  }
1104
1107
  if (isObject(res)) {
1105
1108
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -1121,7 +1124,13 @@ var VueRuntimeDOM = (function (exports) {
1121
1124
  }
1122
1125
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1123
1126
  if (isOldValueReadonly) {
1124
- return false;
1127
+ {
1128
+ warn$2(
1129
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1130
+ target[key]
1131
+ );
1132
+ }
1133
+ return true;
1125
1134
  } else {
1126
1135
  oldValue.value = value;
1127
1136
  return true;
@@ -1266,7 +1275,7 @@ var VueRuntimeDOM = (function (exports) {
1266
1275
  get size() {
1267
1276
  const target = this["__v_raw"];
1268
1277
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1269
- return Reflect.get(target, "size", target);
1278
+ return target.size;
1270
1279
  },
1271
1280
  has(key) {
1272
1281
  const target = this["__v_raw"];
@@ -2269,11 +2278,11 @@ var VueRuntimeDOM = (function (exports) {
2269
2278
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2270
2279
  return value;
2271
2280
  }
2272
- seen = seen || /* @__PURE__ */ new Set();
2273
- if (seen.has(value)) {
2281
+ seen = seen || /* @__PURE__ */ new Map();
2282
+ if ((seen.get(value) || 0) >= depth) {
2274
2283
  return value;
2275
2284
  }
2276
- seen.add(value);
2285
+ seen.set(value, depth);
2277
2286
  depth--;
2278
2287
  if (isRef(value)) {
2279
2288
  traverse(value.value, depth, seen);
@@ -2819,8 +2828,10 @@ var VueRuntimeDOM = (function (exports) {
2819
2828
  instance.hmrRerender();
2820
2829
  } else {
2821
2830
  const i = instance;
2822
- i.renderCache = [];
2823
- i.effect.run();
2831
+ if (!(i.effect.flags & 1024)) {
2832
+ i.renderCache = [];
2833
+ i.effect.run();
2834
+ }
2824
2835
  }
2825
2836
  nextTick(() => {
2826
2837
  isHmrUpdating = false;
@@ -2833,7 +2844,12 @@ var VueRuntimeDOM = (function (exports) {
2833
2844
  newComp = normalizeClassComponent(newComp);
2834
2845
  updateComponentDef(record.initialDef, newComp);
2835
2846
  const instances = [...record.instances];
2836
- if (newComp.__vapor) {
2847
+ if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
2848
+ for (const instance of instances) {
2849
+ if (instance.root && instance.root.ce && instance !== instance.root) {
2850
+ instance.root.ce._removeChildStyle(instance.type);
2851
+ }
2852
+ }
2837
2853
  for (const instance of instances) {
2838
2854
  instance.hmrReload(newComp);
2839
2855
  }
@@ -2862,7 +2878,10 @@ var VueRuntimeDOM = (function (exports) {
2862
2878
  if (parent.vapor) {
2863
2879
  parent.hmrRerender();
2864
2880
  } else {
2865
- parent.effect.run();
2881
+ if (!(parent.effect.flags & 1024)) {
2882
+ parent.renderCache = [];
2883
+ parent.effect.run();
2884
+ }
2866
2885
  }
2867
2886
  nextTick(() => {
2868
2887
  isHmrUpdating = false;
@@ -2972,7 +2991,6 @@ var VueRuntimeDOM = (function (exports) {
2972
2991
  _devtoolsComponentRemoved(component);
2973
2992
  }
2974
2993
  };
2975
- /*! #__NO_SIDE_EFFECTS__ */
2976
2994
  // @__NO_SIDE_EFFECTS__
2977
2995
  function createDevtoolsComponentHook(hook) {
2978
2996
  return (component) => {
@@ -3158,9 +3176,6 @@ var VueRuntimeDOM = (function (exports) {
3158
3176
  insert(mainAnchor, container, anchor);
3159
3177
  const mount = (container2, anchor2) => {
3160
3178
  if (shapeFlag & 16) {
3161
- if (parentComponent && parentComponent.isCE) {
3162
- parentComponent.ce._teleportTarget = container2;
3163
- }
3164
3179
  mountChildren(
3165
3180
  children,
3166
3181
  container2,
@@ -3182,6 +3197,9 @@ var VueRuntimeDOM = (function (exports) {
3182
3197
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3183
3198
  namespace = "mathml";
3184
3199
  }
3200
+ if (parentComponent && parentComponent.isCE) {
3201
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3202
+ }
3185
3203
  if (!disabled) {
3186
3204
  mount(target, targetAnchor);
3187
3205
  updateCssVars(n2, false);
@@ -3382,26 +3400,34 @@ var VueRuntimeDOM = (function (exports) {
3382
3400
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3383
3401
  o: { nextSibling, parentNode, querySelector, insert, createText }
3384
3402
  }, hydrateChildren) {
3403
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3404
+ vnode2.anchor = hydrateChildren(
3405
+ nextSibling(node2),
3406
+ vnode2,
3407
+ parentNode(node2),
3408
+ parentComponent,
3409
+ parentSuspense,
3410
+ slotScopeIds,
3411
+ optimized
3412
+ );
3413
+ vnode2.targetStart = targetStart;
3414
+ vnode2.targetAnchor = targetAnchor;
3415
+ }
3385
3416
  const target = vnode.target = resolveTarget(
3386
3417
  vnode.props,
3387
3418
  querySelector
3388
3419
  );
3420
+ const disabled = isTeleportDisabled(vnode.props);
3389
3421
  if (target) {
3390
- const disabled = isTeleportDisabled(vnode.props);
3391
3422
  const targetNode = target._lpa || target.firstChild;
3392
3423
  if (vnode.shapeFlag & 16) {
3393
3424
  if (disabled) {
3394
- vnode.anchor = hydrateChildren(
3395
- nextSibling(node),
3425
+ hydrateDisabledTeleport(
3426
+ node,
3396
3427
  vnode,
3397
- parentNode(node),
3398
- parentComponent,
3399
- parentSuspense,
3400
- slotScopeIds,
3401
- optimized
3428
+ targetNode,
3429
+ targetNode && nextSibling(targetNode)
3402
3430
  );
3403
- vnode.targetStart = targetNode;
3404
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3405
3431
  } else {
3406
3432
  vnode.anchor = nextSibling(node);
3407
3433
  let targetAnchor = targetNode;
@@ -3432,6 +3458,10 @@ var VueRuntimeDOM = (function (exports) {
3432
3458
  }
3433
3459
  }
3434
3460
  updateCssVars(vnode, disabled);
3461
+ } else if (disabled) {
3462
+ if (vnode.shapeFlag & 16) {
3463
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3464
+ }
3435
3465
  }
3436
3466
  return vnode.anchor && nextSibling(vnode.anchor);
3437
3467
  }
@@ -3472,7 +3502,7 @@ var VueRuntimeDOM = (function (exports) {
3472
3502
  isMounted: false,
3473
3503
  isLeaving: false,
3474
3504
  isUnmounting: false,
3475
- leavingVNodes: /* @__PURE__ */ new Map()
3505
+ leavingNodes: /* @__PURE__ */ new Map()
3476
3506
  };
3477
3507
  onMounted(() => {
3478
3508
  state.isMounted = true;
@@ -3504,7 +3534,7 @@ var VueRuntimeDOM = (function (exports) {
3504
3534
  onAppearCancelled: TransitionHookValidator
3505
3535
  };
3506
3536
  const recursiveGetSubtree = (instance) => {
3507
- const subTree = instance.subTree;
3537
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3508
3538
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3509
3539
  };
3510
3540
  const BaseTransitionImpl = {
@@ -3521,9 +3551,7 @@ var VueRuntimeDOM = (function (exports) {
3521
3551
  const child = findNonCommentChild(children);
3522
3552
  const rawProps = toRaw(props);
3523
3553
  const { mode } = rawProps;
3524
- if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3525
- warn$1(`invalid <transition> mode: ${mode}`);
3526
- }
3554
+ checkTransitionMode(mode);
3527
3555
  if (state.isLeaving) {
3528
3556
  return emptyPlaceholder(child);
3529
3557
  }
@@ -3543,7 +3571,7 @@ var VueRuntimeDOM = (function (exports) {
3543
3571
  setTransitionHooks(innerChild, enterHooks);
3544
3572
  }
3545
3573
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3546
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3574
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3547
3575
  let leavingHooks = resolveTransitionHooks(
3548
3576
  oldInnerChild,
3549
3577
  rawProps,
@@ -3612,15 +3640,53 @@ var VueRuntimeDOM = (function (exports) {
3612
3640
  }
3613
3641
  const BaseTransition = BaseTransitionImpl;
3614
3642
  function getLeavingNodesForType(state, vnode) {
3615
- const { leavingVNodes } = state;
3616
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
3643
+ const { leavingNodes } = state;
3644
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
3617
3645
  if (!leavingVNodesCache) {
3618
3646
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3619
- leavingVNodes.set(vnode.type, leavingVNodesCache);
3647
+ leavingNodes.set(vnode.type, leavingVNodesCache);
3620
3648
  }
3621
3649
  return leavingVNodesCache;
3622
3650
  }
3623
3651
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3652
+ const key = String(vnode.key);
3653
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3654
+ const context = {
3655
+ setLeavingNodeCache: () => {
3656
+ leavingVNodesCache[key] = vnode;
3657
+ },
3658
+ unsetLeavingNodeCache: () => {
3659
+ if (leavingVNodesCache[key] === vnode) {
3660
+ delete leavingVNodesCache[key];
3661
+ }
3662
+ },
3663
+ earlyRemove: () => {
3664
+ const leavingVNode = leavingVNodesCache[key];
3665
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3666
+ leavingVNode.el[leaveCbKey]();
3667
+ }
3668
+ },
3669
+ cloneHooks: (vnode2) => {
3670
+ const hooks = resolveTransitionHooks(
3671
+ vnode2,
3672
+ props,
3673
+ state,
3674
+ instance,
3675
+ postClone
3676
+ );
3677
+ if (postClone) postClone(hooks);
3678
+ return hooks;
3679
+ }
3680
+ };
3681
+ return baseResolveTransitionHooks(context, props, state, instance);
3682
+ }
3683
+ function baseResolveTransitionHooks(context, props, state, instance) {
3684
+ const {
3685
+ setLeavingNodeCache,
3686
+ unsetLeavingNodeCache,
3687
+ earlyRemove,
3688
+ cloneHooks
3689
+ } = context;
3624
3690
  const {
3625
3691
  appear,
3626
3692
  mode,
@@ -3638,8 +3704,6 @@ var VueRuntimeDOM = (function (exports) {
3638
3704
  onAfterAppear,
3639
3705
  onAppearCancelled
3640
3706
  } = props;
3641
- const key = String(vnode.key);
3642
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3643
3707
  const callHook = (hook, args) => {
3644
3708
  hook && callWithAsyncErrorHandling(
3645
3709
  hook,
@@ -3675,10 +3739,7 @@ var VueRuntimeDOM = (function (exports) {
3675
3739
  /* cancelled */
3676
3740
  );
3677
3741
  }
3678
- const leavingVNode = leavingVNodesCache[key];
3679
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3680
- leavingVNode.el[leaveCbKey]();
3681
- }
3742
+ earlyRemove();
3682
3743
  callHook(hook, [el]);
3683
3744
  },
3684
3745
  enter(el) {
@@ -3715,7 +3776,6 @@ var VueRuntimeDOM = (function (exports) {
3715
3776
  }
3716
3777
  },
3717
3778
  leave(el, remove) {
3718
- const key2 = String(vnode.key);
3719
3779
  if (el[enterCbKey$1]) {
3720
3780
  el[enterCbKey$1](
3721
3781
  true
@@ -3737,27 +3797,17 @@ var VueRuntimeDOM = (function (exports) {
3737
3797
  callHook(onAfterLeave, [el]);
3738
3798
  }
3739
3799
  el[leaveCbKey] = void 0;
3740
- if (leavingVNodesCache[key2] === vnode) {
3741
- delete leavingVNodesCache[key2];
3742
- }
3800
+ unsetLeavingNodeCache(el);
3743
3801
  };
3744
- leavingVNodesCache[key2] = vnode;
3802
+ setLeavingNodeCache(el);
3745
3803
  if (onLeave) {
3746
3804
  callAsyncHook(onLeave, [el, done]);
3747
3805
  } else {
3748
3806
  done();
3749
3807
  }
3750
3808
  },
3751
- clone(vnode2) {
3752
- const hooks2 = resolveTransitionHooks(
3753
- vnode2,
3754
- props,
3755
- state,
3756
- instance,
3757
- postClone
3758
- );
3759
- if (postClone) postClone(hooks2);
3760
- return hooks2;
3809
+ clone(node) {
3810
+ return cloneHooks(node);
3761
3811
  }
3762
3812
  };
3763
3813
  return hooks;
@@ -3791,8 +3841,15 @@ var VueRuntimeDOM = (function (exports) {
3791
3841
  }
3792
3842
  function setTransitionHooks(vnode, hooks) {
3793
3843
  if (vnode.shapeFlag & 6 && vnode.component) {
3794
- vnode.transition = hooks;
3795
- setTransitionHooks(vnode.component.subTree, hooks);
3844
+ if (vnode.type.__vapor) {
3845
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
3846
+ vnode.component,
3847
+ hooks
3848
+ );
3849
+ } else {
3850
+ vnode.transition = hooks;
3851
+ setTransitionHooks(vnode.component.subTree, hooks);
3852
+ }
3796
3853
  } else if (vnode.shapeFlag & 128) {
3797
3854
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3798
3855
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3822,8 +3879,12 @@ var VueRuntimeDOM = (function (exports) {
3822
3879
  }
3823
3880
  return ret;
3824
3881
  }
3882
+ function checkTransitionMode(mode) {
3883
+ if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3884
+ warn$1(`invalid <transition> mode: ${mode}`);
3885
+ }
3886
+ }
3825
3887
 
3826
- /*! #__NO_SIDE_EFFECTS__ */
3827
3888
  // @__NO_SIDE_EFFECTS__
3828
3889
  function defineComponent(options, extraOptions) {
3829
3890
  return isFunction(options) ? (
@@ -3876,6 +3937,7 @@ var VueRuntimeDOM = (function (exports) {
3876
3937
  return ret;
3877
3938
  }
3878
3939
 
3940
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
3879
3941
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3880
3942
  if (isArray(rawRef)) {
3881
3943
  rawRef.forEach(
@@ -3907,28 +3969,23 @@ var VueRuntimeDOM = (function (exports) {
3907
3969
  const oldRef = oldRawRef && oldRawRef.r;
3908
3970
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3909
3971
  const setupState = owner.setupState;
3910
- const rawSetupState = toRaw(setupState);
3911
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3912
- {
3913
- if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3914
- warn$1(
3915
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
3916
- );
3917
- }
3918
- if (knownTemplateRefs.has(rawSetupState[key])) {
3919
- return false;
3920
- }
3921
- }
3922
- return hasOwn(rawSetupState, key);
3972
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
3973
+ const canSetRef = (ref2) => {
3974
+ return !knownTemplateRefs.has(ref2);
3923
3975
  };
3924
3976
  if (oldRef != null && oldRef !== ref) {
3977
+ invalidatePendingSetRef(oldRawRef);
3925
3978
  if (isString(oldRef)) {
3926
3979
  refs[oldRef] = null;
3927
3980
  if (canSetSetupRef(oldRef)) {
3928
3981
  setupState[oldRef] = null;
3929
3982
  }
3930
3983
  } else if (isRef(oldRef)) {
3931
- oldRef.value = null;
3984
+ if (canSetRef(oldRef)) {
3985
+ oldRef.value = null;
3986
+ }
3987
+ const oldRawRefAtom = oldRawRef;
3988
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3932
3989
  }
3933
3990
  }
3934
3991
  if (isFunction(ref)) {
@@ -3939,7 +3996,7 @@ var VueRuntimeDOM = (function (exports) {
3939
3996
  if (_isString || _isRef) {
3940
3997
  const doSet = () => {
3941
3998
  if (rawRef.f) {
3942
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3999
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3943
4000
  if (isUnmount) {
3944
4001
  isArray(existing) && remove(existing, refValue);
3945
4002
  } else {
@@ -3950,8 +4007,11 @@ var VueRuntimeDOM = (function (exports) {
3950
4007
  setupState[ref] = refs[ref];
3951
4008
  }
3952
4009
  } else {
3953
- ref.value = [refValue];
3954
- if (rawRef.k) refs[rawRef.k] = ref.value;
4010
+ const newVal = [refValue];
4011
+ if (canSetRef(ref)) {
4012
+ ref.value = newVal;
4013
+ }
4014
+ if (rawRef.k) refs[rawRef.k] = newVal;
3955
4015
  }
3956
4016
  } else if (!existing.includes(refValue)) {
3957
4017
  existing.push(refValue);
@@ -3963,15 +4023,23 @@ var VueRuntimeDOM = (function (exports) {
3963
4023
  setupState[ref] = value;
3964
4024
  }
3965
4025
  } else if (_isRef) {
3966
- ref.value = value;
4026
+ if (canSetRef(ref)) {
4027
+ ref.value = value;
4028
+ }
3967
4029
  if (rawRef.k) refs[rawRef.k] = value;
3968
4030
  } else {
3969
4031
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
3970
4032
  }
3971
4033
  };
3972
4034
  if (value) {
3973
- queuePostRenderEffect(doSet, -1, parentSuspense);
4035
+ const job = () => {
4036
+ doSet();
4037
+ pendingSetRefMap.delete(rawRef);
4038
+ };
4039
+ pendingSetRefMap.set(rawRef, job);
4040
+ queuePostRenderEffect(job, -1, parentSuspense);
3974
4041
  } else {
4042
+ invalidatePendingSetRef(rawRef);
3975
4043
  doSet();
3976
4044
  }
3977
4045
  } else {
@@ -3979,6 +4047,29 @@ var VueRuntimeDOM = (function (exports) {
3979
4047
  }
3980
4048
  }
3981
4049
  }
4050
+ function createCanSetSetupRefChecker(setupState) {
4051
+ const rawSetupState = toRaw(setupState);
4052
+ return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
4053
+ {
4054
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4055
+ warn$1(
4056
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4057
+ );
4058
+ }
4059
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4060
+ return false;
4061
+ }
4062
+ }
4063
+ return hasOwn(rawSetupState, key);
4064
+ };
4065
+ }
4066
+ function invalidatePendingSetRef(rawRef) {
4067
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4068
+ if (pendingSetRef) {
4069
+ pendingSetRef.flags |= 4;
4070
+ pendingSetRefMap.delete(rawRef);
4071
+ }
4072
+ }
3982
4073
 
3983
4074
  let hasLoggedMismatchError = false;
3984
4075
  const logMismatchError = () => {
@@ -4123,6 +4214,12 @@ var VueRuntimeDOM = (function (exports) {
4123
4214
  );
4124
4215
  }
4125
4216
  break;
4217
+ case VaporSlot:
4218
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
4219
+ vnode,
4220
+ node
4221
+ );
4222
+ break;
4126
4223
  default:
4127
4224
  if (shapeFlag & 1) {
4128
4225
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
@@ -4138,9 +4235,6 @@ var VueRuntimeDOM = (function (exports) {
4138
4235
  );
4139
4236
  }
4140
4237
  } else if (shapeFlag & 6) {
4141
- if (vnode.type.__vapor) {
4142
- throw new Error("Vapor component hydration is not supported yet.");
4143
- }
4144
4238
  vnode.slotScopeIds = slotScopeIds;
4145
4239
  const container = parentNode(node);
4146
4240
  if (isFragmentStart) {
@@ -4150,15 +4244,25 @@ var VueRuntimeDOM = (function (exports) {
4150
4244
  } else {
4151
4245
  nextNode = nextSibling(node);
4152
4246
  }
4153
- mountComponent(
4154
- vnode,
4155
- container,
4156
- null,
4157
- parentComponent,
4158
- parentSuspense,
4159
- getContainerType(container),
4160
- optimized
4161
- );
4247
+ if (vnode.type.__vapor) {
4248
+ getVaporInterface(parentComponent, vnode).hydrate(
4249
+ vnode,
4250
+ node,
4251
+ container,
4252
+ null,
4253
+ parentComponent
4254
+ );
4255
+ } else {
4256
+ mountComponent(
4257
+ vnode,
4258
+ container,
4259
+ null,
4260
+ parentComponent,
4261
+ parentSuspense,
4262
+ getContainerType(container),
4263
+ optimized
4264
+ );
4265
+ }
4162
4266
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4163
4267
  let subTree;
4164
4268
  if (isFragmentStart) {
@@ -4243,7 +4347,7 @@ var VueRuntimeDOM = (function (exports) {
4243
4347
  );
4244
4348
  let hasWarned = false;
4245
4349
  while (next) {
4246
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4350
+ if (!isMismatchAllowed(el, 1)) {
4247
4351
  if (!hasWarned) {
4248
4352
  warn$1(
4249
4353
  `Hydration children mismatch on`,
@@ -4264,14 +4368,16 @@ Server rendered element contains more child nodes than client vdom.`
4264
4368
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4265
4369
  clientText = clientText.slice(1);
4266
4370
  }
4267
- if (el.textContent !== clientText) {
4268
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4371
+ const { textContent } = el;
4372
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
4373
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
4374
+ if (!isMismatchAllowed(el, 0)) {
4269
4375
  warn$1(
4270
4376
  `Hydration text content mismatch on`,
4271
4377
  el,
4272
4378
  `
4273
- - rendered on server: ${el.textContent}
4274
- - expected on client: ${vnode.children}`
4379
+ - rendered on server: ${textContent}
4380
+ - expected on client: ${clientText}`
4275
4381
  );
4276
4382
  logMismatchError();
4277
4383
  }
@@ -4347,7 +4453,7 @@ Server rendered element contains more child nodes than client vdom.`
4347
4453
  } else if (isText && !vnode.children) {
4348
4454
  insert(vnode.el = createText(""), container);
4349
4455
  } else {
4350
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4456
+ if (!isMismatchAllowed(container, 1)) {
4351
4457
  if (!hasWarned) {
4352
4458
  warn$1(
4353
4459
  `Hydration children mismatch on`,
@@ -4397,7 +4503,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4397
4503
  }
4398
4504
  };
4399
4505
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4400
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
4506
+ if (!isMismatchAllowed(node.parentElement, 1)) {
4401
4507
  warn$1(
4402
4508
  `Hydration node mismatch:
4403
4509
  - rendered on server:`,
@@ -4470,11 +4576,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4470
4576
  parent = parent.parent;
4471
4577
  }
4472
4578
  };
4473
- const isTemplateNode = (node) => {
4474
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
4475
- };
4476
4579
  return [hydrate, hydrateNode];
4477
4580
  }
4581
+ const isTemplateNode = (node) => {
4582
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4583
+ };
4478
4584
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4479
4585
  let mismatchType;
4480
4586
  let mismatchKey;
@@ -4489,7 +4595,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4489
4595
  }
4490
4596
  expected = normalizeClass(clientValue);
4491
4597
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
4492
- mismatchType = 2 /* CLASS */;
4598
+ mismatchType = 2;
4493
4599
  mismatchKey = `class`;
4494
4600
  }
4495
4601
  } else if (key === "style") {
@@ -4508,31 +4614,43 @@ Server rendered element contains fewer child nodes than client vdom.`
4508
4614
  resolveCssVars(instance, vnode, expectedMap);
4509
4615
  }
4510
4616
  if (!isMapEqual(actualMap, expectedMap)) {
4511
- mismatchType = 3 /* STYLE */;
4617
+ mismatchType = 3;
4512
4618
  mismatchKey = "style";
4513
4619
  }
4514
- } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
4515
- if (isBooleanAttr(key)) {
4516
- actual = el.hasAttribute(key);
4517
- expected = includeBooleanAttr(clientValue);
4518
- } else if (clientValue == null) {
4519
- actual = el.hasAttribute(key);
4520
- expected = false;
4521
- } else {
4522
- if (el.hasAttribute(key)) {
4523
- actual = el.getAttribute(key);
4524
- } else if (key === "value" && el.tagName === "TEXTAREA") {
4525
- actual = el.value;
4526
- } else {
4527
- actual = false;
4528
- }
4529
- expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4530
- }
4620
+ } else if (isValidHtmlOrSvgAttribute(el, key)) {
4621
+ ({ actual, expected } = getAttributeMismatch(el, key, clientValue));
4531
4622
  if (actual !== expected) {
4532
- mismatchType = 4 /* ATTRIBUTE */;
4623
+ mismatchType = 4;
4533
4624
  mismatchKey = key;
4534
4625
  }
4535
4626
  }
4627
+ return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
4628
+ }
4629
+ function getAttributeMismatch(el, key, clientValue) {
4630
+ let actual;
4631
+ let expected;
4632
+ if (isBooleanAttr(key)) {
4633
+ actual = el.hasAttribute(key);
4634
+ expected = includeBooleanAttr(clientValue);
4635
+ } else if (clientValue == null) {
4636
+ actual = el.hasAttribute(key);
4637
+ expected = false;
4638
+ } else {
4639
+ if (el.hasAttribute(key)) {
4640
+ actual = el.getAttribute(key);
4641
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
4642
+ actual = el.value;
4643
+ } else {
4644
+ actual = false;
4645
+ }
4646
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4647
+ }
4648
+ return { actual, expected };
4649
+ }
4650
+ function isValidHtmlOrSvgAttribute(el, key) {
4651
+ return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
4652
+ }
4653
+ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
4536
4654
  if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
4537
4655
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
4538
4656
  const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
@@ -4604,14 +4722,14 @@ Server rendered element contains fewer child nodes than client vdom.`
4604
4722
  }
4605
4723
  const allowMismatchAttr = "data-allow-mismatch";
4606
4724
  const MismatchTypeString = {
4607
- [0 /* TEXT */]: "text",
4608
- [1 /* CHILDREN */]: "children",
4609
- [2 /* CLASS */]: "class",
4610
- [3 /* STYLE */]: "style",
4611
- [4 /* ATTRIBUTE */]: "attribute"
4725
+ [0]: "text",
4726
+ [1]: "children",
4727
+ [2]: "class",
4728
+ [3]: "style",
4729
+ [4]: "attribute"
4612
4730
  };
4613
4731
  function isMismatchAllowed(el, allowedType) {
4614
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
4732
+ if (allowedType === 0 || allowedType === 1) {
4615
4733
  while (el && !el.hasAttribute(allowMismatchAttr)) {
4616
4734
  el = el.parentElement;
4617
4735
  }
@@ -4623,7 +4741,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4623
4741
  return true;
4624
4742
  } else {
4625
4743
  const list = allowedAttr.split(",");
4626
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
4744
+ if (allowedType === 0 && list.includes("children")) {
4627
4745
  return true;
4628
4746
  }
4629
4747
  return list.includes(MismatchTypeString[allowedType]);
@@ -4680,7 +4798,9 @@ Server rendered element contains fewer child nodes than client vdom.`
4680
4798
  hasHydrated = true;
4681
4799
  teardown();
4682
4800
  hydrate();
4683
- e.target.dispatchEvent(new e.constructor(e.type, e));
4801
+ if (!(`$evt${e.type}` in e.target)) {
4802
+ e.target.dispatchEvent(new e.constructor(e.type, e));
4803
+ }
4684
4804
  }
4685
4805
  };
4686
4806
  const teardown = () => {
@@ -4722,104 +4842,46 @@ Server rendered element contains fewer child nodes than client vdom.`
4722
4842
  }
4723
4843
 
4724
4844
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4725
- /*! #__NO_SIDE_EFFECTS__ */
4726
4845
  // @__NO_SIDE_EFFECTS__
4727
4846
  function defineAsyncComponent(source) {
4728
- if (isFunction(source)) {
4729
- source = { loader: source };
4730
- }
4731
4847
  const {
4732
- loader,
4733
- loadingComponent,
4734
- errorComponent,
4735
- delay = 200,
4736
- hydrate: hydrateStrategy,
4737
- timeout,
4738
- // undefined = never times out
4739
- suspensible = true,
4740
- onError: userOnError
4741
- } = source;
4742
- let pendingRequest = null;
4743
- let resolvedComp;
4744
- let retries = 0;
4745
- const retry = () => {
4746
- retries++;
4747
- pendingRequest = null;
4748
- return load();
4749
- };
4750
- const load = () => {
4751
- let thisRequest;
4752
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4753
- err = err instanceof Error ? err : new Error(String(err));
4754
- if (userOnError) {
4755
- return new Promise((resolve, reject) => {
4756
- const userRetry = () => resolve(retry());
4757
- const userFail = () => reject(err);
4758
- userOnError(err, userRetry, userFail, retries + 1);
4759
- });
4760
- } else {
4761
- throw err;
4762
- }
4763
- }).then((comp) => {
4764
- if (thisRequest !== pendingRequest && pendingRequest) {
4765
- return pendingRequest;
4766
- }
4767
- if (!comp) {
4768
- warn$1(
4769
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4770
- );
4771
- }
4772
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4773
- comp = comp.default;
4774
- }
4775
- if (comp && !isObject(comp) && !isFunction(comp)) {
4776
- throw new Error(`Invalid async component load result: ${comp}`);
4777
- }
4778
- resolvedComp = comp;
4779
- return comp;
4780
- }));
4781
- };
4848
+ load,
4849
+ getResolvedComp,
4850
+ setPendingRequest,
4851
+ source: {
4852
+ loadingComponent,
4853
+ errorComponent,
4854
+ delay,
4855
+ hydrate: hydrateStrategy,
4856
+ timeout,
4857
+ suspensible = true
4858
+ }
4859
+ } = createAsyncComponentContext(source);
4782
4860
  return defineComponent({
4783
4861
  name: "AsyncComponentWrapper",
4784
4862
  __asyncLoader: load,
4785
4863
  __asyncHydrate(el, instance, hydrate) {
4786
- let patched = false;
4787
- const doHydrate = hydrateStrategy ? () => {
4788
- const performHydrate = () => {
4789
- if (patched) {
4790
- warn$1(
4791
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
4792
- );
4793
- return;
4794
- }
4795
- hydrate();
4796
- };
4797
- const teardown = hydrateStrategy(
4798
- performHydrate,
4799
- (cb) => forEachElement(el, cb)
4800
- );
4801
- if (teardown) {
4802
- (instance.bum || (instance.bum = [])).push(teardown);
4803
- }
4804
- (instance.u || (instance.u = [])).push(() => patched = true);
4805
- } : hydrate;
4806
- if (resolvedComp) {
4807
- doHydrate();
4808
- } else {
4809
- load().then(() => !instance.isUnmounted && doHydrate());
4810
- }
4864
+ performAsyncHydrate(
4865
+ el,
4866
+ instance,
4867
+ hydrate,
4868
+ getResolvedComp,
4869
+ load,
4870
+ hydrateStrategy
4871
+ );
4811
4872
  },
4812
4873
  get __asyncResolved() {
4813
- return resolvedComp;
4874
+ return getResolvedComp();
4814
4875
  },
4815
4876
  setup() {
4816
4877
  const instance = currentInstance;
4817
4878
  markAsyncBoundary(instance);
4879
+ let resolvedComp = getResolvedComp();
4818
4880
  if (resolvedComp) {
4819
4881
  return () => createInnerComp(resolvedComp, instance);
4820
4882
  }
4821
4883
  const onError = (err) => {
4822
- pendingRequest = null;
4884
+ setPendingRequest(null);
4823
4885
  handleError(
4824
4886
  err,
4825
4887
  instance,
@@ -4837,25 +4899,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4837
4899
  }) : null;
4838
4900
  });
4839
4901
  }
4840
- const loaded = ref(false);
4841
- const error = ref();
4842
- const delayed = ref(!!delay);
4843
- if (delay) {
4844
- setTimeout(() => {
4845
- delayed.value = false;
4846
- }, delay);
4847
- }
4848
- if (timeout != null) {
4849
- setTimeout(() => {
4850
- if (!loaded.value && !error.value) {
4851
- const err = new Error(
4852
- `Async component timed out after ${timeout}ms.`
4853
- );
4854
- onError(err);
4855
- error.value = err;
4856
- }
4857
- }, timeout);
4858
- }
4902
+ const { loaded, error, delayed } = useAsyncComponentState(
4903
+ delay,
4904
+ timeout,
4905
+ onError
4906
+ );
4859
4907
  load().then(() => {
4860
4908
  loaded.value = true;
4861
4909
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -4866,6 +4914,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4866
4914
  error.value = err;
4867
4915
  });
4868
4916
  return () => {
4917
+ resolvedComp = getResolvedComp();
4869
4918
  if (loaded.value && resolvedComp) {
4870
4919
  return createInnerComp(resolvedComp, instance);
4871
4920
  } else if (error.value && errorComponent) {
@@ -4873,7 +4922,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4873
4922
  error: error.value
4874
4923
  });
4875
4924
  } else if (loadingComponent && !delayed.value) {
4876
- return createVNode(loadingComponent);
4925
+ return createInnerComp(
4926
+ loadingComponent,
4927
+ instance
4928
+ );
4877
4929
  }
4878
4930
  };
4879
4931
  }
@@ -4887,6 +4939,108 @@ Server rendered element contains fewer child nodes than client vdom.`
4887
4939
  delete parent.vnode.ce;
4888
4940
  return vnode;
4889
4941
  }
4942
+ function createAsyncComponentContext(source) {
4943
+ if (isFunction(source)) {
4944
+ source = { loader: source };
4945
+ }
4946
+ const { loader, onError: userOnError } = source;
4947
+ let pendingRequest = null;
4948
+ let resolvedComp;
4949
+ let retries = 0;
4950
+ const retry = () => {
4951
+ retries++;
4952
+ pendingRequest = null;
4953
+ return load();
4954
+ };
4955
+ const load = () => {
4956
+ let thisRequest;
4957
+ return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4958
+ err = err instanceof Error ? err : new Error(String(err));
4959
+ if (userOnError) {
4960
+ return new Promise((resolve, reject) => {
4961
+ const userRetry = () => resolve(retry());
4962
+ const userFail = () => reject(err);
4963
+ userOnError(err, userRetry, userFail, retries + 1);
4964
+ });
4965
+ } else {
4966
+ throw err;
4967
+ }
4968
+ }).then((comp) => {
4969
+ if (thisRequest !== pendingRequest && pendingRequest) {
4970
+ return pendingRequest;
4971
+ }
4972
+ if (!comp) {
4973
+ warn$1(
4974
+ `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4975
+ );
4976
+ }
4977
+ if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4978
+ comp = comp.default;
4979
+ }
4980
+ if (comp && !isObject(comp) && !isFunction(comp)) {
4981
+ throw new Error(`Invalid async component load result: ${comp}`);
4982
+ }
4983
+ resolvedComp = comp;
4984
+ return comp;
4985
+ }));
4986
+ };
4987
+ return {
4988
+ load,
4989
+ source,
4990
+ getResolvedComp: () => resolvedComp,
4991
+ setPendingRequest: (request) => pendingRequest = request
4992
+ };
4993
+ }
4994
+ const useAsyncComponentState = (delay, timeout, onError) => {
4995
+ const loaded = ref(false);
4996
+ const error = ref();
4997
+ const delayed = ref(!!delay);
4998
+ if (delay) {
4999
+ setTimeout(() => {
5000
+ delayed.value = false;
5001
+ }, delay);
5002
+ }
5003
+ if (timeout != null) {
5004
+ setTimeout(() => {
5005
+ if (!loaded.value && !error.value) {
5006
+ const err = new Error(`Async component timed out after ${timeout}ms.`);
5007
+ onError(err);
5008
+ error.value = err;
5009
+ }
5010
+ }, timeout);
5011
+ }
5012
+ return { loaded, error, delayed };
5013
+ };
5014
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
5015
+ let patched = false;
5016
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
5017
+ const performHydrate = () => {
5018
+ if (patched) {
5019
+ {
5020
+ const resolvedComp = getResolvedComp();
5021
+ warn$1(
5022
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
5023
+ );
5024
+ }
5025
+ return;
5026
+ }
5027
+ hydrate();
5028
+ };
5029
+ const doHydrate = hydrateStrategy ? () => {
5030
+ const teardown = hydrateStrategy(
5031
+ performHydrate,
5032
+ (cb) => forEachElement(el, cb)
5033
+ );
5034
+ if (teardown) {
5035
+ (instance.bum || (instance.bum = [])).push(teardown);
5036
+ }
5037
+ } : performHydrate;
5038
+ if (getResolvedComp()) {
5039
+ doHydrate();
5040
+ } else {
5041
+ load().then(() => !instance.isUnmounted && doHydrate());
5042
+ }
5043
+ }
4890
5044
 
4891
5045
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
4892
5046
  const KeepAliveImpl = {
@@ -4910,86 +5064,37 @@ Server rendered element contains fewer child nodes than client vdom.`
4910
5064
  keepAliveInstance.__v_cache = cache;
4911
5065
  }
4912
5066
  const parentSuspense = keepAliveInstance.suspense;
5067
+ const { renderer } = sharedContext;
4913
5068
  const {
4914
- renderer: {
4915
- p: patch,
4916
- m: move,
4917
- um: _unmount,
4918
- o: { createElement }
4919
- }
4920
- } = sharedContext;
5069
+ um: _unmount,
5070
+ o: { createElement }
5071
+ } = renderer;
4921
5072
  const storageContainer = createElement("div");
5073
+ sharedContext.getStorageContainer = () => storageContainer;
5074
+ sharedContext.getCachedComponent = (vnode) => {
5075
+ const key = vnode.key == null ? vnode.type : vnode.key;
5076
+ return cache.get(key);
5077
+ };
4922
5078
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4923
- const instance = vnode.component;
4924
- move(
5079
+ activate(
4925
5080
  vnode,
4926
5081
  container,
4927
5082
  anchor,
4928
- 0,
5083
+ renderer,
4929
5084
  keepAliveInstance,
4930
- parentSuspense
4931
- );
4932
- patch(
4933
- instance.vnode,
4934
- vnode,
4935
- container,
4936
- anchor,
4937
- instance,
4938
5085
  parentSuspense,
4939
5086
  namespace,
4940
- vnode.slotScopeIds,
4941
5087
  optimized
4942
5088
  );
4943
- queuePostRenderEffect(
4944
- () => {
4945
- instance.isDeactivated = false;
4946
- if (instance.a) {
4947
- invokeArrayFns(instance.a);
4948
- }
4949
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4950
- if (vnodeHook) {
4951
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4952
- }
4953
- },
4954
- void 0,
4955
- parentSuspense
4956
- );
4957
- {
4958
- devtoolsComponentAdded(instance);
4959
- }
4960
5089
  };
4961
5090
  sharedContext.deactivate = (vnode) => {
4962
- const instance = vnode.component;
4963
- invalidateMount(instance.m);
4964
- invalidateMount(instance.a);
4965
- move(
5091
+ deactivate(
4966
5092
  vnode,
4967
5093
  storageContainer,
4968
- null,
4969
- 1,
5094
+ renderer,
4970
5095
  keepAliveInstance,
4971
5096
  parentSuspense
4972
5097
  );
4973
- queuePostRenderEffect(
4974
- () => {
4975
- if (instance.da) {
4976
- invokeArrayFns(instance.da);
4977
- }
4978
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4979
- if (vnodeHook) {
4980
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4981
- }
4982
- instance.isDeactivated = true;
4983
- },
4984
- void 0,
4985
- parentSuspense
4986
- );
4987
- {
4988
- devtoolsComponentAdded(instance);
4989
- }
4990
- {
4991
- instance.__keepAliveStorageContainer = storageContainer;
4992
- }
4993
5098
  };
4994
5099
  function unmount(vnode) {
4995
5100
  resetShapeFlag(vnode);
@@ -5136,7 +5241,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5136
5241
  function onDeactivated(hook, target) {
5137
5242
  registerKeepAliveHook(hook, "da", target);
5138
5243
  }
5139
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
5244
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
5140
5245
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
5141
5246
  let current = target;
5142
5247
  while (current) {
@@ -5150,8 +5255,9 @@ Server rendered element contains fewer child nodes than client vdom.`
5150
5255
  injectHook(type, wrappedHook, target);
5151
5256
  if (target) {
5152
5257
  let current = target.parent;
5153
- while (current && current.parent && current.parent.vnode) {
5154
- if (isKeepAlive(current.parent.vnode)) {
5258
+ while (current && current.parent) {
5259
+ let parent = current.parent;
5260
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
5155
5261
  injectToKeepAliveRoot(wrappedHook, type, target, current);
5156
5262
  }
5157
5263
  current = current.parent;
@@ -5177,6 +5283,71 @@ Server rendered element contains fewer child nodes than client vdom.`
5177
5283
  function getInnerChild(vnode) {
5178
5284
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
5179
5285
  }
5286
+ function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
5287
+ const instance = vnode.component;
5288
+ move(
5289
+ vnode,
5290
+ container,
5291
+ anchor,
5292
+ 0,
5293
+ parentComponent,
5294
+ parentSuspense
5295
+ );
5296
+ patch(
5297
+ instance.vnode,
5298
+ vnode,
5299
+ container,
5300
+ anchor,
5301
+ instance,
5302
+ parentSuspense,
5303
+ namespace,
5304
+ vnode.slotScopeIds,
5305
+ optimized
5306
+ );
5307
+ queuePostRenderEffect(
5308
+ () => {
5309
+ instance.isDeactivated = false;
5310
+ if (instance.a) {
5311
+ invokeArrayFns(instance.a);
5312
+ }
5313
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
5314
+ if (vnodeHook) {
5315
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
5316
+ }
5317
+ },
5318
+ void 0,
5319
+ parentSuspense
5320
+ );
5321
+ {
5322
+ devtoolsComponentAdded(instance);
5323
+ }
5324
+ }
5325
+ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
5326
+ const instance = vnode.component;
5327
+ invalidateMount(instance.m);
5328
+ invalidateMount(instance.a);
5329
+ move(vnode, container, null, 1, parentComponent, parentSuspense);
5330
+ queuePostRenderEffect(
5331
+ () => {
5332
+ if (instance.da) {
5333
+ invokeArrayFns(instance.da);
5334
+ }
5335
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
5336
+ if (vnodeHook) {
5337
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
5338
+ }
5339
+ instance.isDeactivated = true;
5340
+ },
5341
+ void 0,
5342
+ parentSuspense
5343
+ );
5344
+ {
5345
+ devtoolsComponentAdded(instance);
5346
+ }
5347
+ {
5348
+ instance.__keepAliveStorageContainer = container;
5349
+ }
5350
+ }
5180
5351
 
5181
5352
  function injectHook(type, hook, target = currentInstance, prepend = false) {
5182
5353
  if (target) {
@@ -5365,12 +5536,13 @@ If this is a native custom element, make sure to exclude it from component resol
5365
5536
  return ret;
5366
5537
  }
5367
5538
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5539
+ const hasProps = Object.keys(props).length > 0;
5368
5540
  if (name !== "default") props.name = name;
5369
5541
  return openBlock(), createBlock(
5370
5542
  Fragment,
5371
5543
  null,
5372
5544
  [createVNode("slot", props, fallback && fallback())],
5373
- 64
5545
+ hasProps ? -2 : 64
5374
5546
  );
5375
5547
  }
5376
5548
  if (slot && slot.length > 1) {
@@ -5384,6 +5556,7 @@ If this is a native custom element, make sure to exclude it from component resol
5384
5556
  }
5385
5557
  openBlock();
5386
5558
  const validSlotContent = slot && ensureValidVNode(slot(props));
5559
+ ensureVaporSlotFallback(validSlotContent, fallback);
5387
5560
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5388
5561
  // key attached in the `createSlots` helper, respect that
5389
5562
  validSlotContent && validSlotContent.key;
@@ -5413,6 +5586,14 @@ If this is a native custom element, make sure to exclude it from component resol
5413
5586
  return true;
5414
5587
  }) ? vnodes : null;
5415
5588
  }
5589
+ function ensureVaporSlotFallback(vnodes, fallback) {
5590
+ let vaporSlot;
5591
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5592
+ if (!vaporSlot.fallback && fallback) {
5593
+ vaporSlot.fallback = fallback;
5594
+ }
5595
+ }
5596
+ }
5416
5597
 
5417
5598
  function toHandlers(obj, preserveCaseIfNecessary) {
5418
5599
  const ret = {};
@@ -5575,10 +5756,10 @@ If this is a native custom element, make sure to exclude it from component resol
5575
5756
  return true;
5576
5757
  },
5577
5758
  has({
5578
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5759
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5579
5760
  }, key) {
5580
- let normalizedProps;
5581
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
5761
+ let normalizedProps, cssModules;
5762
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5582
5763
  },
5583
5764
  defineProperty(target, key, descriptor) {
5584
5765
  if (descriptor.get != null) {
@@ -5716,15 +5897,15 @@ If this is a native custom element, make sure to exclude it from component resol
5716
5897
  return null;
5717
5898
  }
5718
5899
  function useSlots() {
5719
- return getContext().slots;
5900
+ return getContext("useSlots").slots;
5720
5901
  }
5721
5902
  function useAttrs() {
5722
- return getContext().attrs;
5903
+ return getContext("useAttrs").attrs;
5723
5904
  }
5724
- function getContext() {
5905
+ function getContext(calledFunctionName) {
5725
5906
  const i = getCurrentGenericInstance();
5726
5907
  if (!i) {
5727
- warn$1(`useContext() called without active instance.`);
5908
+ warn$1(`${calledFunctionName}() called without active instance.`);
5728
5909
  }
5729
5910
  if (i.vapor) {
5730
5911
  return i;
@@ -5980,7 +6161,8 @@ If this is a native custom element, make sure to exclude it from component resol
5980
6161
  expose.forEach((key) => {
5981
6162
  Object.defineProperty(exposed, key, {
5982
6163
  get: () => publicThis[key],
5983
- set: (val) => publicThis[key] = val
6164
+ set: (val) => publicThis[key] = val,
6165
+ enumerable: true
5984
6166
  });
5985
6167
  });
5986
6168
  } else if (!instance.exposed) {
@@ -6850,7 +7032,7 @@ If you want to remount the same app, move your app creation logic into a factory
6850
7032
  return args.some((elem) => elem.toLowerCase() === "boolean");
6851
7033
  }
6852
7034
 
6853
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
7035
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6854
7036
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6855
7037
  const normalizeSlot = (key, rawSlot, ctx) => {
6856
7038
  if (rawSlot._n) {
@@ -6904,8 +7086,6 @@ If you want to remount the same app, move your app creation logic into a factory
6904
7086
  const initSlots = (instance, children, optimized) => {
6905
7087
  const slots = instance.slots = createInternalObject();
6906
7088
  if (instance.vnode.shapeFlag & 32) {
6907
- const cacheIndexes = children.__;
6908
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6909
7089
  const type = children._;
6910
7090
  if (type) {
6911
7091
  assignSlots(slots, children, optimized);
@@ -6969,12 +7149,10 @@ If you want to remount the same app, move your app creation logic into a factory
6969
7149
  if (instance.appContext.config.performance && isSupported()) {
6970
7150
  const startTag = `vue-${type}-${instance.uid}`;
6971
7151
  const endTag = startTag + `:end`;
7152
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6972
7153
  perf.mark(endTag);
6973
- perf.measure(
6974
- `<${formatComponentName(instance, instance.type)}> ${type}`,
6975
- startTag,
6976
- endTag
6977
- );
7154
+ perf.measure(measureName, startTag, endTag);
7155
+ perf.clearMeasures(measureName);
6978
7156
  perf.clearMarks(startTag);
6979
7157
  perf.clearMarks(endTag);
6980
7158
  }
@@ -7213,15 +7391,25 @@ If you want to remount the same app, move your app creation logic into a factory
7213
7391
  optimized
7214
7392
  );
7215
7393
  } else {
7216
- patchElement(
7217
- n1,
7218
- n2,
7219
- parentComponent,
7220
- parentSuspense,
7221
- namespace,
7222
- slotScopeIds,
7223
- optimized
7224
- );
7394
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
7395
+ try {
7396
+ if (customElement) {
7397
+ customElement._beginPatch();
7398
+ }
7399
+ patchElement(
7400
+ n1,
7401
+ n2,
7402
+ parentComponent,
7403
+ parentSuspense,
7404
+ namespace,
7405
+ slotScopeIds,
7406
+ optimized
7407
+ );
7408
+ } finally {
7409
+ if (customElement) {
7410
+ customElement._endPatch();
7411
+ }
7412
+ }
7225
7413
  }
7226
7414
  };
7227
7415
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -7272,16 +7460,20 @@ If you want to remount the same app, move your app creation logic into a factory
7272
7460
  if (dirs) {
7273
7461
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7274
7462
  }
7275
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
7276
- if (needCallTransitionHooks) {
7277
- transition.beforeEnter(el);
7463
+ if (transition) {
7464
+ performTransitionEnter(
7465
+ el,
7466
+ transition,
7467
+ () => hostInsert(el, container, anchor),
7468
+ parentSuspense
7469
+ );
7470
+ } else {
7471
+ hostInsert(el, container, anchor);
7278
7472
  }
7279
- hostInsert(el, container, anchor);
7280
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7473
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
7281
7474
  queuePostRenderEffect(
7282
7475
  () => {
7283
7476
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7284
- needCallTransitionHooks && transition.enter(el);
7285
7477
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7286
7478
  },
7287
7479
  void 0,
@@ -7298,21 +7490,9 @@ If you want to remount the same app, move your app creation logic into a factory
7298
7490
  hostSetScopeId(el, slotScopeIds[i]);
7299
7491
  }
7300
7492
  }
7301
- let subTree = parentComponent && parentComponent.subTree;
7302
- if (subTree) {
7303
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
7304
- subTree = filterSingleRoot(subTree.children) || subTree;
7305
- }
7306
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
7307
- const parentVNode = parentComponent.vnode;
7308
- setScopeId(
7309
- el,
7310
- parentVNode,
7311
- parentVNode.scopeId,
7312
- parentVNode.slotScopeIds,
7313
- parentComponent.parent
7314
- );
7315
- }
7493
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
7494
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
7495
+ hostSetScopeId(el, inheritedScopeIds[i]);
7316
7496
  }
7317
7497
  };
7318
7498
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -7553,12 +7733,21 @@ If you want to remount the same app, move your app creation logic into a factory
7553
7733
  n2.slotScopeIds = slotScopeIds;
7554
7734
  if (n2.type.__vapor) {
7555
7735
  if (n1 == null) {
7556
- getVaporInterface(parentComponent, n2).mount(
7557
- n2,
7558
- container,
7559
- anchor,
7560
- parentComponent
7561
- );
7736
+ if (n2.shapeFlag & 512) {
7737
+ getVaporInterface(parentComponent, n2).activate(
7738
+ n2,
7739
+ container,
7740
+ anchor,
7741
+ parentComponent
7742
+ );
7743
+ } else {
7744
+ getVaporInterface(parentComponent, n2).mount(
7745
+ n2,
7746
+ container,
7747
+ anchor,
7748
+ parentComponent
7749
+ );
7750
+ }
7562
7751
  } else {
7563
7752
  getVaporInterface(parentComponent, n2).update(
7564
7753
  n1,
@@ -7621,6 +7810,7 @@ If you want to remount the same app, move your app creation logic into a factory
7621
7810
  if (!initialVNode.el) {
7622
7811
  const placeholder = instance.subTree = createVNode(Comment);
7623
7812
  processCommentNode(null, placeholder, container, anchor);
7813
+ initialVNode.placeholder = placeholder.el;
7624
7814
  }
7625
7815
  } else {
7626
7816
  setupRenderEffect(
@@ -8161,7 +8351,11 @@ If you want to remount the same app, move your app creation logic into a factory
8161
8351
  for (i = toBePatched - 1; i >= 0; i--) {
8162
8352
  const nextIndex = s2 + i;
8163
8353
  const nextChild = c2[nextIndex];
8164
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
8354
+ const anchorVNode = c2[nextIndex + 1];
8355
+ const anchor = nextIndex + 1 < l2 ? (
8356
+ // #13559, fallback to el placeholder for unresolved async component
8357
+ anchorVNode.el || anchorVNode.placeholder
8358
+ ) : parentAnchor;
8165
8359
  if (newIndexToOldIndexMap[i] === 0) {
8166
8360
  patch(
8167
8361
  null,
@@ -8241,12 +8435,12 @@ If you want to remount the same app, move your app creation logic into a factory
8241
8435
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8242
8436
  if (needTransition2) {
8243
8437
  if (moveType === 0) {
8244
- transition.beforeEnter(el);
8245
- hostInsert(el, container, anchor);
8246
- queuePostRenderEffect(
8247
- () => transition.enter(el),
8248
- void 0,
8249
- parentSuspense
8438
+ performTransitionEnter(
8439
+ el,
8440
+ transition,
8441
+ () => hostInsert(el, container, anchor),
8442
+ parentSuspense,
8443
+ true
8250
8444
  );
8251
8445
  } else {
8252
8446
  const { leave, delayLeave, afterLeave } = transition;
@@ -8258,6 +8452,12 @@ If you want to remount the same app, move your app creation logic into a factory
8258
8452
  }
8259
8453
  };
8260
8454
  const performLeave = () => {
8455
+ if (el._isLeaving) {
8456
+ el[leaveCbKey](
8457
+ true
8458
+ /* cancelled */
8459
+ );
8460
+ }
8261
8461
  leave(el, () => {
8262
8462
  remove2();
8263
8463
  afterLeave && afterLeave();
@@ -8297,7 +8497,14 @@ If you want to remount the same app, move your app creation logic into a factory
8297
8497
  parentComponent.renderCache[cacheIndex] = void 0;
8298
8498
  }
8299
8499
  if (shapeFlag & 256) {
8300
- parentComponent.ctx.deactivate(vnode);
8500
+ if (vnode.type.__vapor) {
8501
+ getVaporInterface(parentComponent, vnode).deactivate(
8502
+ vnode,
8503
+ parentComponent.ctx.getStorageContainer()
8504
+ );
8505
+ } else {
8506
+ parentComponent.ctx.deactivate(vnode);
8507
+ }
8301
8508
  return;
8302
8509
  }
8303
8510
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -8385,22 +8592,15 @@ If you want to remount the same app, move your app creation logic into a factory
8385
8592
  removeStaticNode(vnode);
8386
8593
  return;
8387
8594
  }
8388
- const performRemove = () => {
8389
- hostRemove(el);
8390
- if (transition && !transition.persisted && transition.afterLeave) {
8391
- transition.afterLeave();
8392
- }
8393
- };
8394
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8395
- const { leave, delayLeave } = transition;
8396
- const performLeave = () => leave(el, performRemove);
8397
- if (delayLeave) {
8398
- delayLeave(vnode.el, performRemove, performLeave);
8399
- } else {
8400
- performLeave();
8401
- }
8595
+ if (transition) {
8596
+ performTransitionLeave(
8597
+ el,
8598
+ transition,
8599
+ () => hostRemove(el),
8600
+ !!(vnode.shapeFlag & 1)
8601
+ );
8402
8602
  } else {
8403
- performRemove();
8603
+ hostRemove(el);
8404
8604
  }
8405
8605
  };
8406
8606
  const removeFragment = (cur, end) => {
@@ -8416,27 +8616,12 @@ If you want to remount the same app, move your app creation logic into a factory
8416
8616
  if (instance.type.__hmrId) {
8417
8617
  unregisterHMR(instance);
8418
8618
  }
8419
- const {
8420
- bum,
8421
- scope,
8422
- effect,
8423
- subTree,
8424
- um,
8425
- m,
8426
- a,
8427
- parent,
8428
- slots: { __: slotCacheKeys }
8429
- } = instance;
8619
+ const { bum, scope, effect, subTree, um, m, a } = instance;
8430
8620
  invalidateMount(m);
8431
8621
  invalidateMount(a);
8432
8622
  if (bum) {
8433
8623
  invokeArrayFns(bum);
8434
8624
  }
8435
- if (parent && isArray(slotCacheKeys)) {
8436
- slotCacheKeys.forEach((v) => {
8437
- parent.renderCache[v] = void 0;
8438
- });
8439
- }
8440
8625
  scope.stop();
8441
8626
  if (effect) {
8442
8627
  effect.stop();
@@ -8450,12 +8635,6 @@ If you want to remount the same app, move your app creation logic into a factory
8450
8635
  void 0,
8451
8636
  parentSuspense
8452
8637
  );
8453
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8454
- parentSuspense.deps--;
8455
- if (parentSuspense.deps === 0) {
8456
- parentSuspense.resolve();
8457
- }
8458
- }
8459
8638
  {
8460
8639
  devtoolsComponentRemoved(instance);
8461
8640
  }
@@ -8468,7 +8647,7 @@ If you want to remount the same app, move your app creation logic into a factory
8468
8647
  const getNextHostNode = (vnode) => {
8469
8648
  if (vnode.shapeFlag & 6) {
8470
8649
  if (vnode.type.__vapor) {
8471
- return hostNextSibling(vnode.component.block);
8650
+ return hostNextSibling(vnode.anchor);
8472
8651
  }
8473
8652
  return getNextHostNode(vnode.component.subTree);
8474
8653
  }
@@ -8546,6 +8725,7 @@ If you want to remount the same app, move your app creation logic into a factory
8546
8725
  return {
8547
8726
  render,
8548
8727
  hydrate,
8728
+ hydrateNode,
8549
8729
  internals,
8550
8730
  createApp: createAppAPI(
8551
8731
  mountApp,
@@ -8585,7 +8765,8 @@ If you want to remount the same app, move your app creation logic into a factory
8585
8765
  if (!shallow && c2.patchFlag !== -2)
8586
8766
  traverseStaticChildren(c1, c2);
8587
8767
  }
8588
- if (c2.type === Text) {
8768
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8769
+ c2.patchFlag !== -1) {
8589
8770
  c2.el = c1.el;
8590
8771
  }
8591
8772
  if (c2.type === Comment && !c2.el) {
@@ -8598,7 +8779,7 @@ If you want to remount the same app, move your app creation logic into a factory
8598
8779
  }
8599
8780
  }
8600
8781
  function locateNonHydratedAsyncRoot(instance) {
8601
- const subComponent = instance.vapor ? null : instance.subTree.component;
8782
+ const subComponent = instance.subTree && instance.subTree.component;
8602
8783
  if (subComponent) {
8603
8784
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
8604
8785
  return subComponent;
@@ -8613,6 +8794,34 @@ If you want to remount the same app, move your app creation logic into a factory
8613
8794
  hooks[i].flags |= 4;
8614
8795
  }
8615
8796
  }
8797
+ function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8798
+ if (force || needTransition(parentSuspense, transition)) {
8799
+ transition.beforeEnter(el);
8800
+ insert();
8801
+ queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
8802
+ } else {
8803
+ insert();
8804
+ }
8805
+ }
8806
+ function performTransitionLeave(el, transition, remove, isElement = true) {
8807
+ const performRemove = () => {
8808
+ remove();
8809
+ if (transition && !transition.persisted && transition.afterLeave) {
8810
+ transition.afterLeave();
8811
+ }
8812
+ };
8813
+ if (isElement && transition && !transition.persisted) {
8814
+ const { leave, delayLeave } = transition;
8815
+ const performLeave = () => leave(el, performRemove);
8816
+ if (delayLeave) {
8817
+ delayLeave(el, performRemove, performLeave);
8818
+ } else {
8819
+ performLeave();
8820
+ }
8821
+ } else {
8822
+ performRemove();
8823
+ }
8824
+ }
8616
8825
  function getVaporInterface(instance, vnode) {
8617
8826
  const ctx = instance ? instance.appContext : vnode.appContext;
8618
8827
  const res = ctx && ctx.vapor;
@@ -8627,6 +8836,32 @@ app.use(vaporInteropPlugin)
8627
8836
  }
8628
8837
  return res;
8629
8838
  }
8839
+ function getInheritedScopeIds(vnode, parentComponent) {
8840
+ const inheritedScopeIds = [];
8841
+ let currentParent = parentComponent;
8842
+ let currentVNode = vnode;
8843
+ while (currentParent) {
8844
+ let subTree = currentParent.subTree;
8845
+ if (!subTree) break;
8846
+ if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
8847
+ subTree = filterSingleRoot(subTree.children) || subTree;
8848
+ }
8849
+ if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
8850
+ const parentVNode = currentParent.vnode;
8851
+ if (parentVNode.scopeId) {
8852
+ inheritedScopeIds.push(parentVNode.scopeId);
8853
+ }
8854
+ if (parentVNode.slotScopeIds) {
8855
+ inheritedScopeIds.push(...parentVNode.slotScopeIds);
8856
+ }
8857
+ currentVNode = parentVNode;
8858
+ currentParent = currentParent.parent;
8859
+ } else {
8860
+ break;
8861
+ }
8862
+ }
8863
+ return inheritedScopeIds;
8864
+ }
8630
8865
 
8631
8866
  const ssrContextKey = Symbol.for("v-scx");
8632
8867
  const useSSRContext = () => {
@@ -8842,7 +9077,7 @@ app.use(vaporInteropPlugin)
8842
9077
  return res;
8843
9078
  }
8844
9079
  const getModelModifiers = (props, modelName, getter) => {
8845
- return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
9080
+ return getter(props, getModifierPropName(modelName)) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
8846
9081
  };
8847
9082
 
8848
9083
  function emit(instance, event, ...rawArgs) {
@@ -8938,8 +9173,9 @@ app.use(vaporInteropPlugin)
8938
9173
  function defaultPropGetter(props, key) {
8939
9174
  return props[key];
8940
9175
  }
9176
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8941
9177
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8942
- const cache = appContext.emitsCache;
9178
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8943
9179
  const cached = cache.get(comp);
8944
9180
  if (cached !== void 0) {
8945
9181
  return cached;
@@ -9387,7 +9623,7 @@ app.use(vaporInteropPlugin)
9387
9623
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
9388
9624
  if (pendingBranch) {
9389
9625
  suspense.pendingBranch = newBranch;
9390
- if (isSameVNodeType(newBranch, pendingBranch)) {
9626
+ if (isSameVNodeType(pendingBranch, newBranch)) {
9391
9627
  patch(
9392
9628
  pendingBranch,
9393
9629
  newBranch,
@@ -9458,7 +9694,7 @@ app.use(vaporInteropPlugin)
9458
9694
  );
9459
9695
  setActiveBranch(suspense, newFallback);
9460
9696
  }
9461
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9697
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9462
9698
  patch(
9463
9699
  activeBranch,
9464
9700
  newBranch,
@@ -9489,7 +9725,7 @@ app.use(vaporInteropPlugin)
9489
9725
  }
9490
9726
  }
9491
9727
  } else {
9492
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9728
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9493
9729
  patch(
9494
9730
  activeBranch,
9495
9731
  newBranch,
@@ -9602,7 +9838,8 @@ app.use(vaporInteropPlugin)
9602
9838
  pendingId,
9603
9839
  effects,
9604
9840
  parentComponent: parentComponent2,
9605
- container: container2
9841
+ container: container2,
9842
+ isInFallback
9606
9843
  } = suspense;
9607
9844
  let delayEnter = false;
9608
9845
  if (suspense.isHydrating) {
@@ -9620,6 +9857,9 @@ app.use(vaporInteropPlugin)
9620
9857
  parentComponent2
9621
9858
  );
9622
9859
  queuePostFlushCb(effects);
9860
+ if (isInFallback && vnode2.ssFallback) {
9861
+ vnode2.ssFallback.el = null;
9862
+ }
9623
9863
  }
9624
9864
  };
9625
9865
  }
@@ -9628,6 +9868,9 @@ app.use(vaporInteropPlugin)
9628
9868
  anchor = next(activeBranch);
9629
9869
  }
9630
9870
  unmount(activeBranch, parentComponent2, suspense, true);
9871
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9872
+ vnode2.ssFallback.el = null;
9873
+ }
9631
9874
  }
9632
9875
  if (!delayEnter) {
9633
9876
  move(
@@ -9752,6 +9995,7 @@ app.use(vaporInteropPlugin)
9752
9995
  optimized2
9753
9996
  );
9754
9997
  if (placeholder) {
9998
+ vnode2.placeholder = null;
9755
9999
  remove(placeholder);
9756
10000
  }
9757
10001
  updateHOCHostEl(instance, vnode2.el);
@@ -9957,15 +10201,11 @@ app.use(vaporInteropPlugin)
9957
10201
  );
9958
10202
  };
9959
10203
  const normalizeKey = ({ key }) => key != null ? key : null;
9960
- const normalizeRef = ({
9961
- ref,
9962
- ref_key,
9963
- ref_for
9964
- }) => {
10204
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
9965
10205
  if (typeof ref === "number") {
9966
10206
  ref = "" + ref;
9967
10207
  }
9968
- return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
10208
+ return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
9969
10209
  };
9970
10210
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
9971
10211
  const vnode = {
@@ -10131,6 +10371,7 @@ Component that was made reactive: `,
10131
10371
  suspense: vnode.suspense,
10132
10372
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
10133
10373
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
10374
+ placeholder: vnode.placeholder,
10134
10375
  el: vnode.el,
10135
10376
  anchor: vnode.anchor,
10136
10377
  ctx: vnode.ctx,
@@ -10278,6 +10519,25 @@ Component that was made reactive: `,
10278
10519
  simpleSetCurrentInstance(instance);
10279
10520
  }
10280
10521
  };
10522
+ const internalOptions = ["ce", "type"];
10523
+ const useInstanceOption = (key, silent = false) => {
10524
+ const instance = getCurrentGenericInstance();
10525
+ if (!instance) {
10526
+ if (!silent) {
10527
+ warn$1(`useInstanceOption called without an active component instance.`);
10528
+ }
10529
+ return { hasInstance: false, value: void 0 };
10530
+ }
10531
+ if (!internalOptions.includes(key)) {
10532
+ {
10533
+ warn$1(
10534
+ `useInstanceOption only accepts ${internalOptions.map((k) => `'${k}'`).join(", ")} as key, got '${key}'.`
10535
+ );
10536
+ }
10537
+ return { hasInstance: true, value: void 0 };
10538
+ }
10539
+ return { hasInstance: true, value: instance[key] };
10540
+ };
10281
10541
 
10282
10542
  const emptyAppContext = createAppContext();
10283
10543
  let uid = 0;
@@ -10643,7 +10903,7 @@ Component that was made reactive: `,
10643
10903
  return instance.proxy;
10644
10904
  }
10645
10905
  }
10646
- const classifyRE = /(?:^|[-_])(\w)/g;
10906
+ const classifyRE = /(?:^|[-_])\w/g;
10647
10907
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
10648
10908
  function getComponentName(Component, includeInferred = true) {
10649
10909
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -10679,23 +10939,28 @@ Component that was made reactive: `,
10679
10939
  };
10680
10940
 
10681
10941
  function h(type, propsOrChildren, children) {
10682
- const l = arguments.length;
10683
- if (l === 2) {
10684
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10685
- if (isVNode(propsOrChildren)) {
10686
- return createVNode(type, null, [propsOrChildren]);
10942
+ try {
10943
+ setBlockTracking(-1);
10944
+ const l = arguments.length;
10945
+ if (l === 2) {
10946
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10947
+ if (isVNode(propsOrChildren)) {
10948
+ return createVNode(type, null, [propsOrChildren]);
10949
+ }
10950
+ return createVNode(type, propsOrChildren);
10951
+ } else {
10952
+ return createVNode(type, null, propsOrChildren);
10687
10953
  }
10688
- return createVNode(type, propsOrChildren);
10689
10954
  } else {
10690
- return createVNode(type, null, propsOrChildren);
10691
- }
10692
- } else {
10693
- if (l > 3) {
10694
- children = Array.prototype.slice.call(arguments, 2);
10695
- } else if (l === 3 && isVNode(children)) {
10696
- children = [children];
10955
+ if (l > 3) {
10956
+ children = Array.prototype.slice.call(arguments, 2);
10957
+ } else if (l === 3 && isVNode(children)) {
10958
+ children = [children];
10959
+ }
10960
+ return createVNode(type, propsOrChildren, children);
10697
10961
  }
10698
- return createVNode(type, propsOrChildren, children);
10962
+ } finally {
10963
+ setBlockTracking(1);
10699
10964
  }
10700
10965
  }
10701
10966
 
@@ -10905,7 +11170,7 @@ Component that was made reactive: `,
10905
11170
  return true;
10906
11171
  }
10907
11172
 
10908
- const version = "3.6.0-alpha.2";
11173
+ const version = "3.6.0-alpha.4";
10909
11174
  const warn = warn$1 ;
10910
11175
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10911
11176
  const devtools = devtools$1 ;
@@ -11122,11 +11387,11 @@ Component that was made reactive: `,
11122
11387
  const resolve = () => finishLeave(el, done);
11123
11388
  addTransitionClass(el, leaveFromClass);
11124
11389
  if (!el._enterCancelled) {
11125
- forceReflow();
11390
+ forceReflow(el);
11126
11391
  addTransitionClass(el, leaveActiveClass);
11127
11392
  } else {
11128
11393
  addTransitionClass(el, leaveActiveClass);
11129
- forceReflow();
11394
+ forceReflow(el);
11130
11395
  }
11131
11396
  nextFrame(() => {
11132
11397
  if (!el._isLeaving) {
@@ -11252,7 +11517,7 @@ Component that was made reactive: `,
11252
11517
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11253
11518
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11254
11519
  }
11255
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11520
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
11256
11521
  getStyleProperties(`${TRANSITION}Property`).toString()
11257
11522
  );
11258
11523
  return {
@@ -11272,8 +11537,9 @@ Component that was made reactive: `,
11272
11537
  if (s === "auto") return 0;
11273
11538
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11274
11539
  }
11275
- function forceReflow() {
11276
- return document.body.offsetHeight;
11540
+ function forceReflow(el) {
11541
+ const targetDocument = el ? el.ownerDocument : document;
11542
+ return targetDocument.body.offsetHeight;
11277
11543
  }
11278
11544
 
11279
11545
  function patchClass(el, value, isSVG) {
@@ -11293,6 +11559,8 @@ Component that was made reactive: `,
11293
11559
  const vShowOriginalDisplay = Symbol("_vod");
11294
11560
  const vShowHidden = Symbol("_vsh");
11295
11561
  const vShow = {
11562
+ // used for prop mismatch check during hydration
11563
+ name: "show",
11296
11564
  beforeMount(el, { value }, { transition }) {
11297
11565
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
11298
11566
  if (transition && value) {
@@ -11326,9 +11594,6 @@ Component that was made reactive: `,
11326
11594
  setDisplay(el, value);
11327
11595
  }
11328
11596
  };
11329
- {
11330
- vShow.name = "show";
11331
- }
11332
11597
  function setDisplay(el, value) {
11333
11598
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
11334
11599
  el[vShowHidden] = !value;
@@ -11407,7 +11672,7 @@ Component that was made reactive: `,
11407
11672
  }
11408
11673
  }
11409
11674
 
11410
- const displayRE = /(^|;)\s*display\s*:/;
11675
+ const displayRE = /(?:^|;)\s*display\s*:/;
11411
11676
  function patchStyle(el, prev, next) {
11412
11677
  const style = el.style;
11413
11678
  const isCssString = isString(next);
@@ -11712,11 +11977,10 @@ Expected function or array of functions, received type ${typeof value}.`
11712
11977
  }
11713
11978
 
11714
11979
  const REMOVAL = {};
11715
- /*! #__NO_SIDE_EFFECTS__ */
11716
11980
  // @__NO_SIDE_EFFECTS__
11717
11981
  function defineCustomElement(options, extraOptions, _createApp) {
11718
- const Comp = defineComponent(options, extraOptions);
11719
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
11982
+ let Comp = defineComponent(options, extraOptions);
11983
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
11720
11984
  class VueCustomElement extends VueElement {
11721
11985
  constructor(initialProps) {
11722
11986
  super(Comp, initialProps, _createApp);
@@ -11725,18 +11989,14 @@ Expected function or array of functions, received type ${typeof value}.`
11725
11989
  VueCustomElement.def = Comp;
11726
11990
  return VueCustomElement;
11727
11991
  }
11728
- /*! #__NO_SIDE_EFFECTS__ */
11729
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11992
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11730
11993
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11731
- };
11994
+ });
11732
11995
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11733
11996
  };
11734
- class VueElement extends BaseClass {
11735
- constructor(_def, _props = {}, _createApp = createApp) {
11997
+ class VueElementBase extends BaseClass {
11998
+ constructor(def, props = {}, createAppFn) {
11736
11999
  super();
11737
- this._def = _def;
11738
- this._props = _props;
11739
- this._createApp = _createApp;
11740
12000
  this._isVueCE = true;
11741
12001
  /**
11742
12002
  * @internal
@@ -11746,25 +12006,26 @@ Expected function or array of functions, received type ${typeof value}.`
11746
12006
  * @internal
11747
12007
  */
11748
12008
  this._app = null;
11749
- /**
11750
- * @internal
11751
- */
11752
- this._nonce = this._def.nonce;
11753
12009
  this._connected = false;
11754
12010
  this._resolved = false;
11755
12011
  this._numberProps = null;
11756
12012
  this._styleChildren = /* @__PURE__ */ new WeakSet();
12013
+ this._patching = false;
12014
+ this._dirty = false;
11757
12015
  this._ob = null;
11758
- if (this.shadowRoot && _createApp !== createApp) {
12016
+ this._def = def;
12017
+ this._props = props;
12018
+ this._createApp = createAppFn;
12019
+ this._nonce = def.nonce;
12020
+ if (this._needsHydration()) {
11759
12021
  this._root = this.shadowRoot;
11760
12022
  } else {
11761
- if (this.shadowRoot) {
11762
- warn(
11763
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
12023
+ if (def.shadowRoot !== false) {
12024
+ this.attachShadow(
12025
+ extend({}, def.shadowRootOptions, {
12026
+ mode: "open"
12027
+ })
11764
12028
  );
11765
- }
11766
- if (_def.shadowRoot !== false) {
11767
- this.attachShadow({ mode: "open" });
11768
12029
  this._root = this.shadowRoot;
11769
12030
  } else {
11770
12031
  this._root = this;
@@ -11779,14 +12040,14 @@ Expected function or array of functions, received type ${typeof value}.`
11779
12040
  this._connected = true;
11780
12041
  let parent = this;
11781
12042
  while (parent = parent && (parent.parentNode || parent.host)) {
11782
- if (parent instanceof VueElement) {
12043
+ if (parent instanceof VueElementBase) {
11783
12044
  this._parent = parent;
11784
12045
  break;
11785
12046
  }
11786
12047
  }
11787
12048
  if (!this._instance) {
11788
12049
  if (this._resolved) {
11789
- this._mount(this._def);
12050
+ this._mountComponent(this._def);
11790
12051
  } else {
11791
12052
  if (parent && parent._pendingResolve) {
11792
12053
  this._pendingResolve = parent._pendingResolve.then(() => {
@@ -11799,8 +12060,24 @@ Expected function or array of functions, received type ${typeof value}.`
11799
12060
  }
11800
12061
  }
11801
12062
  }
12063
+ disconnectedCallback() {
12064
+ this._connected = false;
12065
+ nextTick(() => {
12066
+ if (!this._connected) {
12067
+ if (this._ob) {
12068
+ this._ob.disconnect();
12069
+ this._ob = null;
12070
+ }
12071
+ this._unmount();
12072
+ if (this._teleportTargets) {
12073
+ this._teleportTargets.clear();
12074
+ this._teleportTargets = void 0;
12075
+ }
12076
+ }
12077
+ });
12078
+ }
11802
12079
  _setParent(parent = this._parent) {
11803
- if (parent) {
12080
+ if (parent && this._instance) {
11804
12081
  this._instance.parent = parent._instance;
11805
12082
  this._inheritParentContext(parent);
11806
12083
  }
@@ -11813,19 +12090,10 @@ Expected function or array of functions, received type ${typeof value}.`
11813
12090
  );
11814
12091
  }
11815
12092
  }
11816
- disconnectedCallback() {
11817
- this._connected = false;
11818
- nextTick(() => {
11819
- if (!this._connected) {
11820
- if (this._ob) {
11821
- this._ob.disconnect();
11822
- this._ob = null;
11823
- }
11824
- this._app && this._app.unmount();
11825
- if (this._instance) this._instance.ce = void 0;
11826
- this._app = this._instance = null;
11827
- }
11828
- });
12093
+ _processMutations(mutations) {
12094
+ for (const m of mutations) {
12095
+ this._setAttr(m.attributeName);
12096
+ }
11829
12097
  }
11830
12098
  /**
11831
12099
  * resolve inner component definition (handle possible async component)
@@ -11837,13 +12105,9 @@ Expected function or array of functions, received type ${typeof value}.`
11837
12105
  for (let i = 0; i < this.attributes.length; i++) {
11838
12106
  this._setAttr(this.attributes[i].name);
11839
12107
  }
11840
- this._ob = new MutationObserver((mutations) => {
11841
- for (const m of mutations) {
11842
- this._setAttr(m.attributeName);
11843
- }
11844
- });
12108
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11845
12109
  this._ob.observe(this, { attributes: true });
11846
- const resolve = (def, isAsync = false) => {
12110
+ const resolve = (def) => {
11847
12111
  this._resolved = true;
11848
12112
  this._pendingResolve = void 0;
11849
12113
  const { props, styles } = def;
@@ -11868,29 +12132,25 @@ Expected function or array of functions, received type ${typeof value}.`
11868
12132
  "Custom element style injection is not supported when using shadowRoot: false"
11869
12133
  );
11870
12134
  }
11871
- this._mount(def);
12135
+ this._mountComponent(def);
11872
12136
  };
11873
12137
  const asyncDef = this._def.__asyncLoader;
11874
12138
  if (asyncDef) {
12139
+ const { configureApp } = this._def;
11875
12140
  this._pendingResolve = asyncDef().then((def) => {
11876
- def.configureApp = this._def.configureApp;
11877
- resolve(this._def = def, true);
12141
+ def.configureApp = configureApp;
12142
+ this._def = def;
12143
+ resolve(def);
11878
12144
  });
11879
12145
  } else {
11880
12146
  resolve(this._def);
11881
12147
  }
11882
12148
  }
11883
- _mount(def) {
11884
- if (!def.name) {
11885
- def.name = "VueElement";
11886
- }
11887
- this._app = this._createApp(def);
11888
- this._inheritParentContext();
11889
- if (def.configureApp) {
11890
- def.configureApp(this._app);
11891
- }
11892
- this._app._ceVNode = this._createVNode();
11893
- this._app.mount(this._root);
12149
+ _mountComponent(def) {
12150
+ this._mount(def);
12151
+ this._processExposed();
12152
+ }
12153
+ _processExposed() {
11894
12154
  const exposed = this._instance && this._instance.exposed;
11895
12155
  if (!exposed) return;
11896
12156
  for (const key in exposed) {
@@ -11904,6 +12164,38 @@ Expected function or array of functions, received type ${typeof value}.`
11904
12164
  }
11905
12165
  }
11906
12166
  }
12167
+ _processInstance() {
12168
+ this._instance.ce = this;
12169
+ this._instance.isCE = true;
12170
+ {
12171
+ this._instance.ceReload = (newStyles) => {
12172
+ if (this._styles) {
12173
+ this._styles.forEach((s) => this._root.removeChild(s));
12174
+ this._styles.length = 0;
12175
+ }
12176
+ this._applyStyles(newStyles);
12177
+ if (!this._instance.vapor) {
12178
+ this._instance = null;
12179
+ }
12180
+ this._update();
12181
+ };
12182
+ }
12183
+ const dispatch = (event, args) => {
12184
+ this.dispatchEvent(
12185
+ new CustomEvent(
12186
+ event,
12187
+ isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
12188
+ )
12189
+ );
12190
+ };
12191
+ this._instance.emit = (event, ...args) => {
12192
+ dispatch(event, args);
12193
+ if (hyphenate(event) !== event) {
12194
+ dispatch(hyphenate(event), args);
12195
+ }
12196
+ };
12197
+ this._setParent();
12198
+ }
11907
12199
  _resolveProps(def) {
11908
12200
  const { props } = def;
11909
12201
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
@@ -11918,7 +12210,7 @@ Expected function or array of functions, received type ${typeof value}.`
11918
12210
  return this._getProp(key);
11919
12211
  },
11920
12212
  set(val) {
11921
- this._setProp(key, val, true, true);
12213
+ this._setProp(key, val, true, !this._patching);
11922
12214
  }
11923
12215
  });
11924
12216
  }
@@ -11944,11 +12236,12 @@ Expected function or array of functions, received type ${typeof value}.`
11944
12236
  */
11945
12237
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
11946
12238
  if (val !== this._props[key]) {
12239
+ this._dirty = true;
11947
12240
  if (val === REMOVAL) {
11948
12241
  delete this._props[key];
11949
12242
  } else {
11950
12243
  this._props[key] = val;
11951
- if (key === "key" && this._app) {
12244
+ if (key === "key" && this._app && this._app._ceVNode) {
11952
12245
  this._app._ceVNode.key = val;
11953
12246
  }
11954
12247
  }
@@ -11957,7 +12250,10 @@ Expected function or array of functions, received type ${typeof value}.`
11957
12250
  }
11958
12251
  if (shouldReflect) {
11959
12252
  const ob = this._ob;
11960
- ob && ob.disconnect();
12253
+ if (ob) {
12254
+ this._processMutations(ob.takeRecords());
12255
+ ob.disconnect();
12256
+ }
11961
12257
  if (val === true) {
11962
12258
  this.setAttribute(hyphenate(key), "");
11963
12259
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11969,52 +12265,6 @@ Expected function or array of functions, received type ${typeof value}.`
11969
12265
  }
11970
12266
  }
11971
12267
  }
11972
- _update() {
11973
- const vnode = this._createVNode();
11974
- if (this._app) vnode.appContext = this._app._context;
11975
- render(vnode, this._root);
11976
- }
11977
- _createVNode() {
11978
- const baseProps = {};
11979
- if (!this.shadowRoot) {
11980
- baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
11981
- }
11982
- const vnode = createVNode(this._def, extend(baseProps, this._props));
11983
- if (!this._instance) {
11984
- vnode.ce = (instance) => {
11985
- this._instance = instance;
11986
- instance.ce = this;
11987
- instance.isCE = true;
11988
- {
11989
- instance.ceReload = (newStyles) => {
11990
- if (this._styles) {
11991
- this._styles.forEach((s) => this._root.removeChild(s));
11992
- this._styles.length = 0;
11993
- }
11994
- this._applyStyles(newStyles);
11995
- this._instance = null;
11996
- this._update();
11997
- };
11998
- }
11999
- const dispatch = (event, args) => {
12000
- this.dispatchEvent(
12001
- new CustomEvent(
12002
- event,
12003
- isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
12004
- )
12005
- );
12006
- };
12007
- instance.emit = (event, ...args) => {
12008
- dispatch(event, args);
12009
- if (hyphenate(event) !== event) {
12010
- dispatch(hyphenate(event), args);
12011
- }
12012
- };
12013
- this._setParent();
12014
- };
12015
- }
12016
- return vnode;
12017
- }
12018
12268
  _applyStyles(styles, owner) {
12019
12269
  if (!styles) return;
12020
12270
  if (owner) {
@@ -12061,13 +12311,15 @@ Expected function or array of functions, received type ${typeof value}.`
12061
12311
  * Only called when shadowRoot is false
12062
12312
  */
12063
12313
  _renderSlots() {
12064
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
12314
+ const outlets = this._getSlots();
12065
12315
  const scopeId = this._instance.type.__scopeId;
12316
+ const slotReplacements = /* @__PURE__ */ new Map();
12066
12317
  for (let i = 0; i < outlets.length; i++) {
12067
12318
  const o = outlets[i];
12068
12319
  const slotName = o.getAttribute("name") || "default";
12069
12320
  const content = this._slots[slotName];
12070
12321
  const parent = o.parentNode;
12322
+ const replacementNodes = [];
12071
12323
  if (content) {
12072
12324
  for (const n of content) {
12073
12325
  if (scopeId && n.nodeType === 1) {
@@ -12080,12 +12332,36 @@ Expected function or array of functions, received type ${typeof value}.`
12080
12332
  }
12081
12333
  }
12082
12334
  parent.insertBefore(n, o);
12335
+ replacementNodes.push(n);
12083
12336
  }
12084
12337
  } else {
12085
- while (o.firstChild) parent.insertBefore(o.firstChild, o);
12338
+ while (o.firstChild) {
12339
+ const child = o.firstChild;
12340
+ parent.insertBefore(child, o);
12341
+ replacementNodes.push(child);
12342
+ }
12086
12343
  }
12087
12344
  parent.removeChild(o);
12345
+ slotReplacements.set(o, replacementNodes);
12346
+ }
12347
+ this._updateSlotNodes(slotReplacements);
12348
+ }
12349
+ /**
12350
+ * @internal
12351
+ */
12352
+ _getSlots() {
12353
+ const roots = [this];
12354
+ if (this._teleportTargets) {
12355
+ roots.push(...this._teleportTargets);
12356
+ }
12357
+ const slots = /* @__PURE__ */ new Set();
12358
+ for (const root of roots) {
12359
+ const found = root.querySelectorAll("slot");
12360
+ for (let i = 0; i < found.length; i++) {
12361
+ slots.add(found[i]);
12362
+ }
12088
12363
  }
12364
+ return Array.from(slots);
12089
12365
  }
12090
12366
  /**
12091
12367
  * @internal
@@ -12093,6 +12369,22 @@ Expected function or array of functions, received type ${typeof value}.`
12093
12369
  _injectChildStyle(comp) {
12094
12370
  this._applyStyles(comp.styles, comp);
12095
12371
  }
12372
+ /**
12373
+ * @internal
12374
+ */
12375
+ _beginPatch() {
12376
+ this._patching = true;
12377
+ this._dirty = false;
12378
+ }
12379
+ /**
12380
+ * @internal
12381
+ */
12382
+ _endPatch() {
12383
+ this._patching = false;
12384
+ if (this._dirty && this._instance) {
12385
+ this._update();
12386
+ }
12387
+ }
12096
12388
  /**
12097
12389
  * @internal
12098
12390
  */
@@ -12109,13 +12401,76 @@ Expected function or array of functions, received type ${typeof value}.`
12109
12401
  }
12110
12402
  }
12111
12403
  }
12404
+ class VueElement extends VueElementBase {
12405
+ constructor(def, props = {}, createAppFn = createApp) {
12406
+ super(def, props, createAppFn);
12407
+ }
12408
+ _needsHydration() {
12409
+ if (this.shadowRoot && this._createApp !== createApp) {
12410
+ return true;
12411
+ } else {
12412
+ if (this.shadowRoot) {
12413
+ warn(
12414
+ `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
12415
+ );
12416
+ }
12417
+ }
12418
+ return false;
12419
+ }
12420
+ _mount(def) {
12421
+ if (!def.name) {
12422
+ def.name = "VueElement";
12423
+ }
12424
+ this._app = this._createApp(def);
12425
+ this._inheritParentContext();
12426
+ if (def.configureApp) {
12427
+ def.configureApp(this._app);
12428
+ }
12429
+ this._app._ceVNode = this._createVNode();
12430
+ this._app.mount(this._root);
12431
+ }
12432
+ _update() {
12433
+ if (!this._app) return;
12434
+ const vnode = this._createVNode();
12435
+ vnode.appContext = this._app._context;
12436
+ render(vnode, this._root);
12437
+ }
12438
+ _unmount() {
12439
+ if (this._app) {
12440
+ this._app.unmount();
12441
+ }
12442
+ if (this._instance && this._instance.ce) {
12443
+ this._instance.ce = void 0;
12444
+ }
12445
+ this._app = this._instance = null;
12446
+ }
12447
+ /**
12448
+ * Only called when shadowRoot is false
12449
+ */
12450
+ _updateSlotNodes(replacements) {
12451
+ }
12452
+ _createVNode() {
12453
+ const baseProps = {};
12454
+ if (!this.shadowRoot) {
12455
+ baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
12456
+ }
12457
+ const vnode = createVNode(this._def, extend(baseProps, this._props));
12458
+ if (!this._instance) {
12459
+ vnode.ce = (instance) => {
12460
+ this._instance = instance;
12461
+ this._processInstance();
12462
+ };
12463
+ }
12464
+ return vnode;
12465
+ }
12466
+ }
12112
12467
  function useHost(caller) {
12113
- const instance = getCurrentInstance();
12114
- const el = instance && instance.ce;
12468
+ const { hasInstance, value } = useInstanceOption("ce", true);
12469
+ const el = value;
12115
12470
  if (el) {
12116
12471
  return el;
12117
12472
  } else {
12118
- if (!instance) {
12473
+ if (!hasInstance) {
12119
12474
  warn(
12120
12475
  `${caller || "useHost"} called without an active component instance.`
12121
12476
  );
@@ -12173,26 +12528,13 @@ Expected function or array of functions, received type ${typeof value}.`
12173
12528
  prevChildren = [];
12174
12529
  return;
12175
12530
  }
12176
- prevChildren.forEach(callPendingCbs);
12531
+ prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
12177
12532
  prevChildren.forEach(recordPosition);
12178
12533
  const movedChildren = prevChildren.filter(applyTranslation);
12179
- forceReflow();
12534
+ forceReflow(instance.vnode.el);
12180
12535
  movedChildren.forEach((c) => {
12181
12536
  const el = c.el;
12182
- const style = el.style;
12183
- addTransitionClass(el, moveClass);
12184
- style.transform = style.webkitTransform = style.transitionDuration = "";
12185
- const cb = el[moveCbKey] = (e) => {
12186
- if (e && e.target !== el) {
12187
- return;
12188
- }
12189
- if (!e || /transform$/.test(e.propertyName)) {
12190
- el.removeEventListener("transitionend", cb);
12191
- el[moveCbKey] = null;
12192
- removeTransitionClass(el, moveClass);
12193
- }
12194
- };
12195
- el.addEventListener("transitionend", cb);
12537
+ handleMovedChildren(el, moveClass);
12196
12538
  });
12197
12539
  prevChildren = [];
12198
12540
  });
@@ -12215,10 +12557,10 @@ Expected function or array of functions, received type ${typeof value}.`
12215
12557
  instance
12216
12558
  )
12217
12559
  );
12218
- positionMap.set(
12219
- child,
12220
- child.el.getBoundingClientRect()
12221
- );
12560
+ positionMap.set(child, {
12561
+ left: child.el.offsetLeft,
12562
+ top: child.el.offsetTop
12563
+ });
12222
12564
  }
12223
12565
  }
12224
12566
  }
@@ -12239,8 +12581,7 @@ Expected function or array of functions, received type ${typeof value}.`
12239
12581
  }
12240
12582
  });
12241
12583
  const TransitionGroup = TransitionGroupImpl;
12242
- function callPendingCbs(c) {
12243
- const el = c.el;
12584
+ function callPendingCbs(el) {
12244
12585
  if (el[moveCbKey]) {
12245
12586
  el[moveCbKey]();
12246
12587
  }
@@ -12249,19 +12590,30 @@ Expected function or array of functions, received type ${typeof value}.`
12249
12590
  }
12250
12591
  }
12251
12592
  function recordPosition(c) {
12252
- newPositionMap.set(c, c.el.getBoundingClientRect());
12593
+ newPositionMap.set(c, {
12594
+ left: c.el.offsetLeft,
12595
+ top: c.el.offsetTop
12596
+ });
12253
12597
  }
12254
12598
  function applyTranslation(c) {
12255
- const oldPos = positionMap.get(c);
12256
- const newPos = newPositionMap.get(c);
12599
+ if (baseApplyTranslation(
12600
+ positionMap.get(c),
12601
+ newPositionMap.get(c),
12602
+ c.el
12603
+ )) {
12604
+ return c;
12605
+ }
12606
+ }
12607
+ function baseApplyTranslation(oldPos, newPos, el) {
12257
12608
  const dx = oldPos.left - newPos.left;
12258
12609
  const dy = oldPos.top - newPos.top;
12259
12610
  if (dx || dy) {
12260
- const s = c.el.style;
12611
+ const s = el.style;
12261
12612
  s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
12262
12613
  s.transitionDuration = "0s";
12263
- return c;
12614
+ return true;
12264
12615
  }
12616
+ return false;
12265
12617
  }
12266
12618
  function hasCSSTransform(el, root, moveClass) {
12267
12619
  const clone = el.cloneNode();
@@ -12279,6 +12631,22 @@ Expected function or array of functions, received type ${typeof value}.`
12279
12631
  container.removeChild(clone);
12280
12632
  return hasTransform;
12281
12633
  }
12634
+ const handleMovedChildren = (el, moveClass) => {
12635
+ const style = el.style;
12636
+ addTransitionClass(el, moveClass);
12637
+ style.transform = style.webkitTransform = style.transitionDuration = "";
12638
+ const cb = el[moveCbKey] = (e) => {
12639
+ if (e && e.target !== el) {
12640
+ return;
12641
+ }
12642
+ if (!e || e.propertyName.endsWith("transform")) {
12643
+ el.removeEventListener("transitionend", cb);
12644
+ el[moveCbKey] = null;
12645
+ removeTransitionClass(el, moveClass);
12646
+ }
12647
+ };
12648
+ el.addEventListener("transitionend", cb);
12649
+ };
12282
12650
 
12283
12651
  const getModelAssigner = (vnode) => {
12284
12652
  const fn = vnode.props["onUpdate:modelValue"] || false;
@@ -12314,21 +12682,21 @@ Expected function or array of functions, received type ${typeof value}.`
12314
12682
  vModelTextUpdate(el, oldValue, value, trim, number, lazy);
12315
12683
  }
12316
12684
  };
12685
+ function castValue(value, trim, number) {
12686
+ if (trim) value = value.trim();
12687
+ if (number) value = looseToNumber(value);
12688
+ return value;
12689
+ }
12317
12690
  const vModelTextInit = (el, trim, number, lazy, set) => {
12318
12691
  addEventListener(el, lazy ? "change" : "input", (e) => {
12319
12692
  if (e.target.composing) return;
12320
- let domValue = el.value;
12321
- if (trim) {
12322
- domValue = domValue.trim();
12323
- }
12324
- if (number || el.type === "number") {
12325
- domValue = looseToNumber(domValue);
12326
- }
12327
- (0, el[assignKey])(domValue);
12693
+ (0, el[assignKey])(
12694
+ castValue(el.value, trim, number || el.type === "number")
12695
+ );
12328
12696
  });
12329
- if (trim) {
12697
+ if (trim || number) {
12330
12698
  addEventListener(el, "change", () => {
12331
- el.value = el.value.trim();
12699
+ el.value = castValue(el.value, trim, number || el.type === "number");
12332
12700
  });
12333
12701
  }
12334
12702
  if (!lazy) {
@@ -12577,13 +12945,13 @@ Expected function or array of functions, received type ${typeof value}.`
12577
12945
  const withModifiers = (fn, modifiers) => {
12578
12946
  const cache = fn._withMods || (fn._withMods = {});
12579
12947
  const cacheKey = modifiers.join(".");
12580
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12948
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12581
12949
  for (let i = 0; i < modifiers.length; i++) {
12582
12950
  const guard = modifierGuards[modifiers[i]];
12583
12951
  if (guard && guard(event, modifiers)) return;
12584
12952
  }
12585
12953
  return fn(event, ...args);
12586
- });
12954
+ }));
12587
12955
  };
12588
12956
  const keyNames = {
12589
12957
  esc: "escape",
@@ -12597,7 +12965,7 @@ Expected function or array of functions, received type ${typeof value}.`
12597
12965
  const withKeys = (fn, modifiers) => {
12598
12966
  const cache = fn._withKeys || (fn._withKeys = {});
12599
12967
  const cacheKey = modifiers.join(".");
12600
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
12968
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12601
12969
  if (!("key" in event)) {
12602
12970
  return;
12603
12971
  }
@@ -12607,7 +12975,7 @@ Expected function or array of functions, received type ${typeof value}.`
12607
12975
  )) {
12608
12976
  return fn(event);
12609
12977
  }
12610
- });
12978
+ }));
12611
12979
  };
12612
12980
 
12613
12981
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12621,13 +12989,13 @@ Expected function or array of functions, received type ${typeof value}.`
12621
12989
  enabledHydration = true;
12622
12990
  return renderer;
12623
12991
  }
12624
- const render = (...args) => {
12992
+ const render = ((...args) => {
12625
12993
  ensureRenderer().render(...args);
12626
- };
12627
- const hydrate = (...args) => {
12994
+ });
12995
+ const hydrate = ((...args) => {
12628
12996
  ensureHydrationRenderer().hydrate(...args);
12629
- };
12630
- const createApp = (...args) => {
12997
+ });
12998
+ const createApp = ((...args) => {
12631
12999
  const app = ensureRenderer().createApp(...args);
12632
13000
  {
12633
13001
  injectNativeTagCheck(app);
@@ -12652,8 +13020,8 @@ Expected function or array of functions, received type ${typeof value}.`
12652
13020
  return proxy;
12653
13021
  };
12654
13022
  return app;
12655
- };
12656
- const createSSRApp = (...args) => {
13023
+ });
13024
+ const createSSRApp = ((...args) => {
12657
13025
  const app = ensureHydrationRenderer().createApp(...args);
12658
13026
  {
12659
13027
  injectNativeTagCheck(app);
@@ -12667,7 +13035,7 @@ Expected function or array of functions, received type ${typeof value}.`
12667
13035
  }
12668
13036
  };
12669
13037
  return app;
12670
- };
13038
+ });
12671
13039
  function resolveRootNamespace(container) {
12672
13040
  if (container instanceof SVGElement) {
12673
13041
  return "svg";
@@ -12749,6 +13117,7 @@ Expected function or array of functions, received type ${typeof value}.`
12749
13117
  exports.TransitionGroup = TransitionGroup;
12750
13118
  exports.TriggerOpTypes = TriggerOpTypes;
12751
13119
  exports.VueElement = VueElement;
13120
+ exports.VueElementBase = VueElementBase;
12752
13121
  exports.assertNumber = assertNumber;
12753
13122
  exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
12754
13123
  exports.callWithErrorHandling = callWithErrorHandling;
@@ -12813,6 +13182,7 @@ Expected function or array of functions, received type ${typeof value}.`
12813
13182
  exports.mergeModels = mergeModels;
12814
13183
  exports.mergeProps = mergeProps;
12815
13184
  exports.nextTick = nextTick;
13185
+ exports.nodeOps = nodeOps;
12816
13186
  exports.normalizeClass = normalizeClass;
12817
13187
  exports.normalizeProps = normalizeProps;
12818
13188
  exports.normalizeStyle = normalizeStyle;
@@ -12831,6 +13201,7 @@ Expected function or array of functions, received type ${typeof value}.`
12831
13201
  exports.onUpdated = onUpdated;
12832
13202
  exports.onWatcherCleanup = onWatcherCleanup;
12833
13203
  exports.openBlock = openBlock;
13204
+ exports.patchProp = patchProp;
12834
13205
  exports.popScopeId = popScopeId;
12835
13206
  exports.provide = provide;
12836
13207
  exports.proxyRefs = proxyRefs;
@@ -12872,6 +13243,7 @@ Expected function or array of functions, received type ${typeof value}.`
12872
13243
  exports.useCssVars = useCssVars;
12873
13244
  exports.useHost = useHost;
12874
13245
  exports.useId = useId;
13246
+ exports.useInstanceOption = useInstanceOption;
12875
13247
  exports.useModel = useModel;
12876
13248
  exports.useSSRContext = useSSRContext;
12877
13249
  exports.useShadowRoot = useShadowRoot;