@vue/compat 3.4.0-alpha.3 → 3.4.0-beta.1

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.
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -117,7 +117,7 @@ const slotFlagsText = {
117
117
  [3]: "FORWARDED"
118
118
  };
119
119
 
120
- 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";
120
+ 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,Error";
121
121
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
122
122
 
123
123
  const range = 2;
@@ -190,6 +190,20 @@ function parseStringStyle(cssText) {
190
190
  });
191
191
  return ret;
192
192
  }
193
+ function stringifyStyle(styles) {
194
+ let ret = "";
195
+ if (!styles || isString(styles)) {
196
+ return ret;
197
+ }
198
+ for (const key in styles) {
199
+ const value = styles[key];
200
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
201
+ if (isString(value) || typeof value === "number") {
202
+ ret += `${normalizedKey}:${value};`;
203
+ }
204
+ }
205
+ return ret;
206
+ }
193
207
  function normalizeClass(value) {
194
208
  let res = "";
195
209
  if (isString(value)) {
@@ -225,16 +239,27 @@ function normalizeProps(props) {
225
239
 
226
240
  const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
227
241
  const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
242
+ const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
228
243
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
229
244
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
230
245
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
246
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
231
247
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
232
248
 
233
249
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
234
250
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
251
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
252
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
253
+ );
235
254
  function includeBooleanAttr(value) {
236
255
  return !!value || value === "";
237
256
  }
257
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
258
+ `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
259
+ );
260
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
261
+ `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
262
+ );
238
263
 
239
264
  function looseCompareArrays(a, b) {
240
265
  if (a.length !== b.length)
@@ -296,20 +321,29 @@ const replacer = (_key, val) => {
296
321
  return replacer(_key, val.value);
297
322
  } else if (isMap(val)) {
298
323
  return {
299
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
300
- entries[`${key} =>`] = val2;
301
- return entries;
302
- }, {})
324
+ [`Map(${val.size})`]: [...val.entries()].reduce(
325
+ (entries, [key, val2], i) => {
326
+ entries[stringifySymbol(key, i) + " =>"] = val2;
327
+ return entries;
328
+ },
329
+ {}
330
+ )
303
331
  };
304
332
  } else if (isSet(val)) {
305
333
  return {
306
- [`Set(${val.size})`]: [...val.values()]
334
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
307
335
  };
336
+ } else if (isSymbol(val)) {
337
+ return stringifySymbol(val);
308
338
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
309
339
  return String(val);
310
340
  }
311
341
  return val;
312
342
  };
343
+ const stringifySymbol = (v, i = "") => {
344
+ var _a;
345
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
346
+ };
313
347
 
314
348
  function warn$1(msg, ...args) {
315
349
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -758,8 +792,13 @@ class BaseReactiveHandler {
758
792
  return isReadonly2;
759
793
  } else if (key === "__v_isShallow") {
760
794
  return shallow;
761
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
762
- return target;
795
+ } else if (key === "__v_raw") {
796
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
797
+ // this means the reciever is a user proxy of the reactive proxy
798
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
799
+ return target;
800
+ }
801
+ return;
763
802
  }
764
803
  const targetIsArray = isArray(target);
765
804
  if (!isReadonly2) {
@@ -795,17 +834,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
795
834
  }
796
835
  set(target, key, value, receiver) {
797
836
  let oldValue = target[key];
798
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
799
- return false;
800
- }
801
837
  if (!this._shallow) {
838
+ const isOldValueReadonly = isReadonly(oldValue);
802
839
  if (!isShallow(value) && !isReadonly(value)) {
803
840
  oldValue = toRaw(oldValue);
804
841
  value = toRaw(value);
805
842
  }
806
843
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
807
- oldValue.value = value;
808
- return true;
844
+ if (isOldValueReadonly) {
845
+ return false;
846
+ } else {
847
+ oldValue.value = value;
848
+ return true;
849
+ }
809
850
  }
810
851
  }
811
852
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -1498,6 +1539,18 @@ function propertyToRef(source, key, defaultValue) {
1498
1539
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1499
1540
  }
1500
1541
 
1542
+ const TrackOpTypes = {
1543
+ "GET": "get",
1544
+ "HAS": "has",
1545
+ "ITERATE": "iterate"
1546
+ };
1547
+ const TriggerOpTypes = {
1548
+ "SET": "set",
1549
+ "ADD": "add",
1550
+ "DELETE": "delete",
1551
+ "CLEAR": "clear"
1552
+ };
1553
+
1501
1554
  const stack$1 = [];
1502
1555
  function pushWarningContext(vnode) {
1503
1556
  stack$1.push(vnode);
@@ -1612,6 +1665,38 @@ function assertNumber(val, type) {
1612
1665
  }
1613
1666
  }
1614
1667
 
1668
+ const ErrorCodes = {
1669
+ "SETUP_FUNCTION": 0,
1670
+ "0": "SETUP_FUNCTION",
1671
+ "RENDER_FUNCTION": 1,
1672
+ "1": "RENDER_FUNCTION",
1673
+ "WATCH_GETTER": 2,
1674
+ "2": "WATCH_GETTER",
1675
+ "WATCH_CALLBACK": 3,
1676
+ "3": "WATCH_CALLBACK",
1677
+ "WATCH_CLEANUP": 4,
1678
+ "4": "WATCH_CLEANUP",
1679
+ "NATIVE_EVENT_HANDLER": 5,
1680
+ "5": "NATIVE_EVENT_HANDLER",
1681
+ "COMPONENT_EVENT_HANDLER": 6,
1682
+ "6": "COMPONENT_EVENT_HANDLER",
1683
+ "VNODE_HOOK": 7,
1684
+ "7": "VNODE_HOOK",
1685
+ "DIRECTIVE_HOOK": 8,
1686
+ "8": "DIRECTIVE_HOOK",
1687
+ "TRANSITION_HOOK": 9,
1688
+ "9": "TRANSITION_HOOK",
1689
+ "APP_ERROR_HANDLER": 10,
1690
+ "10": "APP_ERROR_HANDLER",
1691
+ "APP_WARN_HANDLER": 11,
1692
+ "11": "APP_WARN_HANDLER",
1693
+ "FUNCTION_REF": 12,
1694
+ "12": "FUNCTION_REF",
1695
+ "ASYNC_COMPONENT_LOADER": 13,
1696
+ "13": "ASYNC_COMPONENT_LOADER",
1697
+ "SCHEDULER": 14,
1698
+ "14": "SCHEDULER"
1699
+ };
1615
1700
  const ErrorTypeStrings$1 = {
1616
1701
  ["sp"]: "serverPrefetch hook",
1617
1702
  ["bc"]: "beforeCreate hook",
@@ -1783,13 +1868,16 @@ function queuePostFlushCb(cb) {
1783
1868
  }
1784
1869
  queueFlush();
1785
1870
  }
1786
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1871
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1787
1872
  {
1788
1873
  seen = seen || /* @__PURE__ */ new Map();
1789
1874
  }
