@vue/runtime-dom 3.6.0-beta.9 → 3.6.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.9
2
+ * @vue/runtime-dom v3.6.0-rc.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -13,7 +13,7 @@ var VueRuntimeDOM = (function(exports) {
13
13
  * \/\*#\_\_PURE\_\_\*\/
14
14
  * So that they can be tree-shaken if necessary.
15
15
  */
16
- /* @__NO_SIDE_EFFECTS__ */
16
+ /*@__NO_SIDE_EFFECTS__*/
17
17
  function makeMap(str) {
18
18
  const map = Object.create(null);
19
19
  for (const key of str.split(",")) map[key] = 1;
@@ -57,9 +57,9 @@ var VueRuntimeDOM = (function(exports) {
57
57
  };
58
58
  const isPlainObject = (val) => toTypeString(val) === "[object Object]";
59
59
  const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
60
- const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
61
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
62
- const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
60
+ const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
61
+ const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
62
+ const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
63
63
  const cacheStringFunction = (fn) => {
64
64
  const cache = Object.create(null);
65
65
  return ((str) => {
@@ -133,7 +133,7 @@ var VueRuntimeDOM = (function(exports) {
133
133
  function canSetValueDirectly(tagName) {
134
134
  return tagName !== "PROGRESS" && !tagName.includes("-");
135
135
  }
136
- const isGloballyAllowed = /* @__PURE__ */ makeMap("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,Symbol");
136
+ const isGloballyAllowed = /*@__PURE__*/ makeMap("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,Symbol");
137
137
  //#endregion
138
138
  //#region packages/shared/src/normalizeProp.ts
139
139
  function normalizeStyle(value) {
@@ -149,10 +149,10 @@ var VueRuntimeDOM = (function(exports) {
149
149
  }
150
150
  const listDelimiterRE = /;(?![^(]*\))/g;
151
151
  const propertyDelimiterRE = /:([^]+)/;
152
- const styleCommentRE = /\/\*[^]*?\*\//g;
152
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
153
153
  function parseStringStyle(cssText) {
154
154
  const ret = {};
155
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
155
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
156
156
  if (item) {
157
157
  const tmp = item.split(propertyDelimiterRE);
158
158
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -201,17 +201,17 @@ var VueRuntimeDOM = (function(exports) {
201
201
  * Compiler only.
202
202
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
203
203
  */
204
- const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
204
+ const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
205
205
  /**
206
206
  * Compiler only.
207
207
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
208
208
  */
209
- const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
209
+ const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
210
210
  /**
211
211
  * Compiler only.
212
212
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
213
213
  */
214
- const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
214
+ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
215
215
  //#endregion
216
216
  //#region packages/shared/src/domAttrConfig.ts
217
217
  /**
@@ -226,11 +226,11 @@ var VueRuntimeDOM = (function(exports) {
226
226
  * - readonly -> readOnly
227
227
  */
228
228
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
229
- const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
229
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
230
230
  /**
231
231
  * The full list is needed during SSR to produce the correct initial markup.
232
232
  */
233
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
233
+ const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
234
234
  /**
235
235
  * Boolean attributes should be included if the value is truthy or ''.
236
236
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -244,11 +244,11 @@ var VueRuntimeDOM = (function(exports) {
244
244
  * Don't also forget to allow `data-*` and `aria-*`!
245
245
  * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
246
246
  */
247
- const isKnownHtmlAttr = /* @__PURE__ */ makeMap("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");
247
+ const isKnownHtmlAttr = /*@__PURE__*/ makeMap("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");
248
248
  /**
249
249
  * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
250
250
  */
251
- const isKnownSvgAttr = /* @__PURE__ */ makeMap("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");
251
+ const isKnownSvgAttr = /*@__PURE__*/ makeMap("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");
252
252
  /**
253
253
  * Shared between server-renderer and runtime-core hydration logic
254
254
  */
@@ -274,13 +274,54 @@ var VueRuntimeDOM = (function(exports) {
274
274
  }
275
275
  //#endregion
276
276
  //#region packages/shared/src/looseEqual.ts
277
- function looseCompareArrays(a, b) {
277
+ function looseCompareArrays(a, b, seen) {
278
278
  if (a.length !== b.length) return false;
279
279
  let equal = true;
280
- for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
280
+ for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
281
281
  return equal;
282
282
  }
283
- function looseEqual(a, b) {
283
+ function looseCompareCollections(a, b, seen) {
284
+ if (a.size !== b.size) return false;
285
+ const candidates = Array.from(b);
286
+ const matched = new Uint8Array(candidates.length);
287
+ for (const item of a) {
288
+ let index = -1;
289
+ for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
290
+ index = i;
291
+ break;
292
+ }
293
+ if (index < 0) return false;
294
+ matched[index] = 1;
295
+ }
296
+ return true;
297
+ }
298
+ function looseCompareObjects(a, b, seen) {
299
+ let aValidType = isMap(a);
300
+ let bValidType = isMap(b);
301
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
302
+ aValidType = isSet(a);
303
+ bValidType = isSet(b);
304
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
305
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
306
+ for (const key in a) {
307
+ const aHasKey = a.hasOwnProperty(key);
308
+ const bHasKey = b.hasOwnProperty(key);
309
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
310
+ }
311
+ return String(a) === String(b);
312
+ }
313
+ function looseCompareNested(a, b, seen, compare) {
314
+ if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
315
+ const [seenA, seenB] = seen;
316
+ if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
317
+ seenA.set(a, b);
318
+ seenB.set(b, a);
319
+ const equal = compare(a, b, seen);
320
+ seenA.delete(a);
321
+ seenB.delete(b);
322
+ return equal;
323
+ }
324
+ function looseEqual(a, b, seen) {
284
325
  if (a === b) return true;
285
326
  let aValidType = isDate(a);
286
327
  let bValidType = isDate(b);
@@ -290,17 +331,12 @@ var VueRuntimeDOM = (function(exports) {
290
331
  if (aValidType || bValidType) return a === b;
291
332
  aValidType = isArray(a);
292
333
  bValidType = isArray(b);
293
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareArrays(a, b) : false;
334
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
294
335
  aValidType = isObject(a);
295
336
  bValidType = isObject(b);
296
337
  if (aValidType || bValidType) {
297
338
  if (!aValidType || !bValidType) return false;
298
- if (Object.keys(a).length !== Object.keys(b).length) return false;
299
- for (const key in a) {
300
- const aHasKey = a.hasOwnProperty(key);
301
- const bHasKey = b.hasOwnProperty(key);
302
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
303
- }
339
+ return looseCompareNested(a, b, seen, looseCompareObjects);
304
340
  }
305
341
  return String(a) === String(b);
306
342
  }
@@ -430,9 +466,18 @@ var VueRuntimeDOM = (function(exports) {
430
466
  function warn$2(msg, ...args) {
431
467
  console.warn(`[Vue warn] ${msg}`, ...args);
432
468
  }
469
+ //#endregion
470
+ //#region packages/reactivity/src/system.ts
433
471
  const notifyBuffer = [];
434
472
  let batchDepth = 0;
435
473
  let activeSub = void 0;
474
+ let runDepth = 0;
475
+ function incRunDepth() {
476
+ ++runDepth;
477
+ }
478
+ function decRunDepth() {
479
+ --runDepth;
480
+ }
436
481
  let globalVersion = 0;
437
482
  let notifyIndex = 0;
438
483
  let notifyBufferLength = 0;
@@ -506,8 +551,10 @@ var VueRuntimeDOM = (function(exports) {
506
551
  const sub = link.sub;
507
552
  let flags = sub.flags;
508
553
  if (flags & 3) {
509
- if (!(flags & 60)) sub.flags = flags | 32;
510
- else if (!(flags & 12)) flags = 0;
554
+ if (!(flags & 60)) {
555
+ sub.flags = flags | 32;
556
+ if (runDepth) sub.flags |= 8;
557
+ } else if (!(flags & 12)) flags = 0;
511
558
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
512
559
  else if (!(flags & 48) && isValidLink(link, sub)) {
513
560
  sub.flags = flags | 40;
@@ -559,13 +606,23 @@ var VueRuntimeDOM = (function(exports) {
559
606
  sub.flags &= -5;
560
607
  }
561
608
  function flush() {
609
+ let hasError = false;
610
+ let error;
562
611
  while (notifyIndex < notifyBufferLength) {
563
612
  const effect = notifyBuffer[notifyIndex];
564
613
  notifyBuffer[notifyIndex++] = void 0;
565
- effect.notify();
614
+ try {
615
+ effect.notify();
616
+ } catch (err) {
617
+ if (!hasError) {
618
+ hasError = true;
619
+ error = err;
620
+ }
621
+ }
566
622
  }
567
623
  notifyIndex = 0;
568
624
  notifyBufferLength = 0;
625
+ if (hasError) throw error;
569
626
  }
570
627
  function checkDirty(link, sub) {
571
628
  let stack;
@@ -576,13 +633,13 @@ var VueRuntimeDOM = (function(exports) {
576
633
  let dirty = false;
577
634
  if (sub.flags & 16) dirty = true;
578
635
  else if ((depFlags & 17) === 17) {
636
+ const subs = dep.subs;
579
637
  if (dep.update()) {
580
- const subs = dep.subs;
581
638
  if (subs.nextSub !== void 0) shallowPropagate(subs);
582
639
  dirty = true;
583
640
  }
584
641
  } else if ((depFlags & 33) === 33) {
585
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
642
+ stack = {
586
643
  value: link,
587
644
  prev: stack
588
645
  };
@@ -597,15 +654,12 @@ var VueRuntimeDOM = (function(exports) {
597
654
  }
598
655
  while (checkDepth) {
599
656
  --checkDepth;
600
- const firstSub = sub.subs;
601
- const hasMultipleSubs = firstSub.nextSub !== void 0;
602
- if (hasMultipleSubs) {
603
- link = stack.value;
604
- stack = stack.prev;
605
- } else link = firstSub;
657
+ link = stack.value;
658
+ stack = stack.prev;
606
659
  if (dirty) {
660
+ const subs = sub.subs;
607
661
  if (sub.update()) {
608
- if (hasMultipleSubs) shallowPropagate(firstSub);
662
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
609
663
  sub = link.sub;
610
664
  continue;
611
665
  }
@@ -617,7 +671,7 @@ var VueRuntimeDOM = (function(exports) {
617
671
  }
618
672
  dirty = false;
619
673
  }
620
- return dirty;
674
+ return dirty && !!sub.flags;
621
675
  } while (true);
622
676
  }
623
677
  function shallowPropagate(link) {
@@ -652,7 +706,7 @@ var VueRuntimeDOM = (function(exports) {
652
706
  }
653
707
  set subs(value) {
654
708
  this._subs = value;
655
- if (value === void 0) this.map.delete(this.key);
709
+ if (value === void 0 && this.map) this.map.delete(this.key);
656
710
  }
657
711
  };
658
712
  const targetMap = /* @__PURE__ */ new WeakMap();
@@ -735,9 +789,7 @@ var VueRuntimeDOM = (function(exports) {
735
789
  if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
736
790
  }
737
791
  break;
738
- case "set":
739
- if (isMap(target)) run(depsMap.get(ITERATE_KEY));
740
- break;
792
+ case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
741
793
  }
742
794
  }
743
795
  }
@@ -752,13 +804,17 @@ var VueRuntimeDOM = (function(exports) {
752
804
  /**
753
805
  * Track array iteration and return:
754
806
  * - if input is reactive: a cloned raw array with reactive values
755
- * - if input is non-reactive or shallowReactive: the original raw array
807
+ * - if input is readonly: a cloned raw array with readonly values, preserving
808
+ * reactivity
809
+ * - if input is raw or shallow: the original raw array
756
810
  */
757
811
  function reactiveReadArray(array) {
758
812
  const raw = /* @__PURE__ */ toRaw(array);
759
813
  if (raw === array) return raw;
760
814
  track(raw, "iterate", ARRAY_ITERATE_KEY);
761
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
815
+ if (/* @__PURE__ */ isShallow(array)) return raw;
816
+ if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
817
+ return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
762
818
  }
763
819
  /**
764
820
  * Track array iteration and return raw array
@@ -934,8 +990,8 @@ var VueRuntimeDOM = (function(exports) {
934
990
  }
935
991
  //#endregion
936
992
  //#region packages/reactivity/src/baseHandlers.ts
937
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
938
- const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
993
+ const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
994
+ const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
939
995
  function hasOwnProperty(key) {
940
996
  if (!isSymbol(key)) key = String(key);
941
997
  const obj = /* @__PURE__ */ toRaw(this);
@@ -990,17 +1046,19 @@ var VueRuntimeDOM = (function(exports) {
990
1046
  oldValue = /* @__PURE__ */ toRaw(oldValue);
991
1047
  value = /* @__PURE__ */ toRaw(value);
992
1048
  }
993
- if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
994
- warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
995
- return true;
996
- } else {
997
- oldValue.value = value;
998
- return true;
1049
+ if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1050
+ if (isOldValueReadonly) {
1051
+ warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1052
+ return true;
1053
+ } else {
1054
+ oldValue.value = value;
1055
+ return true;
1056
+ }
999
1057
  }
1000
1058
  }
1001
1059
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1002
1060
  const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
1003
- if (target === /* @__PURE__ */ toRaw(receiver)) {
1061
+ if (target === /* @__PURE__ */ toRaw(receiver) && result) {
1004
1062
  if (!hadKey) trigger(target, "add", key, value);
1005
1063
  else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1006
1064
  }
@@ -1036,10 +1094,10 @@ var VueRuntimeDOM = (function(exports) {
1036
1094
  return true;
1037
1095
  }
1038
1096
  };
1039
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
1040
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
1041
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
1042
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
1097
+ const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
1098
+ const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
1099
+ const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
1100
+ const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
1043
1101
  //#endregion
1044
1102
  //#region packages/reactivity/src/collectionHandlers.ts
1045
1103
  const toShallow = (value) => value;
@@ -1190,10 +1248,10 @@ var VueRuntimeDOM = (function(exports) {
1190
1248
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1191
1249
  };
1192
1250
  }
1193
- const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
1194
- const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) };
1195
- const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
1196
- const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
1251
+ const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
1252
+ const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
1253
+ const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
1254
+ const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
1197
1255
  function checkIdentityKeys(target, has, key) {
1198
1256
  const rawKey = /* @__PURE__ */ toRaw(key);
1199
1257
  if (rawKey !== key && has.call(target, rawKey)) {
@@ -1218,10 +1276,7 @@ var VueRuntimeDOM = (function(exports) {
1218
1276
  default: return 0;
1219
1277
  }
1220
1278
  }
1221
- function getTargetType(value) {
1222
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1223
- }
1224
- /* @__NO_SIDE_EFFECTS__ */
1279
+ /*@__NO_SIDE_EFFECTS__*/
1225
1280
  function reactive(target) {
1226
1281
  if (/* @__PURE__ */ isReadonly(target)) return target;
1227
1282
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -1256,7 +1311,7 @@ var VueRuntimeDOM = (function(exports) {
1256
1311
  * @param target - The source object.
1257
1312
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
1258
1313
  */
1259
- /* @__NO_SIDE_EFFECTS__ */
1314
+ /*@__NO_SIDE_EFFECTS__*/
1260
1315
  function shallowReactive(target) {
1261
1316
  return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
1262
1317
  }
@@ -1289,7 +1344,7 @@ var VueRuntimeDOM = (function(exports) {
1289
1344
  * @param target - The source object.
1290
1345
  * @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
1291
1346
  */
1292
- /* @__NO_SIDE_EFFECTS__ */
1347
+ /*@__NO_SIDE_EFFECTS__*/
1293
1348
  function readonly(target) {
1294
1349
  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
1295
1350
  }
@@ -1323,7 +1378,7 @@ var VueRuntimeDOM = (function(exports) {
1323
1378
  * @param target - The source object.
1324
1379
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
1325
1380
  */
1326
- /* @__NO_SIDE_EFFECTS__ */
1381
+ /*@__NO_SIDE_EFFECTS__*/
1327
1382
  function shallowReadonly(target) {
1328
1383
  return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
1329
1384
  }
@@ -1333,10 +1388,11 @@ var VueRuntimeDOM = (function(exports) {
1333
1388
  return target;
1334
1389
  }
1335
1390
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1336
- const targetType = getTargetType(target);
1337
- if (targetType === 0) return target;
1391
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1338
1392
  const existingProxy = proxyMap.get(target);
1339
1393
  if (existingProxy) return existingProxy;
1394
+ const targetType = targetTypeMap(toRawType(target));
1395
+ if (targetType === 0) return target;
1340
1396
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1341
1397
  proxyMap.set(target, proxy);
1342
1398
  return proxy;
@@ -1359,7 +1415,7 @@ var VueRuntimeDOM = (function(exports) {
1359
1415
  * @param value - The value to check.
1360
1416
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
1361
1417
  */
1362
- /* @__NO_SIDE_EFFECTS__ */
1418
+ /*@__NO_SIDE_EFFECTS__*/
1363
1419
  function isReactive(value) {
1364
1420
  if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
1365
1421
  return !!(value && value["__v_isReactive"]);
@@ -1375,11 +1431,11 @@ var VueRuntimeDOM = (function(exports) {
1375
1431
  * @param value - The value to check.
1376
1432
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
1377
1433
  */
1378
- /* @__NO_SIDE_EFFECTS__ */
1434
+ /*@__NO_SIDE_EFFECTS__*/
1379
1435
  function isReadonly(value) {
1380
1436
  return !!(value && value["__v_isReadonly"]);
1381
1437
  }
1382
- /* @__NO_SIDE_EFFECTS__ */
1438
+ /*@__NO_SIDE_EFFECTS__*/
1383
1439
  function isShallow(value) {
1384
1440
  return !!(value && value["__v_isShallow"]);
1385
1441
  }
@@ -1390,7 +1446,7 @@ var VueRuntimeDOM = (function(exports) {
1390
1446
  * @param value - The value to check.
1391
1447
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
1392
1448
  */
1393
- /* @__NO_SIDE_EFFECTS__ */
1449
+ /*@__NO_SIDE_EFFECTS__*/
1394
1450
  function isProxy(value) {
1395
1451
  return value ? !!value["__v_raw"] : false;
1396
1452
  }
@@ -1417,7 +1473,7 @@ var VueRuntimeDOM = (function(exports) {
1417
1473
  * @param observed - The object for which the "raw" value is requested.
1418
1474
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
1419
1475
  */
1420
- /* @__NO_SIDE_EFFECTS__ */
1476
+ /*@__NO_SIDE_EFFECTS__*/
1421
1477
  function toRaw(observed) {
1422
1478
  const raw = observed && observed["__v_raw"];
1423
1479
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
@@ -1466,15 +1522,15 @@ var VueRuntimeDOM = (function(exports) {
1466
1522
  const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1467
1523
  //#endregion
1468
1524
  //#region packages/reactivity/src/ref.ts
1469
- /* @__NO_SIDE_EFFECTS__ */
1525
+ /*@__NO_SIDE_EFFECTS__*/
1470
1526
  function isRef(r) {
1471
1527
  return r ? r["__v_isRef"] === true : false;
1472
1528
  }
1473
- /* @__NO_SIDE_EFFECTS__ */
1529
+ /*@__NO_SIDE_EFFECTS__*/
1474
1530
  function ref(value) {
1475
1531
  return createRef(value, toReactive);
1476
1532
  }
1477
- /* @__NO_SIDE_EFFECTS__ */
1533
+ /*@__NO_SIDE_EFFECTS__*/
1478
1534
  function shallowRef(value) {
1479
1535
  return createRef(value);
1480
1536
  }
@@ -1677,7 +1733,7 @@ var VueRuntimeDOM = (function(exports) {
1677
1733
  * @param object - Reactive object to be made into an object of linked refs.
1678
1734
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
1679
1735
  */
1680
- /* @__NO_SIDE_EFFECTS__ */
1736
+ /*@__NO_SIDE_EFFECTS__*/
1681
1737
  function toRefs(object) {
1682
1738
  const ret = isArray(object) ? new Array(object.length) : {};
1683
1739
  for (const key in object) ret[key] = propertyToRef(object, key);
@@ -1728,7 +1784,7 @@ var VueRuntimeDOM = (function(exports) {
1728
1784
  return this._value = this._getter();
1729
1785
  }
1730
1786
  };
1731
- /* @__NO_SIDE_EFFECTS__ */
1787
+ /*@__NO_SIDE_EFFECTS__*/
1732
1788
  function toRef(source, key, defaultValue) {
1733
1789
  if (/* @__PURE__ */ isRef(source)) return source;
1734
1790
  else if (isFunction(source)) return new GetterRefImpl(source);
@@ -1769,9 +1825,11 @@ var VueRuntimeDOM = (function(exports) {
1769
1825
  if (!this.active) return this.fn();
1770
1826
  cleanup(this);
1771
1827
  const prevSub = startTracking(this);
1828
+ incRunDepth();
1772
1829
  try {
1773
1830
  return this.fn();
1774
1831
  } finally {
1832
+ decRunDepth();
1775
1833
  endTracking(this, prevSub);
1776
1834
  const flags = this.flags;
1777
1835
  if ((flags & 136) === 136) {
@@ -1792,10 +1850,12 @@ var VueRuntimeDOM = (function(exports) {
1792
1850
  get dirty() {
1793
1851
  const flags = this.flags;
1794
1852
  if (flags & 16) return true;
1795
- if (flags & 32) if (checkDirty(this.deps, this)) {
1796
- this.flags = flags | 16;
1797
- return true;
1798
- } else this.flags = flags & -33;
1853
+ if (flags & 32) {
1854
+ if (checkDirty(this.deps, this)) {
1855
+ this.flags = flags | 16;
1856
+ return true;
1857
+ } else this.flags = flags & -33;
1858
+ }
1799
1859
  return false;
1800
1860
  }
1801
1861
  };
@@ -1974,10 +2034,12 @@ var VueRuntimeDOM = (function(exports) {
1974
2034
  get _dirty() {
1975
2035
  const flags = this.flags;
1976
2036
  if (flags & 16) return true;
1977
- if (flags & 32) if (checkDirty(this.deps, this)) {
1978
- this.flags = flags | 16;
1979
- return true;
1980
- } else this.flags = flags & -33;
2037
+ if (flags & 32) {
2038
+ if (checkDirty(this.deps, this)) {
2039
+ this.flags = flags | 16;
2040
+ return true;
2041
+ } else this.flags = flags & -33;
2042
+ }
1981
2043
  return false;
1982
2044
  }
1983
2045
  /**
@@ -2038,7 +2100,7 @@ var VueRuntimeDOM = (function(exports) {
2038
2100
  }
2039
2101
  };
2040
2102
  setupOnTrigger(ComputedRefImpl);
2041
- /* @__NO_SIDE_EFFECTS__ */
2103
+ /*@__NO_SIDE_EFFECTS__*/
2042
2104
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2043
2105
  let getter;
2044
2106
  let setter;
@@ -2116,25 +2178,26 @@ var VueRuntimeDOM = (function(exports) {
2116
2178
  else if (isFunction(s)) return call ? call(s, 2) : s();
2117
2179
  else warnInvalidSource(s, onWarn);
2118
2180
  });
2119
- } else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
2120
- else getter = () => {
2121
- if (this.cleanupsLength) {
2122
- const prevSub = setActiveSub();
2181
+ } else if (isFunction(source)) {
2182
+ if (cb) getter = call ? () => call(source, 2) : source;
2183
+ else getter = () => {
2184
+ if (this.cleanupsLength) {
2185
+ const prevSub = setActiveSub();
2186
+ try {
2187
+ cleanup(this);
2188
+ } finally {
2189
+ setActiveSub(prevSub);
2190
+ }
2191
+ }
2192
+ const currentEffect = activeWatcher;
2193
+ activeWatcher = this;
2123
2194
  try {
2124
- cleanup(this);
2195
+ return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
2125
2196
  } finally {
2126
- setActiveSub(prevSub);
2197
+ activeWatcher = currentEffect;
2127
2198
  }
2128
- }
2129
- const currentEffect = activeWatcher;
2130
- activeWatcher = this;
2131
- try {
2132
- return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
2133
- } finally {
2134
- activeWatcher = currentEffect;
2135
- }
2136
- };
2137
- else {
2199
+ };
2200
+ } else {
2138
2201
  getter = NOOP;
2139
2202
  warnInvalidSource(source, onWarn);
2140
2203
  }
@@ -2152,8 +2215,9 @@ var VueRuntimeDOM = (function(exports) {
2152
2215
  if (once && cb) {
2153
2216
  const _cb = cb;
2154
2217
  cb = (...args) => {
2155
- _cb(...args);
2218
+ const res = _cb(...args);
2156
2219
  this.stop();
2220
+ return res;
2157
2221
  };
2158
2222
  }
2159
2223
  this.cb = cb;
@@ -2167,7 +2231,7 @@ var VueRuntimeDOM = (function(exports) {
2167
2231
  if (!this.cb) return;
2168
2232
  const { immediate, deep, call } = this.options;
2169
2233
  if (initialRun && !immediate) return;
2170
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2234
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2171
2235
  cleanup(this);
2172
2236
  const currentWatcher = activeWatcher;
2173
2237
  activeWatcher = this;
@@ -2457,7 +2521,7 @@ var VueRuntimeDOM = (function(exports) {
2457
2521
  let jobsLength = 0;
2458
2522
  let flushIndex = 0;
2459
2523
  let postFlushIndex = 0;
2460
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2524
+ const resolvedPromise = /*@__PURE__*/ Promise.resolve();
2461
2525
  const RECURSION_LIMIT = 100;
2462
2526
  function nextTick(fn) {
2463
2527
  const p = currentFlushPromise || resolvedPromise;
@@ -2474,8 +2538,8 @@ var VueRuntimeDOM = (function(exports) {
2474
2538
  /**
2475
2539
  * @internal for runtime-vapor only
2476
2540
  */
2477
- function queueJob(job, id, isPre = false) {
2478
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2541
+ function queueJob(job, id, isPre = false, order = 0) {
2542
+ if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2479
2543
  jobsLength++;
2480
2544
  queueFlush();
2481
2545
  }
@@ -2496,6 +2560,7 @@ var VueRuntimeDOM = (function(exports) {
2496
2560
  flushJobs();
2497
2561
  } catch (e) {
2498
2562
  currentFlushPromise = null;
2563
+ if (jobsLength || postJobs.length) queueFlush();
2499
2564
  throw e;
2500
2565
  }
2501
2566
  };
@@ -2503,9 +2568,10 @@ var VueRuntimeDOM = (function(exports) {
2503
2568
  if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
2504
2569
  }
2505
2570
  function queuePostFlushCb(jobs, id = Infinity) {
2506
- if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2507
- else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2508
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2571
+ if (!isArray(jobs)) {
2572
+ if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2573
+ else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2574
+ } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2509
2575
  queueFlush();
2510
2576
  }
2511
2577
  function flushPreFlushCbs(instance, seen) {
@@ -2519,32 +2585,39 @@ var VueRuntimeDOM = (function(exports) {
2519
2585
  i--;
2520
2586
  jobsLength--;
2521
2587
  if (cb.flags & 2) cb.flags &= -2;
2522
- cb();
2523
- if (!(cb.flags & 2)) cb.flags &= -2;
2588
+ try {
2589
+ cb();
2590
+ } finally {
2591
+ if (!(cb.flags & 2)) cb.flags &= -2;
2592
+ }
2524
2593
  }
2525
2594
  }
2526
2595
  function flushPostFlushCbs(seen) {
2527
2596
  if (postJobs.length) {
2528
2597
  if (activePostJobs) {
2529
- activePostJobs.push(...postJobs);
2598
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2530
2599
  postJobs.length = 0;
2531
2600
  return;
2532
2601
  }
2533
2602
  activePostJobs = postJobs;
2534
2603
  postJobs = [];
2535
2604
  seen = seen || /* @__PURE__ */ new Map();
2536
- while (postFlushIndex < activePostJobs.length) {
2537
- const cb = activePostJobs[postFlushIndex++];
2538
- if (checkRecursiveUpdates(seen, cb)) continue;
2539
- if (cb.flags & 2) cb.flags &= -2;
2540
- if (!(cb.flags & 4)) try {
2541
- cb();
2542
- } finally {
2543
- cb.flags &= -2;
2605
+ try {
2606
+ while (postFlushIndex < activePostJobs.length) {
2607
+ const cb = activePostJobs[postFlushIndex++];
2608
+ if (checkRecursiveUpdates(seen, cb)) continue;
2609
+ if (cb.flags & 2) cb.flags &= -2;
2610
+ if (!(cb.flags & 4)) try {
2611
+ cb();
2612
+ } finally {
2613
+ if (!(cb.flags & 2)) cb.flags &= -2;
2614
+ }
2544
2615
  }
2616
+ } finally {
2617
+ while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
2618
+ activePostJobs = null;
2619
+ postFlushIndex = 0;
2545
2620
  }
2546
- activePostJobs = null;
2547
- postFlushIndex = 0;
2548
2621
  }
2549
2622
  }
2550
2623
  let isFlushing = false;
@@ -2554,9 +2627,12 @@ var VueRuntimeDOM = (function(exports) {
2554
2627
  function flushOnAppMount(instance) {
2555
2628
  if (!isFlushing) {
2556
2629
  isFlushing = true;
2557
- flushPreFlushCbs(instance);
2558
- flushPostFlushCbs();
2559
- isFlushing = false;
2630
+ try {
2631
+ flushPreFlushCbs(instance);
2632
+ flushPostFlushCbs();
2633
+ } finally {
2634
+ isFlushing = false;
2635
+ }
2560
2636
  }
2561
2637
  }
2562
2638
  function flushJobs(seen) {
@@ -2584,9 +2660,10 @@ var VueRuntimeDOM = (function(exports) {
2584
2660
  }
2585
2661
  flushIndex = 0;
2586
2662
  jobsLength = 0;
2663
+ jobs.length = 0;
2587
2664
  flushPostFlushCbs(seen);
2588
- currentFlushPromise = null;
2589
2665
  if (jobsLength || postJobs.length) flushJobs(seen);
2666
+ else currentFlushPromise = null;
2590
2667
  }
2591
2668
  }
2592
2669
  function checkRecursiveUpdates(seen, fn) {
@@ -2617,6 +2694,19 @@ var VueRuntimeDOM = (function(exports) {
2617
2694
  rerender: tryWrap(rerender),
2618
2695
  reload: tryWrap(reload)
2619
2696
  };
2697
+ function runWithHmrUpdating(fn) {
2698
+ isHmrUpdating = true;
2699
+ let done = false;
2700
+ try {
2701
+ fn();
2702
+ done = true;
2703
+ } finally {
2704
+ if (done) nextTick(() => {
2705
+ isHmrUpdating = false;
2706
+ });
2707
+ else isHmrUpdating = false;
2708
+ }
2709
+ }
2620
2710
  const map = /* @__PURE__ */ new Map();
2621
2711
  function registerHMR(instance) {
2622
2712
  const id = instance.type.__hmrId;
@@ -2641,6 +2731,14 @@ var VueRuntimeDOM = (function(exports) {
2641
2731
  function normalizeClassComponent(component) {
2642
2732
  return isClassComponent(component) ? component.__vccOpts : component;
2643
2733
  }
2734
+ function hasDirtyAncestor(instance, dirtyInstances) {
2735
+ let parent = instance.parent;
2736
+ while (parent) {
2737
+ if (dirtyInstances.has(parent)) return true;
2738
+ parent = parent.parent;
2739
+ }
2740
+ return false;
2741
+ }
2644
2742
  function rerender(id, newRender) {
2645
2743
  const record = map.get(id);
2646
2744
  if (!record) return;
@@ -2650,18 +2748,16 @@ var VueRuntimeDOM = (function(exports) {
2650
2748
  instance.render = newRender;
2651
2749
  normalizeClassComponent(instance.type).render = newRender;
2652
2750
  }
2653
- isHmrUpdating = true;
2654
- if (instance.vapor) {
2655
- if (!instance.isUnmounted) instance.hmrRerender();
2656
- } else {
2657
- const i = instance;
2658
- if (!(i.effect.flags & 1024)) {
2659
- i.renderCache = [];
2660
- i.effect.run();
2751
+ runWithHmrUpdating(() => {
2752
+ if (instance.vapor) {
2753
+ if (!instance.isUnmounted) instance.hmrRerender();
2754
+ } else {
2755
+ const i = instance;
2756
+ if (!(i.effect.flags & 1024)) {
2757
+ i.renderCache = [];
2758
+ i.effect.run();
2759
+ }
2661
2760
  }
2662
- }
2663
- nextTick(() => {
2664
- isHmrUpdating = false;
2665
2761
  });
2666
2762
  });
2667
2763
  }
@@ -2672,42 +2768,61 @@ var VueRuntimeDOM = (function(exports) {
2672
2768
  const isVapor = record.initialDef.__vapor;
2673
2769
  updateComponentDef(record.initialDef, newComp);
2674
2770
  const instances = [...record.instances];
2675
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2771
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2676
2772
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2677
- for (const instance of instances) instance.hmrReload(newComp);
2678
- } else for (const instance of instances) {
2679
- const oldComp = normalizeClassComponent(instance.type);
2680
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2681
- if (!dirtyInstances) {
2682
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2683
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2684
- }
2685
- dirtyInstances.add(instance);
2686
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2687
- instance.appContext.propsCache.delete(instance.type);
2688
- instance.appContext.emitsCache.delete(instance.type);
2689
- instance.appContext.optionsCache.delete(instance.type);
2690
- if (instance.ceReload) {
2691
- dirtyInstances.add(instance);
2692
- instance.ceReload(newComp.styles);
2693
- dirtyInstances.delete(instance);
2694
- } else if (instance.parent) queueJob(() => {
2695
- isHmrUpdating = true;
2696
- const parent = instance.parent;
2697
- if (parent.vapor) parent.hmrRerender();
2698
- else if (!(parent.effect.flags & 1024)) {
2699
- parent.renderCache = [];
2700
- parent.effect.run();
2773
+ const dirtyInstances = new Set(instances);
2774
+ const rerenderedParents = /* @__PURE__ */ new Set();
2775
+ runWithHmrUpdating(() => {
2776
+ for (const instance of instances) {
2777
+ const parent = instance.parent;
2778
+ if (parent) {
2779
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2780
+ rerenderedParents.add(parent);
2781
+ parent.hmrRerender();
2782
+ }
2783
+ } else instance.hmrReload(newComp);
2701
2784
  }
2702
- nextTick(() => {
2703
- isHmrUpdating = false;
2785
+ });
2786
+ } else {
2787
+ const parents = /* @__PURE__ */ new Set();
2788
+ const dirtyInstanceSet = new Set(instances);
2789
+ for (const instance of instances) {
2790
+ const oldComp = normalizeClassComponent(instance.type);
2791
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2792
+ if (!dirtyInstances) {
2793
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2794
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2795
+ }
2796
+ dirtyInstances.add(instance);
2797
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2798
+ instance.appContext.propsCache.delete(instance.type);
2799
+ instance.appContext.emitsCache.delete(instance.type);
2800
+ instance.appContext.optionsCache.delete(instance.type);
2801
+ if (instance.ceReload) {
2802
+ dirtyInstances.add(instance);
2803
+ instance.ceReload(newComp.styles);
2804
+ dirtyInstances.delete(instance);
2805
+ } else if (instance.parent) {
2806
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
2807
+ } else if (instance.appContext.reload) instance.appContext.reload();
2808
+ else if (typeof window !== "undefined") window.location.reload();
2809
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2810
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2811
+ }
2812
+ parents.forEach((parent) => {
2813
+ queueJob(() => {
2814
+ runWithHmrUpdating(() => {
2815
+ if (parent.vapor) parent.hmrRerender();
2816
+ else {
2817
+ const i = parent;
2818
+ if (!(i.effect.flags & 1024)) {
2819
+ i.renderCache = [];
2820
+ i.effect.run();
2821
+ }
2822
+ }
2823
+ });
2704
2824
  });
2705
- dirtyInstances.delete(instance);
2706
2825
  });
2707
- else if (instance.appContext.reload) instance.appContext.reload();
2708
- else if (typeof window !== "undefined") window.location.reload();
2709
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2710
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2711
2826
  }
2712
2827
  queuePostFlushCb(() => {
2713
2828
  hmrDirtyComponents.clear();
@@ -2774,20 +2889,20 @@ var VueRuntimeDOM = (function(exports) {
2774
2889
  function devtoolsUnmountApp(app) {
2775
2890
  emit$1("app:unmount", app);
2776
2891
  }
2777
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added");
2778
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated");
2779
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook("component:removed");
2892
+ const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
2893
+ const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
2894
+ const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
2780
2895
  const devtoolsComponentRemoved = (component) => {
2781
2896
  if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
2782
2897
  };
2783
- /* @__NO_SIDE_EFFECTS__ */
2898
+ /*@__NO_SIDE_EFFECTS__*/
2784
2899
  function createDevtoolsComponentHook(hook) {
2785
2900
  return (component) => {
2786
2901
  emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
2787
2902
  };
2788
2903
  }
2789
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start");
2790
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end");
2904
+ const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
2905
+ const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
2791
2906
  function createDevtoolsPerformanceHook(hook) {
2792
2907
  return (component, type, time) => {
2793
2908
  emit$1(hook, component.appContext.app, component.uid, component, type, time);
@@ -2850,10 +2965,12 @@ var VueRuntimeDOM = (function(exports) {
2850
2965
  const renderFnWithContext = (...args) => {
2851
2966
  if (renderFnWithContext._d) setBlockTracking(-1);
2852
2967
  const prevInstance = setCurrentRenderingInstance(ctx);
2968
+ const prevStackSize = blockStack.length;
2853
2969
  let res;
2854
2970
  try {
2855
2971
  res = fn(...args);
2856
2972
  } finally {
2973
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
2857
2974
  setCurrentRenderingInstance(prevInstance);
2858
2975
  if (renderFnWithContext._d) setBlockTracking(1);
2859
2976
  }
@@ -3024,7 +3141,7 @@ var VueRuntimeDOM = (function(exports) {
3024
3141
  }
3025
3142
  const prev = setCurrentInstance(this);
3026
3143
  const res = doWatch(getter, cb.bind(publicThis), options);
3027
- setCurrentInstance(...prev);
3144
+ restoreCurrentInstance(prev);
3028
3145
  return res;
3029
3146
  }
3030
3147
  function createPathGetter(ctx, path) {
@@ -3037,6 +3154,7 @@ var VueRuntimeDOM = (function(exports) {
3037
3154
  }
3038
3155
  //#endregion
3039
3156
  //#region packages/runtime-core/src/components/Teleport.ts
3157
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3040
3158
  const TeleportEndKey = Symbol("_vte");
3041
3159
  const isTeleport = (type) => type.__isTeleport;
3042
3160
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3045,15 +3163,16 @@ var VueRuntimeDOM = (function(exports) {
3045
3163
  const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
3046
3164
  const resolveTarget = (props, select) => {
3047
3165
  const targetSelector = props && props.to;
3048
- if (isString(targetSelector)) if (!select) {
3049
- warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
3050
- return null;
3166
+ if (isString(targetSelector)) {
3167
+ if (!select) {
3168
+ warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
3169
+ return null;
3170
+ } else {
3171
+ const target = select(targetSelector);
3172
+ if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
3173
+ return target;
3174
+ }
3051
3175
  } else {
3052
- const target = select(targetSelector);
3053
- if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
3054
- return target;
3055
- }
3056
- else {
3057
3176
  if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
3058
3177
  return targetSelector;
3059
3178
  }
@@ -3062,58 +3181,71 @@ var VueRuntimeDOM = (function(exports) {
3062
3181
  name: "Teleport",
3063
3182
  __isTeleport: true,
3064
3183
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3065
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3184
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3066
3185
  const disabled = isTeleportDisabled(n2.props);
3067
- let { shapeFlag, children, dynamicChildren } = n2;
3186
+ let { dynamicChildren } = n2;
3068
3187
  if (isHmrUpdating) {
3069
3188
  optimized = false;
3070
3189
  dynamicChildren = null;
3071
3190
  }
3191
+ const mount = (vnode, container, anchor) => {
3192
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3193
+ };
3194
+ const mountToTarget = (vnode = n2) => {
3195
+ const disabled = isTeleportDisabled(vnode.props);
3196
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3197
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3198
+ if (target) {
3199
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3200
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3201
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3202
+ if (!disabled) {
3203
+ mount(vnode, target, targetAnchor);
3204
+ updateCssVars(vnode, false);
3205
+ }
3206
+ } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3207
+ };
3208
+ const queuePendingMount = (vnode) => {
3209
+ const mountJob = () => {
3210
+ if (pendingMounts.get(vnode) !== mountJob) return;
3211
+ pendingMounts.delete(vnode);
3212
+ if (isTeleportDisabled(vnode.props)) {
3213
+ const mountContainer = parentNode(vnode.el) || container;
3214
+ mount(vnode, mountContainer, vnode.anchor);
3215
+ updateCssVars(vnode, true);
3216
+ }
3217
+ mountToTarget(vnode);
3218
+ };
3219
+ pendingMounts.set(vnode, mountJob);
3220
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
3221
+ };
3072
3222
  if (n1 == null) {
3073
3223
  const placeholder = n2.el = createComment("teleport start");
3074
3224
  const mainAnchor = n2.anchor = createComment("teleport end");
3075
3225
  insert(placeholder, container, anchor);
3076
3226
  insert(mainAnchor, container, anchor);
3077
- const mount = (container, anchor) => {
3078
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3079
- };
3080
- const mountToTarget = () => {
3081
- const target = n2.target = resolveTarget(n2.props, querySelector);
3082
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3083
- if (target) {
3084
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3085
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3086
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3087
- if (!disabled) {
3088
- mount(target, targetAnchor);
3089
- updateCssVars(n2, false);
3090
- }
3091
- } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3092
- };
3227
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3228
+ queuePendingMount(n2);
3229
+ return;
3230
+ }
3093
3231
  if (disabled) {
3094
- mount(container, mainAnchor);
3232
+ mount(n2, container, mainAnchor);
3095
3233
  updateCssVars(n2, true);
3096
3234
  }
3097
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3098
- n2.el.__isMounted = false;
3099
- queuePostRenderEffect(() => {
3100
- if (n2.el.__isMounted !== false) return;
3101
- mountToTarget();
3102
- delete n2.el.__isMounted;
3103
- }, void 0, parentSuspense);
3104
- } else mountToTarget();
3235
+ mountToTarget();
3105
3236
  } else {
3106
3237
  n2.el = n1.el;
3107
- n2.targetStart = n1.targetStart;
3108
3238
  const mainAnchor = n2.anchor = n1.anchor;
3109
- const target = n2.target = n1.target;
3110
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3111
- if (n1.el.__isMounted === false) {
3112
- queuePostRenderEffect(() => {
3113
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3114
- }, void 0, parentSuspense);
3239
+ const pendingMount = pendingMounts.get(n1);
3240
+ if (pendingMount) {
3241
+ pendingMount.flags |= 4;
3242
+ pendingMounts.delete(n1);
3243
+ queuePendingMount(n2);
3115
3244
  return;
3116
3245
  }
3246
+ n2.targetStart = n1.targetStart;
3247
+ const target = n2.target = n1.target;
3248
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3117
3249
  const wasDisabled = isTeleportDisabled(n1.props);
3118
3250
  const currentContainer = wasDisabled ? container : target;
3119
3251
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3127,24 +3259,30 @@ var VueRuntimeDOM = (function(exports) {
3127
3259
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
3128
3260
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
3129
3261
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3130
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
3131
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3132
- else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3262
+ const nextTarget = resolveTarget(n2.props, querySelector);
3263
+ if (nextTarget) {
3264
+ n2.target = nextTarget;
3265
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3266
+ } else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3133
3267
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
3134
3268
  updateCssVars(n2, disabled);
3135
3269
  }
3136
3270
  },
3137
3271
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3138
- const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3272
+ const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
3273
+ const disabled = isTeleportDisabled(props);
3274
+ const shouldRemove = doRemove || !disabled;
3275
+ const pendingMount = pendingMounts.get(vnode);
3276
+ if (pendingMount) {
3277
+ pendingMount.flags |= 4;
3278
+ pendingMounts.delete(vnode);
3279
+ }
3139
3280
  if (targetStart) hostRemove(targetStart);
3140
3281
  if (targetAnchor) hostRemove(targetAnchor);
3141
3282
  doRemove && hostRemove(anchor);
3142
- if (shapeFlag & 16) {
3143
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3144
- for (let i = 0; i < children.length; i++) {
3145
- const child = children[i];
3146
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3147
- }
3283
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3284
+ const child = children[i];
3285
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3148
3286
  }
3149
3287
  },
3150
3288
  move: moveTeleport,
@@ -3155,7 +3293,7 @@ var VueRuntimeDOM = (function(exports) {
3155
3293
  const { el, anchor, shapeFlag, children, props } = vnode;
3156
3294
  const isReorder = moveType === 2;
3157
3295
  if (isReorder) insert(el, container, parentAnchor);
3158
- if (!isReorder || isTeleportDisabled(props)) {
3296
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3159
3297
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3160
3298
  }
3161
3299
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3182,15 +3320,17 @@ var VueRuntimeDOM = (function(exports) {
3182
3320
  const disabled = isTeleportDisabled(vnode.props);
3183
3321
  if (target) {
3184
3322
  const targetNode = target._lpa || target.firstChild;
3185
- if (vnode.shapeFlag & 16) if (disabled) {
3186
- hydrateDisabledTeleport(node, vnode);
3187
- hydrateAnchor(target, targetNode);
3188
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3189
- } else {
3190
- vnode.anchor = nextSibling(node);
3191
- hydrateAnchor(target, targetNode);
3192
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3193
- hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3323
+ if (vnode.shapeFlag & 16) {
3324
+ if (disabled) {
3325
+ hydrateDisabledTeleport(node, vnode);
3326
+ hydrateAnchor(target, targetNode);
3327
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3328
+ } else {
3329
+ vnode.anchor = nextSibling(node);
3330
+ hydrateAnchor(target, targetNode);
3331
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3332
+ hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3333
+ }
3194
3334
  }
3195
3335
  updateCssVars(vnode, disabled);
3196
3336
  } else if (disabled) {
@@ -3278,49 +3418,16 @@ var VueRuntimeDOM = (function(exports) {
3278
3418
  setup(props, { slots }) {
3279
3419
  const instance = getCurrentInstance();
3280
3420
  const state = useTransitionState();
3421
+ let resumeAfterLeave;
3281
3422
  return () => {
3282
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3283
- if (!children || !children.length) return;
3284
- const child = findNonCommentChild(children);
3423
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3424
+ if (!child) return;
3285
3425
  const rawProps = /* @__PURE__ */ toRaw(props);
3286
3426
  const { mode } = rawProps;
3287
3427
  checkTransitionMode(mode);
3288
- if (state.isLeaving) return emptyPlaceholder(child);
3289
- const innerChild = getInnerChild$1(child);
3290
- if (!innerChild) return emptyPlaceholder(child);
3291
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3292
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3293
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3294
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3295
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3296
- setTransitionHooks(oldInnerChild, leavingHooks);
3297
- if (mode === "out-in" && innerChild.type !== Comment) {
3298
- state.isLeaving = true;
3299
- leavingHooks.afterLeave = () => {
3300
- state.isLeaving = false;
3301
- if (!(instance.job.flags & 4)) instance.update();
3302
- delete leavingHooks.afterLeave;
3303
- oldInnerChild = void 0;
3304
- };
3305
- return emptyPlaceholder(child);
3306
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3307
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3308
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3309
- el[leaveCbKey] = () => {
3310
- earlyRemove();
3311
- el[leaveCbKey] = void 0;
3312
- delete enterHooks.delayedLeave;
3313
- oldInnerChild = void 0;
3314
- };
3315
- enterHooks.delayedLeave = () => {
3316
- delayedLeave();
3317
- delete enterHooks.delayedLeave;
3318
- oldInnerChild = void 0;
3319
- };
3320
- };
3321
- else oldInnerChild = void 0;
3322
- } else if (oldInnerChild) oldInnerChild = void 0;
3323
- return child;
3428
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3429
+ if (!(instance.job.flags & 4)) instance.update();
3430
+ }) : NOOP);
3324
3431
  };
3325
3432
  }
3326
3433
  };
@@ -3389,8 +3496,10 @@ var VueRuntimeDOM = (function(exports) {
3389
3496
  persisted,
3390
3497
  beforeEnter(el) {
3391
3498
  let hook = onBeforeEnter;
3392
- if (!state.isMounted) if (appear) hook = onBeforeAppear || onBeforeEnter;
3393
- else return;
3499
+ if (!state.isMounted) {
3500
+ if (appear) hook = onBeforeAppear || onBeforeEnter;
3501
+ else return;
3502
+ }
3394
3503
  if (el[leaveCbKey]) el[leaveCbKey](true);
3395
3504
  earlyRemove();
3396
3505
  callHook(hook, [el]);
@@ -3400,11 +3509,13 @@ var VueRuntimeDOM = (function(exports) {
3400
3509
  let hook = onEnter;
3401
3510
  let afterHook = onAfterEnter;
3402
3511
  let cancelHook = onEnterCancelled;
3403
- if (!state.isMounted) if (appear) {
3404
- hook = onAppear || onEnter;
3405
- afterHook = onAfterAppear || onAfterEnter;
3406
- cancelHook = onAppearCancelled || onEnterCancelled;
3407
- } else return;
3512
+ if (!state.isMounted) {
3513
+ if (appear) {
3514
+ hook = onAppear || onEnter;
3515
+ afterHook = onAfterAppear || onAfterEnter;
3516
+ cancelHook = onAppearCancelled || onEnterCancelled;
3517
+ } else return;
3518
+ }
3408
3519
  let called = false;
3409
3520
  el[enterCbKey$1] = (cancelled) => {
3410
3521
  if (called) return;
@@ -3438,7 +3549,7 @@ var VueRuntimeDOM = (function(exports) {
3438
3549
  else done();
3439
3550
  },
3440
3551
  clone(node) {
3441
- return cloneHooks(node);
3552
+ return cloneHooks ? cloneHooks(node) : hooks;
3442
3553
  }
3443
3554
  };
3444
3555
  return hooks;
@@ -3462,16 +3573,91 @@ var VueRuntimeDOM = (function(exports) {
3462
3573
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3463
3574
  }
3464
3575
  }
3576
+ function resolveTransitionChild(children, renderEmpty = false) {
3577
+ const branches = children && getTransitionRawChildren(children, true);
3578
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
3579
+ }
3580
+ /**
3581
+ * @internal
3582
+ */
3583
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
3584
+ if (state.isLeaving) return emptyPlaceholder(next);
3585
+ const nextInner = getInnerChild$1(next);
3586
+ if (!nextInner) return emptyPlaceholder(next);
3587
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3588
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3589
+ enterHooks = hooks;
3590
+ });
3591
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3592
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3593
+ const mode = props.mode;
3594
+ const previousInner = previous && getInnerChild$1(previous);
3595
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3596
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3597
+ if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
3598
+ }
3599
+ return next;
3600
+ }
3601
+ function forwardDelayedLeave(hooks, source) {
3602
+ const delayedLeave = source && source.delayedLeave;
3603
+ if (!delayedLeave) return;
3604
+ hooks.delayedLeave = () => {
3605
+ if (source.delayedLeave === delayedLeave) delayedLeave();
3606
+ delete hooks.delayedLeave;
3607
+ };
3608
+ }
3609
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
3610
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
3611
+ }
3612
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
3613
+ if (props.mode === "out-in") {
3614
+ state.isLeaving = true;
3615
+ leavingHooks.afterLeave = () => {
3616
+ state.isLeaving = false;
3617
+ resumeAfterLeave();
3618
+ delete leavingHooks.afterLeave;
3619
+ };
3620
+ return true;
3621
+ } else if (props.mode === "in-out" && getEnterHooks) {
3622
+ let delayedLeavingVNode = leavingVNode;
3623
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3624
+ const enterHooks = getEnterHooks();
3625
+ if (!enterHooks) {
3626
+ delayedLeave();
3627
+ return;
3628
+ }
3629
+ const vnode = delayedLeavingVNode;
3630
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3631
+ leavingVNodesCache[String(vnode.key)] = vnode;
3632
+ el[leaveCbKey] = () => {
3633
+ earlyRemove();
3634
+ el[leaveCbKey] = void 0;
3635
+ delete enterHooks.delayedLeave;
3636
+ delayedLeavingVNode = void 0;
3637
+ };
3638
+ enterHooks.delayedLeave = () => {
3639
+ delayedLeave();
3640
+ delete enterHooks.delayedLeave;
3641
+ delayedLeavingVNode = void 0;
3642
+ };
3643
+ };
3644
+ }
3645
+ return false;
3646
+ }
3465
3647
  function setTransitionHooks(vnode, hooks) {
3466
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3467
- else {
3648
+ if (vnode.shapeFlag & 6 && vnode.component) {
3468
3649
  vnode.transition = hooks;
3469
- setTransitionHooks(vnode.component.subTree, hooks);
3470
- }
3471
- else if (vnode.shapeFlag & 128) {
3472
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3473
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3650
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3651
+ else {
3652
+ const subTree = vnode.component.subTree;
3653
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
3654
+ }
3655
+ } else if (vnode.shapeFlag & 128) {
3656
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3657
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3658
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3474
3659
  } else vnode.transition = hooks;
3660
+ return hooks;
3475
3661
  }
3476
3662
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3477
3663
  let ret = [];
@@ -3495,9 +3681,9 @@ var VueRuntimeDOM = (function(exports) {
3495
3681
  }
3496
3682
  //#endregion
3497
3683
  //#region packages/runtime-core/src/apiDefineComponent.ts
3498
- /* @__NO_SIDE_EFFECTS__ */
3684
+ /*@__NO_SIDE_EFFECTS__*/
3499
3685
  function defineComponent(options, extraOptions) {
3500
- return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
3686
+ return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
3501
3687
  }
3502
3688
  //#endregion
3503
3689
  //#region packages/runtime-core/src/helpers/useId.ts
@@ -3594,15 +3780,16 @@ var VueRuntimeDOM = (function(exports) {
3594
3780
  if (rawRef.f) {
3595
3781
  const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3596
3782
  if (isUnmount) isArray(existing) && remove(existing, refValue);
3597
- else if (!isArray(existing)) if (_isString) {
3598
- refs[ref] = [refValue];
3599
- if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
3600
- } else {
3601
- const newVal = [refValue];
3602
- if (canSetRef(ref, rawRef.k)) ref.value = newVal;
3603
- if (rawRef.k) refs[rawRef.k] = newVal;
3604
- }
3605
- else if (!existing.includes(refValue)) existing.push(refValue);
3783
+ else if (!isArray(existing)) {
3784
+ if (_isString) {
3785
+ refs[ref] = [refValue];
3786
+ if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
3787
+ } else {
3788
+ const newVal = [refValue];
3789
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
3790
+ if (rawRef.k) refs[rawRef.k] = newVal;
3791
+ }
3792
+ } else if (!existing.includes(refValue)) existing.push(refValue);
3606
3793
  } else if (_isString) {
3607
3794
  refs[ref] = value;
3608
3795
  if (canSetSetupRef(ref)) setupState[ref] = value;
@@ -3654,7 +3841,18 @@ var VueRuntimeDOM = (function(exports) {
3654
3841
  hasLoggedMismatchError = true;
3655
3842
  };
3656
3843
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
3657
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
3844
+ const isMathMLContainer = (container) => {
3845
+ if (!container.namespaceURI.includes("MathML")) return false;
3846
+ if (container.tagName !== "annotation-xml") return true;
3847
+ const encoding = container.getAttribute("encoding");
3848
+ return !encoding || !encoding.includes("html");
3849
+ };
3850
+ /**
3851
+ * Resolve the element namespace a container's children should be created in.
3852
+ * The live DOM is the source of truth, so this also covers containers that are
3853
+ * only known at runtime (interop boundaries, teleport targets).
3854
+ * @internal
3855
+ */
3658
3856
  const getContainerType = (container) => {
3659
3857
  if (container.nodeType !== 1) return void 0;
3660
3858
  if (isSVGContainer(container)) return "svg";
@@ -3678,7 +3876,7 @@ var VueRuntimeDOM = (function(exports) {
3678
3876
  };
3679
3877
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
3680
3878
  optimized = optimized || !!vnode.dynamicChildren;
3681
- const isFragmentStart = isComment(node) && node.data === "[";
3879
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
3682
3880
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
3683
3881
  const { type, ref, shapeFlag, patchFlag } = vnode;
3684
3882
  let domType = node.nodeType;
@@ -3692,11 +3890,12 @@ var VueRuntimeDOM = (function(exports) {
3692
3890
  let nextNode = null;
3693
3891
  switch (type) {
3694
3892
  case Text:
3695
- if (domType !== 3) if (vnode.children === "") {
3696
- insert(vnode.el = createText(""), parentNode(node), node);
3697
- nextNode = node;
3698
- } else nextNode = onMismatch();
3699
- else {
3893
+ if (domType !== 3) {
3894
+ if (vnode.children === "") {
3895
+ insert(vnode.el = createText(""), parentNode(node), node);
3896
+ nextNode = node;
3897
+ } else nextNode = onMismatch();
3898
+ } else {
3700
3899
  if (node.data !== vnode.children) {
3701
3900
  warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
3702
3901
  logMismatchError();
@@ -3733,30 +3932,35 @@ var VueRuntimeDOM = (function(exports) {
3733
3932
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3734
3933
  break;
3735
3934
  case VaporSlot:
3736
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
3935
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
3737
3936
  break;
3738
- default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
3739
- else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3740
- else if (shapeFlag & 6) {
3937
+ default: if (shapeFlag & 1) {
3938
+ if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
3939
+ else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3940
+ } else if (shapeFlag & 6) {
3741
3941
  vnode.slotScopeIds = slotScopeIds;
3742
3942
  const container = parentNode(node);
3743
3943
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
3744
3944
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
3745
3945
  else nextNode = nextSibling(node);
3746
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
3747
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3748
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3749
- let subTree;
3750
- if (isFragmentStart) {
3751
- subTree = createVNode(Fragment);
3752
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3753
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
3754
- subTree.el = node;
3755
- vnode.component.subTree = subTree;
3946
+ if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
3947
+ else {
3948
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3949
+ const component = vnode.component;
3950
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
3951
+ let subTree;
3952
+ if (isFragmentStart) {
3953
+ subTree = createVNode(Static);
3954
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3955
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
3956
+ subTree.el = node;
3957
+ component.subTree = subTree;
3958
+ }
3756
3959
  }
3757
- } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
3758
- else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
3759
- else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
3960
+ } else if (shapeFlag & 64) {
3961
+ if (domType !== 8) nextNode = onMismatch();
3962
+ else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
3963
+ } else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
3760
3964
  else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
3761
3965
  }
3762
3966
  if (ref != null) setRef(ref, null, parentSuspense, vnode);
@@ -3764,7 +3968,7 @@ var VueRuntimeDOM = (function(exports) {
3764
3968
  };
3765
3969
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
3766
3970
  optimized = optimized || !!vnode.dynamicChildren;
3767
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
3971
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
3768
3972
  const forcePatch = type === "input" || type === "option";
3769
3973
  {
3770
3974
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
@@ -3782,15 +3986,11 @@ var VueRuntimeDOM = (function(exports) {
3782
3986
  }
3783
3987
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3784
3988
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3785
- let hasWarned = false;
3989
+ if (next && !isMismatchAllowed(el, 1)) {
3990
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3991
+ logMismatchError();
3992
+ }
3786
3993
  while (next) {
3787
- if (!isMismatchAllowed(el, 1)) {
3788
- if (!hasWarned) {
3789
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3790
- hasWarned = true;
3791
- }
3792
- logMismatchError();
3793
- }
3794
3994
  const cur = next;
3795
3995
  next = next.nextSibling;
3796
3996
  remove(cur);
@@ -3809,9 +4009,13 @@ var VueRuntimeDOM = (function(exports) {
3809
4009
  }
3810
4010
  if (props) {
3811
4011
  const isCustomElement = el.tagName.includes("-");
4012
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
3812
4013
  for (const key in props) {
3813
4014
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
3814
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key], void 0, parentComponent);
4015
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4016
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
4017
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4018
+ }
3815
4019
  }
3816
4020
  }
3817
4021
  let vnodeHooks;
@@ -3829,7 +4033,7 @@ var VueRuntimeDOM = (function(exports) {
3829
4033
  optimized = optimized || !!parentVNode.dynamicChildren;
3830
4034
  const children = parentVNode.children;
3831
4035
  const l = children.length;
3832
- let hasWarned = false;
4036
+ let hasCheckedMismatch = false;
3833
4037
  for (let i = 0; i < l; i++) {
3834
4038
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3835
4039
  const isText = vnode.type === Text;
@@ -3843,12 +4047,12 @@ var VueRuntimeDOM = (function(exports) {
3843
4047
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3844
4048
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3845
4049
  else {
3846
- if (!isMismatchAllowed(container, 1)) {
3847
- if (!hasWarned) {
4050
+ if (!hasCheckedMismatch) {
4051
+ hasCheckedMismatch = true;
4052
+ if (!isMismatchAllowed(container, 1)) {
3848
4053
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3849
- hasWarned = true;
4054
+ logMismatchError();
3850
4055
  }
3851
- logMismatchError();
3852
4056
  }
3853
4057
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3854
4058
  }
@@ -3859,8 +4063,9 @@ var VueRuntimeDOM = (function(exports) {
3859
4063
  const { slotScopeIds: fragmentSlotScopeIds } = vnode;
3860
4064
  if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
3861
4065
  const container = parentNode(node);
3862
- const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
3863
- if (next && isComment(next) && next.data === "]") return nextSibling(vnode.anchor = next);
4066
+ const first = nextSibling(node);
4067
+ const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4068
+ if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
3864
4069
  else {
3865
4070
  logMismatchError();
3866
4071
  insert(vnode.anchor = createComment(`]`), container, next);
@@ -3868,8 +4073,8 @@ var VueRuntimeDOM = (function(exports) {
3868
4073
  }
3869
4074
  };
3870
4075
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
3871
- if (!isMismatchAllowed(node.parentElement, 1)) {
3872
- warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4076
+ if (!isNodeMismatchAllowed(node, vnode)) {
4077
+ warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
3873
4078
  logMismatchError();
3874
4079
  }
3875
4080
  vnode.el = null;
@@ -3885,20 +4090,22 @@ var VueRuntimeDOM = (function(exports) {
3885
4090
  const container = parentNode(node);
3886
4091
  remove(node);
3887
4092
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3888
- if (parentComponent) {
4093
+ if (parentComponent && parentComponent.vnode) {
3889
4094
  parentComponent.vnode.el = vnode.el;
3890
4095
  updateHOCHostEl(parentComponent, vnode.el);
3891
4096
  }
3892
4097
  return next;
3893
4098
  };
3894
- const locateClosingAnchor = (node, open = "[", close = "]") => {
4099
+ const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
3895
4100
  let match = 0;
3896
4101
  while (node) {
3897
4102
  node = nextSibling(node);
3898
4103
  if (node && isComment(node)) {
3899
4104
  if (node.data === open) match++;
3900
- if (node.data === close) if (match === 0) return nextSibling(node);
3901
- else match--;
4105
+ if (node.data === close) {
4106
+ if (match === 0) return nextSibling(node);
4107
+ else match--;
4108
+ }
3902
4109
  }
3903
4110
  }
3904
4111
  return node;
@@ -3908,7 +4115,7 @@ var VueRuntimeDOM = (function(exports) {
3908
4115
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
3909
4116
  let parent = parentComponent;
3910
4117
  while (parent) {
3911
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4118
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
3912
4119
  parent = parent.parent;
3913
4120
  }
3914
4121
  };
@@ -3917,6 +4124,16 @@ var VueRuntimeDOM = (function(exports) {
3917
4124
  const isTemplateNode = (node) => {
3918
4125
  return node.nodeType === 1 && node.tagName === "TEMPLATE";
3919
4126
  };
4127
+ const resourceProps = /*@__PURE__*/ new Set([
4128
+ "src",
4129
+ "srcset",
4130
+ "href",
4131
+ "poster"
4132
+ ]);
4133
+ function isUnchangedResourceProp(el, key, clientValue) {
4134
+ if (!resourceProps.has(key)) return false;
4135
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4136
+ }
3920
4137
  /**
3921
4138
  * Dev only
3922
4139
  */
@@ -3960,7 +4177,10 @@ var VueRuntimeDOM = (function(exports) {
3960
4177
  function getAttributeMismatch(el, key, clientValue) {
3961
4178
  let actual;
3962
4179
  let expected;
3963
- if (isBooleanAttr(key)) {
4180
+ if (key === "hidden") {
4181
+ actual = normalizeHiddenValue(el.getAttribute(key));
4182
+ expected = normalizeHiddenValue(clientValue);
4183
+ } else if (isBooleanAttr(key)) {
3964
4184
  actual = el.hasAttribute(key);
3965
4185
  expected = includeBooleanAttr(clientValue);
3966
4186
  } else if (clientValue == null) {
@@ -3988,6 +4208,11 @@ var VueRuntimeDOM = (function(exports) {
3988
4208
  }
3989
4209
  return false;
3990
4210
  }
4211
+ function normalizeHiddenValue(value) {
4212
+ if (!isRenderableAttrValue(value)) return false;
4213
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4214
+ return includeBooleanAttr(value) ? "" : false;
4215
+ }
3991
4216
  function toClassSet(str) {
3992
4217
  return new Set(str.trim().split(/\s+/));
3993
4218
  }
@@ -4032,7 +4257,9 @@ var VueRuntimeDOM = (function(exports) {
4032
4257
  };
4033
4258
  function isMismatchAllowed(el, allowedType) {
4034
4259
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
4035
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4260
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
4261
+ }
4262
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4036
4263
  if (allowedAttr == null) return false;
4037
4264
  else if (allowedAttr === "") return true;
4038
4265
  else {
@@ -4041,6 +4268,16 @@ var VueRuntimeDOM = (function(exports) {
4041
4268
  return list.includes(MismatchTypeString[allowedType]);
4042
4269
  }
4043
4270
  }
4271
+ function isNodeMismatchAllowed(node, vnode) {
4272
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4273
+ }
4274
+ function isMismatchAllowedByNode(node) {
4275
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
4276
+ }
4277
+ function isMismatchAllowedByVNode({ props }) {
4278
+ const allowedAttr = props && props[allowMismatchAttr];
4279
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
4280
+ }
4044
4281
  //#endregion
4045
4282
  //#region packages/runtime-core/src/hydrationStrategies.ts
4046
4283
  let requestIdleCallback;
@@ -4114,16 +4351,18 @@ var VueRuntimeDOM = (function(exports) {
4114
4351
  return teardown;
4115
4352
  };
4116
4353
  function forEachElement(node, cb) {
4117
- if (isComment(node) && node.data === "[") {
4354
+ if (isComment(node) && (node.data === "[" || node.data === "(")) {
4355
+ const open = node.data;
4356
+ const close = open === "[" ? "]" : ")";
4118
4357
  let depth = 1;
4119
4358
  let next = node.nextSibling;
4120
4359
  while (next) {
4121
4360
  if (next.nodeType === 1) {
4122
4361
  if (cb(next) === false) break;
4123
4362
  } else if (isComment(next)) {
4124
- if (next.data === "]") {
4363
+ if (next.data === close) {
4125
4364
  if (--depth === 0) break;
4126
- } else if (next.data === "[") depth++;
4365
+ } else if (next.data === open) depth++;
4127
4366
  }
4128
4367
  next = next.nextSibling;
4129
4368
  }
@@ -4132,14 +4371,14 @@ var VueRuntimeDOM = (function(exports) {
4132
4371
  //#endregion
4133
4372
  //#region packages/runtime-core/src/apiAsyncComponent.ts
4134
4373
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4135
- /* @__NO_SIDE_EFFECTS__ */
4374
+ /*@__NO_SIDE_EFFECTS__*/
4136
4375
  function defineAsyncComponent(source) {
4137
4376
  const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
4138
4377
  return /* @__PURE__ */ defineComponent({
4139
4378
  name: "AsyncComponentWrapper",
4140
4379
  __asyncLoader: load,
4141
4380
  __asyncHydrate(el, instance, hydrate) {
4142
- performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
4381
+ performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
4143
4382
  },
4144
4383
  get __asyncResolved() {
4145
4384
  return getResolvedComp();
@@ -4159,11 +4398,16 @@ var VueRuntimeDOM = (function(exports) {
4159
4398
  onError(err);
4160
4399
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4161
4400
  });
4162
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4401
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4163
4402
  load().then(() => {
4403
+ if (instance.isUnmounted) return;
4164
4404
  loaded.value = true;
4165
4405
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4166
4406
  }).catch((err) => {
4407
+ if (instance.isUnmounted) {
4408
+ setPendingRequest(null);
4409
+ return;
4410
+ }
4167
4411
  onError(err);
4168
4412
  error.value = err;
4169
4413
  });
@@ -4221,14 +4465,22 @@ var VueRuntimeDOM = (function(exports) {
4221
4465
  setPendingRequest: (request) => pendingRequest = request
4222
4466
  };
4223
4467
  }
4224
- const useAsyncComponentState = (delay, timeout, onError) => {
4468
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4225
4469
  const loaded = /* @__PURE__ */ ref(false);
4226
4470
  const error = /* @__PURE__ */ ref();
4227
4471
  const delayed = /* @__PURE__ */ ref(!!delay);
4228
- if (delay) setTimeout(() => {
4472
+ let timeoutTimer;
4473
+ let delayTimer;
4474
+ if (instance) onUnmounted(() => {
4475
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4476
+ if (delayTimer != null) clearTimeout(delayTimer);
4477
+ }, instance);
4478
+ if (delay) delayTimer = setTimeout(() => {
4479
+ if (instance && instance.isUnmounted) return;
4229
4480
  delayed.value = false;
4230
4481
  }, delay);
4231
- if (timeout != null) setTimeout(() => {
4482
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4483
+ if (instance && instance.isUnmounted) return;
4232
4484
  if (!loaded.value && !error.value) {
4233
4485
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4234
4486
  onError(err);
@@ -4245,9 +4497,10 @@ var VueRuntimeDOM = (function(exports) {
4245
4497
  * shared between core and vapor
4246
4498
  * @internal
4247
4499
  */
4248
- function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4500
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
4501
+ const wasConnected = el.isConnected;
4249
4502
  let patched = false;
4250
- (instance.bu || (instance.bu = [])).push(() => patched = true);
4503
+ if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
4251
4504
  const performHydrate = () => {
4252
4505
  if (patched) {
4253
4506
  {
@@ -4256,6 +4509,7 @@ var VueRuntimeDOM = (function(exports) {
4256
4509
  }
4257
4510
  return;
4258
4511
  }
4512
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4259
4513
  hydrate();
4260
4514
  };
4261
4515
  const doHydrate = hydrateStrategy ? () => {
@@ -4332,10 +4586,13 @@ var VueRuntimeDOM = (function(exports) {
4332
4586
  });
4333
4587
  let pendingCacheKey = null;
4334
4588
  const cacheSubtree = () => {
4335
- if (pendingCacheKey != null) if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4336
- cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4337
- }, void 0, keepAliveInstance.subTree.suspense);
4338
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4589
+ if (pendingCacheKey != null) {
4590
+ if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4591
+ const vnode = getInnerChild(keepAliveInstance.subTree);
4592
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
4593
+ }, void 0, keepAliveInstance.subTree.suspense);
4594
+ else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4595
+ }
4339
4596
  };
4340
4597
  onMounted(cacheSubtree);
4341
4598
  onUpdated(cacheSubtree);
@@ -4492,7 +4749,7 @@ var VueRuntimeDOM = (function(exports) {
4492
4749
  try {
4493
4750
  return callWithAsyncErrorHandling(hook, target, type, args);
4494
4751
  } finally {
4495
- setCurrentInstance(...prev);
4752
+ restoreCurrentInstance(prev);
4496
4753
  setActiveSub(prevSub);
4497
4754
  }
4498
4755
  });
@@ -4577,23 +4834,25 @@ var VueRuntimeDOM = (function(exports) {
4577
4834
  }
4578
4835
  ret = new Array(source.length);
4579
4836
  for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
4580
- } else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
4581
- warn$1(`The v-for range expects a positive integer value but got ${source}.`);
4582
- ret = [];
4583
- } else {
4584
- ret = new Array(source);
4585
- for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4586
- }
4587
- else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4588
- else {
4589
- const keys = Object.keys(source);
4590
- ret = new Array(keys.length);
4591
- for (let i = 0, l = keys.length; i < l; i++) {
4592
- const key = keys[i];
4593
- ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4837
+ } else if (typeof source === "number") {
4838
+ if (!Number.isInteger(source) || source < 0) {
4839
+ warn$1(`The v-for range expects a positive integer value but got ${source}.`);
4840
+ ret = [];
4841
+ } else {
4842
+ ret = new Array(source);
4843
+ for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4594
4844
  }
4595
- }
4596
- else ret = [];
4845
+ } else if (isObject(source)) {
4846
+ if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4847
+ else {
4848
+ const keys = Object.keys(source);
4849
+ ret = new Array(keys.length);
4850
+ for (let i = 0, l = keys.length; i < l; i++) {
4851
+ const key = keys[i];
4852
+ ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4853
+ }
4854
+ }
4855
+ } else ret = [];
4597
4856
  if (cache) cache[index] = ret;
4598
4857
  return ret;
4599
4858
  }
@@ -4618,37 +4877,64 @@ var VueRuntimeDOM = (function(exports) {
4618
4877
  //#endregion
4619
4878
  //#region packages/runtime-core/src/helpers/renderSlot.ts
4620
4879
  /**
4880
+ * Links a slot function to its raw vapor slot: a raw vapor slot carries
4881
+ * itself, and the wrapper the interop slots proxy hands out carries the raw
4882
+ * slot it wraps — one lookup answers both "is this a vapor slot" and
4883
+ * "which one". Internal to vapor interop.
4884
+ */
4885
+ const rawVaporSlotKey = Symbol(`rawVaporSlot`);
4886
+ /**
4621
4887
  * Compiler runtime helper for rendering `<slot/>`
4622
4888
  * @private
4623
4889
  */
4624
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4890
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4891
+ if (props == null) props = {};
4625
4892
  let slot = slots[name];
4626
- const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4893
+ const vaporSlot = slot && slot[rawVaporSlotKey];
4627
4894
  if (vaporSlot) {
4628
4895
  const ret = (openBlock(), createBlock(VaporSlot, props));
4629
4896
  ret.vs = {
4630
4897
  slot: vaporSlot,
4631
- fallback
4898
+ outlets: fallback ? [{
4899
+ fallback,
4900
+ owner: currentRenderingInstance
4901
+ }] : void 0
4632
4902
  };
4903
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4633
4904
  return ret;
4634
4905
  }
4635
4906
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
4636
- const hasProps = Object.keys(props).length > 0;
4637
- if (name !== "default") props.name = name;
4638
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
4907
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
4908
+ const hasProps = Object.keys(slotProps).length > 0;
4909
+ if (name !== "default") slotProps.name = name;
4910
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
4639
4911
  }
4640
4912
  if (slot && slot.length > 1) {
4641
4913
  warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
4642
4914
  slot = () => [];
4643
4915
  }
4644
4916
  if (slot && slot._c) slot._d = false;
4917
+ const prevStackSize = blockStack.length;
4645
4918
  openBlock();
4646
- const validSlotContent = slot && ensureValidVNode(slot(props));
4647
- ensureVaporSlotFallback(validSlotContent, fallback);
4648
- const slotKey = props.key || validSlotContent && validSlotContent.key;
4649
- const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
4919
+ let rendered;
4920
+ try {
4921
+ const validSlotContent = slot && ensureValidVNode(slot(props));
4922
+ let attached = false;
4923
+ if (fallback && validSlotContent && currentRenderingInstance) {
4924
+ const interop = currentRenderingInstance.appContext.vapor;
4925
+ if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
4926
+ }
4927
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
4928
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
4929
+ if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
4930
+ if (attached) rendered.vo = true;
4931
+ } catch (err) {
4932
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
4933
+ throw err;
4934
+ } finally {
4935
+ if (slot && slot._c) slot._d = true;
4936
+ }
4650
4937
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
4651
- if (slot && slot._c) slot._d = true;
4652
4938
  return rendered;
4653
4939
  }
4654
4940
  function ensureValidVNode(vnodes) {
@@ -4659,12 +4945,6 @@ var VueRuntimeDOM = (function(exports) {
4659
4945
  return true;
4660
4946
  }) ? vnodes : null;
4661
4947
  }
4662
- function ensureVaporSlotFallback(vnodes, fallback) {
4663
- let vaporSlot;
4664
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
4665
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
4666
- }
4667
- }
4668
4948
  //#endregion
4669
4949
  //#region packages/runtime-core/src/helpers/toHandlers.ts
4670
4950
  /**
@@ -4692,11 +4972,38 @@ var VueRuntimeDOM = (function(exports) {
4692
4972
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
4693
4973
  return getPublicInstance(i.parent);
4694
4974
  };
4975
+ const resolveDevRootEl = (vnode) => {
4976
+ let found = false;
4977
+ while (true) {
4978
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
4979
+ const root = filterSingleRoot(vnode.children);
4980
+ if (!root) return;
4981
+ vnode = root;
4982
+ found = true;
4983
+ continue;
4984
+ }
4985
+ const component = vnode.component;
4986
+ if (component && component.subTree) {
4987
+ vnode = component.subTree;
4988
+ continue;
4989
+ }
4990
+ const suspense = vnode.suspense;
4991
+ if (suspense && suspense.activeBranch) {
4992
+ vnode = suspense.activeBranch;
4993
+ continue;
4994
+ }
4995
+ return found ? vnode.el : void 0;
4996
+ }
4997
+ };
4998
+ const getDevRootFragmentEl = (i) => {
4999
+ const el = i.subTree && resolveDevRootEl(i.subTree);
5000
+ return el === void 0 ? i.vnode.el : el;
5001
+ };
4695
5002
  let publicPropertiesMap;
4696
5003
  const getPublicPropertiesMap = () => {
4697
5004
  if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
4698
5005
  $: (i) => i,
4699
- $el: (i) => i.vnode.el,
5006
+ $el: (i) => getDevRootFragmentEl(i),
4700
5007
  $data: (i) => i.data,
4701
5008
  $props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
4702
5009
  $attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
@@ -4802,7 +5109,7 @@ var VueRuntimeDOM = (function(exports) {
4802
5109
  warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
4803
5110
  return Reflect.ownKeys(target);
4804
5111
  };
4805
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
5112
+ const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
4806
5113
  get(target, key) {
4807
5114
  if (key === Symbol.unscopables) return;
4808
5115
  return PublicInstanceProxyHandlers.get(target, key, target);
@@ -4974,12 +5281,13 @@ var VueRuntimeDOM = (function(exports) {
4974
5281
  for (const key in defaults) {
4975
5282
  if (key.startsWith("__skip")) continue;
4976
5283
  let opt = props[key];
4977
- if (opt) if (isArray(opt) || isFunction(opt)) opt = props[key] = {
4978
- type: opt,
4979
- default: defaults[key]
4980
- };
4981
- else opt.default = defaults[key];
4982
- else if (opt === null) opt = props[key] = { default: defaults[key] };
5284
+ if (opt) {
5285
+ if (isArray(opt) || isFunction(opt)) opt = props[key] = {
5286
+ type: opt,
5287
+ default: defaults[key]
5288
+ };
5289
+ else opt.default = defaults[key];
5290
+ } else if (opt === null) opt = props[key] = { default: defaults[key] };
4983
5291
  else warn$1(`props default key "${key}" has no corresponding declaration.`);
4984
5292
  if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
4985
5293
  }
@@ -5034,21 +5342,29 @@ var VueRuntimeDOM = (function(exports) {
5034
5342
  setCurrentInstance(null, void 0);
5035
5343
  if (inSSRSetup) setInSSRSetupState(false);
5036
5344
  const restore = () => {
5345
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5037
5346
  setCurrentInstance(ctx);
5038
5347
  if (inSSRSetup) setInSSRSetupState(true);
5348
+ return stoppedScope;
5039
5349
  };
5040
5350
  const cleanup = () => {
5041
5351
  setCurrentInstance(null, void 0);
5042
5352
  if (inSSRSetup) setInSSRSetupState(false);
5043
5353
  };
5044
5354
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5045
- restore();
5046
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
5355
+ const stoppedScope = restore();
5356
+ Promise.resolve().then(() => Promise.resolve().then(() => {
5357
+ if (stoppedScope) stoppedScope.reset();
5358
+ cleanup();
5359
+ }));
5047
5360
  throw e;
5048
5361
  });
5049
5362
  return [awaitable, () => {
5050
- restore();
5051
- Promise.resolve().then(cleanup);
5363
+ const stoppedScope = restore();
5364
+ Promise.resolve().then(() => {
5365
+ if (stoppedScope) stoppedScope.reset();
5366
+ cleanup();
5367
+ });
5052
5368
  }];
5053
5369
  }
5054
5370
  //#endregion
@@ -5109,11 +5425,12 @@ var VueRuntimeDOM = (function(exports) {
5109
5425
  const opt = computedOptions[key];
5110
5426
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
5111
5427
  if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
5428
+ const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
5429
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
5430
+ };
5112
5431
  const c = computed({
5113
5432
  get,
5114
- set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
5115
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
5116
- }
5433
+ set
5117
5434
  });
5118
5435
  Object.defineProperty(ctx, key, {
5119
5436
  enumerable: true,
@@ -5169,9 +5486,10 @@ var VueRuntimeDOM = (function(exports) {
5169
5486
  for (const key in injectOptions) {
5170
5487
  const opt = injectOptions[key];
5171
5488
  let injected;
5172
- if (isObject(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
5173
- else injected = inject(opt.from || key);
5174
- else injected = inject(opt);
5489
+ if (isObject(opt)) {
5490
+ if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
5491
+ else injected = inject(opt.from || key);
5492
+ } else injected = inject(opt);
5175
5493
  if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
5176
5494
  enumerable: true,
5177
5495
  configurable: true,
@@ -5192,13 +5510,14 @@ var VueRuntimeDOM = (function(exports) {
5192
5510
  if (isFunction(handler)) watch(getter, handler);
5193
5511
  else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
5194
5512
  } else if (isFunction(raw)) watch(getter, raw.bind(publicThis));
5195
- else if (isObject(raw)) if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
5196
- else {
5197
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5198
- if (isFunction(handler)) watch(getter, handler, raw);
5199
- else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5200
- }
5201
- else warn$1(`Invalid watch option: "${key}"`, raw);
5513
+ else if (isObject(raw)) {
5514
+ if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
5515
+ else {
5516
+ const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5517
+ if (isFunction(handler)) watch(getter, handler, raw);
5518
+ else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5519
+ }
5520
+ } else warn$1(`Invalid watch option: "${key}"`, raw);
5202
5521
  }
5203
5522
  /**
5204
5523
  * Resolve merged options and cache it on the component.
@@ -5284,7 +5603,7 @@ var VueRuntimeDOM = (function(exports) {
5284
5603
  }
5285
5604
  function mergeEmitsOrPropsOptions(to, from) {
5286
5605
  if (to) {
5287
- if (isArray(to) && isArray(from)) return [...new Set([...to, ...from])];
5606
+ if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
5288
5607
  return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
5289
5608
  } else return from;
5290
5609
  }
@@ -5403,8 +5722,10 @@ var VueRuntimeDOM = (function(exports) {
5403
5722
  } else warn$1(`Cannot unmount an app that is not mounted.`);
5404
5723
  },
5405
5724
  provide(key, value) {
5406
- if (key in context.provides) if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
5407
- else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
5725
+ if (key in context.provides) {
5726
+ if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
5727
+ else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
5728
+ }
5408
5729
  context.provides[key] = value;
5409
5730
  return app;
5410
5731
  },
@@ -5443,13 +5764,17 @@ var VueRuntimeDOM = (function(exports) {
5443
5764
  const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
5444
5765
  const res = customRef((track, trigger) => {
5445
5766
  let localValue;
5767
+ let prevPropValue = EMPTY_OBJ;
5446
5768
  let prevSetValue = EMPTY_OBJ;
5447
5769
  let prevEmittedValue;
5448
5770
  watchSyncEffect(() => {
5449
5771
  const propValue = props[camelizedName];
5450
- if (hasChanged(localValue, propValue)) {
5451
- localValue = propValue;
5452
- trigger();
5772
+ if (hasChanged(prevPropValue, propValue)) {
5773
+ prevPropValue = propValue;
5774
+ if (hasChanged(localValue, propValue)) {
5775
+ localValue = propValue;
5776
+ trigger();
5777
+ }
5453
5778
  }
5454
5779
  });
5455
5780
  return {
@@ -5472,12 +5797,13 @@ var VueRuntimeDOM = (function(exports) {
5472
5797
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
5473
5798
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
5474
5799
  }
5475
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
5800
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
5801
+ if (!hasVModel) {
5476
5802
  localValue = value;
5477
5803
  trigger();
5478
5804
  }
5479
5805
  i.emit(`update:${name}`, emittedValue);
5480
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
5806
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
5481
5807
  prevSetValue = value;
5482
5808
  prevEmittedValue = emittedValue;
5483
5809
  }
@@ -5510,12 +5836,14 @@ var VueRuntimeDOM = (function(exports) {
5510
5836
  if (instance.isUnmounted) return;
5511
5837
  {
5512
5838
  const { emitsOptions, propsOptions } = instance;
5513
- if (emitsOptions) if (!(event in emitsOptions) && true) {
5514
- if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
5515
- } else {
5516
- const validator = emitsOptions[event];
5517
- if (isFunction(validator)) {
5518
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
5839
+ if (emitsOptions) {
5840
+ if (!(event in emitsOptions) && true) {
5841
+ if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
5842
+ } else {
5843
+ const validator = emitsOptions[event];
5844
+ if (isFunction(validator)) {
5845
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
5846
+ }
5519
5847
  }
5520
5848
  }
5521
5849
  }
@@ -5524,7 +5852,7 @@ var VueRuntimeDOM = (function(exports) {
5524
5852
  const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
5525
5853
  if (modifiers) {
5526
5854
  if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
5527
- if (modifiers.number) args = rawArgs.map(looseToNumber);
5855
+ if (modifiers.number) args = args.map(looseToNumber);
5528
5856
  }
5529
5857
  devtoolsComponentEmit(instance, event, args);
5530
5858
  {
@@ -5584,7 +5912,8 @@ var VueRuntimeDOM = (function(exports) {
5584
5912
  */
5585
5913
  function isEmitListener(options, key) {
5586
5914
  if (!options || !isOn(key)) return false;
5587
- key = key.slice(2).replace(/Once$/, "");
5915
+ key = key.slice(2);
5916
+ key = key === "Once" ? key : key.replace(/Once$/, "");
5588
5917
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
5589
5918
  }
5590
5919
  //#endregion
@@ -5650,8 +5979,9 @@ var VueRuntimeDOM = (function(exports) {
5650
5979
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
5651
5980
  }
5652
5981
  if (vnode.transition) {
5653
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5654
- setTransitionHooks(root, vnode.transition);
5982
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
5983
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
5984
+ setTransitionHooks(child, vnode.transition);
5655
5985
  }
5656
5986
  if (setRoot) setRoot(root);
5657
5987
  else result = root;
@@ -5702,18 +6032,21 @@ var VueRuntimeDOM = (function(exports) {
5702
6032
  for (let i = 0; i < children.length; i++) {
5703
6033
  const child = children[i];
5704
6034
  if (isVNode(child)) {
5705
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
5706
- else {
5707
- singleRoot = child;
5708
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
6035
+ if (child.type !== Comment || child.children === "v-if") {
6036
+ if (singleRoot) return;
6037
+ else {
6038
+ singleRoot = child;
6039
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
6040
+ }
5709
6041
  }
5710
6042
  } else return;
5711
6043
  }
5712
6044
  return singleRoot;
5713
6045
  }
6046
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
5714
6047
  const getFunctionalFallthrough = (attrs) => {
5715
6048
  let res;
5716
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
6049
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
5717
6050
  return res;
5718
6051
  };
5719
6052
  const filterModelListeners = (attrs, props) => {
@@ -5825,16 +6158,17 @@ var VueRuntimeDOM = (function(exports) {
5825
6158
  let key = propsToUpdate[i];
5826
6159
  if (isEmitListener(instance.emitsOptions, key)) continue;
5827
6160
  const value = rawProps[key];
5828
- if (options) if (hasOwn(attrs, key)) {
5829
- if (value !== attrs[key]) {
5830
- attrs[key] = value;
5831
- hasAttrsChanged = true;
6161
+ if (options) {
6162
+ if (hasOwn(attrs, key)) {
6163
+ if (value !== attrs[key]) {
6164
+ attrs[key] = value;
6165
+ hasAttrsChanged = true;
6166
+ }
6167
+ } else {
6168
+ const camelizedKey = camelize(key);
6169
+ props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
5832
6170
  }
5833
- } else {
5834
- const camelizedKey = camelize(key);
5835
- props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
5836
- }
5837
- else if (value !== attrs[key]) {
6171
+ } else if (value !== attrs[key]) {
5838
6172
  attrs[key] = value;
5839
6173
  hasAttrsChanged = true;
5840
6174
  }
@@ -5843,9 +6177,11 @@ var VueRuntimeDOM = (function(exports) {
5843
6177
  } else {
5844
6178
  if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
5845
6179
  let kebabKey;
5846
- for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
5847
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
5848
- } else delete props[key];
6180
+ for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
6181
+ if (options) {
6182
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
6183
+ } else delete props[key];
6184
+ }
5849
6185
  if (attrs !== rawCurrentProps) {
5850
6186
  for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && true) {
5851
6187
  delete attrs[key];
@@ -5864,9 +6200,10 @@ var VueRuntimeDOM = (function(exports) {
5864
6200
  if (isReservedProp(key)) continue;
5865
6201
  const value = rawProps[key];
5866
6202
  let camelKey;
5867
- if (options && hasOwn(options, camelKey = camelize(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
5868
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
5869
- else if (!isEmitListener(instance.emitsOptions, key)) {
6203
+ if (options && hasOwn(options, camelKey = camelize(key))) {
6204
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
6205
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
6206
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
5870
6207
  if (!(key in attrs) || value !== attrs[key]) {
5871
6208
  attrs[key] = value;
5872
6209
  hasAttrsChanged = true;
@@ -5913,7 +6250,7 @@ var VueRuntimeDOM = (function(exports) {
5913
6250
  const prev = setCurrentInstance(instance);
5914
6251
  const props = /* @__PURE__ */ toRaw(instance.props);
5915
6252
  value = factory.call(null, props);
5916
- setCurrentInstance(...prev);
6253
+ restoreCurrentInstance(prev);
5917
6254
  return value;
5918
6255
  }
5919
6256
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -6029,7 +6366,7 @@ var VueRuntimeDOM = (function(exports) {
6029
6366
  }
6030
6367
  if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
6031
6368
  }
6032
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
6369
+ const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
6033
6370
  /**
6034
6371
  * dev only
6035
6372
  */
@@ -6059,7 +6396,7 @@ var VueRuntimeDOM = (function(exports) {
6059
6396
  const receivedType = toRawType(value);
6060
6397
  const expectedValue = styleValue(value, expectedType);
6061
6398
  const receivedValue = styleValue(value, receivedType);
6062
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6399
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6063
6400
  message += `, got ${receivedType} `;
6064
6401
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
6065
6402
  return message;
@@ -6068,7 +6405,8 @@ var VueRuntimeDOM = (function(exports) {
6068
6405
  * dev only
6069
6406
  */
6070
6407
  function styleValue(value, type) {
6071
- if (type === "String") return `"${value}"`;
6408
+ if (isSymbol(value)) return value.toString();
6409
+ else if (type === "String") return `"${value}"`;
6072
6410
  else if (type === "Number") return `${Number(value)}`;
6073
6411
  else return `${value}`;
6074
6412
  }
@@ -6085,8 +6423,11 @@ var VueRuntimeDOM = (function(exports) {
6085
6423
  /**
6086
6424
  * dev only
6087
6425
  */
6088
- function isBoolean(...args) {
6089
- return args.some((elem) => elem.toLowerCase() === "boolean");
6426
+ function isCoercible(...args) {
6427
+ return args.every((elem) => {
6428
+ const value = elem.toLowerCase();
6429
+ return value !== "boolean" && value !== "symbol";
6430
+ });
6090
6431
  }
6091
6432
  //#endregion
6092
6433
  //#region packages/runtime-core/src/componentSlots.ts
@@ -6138,12 +6479,13 @@ var VueRuntimeDOM = (function(exports) {
6138
6479
  let deletionComparisonTarget = EMPTY_OBJ;
6139
6480
  if (vnode.shapeFlag & 32) {
6140
6481
  const type = children._;
6141
- if (type) if (isHmrUpdating) {
6142
- assignSlots(slots, children, optimized);
6143
- trigger(instance, "set", "$slots");
6144
- } else if (optimized && type === 1) needDeletionCheck = false;
6145
- else assignSlots(slots, children, optimized);
6146
- else {
6482
+ if (type) {
6483
+ if (isHmrUpdating) {
6484
+ assignSlots(slots, children, optimized);
6485
+ trigger(instance, "set", "$slots");
6486
+ } else if (optimized && type === 1) needDeletionCheck = false;
6487
+ else assignSlots(slots, children, optimized);
6488
+ } else {
6147
6489
  needDeletionCheck = !children.$stable;
6148
6490
  normalizeObjectSlots(children, slots, instance);
6149
6491
  }
@@ -6161,7 +6503,7 @@ var VueRuntimeDOM = (function(exports) {
6161
6503
  let supported;
6162
6504
  let perf;
6163
6505
  let cachedNow$1 = 0;
6164
- const p$1 = /* @__PURE__ */ Promise.resolve();
6506
+ const p$1 = /*@__PURE__*/ Promise.resolve();
6165
6507
  const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
6166
6508
  /**
6167
6509
  * @internal
@@ -6242,6 +6584,10 @@ var VueRuntimeDOM = (function(exports) {
6242
6584
  optimized = false;
6243
6585
  n2.dynamicChildren = null;
6244
6586
  }
6587
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
6588
+ if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
6589
+ n2.dynamicChildren.hasOnce = true;
6590
+ }
6245
6591
  const { type, ref, shapeFlag } = n2;
6246
6592
  switch (type) {
6247
6593
  case Text:
@@ -6258,7 +6604,7 @@ var VueRuntimeDOM = (function(exports) {
6258
6604
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6259
6605
  break;
6260
6606
  case VaporSlot:
6261
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
6607
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
6262
6608
  break;
6263
6609
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6264
6610
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -6377,7 +6723,10 @@ var VueRuntimeDOM = (function(exports) {
6377
6723
  for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
6378
6724
  };
6379
6725
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
6380
- for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6726
+ for (let i = start; i < children.length; i++) {
6727
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
6728
+ patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6729
+ }
6381
6730
  };
6382
6731
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6383
6732
  const el = n2.el = n1.el;
@@ -6389,9 +6738,10 @@ var VueRuntimeDOM = (function(exports) {
6389
6738
  let vnodeHook;
6390
6739
  parentComponent && toggleRecurse(parentComponent, false);
6391
6740
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6741
+ if (n2.ibu) n2.ibu();
6392
6742
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6393
6743
  parentComponent && toggleRecurse(parentComponent, true);
6394
- if (isHmrUpdating) {
6744
+ if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
6395
6745
  patchFlag = 0;
6396
6746
  optimized = false;
6397
6747
  dynamicChildren = null;
@@ -6422,8 +6772,9 @@ var VueRuntimeDOM = (function(exports) {
6422
6772
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
6423
6773
  }
6424
6774
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
6425
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
6775
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
6426
6776
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6777
+ n2.iu && n2.iu();
6427
6778
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
6428
6779
  }, void 0, parentSuspense);
6429
6780
  };
@@ -6431,7 +6782,8 @@ var VueRuntimeDOM = (function(exports) {
6431
6782
  for (let i = 0; i < newChildren.length; i++) {
6432
6783
  const oldVNode = oldChildren[i];
6433
6784
  const newVNode = newChildren[i];
6434
- patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6785
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
6786
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6435
6787
  }
6436
6788
  };
6437
6789
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -6469,25 +6821,15 @@ var VueRuntimeDOM = (function(exports) {
6469
6821
  };
6470
6822
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6471
6823
  n2.slotScopeIds = slotScopeIds;
6472
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
6473
- else {
6474
- getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
6475
- if (n2.dirs) {
6476
- invokeDirectiveHook(n2, null, parentComponent, "created");
6477
- invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
6478
- }
6479
- });
6480
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
6481
- }
6482
- else {
6483
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
6484
- if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6485
- });
6486
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
6487
- }
6488
- else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
6489
- else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
6490
- else updateComponent(n1, n2, optimized);
6824
+ if (n2.type.__vapor) {
6825
+ if (n1 == null) {
6826
+ if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
6827
+ else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
6828
+ } else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
6829
+ } else if (n1 == null) {
6830
+ if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
6831
+ else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
6832
+ } else updateComponent(n1, n2, optimized);
6491
6833
  };
6492
6834
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
6493
6835
  const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
@@ -6528,16 +6870,18 @@ var VueRuntimeDOM = (function(exports) {
6528
6870
  };
6529
6871
  const updateComponent = (n1, n2, optimized) => {
6530
6872
  const instance = n2.component = n1.component;
6531
- if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
6532
- pushWarningContext(n2);
6533
- updateComponentPreRender(instance, n2, optimized);
6534
- popWarningContext();
6535
- return;
6873
+ if (shouldUpdateComponent(n1, n2, optimized)) {
6874
+ if (instance.asyncDep && !instance.asyncResolved) {
6875
+ pushWarningContext(n2);
6876
+ n2.el = n1.el;
6877
+ updateComponentPreRender(instance, n2, optimized);
6878
+ popWarningContext();
6879
+ return;
6880
+ } else {
6881
+ instance.next = n2;
6882
+ instance.effect.run();
6883
+ }
6536
6884
  } else {
6537
- instance.next = n2;
6538
- instance.effect.run();
6539
- }
6540
- else {
6541
6885
  n2.el = n1.el;
6542
6886
  instance.vnode = n2;
6543
6887
  }
@@ -6635,6 +6979,7 @@ var VueRuntimeDOM = (function(exports) {
6635
6979
  } else next = vnode;
6636
6980
  if (bu) invokeArrayFns(bu);
6637
6981
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
6982
+ if (next.ibu) next.ibu();
6638
6983
  toggleRecurse(instance, true);
6639
6984
  startMeasure(instance, `render`);
6640
6985
  const nextTree = renderComponentRoot(instance);
@@ -6647,7 +6992,10 @@ var VueRuntimeDOM = (function(exports) {
6647
6992
  next.el = nextTree.el;
6648
6993
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
6649
6994
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
6650
- if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), void 0, parentSuspense);
6995
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
6996
+ vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
6997
+ next.iu && next.iu();
6998
+ }, void 0, parentSuspense);
6651
6999
  devtoolsComponentUpdated(instance);
6652
7000
  popWarningContext();
6653
7001
  }
@@ -6687,9 +7035,10 @@ var VueRuntimeDOM = (function(exports) {
6687
7035
  if (shapeFlag & 8) {
6688
7036
  if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
6689
7037
  if (c2 !== c1) hostSetElementText(container, c2);
6690
- } else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6691
- else unmountChildren(c1, parentComponent, parentSuspense, true);
6692
- else {
7038
+ } else if (prevShapeFlag & 16) {
7039
+ if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7040
+ else unmountChildren(c1, parentComponent, parentSuspense, true);
7041
+ } else {
6693
7042
  if (prevShapeFlag & 8) hostSetElementText(container, "");
6694
7043
  if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6695
7044
  }
@@ -6788,15 +7137,17 @@ var VueRuntimeDOM = (function(exports) {
6788
7137
  const anchorVNode = c2[nextIndex + 1];
6789
7138
  const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
6790
7139
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6791
- else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
6792
- else j--;
7140
+ else if (moved) {
7141
+ if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
7142
+ else j--;
7143
+ }
6793
7144
  }
6794
7145
  }
6795
7146
  };
6796
7147
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
6797
7148
  const { el, type, transition, children, shapeFlag } = vnode;
6798
7149
  if (isVaporComponent(type) || type === VaporSlot) {
6799
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
7150
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
6800
7151
  return;
6801
7152
  }
6802
7153
  if (shapeFlag & 6) {
@@ -6821,49 +7172,37 @@ var VueRuntimeDOM = (function(exports) {
6821
7172
  moveStaticNode(vnode, container, anchor);
6822
7173
  return;
6823
7174
  }
6824
- if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
6825
- else {
6826
- const { leave, delayLeave, afterLeave } = transition;
6827
- const remove = () => {
7175
+ if (moveType !== 2 && shapeFlag & 1 && transition) {
7176
+ if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
7177
+ else performTransitionLeave(el, transition, () => {
6828
7178
  if (vnode.ctx.isUnmounted) hostRemove(el);
6829
7179
  else hostInsert(el, container, anchor);
6830
- };
6831
- const performLeave = () => {
6832
- if (el._isLeaving) el[leaveCbKey](true);
6833
- leave(el, () => {
6834
- remove();
6835
- afterLeave && afterLeave();
6836
- });
6837
- };
6838
- if (delayLeave) delayLeave(el, remove, performLeave);
6839
- else performLeave();
6840
- }
6841
- else hostInsert(el, container, anchor);
7180
+ }, true, true);
7181
+ } else hostInsert(el, container, anchor);
6842
7182
  };
6843
7183
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
6844
7184
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
6845
- if (patchFlag === -2) optimized = false;
7185
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
6846
7186
  if (ref != null) {
6847
7187
  const prevSub = setActiveSub();
6848
7188
  setRef(ref, null, parentSuspense, vnode, true);
6849
7189
  setActiveSub(prevSub);
6850
7190
  }
6851
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
7191
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
6852
7192
  if (shapeFlag & 256) {
6853
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
7193
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
6854
7194
  else parentComponent.ctx.deactivate(vnode);
6855
7195
  return;
6856
7196
  }
7197
+ if (shapeFlag & 6 && isVaporComponent(type)) {
7198
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7199
+ return;
7200
+ }
6857
7201
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
6858
7202
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
6859
7203
  let vnodeHook;
6860
7204
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
6861
- if (shapeFlag & 6) if (isVaporComponent(type)) {
6862
- if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
6863
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
6864
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
6865
- return;
6866
- } else unmountComponent(vnode.component, parentSuspense, doRemove);
7205
+ if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
6867
7206
  else {
6868
7207
  if (shapeFlag & 128) {
6869
7208
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -6874,7 +7213,7 @@ var VueRuntimeDOM = (function(exports) {
6874
7213
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
6875
7214
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
6876
7215
  if (type === VaporSlot) {
6877
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7216
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
6878
7217
  return;
6879
7218
  }
6880
7219
  if (doRemove) remove(vnode);
@@ -6898,6 +7237,7 @@ var VueRuntimeDOM = (function(exports) {
6898
7237
  }
6899
7238
  if (type === Static) {
6900
7239
  removeStaticNode(vnode);
7240
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
6901
7241
  return;
6902
7242
  }
6903
7243
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -6922,6 +7262,9 @@ var VueRuntimeDOM = (function(exports) {
6922
7262
  if (effect) {
6923
7263
  effect.stop();
6924
7264
  unmount(subTree, instance, parentSuspense, doRemove);
7265
+ } else if (instance.vnode.el && subTree) {
7266
+ subTree.transition = instance.vnode.transition;
7267
+ unmount(subTree, instance, parentSuspense, doRemove);
6925
7268
  }
6926
7269
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
6927
7270
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
@@ -6996,12 +7339,14 @@ var VueRuntimeDOM = (function(exports) {
6996
7339
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
6997
7340
  }
6998
7341
  function toggleRecurse({ effect, job, vapor }, allowed) {
6999
- if (!vapor) if (allowed) {
7000
- effect.flags |= 128;
7001
- job.flags |= 2;
7002
- } else {
7003
- effect.flags &= -129;
7004
- job.flags &= -3;
7342
+ if (!vapor) {
7343
+ if (allowed) {
7344
+ effect.flags |= 128;
7345
+ job.flags |= 2;
7346
+ } else {
7347
+ effect.flags &= -129;
7348
+ job.flags &= -3;
7349
+ }
7005
7350
  }
7006
7351
  }
7007
7352
  function needTransition(parentSuspense, transition) {
@@ -7041,13 +7386,19 @@ var VueRuntimeDOM = (function(exports) {
7041
7386
  }
7042
7387
  function locateNonHydratedAsyncRoot(instance) {
7043
7388
  const subComponent = instance.subTree && instance.subTree.component;
7044
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
7045
- else return locateNonHydratedAsyncRoot(subComponent);
7389
+ if (subComponent) {
7390
+ if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
7391
+ else return locateNonHydratedAsyncRoot(subComponent);
7392
+ }
7046
7393
  }
7047
7394
  function invalidateMount(hooks) {
7048
7395
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7049
7396
  }
7050
7397
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7398
+ if (force && transition.persisted && !el[leaveCbKey]) {
7399
+ insert();
7400
+ return;
7401
+ }
7051
7402
  if (force || needTransition(parentSuspense, transition)) {
7052
7403
  transition.beforeEnter(el);
7053
7404
  insert();
@@ -7057,13 +7408,15 @@ var VueRuntimeDOM = (function(exports) {
7057
7408
  function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
7058
7409
  const performRemove = () => {
7059
7410
  remove();
7060
- if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7411
+ if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
7061
7412
  };
7062
7413
  if (force || isElement && transition && !transition.persisted) {
7063
7414
  const { leave, delayLeave } = transition;
7064
7415
  const performLeave = () => {
7416
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
7065
7417
  if (el._isLeaving && force) el[leaveCbKey](true);
7066
- leave(el, performRemove);
7418
+ if (force && transition.persisted && !wasLeaving) remove();
7419
+ else leave(el, performRemove);
7067
7420
  };
7068
7421
  if (delayLeave) delayLeave(el, performRemove, performLeave);
7069
7422
  else performLeave();
@@ -7082,7 +7435,7 @@ var VueRuntimeDOM = (function(exports) {
7082
7435
  /**
7083
7436
  * shared between vdom and vapor
7084
7437
  */
7085
- function getInheritedScopeIds(vnode, parentComponent) {
7438
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
7086
7439
  const inheritedScopeIds = [];
7087
7440
  let currentParent = parentComponent;
7088
7441
  let currentVNode = vnode;
@@ -7098,6 +7451,8 @@ var VueRuntimeDOM = (function(exports) {
7098
7451
  currentParent = currentParent.parent;
7099
7452
  } else break;
7100
7453
  }
7454
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
7455
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
7101
7456
  return inheritedScopeIds;
7102
7457
  }
7103
7458
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -7116,7 +7471,7 @@ var VueRuntimeDOM = (function(exports) {
7116
7471
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7117
7472
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
7118
7473
  else {
7119
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
7474
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7120
7475
  n2.suspense = n1.suspense;
7121
7476
  n2.suspense.vnode = n2;
7122
7477
  n2.el = n1.el;
@@ -7154,10 +7509,12 @@ var VueRuntimeDOM = (function(exports) {
7154
7509
  if (pendingBranch) {
7155
7510
  suspense.pendingBranch = newBranch;
7156
7511
  if (isSameVNodeType(pendingBranch, newBranch)) {
7157
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7512
+ suspense.deps++;
7513
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7514
+ suspense.deps--;
7158
7515
  if (suspense.deps <= 0) suspense.resolve();
7159
7516
  else if (isInFallback) {
7160
- if (!isHydrating) {
7517
+ if (!isHydrating && !suspense.isFallbackMountPending) {
7161
7518
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7162
7519
  setActiveBranch(suspense, newFallback);
7163
7520
  }
@@ -7169,12 +7526,16 @@ var VueRuntimeDOM = (function(exports) {
7169
7526
  suspense.activeBranch = pendingBranch;
7170
7527
  } else unmount(pendingBranch, parentComponent, suspense);
7171
7528
  suspense.deps = 0;
7529
+ for (let i = 0; i < suspense.effects.length; i++) {
7530
+ const effect = suspense.effects[i];
7531
+ if (effect.flags & 8) queuePostFlushCb(effect);
7532
+ }
7172
7533
  suspense.effects.length = 0;
7173
7534
  suspense.hiddenContainer = createElement("div");
7174
7535
  if (isInFallback) {
7175
7536
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7176
7537
  if (suspense.deps <= 0) suspense.resolve();
7177
- else {
7538
+ else if (!suspense.isFallbackMountPending) {
7178
7539
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7179
7540
  setActiveBranch(suspense, newFallback);
7180
7541
  }
@@ -7250,15 +7611,19 @@ var VueRuntimeDOM = (function(exports) {
7250
7611
  if (suspense.isHydrating) suspense.isHydrating = false;
7251
7612
  else if (!resume) {
7252
7613
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7614
+ let hasUpdatedAnchor = false;
7253
7615
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7254
7616
  if (pendingId === suspense.pendingId) {
7255
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7617
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7256
7618
  queuePostFlushCb(effects);
7257
7619
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7258
7620
  }
7259
7621
  };
7260
7622
  if (activeBranch && !suspense.isFallbackMountPending) {
7261
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
7623
+ if (parentNode(activeBranch.el) === container) {
7624
+ anchor = next(activeBranch);
7625
+ hasUpdatedAnchor = true;
7626
+ }
7262
7627
  unmount(activeBranch, parentComponent, suspense, true);
7263
7628
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7264
7629
  }
@@ -7272,7 +7637,7 @@ var VueRuntimeDOM = (function(exports) {
7272
7637
  let hasUnresolvedAncestor = false;
7273
7638
  while (parent) {
7274
7639
  if (parent.pendingBranch) {
7275
- parent.effects.push(...effects);
7640
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
7276
7641
  hasUnresolvedAncestor = true;
7277
7642
  break;
7278
7643
  }
@@ -7282,6 +7647,7 @@ var VueRuntimeDOM = (function(exports) {
7282
7647
  suspense.effects = [];
7283
7648
  if (isSuspensible) {
7284
7649
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
7650
+ parentSuspenseId = void 0;
7285
7651
  parentSuspense.deps--;
7286
7652
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
7287
7653
  }
@@ -7296,8 +7662,9 @@ var VueRuntimeDOM = (function(exports) {
7296
7662
  const mountFallback = () => {
7297
7663
  suspense.isFallbackMountPending = false;
7298
7664
  if (!suspense.isInFallback) return;
7299
- patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7300
- setActiveBranch(suspense, fallbackVNode);
7665
+ const latestFallback = suspense.vnode.ssFallback;
7666
+ patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7667
+ setActiveBranch(suspense, latestFallback);
7301
7668
  };
7302
7669
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
7303
7670
  if (delayEnter) {
@@ -7318,10 +7685,16 @@ var VueRuntimeDOM = (function(exports) {
7318
7685
  registerDep(instance, onResolve) {
7319
7686
  const isInPendingSuspense = !!suspense.pendingBranch;
7320
7687
  if (isInPendingSuspense) suspense.deps++;
7688
+ const hydratedEl = instance.vnode && instance.vnode.el;
7321
7689
  instance.asyncDep.catch((err) => {
7322
7690
  handleError(err, instance, 0);
7323
7691
  }).then((asyncSetupResult) => {
7324
7692
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7693
+ setCurrentInstance(null, void 0);
7694
+ if (hydratedEl && !instance.scope.active) {
7695
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7696
+ return;
7697
+ }
7325
7698
  instance.asyncResolved = true;
7326
7699
  onResolve(asyncSetupResult);
7327
7700
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -7372,9 +7745,10 @@ var VueRuntimeDOM = (function(exports) {
7372
7745
  return s;
7373
7746
  }
7374
7747
  function queueEffectWithSuspense(fn, id, suspense) {
7375
- if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
7376
- else suspense.effects.push(fn);
7377
- else queuePostFlushCb(fn, id);
7748
+ if (suspense && suspense.pendingBranch) {
7749
+ if (isArray(fn)) suspense.effects.push(...fn);
7750
+ else suspense.effects.push(fn);
7751
+ } else queuePostFlushCb(fn, id);
7378
7752
  }
7379
7753
  function setActiveBranch(suspense, branch) {
7380
7754
  suspense.activeBranch = branch;
@@ -7541,9 +7915,24 @@ var VueRuntimeDOM = (function(exports) {
7541
7915
  if (shapeFlag & 128) type.normalize(vnode);
7542
7916
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
7543
7917
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
7918
+ if (props && vnode.shapeFlag & 1) {
7919
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
7920
+ if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
7921
+ }
7544
7922
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
7545
7923
  return vnode;
7546
7924
  }
7925
+ /**
7926
+ * dev only
7927
+ * Whether children would actually render something. Empty text and empty
7928
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
7929
+ * for `v-html` / `v-text`.
7930
+ */
7931
+ function hasContentChildren(children) {
7932
+ if (isString(children)) return children !== "";
7933
+ if (isArray(children)) return children.length > 0;
7934
+ return false;
7935
+ }
7547
7936
  const createVNode = createVNodeWithArgsTransform;
7548
7937
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
7549
7938
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -7553,8 +7942,10 @@ var VueRuntimeDOM = (function(exports) {
7553
7942
  if (isVNode(type)) {
7554
7943
  const cloned = cloneVNode(type, props, true);
7555
7944
  if (children) normalizeChildren(cloned, children);
7556
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
7557
- else currentBlock.push(cloned);
7945
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
7946
+ if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
7947
+ else currentBlock.push(cloned);
7948
+ }
7558
7949
  cloned.patchFlag = -2;
7559
7950
  return cloned;
7560
7951
  }
@@ -7611,11 +8002,31 @@ var VueRuntimeDOM = (function(exports) {
7611
8002
  el: vnode.el,
7612
8003
  anchor: vnode.anchor,
7613
8004
  ctx: vnode.ctx,
7614
- ce: vnode.ce
8005
+ ce: vnode.ce,
8006
+ vi: vnode.vi,
8007
+ vs: cloneVaporSlotMeta(vnode),
8008
+ vb: vnode.vb,
8009
+ ibu: vnode.ibu,
8010
+ iu: vnode.iu,
8011
+ cacheIndex: vnode.cacheIndex
7615
8012
  };
7616
8013
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7617
8014
  return cloned;
7618
8015
  }
8016
+ function cloneVaporSlotMeta(vnode) {
8017
+ const vaporSlot = vnode.vs;
8018
+ if (!vaporSlot) return vaporSlot;
8019
+ const cloned = {
8020
+ slot: vaporSlot.slot,
8021
+ outlets: vaporSlot.outlets
8022
+ };
8023
+ if (vnode.el) {
8024
+ cloned.state = vaporSlot.state;
8025
+ cloned.ref = vaporSlot.ref;
8026
+ cloned.scope = vaporSlot.scope;
8027
+ }
8028
+ return cloned;
8029
+ }
7619
8030
  /**
7620
8031
  * Dev only, for HMR of hoisted vnodes reused in v-for
7621
8032
  * https://github.com/vitejs/vite/issues/2022
@@ -7659,25 +8070,32 @@ var VueRuntimeDOM = (function(exports) {
7659
8070
  const { shapeFlag } = vnode;
7660
8071
  if (children == null) children = null;
7661
8072
  else if (isArray(children)) type = 16;
7662
- else if (typeof children === "object") if (shapeFlag & 65) {
7663
- const slot = children.default;
7664
- if (slot) {
7665
- slot._c && (slot._d = false);
7666
- normalizeChildren(vnode, slot());
7667
- slot._c && (slot._d = true);
8073
+ else if (typeof children === "object") {
8074
+ if (shapeFlag & 65) {
8075
+ const slot = children.default;
8076
+ if (slot) {
8077
+ slot._c && (slot._d = false);
8078
+ normalizeChildren(vnode, slot());
8079
+ slot._c && (slot._d = true);
8080
+ }
8081
+ return;
8082
+ } else {
8083
+ type = 32;
8084
+ const slotFlag = children._;
8085
+ if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
8086
+ else if (slotFlag === 3 && currentRenderingInstance) {
8087
+ if (currentRenderingInstance.slots._ === 1) children._ = 1;
8088
+ else {
8089
+ children._ = 2;
8090
+ vnode.patchFlag |= 1024;
8091
+ }
8092
+ }
7668
8093
  }
7669
- return;
7670
- } else {
7671
- type = 32;
7672
- const slotFlag = children._;
7673
- if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
7674
- else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
7675
- else {
7676
- children._ = 2;
7677
- vnode.patchFlag |= 1024;
8094
+ } else if (isFunction(children)) {
8095
+ if (shapeFlag & 65) {
8096
+ normalizeChildren(vnode, { default: children });
8097
+ return;
7678
8098
  }
7679
- }
7680
- else if (isFunction(children)) {
7681
8099
  children = {
7682
8100
  default: children,
7683
8101
  _ctx: currentRenderingInstance
@@ -7741,6 +8159,16 @@ var VueRuntimeDOM = (function(exports) {
7741
8159
  simpleSetCurrentInstance(instance);
7742
8160
  }
7743
8161
  };
8162
+ /**
8163
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
8164
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
8165
+ * verbatim instead of re-triggering the `instance.scope` default.
8166
+ * @internal
8167
+ */
8168
+ const restoreCurrentInstance = (prev) => {
8169
+ setCurrentScope(prev[1]);
8170
+ simpleSetCurrentInstance(prev[0]);
8171
+ };
7744
8172
  const internalOptions = [
7745
8173
  "ce",
7746
8174
  "type",
@@ -7772,7 +8200,7 @@ var VueRuntimeDOM = (function(exports) {
7772
8200
  };
7773
8201
  //#endregion
7774
8202
  //#region packages/runtime-core/src/component.ts
7775
- const emptyAppContext = /* @__PURE__ */ createAppContext();
8203
+ const emptyAppContext = /*@__PURE__*/ createAppContext();
7776
8204
  let uid = 0;
7777
8205
  function createComponentInstance(vnode, parent, suspense) {
7778
8206
  const type = vnode.type;
@@ -7892,7 +8320,7 @@ var VueRuntimeDOM = (function(exports) {
7892
8320
  const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
7893
8321
  const isAsyncSetup = isPromise(setupResult);
7894
8322
  setActiveSub(prevSub);
7895
- setCurrentInstance(...prev);
8323
+ restoreCurrentInstance(prev);
7896
8324
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
7897
8325
  if (isAsyncSetup) {
7898
8326
  const unsetCurrentInstance = () => {
@@ -7900,7 +8328,12 @@ var VueRuntimeDOM = (function(exports) {
7900
8328
  };
7901
8329
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7902
8330
  if (isSSR) return setupResult.then((resolvedResult) => {
7903
- handleSetupResult(instance, resolvedResult, isSSR);
8331
+ setInSSRSetupState(true);
8332
+ try {
8333
+ handleSetupResult(instance, resolvedResult, isSSR);
8334
+ } finally {
8335
+ setInSSRSetupState(false);
8336
+ }
7904
8337
  }).catch((e) => {
7905
8338
  handleError(e, instance, 0);
7906
8339
  });
@@ -7961,13 +8394,15 @@ var VueRuntimeDOM = (function(exports) {
7961
8394
  applyOptions(instance);
7962
8395
  } finally {
7963
8396
  setActiveSub(prevSub);
7964
- setCurrentInstance(...prevInstance);
8397
+ restoreCurrentInstance(prevInstance);
7965
8398
  }
7966
8399
  }
7967
- if (!Component.render && instance.render === NOOP && !isSSR) if (!compile && Component.template)
8400
+ if (!Component.render && instance.render === NOOP && !isSSR) {
8401
+ if (!compile && Component.template)
7968
8402
  /* v8 ignore start */
7969
- warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.global.js\" instead.");
7970
- else warn$1(`Component is missing template or render function: `, Component);
8403
+ warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.global.js\" instead.");
8404
+ else warn$1(`Component is missing template or render function: `, Component);
8405
+ }
7971
8406
  }
7972
8407
  const attrsProxyHandlers = {
7973
8408
  get(target, key) {
@@ -8030,14 +8465,13 @@ var VueRuntimeDOM = (function(exports) {
8030
8465
  if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
8031
8466
  get(target, key) {
8032
8467
  if (key in target) return target[key];
8033
- else {
8468
+ else if (!instance.vapor) {
8034
8469
  const publicPropertiesMap = getPublicPropertiesMap();
8035
8470
  if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
8036
8471
  }
8037
8472
  },
8038
8473
  has(target, key) {
8039
- const publicPropertiesMap = getPublicPropertiesMap();
8040
- return key in target || key in publicPropertiesMap;
8474
+ return key in target || !instance.vapor && key in getPublicPropertiesMap();
8041
8475
  }
8042
8476
  }));
8043
8477
  else return instance.proxy;
@@ -8075,11 +8509,12 @@ var VueRuntimeDOM = (function(exports) {
8075
8509
  try {
8076
8510
  setBlockTracking(-1);
8077
8511
  const l = arguments.length;
8078
- if (l === 2) if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8079
- if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
8080
- return createVNode(type, propsOrChildren);
8081
- } else return createVNode(type, null, propsOrChildren);
8082
- else {
8512
+ if (l === 2) {
8513
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8514
+ if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
8515
+ return createVNode(type, propsOrChildren);
8516
+ } else return createVNode(type, null, propsOrChildren);
8517
+ } else {
8083
8518
  if (l > 3) children = Array.prototype.slice.call(arguments, 2);
8084
8519
  else if (l === 3 && isVNode(children)) children = [children];
8085
8520
  return createVNode(type, propsOrChildren, children);
@@ -8271,7 +8706,7 @@ var VueRuntimeDOM = (function(exports) {
8271
8706
  }
8272
8707
  //#endregion
8273
8708
  //#region packages/runtime-core/src/index.ts
8274
- const version = "3.6.0-beta.9";
8709
+ const version = "3.6.0-rc.10";
8275
8710
  const warn = warn$1;
8276
8711
  /**
8277
8712
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8299,7 +8734,7 @@ var VueRuntimeDOM = (function(exports) {
8299
8734
  let policy = void 0;
8300
8735
  const tt = typeof window !== "undefined" && window.trustedTypes;
8301
8736
  if (tt) try {
8302
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
8737
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
8303
8738
  } catch (e) {
8304
8739
  warn(`Error creating trusted types policy: ${e}`);
8305
8740
  }
@@ -8307,7 +8742,7 @@ var VueRuntimeDOM = (function(exports) {
8307
8742
  const svgNS = "http://www.w3.org/2000/svg";
8308
8743
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
8309
8744
  const doc = typeof document !== "undefined" ? document : null;
8310
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
8745
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
8311
8746
  const nodeOps = {
8312
8747
  insert: (child, parent, anchor) => {
8313
8748
  parent.insertBefore(child, anchor || null);
@@ -8381,7 +8816,7 @@ var VueRuntimeDOM = (function(exports) {
8381
8816
  leaveActiveClass: String,
8382
8817
  leaveToClass: String
8383
8818
  };
8384
- const TransitionPropsValidators = /* @__PURE__ */ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
8819
+ const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
8385
8820
  /**
8386
8821
  * Wrap logic that attaches extra properties to Transition in a function
8387
8822
  * so that it can be annotated as pure
@@ -8395,7 +8830,7 @@ var VueRuntimeDOM = (function(exports) {
8395
8830
  * DOM Transition is a higher-order-component based on the platform-agnostic
8396
8831
  * base Transition component, with DOM-specific logic.
8397
8832
  */
8398
- const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
8833
+ const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
8399
8834
  /**
8400
8835
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
8401
8836
  * with custom HOCs.
@@ -8617,14 +9052,15 @@ var VueRuntimeDOM = (function(exports) {
8617
9052
  },
8618
9053
  updated(el, { value, oldValue }, { transition }) {
8619
9054
  if (!value === !oldValue) return;
8620
- if (transition) if (value) {
8621
- transition.beforeEnter(el);
8622
- setDisplay(el, true);
8623
- transition.enter(el);
8624
- } else transition.leave(el, () => {
8625
- setDisplay(el, false);
8626
- });
8627
- else setDisplay(el, value);
9055
+ if (transition) {
9056
+ if (value) {
9057
+ transition.beforeEnter(el);
9058
+ setDisplay(el, true);
9059
+ transition.enter(el);
9060
+ } else transition.leave(el, () => {
9061
+ setDisplay(el, false);
9062
+ });
9063
+ } else setDisplay(el, value);
8628
9064
  },
8629
9065
  beforeUnmount(el, { value }) {
8630
9066
  setDisplay(el, value);
@@ -8643,49 +9079,20 @@ var VueRuntimeDOM = (function(exports) {
8643
9079
  */
8644
9080
  function useCssVars(getter) {
8645
9081
  const instance = getCurrentInstance();
8646
- const getVars = () => getter(instance.proxy);
8647
- const setVars = (vars) => {
8648
- if (instance.ce) setVarsOnNode(instance.ce, vars);
8649
- else setVarsOnVNode(instance.subTree, vars);
8650
- };
8651
- baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
8652
- }
8653
- function setVarsOnVNode(vnode, vars) {
8654
- if (vnode.shapeFlag & 128) {
8655
- const suspense = vnode.suspense;
8656
- vnode = suspense.activeBranch;
8657
- if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
8658
- setVarsOnVNode(suspense.activeBranch, vars);
8659
- });
8660
- }
8661
- while (vnode.component) vnode = vnode.component.subTree;
8662
- if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
8663
- else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
8664
- else if (vnode.type === Static) {
8665
- let { el, anchor } = vnode;
8666
- while (el) {
8667
- setVarsOnNode(el, vars);
8668
- if (el === anchor) break;
8669
- el = el.nextSibling;
8670
- }
8671
- }
8672
- }
8673
- /**
8674
- * @internal
8675
- * shared between vdom and vapor
8676
- */
8677
- function baseUseCssVars(instance, getParentNode, getVars, setVars) {
8678
9082
  /* v8 ignore start */
8679
9083
  if (!instance) {
8680
9084
  warn(`useCssVars is called without current active component instance.`);
8681
9085
  return;
8682
9086
  }
9087
+ /* v8 ignore stop */
9088
+ const getVars = () => getter(instance.proxy);
8683
9089
  instance.getCssVars = getVars;
8684
9090
  const updateTeleports = instance.ut = (vars = getVars()) => {
8685
9091
  Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
8686
9092
  };
8687
9093
  const applyCssVars = (vars = getVars()) => {
8688
- setVars(vars);
9094
+ if (instance.ce) setVarsOnNode(instance.ce, vars);
9095
+ else setVarsOnVNode(instance.subTree, vars);
8689
9096
  updateTeleports(vars);
8690
9097
  };
8691
9098
  onBeforeUpdate(() => {
@@ -8698,10 +9105,38 @@ var VueRuntimeDOM = (function(exports) {
8698
9105
  applyCssVars(vars);
8699
9106
  }, NOOP, { flush: "post" });
8700
9107
  const ob = new MutationObserver(() => applyCssVars());
8701
- ob.observe(getParentNode(), { childList: true });
9108
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
8702
9109
  onUnmounted(() => ob.disconnect());
8703
9110
  });
8704
9111
  }
9112
+ function setVarsOnVNode(vnode, vars) {
9113
+ if (vnode.shapeFlag & 128) {
9114
+ const suspense = vnode.suspense;
9115
+ vnode = suspense.activeBranch;
9116
+ if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
9117
+ setVarsOnVNode(suspense.activeBranch, vars);
9118
+ });
9119
+ }
9120
+ while (vnode.component) {
9121
+ const component = vnode.component;
9122
+ if (component.vapor) {
9123
+ component.appContext.vapor.applyCssVars(vnode, vars);
9124
+ return;
9125
+ }
9126
+ vnode = vnode.component.subTree;
9127
+ }
9128
+ if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
9129
+ else if (vnode.vb) vnode.ctx.appContext.vapor.applyCssVars(vnode, vars);
9130
+ else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
9131
+ else if (vnode.type === Static) {
9132
+ let { el, anchor } = vnode;
9133
+ while (el) {
9134
+ setVarsOnNode(el, vars);
9135
+ if (el === anchor) break;
9136
+ el = el.nextSibling;
9137
+ }
9138
+ }
9139
+ }
8705
9140
  /**
8706
9141
  * @internal
8707
9142
  * shared between vdom and vapor
@@ -8726,15 +9161,20 @@ var VueRuntimeDOM = (function(exports) {
8726
9161
  const isCssString = isString(next);
8727
9162
  let hasControlledDisplay = false;
8728
9163
  if (next && !isCssString) {
8729
- if (prev) if (!isString(prev)) {
8730
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
8731
- } else for (const prevStyle of prev.split(";")) {
8732
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
8733
- if (next[key] == null) setStyle(style, key, "");
9164
+ if (prev) {
9165
+ if (!isString(prev)) {
9166
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
9167
+ } else for (const prevStyle of prev.split(";")) {
9168
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
9169
+ if (next[key] == null) setStyle(style, key, "");
9170
+ }
8734
9171
  }
8735
9172
  for (const key in next) {
8736
9173
  if (key === "display") hasControlledDisplay = true;
8737
- setStyle(style, key, next[key]);
9174
+ const value = next[key];
9175
+ if (value != null) {
9176
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
9177
+ } else setStyle(style, key, "");
8738
9178
  }
8739
9179
  } else if (isCssString) {
8740
9180
  if (prev !== next) {
@@ -8743,7 +9183,11 @@ var VueRuntimeDOM = (function(exports) {
8743
9183
  style.cssText = next;
8744
9184
  hasControlledDisplay = displayRE.test(next);
8745
9185
  }
8746
- } else if (prev) el.removeAttribute("style");
9186
+ } else if (prev) {
9187
+ const cssVarText = style[CSS_VAR_TEXT];
9188
+ if (cssVarText) style.cssText = cssVarText;
9189
+ else el.removeAttribute("style");
9190
+ }
8747
9191
  if (vShowOriginalDisplay in el) {
8748
9192
  el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8749
9193
  if (el[vShowHidden]) style.display = "none";
@@ -8756,8 +9200,10 @@ var VueRuntimeDOM = (function(exports) {
8756
9200
  else {
8757
9201
  const val = rawVal == null ? "" : String(rawVal);
8758
9202
  if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
8759
- if (name.startsWith("--")) style.setProperty(name, val);
8760
- else {
9203
+ if (name.startsWith("--")) {
9204
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
9205
+ else style.setProperty(name, val);
9206
+ } else {
8761
9207
  const prefixed = autoPrefix(style, name);
8762
9208
  if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
8763
9209
  else style[prefixed] = val;
@@ -8782,13 +9228,22 @@ var VueRuntimeDOM = (function(exports) {
8782
9228
  }
8783
9229
  return rawName;
8784
9230
  }
9231
+ /**
9232
+ * Browsers update textarea width/height directly during native resize.
9233
+ * Only special-case this common textarea path for now; other resize scenarios
9234
+ * still follow normal vnode style patching.
9235
+ */
9236
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
9237
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
9238
+ }
8785
9239
  //#endregion
8786
9240
  //#region packages/runtime-dom/src/modules/attrs.ts
8787
9241
  const xlinkNS = "http://www.w3.org/1999/xlink";
8788
9242
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
8789
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
8790
- else el.setAttributeNS(xlinkNS, key, value);
8791
- else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
9243
+ if (isSVG && key.startsWith("xlink:")) {
9244
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
9245
+ else el.setAttributeNS(xlinkNS, key, value);
9246
+ } else if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
8792
9247
  else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
8793
9248
  }
8794
9249
  //#endregion
@@ -8840,7 +9295,7 @@ var VueRuntimeDOM = (function(exports) {
8840
9295
  const existingInvoker = invokers[rawName];
8841
9296
  if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
8842
9297
  else {
8843
- const [name, options] = parseName(rawName);
9298
+ const [name, options] = parseEventName(rawName);
8844
9299
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
8845
9300
  else if (existingInvoker) {
8846
9301
  removeEventListener(el, name, existingInvoker, options);
@@ -8848,27 +9303,40 @@ var VueRuntimeDOM = (function(exports) {
8848
9303
  }
8849
9304
  }
8850
9305
  }
8851
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
8852
- function parseName(name) {
9306
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
9307
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
9308
+ function parseEventName(name) {
8853
9309
  let options;
8854
- if (optionsModifierRE.test(name)) {
8855
- options = {};
8856
- let m;
8857
- while (m = name.match(optionsModifierRE)) {
8858
- name = name.slice(0, name.length - m[0].length);
8859
- options[m[0].toLowerCase()] = true;
8860
- }
9310
+ let m;
9311
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
9312
+ if (!options) options = {};
9313
+ name = name.slice(0, name.length - m[1].length);
9314
+ options[m[1].toLowerCase()] = true;
8861
9315
  }
8862
9316
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
8863
9317
  }
8864
9318
  let cachedNow = 0;
8865
- const p = /* @__PURE__ */ Promise.resolve();
9319
+ const p = /*@__PURE__*/ Promise.resolve();
8866
9320
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
8867
9321
  function createInvoker(initialValue, instance) {
8868
9322
  const invoker = (e) => {
8869
9323
  if (!e._vts) e._vts = Date.now();
8870
9324
  else if (e._vts <= invoker.attached) return;
8871
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
9325
+ const value = invoker.value;
9326
+ if (isArray(value)) {
9327
+ const originalStop = e.stopImmediatePropagation;
9328
+ e.stopImmediatePropagation = () => {
9329
+ originalStop.call(e);
9330
+ e._stopped = true;
9331
+ };
9332
+ const handlers = value.slice();
9333
+ const args = [e];
9334
+ for (let i = 0; i < handlers.length; i++) {
9335
+ if (e._stopped) break;
9336
+ const handler = handlers[i];
9337
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
9338
+ }
9339
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
8872
9340
  };
8873
9341
  invoker.value = initialValue;
8874
9342
  invoker.attached = getNow();
@@ -8879,16 +9347,6 @@ var VueRuntimeDOM = (function(exports) {
8879
9347
  warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
8880
9348
  return NOOP;
8881
9349
  }
8882
- function patchStopImmediatePropagation(e, value) {
8883
- if (isArray(value)) {
8884
- const originalStop = e.stopImmediatePropagation;
8885
- e.stopImmediatePropagation = () => {
8886
- originalStop.call(e);
8887
- e._stopped = true;
8888
- };
8889
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
8890
- } else return value;
8891
- }
8892
9350
  //#endregion
8893
9351
  //#region packages/runtime-dom/src/patchProp.ts
8894
9352
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -8926,7 +9384,7 @@ var VueRuntimeDOM = (function(exports) {
8926
9384
  //#endregion
8927
9385
  //#region packages/runtime-dom/src/apiCustomElement.ts
8928
9386
  const REMOVAL = {};
8929
- /* @__NO_SIDE_EFFECTS__ */
9387
+ /*@__NO_SIDE_EFFECTS__*/
8930
9388
  function defineCustomElement(options, extraOptions, _createApp) {
8931
9389
  let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
8932
9390
  if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
@@ -8975,12 +9433,14 @@ var VueRuntimeDOM = (function(exports) {
8975
9433
  this._parent = parent;
8976
9434
  break;
8977
9435
  }
8978
- if (!this._instance) if (this._resolved) this._mountComponent(this._def);
8979
- else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
8980
- this._pendingResolve = void 0;
8981
- this._resolveDef();
8982
- });
8983
- else this._resolveDef();
9436
+ if (!this._instance) {
9437
+ if (this._resolved) this._mountComponent(this._def);
9438
+ else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
9439
+ this._pendingResolve = void 0;
9440
+ if (this.isConnected) return this._resolveDef();
9441
+ });
9442
+ else this._resolveDef();
9443
+ }
8984
9444
  }
8985
9445
  disconnectedCallback() {
8986
9446
  this._connected = false;
@@ -9014,7 +9474,7 @@ var VueRuntimeDOM = (function(exports) {
9014
9474
  * resolve inner component definition (handle possible async component)
9015
9475
  */
9016
9476
  _resolveDef() {
9017
- if (this._pendingResolve) return;
9477
+ if (this._pendingResolve) return this._pendingResolve;
9018
9478
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
9019
9479
  this._ob = new MutationObserver(this._processMutations.bind(this));
9020
9480
  this._ob.observe(this, { attributes: true });
@@ -9044,6 +9504,7 @@ var VueRuntimeDOM = (function(exports) {
9044
9504
  this._def = def;
9045
9505
  resolve(def);
9046
9506
  });
9507
+ return this._pendingResolve;
9047
9508
  } else resolve(this._def);
9048
9509
  }
9049
9510
  _mountComponent(def) {
@@ -9082,14 +9543,17 @@ var VueRuntimeDOM = (function(exports) {
9082
9543
  const { props } = def;
9083
9544
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9084
9545
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
9085
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
9086
- get() {
9087
- return this._getProp(key);
9088
- },
9089
- set(val) {
9090
- this._setProp(key, val, true, !this._patching);
9091
- }
9092
- });
9546
+ for (const key of declaredPropKeys.map(camelize)) {
9547
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
9548
+ Object.defineProperty(this, key, {
9549
+ get() {
9550
+ return this._getProp(key);
9551
+ },
9552
+ set(val) {
9553
+ this._setProp(key, val, true, !this._patching);
9554
+ }
9555
+ });
9556
+ }
9093
9557
  }
9094
9558
  _setAttr(key) {
9095
9559
  if (key.startsWith("data-v-")) return;
@@ -9192,13 +9656,11 @@ var VueRuntimeDOM = (function(exports) {
9192
9656
  _renderSlots() {
9193
9657
  const outlets = this._getSlots();
9194
9658
  const scopeId = this._instance.type.__scopeId;
9195
- const slotReplacements = /* @__PURE__ */ new Map();
9196
9659
  for (let i = 0; i < outlets.length; i++) {
9197
9660
  const o = outlets[i];
9198
9661
  const slotName = o.getAttribute("name") || "default";
9199
9662
  const content = this._slots[slotName];
9200
9663
  const parent = o.parentNode;
9201
- const replacementNodes = [];
9202
9664
  if (content) for (const n of content) {
9203
9665
  if (scopeId && n.nodeType === 1) {
9204
9666
  const id = scopeId + "-s";
@@ -9208,17 +9670,10 @@ var VueRuntimeDOM = (function(exports) {
9208
9670
  while (child = walker.nextNode()) child.setAttribute(id, "");
9209
9671
  }
9210
9672
  parent.insertBefore(n, o);
9211
- replacementNodes.push(n);
9212
- }
9213
- else while (o.firstChild) {
9214
- const child = o.firstChild;
9215
- parent.insertBefore(child, o);
9216
- replacementNodes.push(child);
9217
9673
  }
9674
+ else while (o.firstChild) parent.insertBefore(o.firstChild, o);
9218
9675
  parent.removeChild(o);
9219
- slotReplacements.set(o, replacementNodes);
9220
9676
  }
9221
- this._updateSlotNodes(slotReplacements);
9222
9677
  }
9223
9678
  /**
9224
9679
  * @internal
@@ -9257,7 +9712,7 @@ var VueRuntimeDOM = (function(exports) {
9257
9712
  * @internal
9258
9713
  */
9259
9714
  _hasShadowRoot() {
9260
- return this._def.shadowRoot !== false;
9715
+ return this._root !== this;
9261
9716
  }
9262
9717
  /**
9263
9718
  * @internal
@@ -9302,10 +9757,6 @@ var VueRuntimeDOM = (function(exports) {
9302
9757
  if (this._instance && this._instance.ce) this._instance.ce = void 0;
9303
9758
  this._app = this._instance = null;
9304
9759
  }
9305
- /**
9306
- * Only called when shadowRoot is false
9307
- */
9308
- _updateSlotNodes(replacements) {}
9309
9760
  _createVNode() {
9310
9761
  const baseProps = {};
9311
9762
  if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
@@ -9355,7 +9806,7 @@ var VueRuntimeDOM = (function(exports) {
9355
9806
  };
9356
9807
  const TransitionGroup = /* @__PURE__ */ decorate({
9357
9808
  name: "TransitionGroup",
9358
- props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
9809
+ props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
9359
9810
  tag: String,
9360
9811
  moveClass: String
9361
9812
  }),
@@ -9388,7 +9839,7 @@ var VueRuntimeDOM = (function(exports) {
9388
9839
  prevChildren = [];
9389
9840
  if (children) for (let i = 0; i < children.length; i++) {
9390
9841
  const child = children[i];
9391
- if (child.el && child.el instanceof Element) {
9842
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
9392
9843
  prevChildren.push(child);
9393
9844
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9394
9845
  positionMap.set(child, getPosition(child.el));
@@ -9486,13 +9937,22 @@ var VueRuntimeDOM = (function(exports) {
9486
9937
  }
9487
9938
  }
9488
9939
  const assignKey = Symbol("_assign");
9940
+ const initialValueKey = Symbol("_initialValue");
9489
9941
  const vModelText = {
9490
9942
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
9943
+ if (el.parentNode) {
9944
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
9945
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
9946
+ }
9491
9947
  el[assignKey] = getModelAssigner(vnode);
9492
9948
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
9493
9949
  },
9494
- mounted(el, { value }) {
9495
- el.value = value == null ? "" : value;
9950
+ mounted(el, { value, modifiers: { trim, number } }) {
9951
+ const newValue = value == null ? "" : value;
9952
+ const initialValue = el[initialValueKey];
9953
+ delete el[initialValueKey];
9954
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
9955
+ else el.value = newValue;
9496
9956
  },
9497
9957
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
9498
9958
  el[assignKey] = getModelAssigner(vnode);
@@ -9612,7 +10072,8 @@ var VueRuntimeDOM = (function(exports) {
9612
10072
  mounted(el, { value }) {
9613
10073
  vModelSetSelected(el, value);
9614
10074
  },
9615
- beforeUpdate(el, _binding, vnode) {
10075
+ beforeUpdate(el, { value }, vnode) {
10076
+ el._modelValue = value;
9616
10077
  el[assignKey] = getModelAssigner(vnode);
9617
10078
  },
9618
10079
  updated(el, { value }) {
@@ -9623,21 +10084,42 @@ var VueRuntimeDOM = (function(exports) {
9623
10084
  * @internal
9624
10085
  */
9625
10086
  const vModelSelectInit = (el, value, number, set) => {
9626
- const isSetModel = isSet(value);
10087
+ el._modelValue = value;
9627
10088
  addEventListener(el, "change", () => {
9628
10089
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
9629
- (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
9630
- el._assigning = true;
9631
- nextTick(() => {
9632
- el._assigning = false;
9633
- });
10090
+ const multiple = el.multiple;
10091
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
10092
+ const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
10093
+ try {
10094
+ (set || el[assignKey])(assignedValue);
10095
+ } finally {
10096
+ nextTick(() => {
10097
+ if (el._pendingValue === pending) el._pendingValue = void 0;
10098
+ });
10099
+ }
9634
10100
  });
9635
10101
  };
10102
+ function isSameSelectValue(value, assignedValue, multiple) {
10103
+ if (!multiple) return looseEqual(value, assignedValue);
10104
+ if (isArray(value)) return looseEqual(value, assignedValue);
10105
+ if (isSet(value)) {
10106
+ if (value.size !== assignedValue.length) return false;
10107
+ for (const item of assignedValue) if (!value.has(item)) return false;
10108
+ return true;
10109
+ }
10110
+ return false;
10111
+ }
9636
10112
  /**
9637
10113
  * @internal
9638
10114
  */
9639
10115
  const vModelSetSelected = (el, value) => {
9640
- if (el._assigning) return;
10116
+ el._modelValue = value;
10117
+ const pending = el._pendingValue;
10118
+ el._pendingValue = void 0;
10119
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
10120
+ setSelected(el, value);
10121
+ };
10122
+ function setSelected(el, value) {
9641
10123
  const isMultiple = el.multiple;
9642
10124
  const isArrayValue = isArray(value);
9643
10125
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -9647,18 +10129,19 @@ var VueRuntimeDOM = (function(exports) {
9647
10129
  for (let i = 0, l = el.options.length; i < l; i++) {
9648
10130
  const option = el.options[i];
9649
10131
  const optionValue = getValue(option);
9650
- if (isMultiple) if (isArrayValue) {
9651
- const optionType = typeof optionValue;
9652
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
9653
- else option.selected = looseIndexOf(value, optionValue) > -1;
9654
- } else option.selected = value.has(optionValue);
9655
- else if (looseEqual(getValue(option), value)) {
10132
+ if (isMultiple) {
10133
+ if (isArrayValue) {
10134
+ const optionType = typeof optionValue;
10135
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
10136
+ else option.selected = looseIndexOf(value, optionValue) > -1;
10137
+ } else option.selected = value.has(optionValue);
10138
+ } else if (looseEqual(getValue(option), value)) {
9656
10139
  if (el.selectedIndex !== i) el.selectedIndex = i;
9657
10140
  return;
9658
10141
  }
9659
10142
  }
9660
10143
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
9661
- };
10144
+ }
9662
10145
  /**
9663
10146
  * @internal retrieve raw value set via :value bindings
9664
10147
  */
@@ -9760,7 +10243,7 @@ var VueRuntimeDOM = (function(exports) {
9760
10243
  };
9761
10244
  //#endregion
9762
10245
  //#region packages/runtime-dom/src/index.ts
9763
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
10246
+ const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
9764
10247
  let renderer;
9765
10248
  let enabledHydration = false;
9766
10249
  function ensureRenderer() {