@vue/compat 3.3.3 → 3.3.5

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.
@@ -37,7 +37,7 @@ var Vue = (function () {
37
37
  const isSymbol = (val) => typeof val === "symbol";
38
38
  const isObject = (val) => val !== null && typeof val === "object";
39
39
  const isPromise = (val) => {
40
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
40
+ return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
41
41
  };
42
42
  const objectToString = Object.prototype.toString;
43
43
  const toTypeString = (value) => objectToString.call(value);
@@ -68,12 +68,13 @@ var Vue = (function () {
68
68
  const hyphenate = cacheStringFunction(
69
69
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
70
70
  );
71
- const capitalize = cacheStringFunction(
72
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
73
- );
74
- const toHandlerKey = cacheStringFunction(
75
- (str) => str ? `on${capitalize(str)}` : ``
76
- );
71
+ const capitalize = cacheStringFunction((str) => {
72
+ return str.charAt(0).toUpperCase() + str.slice(1);
73
+ });
74
+ const toHandlerKey = cacheStringFunction((str) => {
75
+ const s = str ? `on${capitalize(str)}` : ``;
76
+ return s;
77
+ });
77
78
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
78
79
  const invokeArrayFns = (fns, arg) => {
79
80
  for (let i = 0; i < fns.length; i++) {
@@ -123,8 +124,8 @@ var Vue = (function () {
123
124
  [3]: "FORWARDED"
124
125
  };
125
126
 
126
- const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
127
- const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
127
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
128
+ const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
128
129
 
129
130
  const range = 2;
130
131
  function generateCodeFrame(source, start = 0, end = source.length) {
@@ -179,9 +180,7 @@ var Vue = (function () {
179
180
  }
180
181
  }
181
182
  return res;
182
- } else if (isString(value)) {
183
- return value;
184
- } else if (isObject(value)) {
183
+ } else if (isString(value) || isObject(value)) {
185
184
  return value;
186
185
  }
187
186
  }
@@ -530,7 +529,7 @@ var Vue = (function () {
530
529
  }
531
530
  }
532
531
  function effect(fn, options) {
533
- if (fn.effect) {
532
+ if (fn.effect instanceof ReactiveEffect) {
534
533
  fn = fn.effect.fn;
535
534
  }
536
535
  const _effect = new ReactiveEffect(fn);
@@ -696,10 +695,6 @@ var Vue = (function () {
696
695
  const builtInSymbols = new Set(
697
696
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
698
697
  );
699
- const get$1 = /* @__PURE__ */ createGetter();
700
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
701
- const readonlyGet = /* @__PURE__ */ createGetter(true);
702
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
703
698
  const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
704
699
  function createArrayInstrumentations() {
705
700
  const instrumentations = {};
@@ -732,8 +727,13 @@ var Vue = (function () {
732
727
  track(obj, "has", key);
733
728
  return obj.hasOwnProperty(key);
734
729
  }
735
- function createGetter(isReadonly2 = false, shallow = false) {
736
- return function get2(target, key, receiver) {
730
+ class BaseReactiveHandler {
731
+ constructor(_isReadonly = false, _shallow = false) {
732
+ this._isReadonly = _isReadonly;
733
+ this._shallow = _shallow;
734
+ }
735
+ get(target, key, receiver) {
736
+ const isReadonly2 = this._isReadonly, shallow = this._shallow;
737
737
  if (key === "__v_isReactive") {
738
738
  return !isReadonly2;
739
739
  } else if (key === "__v_isReadonly") {
@@ -769,17 +769,18 @@ var Vue = (function () {
769
769
  return isReadonly2 ? readonly(res) : reactive(res);
770
770
  }
771
771
  return res;
772
- };
772
+ }
773
773
  }
774
- const set$1 = /* @__PURE__ */ createSetter();
775
- const shallowSet = /* @__PURE__ */ createSetter(true);
776
- function createSetter(shallow = false) {
777
- return function set2(target, key, value, receiver) {
774
+ class MutableReactiveHandler extends BaseReactiveHandler {
775
+ constructor(shallow = false) {
776
+ super(false, shallow);
777
+ }
778
+ set(target, key, value, receiver) {
778
779
  let oldValue = target[key];
779
780
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
780
781
  return false;
781
782
  }
782
- if (!shallow) {
783
+ if (!this._shallow) {
783
784
  if (!isShallow(value) && !isReadonly(value)) {
784
785
  oldValue = toRaw(oldValue);
785
786
  value = toRaw(value);
@@ -799,37 +800,36 @@ var Vue = (function () {
799
800
  }
800
801
  }
801
802
  return result;
802
- };
803
- }
804
- function deleteProperty(target, key) {
805
- const hadKey = hasOwn(target, key);
806
- const oldValue = target[key];
807
- const result = Reflect.deleteProperty(target, key);
808
- if (result && hadKey) {
809
- trigger(target, "delete", key, void 0, oldValue);
810
803
  }
811
- return result;
812
- }
813
- function has$1(target, key) {
814
- const result = Reflect.has(target, key);
815
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
816
- track(target, "has", key);
804
+ deleteProperty(target, key) {
805
+ const hadKey = hasOwn(target, key);
806
+ const oldValue = target[key];
807
+ const result = Reflect.deleteProperty(target, key);
808
+ if (result && hadKey) {
809
+ trigger(target, "delete", key, void 0, oldValue);
810
+ }
811
+ return result;
812
+ }
813
+ has(target, key) {
814
+ const result = Reflect.has(target, key);
815
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
816
+ track(target, "has", key);
817
+ }
818
+ return result;
819
+ }
820
+ ownKeys(target) {
821
+ track(
822
+ target,
823
+ "iterate",
824
+ isArray(target) ? "length" : ITERATE_KEY
825
+ );
826
+ return Reflect.ownKeys(target);
817
827
  }
818
- return result;
819
- }
820
- function ownKeys(target) {
821
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
822
- return Reflect.ownKeys(target);
823
828
  }
824
- const mutableHandlers = {
825
- get: get$1,
826
- set: set$1,
827
- deleteProperty,
828
- has: has$1,
829
- ownKeys
830
- };
831
- const readonlyHandlers = {
832
- get: readonlyGet,
829
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
830
+ constructor(shallow = false) {
831
+ super(true, shallow);
832
+ }
833
833
  set(target, key) {
834
834
  {
835
835
  warn$1(
@@ -838,7 +838,7 @@ var Vue = (function () {
838
838
  );
839
839
  }
840
840
  return true;
841
- },
841
+ }
842
842
  deleteProperty(target, key) {
843
843
  {
844
844
  warn$1(
@@ -848,22 +848,13 @@ var Vue = (function () {
848
848
  }
849
849
  return true;
850
850
  }
851
- };
852
- const shallowReactiveHandlers = /* @__PURE__ */ extend(
853
- {},
854
- mutableHandlers,
855
- {
856
- get: shallowGet,
857
- set: shallowSet
858
- }
859
- );
860
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
861
- {},
862
- readonlyHandlers,
863
- {
864
- get: shallowReadonlyGet
865
- }
851
+ }
852
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
853
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
854
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
855
+ true
866
856
  );
857
+ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
867
858
 
868
859
  const toShallow = (value) => value;
869
860
  const getProto = (v) => Reflect.getPrototypeOf(v);
@@ -872,7 +863,7 @@ var Vue = (function () {
872
863
  const rawTarget = toRaw(target);
873
864
  const rawKey = toRaw(key);
874
865
  if (!isReadonly) {
875
- if (key !== rawKey) {
866
+ if (hasChanged(key, rawKey)) {
876
867
  track(rawTarget, "get", key);
877
868
  }
878
869
  track(rawTarget, "get", rawKey);
@@ -892,7 +883,7 @@ var Vue = (function () {
892
883
  const rawTarget = toRaw(target);
893
884
  const rawKey = toRaw(key);
894
885
  if (!isReadonly) {
895
- if (key !== rawKey) {
886
+ if (hasChanged(key, rawKey)) {
896
887
  track(rawTarget, "has", key);
897
888
  }
898
889
  track(rawTarget, "has", rawKey);
@@ -1422,11 +1413,7 @@ var Vue = (function () {
1422
1413
  }
1423
1414
  function propertyToRef(source, key, defaultValue) {
1424
1415
  const val = source[key];
1425
- return isRef(val) ? val : new ObjectRefImpl(
1426
- source,
1427
- key,
1428
- defaultValue
1429
- );
1416
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1430
1417
  }
1431
1418
 
1432
1419
  class ComputedRefImpl {
@@ -3720,9 +3707,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3720
3707
  }
3721
3708
  if (cb) {
3722
3709
  const newValue = effect.run();
3723
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
3724
- (v, i) => hasChanged(v, oldValue[i])
3725
- ) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) {
3710
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) {
3726
3711
  if (cleanup) {
3727
3712
  cleanup();
3728
3713
  }
@@ -3896,6 +3881,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3896
3881
  }
3897
3882
  }
3898
3883
 
3884
+ const leaveCbKey = Symbol("_leaveCb");
3885
+ const enterCbKey$1 = Symbol("_enterCb");
3899
3886
  function useTransitionState() {
3900
3887
  const state = {
3901
3888
  isMounted: false,
@@ -4016,9 +4003,9 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4016
4003
  oldInnerChild
4017
4004
  );
4018
4005
  leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
4019
- el._leaveCb = () => {
4006
+ el[leaveCbKey] = () => {
4020
4007
  earlyRemove();
4021
- el._leaveCb = void 0;
4008
+ el[leaveCbKey] = void 0;
4022
4009
  delete enterHooks.delayedLeave;
4023
4010
  };
4024
4011
  enterHooks.delayedLeave = delayedLeave;
@@ -4092,15 +4079,15 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4092
4079
  return;
4093
4080
  }
4094
4081
  }
4095
- if (el._leaveCb) {
4096
- el._leaveCb(
4082
+ if (el[leaveCbKey]) {
4083
+ el[leaveCbKey](
4097
4084
  true
4098
4085
  /* cancelled */
4099
4086
  );
4100
4087
  }
4101
4088
  const leavingVNode = leavingVNodesCache[key];
4102
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
4103
- leavingVNode.el._leaveCb();
4089
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
4090
+ leavingVNode.el[leaveCbKey]();
4104
4091
  }
4105
4092
  callHook(hook, [el]);
4106
4093
  },
@@ -4118,7 +4105,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4118
4105
  }
4119
4106
  }
4120
4107
  let called = false;
4121
- const done = el._enterCb = (cancelled) => {
4108
+ const done = el[enterCbKey$1] = (cancelled) => {
4122
4109
  if (called)
4123
4110
  return;
4124
4111
  called = true;
@@ -4130,7 +4117,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4130
4117
  if (hooks.delayedLeave) {
4131
4118
  hooks.delayedLeave();
4132
4119
  }
4133
- el._enterCb = void 0;
4120
+ el[enterCbKey$1] = void 0;
4134
4121
  };
4135
4122
  if (hook) {
4136
4123
  callAsyncHook(hook, [el, done]);
@@ -4140,8 +4127,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4140
4127
  },
4141
4128
  leave(el, remove) {
4142
4129
  const key2 = String(vnode.key);
4143
- if (el._enterCb) {
4144
- el._enterCb(
4130
+ if (el[enterCbKey$1]) {
4131
+ el[enterCbKey$1](
4145
4132
  true
4146
4133
  /* cancelled */
4147
4134
  );
@@ -4151,7 +4138,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4151
4138
  }
4152
4139
  callHook(onBeforeLeave, [el]);
4153
4140
  let called = false;
4154
- const done = el._leaveCb = (cancelled) => {
4141
+ const done = el[leaveCbKey] = (cancelled) => {
4155
4142
  if (called)
4156
4143
  return;
4157
4144
  called = true;
@@ -4161,7 +4148,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4161
4148
  } else {
4162
4149
  callHook(onAfterLeave, [el]);
4163
4150
  }
4164
- el._leaveCb = void 0;
4151
+ el[leaveCbKey] = void 0;
4165
4152
  if (leavingVNodesCache[key2] === vnode) {
4166
4153
  delete leavingVNodesCache[key2];
4167
4154
  }
@@ -4223,6 +4210,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4223
4210
  return ret;
4224
4211
  }
4225
4212
 
4213
+ /*! #__NO_SIDE_EFFECTS__ */
4214
+ // @__NO_SIDE_EFFECTS__
4226
4215
  function defineComponent(options, extraOptions) {
4227
4216
  return isFunction(options) ? (
4228
4217
  // #8326: extend call and options.name access are considered side-effects
@@ -4232,6 +4221,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4232
4221
  }
4233
4222
 
4234
4223
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4224
+ /*! #__NO_SIDE_EFFECTS__ */
4225
+ // @__NO_SIDE_EFFECTS__
4235
4226
  function defineAsyncComponent(source) {
4236
4227
  if (isFunction(source)) {
4237
4228
  source = { loader: source };
@@ -5244,6 +5235,7 @@ If this is a native custom element, make sure to exclude it from component resol
5244
5235
  function installCompatInstanceProperties(map) {
5245
5236
  const set = (target, key, val) => {
5246
5237
  target[key] = val;
5238
+ return target[key];
5247
5239
  };
5248
5240
  const del = (target, key) => {
5249
5241
  delete target[key];
@@ -5521,7 +5513,7 @@ If this is a native custom element, make sure to exclude it from component resol
5521
5513
  return PublicInstanceProxyHandlers.get(target, key, target);
5522
5514
  },
5523
5515
  has(_, key) {
5524
- const has = key[0] !== "_" && !isGloballyWhitelisted(key);
5516
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
5525
5517
  if (!has && PublicInstanceProxyHandlers.has(_, key)) {
5526
5518
  warn(
5527
5519
  `Property ${JSON.stringify(
@@ -6258,7 +6250,7 @@ If this is a native custom element, make sure to exclude it from component resol
6258
6250
  return vm;
6259
6251
  }
6260
6252
  }
6261
- Vue.version = `2.6.14-compat:${"3.3.3"}`;
6253
+ Vue.version = `2.6.14-compat:${"3.3.5"}`;
6262
6254
  Vue.config = singletonApp.config;
6263
6255
  Vue.use = (p, ...options) => {
6264
6256
  if (p && isFunction(p.install)) {
@@ -6666,7 +6658,7 @@ If this is a native custom element, make sure to exclude it from component resol
6666
6658
  },
6667
6659
  set() {
6668
6660
  warn(
6669
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
6661
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6670
6662
  );
6671
6663
  }
6672
6664
  });
@@ -6753,10 +6745,7 @@ If this is a native custom element, make sure to exclude it from component resol
6753
6745
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
6754
6746
  );
6755
6747
  }
6756
- const vnode = createVNode(
6757
- rootComponent,
6758
- rootProps
6759
- );
6748
+ const vnode = createVNode(rootComponent, rootProps);
6760
6749
  vnode.appContext = context;
6761
6750
  {
6762
6751
  context.reload = () => {
@@ -7579,8 +7568,10 @@ If you want to remount the same app, move your app creation logic into a factory
7579
7568
  hasMismatch = true;
7580
7569
  warn(
7581
7570
  `Hydration text mismatch:
7582
- - Client: ${JSON.stringify(node.data)}
7583
- - Server: ${JSON.stringify(vnode.children)}`
7571
+ - Server rendered: ${JSON.stringify(
7572
+ node.data
7573
+ )}
7574
+ - Client rendered: ${JSON.stringify(vnode.children)}`
7584
7575
  );
7585
7576
  node.data = vnode.children;
7586
7577
  }
@@ -7783,8 +7774,8 @@ If you want to remount the same app, move your app creation logic into a factory
7783
7774
  hasMismatch = true;
7784
7775
  warn(
7785
7776
  `Hydration text content mismatch in <${vnode.type}>:
7786
- - Client: ${el.textContent}
7787
- - Server: ${vnode.children}`
7777
+ - Server rendered: ${el.textContent}
7778
+ - Client rendered: ${vnode.children}`
7788
7779
  );
7789
7780
  el.textContent = vnode.children;
7790
7781
  }
@@ -9566,6 +9557,10 @@ If you want to remount the same app, move your app creation logic into a factory
9566
9557
  internals,
9567
9558
  1
9568
9559
  );
9560
+ } else {
9561
+ if (n2.props && n1.props && n2.props.to !== n1.props.to) {
9562
+ n2.props.to = n1.props.to;
9563
+ }
9569
9564
  }
9570
9565
  } else {
9571
9566
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
@@ -10419,9 +10414,12 @@ Component that was made reactive: `,
10419
10414
  if (!skipOptions) {
10420
10415
  setCurrentInstance(instance);
10421
10416
  pauseTracking();
10422
- applyOptions(instance);
10423
- resetTracking();
10424
- unsetCurrentInstance();
10417
+ try {
10418
+ applyOptions(instance);
10419
+ } finally {
10420
+ resetTracking();
10421
+ unsetCurrentInstance();
10422
+ }
10425
10423
  }
10426
10424
  if (!Component.render && instance.render === NOOP && !isSSR) {
10427
10425
  if (!compile$1 && Component.template) {
@@ -10781,7 +10779,7 @@ Component that was made reactive: `,
10781
10779
  return true;
10782
10780
  }
10783
10781
 
10784
- const version = "3.3.3";
10782
+ const version = "3.3.5";
10785
10783
  const ssrUtils = null;
10786
10784
  const resolveFilter = resolveFilter$1 ;
10787
10785
  const _compatUtils = {
@@ -10860,922 +10858,977 @@ Component that was made reactive: `,
10860
10858
  }
10861
10859
  };
10862
10860
 
10863
- function patchClass(el, value, isSVG) {
10864
- const transitionClasses = el._vtc;
10865
- if (transitionClasses) {
10866
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
10867
- }
10868
- if (value == null) {
10869
- el.removeAttribute("class");
10870
- } else if (isSVG) {
10871
- el.setAttribute("class", value);
10872
- } else {
10873
- el.className = value;
10874
- }
10861
+ const TRANSITION$1 = "transition";
10862
+ const ANIMATION = "animation";
10863
+ const vtcKey = Symbol("_vtc");
10864
+ const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
10865
+ Transition.displayName = "Transition";
10866
+ {
10867
+ Transition.__isBuiltIn = true;
10875
10868
  }
10876
-
10877
- function patchStyle(el, prev, next) {
10878
- const style = el.style;
10879
- const isCssString = isString(next);
10880
- if (next && !isCssString) {
10881
- if (prev && !isString(prev)) {
10882
- for (const key in prev) {
10883
- if (next[key] == null) {
10884
- setStyle(style, key, "");
10885
- }
10886
- }
10887
- }
10888
- for (const key in next) {
10889
- setStyle(style, key, next[key]);
10890
- }
10891
- } else {
10892
- const currentDisplay = style.display;
10893
- if (isCssString) {
10894
- if (prev !== next) {
10895
- style.cssText = next;
10896
- }
10897
- } else if (prev) {
10898
- el.removeAttribute("style");
10899
- }
10900
- if ("_vod" in el) {
10901
- style.display = currentDisplay;
10902
- }
10869
+ const DOMTransitionPropsValidators = {
10870
+ name: String,
10871
+ type: String,
10872
+ css: {
10873
+ type: Boolean,
10874
+ default: true
10875
+ },
10876
+ duration: [String, Number, Object],
10877
+ enterFromClass: String,
10878
+ enterActiveClass: String,
10879
+ enterToClass: String,
10880
+ appearFromClass: String,
10881
+ appearActiveClass: String,
10882
+ appearToClass: String,
10883
+ leaveFromClass: String,
10884
+ leaveActiveClass: String,
10885
+ leaveToClass: String
10886
+ };
10887
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
10888
+ {},
10889
+ BaseTransitionPropsValidators,
10890
+ DOMTransitionPropsValidators
10891
+ );
10892
+ const callHook = (hook, args = []) => {
10893
+ if (isArray(hook)) {
10894
+ hook.forEach((h2) => h2(...args));
10895
+ } else if (hook) {
10896
+ hook(...args);
10903
10897
  }
10904
- }
10905
- const semicolonRE = /[^\\];\s*$/;
10906
- const importantRE = /\s*!important$/;
10907
- function setStyle(style, name, val) {
10908
- if (isArray(val)) {
10909
- val.forEach((v) => setStyle(style, name, v));
10910
- } else {
10911
- if (val == null)
10912
- val = "";
10913
- {
10914
- if (semicolonRE.test(val)) {
10915
- warn(
10916
- `Unexpected semicolon at the end of '${name}' style value: '${val}'`
10917
- );
10918
- }
10919
- }
10920
- if (name.startsWith("--")) {
10921
- style.setProperty(name, val);
10922
- } else {
10923
- const prefixed = autoPrefix(style, name);
10924
- if (importantRE.test(val)) {
10925
- style.setProperty(
10926
- hyphenate(prefixed),
10927
- val.replace(importantRE, ""),
10928
- "important"
10929
- );
10930
- } else {
10931
- style[prefixed] = val;
10932
- }
10898
+ };
10899
+ const hasExplicitCallback = (hook) => {
10900
+ return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
10901
+ };
10902
+ function resolveTransitionProps(rawProps) {
10903
+ const baseProps = {};
10904
+ for (const key in rawProps) {
10905
+ if (!(key in DOMTransitionPropsValidators)) {
10906
+ baseProps[key] = rawProps[key];
10933
10907
  }
10934
10908
  }
10935
- }
10936
- const prefixes = ["Webkit", "Moz", "ms"];
10937
- const prefixCache = {};
10938
- function autoPrefix(style, rawName) {
10939
- const cached = prefixCache[rawName];
10940
- if (cached) {
10941
- return cached;
10942
- }
10943
- let name = camelize(rawName);
10944
- if (name !== "filter" && name in style) {
10945
- return prefixCache[rawName] = name;
10946
- }
10947
- name = capitalize(name);
10948
- for (let i = 0; i < prefixes.length; i++) {
10949
- const prefixed = prefixes[i] + name;
10950
- if (prefixed in style) {
10951
- return prefixCache[rawName] = prefixed;
10952
- }
10909
+ if (rawProps.css === false) {
10910
+ return baseProps;
10953
10911
  }
10954
- return rawName;
10955
- }
10956
-
10957
- const xlinkNS = "http://www.w3.org/1999/xlink";
10958
- function patchAttr(el, key, value, isSVG, instance) {
10959
- if (isSVG && key.startsWith("xlink:")) {
10960
- if (value == null) {
10961
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10962
- } else {
10963
- el.setAttributeNS(xlinkNS, key, value);
10964
- }
10965
- } else {
10966
- if (compatCoerceAttr(el, key, value, instance)) {
10967
- return;
10912
+ const {
10913
+ name = "v",
10914
+ type,
10915
+ duration,
10916
+ enterFromClass = `${name}-enter-from`,
10917
+ enterActiveClass = `${name}-enter-active`,
10918
+ enterToClass = `${name}-enter-to`,
10919
+ appearFromClass = enterFromClass,
10920
+ appearActiveClass = enterActiveClass,
10921
+ appearToClass = enterToClass,
10922
+ leaveFromClass = `${name}-leave-from`,
10923
+ leaveActiveClass = `${name}-leave-active`,
10924
+ leaveToClass = `${name}-leave-to`
10925
+ } = rawProps;
10926
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
10927
+ let legacyEnterFromClass;
10928
+ let legacyAppearFromClass;
10929
+ let legacyLeaveFromClass;
10930
+ if (legacyClassEnabled) {
10931
+ const toLegacyClass = (cls) => cls.replace(/-from$/, "");
10932
+ if (!rawProps.enterFromClass) {
10933
+ legacyEnterFromClass = toLegacyClass(enterFromClass);
10968
10934
  }
10969
- const isBoolean = isSpecialBooleanAttr(key);
10970
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
10971
- el.removeAttribute(key);
10972
- } else {
10973
- el.setAttribute(key, isBoolean ? "" : value);
10935
+ if (!rawProps.appearFromClass) {
10936
+ legacyAppearFromClass = toLegacyClass(appearFromClass);
10974
10937
  }
10975
- }
10976
- }
10977
- const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
10978
- function compatCoerceAttr(el, key, value, instance = null) {
10979
- if (isEnumeratedAttr(key)) {
10980
- const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
10981
- if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
10982
- "ATTR_ENUMERATED_COERCION",
10983
- instance,
10984
- key,
10985
- value,
10986
- v2CoercedValue
10987
- )) {
10988
- el.setAttribute(key, v2CoercedValue);
10989
- return true;
10938
+ if (!rawProps.leaveFromClass) {
10939
+ legacyLeaveFromClass = toLegacyClass(leaveFromClass);
10990
10940
  }
10991
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
10992
- "ATTR_FALSE_VALUE",
10993
- instance,
10994
- key
10995
- )) {
10996
- el.removeAttribute(key);
10997
- return true;
10998
10941
  }
10999
- return false;
11000
- }
11001
-
11002
- function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
11003
- if (key === "innerHTML" || key === "textContent") {
11004
- if (prevChildren) {
11005
- unmountChildren(prevChildren, parentComponent, parentSuspense);
11006
- }
11007
- el[key] = value == null ? "" : value;
11008
- return;
11009
- }
11010
- const tag = el.tagName;
11011
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11012
- !tag.includes("-")) {
11013
- el._value = value;
11014
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11015
- const newValue = value == null ? "" : value;
11016
- if (oldValue !== newValue) {
11017
- el.value = newValue;
11018
- }
11019
- if (value == null) {
11020
- el.removeAttribute(key);
11021
- }
11022
- return;
11023
- }
11024
- let needRemove = false;
11025
- if (value === "" || value == null) {
11026
- const type = typeof el[key];
11027
- if (type === "boolean") {
11028
- value = includeBooleanAttr(value);
11029
- } else if (value == null && type === "string") {
11030
- value = "";
11031
- needRemove = true;
11032
- } else if (type === "number") {
11033
- value = 0;
11034
- needRemove = true;
11035
- }
11036
- } else {
11037
- if (value === false && compatUtils.isCompatEnabled(
11038
- "ATTR_FALSE_VALUE",
11039
- parentComponent
11040
- )) {
11041
- const type = typeof el[key];
11042
- if (type === "string" || type === "number") {
11043
- compatUtils.warnDeprecation(
11044
- "ATTR_FALSE_VALUE",
11045
- parentComponent,
11046
- key
11047
- );
11048
- value = type === "number" ? 0 : "";
11049
- needRemove = true;
10942
+ const durations = normalizeDuration(duration);
10943
+ const enterDuration = durations && durations[0];
10944
+ const leaveDuration = durations && durations[1];
10945
+ const {
10946
+ onBeforeEnter,
10947
+ onEnter,
10948
+ onEnterCancelled,
10949
+ onLeave,
10950
+ onLeaveCancelled,
10951
+ onBeforeAppear = onBeforeEnter,
10952
+ onAppear = onEnter,
10953
+ onAppearCancelled = onEnterCancelled
10954
+ } = baseProps;
10955
+ const finishEnter = (el, isAppear, done) => {
10956
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10957
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10958
+ done && done();
10959
+ };
10960
+ const finishLeave = (el, done) => {
10961
+ el._isLeaving = false;
10962
+ removeTransitionClass(el, leaveFromClass);
10963
+ removeTransitionClass(el, leaveToClass);
10964
+ removeTransitionClass(el, leaveActiveClass);
10965
+ done && done();
10966
+ };
10967
+ const makeEnterHook = (isAppear) => {
10968
+ return (el, done) => {
10969
+ const hook = isAppear ? onAppear : onEnter;
10970
+ const resolve = () => finishEnter(el, isAppear, done);
10971
+ callHook(hook, [el, resolve]);
10972
+ nextFrame(() => {
10973
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
10974
+ if (legacyClassEnabled) {
10975
+ const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
10976
+ if (legacyClass) {
10977
+ removeTransitionClass(el, legacyClass);
10978
+ }
10979
+ }
10980
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
10981
+ if (!hasExplicitCallback(hook)) {
10982
+ whenTransitionEnds(el, type, enterDuration, resolve);
10983
+ }
10984
+ });
10985
+ };
10986
+ };
10987
+ return extend(baseProps, {
10988
+ onBeforeEnter(el) {
10989
+ callHook(onBeforeEnter, [el]);
10990
+ addTransitionClass(el, enterFromClass);
10991
+ if (legacyClassEnabled && legacyEnterFromClass) {
10992
+ addTransitionClass(el, legacyEnterFromClass);
11050
10993
  }
10994
+ addTransitionClass(el, enterActiveClass);
10995
+ },
10996
+ onBeforeAppear(el) {
10997
+ callHook(onBeforeAppear, [el]);
10998
+ addTransitionClass(el, appearFromClass);
10999
+ if (legacyClassEnabled && legacyAppearFromClass) {
11000
+ addTransitionClass(el, legacyAppearFromClass);
11001
+ }
11002
+ addTransitionClass(el, appearActiveClass);
11003
+ },
11004
+ onEnter: makeEnterHook(false),
11005
+ onAppear: makeEnterHook(true),
11006
+ onLeave(el, done) {
11007
+ el._isLeaving = true;
11008
+ const resolve = () => finishLeave(el, done);
11009
+ addTransitionClass(el, leaveFromClass);
11010
+ if (legacyClassEnabled && legacyLeaveFromClass) {
11011
+ addTransitionClass(el, legacyLeaveFromClass);
11012
+ }
11013
+ forceReflow();
11014
+ addTransitionClass(el, leaveActiveClass);
11015
+ nextFrame(() => {
11016
+ if (!el._isLeaving) {
11017
+ return;
11018
+ }
11019
+ removeTransitionClass(el, leaveFromClass);
11020
+ if (legacyClassEnabled && legacyLeaveFromClass) {
11021
+ removeTransitionClass(el, legacyLeaveFromClass);
11022
+ }
11023
+ addTransitionClass(el, leaveToClass);
11024
+ if (!hasExplicitCallback(onLeave)) {
11025
+ whenTransitionEnds(el, type, leaveDuration, resolve);
11026
+ }
11027
+ });
11028
+ callHook(onLeave, [el, resolve]);
11029
+ },
11030
+ onEnterCancelled(el) {
11031
+ finishEnter(el, false);
11032
+ callHook(onEnterCancelled, [el]);
11033
+ },
11034
+ onAppearCancelled(el) {
11035
+ finishEnter(el, true);
11036
+ callHook(onAppearCancelled, [el]);
11037
+ },
11038
+ onLeaveCancelled(el) {
11039
+ finishLeave(el);
11040
+ callHook(onLeaveCancelled, [el]);
11051
11041
  }
11042
+ });
11043
+ }
11044
+ function normalizeDuration(duration) {
11045
+ if (duration == null) {
11046
+ return null;
11047
+ } else if (isObject(duration)) {
11048
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
11049
+ } else {
11050
+ const n = NumberOf(duration);
11051
+ return [n, n];
11052
11052
  }
11053
- try {
11054
- el[key] = value;
11055
- } catch (e) {
11056
- if (!needRemove) {
11057
- warn(
11058
- `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11059
- e
11060
- );
11061
- }
11062
- }
11063
- needRemove && el.removeAttribute(key);
11064
11053
  }
11065
-
11066
- function addEventListener(el, event, handler, options) {
11067
- el.addEventListener(event, handler, options);
11054
+ function NumberOf(val) {
11055
+ const res = toNumber(val);
11056
+ {
11057
+ assertNumber(res, "<transition> explicit duration");
11058
+ }
11059
+ return res;
11068
11060
  }
11069
- function removeEventListener(el, event, handler, options) {
11070
- el.removeEventListener(event, handler, options);
11061
+ function addTransitionClass(el, cls) {
11062
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11063
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
11071
11064
  }
11072
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11073
- const invokers = el._vei || (el._vei = {});
11074
- const existingInvoker = invokers[rawName];
11075
- if (nextValue && existingInvoker) {
11076
- existingInvoker.value = nextValue;
11077
- } else {
11078
- const [name, options] = parseName(rawName);
11079
- if (nextValue) {
11080
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11081
- addEventListener(el, name, invoker, options);
11082
- } else if (existingInvoker) {
11083
- removeEventListener(el, name, existingInvoker, options);
11084
- invokers[rawName] = void 0;
11065
+ function removeTransitionClass(el, cls) {
11066
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11067
+ const _vtc = el[vtcKey];
11068
+ if (_vtc) {
11069
+ _vtc.delete(cls);
11070
+ if (!_vtc.size) {
11071
+ el[vtcKey] = void 0;
11085
11072
  }
11086
11073
  }
11087
11074
  }
11088
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11089
- function parseName(name) {
11090
- let options;
11091
- if (optionsModifierRE.test(name)) {
11092
- options = {};
11093
- let m;
11094
- while (m = name.match(optionsModifierRE)) {
11095
- name = name.slice(0, name.length - m[0].length);
11096
- options[m[0].toLowerCase()] = true;
11075
+ function nextFrame(cb) {
11076
+ requestAnimationFrame(() => {
11077
+ requestAnimationFrame(cb);
11078
+ });
11079
+ }
11080
+ let endId = 0;
11081
+ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11082
+ const id = el._endId = ++endId;
11083
+ const resolveIfNotStale = () => {
11084
+ if (id === el._endId) {
11085
+ resolve();
11097
11086
  }
11087
+ };
11088
+ if (explicitTimeout) {
11089
+ return setTimeout(resolveIfNotStale, explicitTimeout);
11098
11090
  }
11099
- const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11100
- return [event, options];
11101
- }
11102
- let cachedNow = 0;
11103
- const p = /* @__PURE__ */ Promise.resolve();
11104
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11105
- function createInvoker(initialValue, instance) {
11106
- const invoker = (e) => {
11107
- if (!e._vts) {
11108
- e._vts = Date.now();
11109
- } else if (e._vts <= invoker.attached) {
11110
- return;
11091
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11092
+ if (!type) {
11093
+ return resolve();
11094
+ }
11095
+ const endEvent = type + "end";
11096
+ let ended = 0;
11097
+ const end = () => {
11098
+ el.removeEventListener(endEvent, onEnd);
11099
+ resolveIfNotStale();
11100
+ };
11101
+ const onEnd = (e) => {
11102
+ if (e.target === el && ++ended >= propCount) {
11103
+ end();
11111
11104
  }
11112
- callWithAsyncErrorHandling(
11113
- patchStopImmediatePropagation(e, invoker.value),
11114
- instance,
11115
- 5,
11116
- [e]
11117
- );
11118
11105
  };
11119
- invoker.value = initialValue;
11120
- invoker.attached = getNow();
11121
- return invoker;
11106
+ setTimeout(() => {
11107
+ if (ended < propCount) {
11108
+ end();
11109
+ }
11110
+ }, timeout + 1);
11111
+ el.addEventListener(endEvent, onEnd);
11122
11112
  }
11123
- function patchStopImmediatePropagation(e, value) {
11124
- if (isArray(value)) {
11125
- const originalStop = e.stopImmediatePropagation;
11126
- e.stopImmediatePropagation = () => {
11127
- originalStop.call(e);
11128
- e._stopped = true;
11129
- };
11130
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11113
+ function getTransitionInfo(el, expectedType) {
11114
+ const styles = window.getComputedStyle(el);
11115
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
11116
+ const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
11117
+ const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
11118
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11119
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11120
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11121
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
11122
+ let type = null;
11123
+ let timeout = 0;
11124
+ let propCount = 0;
11125
+ if (expectedType === TRANSITION$1) {
11126
+ if (transitionTimeout > 0) {
11127
+ type = TRANSITION$1;
11128
+ timeout = transitionTimeout;
11129
+ propCount = transitionDurations.length;
11130
+ }
11131
+ } else if (expectedType === ANIMATION) {
11132
+ if (animationTimeout > 0) {
11133
+ type = ANIMATION;
11134
+ timeout = animationTimeout;
11135
+ propCount = animationDurations.length;
11136
+ }
11131
11137
  } else {
11132
- return value;
11138
+ timeout = Math.max(transitionTimeout, animationTimeout);
11139
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
11140
+ propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
11133
11141
  }
11142
+ const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
11143
+ getStyleProperties(`${TRANSITION$1}Property`).toString()
11144
+ );
11145
+ return {
11146
+ type,
11147
+ timeout,
11148
+ propCount,
11149
+ hasTransform
11150
+ };
11151
+ }
11152
+ function getTimeout(delays, durations) {
11153
+ while (delays.length < durations.length) {
11154
+ delays = delays.concat(delays);
11155
+ }
11156
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11157
+ }
11158
+ function toMs(s) {
11159
+ if (s === "auto")
11160
+ return 0;
11161
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11162
+ }
11163
+ function forceReflow() {
11164
+ return document.body.offsetHeight;
11134
11165
  }
11135
11166
 
11136
- const nativeOnRE = /^on[a-z]/;
11137
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11138
- if (key === "class") {
11139
- patchClass(el, nextValue, isSVG);
11140
- } else if (key === "style") {
11141
- patchStyle(el, prevValue, nextValue);
11142
- } else if (isOn(key)) {
11143
- if (!isModelListener(key)) {
11144
- patchEvent(el, key, prevValue, nextValue, parentComponent);
11145
- }
11146
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11147
- patchDOMProp(
11148
- el,
11149
- key,
11150
- nextValue,
11151
- prevChildren,
11152
- parentComponent,
11153
- parentSuspense,
11154
- unmountChildren
11155
- );
11167
+ function patchClass(el, value, isSVG) {
11168
+ const transitionClasses = el[vtcKey];
11169
+ if (transitionClasses) {
11170
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
11171
+ }
11172
+ if (value == null) {
11173
+ el.removeAttribute("class");
11174
+ } else if (isSVG) {
11175
+ el.setAttribute("class", value);
11156
11176
  } else {
11157
- if (key === "true-value") {
11158
- el._trueValue = nextValue;
11159
- } else if (key === "false-value") {
11160
- el._falseValue = nextValue;
11161
- }
11162
- patchAttr(el, key, nextValue, isSVG, parentComponent);
11177
+ el.className = value;
11163
11178
  }
11164
- };
11165
- function shouldSetAsProp(el, key, value, isSVG) {
11166
- if (isSVG) {
11167
- if (key === "innerHTML" || key === "textContent") {
11168
- return true;
11179
+ }
11180
+
11181
+ const vShowOldKey = Symbol("_vod");
11182
+ const vShow = {
11183
+ beforeMount(el, { value }, { transition }) {
11184
+ el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
11185
+ if (transition && value) {
11186
+ transition.beforeEnter(el);
11187
+ } else {
11188
+ setDisplay(el, value);
11169
11189
  }
11170
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11171
- return true;
11190
+ },
11191
+ mounted(el, { value }, { transition }) {
11192
+ if (transition && value) {
11193
+ transition.enter(el);
11172
11194
  }
11173
- return false;
11174
- }
11175
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11176
- return false;
11177
- }
11178
- if (key === "form") {
11179
- return false;
11180
- }
11181
- if (key === "list" && el.tagName === "INPUT") {
11182
- return false;
11183
- }
11184
- if (key === "type" && el.tagName === "TEXTAREA") {
11185
- return false;
11186
- }
11187
- if (nativeOnRE.test(key) && isString(value)) {
11188
- return false;
11195
+ },
11196
+ updated(el, { value, oldValue }, { transition }) {
11197
+ if (!value === !oldValue)
11198
+ return;
11199
+ if (transition) {
11200
+ if (value) {
11201
+ transition.beforeEnter(el);
11202
+ setDisplay(el, true);
11203
+ transition.enter(el);
11204
+ } else {
11205
+ transition.leave(el, () => {
11206
+ setDisplay(el, false);
11207
+ });
11208
+ }
11209
+ } else {
11210
+ setDisplay(el, value);
11211
+ }
11212
+ },
11213
+ beforeUnmount(el, { value }) {
11214
+ setDisplay(el, value);
11189
11215
  }
11190
- return key in el;
11216
+ };
11217
+ function setDisplay(el, value) {
11218
+ el.style.display = value ? el[vShowOldKey] : "none";
11191
11219
  }
11192
11220
 
11193
- function defineCustomElement(options, hydrate2) {
11194
- const Comp = defineComponent(options);
11195
- class VueCustomElement extends VueElement {
11196
- constructor(initialProps) {
11197
- super(Comp, initialProps, hydrate2);
11221
+ function patchStyle(el, prev, next) {
11222
+ const style = el.style;
11223
+ const isCssString = isString(next);
11224
+ if (next && !isCssString) {
11225
+ if (prev && !isString(prev)) {
11226
+ for (const key in prev) {
11227
+ if (next[key] == null) {
11228
+ setStyle(style, key, "");
11229
+ }
11230
+ }
11198
11231
  }
11199
- }
11200
- VueCustomElement.def = Comp;
11201
- return VueCustomElement;
11232
+ for (const key in next) {
11233
+ setStyle(style, key, next[key]);
11234
+ }
11235
+ } else {
11236
+ const currentDisplay = style.display;
11237
+ if (isCssString) {
11238
+ if (prev !== next) {
11239
+ style.cssText = next;
11240
+ }
11241
+ } else if (prev) {
11242
+ el.removeAttribute("style");
11243
+ }
11244
+ if (vShowOldKey in el) {
11245
+ style.display = currentDisplay;
11246
+ }
11247
+ }
11202
11248
  }
11203
- const defineSSRCustomElement = (options) => {
11204
- return defineCustomElement(options, hydrate);
11205
- };
11206
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11207
- };
11208
- class VueElement extends BaseClass {
11209
- constructor(_def, _props = {}, hydrate2) {
11210
- super();
11211
- this._def = _def;
11212
- this._props = _props;
11213
- /**
11214
- * @internal
11215
- */
11216
- this._instance = null;
11217
- this._connected = false;
11218
- this._resolved = false;
11219
- this._numberProps = null;
11220
- if (this.shadowRoot && hydrate2) {
11221
- hydrate2(this._createVNode(), this.shadowRoot);
11222
- } else {
11223
- if (this.shadowRoot) {
11249
+ const semicolonRE = /[^\\];\s*$/;
11250
+ const importantRE = /\s*!important$/;
11251
+ function setStyle(style, name, val) {
11252
+ if (isArray(val)) {
11253
+ val.forEach((v) => setStyle(style, name, v));
11254
+ } else {
11255
+ if (val == null)
11256
+ val = "";
11257
+ {
11258
+ if (semicolonRE.test(val)) {
11224
11259
  warn(
11225
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11260
+ `Unexpected semicolon at the end of '${name}' style value: '${val}'`
11226
11261
  );
11227
11262
  }
11228
- this.attachShadow({ mode: "open" });
11229
- if (!this._def.__asyncLoader) {
11230
- this._resolveProps(this._def);
11231
- }
11232
11263
  }
11233
- }
11234
- connectedCallback() {
11235
- this._connected = true;
11236
- if (!this._instance) {
11237
- if (this._resolved) {
11238
- this._update();
11264
+ if (name.startsWith("--")) {
11265
+ style.setProperty(name, val);
11266
+ } else {
11267
+ const prefixed = autoPrefix(style, name);
11268
+ if (importantRE.test(val)) {
11269
+ style.setProperty(
11270
+ hyphenate(prefixed),
11271
+ val.replace(importantRE, ""),
11272
+ "important"
11273
+ );
11239
11274
  } else {
11240
- this._resolveDef();
11275
+ style[prefixed] = val;
11241
11276
  }
11242
11277
  }
11243
11278
  }
11244
- disconnectedCallback() {
11245
- this._connected = false;
11246
- nextTick(() => {
11247
- if (!this._connected) {
11248
- render(null, this.shadowRoot);
11249
- this._instance = null;
11250
- }
11251
- });
11279
+ }
11280
+ const prefixes = ["Webkit", "Moz", "ms"];
11281
+ const prefixCache = {};
11282
+ function autoPrefix(style, rawName) {
11283
+ const cached = prefixCache[rawName];
11284
+ if (cached) {
11285
+ return cached;
11252
11286
  }
11253
- /**
11254
- * resolve inner component definition (handle possible async component)
11255
- */
11256
- _resolveDef() {
11257
- this._resolved = true;
11258
- for (let i = 0; i < this.attributes.length; i++) {
11259
- this._setAttr(this.attributes[i].name);
11287
+ let name = camelize(rawName);
11288
+ if (name !== "filter" && name in style) {
11289
+ return prefixCache[rawName] = name;
11290
+ }
11291
+ name = capitalize(name);
11292
+ for (let i = 0; i < prefixes.length; i++) {
11293
+ const prefixed = prefixes[i] + name;
11294
+ if (prefixed in style) {
11295
+ return prefixCache[rawName] = prefixed;
11260
11296
  }
11261
- new MutationObserver((mutations) => {
11262
- for (const m of mutations) {
11263
- this._setAttr(m.attributeName);
11264
- }
11265
- }).observe(this, { attributes: true });
11266
- const resolve = (def, isAsync = false) => {
11267
- const { props, styles } = def;
11268
- let numberProps;
11269
- if (props && !isArray(props)) {
11270
- for (const key in props) {
11271
- const opt = props[key];
11272
- if (opt === Number || opt && opt.type === Number) {
11273
- if (key in this._props) {
11274
- this._props[key] = toNumber(this._props[key]);
11275
- }
11276
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11277
- }
11278
- }
11279
- }
11280
- this._numberProps = numberProps;
11281
- if (isAsync) {
11282
- this._resolveProps(def);
11283
- }
11284
- this._applyStyles(styles);
11285
- this._update();
11286
- };
11287
- const asyncDef = this._def.__asyncLoader;
11288
- if (asyncDef) {
11289
- asyncDef().then((def) => resolve(def, true));
11297
+ }
11298
+ return rawName;
11299
+ }
11300
+
11301
+ const xlinkNS = "http://www.w3.org/1999/xlink";
11302
+ function patchAttr(el, key, value, isSVG, instance) {
11303
+ if (isSVG && key.startsWith("xlink:")) {
11304
+ if (value == null) {
11305
+ el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
11290
11306
  } else {
11291
- resolve(this._def);
11307
+ el.setAttributeNS(xlinkNS, key, value);
11292
11308
  }
11293
- }
11294
- _resolveProps(def) {
11295
- const { props } = def;
11296
- const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11297
- for (const key of Object.keys(this)) {
11298
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11299
- this._setProp(key, this[key], true, false);
11300
- }
11309
+ } else {
11310
+ if (compatCoerceAttr(el, key, value, instance)) {
11311
+ return;
11301
11312
  }
11302
- for (const key of declaredPropKeys.map(camelize)) {
11303
- Object.defineProperty(this, key, {
11304
- get() {
11305
- return this._getProp(key);
11306
- },
11307
- set(val) {
11308
- this._setProp(key, val);
11309
- }
11310
- });
11313
+ const isBoolean = isSpecialBooleanAttr(key);
11314
+ if (value == null || isBoolean && !includeBooleanAttr(value)) {
11315
+ el.removeAttribute(key);
11316
+ } else {
11317
+ el.setAttribute(key, isBoolean ? "" : value);
11311
11318
  }
11312
11319
  }
11313
- _setAttr(key) {
11314
- let value = this.getAttribute(key);
11315
- const camelKey = camelize(key);
11316
- if (this._numberProps && this._numberProps[camelKey]) {
11317
- value = toNumber(value);
11320
+ }
11321
+ const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
11322
+ function compatCoerceAttr(el, key, value, instance = null) {
11323
+ if (isEnumeratedAttr(key)) {
11324
+ const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
11325
+ if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
11326
+ "ATTR_ENUMERATED_COERCION",
11327
+ instance,
11328
+ key,
11329
+ value,
11330
+ v2CoercedValue
11331
+ )) {
11332
+ el.setAttribute(key, v2CoercedValue);
11333
+ return true;
11318
11334
  }
11319
- this._setProp(camelKey, value, false);
11320
- }
11321
- /**
11322
- * @internal
11323
- */
11324
- _getProp(key) {
11325
- return this._props[key];
11335
+ } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
11336
+ "ATTR_FALSE_VALUE",
11337
+ instance,
11338
+ key
11339
+ )) {
11340
+ el.removeAttribute(key);
11341
+ return true;
11326
11342
  }
11327
- /**
11328
- * @internal
11329
- */
11330
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11331
- if (val !== this._props[key]) {
11332
- this._props[key] = val;
11333
- if (shouldUpdate && this._instance) {
11334
- this._update();
11335
- }
11336
- if (shouldReflect) {
11337
- if (val === true) {
11338
- this.setAttribute(hyphenate(key), "");
11339
- } else if (typeof val === "string" || typeof val === "number") {
11340
- this.setAttribute(hyphenate(key), val + "");
11341
- } else if (!val) {
11342
- this.removeAttribute(hyphenate(key));
11343
- }
11344
- }
11343
+ return false;
11344
+ }
11345
+
11346
+ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
11347
+ if (key === "innerHTML" || key === "textContent") {
11348
+ if (prevChildren) {
11349
+ unmountChildren(prevChildren, parentComponent, parentSuspense);
11345
11350
  }
11351
+ el[key] = value == null ? "" : value;
11352
+ return;
11346
11353
  }
11347
- _update() {
11348
- render(this._createVNode(), this.shadowRoot);
11349
- }
11350
- _createVNode() {
11351
- const vnode = createVNode(this._def, extend({}, this._props));
11352
- if (!this._instance) {
11353
- vnode.ce = (instance) => {
11354
- this._instance = instance;
11355
- instance.isCE = true;
11356
- {
11357
- instance.ceReload = (newStyles) => {
11358
- if (this._styles) {
11359
- this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11360
- this._styles.length = 0;
11361
- }
11362
- this._applyStyles(newStyles);
11363
- this._instance = null;
11364
- this._update();
11365
- };
11366
- }
11367
- const dispatch = (event, args) => {
11368
- this.dispatchEvent(
11369
- new CustomEvent(event, {
11370
- detail: args
11371
- })
11372
- );
11373
- };
11374
- instance.emit = (event, ...args) => {
11375
- dispatch(event, args);
11376
- if (hyphenate(event) !== event) {
11377
- dispatch(hyphenate(event), args);
11378
- }
11379
- };
11380
- let parent = this;
11381
- while (parent = parent && (parent.parentNode || parent.host)) {
11382
- if (parent instanceof VueElement) {
11383
- instance.parent = parent._instance;
11384
- instance.provides = parent._instance.provides;
11385
- break;
11386
- }
11387
- }
11388
- };
11354
+ const tag = el.tagName;
11355
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11356
+ !tag.includes("-")) {
11357
+ el._value = value;
11358
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11359
+ const newValue = value == null ? "" : value;
11360
+ if (oldValue !== newValue) {
11361
+ el.value = newValue;
11389
11362
  }
11390
- return vnode;
11363
+ if (value == null) {
11364
+ el.removeAttribute(key);
11365
+ }
11366
+ return;
11391
11367
  }
11392
- _applyStyles(styles) {
11393
- if (styles) {
11394
- styles.forEach((css) => {
11395
- const s = document.createElement("style");
11396
- s.textContent = css;
11397
- this.shadowRoot.appendChild(s);
11398
- {
11399
- (this._styles || (this._styles = [])).push(s);
11400
- }
11401
- });
11368
+ let needRemove = false;
11369
+ if (value === "" || value == null) {
11370
+ const type = typeof el[key];
11371
+ if (type === "boolean") {
11372
+ value = includeBooleanAttr(value);
11373
+ } else if (value == null && type === "string") {
11374
+ value = "";
11375
+ needRemove = true;
11376
+ } else if (type === "number") {
11377
+ value = 0;
11378
+ needRemove = true;
11379
+ }
11380
+ } else {
11381
+ if (value === false && compatUtils.isCompatEnabled(
11382
+ "ATTR_FALSE_VALUE",
11383
+ parentComponent
11384
+ )) {
11385
+ const type = typeof el[key];
11386
+ if (type === "string" || type === "number") {
11387
+ compatUtils.warnDeprecation(
11388
+ "ATTR_FALSE_VALUE",
11389
+ parentComponent,
11390
+ key
11391
+ );
11392
+ value = type === "number" ? 0 : "";
11393
+ needRemove = true;
11394
+ }
11402
11395
  }
11403
11396
  }
11404
- }
11405
-
11406
- function useCssModule(name = "$style") {
11407
- {
11408
- {
11409
- warn(`useCssModule() is not supported in the global build.`);
11397
+ try {
11398
+ el[key] = value;
11399
+ } catch (e) {
11400
+ if (!needRemove) {
11401
+ warn(
11402
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11403
+ e
11404
+ );
11410
11405
  }
11411
- return EMPTY_OBJ;
11412
11406
  }
11407
+ needRemove && el.removeAttribute(key);
11413
11408
  }
11414
11409
 
11415
- function useCssVars(getter) {
11416
- const instance = getCurrentInstance();
11417
- if (!instance) {
11418
- warn(`useCssVars is called without current active component instance.`);
11419
- return;
11420
- }
11421
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11422
- Array.from(
11423
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11424
- ).forEach((node) => setVarsOnNode(node, vars));
11425
- };
11426
- const setVars = () => {
11427
- const vars = getter(instance.proxy);
11428
- setVarsOnVNode(instance.subTree, vars);
11429
- updateTeleports(vars);
11430
- };
11431
- watchPostEffect(setVars);
11432
- onMounted(() => {
11433
- const ob = new MutationObserver(setVars);
11434
- ob.observe(instance.subTree.el.parentNode, { childList: true });
11435
- onUnmounted(() => ob.disconnect());
11436
- });
11410
+ function addEventListener(el, event, handler, options) {
11411
+ el.addEventListener(event, handler, options);
11437
11412
  }
11438
- function setVarsOnVNode(vnode, vars) {
11439
- if (vnode.shapeFlag & 128) {
11440
- const suspense = vnode.suspense;
11441
- vnode = suspense.activeBranch;
11442
- if (suspense.pendingBranch && !suspense.isHydrating) {
11443
- suspense.effects.push(() => {
11444
- setVarsOnVNode(suspense.activeBranch, vars);
11445
- });
11413
+ function removeEventListener(el, event, handler, options) {
11414
+ el.removeEventListener(event, handler, options);
11415
+ }
11416
+ const veiKey = Symbol("_vei");
11417
+ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11418
+ const invokers = el[veiKey] || (el[veiKey] = {});
11419
+ const existingInvoker = invokers[rawName];
11420
+ if (nextValue && existingInvoker) {
11421
+ existingInvoker.value = nextValue;
11422
+ } else {
11423
+ const [name, options] = parseName(rawName);
11424
+ if (nextValue) {
11425
+ const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11426
+ addEventListener(el, name, invoker, options);
11427
+ } else if (existingInvoker) {
11428
+ removeEventListener(el, name, existingInvoker, options);
11429
+ invokers[rawName] = void 0;
11446
11430
  }
11447
11431
  }
11448
- while (vnode.component) {
11449
- vnode = vnode.component.subTree;
11450
- }
11451
- if (vnode.shapeFlag & 1 && vnode.el) {
11452
- setVarsOnNode(vnode.el, vars);
11453
- } else if (vnode.type === Fragment) {
11454
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11455
- } else if (vnode.type === Static) {
11456
- let { el, anchor } = vnode;
11457
- while (el) {
11458
- setVarsOnNode(el, vars);
11459
- if (el === anchor)
11460
- break;
11461
- el = el.nextSibling;
11432
+ }
11433
+ const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11434
+ function parseName(name) {
11435
+ let options;
11436
+ if (optionsModifierRE.test(name)) {
11437
+ options = {};
11438
+ let m;
11439
+ while (m = name.match(optionsModifierRE)) {
11440
+ name = name.slice(0, name.length - m[0].length);
11441
+ options[m[0].toLowerCase()] = true;
11462
11442
  }
11463
11443
  }
11444
+ const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11445
+ return [event, options];
11464
11446
  }
11465
- function setVarsOnNode(el, vars) {
11466
- if (el.nodeType === 1) {
11467
- const style = el.style;
11468
- for (const key in vars) {
11469
- style.setProperty(`--${key}`, vars[key]);
11447
+ let cachedNow = 0;
11448
+ const p = /* @__PURE__ */ Promise.resolve();
11449
+ const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11450
+ function createInvoker(initialValue, instance) {
11451
+ const invoker = (e) => {
11452
+ if (!e._vts) {
11453
+ e._vts = Date.now();
11454
+ } else if (e._vts <= invoker.attached) {
11455
+ return;
11470
11456
  }
11457
+ callWithAsyncErrorHandling(
11458
+ patchStopImmediatePropagation(e, invoker.value),
11459
+ instance,
11460
+ 5,
11461
+ [e]
11462
+ );
11463
+ };
11464
+ invoker.value = initialValue;
11465
+ invoker.attached = getNow();
11466
+ return invoker;
11467
+ }
11468
+ function patchStopImmediatePropagation(e, value) {
11469
+ if (isArray(value)) {
11470
+ const originalStop = e.stopImmediatePropagation;
11471
+ e.stopImmediatePropagation = () => {
11472
+ originalStop.call(e);
11473
+ e._stopped = true;
11474
+ };
11475
+ return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11476
+ } else {
11477
+ return value;
11471
11478
  }
11472
11479
  }
11473
11480
 
11474
- const TRANSITION$1 = "transition";
11475
- const ANIMATION = "animation";
11476
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
11477
- Transition.displayName = "Transition";
11478
- {
11479
- Transition.__isBuiltIn = true;
11480
- }
11481
- const DOMTransitionPropsValidators = {
11482
- name: String,
11483
- type: String,
11484
- css: {
11485
- type: Boolean,
11486
- default: true
11487
- },
11488
- duration: [String, Number, Object],
11489
- enterFromClass: String,
11490
- enterActiveClass: String,
11491
- enterToClass: String,
11492
- appearFromClass: String,
11493
- appearActiveClass: String,
11494
- appearToClass: String,
11495
- leaveFromClass: String,
11496
- leaveActiveClass: String,
11497
- leaveToClass: String
11481
+ const nativeOnRE = /^on[a-z]/;
11482
+ const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11483
+ if (key === "class") {
11484
+ patchClass(el, nextValue, isSVG);
11485
+ } else if (key === "style") {
11486
+ patchStyle(el, prevValue, nextValue);
11487
+ } else if (isOn(key)) {
11488
+ if (!isModelListener(key)) {
11489
+ patchEvent(el, key, prevValue, nextValue, parentComponent);
11490
+ }
11491
+ } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11492
+ patchDOMProp(
11493
+ el,
11494
+ key,
11495
+ nextValue,
11496
+ prevChildren,
11497
+ parentComponent,
11498
+ parentSuspense,
11499
+ unmountChildren
11500
+ );
11501
+ } else {
11502
+ if (key === "true-value") {
11503
+ el._trueValue = nextValue;
11504
+ } else if (key === "false-value") {
11505
+ el._falseValue = nextValue;
11506
+ }
11507
+ patchAttr(el, key, nextValue, isSVG, parentComponent);
11508
+ }
11498
11509
  };
11499
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
11500
- {},
11501
- BaseTransitionPropsValidators,
11502
- DOMTransitionPropsValidators
11503
- );
11504
- const callHook = (hook, args = []) => {
11505
- if (isArray(hook)) {
11506
- hook.forEach((h2) => h2(...args));
11507
- } else if (hook) {
11508
- hook(...args);
11510
+ function shouldSetAsProp(el, key, value, isSVG) {
11511
+ if (isSVG) {
11512
+ if (key === "innerHTML" || key === "textContent") {
11513
+ return true;
11514
+ }
11515
+ if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11516
+ return true;
11517
+ }
11518
+ return false;
11519
+ }
11520
+ if (key === "spellcheck" || key === "draggable" || key === "translate") {
11521
+ return false;
11522
+ }
11523
+ if (key === "form") {
11524
+ return false;
11525
+ }
11526
+ if (key === "list" && el.tagName === "INPUT") {
11527
+ return false;
11528
+ }
11529
+ if (key === "type" && el.tagName === "TEXTAREA") {
11530
+ return false;
11531
+ }
11532
+ if (nativeOnRE.test(key) && isString(value)) {
11533
+ return false;
11534
+ }
11535
+ return key in el;
11536
+ }
11537
+
11538
+ /*! #__NO_SIDE_EFFECTS__ */
11539
+ // @__NO_SIDE_EFFECTS__
11540
+ function defineCustomElement(options, hydrate2) {
11541
+ const Comp = defineComponent(options);
11542
+ class VueCustomElement extends VueElement {
11543
+ constructor(initialProps) {
11544
+ super(Comp, initialProps, hydrate2);
11545
+ }
11509
11546
  }
11547
+ VueCustomElement.def = Comp;
11548
+ return VueCustomElement;
11549
+ }
11550
+ /*! #__NO_SIDE_EFFECTS__ */
11551
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
11552
+ return /* @__PURE__ */ defineCustomElement(options, hydrate);
11510
11553
  };
11511
- const hasExplicitCallback = (hook) => {
11512
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
11554
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11513
11555
  };
11514
- function resolveTransitionProps(rawProps) {
11515
- const baseProps = {};
11516
- for (const key in rawProps) {
11517
- if (!(key in DOMTransitionPropsValidators)) {
11518
- baseProps[key] = rawProps[key];
11556
+ class VueElement extends BaseClass {
11557
+ constructor(_def, _props = {}, hydrate2) {
11558
+ super();
11559
+ this._def = _def;
11560
+ this._props = _props;
11561
+ /**
11562
+ * @internal
11563
+ */
11564
+ this._instance = null;
11565
+ this._connected = false;
11566
+ this._resolved = false;
11567
+ this._numberProps = null;
11568
+ this._ob = null;
11569
+ if (this.shadowRoot && hydrate2) {
11570
+ hydrate2(this._createVNode(), this.shadowRoot);
11571
+ } else {
11572
+ if (this.shadowRoot) {
11573
+ warn(
11574
+ `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11575
+ );
11576
+ }
11577
+ this.attachShadow({ mode: "open" });
11578
+ if (!this._def.__asyncLoader) {
11579
+ this._resolveProps(this._def);
11580
+ }
11519
11581
  }
11520
11582
  }
11521
- if (rawProps.css === false) {
11522
- return baseProps;
11523
- }
11524
- const {
11525
- name = "v",
11526
- type,
11527
- duration,
11528
- enterFromClass = `${name}-enter-from`,
11529
- enterActiveClass = `${name}-enter-active`,
11530
- enterToClass = `${name}-enter-to`,
11531
- appearFromClass = enterFromClass,
11532
- appearActiveClass = enterActiveClass,
11533
- appearToClass = enterToClass,
11534
- leaveFromClass = `${name}-leave-from`,
11535
- leaveActiveClass = `${name}-leave-active`,
11536
- leaveToClass = `${name}-leave-to`
11537
- } = rawProps;
11538
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
11539
- let legacyEnterFromClass;
11540
- let legacyAppearFromClass;
11541
- let legacyLeaveFromClass;
11542
- if (legacyClassEnabled) {
11543
- const toLegacyClass = (cls) => cls.replace(/-from$/, "");
11544
- if (!rawProps.enterFromClass) {
11545
- legacyEnterFromClass = toLegacyClass(enterFromClass);
11546
- }
11547
- if (!rawProps.appearFromClass) {
11548
- legacyAppearFromClass = toLegacyClass(appearFromClass);
11583
+ connectedCallback() {
11584
+ this._connected = true;
11585
+ if (!this._instance) {
11586
+ if (this._resolved) {
11587
+ this._update();
11588
+ } else {
11589
+ this._resolveDef();
11590
+ }
11549
11591
  }
11550
- if (!rawProps.leaveFromClass) {
11551
- legacyLeaveFromClass = toLegacyClass(leaveFromClass);
11592
+ }
11593
+ disconnectedCallback() {
11594
+ this._connected = false;
11595
+ if (this._ob) {
11596
+ this._ob.disconnect();
11597
+ this._ob = null;
11552
11598
  }
11599
+ nextTick(() => {
11600
+ if (!this._connected) {
11601
+ render(null, this.shadowRoot);
11602
+ this._instance = null;
11603
+ }
11604
+ });
11553
11605
  }
11554
- const durations = normalizeDuration(duration);
11555
- const enterDuration = durations && durations[0];
11556
- const leaveDuration = durations && durations[1];
11557
- const {
11558
- onBeforeEnter,
11559
- onEnter,
11560
- onEnterCancelled,
11561
- onLeave,
11562
- onLeaveCancelled,
11563
- onBeforeAppear = onBeforeEnter,
11564
- onAppear = onEnter,
11565
- onAppearCancelled = onEnterCancelled
11566
- } = baseProps;
11567
- const finishEnter = (el, isAppear, done) => {
11568
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11569
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11570
- done && done();
11571
- };
11572
- const finishLeave = (el, done) => {
11573
- el._isLeaving = false;
11574
- removeTransitionClass(el, leaveFromClass);
11575
- removeTransitionClass(el, leaveToClass);
11576
- removeTransitionClass(el, leaveActiveClass);
11577
- done && done();
11578
- };
11579
- const makeEnterHook = (isAppear) => {
11580
- return (el, done) => {
11581
- const hook = isAppear ? onAppear : onEnter;
11582
- const resolve = () => finishEnter(el, isAppear, done);
11583
- callHook(hook, [el, resolve]);
11584
- nextFrame(() => {
11585
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11586
- if (legacyClassEnabled) {
11587
- const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
11588
- if (legacyClass) {
11589
- removeTransitionClass(el, legacyClass);
11606
+ /**
11607
+ * resolve inner component definition (handle possible async component)
11608
+ */
11609
+ _resolveDef() {
11610
+ this._resolved = true;
11611
+ for (let i = 0; i < this.attributes.length; i++) {
11612
+ this._setAttr(this.attributes[i].name);
11613
+ }
11614
+ this._ob = new MutationObserver((mutations) => {
11615
+ for (const m of mutations) {
11616
+ this._setAttr(m.attributeName);
11617
+ }
11618
+ });
11619
+ this._ob.observe(this, { attributes: true });
11620
+ const resolve = (def, isAsync = false) => {
11621
+ const { props, styles } = def;
11622
+ let numberProps;
11623
+ if (props && !isArray(props)) {
11624
+ for (const key in props) {
11625
+ const opt = props[key];
11626
+ if (opt === Number || opt && opt.type === Number) {
11627
+ if (key in this._props) {
11628
+ this._props[key] = toNumber(this._props[key]);
11629
+ }
11630
+ (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11590
11631
  }
11591
11632
  }
11592
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11593
- if (!hasExplicitCallback(hook)) {
11594
- whenTransitionEnds(el, type, enterDuration, resolve);
11595
- }
11596
- });
11633
+ }
11634
+ this._numberProps = numberProps;
11635
+ if (isAsync) {
11636
+ this._resolveProps(def);
11637
+ }
11638
+ this._applyStyles(styles);
11639
+ this._update();
11597
11640
  };
11598
- };
11599
- return extend(baseProps, {
11600
- onBeforeEnter(el) {
11601
- callHook(onBeforeEnter, [el]);
11602
- addTransitionClass(el, enterFromClass);
11603
- if (legacyClassEnabled && legacyEnterFromClass) {
11604
- addTransitionClass(el, legacyEnterFromClass);
11641
+ const asyncDef = this._def.__asyncLoader;
11642
+ if (asyncDef) {
11643
+ asyncDef().then((def) => resolve(def, true));
11644
+ } else {
11645
+ resolve(this._def);
11646
+ }
11647
+ }
11648
+ _resolveProps(def) {
11649
+ const { props } = def;
11650
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11651
+ for (const key of Object.keys(this)) {
11652
+ if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11653
+ this._setProp(key, this[key], true, false);
11605
11654
  }
11606
- addTransitionClass(el, enterActiveClass);
11607
- },
11608
- onBeforeAppear(el) {
11609
- callHook(onBeforeAppear, [el]);
11610
- addTransitionClass(el, appearFromClass);
11611
- if (legacyClassEnabled && legacyAppearFromClass) {
11612
- addTransitionClass(el, legacyAppearFromClass);
11655
+ }
11656
+ for (const key of declaredPropKeys.map(camelize)) {
11657
+ Object.defineProperty(this, key, {
11658
+ get() {
11659
+ return this._getProp(key);
11660
+ },
11661
+ set(val) {
11662
+ this._setProp(key, val);
11663
+ }
11664
+ });
11665
+ }
11666
+ }
11667
+ _setAttr(key) {
11668
+ let value = this.getAttribute(key);
11669
+ const camelKey = camelize(key);
11670
+ if (this._numberProps && this._numberProps[camelKey]) {
11671
+ value = toNumber(value);
11672
+ }
11673
+ this._setProp(camelKey, value, false);
11674
+ }
11675
+ /**
11676
+ * @internal
11677
+ */
11678
+ _getProp(key) {
11679
+ return this._props[key];
11680
+ }
11681
+ /**
11682
+ * @internal
11683
+ */
11684
+ _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11685
+ if (val !== this._props[key]) {
11686
+ this._props[key] = val;
11687
+ if (shouldUpdate && this._instance) {
11688
+ this._update();
11613
11689
  }
11614
- addTransitionClass(el, appearActiveClass);
11615
- },
11616
- onEnter: makeEnterHook(false),
11617
- onAppear: makeEnterHook(true),
11618
- onLeave(el, done) {
11619
- el._isLeaving = true;
11620
- const resolve = () => finishLeave(el, done);
11621
- addTransitionClass(el, leaveFromClass);
11622
- if (legacyClassEnabled && legacyLeaveFromClass) {
11623
- addTransitionClass(el, legacyLeaveFromClass);
11690
+ if (shouldReflect) {
11691
+ if (val === true) {
11692
+ this.setAttribute(hyphenate(key), "");
11693
+ } else if (typeof val === "string" || typeof val === "number") {
11694
+ this.setAttribute(hyphenate(key), val + "");
11695
+ } else if (!val) {
11696
+ this.removeAttribute(hyphenate(key));
11697
+ }
11624
11698
  }
11625
- forceReflow();
11626
- addTransitionClass(el, leaveActiveClass);
11627
- nextFrame(() => {
11628
- if (!el._isLeaving) {
11629
- return;
11699
+ }
11700
+ }
11701
+ _update() {
11702
+ render(this._createVNode(), this.shadowRoot);
11703
+ }
11704
+ _createVNode() {
11705
+ const vnode = createVNode(this._def, extend({}, this._props));
11706
+ if (!this._instance) {
11707
+ vnode.ce = (instance) => {
11708
+ this._instance = instance;
11709
+ instance.isCE = true;
11710
+ {
11711
+ instance.ceReload = (newStyles) => {
11712
+ if (this._styles) {
11713
+ this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11714
+ this._styles.length = 0;
11715
+ }
11716
+ this._applyStyles(newStyles);
11717
+ this._instance = null;
11718
+ this._update();
11719
+ };
11630
11720
  }
11631
- removeTransitionClass(el, leaveFromClass);
11632
- if (legacyClassEnabled && legacyLeaveFromClass) {
11633
- removeTransitionClass(el, legacyLeaveFromClass);
11721
+ const dispatch = (event, args) => {
11722
+ this.dispatchEvent(
11723
+ new CustomEvent(event, {
11724
+ detail: args
11725
+ })
11726
+ );
11727
+ };
11728
+ instance.emit = (event, ...args) => {
11729
+ dispatch(event, args);
11730
+ if (hyphenate(event) !== event) {
11731
+ dispatch(hyphenate(event), args);
11732
+ }
11733
+ };
11734
+ let parent = this;
11735
+ while (parent = parent && (parent.parentNode || parent.host)) {
11736
+ if (parent instanceof VueElement) {
11737
+ instance.parent = parent._instance;
11738
+ instance.provides = parent._instance.provides;
11739
+ break;
11740
+ }
11634
11741
  }
11635
- addTransitionClass(el, leaveToClass);
11636
- if (!hasExplicitCallback(onLeave)) {
11637
- whenTransitionEnds(el, type, leaveDuration, resolve);
11742
+ };
11743
+ }
11744
+ return vnode;
11745
+ }
11746
+ _applyStyles(styles) {
11747
+ if (styles) {
11748
+ styles.forEach((css) => {
11749
+ const s = document.createElement("style");
11750
+ s.textContent = css;
11751
+ this.shadowRoot.appendChild(s);
11752
+ {
11753
+ (this._styles || (this._styles = [])).push(s);
11638
11754
  }
11639
11755
  });
11640
- callHook(onLeave, [el, resolve]);
11641
- },
11642
- onEnterCancelled(el) {
11643
- finishEnter(el, false);
11644
- callHook(onEnterCancelled, [el]);
11645
- },
11646
- onAppearCancelled(el) {
11647
- finishEnter(el, true);
11648
- callHook(onAppearCancelled, [el]);
11649
- },
11650
- onLeaveCancelled(el) {
11651
- finishLeave(el);
11652
- callHook(onLeaveCancelled, [el]);
11653
11756
  }
11654
- });
11655
- }
11656
- function normalizeDuration(duration) {
11657
- if (duration == null) {
11658
- return null;
11659
- } else if (isObject(duration)) {
11660
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
11661
- } else {
11662
- const n = NumberOf(duration);
11663
- return [n, n];
11664
11757
  }
11665
11758
  }
11666
- function NumberOf(val) {
11667
- const res = toNumber(val);
11759
+
11760
+ function useCssModule(name = "$style") {
11668
11761
  {
11669
- assertNumber(res, "<transition> explicit duration");
11670
- }
11671
- return res;
11672
- }
11673
- function addTransitionClass(el, cls) {
11674
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11675
- (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
11676
- }
11677
- function removeTransitionClass(el, cls) {
11678
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11679
- const { _vtc } = el;
11680
- if (_vtc) {
11681
- _vtc.delete(cls);
11682
- if (!_vtc.size) {
11683
- el._vtc = void 0;
11762
+ {
11763
+ warn(`useCssModule() is not supported in the global build.`);
11684
11764
  }
11765
+ return EMPTY_OBJ;
11685
11766
  }
11686
11767
  }
11687
- function nextFrame(cb) {
11688
- requestAnimationFrame(() => {
11689
- requestAnimationFrame(cb);
11690
- });
11691
- }
11692
- let endId = 0;
11693
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11694
- const id = el._endId = ++endId;
11695
- const resolveIfNotStale = () => {
11696
- if (id === el._endId) {
11697
- resolve();
11698
- }
11699
- };
11700
- if (explicitTimeout) {
11701
- return setTimeout(resolveIfNotStale, explicitTimeout);
11702
- }
11703
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11704
- if (!type) {
11705
- return resolve();
11768
+
11769
+ function useCssVars(getter) {
11770
+ const instance = getCurrentInstance();
11771
+ if (!instance) {
11772
+ warn(`useCssVars is called without current active component instance.`);
11773
+ return;
11706
11774
  }
11707
- const endEvent = type + "end";
11708
- let ended = 0;
11709
- const end = () => {
11710
- el.removeEventListener(endEvent, onEnd);
11711
- resolveIfNotStale();
11775
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11776
+ Array.from(
11777
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11778
+ ).forEach((node) => setVarsOnNode(node, vars));
11712
11779
  };
11713
- const onEnd = (e) => {
11714
- if (e.target === el && ++ended >= propCount) {
11715
- end();
11716
- }
11780
+ const setVars = () => {
11781
+ const vars = getter(instance.proxy);
11782
+ setVarsOnVNode(instance.subTree, vars);
11783
+ updateTeleports(vars);
11717
11784
  };
11718
- setTimeout(() => {
11719
- if (ended < propCount) {
11720
- end();
11721
- }
11722
- }, timeout + 1);
11723
- el.addEventListener(endEvent, onEnd);
11785
+ watchPostEffect(setVars);
11786
+ onMounted(() => {
11787
+ const ob = new MutationObserver(setVars);
11788
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
11789
+ onUnmounted(() => ob.disconnect());
11790
+ });
11724
11791
  }
11725
- function getTransitionInfo(el, expectedType) {
11726
- const styles = window.getComputedStyle(el);
11727
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
11728
- const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
11729
- const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
11730
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11731
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11732
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11733
- const animationTimeout = getTimeout(animationDelays, animationDurations);
11734
- let type = null;
11735
- let timeout = 0;
11736
- let propCount = 0;
11737
- if (expectedType === TRANSITION$1) {
11738
- if (transitionTimeout > 0) {
11739
- type = TRANSITION$1;
11740
- timeout = transitionTimeout;
11741
- propCount = transitionDurations.length;
11792
+ function setVarsOnVNode(vnode, vars) {
11793
+ if (vnode.shapeFlag & 128) {
11794
+ const suspense = vnode.suspense;
11795
+ vnode = suspense.activeBranch;
11796
+ if (suspense.pendingBranch && !suspense.isHydrating) {
11797
+ suspense.effects.push(() => {
11798
+ setVarsOnVNode(suspense.activeBranch, vars);
11799
+ });
11742
11800
  }
11743
- } else if (expectedType === ANIMATION) {
11744
- if (animationTimeout > 0) {
11745
- type = ANIMATION;
11746
- timeout = animationTimeout;
11747
- propCount = animationDurations.length;
11801
+ }
11802
+ while (vnode.component) {
11803
+ vnode = vnode.component.subTree;
11804
+ }
11805
+ if (vnode.shapeFlag & 1 && vnode.el) {
11806
+ setVarsOnNode(vnode.el, vars);
11807
+ } else if (vnode.type === Fragment) {
11808
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11809
+ } else if (vnode.type === Static) {
11810
+ let { el, anchor } = vnode;
11811
+ while (el) {
11812
+ setVarsOnNode(el, vars);
11813
+ if (el === anchor)
11814
+ break;
11815
+ el = el.nextSibling;
11748
11816
  }
11749
- } else {
11750
- timeout = Math.max(transitionTimeout, animationTimeout);
11751
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
11752
- propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
11753
11817
  }
11754
- const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
11755
- getStyleProperties(`${TRANSITION$1}Property`).toString()
11756
- );
11757
- return {
11758
- type,
11759
- timeout,
11760
- propCount,
11761
- hasTransform
11762
- };
11763
11818
  }
11764
- function getTimeout(delays, durations) {
11765
- while (delays.length < durations.length) {
11766
- delays = delays.concat(delays);
11819
+ function setVarsOnNode(el, vars) {
11820
+ if (el.nodeType === 1) {
11821
+ const style = el.style;
11822
+ for (const key in vars) {
11823
+ style.setProperty(`--${key}`, vars[key]);
11824
+ }
11767
11825
  }
11768
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11769
- }
11770
- function toMs(s) {
11771
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11772
- }
11773
- function forceReflow() {
11774
- return document.body.offsetHeight;
11775
11826
  }
11776
11827
 
11777
11828
  const positionMap = /* @__PURE__ */ new WeakMap();
11778
11829
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11830
+ const moveCbKey = Symbol("_moveCb");
11831
+ const enterCbKey = Symbol("_enterCb");
11779
11832
  const TransitionGroupImpl = {
11780
11833
  name: "TransitionGroup",
11781
11834
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
@@ -11808,13 +11861,13 @@ Component that was made reactive: `,
11808
11861
  const style = el.style;
11809
11862
  addTransitionClass(el, moveClass);
11810
11863
  style.transform = style.webkitTransform = style.transitionDuration = "";
11811
- const cb = el._moveCb = (e) => {
11864
+ const cb = el[moveCbKey] = (e) => {
11812
11865
  if (e && e.target !== el) {
11813
11866
  return;
11814
11867
  }
11815
11868
  if (!e || /transform$/.test(e.propertyName)) {
11816
11869
  el.removeEventListener("transitionend", cb);
11817
- el._moveCb = null;
11870
+ el[moveCbKey] = null;
11818
11871
  removeTransitionClass(el, moveClass);
11819
11872
  }
11820
11873
  };
@@ -11866,11 +11919,11 @@ Component that was made reactive: `,
11866
11919
  const TransitionGroup = TransitionGroupImpl;
11867
11920
  function callPendingCbs(c) {
11868
11921
  const el = c.el;
11869
- if (el._moveCb) {
11870
- el._moveCb();
11922
+ if (el[moveCbKey]) {
11923
+ el[moveCbKey]();
11871
11924
  }
11872
- if (el._enterCb) {
11873
- el._enterCb();
11925
+ if (el[enterCbKey]) {
11926
+ el[enterCbKey]();
11874
11927
  }
11875
11928
  }
11876
11929
  function recordPosition(c) {
@@ -11890,8 +11943,9 @@ Component that was made reactive: `,
11890
11943
  }
11891
11944
  function hasCSSTransform(el, root, moveClass) {
11892
11945
  const clone = el.cloneNode();
11893
- if (el._vtc) {
11894
- el._vtc.forEach((cls) => {
11946
+ const _vtc = el[vtcKey];
11947
+ if (_vtc) {
11948
+ _vtc.forEach((cls) => {
11895
11949
  cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
11896
11950
  });
11897
11951
  }
@@ -11918,9 +11972,10 @@ Component that was made reactive: `,
11918
11972
  target.dispatchEvent(new Event("input"));
11919
11973
  }
11920
11974
  }
11975
+ const assignKey = Symbol("_assign");
11921
11976
  const vModelText = {
11922
11977
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11923
- el._assign = getModelAssigner(vnode);
11978
+ el[assignKey] = getModelAssigner(vnode);
11924
11979
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11925
11980
  addEventListener(el, lazy ? "change" : "input", (e) => {
11926
11981
  if (e.target.composing)
@@ -11932,7 +11987,7 @@ Component that was made reactive: `,
11932
11987
  if (castToNumber) {
11933
11988
  domValue = looseToNumber(domValue);
11934
11989
  }
11935
- el._assign(domValue);
11990
+ el[assignKey](domValue);
11936
11991
  });
11937
11992
  if (trim) {
11938
11993
  addEventListener(el, "change", () => {
@@ -11950,7 +12005,7 @@ Component that was made reactive: `,
11950
12005
  el.value = value == null ? "" : value;
11951
12006
  },
11952
12007
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
11953
- el._assign = getModelAssigner(vnode);
12008
+ el[assignKey] = getModelAssigner(vnode);
11954
12009
  if (el.composing)
11955
12010
  return;
11956
12011
  if (document.activeElement === el && el.type !== "range") {
@@ -11974,12 +12029,12 @@ Component that was made reactive: `,
11974
12029
  // #4096 array checkboxes need to be deep traversed
11975
12030
  deep: true,
11976
12031
  created(el, _, vnode) {
11977
- el._assign = getModelAssigner(vnode);
12032
+ el[assignKey] = getModelAssigner(vnode);
11978
12033
  addEventListener(el, "change", () => {
11979
12034
  const modelValue = el._modelValue;
11980
12035
  const elementValue = getValue(el);
11981
12036
  const checked = el.checked;
11982
- const assign = el._assign;
12037
+ const assign = el[assignKey];
11983
12038
  if (isArray(modelValue)) {
11984
12039
  const index = looseIndexOf(modelValue, elementValue);
11985
12040
  const found = index !== -1;
@@ -12006,7 +12061,7 @@ Component that was made reactive: `,
12006
12061
  // set initial checked on mount to wait for true-value/false-value
12007
12062
  mounted: setChecked,
12008
12063
  beforeUpdate(el, binding, vnode) {
12009
- el._assign = getModelAssigner(vnode);
12064
+ el[assignKey] = getModelAssigner(vnode);
12010
12065
  setChecked(el, binding, vnode);
12011
12066
  }
12012
12067
  };
@@ -12023,13 +12078,13 @@ Component that was made reactive: `,
12023
12078
  const vModelRadio = {
12024
12079
  created(el, { value }, vnode) {
12025
12080
  el.checked = looseEqual(value, vnode.props.value);
12026
- el._assign = getModelAssigner(vnode);
12081
+ el[assignKey] = getModelAssigner(vnode);
12027
12082
  addEventListener(el, "change", () => {
12028
- el._assign(getValue(el));
12083
+ el[assignKey](getValue(el));
12029
12084
  });
12030
12085
  },
12031
12086
  beforeUpdate(el, { value, oldValue }, vnode) {
12032
- el._assign = getModelAssigner(vnode);
12087
+ el[assignKey] = getModelAssigner(vnode);
12033
12088
  if (value !== oldValue) {
12034
12089
  el.checked = looseEqual(value, vnode.props.value);
12035
12090
  }
@@ -12044,11 +12099,11 @@ Component that was made reactive: `,
12044
12099
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
12045
12100
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
12046
12101
  );
12047
- el._assign(
12102
+ el[assignKey](
12048
12103
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12049
12104
  );
12050
12105
  });
12051
- el._assign = getModelAssigner(vnode);
12106
+ el[assignKey] = getModelAssigner(vnode);
12052
12107
  },
12053
12108
  // set value in mounted & updated because <select> relies on its children
12054
12109
  // <option>s.
@@ -12056,7 +12111,7 @@ Component that was made reactive: `,
12056
12111
  setSelected(el, value);
12057
12112
  },
12058
12113
  beforeUpdate(el, _binding, vnode) {
12059
- el._assign = getModelAssigner(vnode);
12114
+ el[assignKey] = getModelAssigner(vnode);
12060
12115
  },
12061
12116
  updated(el, { value }) {
12062
12117
  setSelected(el, value);
@@ -12219,45 +12274,6 @@ Component that was made reactive: `,
12219
12274
  };
12220
12275
  };
12221
12276
 
12222
- const vShow = {
12223
- beforeMount(el, { value }, { transition }) {
12224
- el._vod = el.style.display === "none" ? "" : el.style.display;
12225
- if (transition && value) {
12226
- transition.beforeEnter(el);
12227
- } else {
12228
- setDisplay(el, value);
12229
- }
12230
- },
12231
- mounted(el, { value }, { transition }) {
12232
- if (transition && value) {
12233
- transition.enter(el);
12234
- }
12235
- },
12236
- updated(el, { value, oldValue }, { transition }) {
12237
- if (!value === !oldValue)
12238
- return;
12239
- if (transition) {
12240
- if (value) {
12241
- transition.beforeEnter(el);
12242
- setDisplay(el, true);
12243
- transition.enter(el);
12244
- } else {
12245
- transition.leave(el, () => {
12246
- setDisplay(el, false);
12247
- });
12248
- }
12249
- } else {
12250
- setDisplay(el, value);
12251
- }
12252
- },
12253
- beforeUnmount(el, { value }) {
12254
- setDisplay(el, value);
12255
- }
12256
- };
12257
- function setDisplay(el, value) {
12258
- el.style.display = value ? el._vod : "none";
12259
- }
12260
-
12261
12277
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
12262
12278
  let renderer;
12263
12279
  let enabledHydration = false;
@@ -13296,7 +13312,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13296
13312
  continue;
13297
13313
  } else if (/[a-z]/i.test(s[2])) {
13298
13314
  emitError(context, 23);
13299
- parseTag(context, TagType.End, parent);
13315
+ parseTag(context, 1 /* End */, parent);
13300
13316
  continue;
13301
13317
  } else {
13302
13318
  emitError(
@@ -13457,7 +13473,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13457
13473
  const wasInPre = context.inPre;
13458
13474
  const wasInVPre = context.inVPre;
13459
13475
  const parent = last(ancestors);
13460
- const element = parseTag(context, TagType.Start, parent);
13476
+ const element = parseTag(context, 0 /* Start */, parent);
13461
13477
  const isPreBoundary = context.inPre && !wasInPre;
13462
13478
  const isVPreBoundary = context.inVPre && !wasInVPre;
13463
13479
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
@@ -13492,7 +13508,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13492
13508
  }
13493
13509
  element.children = children;
13494
13510
  if (startsWithEndTagOpen(context.source, element.tag)) {
13495
- parseTag(context, TagType.End, parent);
13511
+ parseTag(context, 1 /* End */, parent);
13496
13512
  } else {
13497
13513
  emitError(context, 24, 0, element.loc.start);
13498
13514
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
@@ -13511,11 +13527,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13511
13527
  }
13512
13528
  return element;
13513
13529
  }
13514
- var TagType = /* @__PURE__ */ ((TagType2) => {
13515
- TagType2[TagType2["Start"] = 0] = "Start";
13516
- TagType2[TagType2["End"] = 1] = "End";
13517
- return TagType2;
13518
- })(TagType || {});
13519
13530
  const isSpecialTemplateDirective = /* @__PURE__ */ makeMap(
13520
13531
  `if,else,else-if,for,slot`
13521
13532
  );