1790
1875
  for (; i < queue.length; i++) {
1791
1876
  const cb = queue[i];
1792
1877
  if (cb && cb.pre) {
1878
+ if (instance && cb.id !== instance.uid) {
1879
+ continue;
1880
+ }
1793
1881
  if (checkRecursiveUpdates(seen, cb)) {
1794
1882
  continue;
1795
1883
  }
@@ -2094,6 +2182,50 @@ function devtoolsComponentEmit(component, event, params) {
2094
2182
  );
2095
2183
  }
2096
2184
 
2185
+ const DeprecationTypes$1 = {
2186
+ "GLOBAL_MOUNT": "GLOBAL_MOUNT",
2187
+ "GLOBAL_MOUNT_CONTAINER": "GLOBAL_MOUNT_CONTAINER",
2188
+ "GLOBAL_EXTEND": "GLOBAL_EXTEND",
2189
+ "GLOBAL_PROTOTYPE": "GLOBAL_PROTOTYPE",
2190
+ "GLOBAL_SET": "GLOBAL_SET",
2191
+ "GLOBAL_DELETE": "GLOBAL_DELETE",
2192
+ "GLOBAL_OBSERVABLE": "GLOBAL_OBSERVABLE",
2193
+ "GLOBAL_PRIVATE_UTIL": "GLOBAL_PRIVATE_UTIL",
2194
+ "CONFIG_SILENT": "CONFIG_SILENT",
2195
+ "CONFIG_DEVTOOLS": "CONFIG_DEVTOOLS",
2196
+ "CONFIG_KEY_CODES": "CONFIG_KEY_CODES",
2197
+ "CONFIG_PRODUCTION_TIP": "CONFIG_PRODUCTION_TIP",
2198
+ "CONFIG_IGNORED_ELEMENTS": "CONFIG_IGNORED_ELEMENTS",
2199
+ "CONFIG_WHITESPACE": "CONFIG_WHITESPACE",
2200
+ "CONFIG_OPTION_MERGE_STRATS": "CONFIG_OPTION_MERGE_STRATS",
2201
+ "INSTANCE_SET": "INSTANCE_SET",
2202
+ "INSTANCE_DELETE": "INSTANCE_DELETE",
2203
+ "INSTANCE_DESTROY": "INSTANCE_DESTROY",
2204
+ "INSTANCE_EVENT_EMITTER": "INSTANCE_EVENT_EMITTER",
2205
+ "INSTANCE_EVENT_HOOKS": "INSTANCE_EVENT_HOOKS",
2206
+ "INSTANCE_CHILDREN": "INSTANCE_CHILDREN",
2207
+ "INSTANCE_LISTENERS": "INSTANCE_LISTENERS",
2208
+ "INSTANCE_SCOPED_SLOTS": "INSTANCE_SCOPED_SLOTS",
2209
+ "INSTANCE_ATTRS_CLASS_STYLE": "INSTANCE_ATTRS_CLASS_STYLE",
2210
+ "OPTIONS_DATA_FN": "OPTIONS_DATA_FN",
2211
+ "OPTIONS_DATA_MERGE": "OPTIONS_DATA_MERGE",
2212
+ "OPTIONS_BEFORE_DESTROY": "OPTIONS_BEFORE_DESTROY",
2213
+ "OPTIONS_DESTROYED": "OPTIONS_DESTROYED",
2214
+ "WATCH_ARRAY": "WATCH_ARRAY",
2215
+ "PROPS_DEFAULT_THIS": "PROPS_DEFAULT_THIS",
2216
+ "V_ON_KEYCODE_MODIFIER": "V_ON_KEYCODE_MODIFIER",
2217
+ "CUSTOM_DIR": "CUSTOM_DIR",
2218
+ "ATTR_FALSE_VALUE": "ATTR_FALSE_VALUE",
2219
+ "ATTR_ENUMERATED_COERCION": "ATTR_ENUMERATED_COERCION",
2220
+ "TRANSITION_CLASSES": "TRANSITION_CLASSES",
2221
+ "TRANSITION_GROUP_ROOT": "TRANSITION_GROUP_ROOT",
2222
+ "COMPONENT_ASYNC": "COMPONENT_ASYNC",
2223
+ "COMPONENT_FUNCTIONAL": "COMPONENT_FUNCTIONAL",
2224
+ "COMPONENT_V_MODEL": "COMPONENT_V_MODEL",
2225
+ "RENDER_FUNCTION": "RENDER_FUNCTION",
2226
+ "FILTERS": "FILTERS",
2227
+ "PRIVATE_APIS": "PRIVATE_APIS"
2228
+ };
2097
2229
  const deprecationData$1 = {
2098
2230
  ["GLOBAL_MOUNT"]: {
2099
2231
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" option have been removed. Use createApp(RootComponent).mount() instead.`,
@@ -3022,9 +3154,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3022
3154
  return false;
3023
3155
  }
3024
3156
  function updateHOCHostEl({ vnode, parent }, el) {
3025
- while (parent && parent.subTree === vnode) {
3026
- (vnode = parent.vnode).el = el;
3027
- parent = parent.parent;
3157
+ while (parent) {
3158
+ const root = parent.subTree;
3159
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3160
+ root.el = vnode.el;
3161
+ }
3162
+ if (root === vnode) {
3163
+ (vnode = parent.vnode).el = el;
3164
+ parent = parent.parent;
3165
+ } else {
3166
+ break;
3167
+ }
3028
3168
  }
3029
3169
  }
3030
3170
 
@@ -3088,6 +3228,7 @@ function resolve(registry, name) {
3088
3228
  }
3089
3229
 
3090
3230
  const isSuspense = (type) => type.__isSuspense;
3231
+ let suspenseId = 0;
3091
3232
  const SuspenseImpl = {
3092
3233
  name: "Suspense",
3093
3234
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -3095,7 +3236,7 @@ const SuspenseImpl = {
3095
3236
  // on a vnode's type and calls the `process` method, passing in renderer
3096
3237
  // internals.
3097
3238
  __isSuspense: true,
3098
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3239
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3099
3240
  if (n1 == null) {
3100
3241
  mountSuspense(
3101
3242
  n2,
@@ -3103,7 +3244,7 @@ const SuspenseImpl = {
3103
3244
  anchor,
3104
3245
  parentComponent,
3105
3246
  parentSuspense,
3106
- isSVG,
3247
+ namespace,
3107
3248
  slotScopeIds,
3108
3249
  optimized,
3109
3250
  rendererInternals
@@ -3115,7 +3256,7 @@ const SuspenseImpl = {
3115
3256
  container,
3116
3257
  anchor,
3117
3258
  parentComponent,
3118
- isSVG,
3259
+ namespace,
3119
3260
  slotScopeIds,
3120
3261
  optimized,
3121
3262
  rendererInternals
@@ -3133,7 +3274,7 @@ function triggerEvent(vnode, name) {
3133
3274
  eventListener();
3134
3275
  }
3135
3276
  }
3136
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3277
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3137
3278
  const {
3138
3279
  p: patch,
3139
3280
  o: { createElement }
@@ -3146,7 +3287,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3146
3287
  container,
3147
3288
  hiddenContainer,
3148
3289
  anchor,
3149
- isSVG,
3290
+ namespace,
3150
3291
  slotScopeIds,
3151
3292
  optimized,
3152
3293
  rendererInternals
@@ -3158,7 +3299,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3158
3299
  null,
3159
3300
  parentComponent,
3160
3301
  suspense,
3161
- isSVG,
3302
+ namespace,
3162
3303
  slotScopeIds
3163
3304
  );
3164
3305
  if (suspense.deps > 0) {
@@ -3172,7 +3313,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3172
3313
  parentComponent,
3173
3314
  null,
3174
3315
  // fallback tree will not have suspense context
3175
- isSVG,
3316
+ namespace,
3176
3317
  slotScopeIds
3177
3318
  );
3178
3319
  setActiveBranch(suspense, vnode.ssFallback);
@@ -3180,7 +3321,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3180
3321
  suspense.resolve(false, true);
3181
3322
  }
3182
3323
  }
3183
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3324
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3184
3325
  const suspense = n2.suspense = n1.suspense;
3185
3326
  suspense.vnode = n2;
3186
3327
  n2.el = n1.el;
@@ -3197,29 +3338,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3197
3338
  null,
3198
3339
  parentComponent,
3199
3340
  suspense,
3200
- isSVG,
3341
+ namespace,
3201
3342
  slotScopeIds,
3202
3343
  optimized
3203
3344
  );
3204
3345
  if (suspense.deps <= 0) {
3205
3346
  suspense.resolve();
3206
3347
  } else if (isInFallback) {
3207
- patch(
3208
- activeBranch,
3209
- newFallback,
3210
- container,
3211
- anchor,
3212
- parentComponent,
3213
- null,
3214
- // fallback tree will not have suspense context
3215
- isSVG,
3216
- slotScopeIds,
3217
- optimized
3218
- );
3219
- setActiveBranch(suspense, newFallback);
3348
+ if (!isHydrating) {
3349
+ patch(
3350
+ activeBranch,
3351
+ newFallback,
3352
+ container,
3353
+ anchor,
3354
+ parentComponent,
3355
+ null,
3356
+ // fallback tree will not have suspense context
3357
+ namespace,
3358
+ slotScopeIds,
3359
+ optimized
3360
+ );
3361
+ setActiveBranch(suspense, newFallback);
3362
+ }
3220
3363
  }
3221
3364
  } else {
3222
- suspense.pendingId++;
3365
+ suspense.pendingId = suspenseId++;
3223
3366
  if (isHydrating) {
3224
3367
  suspense.isHydrating = false;
3225
3368
  suspense.activeBranch = pendingBranch;
@@ -3237,7 +3380,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3237
3380
  null,
3238
3381
  parentComponent,
3239
3382
  suspense,
3240
- isSVG,
3383
+ namespace,
3241
3384
  slotScopeIds,
3242
3385
  optimized
3243
3386
  );
@@ -3252,7 +3395,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3252
3395
  parentComponent,
3253
3396
  null,
3254
3397
  // fallback tree will not have suspense context
3255
- isSVG,
3398
+ namespace,
3256
3399
  slotScopeIds,
3257
3400
  optimized
3258
3401
  );
@@ -3266,7 +3409,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3266
3409
  anchor,
3267
3410
  parentComponent,
3268
3411
  suspense,
3269
- isSVG,
3412
+ namespace,
3270
3413
  slotScopeIds,
3271
3414
  optimized
3272
3415
  );
@@ -3279,7 +3422,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3279
3422
  null,
3280
3423
  parentComponent,
3281
3424
  suspense,
3282
- isSVG,
3425
+ namespace,
3283
3426
  slotScopeIds,
3284
3427
  optimized
3285
3428
  );
@@ -3297,7 +3440,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3297
3440
  anchor,
3298
3441
  parentComponent,
3299
3442
  suspense,
3300
- isSVG,
3443
+ namespace,
3301
3444
  slotScopeIds,
3302
3445
  optimized
3303
3446
  );
@@ -3305,7 +3448,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3305
3448
  } else {
3306
3449
  triggerEvent(n2, "onPending");
3307
3450
  suspense.pendingBranch = newBranch;
3308
- suspense.pendingId++;
3451
+ if (newBranch.shapeFlag & 512) {
3452
+ suspense.pendingId = newBranch.component.suspenseId;
3453
+ } else {
3454
+ suspense.pendingId = suspenseId++;
3455
+ }
3309
3456
  patch(
3310
3457
  null,
3311
3458
  newBranch,
@@ -3313,7 +3460,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3313
3460
  null,
3314
3461
  parentComponent,
3315
3462
  suspense,
3316
- isSVG,
3463
+ namespace,
3317
3464
  slotScopeIds,
3318
3465
  optimized
3319
3466
  );
@@ -3335,7 +3482,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3335
3482
  }
3336
3483
  }
3337
3484
  let hasWarned = false;
3338
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3485
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3339
3486
  if (!hasWarned) {
3340
3487
  hasWarned = true;
3341
3488
  console[console.info ? "info" : "log"](
@@ -3365,7 +3512,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3365
3512
  vnode,
3366
3513
  parent: parentSuspense,
3367
3514
  parentComponent,
3368
- isSVG,
3515
+ namespace,
3369
3516
  container,
3370
3517
  hiddenContainer,
3371
3518
  anchor,
@@ -3374,7 +3521,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3374
3521
  timeout: typeof timeout === "number" ? timeout : -1,
3375
3522
  activeBranch: null,
3376
3523
  pendingBranch: null,
3377
- isInFallback: true,
3524
+ isInFallback: !isHydrating,
3378
3525
  isHydrating,
3379
3526
  isUnmounted: false,
3380
3527
  effects: [],
@@ -3408,7 +3555,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3408
3555
  if (delayEnter) {
3409
3556
  activeBranch.transition.afterLeave = () => {
3410
3557
  if (pendingId === suspense.pendingId) {
3411
- move(pendingBranch, container2, anchor2, 0);
3558
+ move(
3559
+ pendingBranch,
3560
+ container2,
3561
+ next(activeBranch),
3562
+ 0
3563
+ );
3412
3564
  queuePostFlushCb(effects);
3413
3565
  }
3414
3566
  };
@@ -3453,7 +3605,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3453
3605
  if (!suspense.pendingBranch) {
3454
3606
  return;
3455
3607
  }
3456
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3608
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3457
3609
  triggerEvent(vnode2, "onFallback");
3458
3610
  const anchor2 = next(activeBranch);
3459
3611
  const mountFallback = () => {
@@ -3468,7 +3620,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3468
3620
  parentComponent2,
3469
3621
  null,
3470
3622
  // fallback tree will not have suspense context
3471
- isSVG2,
3623
+ namespace2,
3472
3624
  slotScopeIds,
3473
3625
  optimized
3474
3626
  );
@@ -3531,7 +3683,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3531
3683
  // consider the comment placeholder case.
3532
3684
  hydratedEl ? null : next(instance.subTree),
3533
3685
  suspense,
3534
- isSVG,
3686
+ namespace,
3535
3687
  optimized
3536
3688
  );
3537
3689
  if (placeholder) {
@@ -3568,7 +3720,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3568
3720
  };
3569
3721
  return suspense;
3570
3722
  }
3571
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3723
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3572
3724
  const suspense = vnode.suspense = createSuspenseBoundary(
3573
3725
  vnode,
3574
3726
  parentSuspense,
@@ -3576,7 +3728,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3576
3728
  node.parentNode,
3577
3729
  document.createElement("div"),
3578
3730
  null,
3579
- isSVG,
3731
+ namespace,
3580
3732
  slotScopeIds,
3581
3733
  optimized,
3582
3734
  rendererInternals,
@@ -4518,7 +4670,7 @@ const KeepAliveImpl = {
4518
4670
  }
4519
4671
  } = sharedContext;
4520
4672
  const storageContainer = createElement("div");
4521
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4673
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4522
4674
  const instance2 = vnode.component;
4523
4675
  move(vnode, container, anchor, 0, parentSuspense);
4524
4676
  patch(
@@ -4528,7 +4680,7 @@ const KeepAliveImpl = {
4528
4680
  anchor,
4529
4681
  instance2,
4530
4682
  parentSuspense,
4531
- isSVG,
4683
+ namespace,
4532
4684
  vnode.slotScopeIds,
4533
4685
  optimized
4534
4686
  );
@@ -5716,7 +5868,7 @@ function useSlots() {
5716
5868
  function useAttrs() {
5717
5869
  return getContext().attrs;
5718
5870
  }
5719
- function useModel(props, name, options) {
5871
+ function useModel(props, name) {
5720
5872
  const i = getCurrentInstance();
5721
5873
  if (!i) {
5722
5874
  warn(`useModel() called without active instance.`);
@@ -5726,29 +5878,24 @@ function useModel(props, name, options) {
5726
5878
  warn(`useModel() called with prop "${name}" which is not declared.`);
5727
5879
  return ref();
5728
5880
  }
5729
- if (options && options.local) {
5730
- const proxy = ref(props[name]);
5731
- watch(
5732
- () => props[name],
5733
- (v) => proxy.value = v
5734
- );
5735
- watch(proxy, (value) => {
5736
- if (value !== props[name]) {
5737
- i.emit(`update:${name}`, value);
5738
- }
5739
- });
5740
- return proxy;
5741
- } else {
5742
- return {
5743
- __v_isRef: true,
5744
- get value() {
5745
- return props[name];
5746
- },
5747
- set value(value) {
5748
- i.emit(`update:${name}`, value);
5881
+ let localValue;
5882
+ watchSyncEffect(() => {
5883
+ localValue = props[name];
5884
+ });
5885
+ return customRef((track, trigger) => ({
5886
+ get() {
5887
+ track();
5888
+ return localValue;
5889
+ },
5890
+ set(value) {
5891
+ const rawProps = i.vnode.props;
5892
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5893
+ localValue = value;
5894
+ trigger();
5749
5895
  }
5750
- };
5751
- }
5896
+ i.emit(`update:${name}`, value);
5897
+ }
5898
+ }));
5752
5899
  }
5753
5900
  function getContext() {
5754
5901
  const i = getCurrentInstance();
@@ -6322,7 +6469,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6322
6469
  return vm;
6323
6470
  }
6324
6471
  }
6325
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.3"}`;
6472
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
6326
6473
  Vue.config = singletonApp.config;
6327
6474
  Vue.use = (p, ...options) => {
6328
6475
  if (p && isFunction(p.install)) {
@@ -6567,12 +6714,16 @@ function installCompatMount(app, context, render) {
6567
6714
  } else {
6568
6715
  container = selectorOrEl || document.createElement("div");
6569
6716
  }
6570
- const isSVG = container instanceof SVGElement;
6717
+ let namespace;
6718
+ if (container instanceof SVGElement)
6719
+ namespace = "svg";
6720
+ else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
6721
+ namespace = "mathml";
6571
6722
  {
6572
6723
  context.reload = () => {
6573
6724
  const cloned = cloneVNode(vnode);
6574
6725
  cloned.component = null;
6575
- render(cloned, container, isSVG);
6726
+ render(cloned, container, namespace);
6576
6727
  };
6577
6728
  }
6578
6729
  if (hasNoRender && instance.render === emptyRender) {
@@ -6595,7 +6746,7 @@ function installCompatMount(app, context, render) {
6595
6746
  );
6596
6747
  }
6597
6748
  container.innerHTML = "";
6598
- render(vnode, container, isSVG);
6749
+ render(vnode, container, namespace);
6599
6750
  if (container instanceof Element) {
6600
6751
  container.removeAttribute("v-cloak");
6601
6752
  container.setAttribute("data-v-app", "");
@@ -6723,18 +6874,6 @@ function createAppAPI(render, hydrate) {
6723
6874
  rootProps = null;
6724
6875
  }
6725
6876
  const context = createAppContext();
6726
- {
6727
- Object.defineProperty(context.config, "unwrapInjectedRef", {
6728
- get() {
6729
- return true;
6730
- },
6731
- set() {
6732
- warn(
6733
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6734
- );
6735
- }
6736
- });
6737
- }
6738
6877
  const installedPlugins = /* @__PURE__ */ new WeakSet();
6739
6878
  let isMounted = false;
6740
6879
  const app = context.app = {
@@ -6809,7 +6948,7 @@ function createAppAPI(render, hydrate) {
6809
6948
  context.directives[name] = directive;
6810
6949
  return app;
6811
6950
  },
6812
- mount(rootContainer, isHydrate, isSVG) {
6951
+ mount(rootContainer, isHydrate, namespace) {
6813
6952
  if (!isMounted) {
6814
6953
  if (rootContainer.__vue_app__) {
6815
6954
  warn(
@@ -6819,15 +6958,24 @@ function createAppAPI(render, hydrate) {
6819
6958
  }
6820
6959
  const vnode = createVNode(rootComponent, rootProps);
6821
6960
  vnode.appContext = context;
6961
+ if (namespace === true) {
6962
+ namespace = "svg";
6963
+ } else if (namespace === false) {
6964
+ namespace = void 0;
6965
+ }
6822
6966
  {
6823
6967
  context.reload = () => {
6824
- render(cloneVNode(vnode), rootContainer, isSVG);
6968
+ render(
6969
+ cloneVNode(vnode),
6970
+ rootContainer,
6971
+ namespace
6972
+ );
6825
6973
  };
6826
6974
  }
6827
6975
  if (isHydrate && hydrate) {
6828
6976
  hydrate(vnode, rootContainer);
6829
6977
  } else {
6830
- render(vnode, rootContainer, isSVG);
6978
+ render(vnode, rootContainer, namespace);
6831
6979
  }
6832
6980
  isMounted = true;
6833
6981
  app._container = rootContainer;
@@ -7292,11 +7440,12 @@ function validateProps(rawProps, props, instance) {
7292
7440
  key,
7293
7441
  resolvedValues[key],
7294
7442
  opt,
7443
+ shallowReadonly(resolvedValues) ,
7295
7444
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
7296
7445
  );
7297
7446
  }
7298
7447
  }
7299
- function validateProp(name, value, prop, isAbsent) {
7448
+ function validateProp(name, value, prop, props, isAbsent) {
7300
7449
  const { type, required, validator, skipCheck } = prop;
7301
7450
  if (required && isAbsent) {
7302
7451
  warn('Missing required prop: "' + name + '"');
@@ -7319,7 +7468,7 @@ function validateProp(name, value, prop, isAbsent) {
7319
7468
  return;
7320
7469
  }
7321
7470
  }
7322
- if (validator && !validator(value)) {
7471
+ if (validator && !validator(value, props)) {
7323
7472
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7324
7473
  }
7325
7474
  }
@@ -7577,7 +7726,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7577
7726
  }
7578
7727
 
7579
7728
  let hasMismatch = false;
7580
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
7729
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
7730
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
7731
+ const getContainerType = (container) => {
7732
+ if (isSVGContainer(container))
7733
+ return "svg";
7734
+ if (isMathMLContainer(container))
7735
+ return "mathml";
7736
+ return void 0;
7737
+ };
7581
7738
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7582
7739
  function createHydrationFunctions(rendererInternals) {
7583
7740
  const {
@@ -7656,11 +7813,13 @@ function createHydrationFunctions(rendererInternals) {
7656
7813
  if (node.data !== vnode.children) {
7657
7814
  hasMismatch = true;
7658
7815
  warn(
7659
- `Hydration text mismatch:
7660
- - Server rendered: ${JSON.stringify(
7816
+ `Hydration text mismatch in`,
7817
+ node.parentNode,
7818
+ `
7819
+ - rendered on server: ${JSON.stringify(
7661
7820
  node.data
7662
7821
  )}
7663
- - Client rendered: ${JSON.stringify(vnode.children)}`
7822
+ - expected on client: ${JSON.stringify(vnode.children)}`
7664
7823
  );
7665
7824
  node.data = vnode.children;
7666
7825
  }
@@ -7746,7 +7905,7 @@ function createHydrationFunctions(rendererInternals) {
7746
7905
  null,
7747
7906
  parentComponent,
7748
7907
  parentSuspense,
7749
- isSVGContainer(container),
7908
+ getContainerType(container),
7750
7909
  optimized
7751
7910
  );
7752
7911
  if (isAsyncWrapper(vnode)) {
@@ -7781,7 +7940,7 @@ function createHydrationFunctions(rendererInternals) {
7781
7940
  vnode,
7782
7941
  parentComponent,
7783
7942
  parentSuspense,
7784
- isSVGContainer(parentNode(node)),
7943
+ getContainerType(parentNode(node)),
7785
7944
  slotScopeIds,
7786
7945
  optimized,
7787
7946
  rendererInternals,
@@ -7804,38 +7963,6 @@ function createHydrationFunctions(rendererInternals) {
7804
7963
  if (dirs) {
7805
7964
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7806
7965
  }
7807
- if (props) {
7808
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7809
- for (const key in props) {
7810
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7811
- key[0] === ".") {
7812
- patchProp(
7813
- el,
7814
- key,
7815
- null,
7816
- props[key],
7817
- false,
7818
- void 0,
7819
- parentComponent
7820
- );
7821
- }
7822
- }
7823
- } else if (props.onClick) {
7824
- patchProp(
7825
- el,
7826
- "onClick",
7827
- null,
7828
- props.onClick,
7829
- false,
7830
- void 0,
7831
- parentComponent
7832
- );
7833
- }
7834
- }
7835
- let vnodeHooks;
7836
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
7837
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7838
- }
7839
7966
  let needCallTransitionHooks = false;
7840
7967
  if (isTemplateNode(el)) {
7841
7968
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -7846,16 +7973,6 @@ function createHydrationFunctions(rendererInternals) {
7846
7973
  replaceNode(content, el, parentComponent);
7847
7974
  vnode.el = el = content;
7848
7975
  }
7849
- if (dirs) {
7850
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7851
- }
7852
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7853
- queueEffectWithSuspense(() => {
7854
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7855
- needCallTransitionHooks && transition.enter(el);
7856
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7857
- }, parentSuspense);
7858
- }
7859
7976
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
7860
7977
  !(props && (props.innerHTML || props.textContent))) {
7861
7978
  let next = hydrateChildren(
@@ -7872,7 +7989,10 @@ function createHydrationFunctions(rendererInternals) {
7872
7989
  hasMismatch = true;
7873
7990
  if (!hasWarned) {
7874
7991
  warn(
7875
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
7992
+ `Hydration children mismatch on`,
7993
+ el,
7994
+ `
7995
+ Server rendered element contains more child nodes than client vdom.`
7876
7996
  );
7877
7997
  hasWarned = true;
7878
7998
  }
@@ -7884,13 +8004,50 @@ function createHydrationFunctions(rendererInternals) {
7884
8004
  if (el.textContent !== vnode.children) {
7885
8005
  hasMismatch = true;
7886
8006
  warn(
7887
- `Hydration text content mismatch in <${vnode.type}>:
7888
- - Server rendered: ${el.textContent}
7889
- - Client rendered: ${vnode.children}`
8007
+ `Hydration text content mismatch on`,
8008
+ el,
8009
+ `
8010
+ - rendered on server: ${el.textContent}
8011
+ - expected on client: ${vnode.children}`
7890
8012
  );
7891
8013
  el.textContent = vnode.children;
7892
8014
  }
7893
8015
  }
8016
+ if (props) {
8017
+ {
8018
+ for (const key in props) {
8019
+ if (propHasMismatch(el, key, props[key])) {
8020
+ hasMismatch = true;
8021
+ }
8022
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
8023
+ key[0] === ".") {
8024
+ patchProp(
8025
+ el,
8026
+ key,
8027
+ null,
8028
+ props[key],
8029
+ void 0,
8030
+ void 0,
8031
+ parentComponent
8032
+ );
8033
+ }
8034
+ }
8035
+ }
8036
+ }
8037
+ let vnodeHooks;
8038
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
8039
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8040
+ }
8041
+ if (dirs) {
8042
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8043
+ }
8044
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8045
+ queueEffectWithSuspense(() => {
8046
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8047
+ needCallTransitionHooks && transition.enter(el);
8048
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8049
+ }, parentSuspense);
8050
+ }
7894
8051
  }
7895
8052
  return el.nextSibling;
7896
8053
  };
@@ -7916,7 +8073,10 @@ function createHydrationFunctions(rendererInternals) {
7916
8073
  hasMismatch = true;
7917
8074
  if (!hasWarned) {
7918
8075
  warn(
7919
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
8076
+ `Hydration children mismatch on`,
8077
+ container,
8078
+ `
8079
+ Server rendered element contains fewer child nodes than client vdom.`
7920
8080
  );
7921
8081
  hasWarned = true;
7922
8082
  }
@@ -7927,7 +8087,7 @@ function createHydrationFunctions(rendererInternals) {
7927
8087
  null,
7928
8088
  parentComponent,
7929
8089
  parentSuspense,
7930
- isSVGContainer(container),
8090
+ getContainerType(container),
7931
8091
  slotScopeIds
7932
8092
  );
7933
8093
  }
@@ -7961,12 +8121,12 @@ function createHydrationFunctions(rendererInternals) {
7961
8121
  hasMismatch = true;
7962
8122
  warn(
7963
8123
  `Hydration node mismatch:
7964
- - Client vnode:`,
7965
- vnode.type,
7966
- `
7967
- - Server rendered DOM:`,
8124
+ - rendered on server:`,
7968
8125
  node,
7969
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
8126
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
8127
+ `
8128
+ - expected on client:`,
8129
+ vnode.type
7970
8130
  );
7971
8131
  vnode.el = null;
7972
8132
  if (isFragment) {
@@ -7990,7 +8150,7 @@ function createHydrationFunctions(rendererInternals) {
7990
8150
  next,
7991
8151
  parentComponent,
7992
8152
  parentSuspense,
7993
- isSVGContainer(container),
8153
+ getContainerType(container),
7994
8154
  slotScopeIds
7995
8155
  );
7996
8156
  return next;
@@ -8031,6 +8191,46 @@ function createHydrationFunctions(rendererInternals) {
8031
8191
  };
8032
8192
  return [hydrate, hydrateNode];
8033
8193
  }
8194
+ function propHasMismatch(el, key, clientValue) {
8195
+ let mismatchType;
8196
+ let mismatchKey;
8197
+ let actual;
8198
+ let expected;
8199
+ if (key === "class") {
8200
+ actual = el.className;
8201
+ expected = normalizeClass(clientValue);
8202
+ if (actual !== expected) {
8203
+ mismatchType = mismatchKey = `class`;
8204
+ }
8205
+ } else if (key === "style") {
8206
+ actual = el.getAttribute("style");
8207
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8208
+ if (actual !== expected) {
8209
+ mismatchType = mismatchKey = "style";
8210
+ }
8211
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
8212
+ actual = el.hasAttribute(key) && el.getAttribute(key);
8213
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
8214
+ if (actual !== expected) {
8215
+ mismatchType = `attribute`;
8216
+ mismatchKey = key;
8217
+ }
8218
+ }
8219
+ if (mismatchType) {
8220
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8221
+ warn(
8222
+ `Hydration ${mismatchType} mismatch on`,
8223
+ el,
8224
+ `
8225
+ - rendered on server: ${format(actual)}
8226
+ - expected on client: ${format(expected)}
8227
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8228
+ You should fix the source of the mismatch.`
8229
+ );
8230
+ return true;
8231
+ }
8232
+ return false;
8233
+ }
8034
8234
 
8035
8235
  let supported;
8036
8236
  let perf;
@@ -8099,7 +8299,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8099
8299
  setScopeId: hostSetScopeId = NOOP,
8100
8300
  insertStaticContent: hostInsertStaticContent
8101
8301
  } = options;
8102
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8302
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8103
8303
  if (n1 === n2) {
8104
8304
  return;
8105
8305
  }
@@ -8122,9 +8322,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8122
8322
  break;
8123
8323
  case Static:
8124
8324
  if (n1 == null) {
8125
- mountStaticNode(n2, container, anchor, isSVG);
8325
+ mountStaticNode(n2, container, anchor, namespace);
8126
8326
  } else {
8127
- patchStaticNode(n1, n2, container, isSVG);
8327
+ patchStaticNode(n1, n2, container, namespace);
8128
8328
  }
8129
8329
  break;
8130
8330
  case Fragment:
@@ -8135,7 +8335,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8135
8335
  anchor,
8136
8336
  parentComponent,
8137
8337
  parentSuspense,
8138
- isSVG,
8338
+ namespace,
8139
8339
  slotScopeIds,
8140
8340
  optimized
8141
8341
  );
@@ -8149,7 +8349,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8149
8349
  anchor,
8150
8350
  parentComponent,
8151
8351
  parentSuspense,
8152
- isSVG,
8352
+ namespace,
8153
8353
  slotScopeIds,
8154
8354
  optimized
8155
8355
  );
@@ -8161,7 +8361,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8161
8361
  anchor,
8162
8362
  parentComponent,
8163
8363
  parentSuspense,
8164
- isSVG,
8364
+ namespace,
8165
8365
  slotScopeIds,
8166
8366
  optimized
8167
8367
  );
@@ -8173,7 +8373,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8173
8373
  anchor,
8174
8374
  parentComponent,
8175
8375
  parentSuspense,
8176
- isSVG,
8376
+ namespace,
8177
8377
  slotScopeIds,
8178
8378
  optimized,
8179
8379
  internals
@@ -8186,7 +8386,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8186
8386
  anchor,
8187
8387
  parentComponent,
8188
8388
  parentSuspense,
8189
- isSVG,
8389
+ namespace,
8190
8390
  slotScopeIds,
8191
8391
  optimized,
8192
8392
  internals
@@ -8224,17 +8424,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8224
8424
  n2.el = n1.el;
8225
8425
  }
8226
8426
  };
8227
- const mountStaticNode = (n2, container, anchor, isSVG) => {
8427
+ const mountStaticNode = (n2, container, anchor, namespace) => {
8228
8428
  [n2.el, n2.anchor] = hostInsertStaticContent(
8229
8429
  n2.children,
8230
8430
  container,
8231
8431
  anchor,
8232
- isSVG,
8432
+ namespace,
8233
8433
  n2.el,
8234
8434
  n2.anchor
8235
8435
  );
8236
8436
  };
8237
- const patchStaticNode = (n1, n2, container, isSVG) => {
8437
+ const patchStaticNode = (n1, n2, container, namespace) => {
8238
8438
  if (n2.children !== n1.children) {
8239
8439
  const anchor = hostNextSibling(n1.anchor);
8240
8440
  removeStaticNode(n1);
@@ -8242,7 +8442,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8242
8442
  n2.children,
8243
8443
  container,
8244
8444
  anchor,
8245
- isSVG
8445
+ namespace
8246
8446
  );
8247
8447
  } else {
8248
8448
  n2.el = n1.el;
@@ -8267,8 +8467,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8267
8467
  }
8268
8468
  hostRemove(anchor);
8269
8469
  };
8270
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8271
- isSVG = isSVG || n2.type === "svg";
8470
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8471
+ if (n2.type === "svg") {
8472
+ namespace = "svg";
8473
+ } else if (n2.type === "math") {
8474
+ namespace = "mathml";
8475
+ }
8272
8476
  if (n1 == null) {
8273
8477
  mountElement(
8274
8478
  n2,
@@ -8276,7 +8480,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8276
8480
  anchor,
8277
8481
  parentComponent,
8278
8482
  parentSuspense,
8279
- isSVG,
8483
+ namespace,
8280
8484
  slotScopeIds,
8281
8485
  optimized
8282
8486
  );
@@ -8286,19 +8490,19 @@ function baseCreateRenderer(options, createHydrationFns) {
8286
8490
  n2,
8287
8491
  parentComponent,
8288
8492
  parentSuspense,
8289
- isSVG,
8493
+ namespace,
8290
8494
  slotScopeIds,
8291
8495
  optimized
8292
8496
  );
8293
8497
  }
8294
8498
  };
8295
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8499
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8296
8500
  let el;
8297
8501
  let vnodeHook;
8298
- const { type, props, shapeFlag, transition, dirs } = vnode;
8502
+ const { props, shapeFlag, transition, dirs } = vnode;
8299
8503
  el = vnode.el = hostCreateElement(
8300
8504
  vnode.type,
8301
- isSVG,
8505
+ namespace,
8302
8506
  props && props.is,
8303
8507
  props
8304
8508
  );
@@ -8311,7 +8515,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8311
8515
  null,
8312
8516
  parentComponent,
8313
8517
  parentSuspense,
8314
- isSVG && type !== "foreignObject",
8518
+ resolveChildrenNamespace(vnode, namespace),
8315
8519
  slotScopeIds,
8316
8520
  optimized
8317
8521
  );
@@ -8328,7 +8532,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8328
8532
  key,
8329
8533
  null,
8330
8534
  props[key],
8331
- isSVG,
8535
+ namespace,
8332
8536
  vnode.children,
8333
8537
  parentComponent,
8334
8538
  parentSuspense,
@@ -8337,7 +8541,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8337
8541
  }
8338
8542
  }
8339
8543
  if ("value" in props) {
8340
- hostPatchProp(el, "value", null, props.value);
8544
+ hostPatchProp(el, "value", null, props.value, namespace);
8341
8545
  }
8342
8546
  if (vnodeHook = props.onVnodeBeforeMount) {
8343
8547
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8395,7 +8599,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8395
8599
  }
8396
8600
  }
8397
8601
  };
8398
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
8602
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8399
8603
  for (let i = start; i < children.length; i++) {
8400
8604
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8401
8605
  patch(
@@ -8405,13 +8609,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8405
8609
  anchor,
8406
8610
  parentComponent,
8407
8611
  parentSuspense,
8408
- isSVG,
8612
+ namespace,
8409
8613
  slotScopeIds,
8410
8614
  optimized
8411
8615
  );
8412
8616
  }
8413
8617
  };
8414
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8618
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8415
8619
  const el = n2.el = n1.el;
8416
8620
  let { patchFlag, dynamicChildren, dirs } = n2;
8417
8621
  patchFlag |= n1.patchFlag & 16;
@@ -8431,7 +8635,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8431
8635
  optimized = false;
8432
8636
  dynamicChildren = null;
8433
8637
  }
8434
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
8435
8638
  if (dynamicChildren) {
8436
8639
  patchBlockChildren(
8437
8640
  n1.dynamicChildren,
@@ -8439,7 +8642,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8439
8642
  el,
8440
8643
  parentComponent,
8441
8644
  parentSuspense,
8442
- areChildrenSVG,
8645
+ resolveChildrenNamespace(n2, namespace),
8443
8646
  slotScopeIds
8444
8647
  );
8445
8648
  {
@@ -8453,7 +8656,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8453
8656
  null,
8454
8657
  parentComponent,
8455
8658
  parentSuspense,
8456
- areChildrenSVG,
8659
+ resolveChildrenNamespace(n2, namespace),
8457
8660
  slotScopeIds,
8458
8661
  false
8459
8662
  );
@@ -8467,16 +8670,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8467
8670
  newProps,
8468
8671
  parentComponent,
8469
8672
  parentSuspense,
8470
- isSVG
8673
+ namespace
8471
8674
  );
8472
8675
  } else {
8473
8676
  if (patchFlag & 2) {
8474
8677
  if (oldProps.class !== newProps.class) {
8475
- hostPatchProp(el, "class", null, newProps.class, isSVG);
8678
+ hostPatchProp(el, "class", null, newProps.class, namespace);
8476
8679
  }
8477
8680
  }
8478
8681
  if (patchFlag & 4) {
8479
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
8682
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8480
8683
  }
8481
8684
  if (patchFlag & 8) {
8482
8685
  const propsToUpdate = n2.dynamicProps;
@@ -8490,7 +8693,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8490
8693
  key,
8491
8694
  prev,
8492
8695
  next,
8493
- isSVG,
8696
+ namespace,
8494
8697
  n1.children,
8495
8698
  parentComponent,
8496
8699
  parentSuspense,
@@ -8513,7 +8716,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8513
8716
  newProps,
8514
8717
  parentComponent,
8515
8718
  parentSuspense,
8516
- isSVG
8719
+ namespace
8517
8720
  );
8518
8721
  }
8519
8722
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -8523,7 +8726,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8523
8726
  }, parentSuspense);
8524
8727
  }
8525
8728
  };
8526
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
8729
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8527
8730
  for (let i = 0; i < newChildren.length; i++) {
8528
8731
  const oldVNode = oldChildren[i];
8529
8732
  const newVNode = newChildren[i];
@@ -8548,13 +8751,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8548
8751
  null,
8549
8752
  parentComponent,
8550
8753
  parentSuspense,
8551
- isSVG,
8754
+ namespace,
8552
8755
  slotScopeIds,
8553
8756
  true
8554
8757
  );
8555
8758
  }
8556
8759
  };
8557
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
8760
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
8558
8761
  if (oldProps !== newProps) {
8559
8762
  if (oldProps !== EMPTY_OBJ) {
8560
8763
  for (const key in oldProps) {
@@ -8564,7 +8767,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8564
8767
  key,
8565
8768
  oldProps[key],
8566
8769
  null,
8567
- isSVG,
8770
+ namespace,
8568
8771
  vnode.children,
8569
8772
  parentComponent,
8570
8773
  parentSuspense,
@@ -8584,7 +8787,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8584
8787
  key,
8585
8788
  prev,
8586
8789
  next,
8587
- isSVG,
8790
+ namespace,
8588
8791
  vnode.children,
8589
8792
  parentComponent,
8590
8793
  parentSuspense,
@@ -8593,11 +8796,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8593
8796
  }
8594
8797
  }
8595
8798
  if ("value" in newProps) {
8596
- hostPatchProp(el, "value", oldProps.value, newProps.value);
8799
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
8597
8800
  }
8598
8801
  }
8599
8802
  };
8600
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8803
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8601
8804
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8602
8805
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8603
8806
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -8621,7 +8824,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8621
8824
  fragmentEndAnchor,
8622
8825
  parentComponent,
8623
8826
  parentSuspense,
8624
- isSVG,
8827
+ namespace,
8625
8828
  slotScopeIds,
8626
8829
  optimized
8627
8830
  );
@@ -8635,7 +8838,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8635
8838
  container,
8636
8839
  parentComponent,
8637
8840
  parentSuspense,
8638
- isSVG,
8841
+ namespace,
8639
8842
  slotScopeIds
8640
8843
  );
8641
8844
  {
@@ -8649,14 +8852,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8649
8852
  fragmentEndAnchor,
8650
8853
  parentComponent,
8651
8854
  parentSuspense,
8652
- isSVG,
8855
+ namespace,
8653
8856
  slotScopeIds,
8654
8857
  optimized
8655
8858
  );
8656
8859
  }
8657
8860
  }
8658
8861
  };
8659
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8862
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8660
8863
  n2.slotScopeIds = slotScopeIds;
8661
8864
  if (n1 == null) {
8662
8865
  if (n2.shapeFlag & 512) {
@@ -8664,7 +8867,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8664
8867
  n2,
8665
8868
  container,
8666
8869
  anchor,
8667
- isSVG,
8870
+ namespace,
8668
8871
  optimized
8669
8872
  );
8670
8873
  } else {
@@ -8674,7 +8877,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8674
8877
  anchor,
8675
8878
  parentComponent,
8676
8879
  parentSuspense,
8677
- isSVG,
8880
+ namespace,
8678
8881
  optimized
8679
8882
  );
8680
8883
  }
@@ -8682,7 +8885,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8682
8885
  updateComponent(n1, n2, optimized);
8683
8886
  }
8684
8887
  };
8685
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
8888
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
8686
8889
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
8687
8890
  const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
8688
8891
  initialVNode,
@@ -8714,17 +8917,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8714
8917
  const placeholder = instance.subTree = createVNode(Comment);
8715
8918
  processCommentNode(null, placeholder, container, anchor);
8716
8919
  }
8717
- return;
8920
+ } else {
8921
+ setupRenderEffect(
8922
+ instance,
8923
+ initialVNode,
8924
+ container,
8925
+ anchor,
8926
+ parentSuspense,
8927
+ namespace,
8928
+ optimized
8929
+ );
8718
8930
  }
8719
- setupRenderEffect(
8720
- instance,
8721
- initialVNode,
8722
- container,
8723
- anchor,
8724
- parentSuspense,
8725
- isSVG,
8726
- optimized
8727
- );
8728
8931
  {
8729
8932
  popWarningContext();
8730
8933
  endMeasure(instance, `mount`);
@@ -8753,7 +8956,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8753
8956
  instance.vnode = n2;
8754
8957
  }
8755
8958
  };
8756
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
8959
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
8757
8960
  const componentUpdateFn = () => {
8758
8961
  if (!instance.isMounted) {
8759
8962
  let vnodeHook;
@@ -8823,7 +9026,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8823
9026
  anchor,
8824
9027
  instance,
8825
9028
  parentSuspense,
8826
- isSVG
9029
+ namespace
8827
9030
  );
8828
9031
  {
8829
9032
  endMeasure(instance, `patch`);
@@ -8862,6 +9065,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8862
9065
  initialVNode = container = anchor = null;
8863
9066
  } else {
8864
9067
  let { next, bu, u, parent, vnode } = instance;
9068
+ {
9069
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9070
+ if (nonHydratedAsyncRoot) {
9071
+ if (next) {
9072
+ next.el = vnode.el;
9073
+ updateComponentPreRender(instance, next, optimized);
9074
+ }
9075
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9076
+ if (!instance.isUnmounted) {
9077
+ componentUpdateFn();
9078
+ }
9079
+ });
9080
+ return;
9081
+ }
9082
+ }
8865
9083
  let originNext = next;
8866
9084
  let vnodeHook;
8867
9085
  {
@@ -8905,7 +9123,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8905
9123
  getNextHostNode(prevTree),
8906
9124
  instance,
8907
9125
  parentSuspense,
8908
- isSVG
9126
+ namespace
8909
9127
  );
8910
9128
  {
8911
9129
  endMeasure(instance, `patch`);
@@ -8966,10 +9184,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8966
9184
  updateProps(instance, nextVNode.props, prevProps, optimized);
8967
9185
  updateSlots(instance, nextVNode.children, optimized);
8968
9186
  pauseTracking();
8969
- flushPreFlushCbs();
9187
+ flushPreFlushCbs(instance);
8970
9188
  resetTracking();
8971
9189
  };
8972
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
9190
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
8973
9191
  const c1 = n1 && n1.children;
8974
9192
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
8975
9193
  const c2 = n2.children;
@@ -8983,7 +9201,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8983
9201
  anchor,
8984
9202
  parentComponent,
8985
9203
  parentSuspense,
8986
- isSVG,
9204
+ namespace,
8987
9205
  slotScopeIds,
8988
9206
  optimized
8989
9207
  );
@@ -8996,7 +9214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8996
9214
  anchor,
8997
9215
  parentComponent,
8998
9216
  parentSuspense,
8999
- isSVG,
9217
+ namespace,
9000
9218
  slotScopeIds,
9001
9219
  optimized
9002
9220
  );
@@ -9020,7 +9238,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9020
9238
  anchor,
9021
9239
  parentComponent,
9022
9240
  parentSuspense,
9023
- isSVG,
9241
+ namespace,
9024
9242
  slotScopeIds,
9025
9243
  optimized
9026
9244
  );
@@ -9038,7 +9256,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9038
9256
  anchor,
9039
9257
  parentComponent,
9040
9258
  parentSuspense,
9041
- isSVG,
9259
+ namespace,
9042
9260
  slotScopeIds,
9043
9261
  optimized
9044
9262
  );
@@ -9046,7 +9264,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9046
9264
  }
9047
9265
  }
9048
9266
  };
9049
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9267
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9050
9268
  c1 = c1 || EMPTY_ARR;
9051
9269
  c2 = c2 || EMPTY_ARR;
9052
9270
  const oldLength = c1.length;
@@ -9062,7 +9280,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9062
9280
  null,
9063
9281
  parentComponent,
9064
9282
  parentSuspense,
9065
- isSVG,
9283
+ namespace,
9066
9284
  slotScopeIds,
9067
9285
  optimized
9068
9286
  );
@@ -9083,14 +9301,14 @@ function baseCreateRenderer(options, createHydrationFns) {
9083
9301
  anchor,
9084
9302
  parentComponent,
9085
9303
  parentSuspense,
9086
- isSVG,
9304
+ namespace,
9087
9305
  slotScopeIds,
9088
9306
  optimized,
9089
9307
  commonLength
9090
9308
  );
9091
9309
  }
9092
9310
  };
9093
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9311
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9094
9312
  let i = 0;
9095
9313
  const l2 = c2.length;
9096
9314
  let e1 = c1.length - 1;
@@ -9106,7 +9324,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9106
9324
  null,
9107
9325
  parentComponent,
9108
9326
  parentSuspense,
9109
- isSVG,
9327
+ namespace,
9110
9328
  slotScopeIds,
9111
9329
  optimized
9112
9330
  );
@@ -9126,7 +9344,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9126
9344
  null,
9127
9345
  parentComponent,
9128
9346
  parentSuspense,
9129
- isSVG,
9347
+ namespace,
9130
9348
  slotScopeIds,
9131
9349
  optimized
9132
9350
  );
@@ -9148,7 +9366,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9148
9366
  anchor,
9149
9367
  parentComponent,
9150
9368
  parentSuspense,
9151
- isSVG,
9369
+ namespace,
9152
9370
  slotScopeIds,
9153
9371
  optimized
9154
9372
  );
@@ -9218,7 +9436,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9218
9436
  null,
9219
9437
  parentComponent,
9220
9438
  parentSuspense,
9221
- isSVG,
9439
+ namespace,
9222
9440
  slotScopeIds,
9223
9441
  optimized
9224
9442
  );
@@ -9239,7 +9457,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9239
9457
  anchor,
9240
9458
  parentComponent,
9241
9459
  parentSuspense,
9242
- isSVG,
9460
+ namespace,
9243
9461
  slotScopeIds,
9244
9462
  optimized
9245
9463
  );
@@ -9469,13 +9687,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9469
9687
  }
9470
9688
  return hostNextSibling(vnode.anchor || vnode.el);
9471
9689
  };
9472
- const render = (vnode, container, isSVG) => {
9690
+ const render = (vnode, container, namespace) => {
9473
9691
  if (vnode == null) {
9474
9692
  if (container._vnode) {
9475
9693
  unmount(container._vnode, null, null, true);
9476
9694
  }
9477
9695
  } else {
9478
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9696
+ patch(
9697
+ container._vnode || null,
9698
+ vnode,
9699
+ container,
9700
+ null,
9701
+ null,
9702
+ null,
9703
+ namespace
9704
+ );
9479
9705
  }
9480
9706
  flushPreFlushCbs();
9481
9707
  flushPostFlushCbs();
@@ -9506,6 +9732,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9506
9732
  createApp: createAppAPI(render, hydrate)
9507
9733
  };
9508
9734
  }
9735
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
9736
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9737
+ }
9509
9738
  function toggleRecurse({ effect, update }, allowed) {
9510
9739
  effect.allowRecurse = update.allowRecurse = allowed;
9511
9740
  }
@@ -9576,10 +9805,21 @@ function getSequence(arr) {
9576
9805
  }
9577
9806
  return result;
9578
9807
  }
9808
+ function locateNonHydratedAsyncRoot(instance) {
9809
+ const subComponent = instance.subTree.component;
9810
+ if (subComponent) {
9811
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9812
+ return subComponent;
9813
+ } else {
9814
+ return locateNonHydratedAsyncRoot(subComponent);
9815
+ }
9816
+ }
9817
+ }
9579
9818
 
9580
9819
  const isTeleport = (type) => type.__isTeleport;
9581
9820
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
9582
9821
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
9822
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
9583
9823
  const resolveTarget = (props, select) => {
9584
9824
  const targetSelector = props && props.to;
9585
9825
  if (isString(targetSelector)) {
@@ -9607,7 +9847,7 @@ const resolveTarget = (props, select) => {
9607
9847
  const TeleportImpl = {
9608
9848
  name: "Teleport",
9609
9849
  __isTeleport: true,
9610
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9850
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
9611
9851
  const {
9612
9852
  mc: mountChildren,
9613
9853
  pc: patchChildren,
@@ -9629,7 +9869,11 @@ const TeleportImpl = {
9629
9869
  const targetAnchor = n2.targetAnchor = createText("");
9630
9870
  if (target) {
9631
9871
  insert(targetAnchor, target);
9632
- isSVG = isSVG || isTargetSVG(target);
9872
+ if (namespace === "svg" || isTargetSVG(target)) {
9873
+ namespace = "svg";
9874
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9875
+ namespace = "mathml";
9876
+ }
9633
9877
  } else if (!disabled) {
9634
9878
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
9635
9879
  }
@@ -9641,7 +9885,7 @@ const TeleportImpl = {
9641
9885
  anchor2,
9642
9886
  parentComponent,
9643
9887
  parentSuspense,
9644
- isSVG,
9888
+ namespace,
9645
9889
  slotScopeIds,
9646
9890
  optimized
9647
9891
  );
@@ -9660,7 +9904,11 @@ const TeleportImpl = {
9660
9904
  const wasDisabled = isTeleportDisabled(n1.props);
9661
9905
  const currentContainer = wasDisabled ? container : target;
9662
9906
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
9663
- isSVG = isSVG || isTargetSVG(target);
9907
+ if (namespace === "svg" || isTargetSVG(target)) {
9908
+ namespace = "svg";
9909
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9910
+ namespace = "mathml";
9911
+ }
9664
9912
  if (dynamicChildren) {
9665
9913
  patchBlockChildren(
9666
9914
  n1.dynamicChildren,
@@ -9668,7 +9916,7 @@ const TeleportImpl = {
9668
9916
  currentContainer,
9669
9917
  parentComponent,
9670
9918
  parentSuspense,
9671
- isSVG,
9919
+ namespace,
9672
9920
  slotScopeIds
9673
9921
  );
9674
9922
  traverseStaticChildren(n1, n2, true);
@@ -9680,7 +9928,7 @@ const TeleportImpl = {
9680
9928
  currentAnchor,
9681
9929
  parentComponent,
9682
9930
  parentSuspense,
9683
- isSVG,
9931
+ namespace,
9684
9932
  slotScopeIds,
9685
9933
  false
9686
9934
  );
@@ -10364,10 +10612,14 @@ function createComponentInstance(vnode, parent, suspense) {
10364
10612
  let currentInstance = null;
10365
10613
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10366
10614
  let internalSetCurrentInstance;
10615
+ let setInSSRSetupState;
10367
10616
  {
10368
10617
  internalSetCurrentInstance = (i) => {
10369
10618
  currentInstance = i;
10370
10619
  };
10620
+ setInSSRSetupState = (v) => {
10621
+ isInSSRComponentSetup = v;
10622
+ };
10371
10623
  }
10372
10624
  const setCurrentInstance = (instance) => {
10373
10625
  internalSetCurrentInstance(instance);
@@ -10391,13 +10643,13 @@ function isStatefulComponent(instance) {
10391
10643
  }
10392
10644
  let isInSSRComponentSetup = false;
10393
10645
  function setupComponent(instance, isSSR = false) {
10394
- isInSSRComponentSetup = isSSR;
10646
+ isSSR && setInSSRSetupState(isSSR);
10395
10647
  const { props, children } = instance.vnode;
10396
10648
  const isStateful = isStatefulComponent(instance);
10397
10649
  initProps(instance, props, isStateful, isSSR);
10398
10650
  initSlots(instance, children);
10399
10651
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10400
- isInSSRComponentSetup = false;
10652
+ isSSR && setInSSRSetupState(false);
10401
10653
  return setupResult;
10402
10654
  }
10403
10655
  function setupStatefulComponent(instance, isSSR) {
@@ -10725,9 +10977,9 @@ function initCustomFormatter() {
10725
10977
  return;
10726
10978
  }
10727
10979
  const vueStyle = { style: "color:#3ba776" };
10728
- const numberStyle = { style: "color:#0b1bc9" };
10729
- const stringStyle = { style: "color:#b62e24" };
10730
- const keywordStyle = { style: "color:#9d288c" };
10980
+ const numberStyle = { style: "color:#1677ff" };
10981
+ const stringStyle = { style: "color:#f5222d" };
10982
+ const keywordStyle = { style: "color:#eb2f96" };
10731
10983
  const formatter = {
10732
10984
  header(obj) {
10733
10985
  if (!isObject(obj)) {
@@ -10921,7 +11173,7 @@ function isMemoSame(cached, memo) {
10921
11173
  return true;
10922
11174
  }
10923
11175
 
10924
- const version = "3.4.0-alpha.3";
11176
+ const version = "3.4.0-beta.1";
10925
11177
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10926
11178
  const ssrUtils = null;
10927
11179
  const resolveFilter = resolveFilter$1 ;
@@ -10933,8 +11185,10 @@ const _compatUtils = {
10933
11185
  softAssertCompatEnabled
10934
11186
  };
10935
11187
  const compatUtils = _compatUtils ;
11188
+ const DeprecationTypes = DeprecationTypes$1 ;
10936
11189
 
10937
11190
  const svgNS = "http://www.w3.org/2000/svg";
11191
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
10938
11192
  const doc = typeof document !== "undefined" ? document : null;
10939
11193
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
10940
11194
  const nodeOps = {
@@ -10947,8 +11201,8 @@ const nodeOps = {
10947
11201
  parent.removeChild(child);
10948
11202
  }
10949
11203
  },
10950
- createElement: (tag, isSVG, is, props) => {
10951
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11204
+ createElement: (tag, namespace, is, props) => {
11205
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
10952
11206
  if (tag === "select" && props && props.multiple != null) {
10953
11207
  el.setAttribute("multiple", props.multiple);
10954
11208
  }
@@ -10972,7 +11226,7 @@ const nodeOps = {
10972
11226
  // Reason: innerHTML.
10973
11227
  // Static content here can only come from compiled templates.
10974
11228
  // As long as the user only uses trusted templates, this is safe.
10975
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
11229
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
10976
11230
  const before = anchor ? anchor.previousSibling : parent.lastChild;
10977
11231
  if (start && (start === end || start.nextSibling)) {
10978
11232
  while (true) {
@@ -10981,9 +11235,9 @@ const nodeOps = {
10981
11235
  break;
10982
11236
  }
10983
11237
  } else {
10984
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
11238
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
10985
11239
  const template = templateContainer.content;
10986
- if (isSVG) {
11240
+ if (namespace === "svg" || namespace === "mathml") {
10987
11241
  const wrapper = template.firstChild;
10988
11242
  while (wrapper.firstChild) {
10989
11243
  template.appendChild(wrapper.firstChild);
@@ -11621,8 +11875,10 @@ function patchStopImmediatePropagation(e, value) {
11621
11875
  }
11622
11876
  }
11623
11877
 
11624
- const nativeOnRE = /^on[a-z]/;
11625
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11878
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11879
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11880
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11881
+ const isSVG = namespace === "svg";
11626
11882
  if (key === "class") {
11627
11883
  patchClass(el, nextValue, isSVG);
11628
11884
  } else if (key === "style") {
@@ -11655,7 +11911,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11655
11911
  if (key === "innerHTML" || key === "textContent") {
11656
11912
  return true;
11657
11913
  }
11658
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11914
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11659
11915
  return true;
11660
11916
  }
11661
11917
  return false;
@@ -11672,7 +11928,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
11672
11928
  if (key === "type" && el.tagName === "TEXTAREA") {
11673
11929
  return false;
11674
11930
  }
11675
- if (nativeOnRE.test(key) && isString(value)) {
11931
+ if (key === "width" || key === "height") {
11932
+ const tag = el.tagName;
11933
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
11934
+ return false;
11935
+ }
11936
+ }
11937
+ if (isNativeOn(key) && isString(value)) {
11676
11938
  return false;
11677
11939
  }
11678
11940
  return key in el;
@@ -12362,14 +12624,14 @@ const modifierGuards = {
12362
12624
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12363
12625
  };
12364
12626
  const withModifiers = (fn, modifiers) => {
12365
- return (event, ...args) => {
12627
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12366
12628
  for (let i = 0; i < modifiers.length; i++) {
12367
12629
  const guard = modifierGuards[modifiers[i]];
12368
12630
  if (guard && guard(event, modifiers))
12369
12631
  return;
12370
12632
  }
12371
12633
  return fn(event, ...args);
12372
- };
12634
+ });
12373
12635
  };
12374
12636
  const keyNames = {
12375
12637
  esc: "escape",
@@ -12397,7 +12659,7 @@ const withKeys = (fn, modifiers) => {
12397
12659
  );
12398
12660
  }
12399
12661
  }
12400
- return (event) => {
12662
+ return fn._withKeys || (fn._withKeys = (event) => {
12401
12663
  if (!("key" in event)) {
12402
12664
  return;
12403
12665
  }
@@ -12425,7 +12687,7 @@ const withKeys = (fn, modifiers) => {
12425
12687
  }
12426
12688
  }
12427
12689
  }
12428
- };
12690
+ });
12429
12691
  };
12430
12692
 
12431
12693
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12473,7 +12735,7 @@ const createApp = (...args) => {
12473
12735
  }
12474
12736
  }
12475
12737
  container.innerHTML = "";
12476
- const proxy = mount(container, false, container instanceof SVGElement);
12738
+ const proxy = mount(container, false, resolveRootNamespace(container));
12477
12739
  if (container instanceof Element) {
12478
12740
  container.removeAttribute("v-cloak");
12479
12741
  container.setAttribute("data-v-app", "");
@@ -12492,14 +12754,22 @@ const createSSRApp = (...args) => {
12492
12754
  app.mount = (containerOrSelector) => {
12493
12755
  const container = normalizeContainer(containerOrSelector);
12494
12756
  if (container) {
12495
- return mount(container, true, container instanceof SVGElement);
12757
+ return mount(container, true, resolveRootNamespace(container));
12496
12758
  }
12497
12759
  };
12498
12760
  return app;
12499
12761
  };
12762
+ function resolveRootNamespace(container) {
12763
+ if (container instanceof SVGElement) {
12764
+ return "svg";
12765
+ }
12766
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
12767
+ return "mathml";
12768
+ }
12769
+ }
12500
12770
  function injectNativeTagCheck(app) {
12501
12771
  Object.defineProperty(app.config, "isNativeTag", {
12502
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
12772
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
12503
12773
  writable: false
12504
12774
  });
12505
12775
  }
@@ -12556,7 +12826,9 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12556
12826
  BaseTransition: BaseTransition,
12557
12827
  BaseTransitionPropsValidators: BaseTransitionPropsValidators,
12558
12828
  Comment: Comment,
12829
+ DeprecationTypes: DeprecationTypes,
12559
12830
  EffectScope: EffectScope,
12831
+ ErrorCodes: ErrorCodes,
12560
12832
  ErrorTypeStrings: ErrorTypeStrings,
12561
12833
  Fragment: Fragment,
12562
12834
  KeepAlive: KeepAlive,
@@ -12565,8 +12837,10 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12565
12837
  Suspense: Suspense,
12566
12838
  Teleport: Teleport,
12567
12839
  Text: Text,
12840
+ TrackOpTypes: TrackOpTypes,
12568
12841
  Transition: Transition,
12569
12842
  TransitionGroup: TransitionGroup,
12843
+ TriggerOpTypes: TriggerOpTypes,
12570
12844
  VueElement: VueElement,
12571
12845
  assertNumber: assertNumber,
12572
12846
  callWithAsyncErrorHandling: callWithAsyncErrorHandling,
@@ -13038,7 +13312,9 @@ class Tokenizer {
13038
13312
  this.inRCDATA = false;
13039
13313
  /** For disabling RCDATA tags handling */
13040
13314
  this.inXML = false;
13041
- /** Reocrd newline positions for fast line / column calculation */
13315
+ /** For disabling interpolation parsing in v-pre */
13316
+ this.inVPre = false;
13317
+ /** Record newline positions for fast line / column calculation */
13042
13318
  this.newlines = [];
13043
13319
  this.mode = 0;
13044
13320
  this.delimiterOpen = defaultDelimitersOpen;
@@ -13057,6 +13333,7 @@ class Tokenizer {
13057
13333
  this.sectionStart = 0;
13058
13334
  this.index = 0;
13059
13335
  this.baseState = 1;
13336
+ this.inRCDATA = false;
13060
13337
  this.currentSequence = void 0;
13061
13338
  this.newlines.length = 0;
13062
13339
  this.delimiterOpen = defaultDelimitersOpen;
@@ -13095,7 +13372,7 @@ class Tokenizer {
13095
13372
  }
13096
13373
  this.state = 5;
13097
13374
  this.sectionStart = this.index;
13098
- } else if (c === this.delimiterOpen[0]) {
13375
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
13099
13376
  this.state = 2;
13100
13377
  this.delimiterIndex = 0;
13101
13378
  this.stateInterpolationOpen(c);
@@ -13910,16 +14187,14 @@ const errorMessages = {
13910
14187
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
13911
14188
  [45]: `Error parsing JavaScript expression: `,
13912
14189
  [46]: `<KeepAlive> expects exactly one child component.`,
14190
+ [51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
13913
14191
  // generic errors
13914
14192
  [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
13915
14193
  [48]: `ES module mode is not supported in this build of compiler.`,
13916
14194
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
13917
14195
  [50]: `"scopeId" option is only supported in module mode.`,
13918
- // deprecations
13919
- [51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
13920
- [52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
13921
14196
  // just to fulfill types
13922
- [53]: ``
14197
+ [52]: ``
13923
14198
  };
13924
14199
 
13925
14200
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
@@ -14162,7 +14437,8 @@ const defaultParserOptions = {
14162
14437
  isCustomElement: NO,
14163
14438
  onError: defaultOnError,
14164
14439
  onWarn: defaultOnWarn,
14165
- comments: true
14440
+ comments: true,
14441
+ prefixIdentifiers: false
14166
14442
  };
14167
14443
  let currentOptions = defaultParserOptions;
14168
14444
  let currentRoot = null;
@@ -14204,7 +14480,7 @@ const tokenizer = new Tokenizer(stack, {
14204
14480
  }
14205
14481
  addNode({
14206
14482
  type: 5,
14207
- content: createSimpleExpression(exp, false, getLoc(innerStart, innerEnd)),
14483
+ content: createExp(exp, false, getLoc(innerStart, innerEnd)),
14208
14484
  loc: getLoc(start, end)
14209
14485
  });
14210
14486
  },
@@ -14297,7 +14573,7 @@ const tokenizer = new Tokenizer(stack, {
14297
14573
  loc: getLoc(start)
14298
14574
  };
14299
14575
  if (name === "pre") {
14300
- inVPre = true;
14576
+ inVPre = tokenizer.inVPre = true;
14301
14577
  currentVPreBoundary = currentOpenTag;
14302
14578
  const props = currentOpenTag.props;
14303
14579
  for (let i = 0; i < props.length; i++) {
@@ -14317,7 +14593,7 @@ const tokenizer = new Tokenizer(stack, {
14317
14593
  setLocEnd(currentProp.nameLoc, end);
14318
14594
  } else {
14319
14595
  const isStatic = arg[0] !== `[`;
14320
- currentProp.arg = createSimpleExpression(
14596
+ currentProp.arg = createExp(
14321
14597
  isStatic ? arg : arg.slice(1, -1),
14322
14598
  isStatic,
14323
14599
  getLoc(start, end),
@@ -14390,10 +14666,13 @@ const tokenizer = new Tokenizer(stack, {
14390
14666
  tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
14391
14667
  }
14392
14668
  } else {
14393
- currentProp.exp = createSimpleExpression(
14669
+ let expParseMode = 0 /* Normal */;
14670
+ currentProp.exp = createExp(
14394
14671
  currentAttrValue,
14395
14672
  false,
14396
- getLoc(currentAttrStartIndex, currentAttrEndIndex)
14673
+ getLoc(currentAttrStartIndex, currentAttrEndIndex),
14674
+ 0,
14675
+ expParseMode
14397
14676
  );
14398
14677
  if (currentProp.name === "for") {
14399
14678
  currentProp.forParseResult = parseForExpression(currentProp.exp);
@@ -14496,10 +14775,16 @@ function parseForExpression(input) {
14496
14775
  if (!inMatch)
14497
14776
  return;
14498
14777
  const [, LHS, RHS] = inMatch;
14499
- const createAliasExpression = (content, offset) => {
14778
+ const createAliasExpression = (content, offset, asParam = false) => {
14500
14779
  const start = loc.start.offset + offset;
14501
14780
  const end = start + content.length;
14502
- return createSimpleExpression(content, false, getLoc(start, end));
14781
+ return createExp(
14782
+ content,
14783
+ false,
14784
+ getLoc(start, end),
14785
+ 0,
14786
+ asParam ? 1 /* Params */ : 0 /* Normal */
14787
+ );
14503
14788
  };
14504
14789
  const result = {
14505
14790
  source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
@@ -14517,7 +14802,7 @@ function parseForExpression(input) {
14517
14802
  let keyOffset;
14518
14803
  if (keyContent) {
14519
14804
  keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
14520
- result.key = createAliasExpression(keyContent, keyOffset);
14805
+ result.key = createAliasExpression(keyContent, keyOffset, true);
14521
14806
  }
14522
14807
  if (iteratorMatch[2]) {
14523
14808
  const indexContent = iteratorMatch[2].trim();
@@ -14527,13 +14812,14 @@ function parseForExpression(input) {
14527
14812
  exp.indexOf(
14528
14813
  indexContent,
14529
14814
  result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
14530
- )
14815
+ ),
14816
+ true
14531
14817
  );
14532
14818
  }
14533
14819
  }
14534
14820
  }
14535
14821
  if (valueContent) {
14536
- result.value = createAliasExpression(valueContent, trimmedOffset);
14822
+ result.value = createAliasExpression(valueContent, trimmedOffset, true);
14537
14823
  }
14538
14824
  return result;
14539
14825
  }
@@ -14611,7 +14897,7 @@ function onCloseTag(el, end, isImplied = false) {
14611
14897
  inPre--;
14612
14898
  }
14613
14899
  if (currentVPreBoundary === el) {
14614
- inVPre = false;
14900
+ inVPre = tokenizer.inVPre = false;
14615
14901
  currentVPreBoundary = null;
14616
14902
  }
14617
14903
  if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
@@ -14846,8 +15132,14 @@ function dirToAttr(dir) {
14846
15132
  }
14847
15133
  return attr;
14848
15134
  }
14849
- function emitError(code, index) {
14850
- currentOptions.onError(createCompilerError(code, getLoc(index, index)));
15135
+ function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
15136
+ const exp = createSimpleExpression(content, isStatic, loc, constType);
15137
+ return exp;
15138
+ }
15139
+ function emitError(code, index, message) {
15140
+ currentOptions.onError(
15141
+ createCompilerError(code, getLoc(index, index), void 0, message)
15142
+ );
14851
15143
  }
14852
15144
  function reset() {
14853
15145
  tokenizer.reset();
@@ -14878,6 +15170,7 @@ function baseParse(input, options) {
14878
15170
  }
14879
15171
  }
14880
15172
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
15173
+ tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
14881
15174
  const delimiters = options == null ? void 0 : options.delimiters;
14882
15175
  if (delimiters) {
14883
15176
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
@@ -15162,6 +15455,7 @@ function createTransformContext(root, {
15162
15455
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
15163
15456
  const context = {
15164
15457
  // options
15458
+ filename,
15165
15459
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
15166
15460
  prefixIdentifiers,
15167
15461
  hoistStatic: hoistStatic2,
@@ -16924,6 +17218,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
16924
17218
  if (isEventHandler && isReservedProp(name)) {
16925
17219
  hasVnodeHook = true;
16926
17220
  }
17221
+ if (isEventHandler && value.type === 14) {
17222
+ value = value.arguments[0];
17223
+ }
16927
17224
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
16928
17225
  return;
16929
17226
  }
@@ -17376,9 +17673,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17376
17673
  if (arg.isStatic) {
17377
17674
  let rawName = arg.content;
17378
17675
  if (rawName.startsWith("vnode")) {
17379
- context.onWarn(
17380
- createCompilerError(51, arg.loc)
17381
- );
17676
+ context.onError(createCompilerError(51, arg.loc));
17382
17677
  }
17383
17678
  if (rawName.startsWith("vue:")) {
17384
17679
  rawName = `vnode-${rawName.slice(4)}`;
@@ -17871,12 +18166,14 @@ function baseCompile(source, options = {}) {
17871
18166
  if (options.scopeId && !isModuleMode) {
17872
18167
  onError(createCompilerError(50));
17873
18168
  }
17874
- const ast = isString(source) ? baseParse(source, options) : source;
18169
+ const resolvedOptions = extend({}, options, {
18170
+ prefixIdentifiers
18171
+ });
18172
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
17875
18173
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
17876
18174
  transform(
17877
18175
  ast,
17878
- extend({}, options, {
17879
- prefixIdentifiers,
18176
+ extend({}, resolvedOptions, {
17880
18177
  nodeTransforms: [
17881
18178
  ...nodeTransforms,
17882
18179
  ...options.nodeTransforms || []
@@ -17890,12 +18187,7 @@ function baseCompile(source, options = {}) {
17890
18187
  )
17891
18188
  })
17892
18189
  );
17893
- return generate(
17894
- ast,
17895
- extend({}, options, {
17896
- prefixIdentifiers
17897
- })
17898
- );
18190
+ return generate(ast, resolvedOptions);
17899
18191
  }
17900
18192
 
17901
18193
  const noopDirectiveTransform = () => ({ props: [] });
@@ -17940,7 +18232,7 @@ function decodeHtmlBrowser(raw, asAttr = false) {
17940
18232
  const parserOptions = {
17941
18233
  parseMode: "html",
17942
18234
  isVoidTag,
17943
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
18235
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
17944
18236
  isPreTag: (tag) => tag === "pre",
17945
18237
  decodeEntities: decodeHtmlBrowser ,
17946
18238
  isBuiltInComponent: (tag) => {
@@ -18425,4 +18717,4 @@ var Vue$1 = Vue;
18425
18717
 
18426
18718
  const { configureCompat } = Vue$1;
18427
18719
 
18428
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
18720
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };