chunk-LRIOPKVT.js (388709B)
1 // node_modules/@vue/shared/dist/shared.esm-bundler.js 2 function makeMap(str) { 3 const map2 = /* @__PURE__ */ Object.create(null); 4 for (const key of str.split(",")) map2[key] = 1; 5 return (val) => val in map2; 6 } 7 var EMPTY_OBJ = true ? Object.freeze({}) : {}; 8 var EMPTY_ARR = true ? Object.freeze([]) : []; 9 var NOOP = () => { 10 }; 11 var NO = () => false; 12 var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter 13 (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); 14 var isModelListener = (key) => key.startsWith("onUpdate:"); 15 var extend = Object.assign; 16 var remove = (arr, el) => { 17 const i = arr.indexOf(el); 18 if (i > -1) { 19 arr.splice(i, 1); 20 } 21 }; 22 var hasOwnProperty = Object.prototype.hasOwnProperty; 23 var hasOwn = (val, key) => hasOwnProperty.call(val, key); 24 var isArray = Array.isArray; 25 var isMap = (val) => toTypeString(val) === "[object Map]"; 26 var isSet = (val) => toTypeString(val) === "[object Set]"; 27 var isDate = (val) => toTypeString(val) === "[object Date]"; 28 var isRegExp = (val) => toTypeString(val) === "[object RegExp]"; 29 var isFunction = (val) => typeof val === "function"; 30 var isString = (val) => typeof val === "string"; 31 var isSymbol = (val) => typeof val === "symbol"; 32 var isObject = (val) => val !== null && typeof val === "object"; 33 var isPromise = (val) => { 34 return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); 35 }; 36 var objectToString = Object.prototype.toString; 37 var toTypeString = (value) => objectToString.call(value); 38 var toRawType = (value) => { 39 return toTypeString(value).slice(8, -1); 40 }; 41 var isPlainObject = (val) => toTypeString(val) === "[object Object]"; 42 var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; 43 var isReservedProp = makeMap( 44 // the leading comma is intentional so empty string "" is also included 45 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" 46 ); 47 var isBuiltInDirective = makeMap( 48 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" 49 ); 50 var cacheStringFunction = (fn) => { 51 const cache = /* @__PURE__ */ Object.create(null); 52 return ((str) => { 53 const hit = cache[str]; 54 return hit || (cache[str] = fn(str)); 55 }); 56 }; 57 var camelizeRE = /-\w/g; 58 var camelize = cacheStringFunction( 59 (str) => { 60 return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); 61 } 62 ); 63 var hyphenateRE = /\B([A-Z])/g; 64 var hyphenate = cacheStringFunction( 65 (str) => str.replace(hyphenateRE, "-$1").toLowerCase() 66 ); 67 var capitalize = cacheStringFunction((str) => { 68 return str.charAt(0).toUpperCase() + str.slice(1); 69 }); 70 var toHandlerKey = cacheStringFunction( 71 (str) => { 72 const s = str ? `on${capitalize(str)}` : ``; 73 return s; 74 } 75 ); 76 var hasChanged = (value, oldValue) => !Object.is(value, oldValue); 77 var invokeArrayFns = (fns, ...arg) => { 78 for (let i = 0; i < fns.length; i++) { 79 fns[i](...arg); 80 } 81 }; 82 var def = (obj, key, value, writable = false) => { 83 Object.defineProperty(obj, key, { 84 configurable: true, 85 enumerable: false, 86 writable, 87 value 88 }); 89 }; 90 var looseToNumber = (val) => { 91 const n = parseFloat(val); 92 return isNaN(n) ? val : n; 93 }; 94 var toNumber = (val) => { 95 const n = isString(val) ? Number(val) : NaN; 96 return isNaN(n) ? val : n; 97 }; 98 var _globalThis; 99 var getGlobalThis = () => { 100 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); 101 }; 102 var GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; 103 var isGloballyAllowed = makeMap(GLOBALS_ALLOWED); 104 function normalizeStyle(value) { 105 if (isArray(value)) { 106 const res = {}; 107 for (let i = 0; i < value.length; i++) { 108 const item = value[i]; 109 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); 110 if (normalized) { 111 for (const key in normalized) { 112 res[key] = normalized[key]; 113 } 114 } 115 } 116 return res; 117 } else if (isString(value) || isObject(value)) { 118 return value; 119 } 120 } 121 var listDelimiterRE = /;(?![^(]*\))/g; 122 var propertyDelimiterRE = /:([^]+)/; 123 var styleCommentRE = /\/\*[^]*?\*\//g; 124 function parseStringStyle(cssText) { 125 const ret = {}; 126 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { 127 if (item) { 128 const tmp = item.split(propertyDelimiterRE); 129 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); 130 } 131 }); 132 return ret; 133 } 134 function stringifyStyle(styles) { 135 if (!styles) return ""; 136 if (isString(styles)) return styles; 137 let ret = ""; 138 for (const key in styles) { 139 const value = styles[key]; 140 if (isString(value) || typeof value === "number") { 141 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); 142 ret += `${normalizedKey}:${value};`; 143 } 144 } 145 return ret; 146 } 147 function normalizeClass(value) { 148 let res = ""; 149 if (isString(value)) { 150 res = value; 151 } else if (isArray(value)) { 152 for (let i = 0; i < value.length; i++) { 153 const normalized = normalizeClass(value[i]); 154 if (normalized) { 155 res += normalized + " "; 156 } 157 } 158 } else if (isObject(value)) { 159 for (const name in value) { 160 if (value[name]) { 161 res += name + " "; 162 } 163 } 164 } 165 return res.trim(); 166 } 167 function normalizeProps(props) { 168 if (!props) return null; 169 let { class: klass, style } = props; 170 if (klass && !isString(klass)) { 171 props.class = normalizeClass(klass); 172 } 173 if (style) { 174 props.style = normalizeStyle(style); 175 } 176 return props; 177 } 178 var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; 179 var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; 180 var MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; 181 var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; 182 var isHTMLTag = makeMap(HTML_TAGS); 183 var isSVGTag = makeMap(SVG_TAGS); 184 var isMathMLTag = makeMap(MATH_TAGS); 185 var isVoidTag = makeMap(VOID_TAGS); 186 var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; 187 var isSpecialBooleanAttr = makeMap(specialBooleanAttrs); 188 var isBooleanAttr = makeMap( 189 specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` 190 ); 191 function includeBooleanAttr(value) { 192 return !!value || value === ""; 193 } 194 var isKnownHtmlAttr = makeMap( 195 `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` 196 ); 197 var isKnownSvgAttr = makeMap( 198 `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` 199 ); 200 var isKnownMathMLAttr = makeMap( 201 `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` 202 ); 203 function isRenderableAttrValue(value) { 204 if (value == null) { 205 return false; 206 } 207 const type = typeof value; 208 return type === "string" || type === "number" || type === "boolean"; 209 } 210 var cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; 211 function getEscapedCssVarName(key, doubleEscape) { 212 return key.replace( 213 cssVarNameEscapeSymbolsRE, 214 (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` 215 ); 216 } 217 function looseCompareArrays(a, b) { 218 if (a.length !== b.length) return false; 219 let equal = true; 220 for (let i = 0; equal && i < a.length; i++) { 221 equal = looseEqual(a[i], b[i]); 222 } 223 return equal; 224 } 225 function looseEqual(a, b) { 226 if (a === b) return true; 227 let aValidType = isDate(a); 228 let bValidType = isDate(b); 229 if (aValidType || bValidType) { 230 return aValidType && bValidType ? a.getTime() === b.getTime() : false; 231 } 232 aValidType = isSymbol(a); 233 bValidType = isSymbol(b); 234 if (aValidType || bValidType) { 235 return a === b; 236 } 237 aValidType = isArray(a); 238 bValidType = isArray(b); 239 if (aValidType || bValidType) { 240 return aValidType && bValidType ? looseCompareArrays(a, b) : false; 241 } 242 aValidType = isObject(a); 243 bValidType = isObject(b); 244 if (aValidType || bValidType) { 245 if (!aValidType || !bValidType) { 246 return false; 247 } 248 const aKeysCount = Object.keys(a).length; 249 const bKeysCount = Object.keys(b).length; 250 if (aKeysCount !== bKeysCount) { 251 return false; 252 } 253 for (const key in a) { 254 const aHasKey = a.hasOwnProperty(key); 255 const bHasKey = b.hasOwnProperty(key); 256 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { 257 return false; 258 } 259 } 260 } 261 return String(a) === String(b); 262 } 263 function looseIndexOf(arr, val) { 264 return arr.findIndex((item) => looseEqual(item, val)); 265 } 266 var isRef = (val) => { 267 return !!(val && val["__v_isRef"] === true); 268 }; 269 var toDisplayString = (val) => { 270 return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); 271 }; 272 var replacer = (_key, val) => { 273 if (isRef(val)) { 274 return replacer(_key, val.value); 275 } else if (isMap(val)) { 276 return { 277 [`Map(${val.size})`]: [...val.entries()].reduce( 278 (entries, [key, val2], i) => { 279 entries[stringifySymbol(key, i) + " =>"] = val2; 280 return entries; 281 }, 282 {} 283 ) 284 }; 285 } else if (isSet(val)) { 286 return { 287 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) 288 }; 289 } else if (isSymbol(val)) { 290 return stringifySymbol(val); 291 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { 292 return String(val); 293 } 294 return val; 295 }; 296 var stringifySymbol = (v, i = "") => { 297 var _a; 298 return ( 299 // Symbol.description in es2019+ so we need to cast here to pass 300 // the lib: es2016 check 301 isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v 302 ); 303 }; 304 function normalizeCssVarValue(value) { 305 if (value == null) { 306 return "initial"; 307 } 308 if (typeof value === "string") { 309 return value === "" ? " " : value; 310 } 311 if (typeof value !== "number" || !Number.isFinite(value)) { 312 if (true) { 313 console.warn( 314 "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:", 315 value 316 ); 317 } 318 } 319 return String(value); 320 } 321 322 // node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js 323 function warn(msg, ...args) { 324 console.warn(`[Vue warn] ${msg}`, ...args); 325 } 326 var activeEffectScope; 327 var EffectScope = class { 328 // TODO isolatedDeclarations "__v_skip" 329 constructor(detached = false) { 330 this.detached = detached; 331 this._active = true; 332 this._on = 0; 333 this.effects = []; 334 this.cleanups = []; 335 this._isPaused = false; 336 this._warnOnRun = true; 337 this.__v_skip = true; 338 if (!detached && activeEffectScope) { 339 if (activeEffectScope.active) { 340 this.parent = activeEffectScope; 341 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( 342 this 343 ) - 1; 344 } else { 345 this._active = false; 346 this._warnOnRun = false; 347 } 348 } 349 } 350 get active() { 351 return this._active; 352 } 353 pause() { 354 if (this._active) { 355 this._isPaused = true; 356 let i, l; 357 if (this.scopes) { 358 for (i = 0, l = this.scopes.length; i < l; i++) { 359 this.scopes[i].pause(); 360 } 361 } 362 for (i = 0, l = this.effects.length; i < l; i++) { 363 this.effects[i].pause(); 364 } 365 } 366 } 367 /** 368 * Resumes the effect scope, including all child scopes and effects. 369 */ 370 resume() { 371 if (this._active) { 372 if (this._isPaused) { 373 this._isPaused = false; 374 let i, l; 375 if (this.scopes) { 376 for (i = 0, l = this.scopes.length; i < l; i++) { 377 this.scopes[i].resume(); 378 } 379 } 380 for (i = 0, l = this.effects.length; i < l; i++) { 381 this.effects[i].resume(); 382 } 383 } 384 } 385 } 386 run(fn) { 387 if (this._active) { 388 const currentEffectScope = activeEffectScope; 389 try { 390 activeEffectScope = this; 391 return fn(); 392 } finally { 393 activeEffectScope = currentEffectScope; 394 } 395 } else if (this._warnOnRun) { 396 warn(`cannot run an inactive effect scope.`); 397 } 398 } 399 /** 400 * This should only be called on non-detached scopes 401 * @internal 402 */ 403 on() { 404 if (++this._on === 1) { 405 this.prevScope = activeEffectScope; 406 activeEffectScope = this; 407 } 408 } 409 /** 410 * This should only be called on non-detached scopes 411 * @internal 412 */ 413 off() { 414 if (this._on > 0 && --this._on === 0) { 415 if (activeEffectScope === this) { 416 activeEffectScope = this.prevScope; 417 } else { 418 let current = activeEffectScope; 419 while (current) { 420 if (current.prevScope === this) { 421 current.prevScope = this.prevScope; 422 break; 423 } 424 current = current.prevScope; 425 } 426 } 427 this.prevScope = void 0; 428 } 429 } 430 stop(fromParent) { 431 if (this._active) { 432 this._active = false; 433 let i, l; 434 for (i = 0, l = this.effects.length; i < l; i++) { 435 this.effects[i].stop(); 436 } 437 this.effects.length = 0; 438 for (i = 0, l = this.cleanups.length; i < l; i++) { 439 this.cleanups[i](); 440 } 441 this.cleanups.length = 0; 442 if (this.scopes) { 443 for (i = 0, l = this.scopes.length; i < l; i++) { 444 this.scopes[i].stop(true); 445 } 446 this.scopes.length = 0; 447 } 448 if (!this.detached && this.parent && !fromParent) { 449 const last = this.parent.scopes.pop(); 450 if (last && last !== this) { 451 this.parent.scopes[this.index] = last; 452 last.index = this.index; 453 } 454 } 455 this.parent = void 0; 456 } 457 } 458 }; 459 function effectScope(detached) { 460 return new EffectScope(detached); 461 } 462 function getCurrentScope() { 463 return activeEffectScope; 464 } 465 function onScopeDispose(fn, failSilently = false) { 466 if (activeEffectScope) { 467 activeEffectScope.cleanups.push(fn); 468 } else if (!failSilently) { 469 warn( 470 `onScopeDispose() is called when there is no active effect scope to be associated with.` 471 ); 472 } 473 } 474 var activeSub; 475 var pausedQueueEffects = /* @__PURE__ */ new WeakSet(); 476 var ReactiveEffect = class { 477 constructor(fn) { 478 this.fn = fn; 479 this.deps = void 0; 480 this.depsTail = void 0; 481 this.flags = 1 | 4; 482 this.next = void 0; 483 this.cleanup = void 0; 484 this.scheduler = void 0; 485 if (activeEffectScope) { 486 if (activeEffectScope.active) { 487 activeEffectScope.effects.push(this); 488 } else { 489 this.flags &= -2; 490 } 491 } 492 } 493 pause() { 494 this.flags |= 64; 495 } 496 resume() { 497 if (this.flags & 64) { 498 this.flags &= -65; 499 if (pausedQueueEffects.has(this)) { 500 pausedQueueEffects.delete(this); 501 this.trigger(); 502 } 503 } 504 } 505 /** 506 * @internal 507 */ 508 notify() { 509 if (this.flags & 2 && !(this.flags & 32)) { 510 return; 511 } 512 if (!(this.flags & 8)) { 513 batch(this); 514 } 515 } 516 run() { 517 if (!(this.flags & 1)) { 518 return this.fn(); 519 } 520 this.flags |= 2; 521 cleanupEffect(this); 522 prepareDeps(this); 523 const prevEffect = activeSub; 524 const prevShouldTrack = shouldTrack; 525 activeSub = this; 526 shouldTrack = true; 527 try { 528 return this.fn(); 529 } finally { 530 if (activeSub !== this) { 531 warn( 532 "Active effect was not restored correctly - this is likely a Vue internal bug." 533 ); 534 } 535 cleanupDeps(this); 536 activeSub = prevEffect; 537 shouldTrack = prevShouldTrack; 538 this.flags &= -3; 539 } 540 } 541 stop() { 542 if (this.flags & 1) { 543 for (let link = this.deps; link; link = link.nextDep) { 544 removeSub(link); 545 } 546 this.deps = this.depsTail = void 0; 547 cleanupEffect(this); 548 this.onStop && this.onStop(); 549 this.flags &= -2; 550 } 551 } 552 trigger() { 553 if (this.flags & 64) { 554 pausedQueueEffects.add(this); 555 } else if (this.scheduler) { 556 this.scheduler(); 557 } else { 558 this.runIfDirty(); 559 } 560 } 561 /** 562 * @internal 563 */ 564 runIfDirty() { 565 if (isDirty(this)) { 566 this.run(); 567 } 568 } 569 get dirty() { 570 return isDirty(this); 571 } 572 }; 573 var batchDepth = 0; 574 var batchedSub; 575 var batchedComputed; 576 function batch(sub, isComputed = false) { 577 sub.flags |= 8; 578 if (isComputed) { 579 sub.next = batchedComputed; 580 batchedComputed = sub; 581 return; 582 } 583 sub.next = batchedSub; 584 batchedSub = sub; 585 } 586 function startBatch() { 587 batchDepth++; 588 } 589 function endBatch() { 590 if (--batchDepth > 0) { 591 return; 592 } 593 if (batchedComputed) { 594 let e = batchedComputed; 595 batchedComputed = void 0; 596 while (e) { 597 const next = e.next; 598 e.next = void 0; 599 e.flags &= -9; 600 e = next; 601 } 602 } 603 let error; 604 while (batchedSub) { 605 let e = batchedSub; 606 batchedSub = void 0; 607 while (e) { 608 const next = e.next; 609 e.next = void 0; 610 e.flags &= -9; 611 if (e.flags & 1) { 612 try { 613 ; 614 e.trigger(); 615 } catch (err) { 616 if (!error) error = err; 617 } 618 } 619 e = next; 620 } 621 } 622 if (error) throw error; 623 } 624 function prepareDeps(sub) { 625 for (let link = sub.deps; link; link = link.nextDep) { 626 link.version = -1; 627 link.prevActiveLink = link.dep.activeLink; 628 link.dep.activeLink = link; 629 } 630 } 631 function cleanupDeps(sub) { 632 let head; 633 let tail = sub.depsTail; 634 let link = tail; 635 while (link) { 636 const prev = link.prevDep; 637 if (link.version === -1) { 638 if (link === tail) tail = prev; 639 removeSub(link); 640 removeDep(link); 641 } else { 642 head = link; 643 } 644 link.dep.activeLink = link.prevActiveLink; 645 link.prevActiveLink = void 0; 646 link = prev; 647 } 648 sub.deps = head; 649 sub.depsTail = tail; 650 } 651 function isDirty(sub) { 652 for (let link = sub.deps; link; link = link.nextDep) { 653 if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { 654 return true; 655 } 656 } 657 if (sub._dirty) { 658 return true; 659 } 660 return false; 661 } 662 function refreshComputed(computed3) { 663 if (computed3.flags & 4 && !(computed3.flags & 16)) { 664 return; 665 } 666 computed3.flags &= -17; 667 if (computed3.globalVersion === globalVersion) { 668 return; 669 } 670 computed3.globalVersion = globalVersion; 671 if (!computed3.isSSR && computed3.flags & 128 && (!computed3.deps && !computed3._dirty || !isDirty(computed3))) { 672 return; 673 } 674 computed3.flags |= 2; 675 const dep = computed3.dep; 676 const prevSub = activeSub; 677 const prevShouldTrack = shouldTrack; 678 activeSub = computed3; 679 shouldTrack = true; 680 try { 681 prepareDeps(computed3); 682 const value = computed3.fn(computed3._value); 683 if (dep.version === 0 || hasChanged(value, computed3._value)) { 684 computed3.flags |= 128; 685 computed3._value = value; 686 dep.version++; 687 } 688 } catch (err) { 689 dep.version++; 690 throw err; 691 } finally { 692 activeSub = prevSub; 693 shouldTrack = prevShouldTrack; 694 cleanupDeps(computed3); 695 computed3.flags &= -3; 696 } 697 } 698 function removeSub(link, soft = false) { 699 const { dep, prevSub, nextSub } = link; 700 if (prevSub) { 701 prevSub.nextSub = nextSub; 702 link.prevSub = void 0; 703 } 704 if (nextSub) { 705 nextSub.prevSub = prevSub; 706 link.nextSub = void 0; 707 } 708 if (dep.subsHead === link) { 709 dep.subsHead = nextSub; 710 } 711 if (dep.subs === link) { 712 dep.subs = prevSub; 713 if (!prevSub && dep.computed) { 714 dep.computed.flags &= -5; 715 for (let l = dep.computed.deps; l; l = l.nextDep) { 716 removeSub(l, true); 717 } 718 } 719 } 720 if (!soft && !--dep.sc && dep.map) { 721 dep.map.delete(dep.key); 722 } 723 } 724 function removeDep(link) { 725 const { prevDep, nextDep } = link; 726 if (prevDep) { 727 prevDep.nextDep = nextDep; 728 link.prevDep = void 0; 729 } 730 if (nextDep) { 731 nextDep.prevDep = prevDep; 732 link.nextDep = void 0; 733 } 734 } 735 function effect(fn, options) { 736 if (fn.effect instanceof ReactiveEffect) { 737 fn = fn.effect.fn; 738 } 739 const e = new ReactiveEffect(fn); 740 if (options) { 741 extend(e, options); 742 } 743 try { 744 e.run(); 745 } catch (err) { 746 e.stop(); 747 throw err; 748 } 749 const runner = e.run.bind(e); 750 runner.effect = e; 751 return runner; 752 } 753 function stop(runner) { 754 runner.effect.stop(); 755 } 756 var shouldTrack = true; 757 var trackStack = []; 758 function pauseTracking() { 759 trackStack.push(shouldTrack); 760 shouldTrack = false; 761 } 762 function resetTracking() { 763 const last = trackStack.pop(); 764 shouldTrack = last === void 0 ? true : last; 765 } 766 function cleanupEffect(e) { 767 const { cleanup } = e; 768 e.cleanup = void 0; 769 if (cleanup) { 770 const prevSub = activeSub; 771 activeSub = void 0; 772 try { 773 cleanup(); 774 } finally { 775 activeSub = prevSub; 776 } 777 } 778 } 779 var globalVersion = 0; 780 var Link = class { 781 constructor(sub, dep) { 782 this.sub = sub; 783 this.dep = dep; 784 this.version = dep.version; 785 this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; 786 } 787 }; 788 var Dep = class { 789 // TODO isolatedDeclarations "__v_skip" 790 constructor(computed3) { 791 this.computed = computed3; 792 this.version = 0; 793 this.activeLink = void 0; 794 this.subs = void 0; 795 this.map = void 0; 796 this.key = void 0; 797 this.sc = 0; 798 this.__v_skip = true; 799 if (true) { 800 this.subsHead = void 0; 801 } 802 } 803 track(debugInfo) { 804 if (!activeSub || !shouldTrack || activeSub === this.computed) { 805 return; 806 } 807 let link = this.activeLink; 808 if (link === void 0 || link.sub !== activeSub) { 809 link = this.activeLink = new Link(activeSub, this); 810 if (!activeSub.deps) { 811 activeSub.deps = activeSub.depsTail = link; 812 } else { 813 link.prevDep = activeSub.depsTail; 814 activeSub.depsTail.nextDep = link; 815 activeSub.depsTail = link; 816 } 817 addSub(link); 818 } else if (link.version === -1) { 819 link.version = this.version; 820 if (link.nextDep) { 821 const next = link.nextDep; 822 next.prevDep = link.prevDep; 823 if (link.prevDep) { 824 link.prevDep.nextDep = next; 825 } 826 link.prevDep = activeSub.depsTail; 827 link.nextDep = void 0; 828 activeSub.depsTail.nextDep = link; 829 activeSub.depsTail = link; 830 if (activeSub.deps === link) { 831 activeSub.deps = next; 832 } 833 } 834 } 835 if (activeSub.onTrack) { 836 activeSub.onTrack( 837 extend( 838 { 839 effect: activeSub 840 }, 841 debugInfo 842 ) 843 ); 844 } 845 return link; 846 } 847 trigger(debugInfo) { 848 this.version++; 849 globalVersion++; 850 this.notify(debugInfo); 851 } 852 notify(debugInfo) { 853 startBatch(); 854 try { 855 if (true) { 856 for (let head = this.subsHead; head; head = head.nextSub) { 857 if (head.sub.onTrigger && !(head.sub.flags & 8)) { 858 head.sub.onTrigger( 859 extend( 860 { 861 effect: head.sub 862 }, 863 debugInfo 864 ) 865 ); 866 } 867 } 868 } 869 for (let link = this.subs; link; link = link.prevSub) { 870 if (link.sub.notify()) { 871 ; 872 link.sub.dep.notify(); 873 } 874 } 875 } finally { 876 endBatch(); 877 } 878 } 879 }; 880 function addSub(link) { 881 link.dep.sc++; 882 if (link.sub.flags & 4) { 883 const computed3 = link.dep.computed; 884 if (computed3 && !link.dep.subs) { 885 computed3.flags |= 4 | 16; 886 for (let l = computed3.deps; l; l = l.nextDep) { 887 addSub(l); 888 } 889 } 890 const currentTail = link.dep.subs; 891 if (currentTail !== link) { 892 link.prevSub = currentTail; 893 if (currentTail) currentTail.nextSub = link; 894 } 895 if (link.dep.subsHead === void 0) { 896 link.dep.subsHead = link; 897 } 898 link.dep.subs = link; 899 } 900 } 901 var targetMap = /* @__PURE__ */ new WeakMap(); 902 var ITERATE_KEY = /* @__PURE__ */ Symbol( 903 true ? "Object iterate" : "" 904 ); 905 var MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol( 906 true ? "Map keys iterate" : "" 907 ); 908 var ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol( 909 true ? "Array iterate" : "" 910 ); 911 function track(target, type, key) { 912 if (shouldTrack && activeSub) { 913 let depsMap = targetMap.get(target); 914 if (!depsMap) { 915 targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); 916 } 917 let dep = depsMap.get(key); 918 if (!dep) { 919 depsMap.set(key, dep = new Dep()); 920 dep.map = depsMap; 921 dep.key = key; 922 } 923 if (true) { 924 dep.track({ 925 target, 926 type, 927 key 928 }); 929 } else { 930 dep.track(); 931 } 932 } 933 } 934 function trigger(target, type, key, newValue, oldValue, oldTarget) { 935 const depsMap = targetMap.get(target); 936 if (!depsMap) { 937 globalVersion++; 938 return; 939 } 940 const run = (dep) => { 941 if (dep) { 942 if (true) { 943 dep.trigger({ 944 target, 945 type, 946 key, 947 newValue, 948 oldValue, 949 oldTarget 950 }); 951 } else { 952 dep.trigger(); 953 } 954 } 955 }; 956 startBatch(); 957 if (type === "clear") { 958 depsMap.forEach(run); 959 } else { 960 const targetIsArray = isArray(target); 961 const isArrayIndex = targetIsArray && isIntegerKey(key); 962 if (targetIsArray && key === "length") { 963 const newLength = Number(newValue); 964 depsMap.forEach((dep, key2) => { 965 if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { 966 run(dep); 967 } 968 }); 969 } else { 970 if (key !== void 0 || depsMap.has(void 0)) { 971 run(depsMap.get(key)); 972 } 973 if (isArrayIndex) { 974 run(depsMap.get(ARRAY_ITERATE_KEY)); 975 } 976 switch (type) { 977 case "add": 978 if (!targetIsArray) { 979 run(depsMap.get(ITERATE_KEY)); 980 if (isMap(target)) { 981 run(depsMap.get(MAP_KEY_ITERATE_KEY)); 982 } 983 } else if (isArrayIndex) { 984 run(depsMap.get("length")); 985 } 986 break; 987 case "delete": 988 if (!targetIsArray) { 989 run(depsMap.get(ITERATE_KEY)); 990 if (isMap(target)) { 991 run(depsMap.get(MAP_KEY_ITERATE_KEY)); 992 } 993 } 994 break; 995 case "set": 996 if (isMap(target)) { 997 run(depsMap.get(ITERATE_KEY)); 998 } 999 break; 1000 } 1001 } 1002 } 1003 endBatch(); 1004 } 1005 function getDepFromReactive(object, key) { 1006 const depMap = targetMap.get(object); 1007 return depMap && depMap.get(key); 1008 } 1009 function reactiveReadArray(array) { 1010 const raw = toRaw(array); 1011 if (raw === array) return raw; 1012 track(raw, "iterate", ARRAY_ITERATE_KEY); 1013 return isShallow(array) ? raw : raw.map(toReactive); 1014 } 1015 function shallowReadArray(arr) { 1016 track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); 1017 return arr; 1018 } 1019 function toWrapped(target, item) { 1020 if (isReadonly(target)) { 1021 return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item); 1022 } 1023 return toReactive(item); 1024 } 1025 var arrayInstrumentations = { 1026 __proto__: null, 1027 [Symbol.iterator]() { 1028 return iterator(this, Symbol.iterator, (item) => toWrapped(this, item)); 1029 }, 1030 concat(...args) { 1031 return reactiveReadArray(this).concat( 1032 ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) 1033 ); 1034 }, 1035 entries() { 1036 return iterator(this, "entries", (value) => { 1037 value[1] = toWrapped(this, value[1]); 1038 return value; 1039 }); 1040 }, 1041 every(fn, thisArg) { 1042 return apply(this, "every", fn, thisArg, void 0, arguments); 1043 }, 1044 filter(fn, thisArg) { 1045 return apply( 1046 this, 1047 "filter", 1048 fn, 1049 thisArg, 1050 (v) => v.map((item) => toWrapped(this, item)), 1051 arguments 1052 ); 1053 }, 1054 find(fn, thisArg) { 1055 return apply( 1056 this, 1057 "find", 1058 fn, 1059 thisArg, 1060 (item) => toWrapped(this, item), 1061 arguments 1062 ); 1063 }, 1064 findIndex(fn, thisArg) { 1065 return apply(this, "findIndex", fn, thisArg, void 0, arguments); 1066 }, 1067 findLast(fn, thisArg) { 1068 return apply( 1069 this, 1070 "findLast", 1071 fn, 1072 thisArg, 1073 (item) => toWrapped(this, item), 1074 arguments 1075 ); 1076 }, 1077 findLastIndex(fn, thisArg) { 1078 return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); 1079 }, 1080 // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement 1081 forEach(fn, thisArg) { 1082 return apply(this, "forEach", fn, thisArg, void 0, arguments); 1083 }, 1084 includes(...args) { 1085 return searchProxy(this, "includes", args); 1086 }, 1087 indexOf(...args) { 1088 return searchProxy(this, "indexOf", args); 1089 }, 1090 join(separator) { 1091 return reactiveReadArray(this).join(separator); 1092 }, 1093 // keys() iterator only reads `length`, no optimization required 1094 lastIndexOf(...args) { 1095 return searchProxy(this, "lastIndexOf", args); 1096 }, 1097 map(fn, thisArg) { 1098 return apply(this, "map", fn, thisArg, void 0, arguments); 1099 }, 1100 pop() { 1101 return noTracking(this, "pop"); 1102 }, 1103 push(...args) { 1104 return noTracking(this, "push", args); 1105 }, 1106 reduce(fn, ...args) { 1107 return reduce(this, "reduce", fn, args); 1108 }, 1109 reduceRight(fn, ...args) { 1110 return reduce(this, "reduceRight", fn, args); 1111 }, 1112 shift() { 1113 return noTracking(this, "shift"); 1114 }, 1115 // slice could use ARRAY_ITERATE but also seems to beg for range tracking 1116 some(fn, thisArg) { 1117 return apply(this, "some", fn, thisArg, void 0, arguments); 1118 }, 1119 splice(...args) { 1120 return noTracking(this, "splice", args); 1121 }, 1122 toReversed() { 1123 return reactiveReadArray(this).toReversed(); 1124 }, 1125 toSorted(comparer) { 1126 return reactiveReadArray(this).toSorted(comparer); 1127 }, 1128 toSpliced(...args) { 1129 return reactiveReadArray(this).toSpliced(...args); 1130 }, 1131 unshift(...args) { 1132 return noTracking(this, "unshift", args); 1133 }, 1134 values() { 1135 return iterator(this, "values", (item) => toWrapped(this, item)); 1136 } 1137 }; 1138 function iterator(self2, method, wrapValue) { 1139 const arr = shallowReadArray(self2); 1140 const iter = arr[method](); 1141 if (arr !== self2 && !isShallow(self2)) { 1142 iter._next = iter.next; 1143 iter.next = () => { 1144 const result = iter._next(); 1145 if (!result.done) { 1146 result.value = wrapValue(result.value); 1147 } 1148 return result; 1149 }; 1150 } 1151 return iter; 1152 } 1153 var arrayProto = Array.prototype; 1154 function apply(self2, method, fn, thisArg, wrappedRetFn, args) { 1155 const arr = shallowReadArray(self2); 1156 const needsWrap = arr !== self2 && !isShallow(self2); 1157 const methodFn = arr[method]; 1158 if (methodFn !== arrayProto[method]) { 1159 const result2 = methodFn.apply(self2, args); 1160 return needsWrap ? toReactive(result2) : result2; 1161 } 1162 let wrappedFn = fn; 1163 if (arr !== self2) { 1164 if (needsWrap) { 1165 wrappedFn = function(item, index) { 1166 return fn.call(this, toWrapped(self2, item), index, self2); 1167 }; 1168 } else if (fn.length > 2) { 1169 wrappedFn = function(item, index) { 1170 return fn.call(this, item, index, self2); 1171 }; 1172 } 1173 } 1174 const result = methodFn.call(arr, wrappedFn, thisArg); 1175 return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; 1176 } 1177 function reduce(self2, method, fn, args) { 1178 const arr = shallowReadArray(self2); 1179 const needsWrap = arr !== self2 && !isShallow(self2); 1180 let wrappedFn = fn; 1181 let wrapInitialAccumulator = false; 1182 if (arr !== self2) { 1183 if (needsWrap) { 1184 wrapInitialAccumulator = args.length === 0; 1185 wrappedFn = function(acc, item, index) { 1186 if (wrapInitialAccumulator) { 1187 wrapInitialAccumulator = false; 1188 acc = toWrapped(self2, acc); 1189 } 1190 return fn.call(this, acc, toWrapped(self2, item), index, self2); 1191 }; 1192 } else if (fn.length > 3) { 1193 wrappedFn = function(acc, item, index) { 1194 return fn.call(this, acc, item, index, self2); 1195 }; 1196 } 1197 } 1198 const result = arr[method](wrappedFn, ...args); 1199 return wrapInitialAccumulator ? toWrapped(self2, result) : result; 1200 } 1201 function searchProxy(self2, method, args) { 1202 const arr = toRaw(self2); 1203 track(arr, "iterate", ARRAY_ITERATE_KEY); 1204 const res = arr[method](...args); 1205 if ((res === -1 || res === false) && isProxy(args[0])) { 1206 args[0] = toRaw(args[0]); 1207 return arr[method](...args); 1208 } 1209 return res; 1210 } 1211 function noTracking(self2, method, args = []) { 1212 pauseTracking(); 1213 startBatch(); 1214 const res = toRaw(self2)[method].apply(self2, args); 1215 endBatch(); 1216 resetTracking(); 1217 return res; 1218 } 1219 var isNonTrackableKeys = makeMap(`__proto__,__v_isRef,__isVue`); 1220 var builtInSymbols = new Set( 1221 Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) 1222 ); 1223 function hasOwnProperty2(key) { 1224 if (!isSymbol(key)) key = String(key); 1225 const obj = toRaw(this); 1226 track(obj, "has", key); 1227 return obj.hasOwnProperty(key); 1228 } 1229 var BaseReactiveHandler = class { 1230 constructor(_isReadonly = false, _isShallow = false) { 1231 this._isReadonly = _isReadonly; 1232 this._isShallow = _isShallow; 1233 } 1234 get(target, key, receiver) { 1235 if (key === "__v_skip") return target["__v_skip"]; 1236 const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; 1237 if (key === "__v_isReactive") { 1238 return !isReadonly2; 1239 } else if (key === "__v_isReadonly") { 1240 return isReadonly2; 1241 } else if (key === "__v_isShallow") { 1242 return isShallow2; 1243 } else if (key === "__v_raw") { 1244 if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype 1245 // this means the receiver is a user proxy of the reactive proxy 1246 Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { 1247 return target; 1248 } 1249 return; 1250 } 1251 const targetIsArray = isArray(target); 1252 if (!isReadonly2) { 1253 let fn; 1254 if (targetIsArray && (fn = arrayInstrumentations[key])) { 1255 return fn; 1256 } 1257 if (key === "hasOwnProperty") { 1258 return hasOwnProperty2; 1259 } 1260 } 1261 const res = Reflect.get( 1262 target, 1263 key, 1264 // if this is a proxy wrapping a ref, return methods using the raw ref 1265 // as receiver so that we don't have to call `toRaw` on the ref in all 1266 // its class methods 1267 isRef2(target) ? target : receiver 1268 ); 1269 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { 1270 return res; 1271 } 1272 if (!isReadonly2) { 1273 track(target, "get", key); 1274 } 1275 if (isShallow2) { 1276 return res; 1277 } 1278 if (isRef2(res)) { 1279 const value = targetIsArray && isIntegerKey(key) ? res : res.value; 1280 return isReadonly2 && isObject(value) ? readonly(value) : value; 1281 } 1282 if (isObject(res)) { 1283 return isReadonly2 ? readonly(res) : reactive(res); 1284 } 1285 return res; 1286 } 1287 }; 1288 var MutableReactiveHandler = class extends BaseReactiveHandler { 1289 constructor(isShallow2 = false) { 1290 super(false, isShallow2); 1291 } 1292 set(target, key, value, receiver) { 1293 let oldValue = target[key]; 1294 const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key); 1295 if (!this._isShallow) { 1296 const isOldValueReadonly = isReadonly(oldValue); 1297 if (!isShallow(value) && !isReadonly(value)) { 1298 oldValue = toRaw(oldValue); 1299 value = toRaw(value); 1300 } 1301 if (!isArrayWithIntegerKey && isRef2(oldValue) && !isRef2(value)) { 1302 if (isOldValueReadonly) { 1303 if (true) { 1304 warn( 1305 `Set operation on key "${String(key)}" failed: target is readonly.`, 1306 target[key] 1307 ); 1308 } 1309 return true; 1310 } else { 1311 oldValue.value = value; 1312 return true; 1313 } 1314 } 1315 } 1316 const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key); 1317 const result = Reflect.set( 1318 target, 1319 key, 1320 value, 1321 isRef2(target) ? target : receiver 1322 ); 1323 if (target === toRaw(receiver) && result) { 1324 if (!hadKey) { 1325 trigger(target, "add", key, value); 1326 } else if (hasChanged(value, oldValue)) { 1327 trigger(target, "set", key, value, oldValue); 1328 } 1329 } 1330 return result; 1331 } 1332 deleteProperty(target, key) { 1333 const hadKey = hasOwn(target, key); 1334 const oldValue = target[key]; 1335 const result = Reflect.deleteProperty(target, key); 1336 if (result && hadKey) { 1337 trigger(target, "delete", key, void 0, oldValue); 1338 } 1339 return result; 1340 } 1341 has(target, key) { 1342 const result = Reflect.has(target, key); 1343 if (!isSymbol(key) || !builtInSymbols.has(key)) { 1344 track(target, "has", key); 1345 } 1346 return result; 1347 } 1348 ownKeys(target) { 1349 track( 1350 target, 1351 "iterate", 1352 isArray(target) ? "length" : ITERATE_KEY 1353 ); 1354 return Reflect.ownKeys(target); 1355 } 1356 }; 1357 var ReadonlyReactiveHandler = class extends BaseReactiveHandler { 1358 constructor(isShallow2 = false) { 1359 super(true, isShallow2); 1360 } 1361 set(target, key) { 1362 if (true) { 1363 warn( 1364 `Set operation on key "${String(key)}" failed: target is readonly.`, 1365 target 1366 ); 1367 } 1368 return true; 1369 } 1370 deleteProperty(target, key) { 1371 if (true) { 1372 warn( 1373 `Delete operation on key "${String(key)}" failed: target is readonly.`, 1374 target 1375 ); 1376 } 1377 return true; 1378 } 1379 }; 1380 var mutableHandlers = new MutableReactiveHandler(); 1381 var readonlyHandlers = new ReadonlyReactiveHandler(); 1382 var shallowReactiveHandlers = new MutableReactiveHandler(true); 1383 var shallowReadonlyHandlers = new ReadonlyReactiveHandler(true); 1384 var toShallow = (value) => value; 1385 var getProto = (v) => Reflect.getPrototypeOf(v); 1386 function createIterableMethod(method, isReadonly2, isShallow2) { 1387 return function(...args) { 1388 const target = this["__v_raw"]; 1389 const rawTarget = toRaw(target); 1390 const targetIsMap = isMap(rawTarget); 1391 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; 1392 const isKeyOnly = method === "keys" && targetIsMap; 1393 const innerIterator = target[method](...args); 1394 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 1395 !isReadonly2 && track( 1396 rawTarget, 1397 "iterate", 1398 isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY 1399 ); 1400 return extend( 1401 // inheriting all iterator properties 1402 Object.create(innerIterator), 1403 { 1404 // iterator protocol 1405 next() { 1406 const { value, done } = innerIterator.next(); 1407 return done ? { value, done } : { 1408 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), 1409 done 1410 }; 1411 } 1412 } 1413 ); 1414 }; 1415 } 1416 function createReadonlyMethod(type) { 1417 return function(...args) { 1418 if (true) { 1419 const key = args[0] ? `on key "${args[0]}" ` : ``; 1420 warn( 1421 `${capitalize(type)} operation ${key}failed: target is readonly.`, 1422 toRaw(this) 1423 ); 1424 } 1425 return type === "delete" ? false : type === "clear" ? void 0 : this; 1426 }; 1427 } 1428 function createInstrumentations(readonly2, shallow) { 1429 const instrumentations = { 1430 get(key) { 1431 const target = this["__v_raw"]; 1432 const rawTarget = toRaw(target); 1433 const rawKey = toRaw(key); 1434 if (!readonly2) { 1435 if (hasChanged(key, rawKey)) { 1436 track(rawTarget, "get", key); 1437 } 1438 track(rawTarget, "get", rawKey); 1439 } 1440 const { has } = getProto(rawTarget); 1441 const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; 1442 if (has.call(rawTarget, key)) { 1443 return wrap(target.get(key)); 1444 } else if (has.call(rawTarget, rawKey)) { 1445 return wrap(target.get(rawKey)); 1446 } else if (target !== rawTarget) { 1447 target.get(key); 1448 } 1449 }, 1450 get size() { 1451 const target = this["__v_raw"]; 1452 !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY); 1453 return target.size; 1454 }, 1455 has(key) { 1456 const target = this["__v_raw"]; 1457 const rawTarget = toRaw(target); 1458 const rawKey = toRaw(key); 1459 if (!readonly2) { 1460 if (hasChanged(key, rawKey)) { 1461 track(rawTarget, "has", key); 1462 } 1463 track(rawTarget, "has", rawKey); 1464 } 1465 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); 1466 }, 1467 forEach(callback, thisArg) { 1468 const observed = this; 1469 const target = observed["__v_raw"]; 1470 const rawTarget = toRaw(target); 1471 const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; 1472 !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); 1473 return target.forEach((value, key) => { 1474 return callback.call(thisArg, wrap(value), wrap(key), observed); 1475 }); 1476 } 1477 }; 1478 extend( 1479 instrumentations, 1480 readonly2 ? { 1481 add: createReadonlyMethod("add"), 1482 set: createReadonlyMethod("set"), 1483 delete: createReadonlyMethod("delete"), 1484 clear: createReadonlyMethod("clear") 1485 } : { 1486 add(value) { 1487 const target = toRaw(this); 1488 const proto = getProto(target); 1489 const rawValue = toRaw(value); 1490 const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value; 1491 const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue); 1492 if (!hadKey) { 1493 target.add(valueToAdd); 1494 trigger(target, "add", valueToAdd, valueToAdd); 1495 } 1496 return this; 1497 }, 1498 set(key, value) { 1499 if (!shallow && !isShallow(value) && !isReadonly(value)) { 1500 value = toRaw(value); 1501 } 1502 const target = toRaw(this); 1503 const { has, get } = getProto(target); 1504 let hadKey = has.call(target, key); 1505 if (!hadKey) { 1506 key = toRaw(key); 1507 hadKey = has.call(target, key); 1508 } else if (true) { 1509 checkIdentityKeys(target, has, key); 1510 } 1511 const oldValue = get.call(target, key); 1512 target.set(key, value); 1513 if (!hadKey) { 1514 trigger(target, "add", key, value); 1515 } else if (hasChanged(value, oldValue)) { 1516 trigger(target, "set", key, value, oldValue); 1517 } 1518 return this; 1519 }, 1520 delete(key) { 1521 const target = toRaw(this); 1522 const { has, get } = getProto(target); 1523 let hadKey = has.call(target, key); 1524 if (!hadKey) { 1525 key = toRaw(key); 1526 hadKey = has.call(target, key); 1527 } else if (true) { 1528 checkIdentityKeys(target, has, key); 1529 } 1530 const oldValue = get ? get.call(target, key) : void 0; 1531 const result = target.delete(key); 1532 if (hadKey) { 1533 trigger(target, "delete", key, void 0, oldValue); 1534 } 1535 return result; 1536 }, 1537 clear() { 1538 const target = toRaw(this); 1539 const hadItems = target.size !== 0; 1540 const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0; 1541 const result = target.clear(); 1542 if (hadItems) { 1543 trigger( 1544 target, 1545 "clear", 1546 void 0, 1547 void 0, 1548 oldTarget 1549 ); 1550 } 1551 return result; 1552 } 1553 } 1554 ); 1555 const iteratorMethods = [ 1556 "keys", 1557 "values", 1558 "entries", 1559 Symbol.iterator 1560 ]; 1561 iteratorMethods.forEach((method) => { 1562 instrumentations[method] = createIterableMethod(method, readonly2, shallow); 1563 }); 1564 return instrumentations; 1565 } 1566 function createInstrumentationGetter(isReadonly2, shallow) { 1567 const instrumentations = createInstrumentations(isReadonly2, shallow); 1568 return (target, key, receiver) => { 1569 if (key === "__v_isReactive") { 1570 return !isReadonly2; 1571 } else if (key === "__v_isReadonly") { 1572 return isReadonly2; 1573 } else if (key === "__v_raw") { 1574 return target; 1575 } 1576 return Reflect.get( 1577 hasOwn(instrumentations, key) && key in target ? instrumentations : target, 1578 key, 1579 receiver 1580 ); 1581 }; 1582 } 1583 var mutableCollectionHandlers = { 1584 get: createInstrumentationGetter(false, false) 1585 }; 1586 var shallowCollectionHandlers = { 1587 get: createInstrumentationGetter(false, true) 1588 }; 1589 var readonlyCollectionHandlers = { 1590 get: createInstrumentationGetter(true, false) 1591 }; 1592 var shallowReadonlyCollectionHandlers = { 1593 get: createInstrumentationGetter(true, true) 1594 }; 1595 function checkIdentityKeys(target, has, key) { 1596 const rawKey = toRaw(key); 1597 if (rawKey !== key && has.call(target, rawKey)) { 1598 const type = toRawType(target); 1599 warn( 1600 `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` 1601 ); 1602 } 1603 } 1604 var reactiveMap = /* @__PURE__ */ new WeakMap(); 1605 var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); 1606 var readonlyMap = /* @__PURE__ */ new WeakMap(); 1607 var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); 1608 function targetTypeMap(rawType) { 1609 switch (rawType) { 1610 case "Object": 1611 case "Array": 1612 return 1; 1613 case "Map": 1614 case "Set": 1615 case "WeakMap": 1616 case "WeakSet": 1617 return 2; 1618 default: 1619 return 0; 1620 } 1621 } 1622 function reactive(target) { 1623 if (isReadonly(target)) { 1624 return target; 1625 } 1626 return createReactiveObject( 1627 target, 1628 false, 1629 mutableHandlers, 1630 mutableCollectionHandlers, 1631 reactiveMap 1632 ); 1633 } 1634 function shallowReactive(target) { 1635 return createReactiveObject( 1636 target, 1637 false, 1638 shallowReactiveHandlers, 1639 shallowCollectionHandlers, 1640 shallowReactiveMap 1641 ); 1642 } 1643 function readonly(target) { 1644 return createReactiveObject( 1645 target, 1646 true, 1647 readonlyHandlers, 1648 readonlyCollectionHandlers, 1649 readonlyMap 1650 ); 1651 } 1652 function shallowReadonly(target) { 1653 return createReactiveObject( 1654 target, 1655 true, 1656 shallowReadonlyHandlers, 1657 shallowReadonlyCollectionHandlers, 1658 shallowReadonlyMap 1659 ); 1660 } 1661 function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { 1662 if (!isObject(target)) { 1663 if (true) { 1664 warn( 1665 `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( 1666 target 1667 )}` 1668 ); 1669 } 1670 return target; 1671 } 1672 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { 1673 return target; 1674 } 1675 if (target["__v_skip"] || !Object.isExtensible(target)) { 1676 return target; 1677 } 1678 const existingProxy = proxyMap.get(target); 1679 if (existingProxy) { 1680 return existingProxy; 1681 } 1682 const targetType = targetTypeMap(toRawType(target)); 1683 if (targetType === 0) { 1684 return target; 1685 } 1686 const proxy = new Proxy( 1687 target, 1688 targetType === 2 ? collectionHandlers : baseHandlers 1689 ); 1690 proxyMap.set(target, proxy); 1691 return proxy; 1692 } 1693 function isReactive(value) { 1694 if (isReadonly(value)) { 1695 return isReactive(value["__v_raw"]); 1696 } 1697 return !!(value && value["__v_isReactive"]); 1698 } 1699 function isReadonly(value) { 1700 return !!(value && value["__v_isReadonly"]); 1701 } 1702 function isShallow(value) { 1703 return !!(value && value["__v_isShallow"]); 1704 } 1705 function isProxy(value) { 1706 return value ? !!value["__v_raw"] : false; 1707 } 1708 function toRaw(observed) { 1709 const raw = observed && observed["__v_raw"]; 1710 return raw ? toRaw(raw) : observed; 1711 } 1712 function markRaw(value) { 1713 if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { 1714 def(value, "__v_skip", true); 1715 } 1716 return value; 1717 } 1718 var toReactive = (value) => isObject(value) ? reactive(value) : value; 1719 var toReadonly = (value) => isObject(value) ? readonly(value) : value; 1720 function isRef2(r) { 1721 return r ? r["__v_isRef"] === true : false; 1722 } 1723 function ref(value) { 1724 return createRef(value, false); 1725 } 1726 function shallowRef(value) { 1727 return createRef(value, true); 1728 } 1729 function createRef(rawValue, shallow) { 1730 if (isRef2(rawValue)) { 1731 return rawValue; 1732 } 1733 return new RefImpl(rawValue, shallow); 1734 } 1735 var RefImpl = class { 1736 constructor(value, isShallow2) { 1737 this.dep = new Dep(); 1738 this["__v_isRef"] = true; 1739 this["__v_isShallow"] = false; 1740 this._rawValue = isShallow2 ? value : toRaw(value); 1741 this._value = isShallow2 ? value : toReactive(value); 1742 this["__v_isShallow"] = isShallow2; 1743 } 1744 get value() { 1745 if (true) { 1746 this.dep.track({ 1747 target: this, 1748 type: "get", 1749 key: "value" 1750 }); 1751 } else { 1752 this.dep.track(); 1753 } 1754 return this._value; 1755 } 1756 set value(newValue) { 1757 const oldValue = this._rawValue; 1758 const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); 1759 newValue = useDirectValue ? newValue : toRaw(newValue); 1760 if (hasChanged(newValue, oldValue)) { 1761 this._rawValue = newValue; 1762 this._value = useDirectValue ? newValue : toReactive(newValue); 1763 if (true) { 1764 this.dep.trigger({ 1765 target: this, 1766 type: "set", 1767 key: "value", 1768 newValue, 1769 oldValue 1770 }); 1771 } else { 1772 this.dep.trigger(); 1773 } 1774 } 1775 } 1776 }; 1777 function triggerRef(ref2) { 1778 if (ref2.dep) { 1779 if (true) { 1780 ref2.dep.trigger({ 1781 target: ref2, 1782 type: "set", 1783 key: "value", 1784 newValue: ref2._value 1785 }); 1786 } else { 1787 ref2.dep.trigger(); 1788 } 1789 } 1790 } 1791 function unref(ref2) { 1792 return isRef2(ref2) ? ref2.value : ref2; 1793 } 1794 function toValue(source) { 1795 return isFunction(source) ? source() : unref(source); 1796 } 1797 var shallowUnwrapHandlers = { 1798 get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), 1799 set: (target, key, value, receiver) => { 1800 const oldValue = target[key]; 1801 if (isRef2(oldValue) && !isRef2(value)) { 1802 oldValue.value = value; 1803 return true; 1804 } else { 1805 return Reflect.set(target, key, value, receiver); 1806 } 1807 } 1808 }; 1809 function proxyRefs(objectWithRefs) { 1810 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); 1811 } 1812 var CustomRefImpl = class { 1813 constructor(factory) { 1814 this["__v_isRef"] = true; 1815 this._value = void 0; 1816 const dep = this.dep = new Dep(); 1817 const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); 1818 this._get = get; 1819 this._set = set; 1820 } 1821 get value() { 1822 return this._value = this._get(); 1823 } 1824 set value(newVal) { 1825 this._set(newVal); 1826 } 1827 }; 1828 function customRef(factory) { 1829 return new CustomRefImpl(factory); 1830 } 1831 function toRefs(object) { 1832 if (!isProxy(object)) { 1833 warn(`toRefs() expects a reactive object but received a plain one.`); 1834 } 1835 const ret = isArray(object) ? new Array(object.length) : {}; 1836 for (const key in object) { 1837 ret[key] = propertyToRef(object, key); 1838 } 1839 return ret; 1840 } 1841 var ObjectRefImpl = class { 1842 constructor(_object, key, _defaultValue) { 1843 this._object = _object; 1844 this._defaultValue = _defaultValue; 1845 this["__v_isRef"] = true; 1846 this._value = void 0; 1847 this._key = isSymbol(key) ? key : String(key); 1848 this._raw = toRaw(_object); 1849 let shallow = true; 1850 let obj = _object; 1851 if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) { 1852 do { 1853 shallow = !isProxy(obj) || isShallow(obj); 1854 } while (shallow && (obj = obj["__v_raw"])); 1855 } 1856 this._shallow = shallow; 1857 } 1858 get value() { 1859 let val = this._object[this._key]; 1860 if (this._shallow) { 1861 val = unref(val); 1862 } 1863 return this._value = val === void 0 ? this._defaultValue : val; 1864 } 1865 set value(newVal) { 1866 if (this._shallow && isRef2(this._raw[this._key])) { 1867 const nestedRef = this._object[this._key]; 1868 if (isRef2(nestedRef)) { 1869 nestedRef.value = newVal; 1870 return; 1871 } 1872 } 1873 this._object[this._key] = newVal; 1874 } 1875 get dep() { 1876 return getDepFromReactive(this._raw, this._key); 1877 } 1878 }; 1879 var GetterRefImpl = class { 1880 constructor(_getter) { 1881 this._getter = _getter; 1882 this["__v_isRef"] = true; 1883 this["__v_isReadonly"] = true; 1884 this._value = void 0; 1885 } 1886 get value() { 1887 return this._value = this._getter(); 1888 } 1889 }; 1890 function toRef(source, key, defaultValue) { 1891 if (isRef2(source)) { 1892 return source; 1893 } else if (isFunction(source)) { 1894 return new GetterRefImpl(source); 1895 } else if (isObject(source) && arguments.length > 1) { 1896 return propertyToRef(source, key, defaultValue); 1897 } else { 1898 return ref(source); 1899 } 1900 } 1901 function propertyToRef(source, key, defaultValue) { 1902 return new ObjectRefImpl(source, key, defaultValue); 1903 } 1904 var ComputedRefImpl = class { 1905 constructor(fn, setter, isSSR) { 1906 this.fn = fn; 1907 this.setter = setter; 1908 this._value = void 0; 1909 this.dep = new Dep(this); 1910 this.__v_isRef = true; 1911 this.deps = void 0; 1912 this.depsTail = void 0; 1913 this.flags = 16; 1914 this.globalVersion = globalVersion - 1; 1915 this.next = void 0; 1916 this.effect = this; 1917 this["__v_isReadonly"] = !setter; 1918 this.isSSR = isSSR; 1919 } 1920 /** 1921 * @internal 1922 */ 1923 notify() { 1924 this.flags |= 16; 1925 if (!(this.flags & 8) && // avoid infinite self recursion 1926 activeSub !== this) { 1927 batch(this, true); 1928 return true; 1929 } else if (true) ; 1930 } 1931 get value() { 1932 const link = true ? this.dep.track({ 1933 target: this, 1934 type: "get", 1935 key: "value" 1936 }) : this.dep.track(); 1937 refreshComputed(this); 1938 if (link) { 1939 link.version = this.dep.version; 1940 } 1941 return this._value; 1942 } 1943 set value(newValue) { 1944 if (this.setter) { 1945 this.setter(newValue); 1946 } else if (true) { 1947 warn("Write operation failed: computed value is readonly"); 1948 } 1949 } 1950 }; 1951 function computed(getterOrOptions, debugOptions, isSSR = false) { 1952 let getter; 1953 let setter; 1954 if (isFunction(getterOrOptions)) { 1955 getter = getterOrOptions; 1956 } else { 1957 getter = getterOrOptions.get; 1958 setter = getterOrOptions.set; 1959 } 1960 const cRef = new ComputedRefImpl(getter, setter, isSSR); 1961 if (debugOptions && !isSSR) { 1962 cRef.onTrack = debugOptions.onTrack; 1963 cRef.onTrigger = debugOptions.onTrigger; 1964 } 1965 return cRef; 1966 } 1967 var TrackOpTypes = { 1968 "GET": "get", 1969 "HAS": "has", 1970 "ITERATE": "iterate" 1971 }; 1972 var TriggerOpTypes = { 1973 "SET": "set", 1974 "ADD": "add", 1975 "DELETE": "delete", 1976 "CLEAR": "clear" 1977 }; 1978 var INITIAL_WATCHER_VALUE = {}; 1979 var cleanupMap = /* @__PURE__ */ new WeakMap(); 1980 var activeWatcher = void 0; 1981 function getCurrentWatcher() { 1982 return activeWatcher; 1983 } 1984 function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { 1985 if (owner) { 1986 let cleanups = cleanupMap.get(owner); 1987 if (!cleanups) cleanupMap.set(owner, cleanups = []); 1988 cleanups.push(cleanupFn); 1989 } else if (!failSilently) { 1990 warn( 1991 `onWatcherCleanup() was called when there was no active watcher to associate with.` 1992 ); 1993 } 1994 } 1995 function watch(source, cb, options = EMPTY_OBJ) { 1996 const { immediate, deep, once, scheduler, augmentJob, call } = options; 1997 const warnInvalidSource = (s) => { 1998 (options.onWarn || warn)( 1999 `Invalid watch source: `, 2000 s, 2001 `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` 2002 ); 2003 }; 2004 const reactiveGetter = (source2) => { 2005 if (deep) return source2; 2006 if (isShallow(source2) || deep === false || deep === 0) 2007 return traverse(source2, 1); 2008 return traverse(source2); 2009 }; 2010 let effect2; 2011 let getter; 2012 let cleanup; 2013 let boundCleanup; 2014 let forceTrigger = false; 2015 let isMultiSource = false; 2016 if (isRef2(source)) { 2017 getter = () => source.value; 2018 forceTrigger = isShallow(source); 2019 } else if (isReactive(source)) { 2020 getter = () => reactiveGetter(source); 2021 forceTrigger = true; 2022 } else if (isArray(source)) { 2023 isMultiSource = true; 2024 forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); 2025 getter = () => source.map((s) => { 2026 if (isRef2(s)) { 2027 return s.value; 2028 } else if (isReactive(s)) { 2029 return reactiveGetter(s); 2030 } else if (isFunction(s)) { 2031 return call ? call(s, 2) : s(); 2032 } else { 2033 warnInvalidSource(s); 2034 } 2035 }); 2036 } else if (isFunction(source)) { 2037 if (cb) { 2038 getter = call ? () => call(source, 2) : source; 2039 } else { 2040 getter = () => { 2041 if (cleanup) { 2042 pauseTracking(); 2043 try { 2044 cleanup(); 2045 } finally { 2046 resetTracking(); 2047 } 2048 } 2049 const currentEffect = activeWatcher; 2050 activeWatcher = effect2; 2051 try { 2052 return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); 2053 } finally { 2054 activeWatcher = currentEffect; 2055 } 2056 }; 2057 } 2058 } else { 2059 getter = NOOP; 2060 warnInvalidSource(source); 2061 } 2062 if (cb && deep) { 2063 const baseGetter = getter; 2064 const depth = deep === true ? Infinity : deep; 2065 getter = () => traverse(baseGetter(), depth); 2066 } 2067 const scope = getCurrentScope(); 2068 const watchHandle = () => { 2069 effect2.stop(); 2070 if (scope && scope.active) { 2071 remove(scope.effects, effect2); 2072 } 2073 }; 2074 if (once && cb) { 2075 const _cb = cb; 2076 cb = (...args) => { 2077 const res = _cb(...args); 2078 watchHandle(); 2079 return res; 2080 }; 2081 } 2082 let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; 2083 const job = (immediateFirstRun) => { 2084 if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) { 2085 return; 2086 } 2087 if (cb) { 2088 const newValue = effect2.run(); 2089 if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { 2090 if (cleanup) { 2091 cleanup(); 2092 } 2093 const currentWatcher = activeWatcher; 2094 activeWatcher = effect2; 2095 try { 2096 const args = [ 2097 newValue, 2098 // pass undefined as the old value when it's changed for the first time 2099 oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, 2100 boundCleanup 2101 ]; 2102 oldValue = newValue; 2103 call ? call(cb, 3, args) : ( 2104 // @ts-expect-error 2105 cb(...args) 2106 ); 2107 } finally { 2108 activeWatcher = currentWatcher; 2109 } 2110 } 2111 } else { 2112 effect2.run(); 2113 } 2114 }; 2115 if (augmentJob) { 2116 augmentJob(job); 2117 } 2118 effect2 = new ReactiveEffect(getter); 2119 effect2.scheduler = scheduler ? () => scheduler(job, false) : job; 2120 boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2); 2121 cleanup = effect2.onStop = () => { 2122 const cleanups = cleanupMap.get(effect2); 2123 if (cleanups) { 2124 if (call) { 2125 call(cleanups, 4); 2126 } else { 2127 for (const cleanup2 of cleanups) cleanup2(); 2128 } 2129 cleanupMap.delete(effect2); 2130 } 2131 }; 2132 if (true) { 2133 effect2.onTrack = options.onTrack; 2134 effect2.onTrigger = options.onTrigger; 2135 } 2136 if (cb) { 2137 if (immediate) { 2138 job(true); 2139 } else { 2140 oldValue = effect2.run(); 2141 } 2142 } else if (scheduler) { 2143 scheduler(job.bind(null, true), true); 2144 } else { 2145 effect2.run(); 2146 } 2147 watchHandle.pause = effect2.pause.bind(effect2); 2148 watchHandle.resume = effect2.resume.bind(effect2); 2149 watchHandle.stop = watchHandle; 2150 return watchHandle; 2151 } 2152 function traverse(value, depth = Infinity, seen) { 2153 if (depth <= 0 || !isObject(value) || value["__v_skip"]) { 2154 return value; 2155 } 2156 seen = seen || /* @__PURE__ */ new Map(); 2157 if ((seen.get(value) || 0) >= depth) { 2158 return value; 2159 } 2160 seen.set(value, depth); 2161 depth--; 2162 if (isRef2(value)) { 2163 traverse(value.value, depth, seen); 2164 } else if (isArray(value)) { 2165 for (let i = 0; i < value.length; i++) { 2166 traverse(value[i], depth, seen); 2167 } 2168 } else if (isSet(value) || isMap(value)) { 2169 value.forEach((v) => { 2170 traverse(v, depth, seen); 2171 }); 2172 } else if (isPlainObject(value)) { 2173 for (const key in value) { 2174 traverse(value[key], depth, seen); 2175 } 2176 for (const key of Object.getOwnPropertySymbols(value)) { 2177 if (Object.prototype.propertyIsEnumerable.call(value, key)) { 2178 traverse(value[key], depth, seen); 2179 } 2180 } 2181 } 2182 return value; 2183 } 2184 2185 // node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js 2186 var stack = []; 2187 function pushWarningContext(vnode) { 2188 stack.push(vnode); 2189 } 2190 function popWarningContext() { 2191 stack.pop(); 2192 } 2193 var isWarning = false; 2194 function warn$1(msg, ...args) { 2195 if (isWarning) return; 2196 isWarning = true; 2197 pauseTracking(); 2198 const instance = stack.length ? stack[stack.length - 1].component : null; 2199 const appWarnHandler = instance && instance.appContext.config.warnHandler; 2200 const trace = getComponentTrace(); 2201 if (appWarnHandler) { 2202 callWithErrorHandling( 2203 appWarnHandler, 2204 instance, 2205 11, 2206 [ 2207 // eslint-disable-next-line no-restricted-syntax 2208 msg + args.map((a) => { 2209 var _a, _b; 2210 return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); 2211 }).join(""), 2212 instance && instance.proxy, 2213 trace.map( 2214 ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` 2215 ).join("\n"), 2216 trace 2217 ] 2218 ); 2219 } else { 2220 const warnArgs = [`[Vue warn]: ${msg}`, ...args]; 2221 if (trace.length && // avoid spamming console during tests 2222 true) { 2223 warnArgs.push(` 2224 `, ...formatTrace(trace)); 2225 } 2226 console.warn(...warnArgs); 2227 } 2228 resetTracking(); 2229 isWarning = false; 2230 } 2231 function getComponentTrace() { 2232 let currentVNode = stack[stack.length - 1]; 2233 if (!currentVNode) { 2234 return []; 2235 } 2236 const normalizedStack = []; 2237 while (currentVNode) { 2238 const last = normalizedStack[0]; 2239 if (last && last.vnode === currentVNode) { 2240 last.recurseCount++; 2241 } else { 2242 normalizedStack.push({ 2243 vnode: currentVNode, 2244 recurseCount: 0 2245 }); 2246 } 2247 const parentInstance = currentVNode.component && currentVNode.component.parent; 2248 currentVNode = parentInstance && parentInstance.vnode; 2249 } 2250 return normalizedStack; 2251 } 2252 function formatTrace(trace) { 2253 const logs = []; 2254 trace.forEach((entry, i) => { 2255 logs.push(...i === 0 ? [] : [` 2256 `], ...formatTraceEntry(entry)); 2257 }); 2258 return logs; 2259 } 2260 function formatTraceEntry({ vnode, recurseCount }) { 2261 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; 2262 const isRoot = vnode.component ? vnode.component.parent == null : false; 2263 const open = ` at <${formatComponentName( 2264 vnode.component, 2265 vnode.type, 2266 isRoot 2267 )}`; 2268 const close = `>` + postfix; 2269 return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; 2270 } 2271 function formatProps(props) { 2272 const res = []; 2273 const keys = Object.keys(props); 2274 keys.slice(0, 3).forEach((key) => { 2275 res.push(...formatProp(key, props[key])); 2276 }); 2277 if (keys.length > 3) { 2278 res.push(` ...`); 2279 } 2280 return res; 2281 } 2282 function formatProp(key, value, raw) { 2283 if (isString(value)) { 2284 value = JSON.stringify(value); 2285 return raw ? value : [`${key}=${value}`]; 2286 } else if (typeof value === "number" || typeof value === "boolean" || value == null) { 2287 return raw ? value : [`${key}=${value}`]; 2288 } else if (isRef2(value)) { 2289 value = formatProp(key, toRaw(value.value), true); 2290 return raw ? value : [`${key}=Ref<`, value, `>`]; 2291 } else if (isFunction(value)) { 2292 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; 2293 } else { 2294 value = toRaw(value); 2295 return raw ? value : [`${key}=`, value]; 2296 } 2297 } 2298 function assertNumber(val, type) { 2299 if (false) return; 2300 if (val === void 0) { 2301 return; 2302 } else if (typeof val !== "number") { 2303 warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); 2304 } else if (isNaN(val)) { 2305 warn$1(`${type} is NaN - the duration expression might be incorrect.`); 2306 } 2307 } 2308 var ErrorCodes = { 2309 "SETUP_FUNCTION": 0, 2310 "0": "SETUP_FUNCTION", 2311 "RENDER_FUNCTION": 1, 2312 "1": "RENDER_FUNCTION", 2313 "NATIVE_EVENT_HANDLER": 5, 2314 "5": "NATIVE_EVENT_HANDLER", 2315 "COMPONENT_EVENT_HANDLER": 6, 2316 "6": "COMPONENT_EVENT_HANDLER", 2317 "VNODE_HOOK": 7, 2318 "7": "VNODE_HOOK", 2319 "DIRECTIVE_HOOK": 8, 2320 "8": "DIRECTIVE_HOOK", 2321 "TRANSITION_HOOK": 9, 2322 "9": "TRANSITION_HOOK", 2323 "APP_ERROR_HANDLER": 10, 2324 "10": "APP_ERROR_HANDLER", 2325 "APP_WARN_HANDLER": 11, 2326 "11": "APP_WARN_HANDLER", 2327 "FUNCTION_REF": 12, 2328 "12": "FUNCTION_REF", 2329 "ASYNC_COMPONENT_LOADER": 13, 2330 "13": "ASYNC_COMPONENT_LOADER", 2331 "SCHEDULER": 14, 2332 "14": "SCHEDULER", 2333 "COMPONENT_UPDATE": 15, 2334 "15": "COMPONENT_UPDATE", 2335 "APP_UNMOUNT_CLEANUP": 16, 2336 "16": "APP_UNMOUNT_CLEANUP" 2337 }; 2338 var ErrorTypeStrings$1 = { 2339 ["sp"]: "serverPrefetch hook", 2340 ["bc"]: "beforeCreate hook", 2341 ["c"]: "created hook", 2342 ["bm"]: "beforeMount hook", 2343 ["m"]: "mounted hook", 2344 ["bu"]: "beforeUpdate hook", 2345 ["u"]: "updated", 2346 ["bum"]: "beforeUnmount hook", 2347 ["um"]: "unmounted hook", 2348 ["a"]: "activated hook", 2349 ["da"]: "deactivated hook", 2350 ["ec"]: "errorCaptured hook", 2351 ["rtc"]: "renderTracked hook", 2352 ["rtg"]: "renderTriggered hook", 2353 [0]: "setup function", 2354 [1]: "render function", 2355 [2]: "watcher getter", 2356 [3]: "watcher callback", 2357 [4]: "watcher cleanup function", 2358 [5]: "native event handler", 2359 [6]: "component event handler", 2360 [7]: "vnode hook", 2361 [8]: "directive hook", 2362 [9]: "transition hook", 2363 [10]: "app errorHandler", 2364 [11]: "app warnHandler", 2365 [12]: "ref function", 2366 [13]: "async component loader", 2367 [14]: "scheduler flush", 2368 [15]: "component update", 2369 [16]: "app unmount cleanup function" 2370 }; 2371 function callWithErrorHandling(fn, instance, type, args) { 2372 try { 2373 return args ? fn(...args) : fn(); 2374 } catch (err) { 2375 handleError(err, instance, type); 2376 } 2377 } 2378 function callWithAsyncErrorHandling(fn, instance, type, args) { 2379 if (isFunction(fn)) { 2380 const res = callWithErrorHandling(fn, instance, type, args); 2381 if (res && isPromise(res)) { 2382 res.catch((err) => { 2383 handleError(err, instance, type); 2384 }); 2385 } 2386 return res; 2387 } 2388 if (isArray(fn)) { 2389 const values = []; 2390 for (let i = 0; i < fn.length; i++) { 2391 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); 2392 } 2393 return values; 2394 } else if (true) { 2395 warn$1( 2396 `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` 2397 ); 2398 } 2399 } 2400 function handleError(err, instance, type, throwInDev = true) { 2401 const contextVNode = instance ? instance.vnode : null; 2402 const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; 2403 if (instance) { 2404 let cur = instance.parent; 2405 const exposedInstance = instance.proxy; 2406 const errorInfo = true ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; 2407 while (cur) { 2408 const errorCapturedHooks = cur.ec; 2409 if (errorCapturedHooks) { 2410 for (let i = 0; i < errorCapturedHooks.length; i++) { 2411 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { 2412 return; 2413 } 2414 } 2415 } 2416 cur = cur.parent; 2417 } 2418 if (errorHandler) { 2419 pauseTracking(); 2420 callWithErrorHandling(errorHandler, null, 10, [ 2421 err, 2422 exposedInstance, 2423 errorInfo 2424 ]); 2425 resetTracking(); 2426 return; 2427 } 2428 } 2429 logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); 2430 } 2431 function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { 2432 if (true) { 2433 const info = ErrorTypeStrings$1[type]; 2434 if (contextVNode) { 2435 pushWarningContext(contextVNode); 2436 } 2437 warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); 2438 if (contextVNode) { 2439 popWarningContext(); 2440 } 2441 if (throwInDev) { 2442 throw err; 2443 } else { 2444 console.error(err); 2445 } 2446 } else if (throwInProd) { 2447 throw err; 2448 } else { 2449 console.error(err); 2450 } 2451 } 2452 var queue = []; 2453 var flushIndex = -1; 2454 var pendingPostFlushCbs = []; 2455 var activePostFlushCbs = null; 2456 var postFlushIndex = 0; 2457 var resolvedPromise = Promise.resolve(); 2458 var currentFlushPromise = null; 2459 var RECURSION_LIMIT = 100; 2460 function nextTick(fn) { 2461 const p2 = currentFlushPromise || resolvedPromise; 2462 return fn ? p2.then(this ? fn.bind(this) : fn) : p2; 2463 } 2464 function findInsertionIndex(id) { 2465 let start = flushIndex + 1; 2466 let end = queue.length; 2467 while (start < end) { 2468 const middle = start + end >>> 1; 2469 const middleJob = queue[middle]; 2470 const middleJobId = getId(middleJob); 2471 if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { 2472 start = middle + 1; 2473 } else { 2474 end = middle; 2475 } 2476 } 2477 return start; 2478 } 2479 function queueJob(job) { 2480 if (!(job.flags & 1)) { 2481 const jobId = getId(job); 2482 const lastJob = queue[queue.length - 1]; 2483 if (!lastJob || // fast path when the job id is larger than the tail 2484 !(job.flags & 2) && jobId >= getId(lastJob)) { 2485 queue.push(job); 2486 } else { 2487 queue.splice(findInsertionIndex(jobId), 0, job); 2488 } 2489 job.flags |= 1; 2490 queueFlush(); 2491 } 2492 } 2493 function queueFlush() { 2494 if (!currentFlushPromise) { 2495 currentFlushPromise = resolvedPromise.then(flushJobs); 2496 } 2497 } 2498 function queuePostFlushCb(cb) { 2499 if (!isArray(cb)) { 2500 if (activePostFlushCbs && cb.id === -1) { 2501 activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); 2502 } else if (!(cb.flags & 1)) { 2503 pendingPostFlushCbs.push(cb); 2504 cb.flags |= 1; 2505 } 2506 } else { 2507 pendingPostFlushCbs.push(...cb); 2508 } 2509 queueFlush(); 2510 } 2511 function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { 2512 if (true) { 2513 seen = seen || /* @__PURE__ */ new Map(); 2514 } 2515 for (; i < queue.length; i++) { 2516 const cb = queue[i]; 2517 if (cb && cb.flags & 2) { 2518 if (instance && cb.id !== instance.uid) { 2519 continue; 2520 } 2521 if (checkRecursiveUpdates(seen, cb)) { 2522 continue; 2523 } 2524 queue.splice(i, 1); 2525 i--; 2526 if (cb.flags & 4) { 2527 cb.flags &= -2; 2528 } 2529 cb(); 2530 if (!(cb.flags & 4)) { 2531 cb.flags &= -2; 2532 } 2533 } 2534 } 2535 } 2536 function flushPostFlushCbs(seen) { 2537 if (pendingPostFlushCbs.length) { 2538 const deduped = [...new Set(pendingPostFlushCbs)].sort( 2539 (a, b) => getId(a) - getId(b) 2540 ); 2541 pendingPostFlushCbs.length = 0; 2542 if (activePostFlushCbs) { 2543 activePostFlushCbs.push(...deduped); 2544 return; 2545 } 2546 activePostFlushCbs = deduped; 2547 if (true) { 2548 seen = seen || /* @__PURE__ */ new Map(); 2549 } 2550 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { 2551 const cb = activePostFlushCbs[postFlushIndex]; 2552 if (checkRecursiveUpdates(seen, cb)) { 2553 continue; 2554 } 2555 if (cb.flags & 4) { 2556 cb.flags &= -2; 2557 } 2558 if (!(cb.flags & 8)) cb(); 2559 cb.flags &= -2; 2560 } 2561 activePostFlushCbs = null; 2562 postFlushIndex = 0; 2563 } 2564 } 2565 var getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; 2566 function flushJobs(seen) { 2567 if (true) { 2568 seen = seen || /* @__PURE__ */ new Map(); 2569 } 2570 const check = true ? (job) => checkRecursiveUpdates(seen, job) : NOOP; 2571 try { 2572 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { 2573 const job = queue[flushIndex]; 2574 if (job && !(job.flags & 8)) { 2575 if (check(job)) { 2576 continue; 2577 } 2578 if (job.flags & 4) { 2579 job.flags &= ~1; 2580 } 2581 callWithErrorHandling( 2582 job, 2583 job.i, 2584 job.i ? 15 : 14 2585 ); 2586 if (!(job.flags & 4)) { 2587 job.flags &= ~1; 2588 } 2589 } 2590 } 2591 } finally { 2592 for (; flushIndex < queue.length; flushIndex++) { 2593 const job = queue[flushIndex]; 2594 if (job) { 2595 job.flags &= -2; 2596 } 2597 } 2598 flushIndex = -1; 2599 queue.length = 0; 2600 flushPostFlushCbs(seen); 2601 currentFlushPromise = null; 2602 if (queue.length || pendingPostFlushCbs.length) { 2603 flushJobs(seen); 2604 } 2605 } 2606 } 2607 function checkRecursiveUpdates(seen, fn) { 2608 const count = seen.get(fn) || 0; 2609 if (count > RECURSION_LIMIT) { 2610 const instance = fn.i; 2611 const componentName = instance && getComponentName(instance.type); 2612 handleError( 2613 `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, 2614 null, 2615 10 2616 ); 2617 return true; 2618 } 2619 seen.set(fn, count + 1); 2620 return false; 2621 } 2622 var isHmrUpdating = false; 2623 var setHmrUpdating = (v) => { 2624 try { 2625 return isHmrUpdating; 2626 } finally { 2627 isHmrUpdating = v; 2628 } 2629 }; 2630 var hmrDirtyComponents = /* @__PURE__ */ new Map(); 2631 if (true) { 2632 getGlobalThis().__VUE_HMR_RUNTIME__ = { 2633 createRecord: tryWrap(createRecord), 2634 rerender: tryWrap(rerender), 2635 reload: tryWrap(reload) 2636 }; 2637 } 2638 var map = /* @__PURE__ */ new Map(); 2639 function registerHMR(instance) { 2640 const id = instance.type.__hmrId; 2641 let record = map.get(id); 2642 if (!record) { 2643 createRecord(id, instance.type); 2644 record = map.get(id); 2645 } 2646 record.instances.add(instance); 2647 } 2648 function unregisterHMR(instance) { 2649 map.get(instance.type.__hmrId).instances.delete(instance); 2650 } 2651 function createRecord(id, initialDef) { 2652 if (map.has(id)) { 2653 return false; 2654 } 2655 map.set(id, { 2656 initialDef: normalizeClassComponent(initialDef), 2657 instances: /* @__PURE__ */ new Set() 2658 }); 2659 return true; 2660 } 2661 function normalizeClassComponent(component) { 2662 return isClassComponent(component) ? component.__vccOpts : component; 2663 } 2664 function rerender(id, newRender) { 2665 const record = map.get(id); 2666 if (!record) { 2667 return; 2668 } 2669 record.initialDef.render = newRender; 2670 [...record.instances].forEach((instance) => { 2671 if (newRender) { 2672 instance.render = newRender; 2673 normalizeClassComponent(instance.type).render = newRender; 2674 } 2675 instance.renderCache = []; 2676 isHmrUpdating = true; 2677 if (!(instance.job.flags & 8)) { 2678 instance.update(); 2679 } 2680 isHmrUpdating = false; 2681 }); 2682 } 2683 function reload(id, newComp) { 2684 const record = map.get(id); 2685 if (!record) return; 2686 newComp = normalizeClassComponent(newComp); 2687 updateComponentDef(record.initialDef, newComp); 2688 const instances = [...record.instances]; 2689 for (let i = 0; i < instances.length; i++) { 2690 const instance = instances[i]; 2691 const oldComp = normalizeClassComponent(instance.type); 2692 let dirtyInstances = hmrDirtyComponents.get(oldComp); 2693 if (!dirtyInstances) { 2694 if (oldComp !== record.initialDef) { 2695 updateComponentDef(oldComp, newComp); 2696 } 2697 hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); 2698 } 2699 dirtyInstances.add(instance); 2700 instance.appContext.propsCache.delete(instance.type); 2701 instance.appContext.emitsCache.delete(instance.type); 2702 instance.appContext.optionsCache.delete(instance.type); 2703 if (instance.ceReload) { 2704 dirtyInstances.add(instance); 2705 instance.ceReload(newComp.styles); 2706 dirtyInstances.delete(instance); 2707 } else if (instance.parent) { 2708 queueJob(() => { 2709 if (!(instance.job.flags & 8)) { 2710 isHmrUpdating = true; 2711 instance.parent.update(); 2712 isHmrUpdating = false; 2713 dirtyInstances.delete(instance); 2714 } 2715 }); 2716 } else if (instance.appContext.reload) { 2717 instance.appContext.reload(); 2718 } else if (typeof window !== "undefined") { 2719 window.location.reload(); 2720 } else { 2721 console.warn( 2722 "[HMR] Root or manually mounted instance modified. Full reload required." 2723 ); 2724 } 2725 if (instance.root.ce && instance !== instance.root) { 2726 instance.root.ce._removeChildStyle(oldComp); 2727 } 2728 } 2729 queuePostFlushCb(() => { 2730 hmrDirtyComponents.clear(); 2731 }); 2732 } 2733 function updateComponentDef(oldComp, newComp) { 2734 extend(oldComp, newComp); 2735 for (const key in oldComp) { 2736 if (key !== "__file" && !(key in newComp)) { 2737 delete oldComp[key]; 2738 } 2739 } 2740 } 2741 function tryWrap(fn) { 2742 return (id, arg) => { 2743 try { 2744 return fn(id, arg); 2745 } catch (e) { 2746 console.error(e); 2747 console.warn( 2748 `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` 2749 ); 2750 } 2751 }; 2752 } 2753 var devtools$1; 2754 var buffer = []; 2755 var devtoolsNotInstalled = false; 2756 function emit$1(event, ...args) { 2757 if (devtools$1) { 2758 devtools$1.emit(event, ...args); 2759 } else if (!devtoolsNotInstalled) { 2760 buffer.push({ event, args }); 2761 } 2762 } 2763 function setDevtoolsHook$1(hook, target) { 2764 var _a, _b; 2765 devtools$1 = hook; 2766 if (devtools$1) { 2767 devtools$1.enabled = true; 2768 buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); 2769 buffer = []; 2770 } else if ( 2771 // handle late devtools injection - only do this if we are in an actual 2772 // browser environment to avoid the timer handle stalling test runner exit 2773 // (#4815) 2774 typeof window !== "undefined" && // some envs mock window but not fully 2775 window.HTMLElement && // also exclude jsdom 2776 // eslint-disable-next-line no-restricted-syntax 2777 !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) 2778 ) { 2779 const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; 2780 replay.push((newHook) => { 2781 setDevtoolsHook$1(newHook, target); 2782 }); 2783 setTimeout(() => { 2784 if (!devtools$1) { 2785 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; 2786 devtoolsNotInstalled = true; 2787 buffer = []; 2788 } 2789 }, 3e3); 2790 } else { 2791 devtoolsNotInstalled = true; 2792 buffer = []; 2793 } 2794 } 2795 function devtoolsInitApp(app, version2) { 2796 emit$1("app:init", app, version2, { 2797 Fragment, 2798 Text, 2799 Comment, 2800 Static 2801 }); 2802 } 2803 function devtoolsUnmountApp(app) { 2804 emit$1("app:unmount", app); 2805 } 2806 var devtoolsComponentAdded = createDevtoolsComponentHook( 2807 "component:added" 2808 /* COMPONENT_ADDED */ 2809 ); 2810 var devtoolsComponentUpdated = createDevtoolsComponentHook( 2811 "component:updated" 2812 /* COMPONENT_UPDATED */ 2813 ); 2814 var _devtoolsComponentRemoved = createDevtoolsComponentHook( 2815 "component:removed" 2816 /* COMPONENT_REMOVED */ 2817 ); 2818 var devtoolsComponentRemoved = (component) => { 2819 if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered 2820 !devtools$1.cleanupBuffer(component)) { 2821 _devtoolsComponentRemoved(component); 2822 } 2823 }; 2824 function createDevtoolsComponentHook(hook) { 2825 return (component) => { 2826 emit$1( 2827 hook, 2828 component.appContext.app, 2829 component.uid, 2830 component.parent ? component.parent.uid : void 0, 2831 component 2832 ); 2833 }; 2834 } 2835 var devtoolsPerfStart = createDevtoolsPerformanceHook( 2836 "perf:start" 2837 /* PERFORMANCE_START */ 2838 ); 2839 var devtoolsPerfEnd = createDevtoolsPerformanceHook( 2840 "perf:end" 2841 /* PERFORMANCE_END */ 2842 ); 2843 function createDevtoolsPerformanceHook(hook) { 2844 return (component, type, time) => { 2845 emit$1(hook, component.appContext.app, component.uid, component, type, time); 2846 }; 2847 } 2848 function devtoolsComponentEmit(component, event, params) { 2849 emit$1( 2850 "component:emit", 2851 component.appContext.app, 2852 component, 2853 event, 2854 params 2855 ); 2856 } 2857 var currentRenderingInstance = null; 2858 var currentScopeId = null; 2859 function setCurrentRenderingInstance(instance) { 2860 const prev = currentRenderingInstance; 2861 currentRenderingInstance = instance; 2862 currentScopeId = instance && instance.type.__scopeId || null; 2863 return prev; 2864 } 2865 function pushScopeId(id) { 2866 currentScopeId = id; 2867 } 2868 function popScopeId() { 2869 currentScopeId = null; 2870 } 2871 var withScopeId = (_id) => withCtx; 2872 function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { 2873 if (!ctx) return fn; 2874 if (fn._n) { 2875 return fn; 2876 } 2877 const renderFnWithContext = (...args) => { 2878 if (renderFnWithContext._d) { 2879 setBlockTracking(-1); 2880 } 2881 const prevInstance = setCurrentRenderingInstance(ctx); 2882 let res; 2883 try { 2884 res = fn(...args); 2885 } finally { 2886 setCurrentRenderingInstance(prevInstance); 2887 if (renderFnWithContext._d) { 2888 setBlockTracking(1); 2889 } 2890 } 2891 if (true) { 2892 devtoolsComponentUpdated(ctx); 2893 } 2894 return res; 2895 }; 2896 renderFnWithContext._n = true; 2897 renderFnWithContext._c = true; 2898 renderFnWithContext._d = true; 2899 return renderFnWithContext; 2900 } 2901 function validateDirectiveName(name) { 2902 if (isBuiltInDirective(name)) { 2903 warn$1("Do not use built-in directive ids as custom directive id: " + name); 2904 } 2905 } 2906 function withDirectives(vnode, directives) { 2907 if (currentRenderingInstance === null) { 2908 warn$1(`withDirectives can only be used inside render functions.`); 2909 return vnode; 2910 } 2911 const instance = getComponentPublicInstance(currentRenderingInstance); 2912 const bindings = vnode.dirs || (vnode.dirs = []); 2913 for (let i = 0; i < directives.length; i++) { 2914 let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; 2915 if (dir) { 2916 if (isFunction(dir)) { 2917 dir = { 2918 mounted: dir, 2919 updated: dir 2920 }; 2921 } 2922 if (dir.deep) { 2923 traverse(value); 2924 } 2925 bindings.push({ 2926 dir, 2927 instance, 2928 value, 2929 oldValue: void 0, 2930 arg, 2931 modifiers 2932 }); 2933 } 2934 } 2935 return vnode; 2936 } 2937 function invokeDirectiveHook(vnode, prevVNode, instance, name) { 2938 const bindings = vnode.dirs; 2939 const oldBindings = prevVNode && prevVNode.dirs; 2940 for (let i = 0; i < bindings.length; i++) { 2941 const binding = bindings[i]; 2942 if (oldBindings) { 2943 binding.oldValue = oldBindings[i].value; 2944 } 2945 let hook = binding.dir[name]; 2946 if (hook) { 2947 pauseTracking(); 2948 callWithAsyncErrorHandling(hook, instance, 8, [ 2949 vnode.el, 2950 binding, 2951 vnode, 2952 prevVNode 2953 ]); 2954 resetTracking(); 2955 } 2956 } 2957 } 2958 function provide(key, value) { 2959 if (true) { 2960 if (!currentInstance || currentInstance.isMounted) { 2961 warn$1(`provide() can only be used inside setup().`); 2962 } 2963 } 2964 if (currentInstance) { 2965 let provides = currentInstance.provides; 2966 const parentProvides = currentInstance.parent && currentInstance.parent.provides; 2967 if (parentProvides === provides) { 2968 provides = currentInstance.provides = Object.create(parentProvides); 2969 } 2970 provides[key] = value; 2971 } 2972 } 2973 function inject(key, defaultValue, treatDefaultAsFactory = false) { 2974 const instance = getCurrentInstance(); 2975 if (instance || currentApp) { 2976 let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; 2977 if (provides && key in provides) { 2978 return provides[key]; 2979 } else if (arguments.length > 1) { 2980 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; 2981 } else if (true) { 2982 warn$1(`injection "${String(key)}" not found.`); 2983 } 2984 } else if (true) { 2985 warn$1(`inject() can only be used inside setup() or functional components.`); 2986 } 2987 } 2988 function hasInjectionContext() { 2989 return !!(getCurrentInstance() || currentApp); 2990 } 2991 var ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx"); 2992 var useSSRContext = () => { 2993 { 2994 const ctx = inject(ssrContextKey); 2995 if (!ctx) { 2996 warn$1( 2997 `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` 2998 ); 2999 } 3000 return ctx; 3001 } 3002 }; 3003 function watchEffect(effect2, options) { 3004 return doWatch(effect2, null, options); 3005 } 3006 function watchPostEffect(effect2, options) { 3007 return doWatch( 3008 effect2, 3009 null, 3010 true ? extend({}, options, { flush: "post" }) : { flush: "post" } 3011 ); 3012 } 3013 function watchSyncEffect(effect2, options) { 3014 return doWatch( 3015 effect2, 3016 null, 3017 true ? extend({}, options, { flush: "sync" }) : { flush: "sync" } 3018 ); 3019 } 3020 function watch2(source, cb, options) { 3021 if (!isFunction(cb)) { 3022 warn$1( 3023 `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` 3024 ); 3025 } 3026 return doWatch(source, cb, options); 3027 } 3028 function doWatch(source, cb, options = EMPTY_OBJ) { 3029 const { immediate, deep, flush, once } = options; 3030 if (!cb) { 3031 if (immediate !== void 0) { 3032 warn$1( 3033 `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` 3034 ); 3035 } 3036 if (deep !== void 0) { 3037 warn$1( 3038 `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` 3039 ); 3040 } 3041 if (once !== void 0) { 3042 warn$1( 3043 `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` 3044 ); 3045 } 3046 } 3047 const baseWatchOptions = extend({}, options); 3048 if (true) baseWatchOptions.onWarn = warn$1; 3049 const runsImmediately = cb && immediate || !cb && flush !== "post"; 3050 let ssrCleanup; 3051 if (isInSSRComponentSetup) { 3052 if (flush === "sync") { 3053 const ctx = useSSRContext(); 3054 ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); 3055 } else if (!runsImmediately) { 3056 const watchStopHandle = () => { 3057 }; 3058 watchStopHandle.stop = NOOP; 3059 watchStopHandle.resume = NOOP; 3060 watchStopHandle.pause = NOOP; 3061 return watchStopHandle; 3062 } 3063 } 3064 const instance = currentInstance; 3065 baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); 3066 let isPre = false; 3067 if (flush === "post") { 3068 baseWatchOptions.scheduler = (job) => { 3069 queuePostRenderEffect(job, instance && instance.suspense); 3070 }; 3071 } else if (flush !== "sync") { 3072 isPre = true; 3073 baseWatchOptions.scheduler = (job, isFirstRun) => { 3074 if (isFirstRun) { 3075 job(); 3076 } else { 3077 queueJob(job); 3078 } 3079 }; 3080 } 3081 baseWatchOptions.augmentJob = (job) => { 3082 if (cb) { 3083 job.flags |= 4; 3084 } 3085 if (isPre) { 3086 job.flags |= 2; 3087 if (instance) { 3088 job.id = instance.uid; 3089 job.i = instance; 3090 } 3091 } 3092 }; 3093 const watchHandle = watch(source, cb, baseWatchOptions); 3094 if (isInSSRComponentSetup) { 3095 if (ssrCleanup) { 3096 ssrCleanup.push(watchHandle); 3097 } else if (runsImmediately) { 3098 watchHandle(); 3099 } 3100 } 3101 return watchHandle; 3102 } 3103 function instanceWatch(source, value, options) { 3104 const publicThis = this.proxy; 3105 const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); 3106 let cb; 3107 if (isFunction(value)) { 3108 cb = value; 3109 } else { 3110 cb = value.handler; 3111 options = value; 3112 } 3113 const reset = setCurrentInstance(this); 3114 const res = doWatch(getter, cb.bind(publicThis), options); 3115 reset(); 3116 return res; 3117 } 3118 function createPathGetter(ctx, path) { 3119 const segments = path.split("."); 3120 return () => { 3121 let cur = ctx; 3122 for (let i = 0; i < segments.length && cur; i++) { 3123 cur = cur[segments[i]]; 3124 } 3125 return cur; 3126 }; 3127 } 3128 var pendingMounts = /* @__PURE__ */ new WeakMap(); 3129 var TeleportEndKey = /* @__PURE__ */ Symbol("_vte"); 3130 var isTeleport = (type) => type.__isTeleport; 3131 var isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); 3132 var isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); 3133 var isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; 3134 var isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; 3135 var resolveTarget = (props, select) => { 3136 const targetSelector = props && props.to; 3137 if (isString(targetSelector)) { 3138 if (!select) { 3139 warn$1( 3140 `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` 3141 ); 3142 return null; 3143 } else { 3144 const target = select(targetSelector); 3145 if (!target && !isTeleportDisabled(props)) { 3146 warn$1( 3147 `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.` 3148 ); 3149 } 3150 return target; 3151 } 3152 } else { 3153 if (!targetSelector && !isTeleportDisabled(props)) { 3154 warn$1(`Invalid Teleport target: ${targetSelector}`); 3155 } 3156 return targetSelector; 3157 } 3158 }; 3159 var TeleportImpl = { 3160 name: "Teleport", 3161 __isTeleport: true, 3162 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { 3163 const { 3164 mc: mountChildren, 3165 pc: patchChildren, 3166 pbc: patchBlockChildren, 3167 o: { insert, querySelector, createText, createComment, parentNode } 3168 } = internals; 3169 const disabled = isTeleportDisabled(n2.props); 3170 let { dynamicChildren } = n2; 3171 if (isHmrUpdating) { 3172 optimized = false; 3173 dynamicChildren = null; 3174 } 3175 const mount = (vnode, container2, anchor2) => { 3176 if (vnode.shapeFlag & 16) { 3177 mountChildren( 3178 vnode.children, 3179 container2, 3180 anchor2, 3181 parentComponent, 3182 parentSuspense, 3183 namespace, 3184 slotScopeIds, 3185 optimized 3186 ); 3187 } 3188 }; 3189 const mountToTarget = (vnode = n2) => { 3190 const disabled2 = isTeleportDisabled(vnode.props); 3191 const target = vnode.target = resolveTarget(vnode.props, querySelector); 3192 const targetAnchor = prepareAnchor(target, vnode, createText, insert); 3193 if (target) { 3194 if (namespace !== "svg" && isTargetSVG(target)) { 3195 namespace = "svg"; 3196 } else if (namespace !== "mathml" && isTargetMathML(target)) { 3197 namespace = "mathml"; 3198 } 3199 if (parentComponent && parentComponent.isCE) { 3200 (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target); 3201 } 3202 if (!disabled2) { 3203 mount(vnode, target, targetAnchor); 3204 updateCssVars(vnode, false); 3205 } 3206 } else if (!disabled2) { 3207 warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`); 3208 } 3209 }; 3210 const queuePendingMount = (vnode) => { 3211 const mountJob = () => { 3212 if (pendingMounts.get(vnode) !== mountJob) return; 3213 pendingMounts.delete(vnode); 3214 if (isTeleportDisabled(vnode.props)) { 3215 const mountContainer = parentNode(vnode.el) || container; 3216 mount(vnode, mountContainer, vnode.anchor); 3217 updateCssVars(vnode, true); 3218 } 3219 mountToTarget(vnode); 3220 }; 3221 pendingMounts.set(vnode, mountJob); 3222 queuePostRenderEffect(mountJob, parentSuspense); 3223 }; 3224 if (n1 == null) { 3225 const placeholder = n2.el = true ? createComment("teleport start") : createText(""); 3226 const mainAnchor = n2.anchor = true ? createComment("teleport end") : createText(""); 3227 insert(placeholder, container, anchor); 3228 insert(mainAnchor, container, anchor); 3229 if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) { 3230 queuePendingMount(n2); 3231 return; 3232 } 3233 if (disabled) { 3234 mount(n2, container, mainAnchor); 3235 updateCssVars(n2, true); 3236 } 3237 mountToTarget(); 3238 } else { 3239 n2.el = n1.el; 3240 const mainAnchor = n2.anchor = n1.anchor; 3241 const pendingMount = pendingMounts.get(n1); 3242 if (pendingMount) { 3243 pendingMount.flags |= 8; 3244 pendingMounts.delete(n1); 3245 queuePendingMount(n2); 3246 return; 3247 } 3248 n2.targetStart = n1.targetStart; 3249 const target = n2.target = n1.target; 3250 const targetAnchor = n2.targetAnchor = n1.targetAnchor; 3251 const wasDisabled = isTeleportDisabled(n1.props); 3252 const currentContainer = wasDisabled ? container : target; 3253 const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; 3254 if (namespace === "svg" || isTargetSVG(target)) { 3255 namespace = "svg"; 3256 } else if (namespace === "mathml" || isTargetMathML(target)) { 3257 namespace = "mathml"; 3258 } 3259 if (dynamicChildren) { 3260 patchBlockChildren( 3261 n1.dynamicChildren, 3262 dynamicChildren, 3263 currentContainer, 3264 parentComponent, 3265 parentSuspense, 3266 namespace, 3267 slotScopeIds 3268 ); 3269 traverseStaticChildren(n1, n2, false); 3270 } else if (!optimized) { 3271 patchChildren( 3272 n1, 3273 n2, 3274 currentContainer, 3275 currentAnchor, 3276 parentComponent, 3277 parentSuspense, 3278 namespace, 3279 slotScopeIds, 3280 false 3281 ); 3282 } 3283 if (disabled) { 3284 if (!wasDisabled) { 3285 moveTeleport( 3286 n2, 3287 container, 3288 mainAnchor, 3289 internals, 3290 1 3291 ); 3292 } else { 3293 if (n2.props && n1.props && n2.props.to !== n1.props.to) { 3294 n2.props.to = n1.props.to; 3295 } 3296 } 3297 } else { 3298 if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { 3299 const nextTarget = resolveTarget(n2.props, querySelector); 3300 if (nextTarget) { 3301 n2.target = nextTarget; 3302 moveTeleport( 3303 n2, 3304 nextTarget, 3305 null, 3306 internals, 3307 0 3308 ); 3309 } else if (true) { 3310 warn$1( 3311 "Invalid Teleport target on update:", 3312 target, 3313 `(${typeof target})` 3314 ); 3315 } 3316 } else if (wasDisabled) { 3317 moveTeleport( 3318 n2, 3319 target, 3320 targetAnchor, 3321 internals, 3322 1 3323 ); 3324 } 3325 } 3326 updateCssVars(n2, disabled); 3327 } 3328 }, 3329 remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { 3330 const { 3331 shapeFlag, 3332 children, 3333 anchor, 3334 targetStart, 3335 targetAnchor, 3336 target, 3337 props 3338 } = vnode; 3339 const disabled = isTeleportDisabled(props); 3340 const shouldRemove = doRemove || !disabled; 3341 const pendingMount = pendingMounts.get(vnode); 3342 if (pendingMount) { 3343 pendingMount.flags |= 8; 3344 pendingMounts.delete(vnode); 3345 } 3346 if (target) { 3347 hostRemove(targetStart); 3348 hostRemove(targetAnchor); 3349 } 3350 doRemove && hostRemove(anchor); 3351 if (!pendingMount && (disabled || target) && shapeFlag & 16) { 3352 for (let i = 0; i < children.length; i++) { 3353 const child = children[i]; 3354 unmount( 3355 child, 3356 parentComponent, 3357 parentSuspense, 3358 shouldRemove, 3359 !!child.dynamicChildren 3360 ); 3361 } 3362 } 3363 }, 3364 move: moveTeleport, 3365 hydrate: hydrateTeleport 3366 }; 3367 function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { 3368 if (moveType === 0) { 3369 insert(vnode.targetAnchor, container, parentAnchor); 3370 } 3371 const { el, anchor, shapeFlag, children, props } = vnode; 3372 const isReorder = moveType === 2; 3373 if (isReorder) { 3374 insert(el, container, parentAnchor); 3375 } 3376 if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) { 3377 if (shapeFlag & 16) { 3378 for (let i = 0; i < children.length; i++) { 3379 move( 3380 children[i], 3381 container, 3382 parentAnchor, 3383 2 3384 ); 3385 } 3386 } 3387 } 3388 if (isReorder) { 3389 insert(anchor, container, parentAnchor); 3390 } 3391 } 3392 function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { 3393 o: { nextSibling, parentNode, querySelector, insert, createText } 3394 }, hydrateChildren) { 3395 function hydrateAnchor(target2, targetNode) { 3396 let targetAnchor = targetNode; 3397 while (targetAnchor) { 3398 if (targetAnchor && targetAnchor.nodeType === 8) { 3399 if (targetAnchor.data === "teleport start anchor") { 3400 vnode.targetStart = targetAnchor; 3401 } else if (targetAnchor.data === "teleport anchor") { 3402 vnode.targetAnchor = targetAnchor; 3403 target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); 3404 break; 3405 } 3406 } 3407 targetAnchor = nextSibling(targetAnchor); 3408 } 3409 } 3410 function hydrateDisabledTeleport(node2, vnode2) { 3411 vnode2.anchor = hydrateChildren( 3412 nextSibling(node2), 3413 vnode2, 3414 parentNode(node2), 3415 parentComponent, 3416 parentSuspense, 3417 slotScopeIds, 3418 optimized 3419 ); 3420 } 3421 const target = vnode.target = resolveTarget( 3422 vnode.props, 3423 querySelector 3424 ); 3425 const disabled = isTeleportDisabled(vnode.props); 3426 if (target) { 3427 const targetNode = target._lpa || target.firstChild; 3428 if (vnode.shapeFlag & 16) { 3429 if (disabled) { 3430 hydrateDisabledTeleport(node, vnode); 3431 hydrateAnchor(target, targetNode); 3432 if (!vnode.targetAnchor) { 3433 prepareAnchor( 3434 target, 3435 vnode, 3436 createText, 3437 insert, 3438 // if target is the same as the main view, insert anchors before current node 3439 // to avoid hydrating mismatch 3440 parentNode(node) === target ? node : null 3441 ); 3442 } 3443 } else { 3444 vnode.anchor = nextSibling(node); 3445 hydrateAnchor(target, targetNode); 3446 if (!vnode.targetAnchor) { 3447 prepareAnchor(target, vnode, createText, insert); 3448 } 3449 hydrateChildren( 3450 targetNode && nextSibling(targetNode), 3451 vnode, 3452 target, 3453 parentComponent, 3454 parentSuspense, 3455 slotScopeIds, 3456 optimized 3457 ); 3458 } 3459 } 3460 updateCssVars(vnode, disabled); 3461 } else if (disabled) { 3462 if (vnode.shapeFlag & 16) { 3463 hydrateDisabledTeleport(node, vnode); 3464 vnode.targetStart = node; 3465 vnode.targetAnchor = nextSibling(node); 3466 } 3467 } 3468 return vnode.anchor && nextSibling(vnode.anchor); 3469 } 3470 var Teleport = TeleportImpl; 3471 function updateCssVars(vnode, isDisabled) { 3472 const ctx = vnode.ctx; 3473 if (ctx && ctx.ut) { 3474 let node, anchor; 3475 if (isDisabled) { 3476 node = vnode.el; 3477 anchor = vnode.anchor; 3478 } else { 3479 node = vnode.targetStart; 3480 anchor = vnode.targetAnchor; 3481 } 3482 while (node && node !== anchor) { 3483 if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); 3484 node = node.nextSibling; 3485 } 3486 ctx.ut(); 3487 } 3488 } 3489 function prepareAnchor(target, vnode, createText, insert, anchor = null) { 3490 const targetStart = vnode.targetStart = createText(""); 3491 const targetAnchor = vnode.targetAnchor = createText(""); 3492 targetStart[TeleportEndKey] = targetAnchor; 3493 if (target) { 3494 insert(targetStart, target, anchor); 3495 insert(targetAnchor, target, anchor); 3496 } 3497 return targetAnchor; 3498 } 3499 var leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb"); 3500 var enterCbKey = /* @__PURE__ */ Symbol("_enterCb"); 3501 function useTransitionState() { 3502 const state = { 3503 isMounted: false, 3504 isLeaving: false, 3505 isUnmounting: false, 3506 leavingVNodes: /* @__PURE__ */ new Map() 3507 }; 3508 onMounted(() => { 3509 state.isMounted = true; 3510 }); 3511 onBeforeUnmount(() => { 3512 state.isUnmounting = true; 3513 }); 3514 return state; 3515 } 3516 var TransitionHookValidator = [Function, Array]; 3517 var BaseTransitionPropsValidators = { 3518 mode: String, 3519 appear: Boolean, 3520 persisted: Boolean, 3521 // enter 3522 onBeforeEnter: TransitionHookValidator, 3523 onEnter: TransitionHookValidator, 3524 onAfterEnter: TransitionHookValidator, 3525 onEnterCancelled: TransitionHookValidator, 3526 // leave 3527 onBeforeLeave: TransitionHookValidator, 3528 onLeave: TransitionHookValidator, 3529 onAfterLeave: TransitionHookValidator, 3530 onLeaveCancelled: TransitionHookValidator, 3531 // appear 3532 onBeforeAppear: TransitionHookValidator, 3533 onAppear: TransitionHookValidator, 3534 onAfterAppear: TransitionHookValidator, 3535 onAppearCancelled: TransitionHookValidator 3536 }; 3537 var recursiveGetSubtree = (instance) => { 3538 const subTree = instance.subTree; 3539 return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; 3540 }; 3541 var BaseTransitionImpl = { 3542 name: `BaseTransition`, 3543 props: BaseTransitionPropsValidators, 3544 setup(props, { slots }) { 3545 const instance = getCurrentInstance(); 3546 const state = useTransitionState(); 3547 return () => { 3548 const children = slots.default && getTransitionRawChildren(slots.default(), true); 3549 const child = children && children.length ? findNonCommentChild(children) : ( 3550 // Keep explicit default-slot conditionals on the same transition path 3551 // as regular v-if branches, which render a comment placeholder. 3552 instance.subTree ? createCommentVNode() : void 0 3553 ); 3554 if (!child) { 3555 return; 3556 } 3557 const rawProps = toRaw(props); 3558 const { mode } = rawProps; 3559 if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { 3560 warn$1(`invalid <transition> mode: ${mode}`); 3561 } 3562 if (state.isLeaving) { 3563 return emptyPlaceholder(child); 3564 } 3565 const innerChild = getInnerChild$1(child); 3566 if (!innerChild) { 3567 return emptyPlaceholder(child); 3568 } 3569 let enterHooks = resolveTransitionHooks( 3570 innerChild, 3571 rawProps, 3572 state, 3573 instance, 3574 // #11061, ensure enterHooks is fresh after clone 3575 (hooks) => enterHooks = hooks 3576 ); 3577 if (innerChild.type !== Comment) { 3578 setTransitionHooks(innerChild, enterHooks); 3579 } 3580 let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); 3581 if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) { 3582 let leavingHooks = resolveTransitionHooks( 3583 oldInnerChild, 3584 rawProps, 3585 state, 3586 instance 3587 ); 3588 setTransitionHooks(oldInnerChild, leavingHooks); 3589 if (mode === "out-in" && innerChild.type !== Comment) { 3590 state.isLeaving = true; 3591 leavingHooks.afterLeave = () => { 3592 state.isLeaving = false; 3593 if (!(instance.job.flags & 8)) { 3594 instance.update(); 3595 } 3596 delete leavingHooks.afterLeave; 3597 oldInnerChild = void 0; 3598 }; 3599 return emptyPlaceholder(child); 3600 } else if (mode === "in-out" && innerChild.type !== Comment) { 3601 leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { 3602 const leavingVNodesCache = getLeavingNodesForType( 3603 state, 3604 oldInnerChild 3605 ); 3606 leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; 3607 el[leaveCbKey] = () => { 3608 earlyRemove(); 3609 el[leaveCbKey] = void 0; 3610 delete enterHooks.delayedLeave; 3611 oldInnerChild = void 0; 3612 }; 3613 enterHooks.delayedLeave = () => { 3614 delayedLeave(); 3615 delete enterHooks.delayedLeave; 3616 oldInnerChild = void 0; 3617 }; 3618 }; 3619 } else { 3620 oldInnerChild = void 0; 3621 } 3622 } else if (oldInnerChild) { 3623 oldInnerChild = void 0; 3624 } 3625 return child; 3626 }; 3627 } 3628 }; 3629 function findNonCommentChild(children) { 3630 let child = children[0]; 3631 if (children.length > 1) { 3632 let hasFound = false; 3633 for (const c of children) { 3634 if (c.type !== Comment) { 3635 if (hasFound) { 3636 warn$1( 3637 "<transition> can only be used on a single element or component. Use <transition-group> for lists." 3638 ); 3639 break; 3640 } 3641 child = c; 3642 hasFound = true; 3643 if (false) break; 3644 } 3645 } 3646 } 3647 return child; 3648 } 3649 var BaseTransition = BaseTransitionImpl; 3650 function getLeavingNodesForType(state, vnode) { 3651 const { leavingVNodes } = state; 3652 let leavingVNodesCache = leavingVNodes.get(vnode.type); 3653 if (!leavingVNodesCache) { 3654 leavingVNodesCache = /* @__PURE__ */ Object.create(null); 3655 leavingVNodes.set(vnode.type, leavingVNodesCache); 3656 } 3657 return leavingVNodesCache; 3658 } 3659 function resolveTransitionHooks(vnode, props, state, instance, postClone) { 3660 const { 3661 appear, 3662 mode, 3663 persisted = false, 3664 onBeforeEnter, 3665 onEnter, 3666 onAfterEnter, 3667 onEnterCancelled, 3668 onBeforeLeave, 3669 onLeave, 3670 onAfterLeave, 3671 onLeaveCancelled, 3672 onBeforeAppear, 3673 onAppear, 3674 onAfterAppear, 3675 onAppearCancelled 3676 } = props; 3677 const key = String(vnode.key); 3678 const leavingVNodesCache = getLeavingNodesForType(state, vnode); 3679 const callHook3 = (hook, args) => { 3680 hook && callWithAsyncErrorHandling( 3681 hook, 3682 instance, 3683 9, 3684 args 3685 ); 3686 }; 3687 const callAsyncHook = (hook, args) => { 3688 const done = args[1]; 3689 callHook3(hook, args); 3690 if (isArray(hook)) { 3691 if (hook.every((hook2) => hook2.length <= 1)) done(); 3692 } else if (hook.length <= 1) { 3693 done(); 3694 } 3695 }; 3696 const hooks = { 3697 mode, 3698 persisted, 3699 beforeEnter(el) { 3700 let hook = onBeforeEnter; 3701 if (!state.isMounted) { 3702 if (appear) { 3703 hook = onBeforeAppear || onBeforeEnter; 3704 } else { 3705 return; 3706 } 3707 } 3708 if (el[leaveCbKey]) { 3709 el[leaveCbKey]( 3710 true 3711 /* cancelled */ 3712 ); 3713 } 3714 const leavingVNode = leavingVNodesCache[key]; 3715 if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { 3716 leavingVNode.el[leaveCbKey](); 3717 } 3718 callHook3(hook, [el]); 3719 }, 3720 enter(el) { 3721 if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return; 3722 let hook = onEnter; 3723 let afterHook = onAfterEnter; 3724 let cancelHook = onEnterCancelled; 3725 if (!state.isMounted) { 3726 if (appear) { 3727 hook = onAppear || onEnter; 3728 afterHook = onAfterAppear || onAfterEnter; 3729 cancelHook = onAppearCancelled || onEnterCancelled; 3730 } else { 3731 return; 3732 } 3733 } 3734 let called = false; 3735 el[enterCbKey] = (cancelled) => { 3736 if (called) return; 3737 called = true; 3738 if (cancelled) { 3739 callHook3(cancelHook, [el]); 3740 } else { 3741 callHook3(afterHook, [el]); 3742 } 3743 if (hooks.delayedLeave) { 3744 hooks.delayedLeave(); 3745 } 3746 el[enterCbKey] = void 0; 3747 }; 3748 const done = el[enterCbKey].bind(null, false); 3749 if (hook) { 3750 callAsyncHook(hook, [el, done]); 3751 } else { 3752 done(); 3753 } 3754 }, 3755 leave(el, remove2) { 3756 const key2 = String(vnode.key); 3757 if (el[enterCbKey]) { 3758 el[enterCbKey]( 3759 true 3760 /* cancelled */ 3761 ); 3762 } 3763 if (state.isUnmounting) { 3764 return remove2(); 3765 } 3766 callHook3(onBeforeLeave, [el]); 3767 let called = false; 3768 el[leaveCbKey] = (cancelled) => { 3769 if (called) return; 3770 called = true; 3771 remove2(); 3772 if (cancelled) { 3773 callHook3(onLeaveCancelled, [el]); 3774 } else { 3775 callHook3(onAfterLeave, [el]); 3776 } 3777 el[leaveCbKey] = void 0; 3778 if (leavingVNodesCache[key2] === vnode) { 3779 delete leavingVNodesCache[key2]; 3780 } 3781 }; 3782 const done = el[leaveCbKey].bind(null, false); 3783 leavingVNodesCache[key2] = vnode; 3784 if (onLeave) { 3785 callAsyncHook(onLeave, [el, done]); 3786 } else { 3787 done(); 3788 } 3789 }, 3790 clone(vnode2) { 3791 const hooks2 = resolveTransitionHooks( 3792 vnode2, 3793 props, 3794 state, 3795 instance, 3796 postClone 3797 ); 3798 if (postClone) postClone(hooks2); 3799 return hooks2; 3800 } 3801 }; 3802 return hooks; 3803 } 3804 function emptyPlaceholder(vnode) { 3805 if (isKeepAlive(vnode)) { 3806 vnode = cloneVNode(vnode); 3807 vnode.children = null; 3808 return vnode; 3809 } 3810 } 3811 function getInnerChild$1(vnode) { 3812 if (!isKeepAlive(vnode)) { 3813 if (isTeleport(vnode.type) && vnode.children) { 3814 return findNonCommentChild(vnode.children); 3815 } 3816 return vnode; 3817 } 3818 if (vnode.component) { 3819 return vnode.component.subTree; 3820 } 3821 const { shapeFlag, children } = vnode; 3822 if (children) { 3823 if (shapeFlag & 16) { 3824 return children[0]; 3825 } 3826 if (shapeFlag & 32 && isFunction(children.default)) { 3827 return children.default(); 3828 } 3829 } 3830 } 3831 function setTransitionHooks(vnode, hooks) { 3832 if (vnode.shapeFlag & 6 && vnode.component) { 3833 vnode.transition = hooks; 3834 setTransitionHooks(vnode.component.subTree, hooks); 3835 } else if (vnode.shapeFlag & 128) { 3836 vnode.ssContent.transition = hooks.clone(vnode.ssContent); 3837 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); 3838 } else { 3839 vnode.transition = hooks; 3840 } 3841 } 3842 function getTransitionRawChildren(children, keepComment = false, parentKey) { 3843 let ret = []; 3844 let keyedFragmentCount = 0; 3845 for (let i = 0; i < children.length; i++) { 3846 let child = children[i]; 3847 const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); 3848 if (child.type === Fragment) { 3849 if (child.patchFlag & 128) keyedFragmentCount++; 3850 ret = ret.concat( 3851 getTransitionRawChildren(child.children, keepComment, key) 3852 ); 3853 } else if (keepComment || child.type !== Comment) { 3854 ret.push(key != null ? cloneVNode(child, { key }) : child); 3855 } 3856 } 3857 if (keyedFragmentCount > 1) { 3858 for (let i = 0; i < ret.length; i++) { 3859 ret[i].patchFlag = -2; 3860 } 3861 } 3862 return ret; 3863 } 3864 function defineComponent(options, extraOptions) { 3865 return isFunction(options) ? ( 3866 // #8236: extend call and options.name access are considered side-effects 3867 // by Rollup, so we have to wrap it in a pure-annotated IIFE. 3868 (() => extend({ name: options.name }, extraOptions, { setup: options }))() 3869 ) : options; 3870 } 3871 function useId() { 3872 const i = getCurrentInstance(); 3873 if (i) { 3874 return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; 3875 } else if (true) { 3876 warn$1( 3877 `useId() is called when there is no active component instance to be associated with.` 3878 ); 3879 } 3880 return ""; 3881 } 3882 function markAsyncBoundary(instance) { 3883 instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; 3884 } 3885 var knownTemplateRefs = /* @__PURE__ */ new WeakSet(); 3886 function useTemplateRef(key) { 3887 const i = getCurrentInstance(); 3888 const r = shallowRef(null); 3889 if (i) { 3890 const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs; 3891 if (isTemplateRefKey(refs, key)) { 3892 warn$1(`useTemplateRef('${key}') already exists.`); 3893 } else { 3894 Object.defineProperty(refs, key, { 3895 enumerable: true, 3896 get: () => r.value, 3897 set: (val) => r.value = val 3898 }); 3899 } 3900 } else if (true) { 3901 warn$1( 3902 `useTemplateRef() is called when there is no active component instance to be associated with.` 3903 ); 3904 } 3905 const ret = true ? readonly(r) : r; 3906 if (true) { 3907 knownTemplateRefs.add(ret); 3908 } 3909 return ret; 3910 } 3911 function isTemplateRefKey(refs, key) { 3912 let desc; 3913 return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable); 3914 } 3915 var pendingSetRefMap = /* @__PURE__ */ new WeakMap(); 3916 function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { 3917 if (isArray(rawRef)) { 3918 rawRef.forEach( 3919 (r, i) => setRef( 3920 r, 3921 oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), 3922 parentSuspense, 3923 vnode, 3924 isUnmount 3925 ) 3926 ); 3927 return; 3928 } 3929 if (isAsyncWrapper(vnode) && !isUnmount) { 3930 if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { 3931 setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); 3932 } 3933 return; 3934 } 3935 const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; 3936 const value = isUnmount ? null : refValue; 3937 const { i: owner, r: ref2 } = rawRef; 3938 if (!owner) { 3939 warn$1( 3940 `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` 3941 ); 3942 return; 3943 } 3944 const oldRef = oldRawRef && oldRawRef.r; 3945 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; 3946 const setupState = owner.setupState; 3947 const rawSetupState = toRaw(setupState); 3948 const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => { 3949 if (true) { 3950 if (hasOwn(rawSetupState, key) && !isRef2(rawSetupState[key])) { 3951 warn$1( 3952 `Template ref "${key}" used on a non-ref value. It will not work in the production build.` 3953 ); 3954 } 3955 if (knownTemplateRefs.has(rawSetupState[key])) { 3956 return false; 3957 } 3958 } 3959 if (isTemplateRefKey(refs, key)) { 3960 return false; 3961 } 3962 return hasOwn(rawSetupState, key); 3963 }; 3964 const canSetRef = (ref22, key) => { 3965 if (knownTemplateRefs.has(ref22)) { 3966 return false; 3967 } 3968 if (key && isTemplateRefKey(refs, key)) { 3969 return false; 3970 } 3971 return true; 3972 }; 3973 if (oldRef != null && oldRef !== ref2) { 3974 invalidatePendingSetRef(oldRawRef); 3975 if (isString(oldRef)) { 3976 refs[oldRef] = null; 3977 if (canSetSetupRef(oldRef)) { 3978 setupState[oldRef] = null; 3979 } 3980 } else if (isRef2(oldRef)) { 3981 const oldRawRefAtom = oldRawRef; 3982 if (canSetRef(oldRef, oldRawRefAtom.k)) { 3983 oldRef.value = null; 3984 } 3985 if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null; 3986 } 3987 } 3988 if (isFunction(ref2)) { 3989 pauseTracking(); 3990 try { 3991 callWithErrorHandling(ref2, owner, 12, [value, refs]); 3992 } finally { 3993 resetTracking(); 3994 } 3995 } else { 3996 const _isString = isString(ref2); 3997 const _isRef = isRef2(ref2); 3998 if (_isString || _isRef) { 3999 const doSet = () => { 4000 if (rawRef.f) { 4001 const existing = _isString ? canSetSetupRef(ref2) ? setupState[ref2] : refs[ref2] : canSetRef(ref2) || !rawRef.k ? ref2.value : refs[rawRef.k]; 4002 if (isUnmount) { 4003 isArray(existing) && remove(existing, refValue); 4004 } else { 4005 if (!isArray(existing)) { 4006 if (_isString) { 4007 refs[ref2] = [refValue]; 4008 if (canSetSetupRef(ref2)) { 4009 setupState[ref2] = refs[ref2]; 4010 } 4011 } else { 4012 const newVal = [refValue]; 4013 if (canSetRef(ref2, rawRef.k)) { 4014 ref2.value = newVal; 4015 } 4016 if (rawRef.k) refs[rawRef.k] = newVal; 4017 } 4018 } else if (!existing.includes(refValue)) { 4019 existing.push(refValue); 4020 } 4021 } 4022 } else if (_isString) { 4023 refs[ref2] = value; 4024 if (canSetSetupRef(ref2)) { 4025 setupState[ref2] = value; 4026 } 4027 } else if (_isRef) { 4028 if (canSetRef(ref2, rawRef.k)) { 4029 ref2.value = value; 4030 } 4031 if (rawRef.k) refs[rawRef.k] = value; 4032 } else if (true) { 4033 warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`); 4034 } 4035 }; 4036 if (value) { 4037 const job = () => { 4038 doSet(); 4039 pendingSetRefMap.delete(rawRef); 4040 }; 4041 job.id = -1; 4042 pendingSetRefMap.set(rawRef, job); 4043 queuePostRenderEffect(job, parentSuspense); 4044 } else { 4045 invalidatePendingSetRef(rawRef); 4046 doSet(); 4047 } 4048 } else if (true) { 4049 warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`); 4050 } 4051 } 4052 } 4053 function invalidatePendingSetRef(rawRef) { 4054 const pendingSetRef = pendingSetRefMap.get(rawRef); 4055 if (pendingSetRef) { 4056 pendingSetRef.flags |= 8; 4057 pendingSetRefMap.delete(rawRef); 4058 } 4059 } 4060 var hasLoggedMismatchError = false; 4061 var logMismatchError = () => { 4062 if (hasLoggedMismatchError) { 4063 return; 4064 } 4065 console.error("Hydration completed but contains mismatches."); 4066 hasLoggedMismatchError = true; 4067 }; 4068 var isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; 4069 var isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); 4070 var getContainerType = (container) => { 4071 if (container.nodeType !== 1) return void 0; 4072 if (isSVGContainer(container)) return "svg"; 4073 if (isMathMLContainer(container)) return "mathml"; 4074 return void 0; 4075 }; 4076 var isComment = (node) => node.nodeType === 8; 4077 function createHydrationFunctions(rendererInternals) { 4078 const { 4079 mt: mountComponent, 4080 p: patch, 4081 o: { 4082 patchProp: patchProp2, 4083 createText, 4084 nextSibling, 4085 parentNode, 4086 remove: remove2, 4087 insert, 4088 createComment 4089 } 4090 } = rendererInternals; 4091 const hydrate2 = (vnode, container) => { 4092 if (!container.hasChildNodes()) { 4093 warn$1( 4094 `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` 4095 ); 4096 patch(null, vnode, container); 4097 flushPostFlushCbs(); 4098 container._vnode = vnode; 4099 return; 4100 } 4101 hydrateNode(container.firstChild, vnode, null, null, null); 4102 flushPostFlushCbs(); 4103 container._vnode = vnode; 4104 }; 4105 const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { 4106 optimized = optimized || !!vnode.dynamicChildren; 4107 const isFragmentStart = isComment(node) && node.data === "["; 4108 const onMismatch = () => handleMismatch( 4109 node, 4110 vnode, 4111 parentComponent, 4112 parentSuspense, 4113 slotScopeIds, 4114 isFragmentStart 4115 ); 4116 const { type, ref: ref2, shapeFlag, patchFlag } = vnode; 4117 let domType = node.nodeType; 4118 vnode.el = node; 4119 if (true) { 4120 def(node, "__vnode", vnode, true); 4121 def(node, "__vueParentComponent", parentComponent, true); 4122 } 4123 if (patchFlag === -2) { 4124 optimized = false; 4125 vnode.dynamicChildren = null; 4126 } 4127 let nextNode = null; 4128 switch (type) { 4129 case Text: 4130 if (domType !== 3) { 4131 if (vnode.children === "") { 4132 insert(vnode.el = createText(""), parentNode(node), node); 4133 nextNode = node; 4134 } else { 4135 nextNode = onMismatch(); 4136 } 4137 } else { 4138 if (node.data !== vnode.children) { 4139 warn$1( 4140 `Hydration text mismatch in`, 4141 node.parentNode, 4142 ` 4143 - rendered on server: ${JSON.stringify( 4144 node.data 4145 )} 4146 - expected on client: ${JSON.stringify(vnode.children)}` 4147 ); 4148 logMismatchError(); 4149 node.data = vnode.children; 4150 } 4151 nextNode = nextSibling(node); 4152 } 4153 break; 4154 case Comment: 4155 if (isTemplateNode(node)) { 4156 nextNode = nextSibling(node); 4157 replaceNode( 4158 vnode.el = node.content.firstChild, 4159 node, 4160 parentComponent 4161 ); 4162 } else if (domType !== 8 || isFragmentStart) { 4163 nextNode = onMismatch(); 4164 } else { 4165 nextNode = nextSibling(node); 4166 } 4167 break; 4168 case Static: 4169 if (isFragmentStart) { 4170 node = nextSibling(node); 4171 domType = node.nodeType; 4172 } 4173 if (domType === 1 || domType === 3) { 4174 nextNode = node; 4175 const needToAdoptContent = !vnode.children.length; 4176 for (let i = 0; i < vnode.staticCount; i++) { 4177 if (needToAdoptContent) 4178 vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; 4179 if (i === vnode.staticCount - 1) { 4180 vnode.anchor = nextNode; 4181 } 4182 nextNode = nextSibling(nextNode); 4183 } 4184 return isFragmentStart ? nextSibling(nextNode) : nextNode; 4185 } else { 4186 onMismatch(); 4187 } 4188 break; 4189 case Fragment: 4190 if (!isFragmentStart) { 4191 nextNode = onMismatch(); 4192 } else { 4193 nextNode = hydrateFragment( 4194 node, 4195 vnode, 4196 parentComponent, 4197 parentSuspense, 4198 slotScopeIds, 4199 optimized 4200 ); 4201 } 4202 break; 4203 default: 4204 if (shapeFlag & 1) { 4205 if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { 4206 nextNode = onMismatch(); 4207 } else { 4208 nextNode = hydrateElement( 4209 node, 4210 vnode, 4211 parentComponent, 4212 parentSuspense, 4213 slotScopeIds, 4214 optimized 4215 ); 4216 } 4217 } else if (shapeFlag & 6) { 4218 vnode.slotScopeIds = slotScopeIds; 4219 const container = parentNode(node); 4220 if (isFragmentStart) { 4221 nextNode = locateClosingAnchor(node); 4222 } else if (isComment(node) && node.data === "teleport start") { 4223 nextNode = locateClosingAnchor(node, node.data, "teleport end"); 4224 } else { 4225 nextNode = nextSibling(node); 4226 } 4227 mountComponent( 4228 vnode, 4229 container, 4230 null, 4231 parentComponent, 4232 parentSuspense, 4233 getContainerType(container), 4234 optimized 4235 ); 4236 if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { 4237 let subTree; 4238 if (isFragmentStart) { 4239 subTree = createVNode(Fragment); 4240 subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; 4241 } else { 4242 subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); 4243 } 4244 subTree.el = node; 4245 vnode.component.subTree = subTree; 4246 } 4247 } else if (shapeFlag & 64) { 4248 if (domType !== 8) { 4249 nextNode = onMismatch(); 4250 } else { 4251 nextNode = vnode.type.hydrate( 4252 node, 4253 vnode, 4254 parentComponent, 4255 parentSuspense, 4256 slotScopeIds, 4257 optimized, 4258 rendererInternals, 4259 hydrateChildren 4260 ); 4261 } 4262 } else if (shapeFlag & 128) { 4263 nextNode = vnode.type.hydrate( 4264 node, 4265 vnode, 4266 parentComponent, 4267 parentSuspense, 4268 getContainerType(parentNode(node)), 4269 slotScopeIds, 4270 optimized, 4271 rendererInternals, 4272 hydrateNode 4273 ); 4274 } else if (true) { 4275 warn$1("Invalid HostVNode type:", type, `(${typeof type})`); 4276 } 4277 } 4278 if (ref2 != null) { 4279 setRef(ref2, null, parentSuspense, vnode); 4280 } 4281 return nextNode; 4282 }; 4283 const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 4284 optimized = optimized || !!vnode.dynamicChildren; 4285 const { 4286 type, 4287 dynamicProps, 4288 props, 4289 patchFlag, 4290 shapeFlag, 4291 dirs, 4292 transition 4293 } = vnode; 4294 const forcePatch = type === "input" || type === "option"; 4295 const hasDynamicProps = !!dynamicProps; 4296 if (true) { 4297 if (dirs) { 4298 invokeDirectiveHook(vnode, null, parentComponent, "created"); 4299 } 4300 let needCallTransitionHooks = false; 4301 if (isTemplateNode(el)) { 4302 needCallTransitionHooks = needTransition( 4303 null, 4304 // no need check parentSuspense in hydration 4305 transition 4306 ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; 4307 const content = el.content.firstChild; 4308 if (needCallTransitionHooks) { 4309 const cls = content.getAttribute("class"); 4310 if (cls) content.$cls = cls; 4311 transition.beforeEnter(content); 4312 } 4313 replaceNode(content, el, parentComponent); 4314 vnode.el = el = content; 4315 } 4316 if (shapeFlag & 16 && // skip if element has innerHTML / textContent 4317 !(props && (props.innerHTML || props.textContent))) { 4318 let next = hydrateChildren( 4319 el.firstChild, 4320 vnode, 4321 el, 4322 parentComponent, 4323 parentSuspense, 4324 slotScopeIds, 4325 optimized 4326 ); 4327 if (next && !isMismatchAllowed( 4328 el, 4329 1 4330 /* CHILDREN */ 4331 )) { 4332 warn$1( 4333 `Hydration children mismatch on`, 4334 el, 4335 ` 4336 Server rendered element contains more child nodes than client vdom.` 4337 ); 4338 logMismatchError(); 4339 } 4340 while (next) { 4341 const cur = next; 4342 next = next.nextSibling; 4343 remove2(cur); 4344 } 4345 } else if (shapeFlag & 8) { 4346 let clientText = vnode.children; 4347 if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { 4348 clientText = clientText.slice(1); 4349 } 4350 const { textContent } = el; 4351 if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM 4352 textContent !== clientText.replace(/\r\n|\r/g, "\n")) { 4353 if (!isMismatchAllowed( 4354 el, 4355 0 4356 /* TEXT */ 4357 )) { 4358 warn$1( 4359 `Hydration text content mismatch on`, 4360 el, 4361 ` 4362 - rendered on server: ${textContent} 4363 - expected on client: ${clientText}` 4364 ); 4365 logMismatchError(); 4366 } 4367 el.textContent = vnode.children; 4368 } 4369 } 4370 if (props) { 4371 if (true) { 4372 const isCustomElement = el.tagName.includes("-"); 4373 for (const key in props) { 4374 if (// #11189 skip if this node has directives that have created hooks 4375 // as it could have mutated the DOM in any possible way 4376 !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { 4377 logMismatchError(); 4378 } 4379 if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers 4380 key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) { 4381 patchProp2(el, key, null, props[key], void 0, parentComponent); 4382 } 4383 } 4384 } else if (props.onClick) { 4385 patchProp2( 4386 el, 4387 "onClick", 4388 null, 4389 props.onClick, 4390 void 0, 4391 parentComponent 4392 ); 4393 } else if (patchFlag & 4 && isReactive(props.style)) { 4394 for (const key in props.style) props.style[key]; 4395 } 4396 } 4397 let vnodeHooks; 4398 if (vnodeHooks = props && props.onVnodeBeforeMount) { 4399 invokeVNodeHook(vnodeHooks, parentComponent, vnode); 4400 } 4401 if (dirs) { 4402 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 4403 } 4404 if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { 4405 queueEffectWithSuspense(() => { 4406 vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); 4407 needCallTransitionHooks && transition.enter(el); 4408 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 4409 }, parentSuspense); 4410 } 4411 } 4412 return el.nextSibling; 4413 }; 4414 const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { 4415 optimized = optimized || !!parentVNode.dynamicChildren; 4416 const children = parentVNode.children; 4417 const l = children.length; 4418 let hasCheckedMismatch = false; 4419 for (let i = 0; i < l; i++) { 4420 const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); 4421 const isText = vnode.type === Text; 4422 if (node) { 4423 if (isText && !optimized) { 4424 if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { 4425 insert( 4426 createText( 4427 node.data.slice(vnode.children.length) 4428 ), 4429 container, 4430 nextSibling(node) 4431 ); 4432 node.data = vnode.children; 4433 } 4434 } 4435 node = hydrateNode( 4436 node, 4437 vnode, 4438 parentComponent, 4439 parentSuspense, 4440 slotScopeIds, 4441 optimized 4442 ); 4443 } else if (isText && !vnode.children) { 4444 insert(vnode.el = createText(""), container); 4445 } else { 4446 if (!hasCheckedMismatch) { 4447 hasCheckedMismatch = true; 4448 if (!isMismatchAllowed( 4449 container, 4450 1 4451 /* CHILDREN */ 4452 )) { 4453 warn$1( 4454 `Hydration children mismatch on`, 4455 container, 4456 ` 4457 Server rendered element contains fewer child nodes than client vdom.` 4458 ); 4459 logMismatchError(); 4460 } 4461 } 4462 patch( 4463 null, 4464 vnode, 4465 container, 4466 null, 4467 parentComponent, 4468 parentSuspense, 4469 getContainerType(container), 4470 slotScopeIds 4471 ); 4472 } 4473 } 4474 return node; 4475 }; 4476 const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 4477 const { slotScopeIds: fragmentSlotScopeIds } = vnode; 4478 if (fragmentSlotScopeIds) { 4479 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 4480 } 4481 const container = parentNode(node); 4482 const next = hydrateChildren( 4483 nextSibling(node), 4484 vnode, 4485 container, 4486 parentComponent, 4487 parentSuspense, 4488 slotScopeIds, 4489 optimized 4490 ); 4491 if (next && isComment(next) && next.data === "]") { 4492 return nextSibling(vnode.anchor = next); 4493 } else { 4494 logMismatchError(); 4495 insert(vnode.anchor = createComment(`]`), container, next); 4496 return next; 4497 } 4498 }; 4499 const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { 4500 if (!isNodeMismatchAllowed(node, vnode)) { 4501 warn$1( 4502 `Hydration node mismatch: 4503 - rendered on server:`, 4504 node, 4505 node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, 4506 ` 4507 - expected on client:`, 4508 vnode.type 4509 ); 4510 logMismatchError(); 4511 } 4512 vnode.el = null; 4513 if (isFragment) { 4514 const end = locateClosingAnchor(node); 4515 while (true) { 4516 const next2 = nextSibling(node); 4517 if (next2 && next2 !== end) { 4518 remove2(next2); 4519 } else { 4520 break; 4521 } 4522 } 4523 } 4524 const next = nextSibling(node); 4525 const container = parentNode(node); 4526 remove2(node); 4527 patch( 4528 null, 4529 vnode, 4530 container, 4531 next, 4532 parentComponent, 4533 parentSuspense, 4534 getContainerType(container), 4535 slotScopeIds 4536 ); 4537 if (parentComponent) { 4538 parentComponent.vnode.el = vnode.el; 4539 updateHOCHostEl(parentComponent, vnode.el); 4540 } 4541 return next; 4542 }; 4543 const locateClosingAnchor = (node, open = "[", close = "]") => { 4544 let match = 0; 4545 while (node) { 4546 node = nextSibling(node); 4547 if (node && isComment(node)) { 4548 if (node.data === open) match++; 4549 if (node.data === close) { 4550 if (match === 0) { 4551 return nextSibling(node); 4552 } else { 4553 match--; 4554 } 4555 } 4556 } 4557 } 4558 return node; 4559 }; 4560 const replaceNode = (newNode, oldNode, parentComponent) => { 4561 const parentNode2 = oldNode.parentNode; 4562 if (parentNode2) { 4563 parentNode2.replaceChild(newNode, oldNode); 4564 } 4565 let parent = parentComponent; 4566 while (parent) { 4567 if (parent.vnode.el === oldNode) { 4568 parent.vnode.el = parent.subTree.el = newNode; 4569 } 4570 parent = parent.parent; 4571 } 4572 }; 4573 const isTemplateNode = (node) => { 4574 return node.nodeType === 1 && node.tagName === "TEMPLATE"; 4575 }; 4576 return [hydrate2, hydrateNode]; 4577 } 4578 function propHasMismatch(el, key, clientValue, vnode, instance) { 4579 let mismatchType; 4580 let mismatchKey; 4581 let actual; 4582 let expected; 4583 if (key === "class") { 4584 if (el.$cls) { 4585 actual = el.$cls; 4586 delete el.$cls; 4587 } else { 4588 actual = el.getAttribute("class"); 4589 } 4590 expected = normalizeClass(clientValue); 4591 if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { 4592 mismatchType = 2; 4593 mismatchKey = `class`; 4594 } 4595 } else if (key === "style") { 4596 actual = el.getAttribute("style") || ""; 4597 expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); 4598 const actualMap = toStyleMap(actual); 4599 const expectedMap = toStyleMap(expected); 4600 if (vnode.dirs) { 4601 for (const { dir, value } of vnode.dirs) { 4602 if (dir.name === "show" && !value) { 4603 expectedMap.set("display", "none"); 4604 } 4605 } 4606 } 4607 if (instance) { 4608 resolveCssVars(instance, vnode, expectedMap); 4609 } 4610 if (!isMapEqual(actualMap, expectedMap)) { 4611 mismatchType = 3; 4612 mismatchKey = "style"; 4613 } 4614 } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { 4615 if (isBooleanAttr(key)) { 4616 actual = el.hasAttribute(key); 4617 expected = includeBooleanAttr(clientValue); 4618 } else if (clientValue == null) { 4619 actual = el.hasAttribute(key); 4620 expected = false; 4621 } else { 4622 if (el.hasAttribute(key)) { 4623 actual = el.getAttribute(key); 4624 } else if (key === "value" && el.tagName === "TEXTAREA") { 4625 actual = el.value; 4626 } else { 4627 actual = false; 4628 } 4629 expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; 4630 } 4631 if (actual !== expected) { 4632 mismatchType = 4; 4633 mismatchKey = key; 4634 } 4635 } 4636 if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { 4637 const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; 4638 const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; 4639 const postSegment = ` 4640 - rendered on server: ${format(actual)} 4641 - expected on client: ${format(expected)} 4642 Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. 4643 You should fix the source of the mismatch.`; 4644 { 4645 warn$1(preSegment, el, postSegment); 4646 } 4647 return true; 4648 } 4649 return false; 4650 } 4651 function toClassSet(str) { 4652 return new Set(str.trim().split(/\s+/)); 4653 } 4654 function isSetEqual(a, b) { 4655 if (a.size !== b.size) { 4656 return false; 4657 } 4658 for (const s of a) { 4659 if (!b.has(s)) { 4660 return false; 4661 } 4662 } 4663 return true; 4664 } 4665 function toStyleMap(str) { 4666 const styleMap = /* @__PURE__ */ new Map(); 4667 for (const item of str.split(";")) { 4668 let [key, value] = item.split(":"); 4669 key = key.trim(); 4670 value = value && value.trim(); 4671 if (key && value) { 4672 styleMap.set(key, value); 4673 } 4674 } 4675 return styleMap; 4676 } 4677 function isMapEqual(a, b) { 4678 if (a.size !== b.size) { 4679 return false; 4680 } 4681 for (const [key, value] of a) { 4682 if (value !== b.get(key)) { 4683 return false; 4684 } 4685 } 4686 return true; 4687 } 4688 function resolveCssVars(instance, vnode, expectedMap) { 4689 const root = instance.subTree; 4690 if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { 4691 const cssVars = instance.getCssVars(); 4692 for (const key in cssVars) { 4693 const value = normalizeCssVarValue(cssVars[key]); 4694 expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value); 4695 } 4696 } 4697 if (vnode === root && instance.parent) { 4698 resolveCssVars(instance.parent, instance.vnode, expectedMap); 4699 } 4700 } 4701 var allowMismatchAttr = "data-allow-mismatch"; 4702 var MismatchTypeString = { 4703 [ 4704 0 4705 /* TEXT */ 4706 ]: "text", 4707 [ 4708 1 4709 /* CHILDREN */ 4710 ]: "children", 4711 [ 4712 2 4713 /* CLASS */ 4714 ]: "class", 4715 [ 4716 3 4717 /* STYLE */ 4718 ]: "style", 4719 [ 4720 4 4721 /* ATTRIBUTE */ 4722 ]: "attribute" 4723 }; 4724 function isMismatchAllowed(el, allowedType) { 4725 if (allowedType === 0 || allowedType === 1) { 4726 while (el && !el.hasAttribute(allowMismatchAttr)) { 4727 el = el.parentElement; 4728 } 4729 } 4730 return isMismatchAllowedByAttr( 4731 el && el.getAttribute(allowMismatchAttr), 4732 allowedType 4733 ); 4734 } 4735 function isMismatchAllowedByAttr(allowedAttr, allowedType) { 4736 if (allowedAttr == null) { 4737 return false; 4738 } else if (allowedAttr === "") { 4739 return true; 4740 } else { 4741 const list = allowedAttr.split(","); 4742 if (allowedType === 0 && list.includes("children")) { 4743 return true; 4744 } 4745 return list.includes(MismatchTypeString[allowedType]); 4746 } 4747 } 4748 function isNodeMismatchAllowed(node, vnode) { 4749 return isMismatchAllowed( 4750 node.parentElement, 4751 1 4752 /* CHILDREN */ 4753 ) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode); 4754 } 4755 function isMismatchAllowedByNode(node) { 4756 return node.nodeType === 1 && isMismatchAllowedByAttr( 4757 node.getAttribute(allowMismatchAttr), 4758 1 4759 /* CHILDREN */ 4760 ); 4761 } 4762 function isMismatchAllowedByVNode({ props }) { 4763 const allowedAttr = props && props[allowMismatchAttr]; 4764 return typeof allowedAttr === "string" && isMismatchAllowedByAttr( 4765 allowedAttr, 4766 1 4767 /* CHILDREN */ 4768 ); 4769 } 4770 var requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); 4771 var cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); 4772 var hydrateOnIdle = (timeout = 1e4) => (hydrate2) => { 4773 const id = requestIdleCallback(hydrate2, { timeout }); 4774 return () => cancelIdleCallback(id); 4775 }; 4776 function elementIsVisibleInViewport(el) { 4777 const { top, left, bottom, right } = el.getBoundingClientRect(); 4778 const { innerHeight, innerWidth } = window; 4779 return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); 4780 } 4781 var hydrateOnVisible = (opts) => (hydrate2, forEach) => { 4782 const ob = new IntersectionObserver((entries) => { 4783 for (const e of entries) { 4784 if (!e.isIntersecting) continue; 4785 ob.disconnect(); 4786 hydrate2(); 4787 break; 4788 } 4789 }, opts); 4790 forEach((el) => { 4791 if (!(el instanceof Element)) return; 4792 if (elementIsVisibleInViewport(el)) { 4793 hydrate2(); 4794 ob.disconnect(); 4795 return false; 4796 } 4797 ob.observe(el); 4798 }); 4799 return () => ob.disconnect(); 4800 }; 4801 var hydrateOnMediaQuery = (query) => (hydrate2) => { 4802 if (query) { 4803 const mql = matchMedia(query); 4804 if (mql.matches) { 4805 hydrate2(); 4806 } else { 4807 mql.addEventListener("change", hydrate2, { once: true }); 4808 return () => mql.removeEventListener("change", hydrate2); 4809 } 4810 } 4811 }; 4812 var hydrateOnInteraction = (interactions = []) => (hydrate2, forEach) => { 4813 if (isString(interactions)) interactions = [interactions]; 4814 let hasHydrated = false; 4815 const doHydrate = (e) => { 4816 if (!hasHydrated) { 4817 hasHydrated = true; 4818 teardown(); 4819 hydrate2(); 4820 e.target.dispatchEvent(new e.constructor(e.type, e)); 4821 } 4822 }; 4823 const teardown = () => { 4824 forEach((el) => { 4825 for (const i of interactions) { 4826 el.removeEventListener(i, doHydrate); 4827 } 4828 }); 4829 }; 4830 forEach((el) => { 4831 for (const i of interactions) { 4832 el.addEventListener(i, doHydrate, { once: true }); 4833 } 4834 }); 4835 return teardown; 4836 }; 4837 function forEachElement(node, cb) { 4838 if (isComment(node) && node.data === "[") { 4839 let depth = 1; 4840 let next = node.nextSibling; 4841 while (next) { 4842 if (next.nodeType === 1) { 4843 const result = cb(next); 4844 if (result === false) { 4845 break; 4846 } 4847 } else if (isComment(next)) { 4848 if (next.data === "]") { 4849 if (--depth === 0) break; 4850 } else if (next.data === "[") { 4851 depth++; 4852 } 4853 } 4854 next = next.nextSibling; 4855 } 4856 } else { 4857 cb(node); 4858 } 4859 } 4860 var isAsyncWrapper = (i) => !!i.type.__asyncLoader; 4861 function defineAsyncComponent(source) { 4862 if (isFunction(source)) { 4863 source = { loader: source }; 4864 } 4865 const { 4866 loader, 4867 loadingComponent, 4868 errorComponent, 4869 delay = 200, 4870 hydrate: hydrateStrategy, 4871 timeout, 4872 // undefined = never times out 4873 suspensible = true, 4874 onError: userOnError 4875 } = source; 4876 let pendingRequest = null; 4877 let resolvedComp; 4878 let retries = 0; 4879 const retry = () => { 4880 retries++; 4881 pendingRequest = null; 4882 return load(); 4883 }; 4884 const load = () => { 4885 let thisRequest; 4886 return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { 4887 err = err instanceof Error ? err : new Error(String(err)); 4888 if (userOnError) { 4889 return new Promise((resolve2, reject) => { 4890 const userRetry = () => resolve2(retry()); 4891 const userFail = () => reject(err); 4892 userOnError(err, userRetry, userFail, retries + 1); 4893 }); 4894 } else { 4895 throw err; 4896 } 4897 }).then((comp) => { 4898 if (thisRequest !== pendingRequest && pendingRequest) { 4899 return pendingRequest; 4900 } 4901 if (!comp) { 4902 warn$1( 4903 `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` 4904 ); 4905 } 4906 if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { 4907 comp = comp.default; 4908 } 4909 if (comp && !isObject(comp) && !isFunction(comp)) { 4910 throw new Error(`Invalid async component load result: ${comp}`); 4911 } 4912 resolvedComp = comp; 4913 return comp; 4914 })); 4915 }; 4916 return defineComponent({ 4917 name: "AsyncComponentWrapper", 4918 __asyncLoader: load, 4919 __asyncHydrate(el, instance, hydrate2) { 4920 let patched = false; 4921 (instance.bu || (instance.bu = [])).push(() => patched = true); 4922 const performHydrate = () => { 4923 if (patched) { 4924 if (true) { 4925 warn$1( 4926 `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.` 4927 ); 4928 } 4929 return; 4930 } 4931 hydrate2(); 4932 }; 4933 const doHydrate = hydrateStrategy ? () => { 4934 const teardown = hydrateStrategy( 4935 performHydrate, 4936 (cb) => forEachElement(el, cb) 4937 ); 4938 if (teardown) { 4939 (instance.bum || (instance.bum = [])).push(teardown); 4940 } 4941 } : performHydrate; 4942 if (resolvedComp) { 4943 doHydrate(); 4944 } else { 4945 load().then(() => !instance.isUnmounted && doHydrate()); 4946 } 4947 }, 4948 get __asyncResolved() { 4949 return resolvedComp; 4950 }, 4951 setup() { 4952 const instance = currentInstance; 4953 markAsyncBoundary(instance); 4954 if (resolvedComp) { 4955 return () => createInnerComp(resolvedComp, instance); 4956 } 4957 const onError = (err) => { 4958 pendingRequest = null; 4959 handleError( 4960 err, 4961 instance, 4962 13, 4963 !errorComponent 4964 ); 4965 }; 4966 if (suspensible && instance.suspense || isInSSRComponentSetup) { 4967 return load().then((comp) => { 4968 return () => createInnerComp(comp, instance); 4969 }).catch((err) => { 4970 onError(err); 4971 return () => errorComponent ? createVNode(errorComponent, { 4972 error: err 4973 }) : null; 4974 }); 4975 } 4976 const loaded = ref(false); 4977 const error = ref(); 4978 const delayed = ref(!!delay); 4979 let timeoutTimer; 4980 let delayTimer; 4981 onUnmounted(() => { 4982 if (timeoutTimer != null) clearTimeout(timeoutTimer); 4983 if (delayTimer != null) clearTimeout(delayTimer); 4984 }); 4985 if (delay) { 4986 delayTimer = setTimeout(() => { 4987 if (instance.isUnmounted) return; 4988 delayed.value = false; 4989 }, delay); 4990 } 4991 if (timeout != null) { 4992 timeoutTimer = setTimeout(() => { 4993 if (instance.isUnmounted) return; 4994 if (!loaded.value && !error.value) { 4995 const err = new Error( 4996 `Async component timed out after ${timeout}ms.` 4997 ); 4998 onError(err); 4999 error.value = err; 5000 } 5001 }, timeout); 5002 } 5003 load().then(() => { 5004 if (instance.isUnmounted) return; 5005 loaded.value = true; 5006 if (instance.parent && isKeepAlive(instance.parent.vnode)) { 5007 instance.parent.update(); 5008 } 5009 }).catch((err) => { 5010 if (instance.isUnmounted) { 5011 pendingRequest = null; 5012 return; 5013 } 5014 onError(err); 5015 error.value = err; 5016 }); 5017 return () => { 5018 if (loaded.value && resolvedComp) { 5019 return createInnerComp(resolvedComp, instance); 5020 } else if (error.value && errorComponent) { 5021 return createVNode(errorComponent, { 5022 error: error.value 5023 }); 5024 } else if (loadingComponent && !delayed.value) { 5025 return createInnerComp( 5026 loadingComponent, 5027 instance 5028 ); 5029 } 5030 }; 5031 } 5032 }); 5033 } 5034 function createInnerComp(comp, parent) { 5035 const { ref: ref2, props, children, ce } = parent.vnode; 5036 const vnode = createVNode(comp, props, children); 5037 vnode.ref = ref2; 5038 vnode.ce = ce; 5039 delete parent.vnode.ce; 5040 return vnode; 5041 } 5042 var isKeepAlive = (vnode) => vnode.type.__isKeepAlive; 5043 var KeepAliveImpl = { 5044 name: `KeepAlive`, 5045 // Marker for special handling inside the renderer. We are not using a === 5046 // check directly on KeepAlive in the renderer, because importing it directly 5047 // would prevent it from being tree-shaken. 5048 __isKeepAlive: true, 5049 props: { 5050 include: [String, RegExp, Array], 5051 exclude: [String, RegExp, Array], 5052 max: [String, Number] 5053 }, 5054 setup(props, { slots }) { 5055 const instance = getCurrentInstance(); 5056 const sharedContext = instance.ctx; 5057 if (!sharedContext.renderer) { 5058 return () => { 5059 const children = slots.default && slots.default(); 5060 return children && children.length === 1 ? children[0] : children; 5061 }; 5062 } 5063 const cache = /* @__PURE__ */ new Map(); 5064 const keys = /* @__PURE__ */ new Set(); 5065 let current = null; 5066 if (true) { 5067 instance.__v_cache = cache; 5068 } 5069 const parentSuspense = instance.suspense; 5070 const { 5071 renderer: { 5072 p: patch, 5073 m: move, 5074 um: _unmount, 5075 o: { createElement } 5076 } 5077 } = sharedContext; 5078 const storageContainer = createElement("div"); 5079 sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { 5080 const instance2 = vnode.component; 5081 move(vnode, container, anchor, 0, parentSuspense); 5082 patch( 5083 instance2.vnode, 5084 vnode, 5085 container, 5086 anchor, 5087 instance2, 5088 parentSuspense, 5089 namespace, 5090 vnode.slotScopeIds, 5091 optimized 5092 ); 5093 queuePostRenderEffect(() => { 5094 instance2.isDeactivated = false; 5095 if (instance2.a) { 5096 invokeArrayFns(instance2.a); 5097 } 5098 const vnodeHook = vnode.props && vnode.props.onVnodeMounted; 5099 if (vnodeHook) { 5100 invokeVNodeHook(vnodeHook, instance2.parent, vnode); 5101 } 5102 }, parentSuspense); 5103 if (true) { 5104 devtoolsComponentAdded(instance2); 5105 } 5106 }; 5107 sharedContext.deactivate = (vnode) => { 5108 const instance2 = vnode.component; 5109 invalidateMount(instance2.m); 5110 invalidateMount(instance2.a); 5111 move(vnode, storageContainer, null, 1, parentSuspense); 5112 queuePostRenderEffect(() => { 5113 if (instance2.da) { 5114 invokeArrayFns(instance2.da); 5115 } 5116 const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; 5117 if (vnodeHook) { 5118 invokeVNodeHook(vnodeHook, instance2.parent, vnode); 5119 } 5120 instance2.isDeactivated = true; 5121 }, parentSuspense); 5122 if (true) { 5123 devtoolsComponentAdded(instance2); 5124 } 5125 if (true) { 5126 instance2.__keepAliveStorageContainer = storageContainer; 5127 } 5128 }; 5129 function unmount(vnode) { 5130 resetShapeFlag(vnode); 5131 _unmount(vnode, instance, parentSuspense, true); 5132 } 5133 function pruneCache(filter) { 5134 cache.forEach((vnode, key) => { 5135 const name = getComponentName( 5136 isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type 5137 ); 5138 if (name && !filter(name)) { 5139 pruneCacheEntry(key); 5140 } 5141 }); 5142 } 5143 function pruneCacheEntry(key) { 5144 const cached = cache.get(key); 5145 if (cached && (!current || !isSameVNodeType(cached, current))) { 5146 unmount(cached); 5147 } else if (current) { 5148 resetShapeFlag(current); 5149 } 5150 cache.delete(key); 5151 keys.delete(key); 5152 } 5153 watch2( 5154 () => [props.include, props.exclude], 5155 ([include, exclude]) => { 5156 include && pruneCache((name) => matches(include, name)); 5157 exclude && pruneCache((name) => !matches(exclude, name)); 5158 }, 5159 // prune post-render after `current` has been updated 5160 { flush: "post", deep: true } 5161 ); 5162 let pendingCacheKey = null; 5163 const cacheSubtree = () => { 5164 if (pendingCacheKey != null) { 5165 if (isSuspense(instance.subTree.type)) { 5166 queuePostRenderEffect(() => { 5167 cache.set(pendingCacheKey, getInnerChild(instance.subTree)); 5168 }, instance.subTree.suspense); 5169 } else { 5170 cache.set(pendingCacheKey, getInnerChild(instance.subTree)); 5171 } 5172 } 5173 }; 5174 onMounted(cacheSubtree); 5175 onUpdated(cacheSubtree); 5176 onBeforeUnmount(() => { 5177 cache.forEach((cached) => { 5178 const { subTree, suspense } = instance; 5179 const vnode = getInnerChild(subTree); 5180 if (cached.type === vnode.type && cached.key === vnode.key) { 5181 resetShapeFlag(vnode); 5182 const da = vnode.component.da; 5183 da && queuePostRenderEffect(da, suspense); 5184 return; 5185 } 5186 unmount(cached); 5187 }); 5188 }); 5189 return () => { 5190 pendingCacheKey = null; 5191 if (!slots.default) { 5192 return current = null; 5193 } 5194 const children = slots.default(); 5195 const rawVNode = children[0]; 5196 if (children.length > 1) { 5197 if (true) { 5198 warn$1(`KeepAlive should contain exactly one component child.`); 5199 } 5200 current = null; 5201 return children; 5202 } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { 5203 current = null; 5204 return rawVNode; 5205 } 5206 let vnode = getInnerChild(rawVNode); 5207 if (vnode.type === Comment) { 5208 current = null; 5209 return vnode; 5210 } 5211 const comp = vnode.type; 5212 const name = getComponentName( 5213 isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp 5214 ); 5215 const { include, exclude, max } = props; 5216 if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { 5217 vnode.shapeFlag &= -257; 5218 current = vnode; 5219 return rawVNode; 5220 } 5221 const key = vnode.key == null ? comp : vnode.key; 5222 const cachedVNode = cache.get(key); 5223 if (vnode.el) { 5224 vnode = cloneVNode(vnode); 5225 if (rawVNode.shapeFlag & 128) { 5226 rawVNode.ssContent = vnode; 5227 } 5228 } 5229 pendingCacheKey = key; 5230 if (cachedVNode) { 5231 vnode.el = cachedVNode.el; 5232 vnode.component = cachedVNode.component; 5233 if (vnode.transition) { 5234 setTransitionHooks(vnode, vnode.transition); 5235 } 5236 vnode.shapeFlag |= 512; 5237 keys.delete(key); 5238 keys.add(key); 5239 } else { 5240 keys.add(key); 5241 if (max && keys.size > parseInt(max, 10)) { 5242 pruneCacheEntry(keys.values().next().value); 5243 } 5244 } 5245 vnode.shapeFlag |= 256; 5246 current = vnode; 5247 return isSuspense(rawVNode.type) ? rawVNode : vnode; 5248 }; 5249 } 5250 }; 5251 var KeepAlive = KeepAliveImpl; 5252 function matches(pattern, name) { 5253 if (isArray(pattern)) { 5254 return pattern.some((p2) => matches(p2, name)); 5255 } else if (isString(pattern)) { 5256 return pattern.split(",").includes(name); 5257 } else if (isRegExp(pattern)) { 5258 pattern.lastIndex = 0; 5259 return pattern.test(name); 5260 } 5261 return false; 5262 } 5263 function onActivated(hook, target) { 5264 registerKeepAliveHook(hook, "a", target); 5265 } 5266 function onDeactivated(hook, target) { 5267 registerKeepAliveHook(hook, "da", target); 5268 } 5269 function registerKeepAliveHook(hook, type, target = currentInstance) { 5270 const wrappedHook = hook.__wdc || (hook.__wdc = () => { 5271 let current = target; 5272 while (current) { 5273 if (current.isDeactivated) { 5274 return; 5275 } 5276 current = current.parent; 5277 } 5278 return hook(); 5279 }); 5280 injectHook(type, wrappedHook, target); 5281 if (target) { 5282 let current = target.parent; 5283 while (current && current.parent) { 5284 if (isKeepAlive(current.parent.vnode)) { 5285 injectToKeepAliveRoot(wrappedHook, type, target, current); 5286 } 5287 current = current.parent; 5288 } 5289 } 5290 } 5291 function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { 5292 const injected = injectHook( 5293 type, 5294 hook, 5295 keepAliveRoot, 5296 true 5297 /* prepend */ 5298 ); 5299 onUnmounted(() => { 5300 remove(keepAliveRoot[type], injected); 5301 }, target); 5302 } 5303 function resetShapeFlag(vnode) { 5304 vnode.shapeFlag &= -257; 5305 vnode.shapeFlag &= -513; 5306 } 5307 function getInnerChild(vnode) { 5308 return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; 5309 } 5310 function injectHook(type, hook, target = currentInstance, prepend = false) { 5311 if (target) { 5312 const hooks = target[type] || (target[type] = []); 5313 const wrappedHook = hook.__weh || (hook.__weh = (...args) => { 5314 pauseTracking(); 5315 const reset = setCurrentInstance(target); 5316 const res = callWithAsyncErrorHandling(hook, target, type, args); 5317 reset(); 5318 resetTracking(); 5319 return res; 5320 }); 5321 if (prepend) { 5322 hooks.unshift(wrappedHook); 5323 } else { 5324 hooks.push(wrappedHook); 5325 } 5326 return wrappedHook; 5327 } else if (true) { 5328 const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); 5329 warn$1( 5330 `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` 5331 ); 5332 } 5333 } 5334 var createHook = (lifecycle) => (hook, target = currentInstance) => { 5335 if (!isInSSRComponentSetup || lifecycle === "sp") { 5336 injectHook(lifecycle, (...args) => hook(...args), target); 5337 } 5338 }; 5339 var onBeforeMount = createHook("bm"); 5340 var onMounted = createHook("m"); 5341 var onBeforeUpdate = createHook( 5342 "bu" 5343 ); 5344 var onUpdated = createHook("u"); 5345 var onBeforeUnmount = createHook( 5346 "bum" 5347 ); 5348 var onUnmounted = createHook("um"); 5349 var onServerPrefetch = createHook( 5350 "sp" 5351 ); 5352 var onRenderTriggered = createHook("rtg"); 5353 var onRenderTracked = createHook("rtc"); 5354 function onErrorCaptured(hook, target = currentInstance) { 5355 injectHook("ec", hook, target); 5356 } 5357 var COMPONENTS = "components"; 5358 var DIRECTIVES = "directives"; 5359 function resolveComponent(name, maybeSelfReference) { 5360 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; 5361 } 5362 var NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc"); 5363 function resolveDynamicComponent(component) { 5364 if (isString(component)) { 5365 return resolveAsset(COMPONENTS, component, false) || component; 5366 } else { 5367 return component || NULL_DYNAMIC_COMPONENT; 5368 } 5369 } 5370 function resolveDirective(name) { 5371 return resolveAsset(DIRECTIVES, name); 5372 } 5373 function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { 5374 const instance = currentRenderingInstance || currentInstance; 5375 if (instance) { 5376 const Component = instance.type; 5377 if (type === COMPONENTS) { 5378 const selfName = getComponentName( 5379 Component, 5380 false 5381 ); 5382 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { 5383 return Component; 5384 } 5385 } 5386 const res = ( 5387 // local registration 5388 // check instance[type] first which is resolved for options API 5389 resolve(instance[type] || Component[type], name) || // global registration 5390 resolve(instance.appContext[type], name) 5391 ); 5392 if (!res && maybeSelfReference) { 5393 return Component; 5394 } 5395 if (warnMissing && !res) { 5396 const extra = type === COMPONENTS ? ` 5397 If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; 5398 warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); 5399 } 5400 return res; 5401 } else if (true) { 5402 warn$1( 5403 `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` 5404 ); 5405 } 5406 } 5407 function resolve(registry, name) { 5408 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); 5409 } 5410 function renderList(source, renderItem, cache, index) { 5411 let ret; 5412 const cached = cache && cache[index]; 5413 const sourceIsArray = isArray(source); 5414 if (sourceIsArray || isString(source)) { 5415 const sourceIsReactiveArray = sourceIsArray && isReactive(source); 5416 let needsWrap = false; 5417 let isReadonlySource = false; 5418 if (sourceIsReactiveArray) { 5419 needsWrap = !isShallow(source); 5420 isReadonlySource = isReadonly(source); 5421 source = shallowReadArray(source); 5422 } 5423 ret = new Array(source.length); 5424 for (let i = 0, l = source.length; i < l; i++) { 5425 ret[i] = renderItem( 5426 needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], 5427 i, 5428 void 0, 5429 cached && cached[i] 5430 ); 5431 } 5432 } else if (typeof source === "number") { 5433 if (!Number.isInteger(source) || source < 0) { 5434 warn$1( 5435 `The v-for range expects a positive integer value but got ${source}.` 5436 ); 5437 ret = []; 5438 } else { 5439 ret = new Array(source); 5440 for (let i = 0; i < source; i++) { 5441 ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); 5442 } 5443 } 5444 } else if (isObject(source)) { 5445 if (source[Symbol.iterator]) { 5446 ret = Array.from( 5447 source, 5448 (item, i) => renderItem(item, i, void 0, cached && cached[i]) 5449 ); 5450 } else { 5451 const keys = Object.keys(source); 5452 ret = new Array(keys.length); 5453 for (let i = 0, l = keys.length; i < l; i++) { 5454 const key = keys[i]; 5455 ret[i] = renderItem(source[key], key, i, cached && cached[i]); 5456 } 5457 } 5458 } else { 5459 ret = []; 5460 } 5461 if (cache) { 5462 cache[index] = ret; 5463 } 5464 return ret; 5465 } 5466 function createSlots(slots, dynamicSlots) { 5467 for (let i = 0; i < dynamicSlots.length; i++) { 5468 const slot = dynamicSlots[i]; 5469 if (isArray(slot)) { 5470 for (let j = 0; j < slot.length; j++) { 5471 slots[slot[j].name] = slot[j].fn; 5472 } 5473 } else if (slot) { 5474 slots[slot.name] = slot.key ? (...args) => { 5475 const res = slot.fn(...args); 5476 if (res) res.key = slot.key; 5477 return res; 5478 } : slot.fn; 5479 } 5480 } 5481 return slots; 5482 } 5483 function renderSlot(slots, name, props = {}, fallback, noSlotted) { 5484 if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { 5485 const hasProps = Object.keys(props).length > 0; 5486 if (name !== "default") props.name = name; 5487 return openBlock(), createBlock( 5488 Fragment, 5489 null, 5490 [createVNode("slot", props, fallback && fallback())], 5491 hasProps ? -2 : 64 5492 ); 5493 } 5494 let slot = slots[name]; 5495 if (slot && slot.length > 1) { 5496 warn$1( 5497 `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.` 5498 ); 5499 slot = () => []; 5500 } 5501 if (slot && slot._c) { 5502 slot._d = false; 5503 } 5504 openBlock(); 5505 const validSlotContent = slot && ensureValidVNode(slot(props)); 5506 const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch 5507 // key attached in the `createSlots` helper, respect that 5508 validSlotContent && validSlotContent.key; 5509 const rendered = createBlock( 5510 Fragment, 5511 { 5512 key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content 5513 (!validSlotContent && fallback ? "_fb" : "") 5514 }, 5515 validSlotContent || (fallback ? fallback() : []), 5516 validSlotContent && slots._ === 1 ? 64 : -2 5517 ); 5518 if (!noSlotted && rendered.scopeId) { 5519 rendered.slotScopeIds = [rendered.scopeId + "-s"]; 5520 } 5521 if (slot && slot._c) { 5522 slot._d = true; 5523 } 5524 return rendered; 5525 } 5526 function ensureValidVNode(vnodes) { 5527 return vnodes.some((child) => { 5528 if (!isVNode(child)) return true; 5529 if (child.type === Comment) return false; 5530 if (child.type === Fragment && !ensureValidVNode(child.children)) 5531 return false; 5532 return true; 5533 }) ? vnodes : null; 5534 } 5535 function toHandlers(obj, preserveCaseIfNecessary) { 5536 const ret = {}; 5537 if (!isObject(obj)) { 5538 warn$1(`v-on with no argument expects an object value.`); 5539 return ret; 5540 } 5541 for (const key in obj) { 5542 ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; 5543 } 5544 return ret; 5545 } 5546 var getPublicInstance = (i) => { 5547 if (!i) return null; 5548 if (isStatefulComponent(i)) return getComponentPublicInstance(i); 5549 return getPublicInstance(i.parent); 5550 }; 5551 var publicPropertiesMap = ( 5552 // Move PURE marker to new line to workaround compiler discarding it 5553 // due to type annotation 5554 extend(/* @__PURE__ */ Object.create(null), { 5555 $: (i) => i, 5556 $el: (i) => i.vnode.el, 5557 $data: (i) => i.data, 5558 $props: (i) => true ? shallowReadonly(i.props) : i.props, 5559 $attrs: (i) => true ? shallowReadonly(i.attrs) : i.attrs, 5560 $slots: (i) => true ? shallowReadonly(i.slots) : i.slots, 5561 $refs: (i) => true ? shallowReadonly(i.refs) : i.refs, 5562 $parent: (i) => getPublicInstance(i.parent), 5563 $root: (i) => getPublicInstance(i.root), 5564 $host: (i) => i.ce, 5565 $emit: (i) => i.emit, 5566 $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type, 5567 $forceUpdate: (i) => i.f || (i.f = () => { 5568 queueJob(i.update); 5569 }), 5570 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), 5571 $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP 5572 }) 5573 ); 5574 var isReservedPrefix = (key) => key === "_" || key === "$"; 5575 var hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); 5576 var PublicInstanceProxyHandlers = { 5577 get({ _: instance }, key) { 5578 if (key === "__v_skip") { 5579 return true; 5580 } 5581 const { ctx, setupState, data, props, accessCache, type, appContext } = instance; 5582 if (key === "__isVue") { 5583 return true; 5584 } 5585 if (key[0] !== "$") { 5586 const n = accessCache[key]; 5587 if (n !== void 0) { 5588 switch (n) { 5589 case 1: 5590 return setupState[key]; 5591 case 2: 5592 return data[key]; 5593 case 4: 5594 return ctx[key]; 5595 case 3: 5596 return props[key]; 5597 } 5598 } else if (hasSetupBinding(setupState, key)) { 5599 accessCache[key] = 1; 5600 return setupState[key]; 5601 } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) { 5602 accessCache[key] = 2; 5603 return data[key]; 5604 } else if (hasOwn(props, key)) { 5605 accessCache[key] = 3; 5606 return props[key]; 5607 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 5608 accessCache[key] = 4; 5609 return ctx[key]; 5610 } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) { 5611 accessCache[key] = 0; 5612 } 5613 } 5614 const publicGetter = publicPropertiesMap[key]; 5615 let cssModule, globalProperties; 5616 if (publicGetter) { 5617 if (key === "$attrs") { 5618 track(instance.attrs, "get", ""); 5619 markAttrsAccessed(); 5620 } else if (key === "$slots") { 5621 track(instance, "get", key); 5622 } 5623 return publicGetter(instance); 5624 } else if ( 5625 // css module (injected by vue-loader) 5626 (cssModule = type.__cssModules) && (cssModule = cssModule[key]) 5627 ) { 5628 return cssModule; 5629 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 5630 accessCache[key] = 4; 5631 return ctx[key]; 5632 } else if ( 5633 // global properties 5634 globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) 5635 ) { 5636 { 5637 return globalProperties[key]; 5638 } 5639 } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading 5640 // to infinite warning loop 5641 key.indexOf("__v") !== 0)) { 5642 if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { 5643 warn$1( 5644 `Property ${JSON.stringify( 5645 key 5646 )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` 5647 ); 5648 } else if (instance === currentRenderingInstance) { 5649 warn$1( 5650 `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` 5651 ); 5652 } 5653 } 5654 }, 5655 set({ _: instance }, key, value) { 5656 const { data, setupState, ctx } = instance; 5657 if (hasSetupBinding(setupState, key)) { 5658 setupState[key] = value; 5659 return true; 5660 } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { 5661 warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); 5662 return false; 5663 } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) { 5664 data[key] = value; 5665 return true; 5666 } else if (hasOwn(instance.props, key)) { 5667 warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); 5668 return false; 5669 } 5670 if (key[0] === "$" && key.slice(1) in instance) { 5671 warn$1( 5672 `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` 5673 ); 5674 return false; 5675 } else { 5676 if (key in instance.appContext.config.globalProperties) { 5677 Object.defineProperty(ctx, key, { 5678 enumerable: true, 5679 configurable: true, 5680 value 5681 }); 5682 } else { 5683 ctx[key] = value; 5684 } 5685 } 5686 return true; 5687 }, 5688 has({ 5689 _: { data, setupState, accessCache, ctx, appContext, props, type } 5690 }, key) { 5691 let cssModules; 5692 return !!(accessCache[key] || __VUE_OPTIONS_API__ && data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]); 5693 }, 5694 defineProperty(target, key, descriptor) { 5695 if (descriptor.get != null) { 5696 target._.accessCache[key] = 0; 5697 } else if (hasOwn(descriptor, "value")) { 5698 this.set(target, key, descriptor.value, null); 5699 } 5700 return Reflect.defineProperty(target, key, descriptor); 5701 } 5702 }; 5703 if (true) { 5704 PublicInstanceProxyHandlers.ownKeys = (target) => { 5705 warn$1( 5706 `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` 5707 ); 5708 return Reflect.ownKeys(target); 5709 }; 5710 } 5711 var RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, { 5712 get(target, key) { 5713 if (key === Symbol.unscopables) { 5714 return; 5715 } 5716 return PublicInstanceProxyHandlers.get(target, key, target); 5717 }, 5718 has(_, key) { 5719 const has = key[0] !== "_" && !isGloballyAllowed(key); 5720 if (!has && PublicInstanceProxyHandlers.has(_, key)) { 5721 warn$1( 5722 `Property ${JSON.stringify( 5723 key 5724 )} should not start with _ which is a reserved prefix for Vue internals.` 5725 ); 5726 } 5727 return has; 5728 } 5729 }); 5730 function createDevRenderContext(instance) { 5731 const target = {}; 5732 Object.defineProperty(target, `_`, { 5733 configurable: true, 5734 enumerable: false, 5735 get: () => instance 5736 }); 5737 Object.keys(publicPropertiesMap).forEach((key) => { 5738 Object.defineProperty(target, key, { 5739 configurable: true, 5740 enumerable: false, 5741 get: () => publicPropertiesMap[key](instance), 5742 // intercepted by the proxy so no need for implementation, 5743 // but needed to prevent set errors 5744 set: NOOP 5745 }); 5746 }); 5747 return target; 5748 } 5749 function exposePropsOnRenderContext(instance) { 5750 const { 5751 ctx, 5752 propsOptions: [propsOptions] 5753 } = instance; 5754 if (propsOptions) { 5755 Object.keys(propsOptions).forEach((key) => { 5756 Object.defineProperty(ctx, key, { 5757 enumerable: true, 5758 configurable: true, 5759 get: () => instance.props[key], 5760 set: NOOP 5761 }); 5762 }); 5763 } 5764 } 5765 function exposeSetupStateOnRenderContext(instance) { 5766 const { ctx, setupState } = instance; 5767 Object.keys(toRaw(setupState)).forEach((key) => { 5768 if (!setupState.__isScriptSetup) { 5769 if (isReservedPrefix(key[0])) { 5770 warn$1( 5771 `setup() return property ${JSON.stringify( 5772 key 5773 )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` 5774 ); 5775 return; 5776 } 5777 Object.defineProperty(ctx, key, { 5778 enumerable: true, 5779 configurable: true, 5780 get: () => setupState[key], 5781 set: NOOP 5782 }); 5783 } 5784 }); 5785 } 5786 var warnRuntimeUsage = (method) => warn$1( 5787 `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` 5788 ); 5789 function defineProps() { 5790 if (true) { 5791 warnRuntimeUsage(`defineProps`); 5792 } 5793 return null; 5794 } 5795 function defineEmits() { 5796 if (true) { 5797 warnRuntimeUsage(`defineEmits`); 5798 } 5799 return null; 5800 } 5801 function defineExpose(exposed) { 5802 if (true) { 5803 warnRuntimeUsage(`defineExpose`); 5804 } 5805 } 5806 function defineOptions(options) { 5807 if (true) { 5808 warnRuntimeUsage(`defineOptions`); 5809 } 5810 } 5811 function defineSlots() { 5812 if (true) { 5813 warnRuntimeUsage(`defineSlots`); 5814 } 5815 return null; 5816 } 5817 function defineModel() { 5818 if (true) { 5819 warnRuntimeUsage("defineModel"); 5820 } 5821 } 5822 function withDefaults(props, defaults) { 5823 if (true) { 5824 warnRuntimeUsage(`withDefaults`); 5825 } 5826 return null; 5827 } 5828 function useSlots() { 5829 return getContext("useSlots").slots; 5830 } 5831 function useAttrs() { 5832 return getContext("useAttrs").attrs; 5833 } 5834 function getContext(calledFunctionName) { 5835 const i = getCurrentInstance(); 5836 if (!i) { 5837 warn$1(`${calledFunctionName}() called without active instance.`); 5838 } 5839 return i.setupContext || (i.setupContext = createSetupContext(i)); 5840 } 5841 function normalizePropsOrEmits(props) { 5842 return isArray(props) ? props.reduce( 5843 (normalized, p2) => (normalized[p2] = null, normalized), 5844 {} 5845 ) : props; 5846 } 5847 function mergeDefaults(raw, defaults) { 5848 const props = normalizePropsOrEmits(raw); 5849 for (const key in defaults) { 5850 if (key.startsWith("__skip")) continue; 5851 let opt = props[key]; 5852 if (opt) { 5853 if (isArray(opt) || isFunction(opt)) { 5854 opt = props[key] = { type: opt, default: defaults[key] }; 5855 } else { 5856 opt.default = defaults[key]; 5857 } 5858 } else if (opt === null) { 5859 opt = props[key] = { default: defaults[key] }; 5860 } else if (true) { 5861 warn$1(`props default key "${key}" has no corresponding declaration.`); 5862 } 5863 if (opt && defaults[`__skip_${key}`]) { 5864 opt.skipFactory = true; 5865 } 5866 } 5867 return props; 5868 } 5869 function mergeModels(a, b) { 5870 if (!a || !b) return a || b; 5871 if (isArray(a) && isArray(b)) return a.concat(b); 5872 return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); 5873 } 5874 function createPropsRestProxy(props, excludedKeys) { 5875 const ret = {}; 5876 for (const key in props) { 5877 if (!excludedKeys.includes(key)) { 5878 Object.defineProperty(ret, key, { 5879 enumerable: true, 5880 get: () => props[key] 5881 }); 5882 } 5883 } 5884 return ret; 5885 } 5886 function withAsyncContext(getAwaitable) { 5887 const ctx = getCurrentInstance(); 5888 const inSSRSetup = isInSSRComponentSetup; 5889 if (!ctx) { 5890 warn$1( 5891 `withAsyncContext called without active current instance. This is likely a bug.` 5892 ); 5893 } 5894 let awaitable = getAwaitable(); 5895 unsetCurrentInstance(); 5896 if (inSSRSetup) { 5897 setInSSRSetupState(false); 5898 } 5899 const restore = () => { 5900 setCurrentInstance(ctx); 5901 if (inSSRSetup) { 5902 setInSSRSetupState(true); 5903 } 5904 }; 5905 const cleanup = () => { 5906 if (getCurrentInstance() !== ctx) ctx.scope.off(); 5907 unsetCurrentInstance(); 5908 if (inSSRSetup) { 5909 setInSSRSetupState(false); 5910 } 5911 }; 5912 if (isPromise(awaitable)) { 5913 awaitable = awaitable.catch((e) => { 5914 restore(); 5915 Promise.resolve().then(() => Promise.resolve().then(cleanup)); 5916 throw e; 5917 }); 5918 } 5919 return [ 5920 awaitable, 5921 () => { 5922 restore(); 5923 Promise.resolve().then(cleanup); 5924 } 5925 ]; 5926 } 5927 function createDuplicateChecker() { 5928 const cache = /* @__PURE__ */ Object.create(null); 5929 return (type, key) => { 5930 if (cache[key]) { 5931 warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); 5932 } else { 5933 cache[key] = type; 5934 } 5935 }; 5936 } 5937 var shouldCacheAccess = true; 5938 function applyOptions(instance) { 5939 const options = resolveMergedOptions(instance); 5940 const publicThis = instance.proxy; 5941 const ctx = instance.ctx; 5942 shouldCacheAccess = false; 5943 if (options.beforeCreate) { 5944 callHook(options.beforeCreate, instance, "bc"); 5945 } 5946 const { 5947 // state 5948 data: dataOptions, 5949 computed: computedOptions, 5950 methods, 5951 watch: watchOptions, 5952 provide: provideOptions, 5953 inject: injectOptions, 5954 // lifecycle 5955 created, 5956 beforeMount, 5957 mounted, 5958 beforeUpdate, 5959 updated, 5960 activated, 5961 deactivated, 5962 beforeDestroy, 5963 beforeUnmount, 5964 destroyed, 5965 unmounted, 5966 render: render2, 5967 renderTracked, 5968 renderTriggered, 5969 errorCaptured, 5970 serverPrefetch, 5971 // public API 5972 expose, 5973 inheritAttrs, 5974 // assets 5975 components, 5976 directives, 5977 filters 5978 } = options; 5979 const checkDuplicateProperties = true ? createDuplicateChecker() : null; 5980 if (true) { 5981 const [propsOptions] = instance.propsOptions; 5982 if (propsOptions) { 5983 for (const key in propsOptions) { 5984 checkDuplicateProperties("Props", key); 5985 } 5986 } 5987 } 5988 if (injectOptions) { 5989 resolveInjections(injectOptions, ctx, checkDuplicateProperties); 5990 } 5991 if (methods) { 5992 for (const key in methods) { 5993 const methodHandler = methods[key]; 5994 if (isFunction(methodHandler)) { 5995 if (true) { 5996 Object.defineProperty(ctx, key, { 5997 value: methodHandler.bind(publicThis), 5998 configurable: true, 5999 enumerable: true, 6000 writable: true 6001 }); 6002 } else { 6003 ctx[key] = methodHandler.bind(publicThis); 6004 } 6005 if (true) { 6006 checkDuplicateProperties("Methods", key); 6007 } 6008 } else if (true) { 6009 warn$1( 6010 `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` 6011 ); 6012 } 6013 } 6014 } 6015 if (dataOptions) { 6016 if (!isFunction(dataOptions)) { 6017 warn$1( 6018 `The data option must be a function. Plain object usage is no longer supported.` 6019 ); 6020 } 6021 const data = dataOptions.call(publicThis, publicThis); 6022 if (isPromise(data)) { 6023 warn$1( 6024 `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` 6025 ); 6026 } 6027 if (!isObject(data)) { 6028 warn$1(`data() should return an object.`); 6029 } else { 6030 instance.data = reactive(data); 6031 if (true) { 6032 for (const key in data) { 6033 checkDuplicateProperties("Data", key); 6034 if (!isReservedPrefix(key[0])) { 6035 Object.defineProperty(ctx, key, { 6036 configurable: true, 6037 enumerable: true, 6038 get: () => data[key], 6039 set: NOOP 6040 }); 6041 } 6042 } 6043 } 6044 } 6045 } 6046 shouldCacheAccess = true; 6047 if (computedOptions) { 6048 for (const key in computedOptions) { 6049 const opt = computedOptions[key]; 6050 const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; 6051 if (get === NOOP) { 6052 warn$1(`Computed property "${key}" has no getter.`); 6053 } 6054 const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : true ? () => { 6055 warn$1( 6056 `Write operation failed: computed property "${key}" is readonly.` 6057 ); 6058 } : NOOP; 6059 const c = computed2({ 6060 get, 6061 set 6062 }); 6063 Object.defineProperty(ctx, key, { 6064 enumerable: true, 6065 configurable: true, 6066 get: () => c.value, 6067 set: (v) => c.value = v 6068 }); 6069 if (true) { 6070 checkDuplicateProperties("Computed", key); 6071 } 6072 } 6073 } 6074 if (watchOptions) { 6075 for (const key in watchOptions) { 6076 createWatcher(watchOptions[key], ctx, publicThis, key); 6077 } 6078 } 6079 if (provideOptions) { 6080 const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; 6081 Reflect.ownKeys(provides).forEach((key) => { 6082 provide(key, provides[key]); 6083 }); 6084 } 6085 if (created) { 6086 callHook(created, instance, "c"); 6087 } 6088 function registerLifecycleHook(register, hook) { 6089 if (isArray(hook)) { 6090 hook.forEach((_hook) => register(_hook.bind(publicThis))); 6091 } else if (hook) { 6092 register(hook.bind(publicThis)); 6093 } 6094 } 6095 registerLifecycleHook(onBeforeMount, beforeMount); 6096 registerLifecycleHook(onMounted, mounted); 6097 registerLifecycleHook(onBeforeUpdate, beforeUpdate); 6098 registerLifecycleHook(onUpdated, updated); 6099 registerLifecycleHook(onActivated, activated); 6100 registerLifecycleHook(onDeactivated, deactivated); 6101 registerLifecycleHook(onErrorCaptured, errorCaptured); 6102 registerLifecycleHook(onRenderTracked, renderTracked); 6103 registerLifecycleHook(onRenderTriggered, renderTriggered); 6104 registerLifecycleHook(onBeforeUnmount, beforeUnmount); 6105 registerLifecycleHook(onUnmounted, unmounted); 6106 registerLifecycleHook(onServerPrefetch, serverPrefetch); 6107 if (isArray(expose)) { 6108 if (expose.length) { 6109 const exposed = instance.exposed || (instance.exposed = {}); 6110 expose.forEach((key) => { 6111 Object.defineProperty(exposed, key, { 6112 get: () => publicThis[key], 6113 set: (val) => publicThis[key] = val, 6114 enumerable: true 6115 }); 6116 }); 6117 } else if (!instance.exposed) { 6118 instance.exposed = {}; 6119 } 6120 } 6121 if (render2 && instance.render === NOOP) { 6122 instance.render = render2; 6123 } 6124 if (inheritAttrs != null) { 6125 instance.inheritAttrs = inheritAttrs; 6126 } 6127 if (components) instance.components = components; 6128 if (directives) instance.directives = directives; 6129 if (serverPrefetch) { 6130 markAsyncBoundary(instance); 6131 } 6132 } 6133 function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { 6134 if (isArray(injectOptions)) { 6135 injectOptions = normalizeInject(injectOptions); 6136 } 6137 for (const key in injectOptions) { 6138 const opt = injectOptions[key]; 6139 let injected; 6140 if (isObject(opt)) { 6141 if ("default" in opt) { 6142 injected = inject( 6143 opt.from || key, 6144 opt.default, 6145 true 6146 ); 6147 } else { 6148 injected = inject(opt.from || key); 6149 } 6150 } else { 6151 injected = inject(opt); 6152 } 6153 if (isRef2(injected)) { 6154 Object.defineProperty(ctx, key, { 6155 enumerable: true, 6156 configurable: true, 6157 get: () => injected.value, 6158 set: (v) => injected.value = v 6159 }); 6160 } else { 6161 ctx[key] = injected; 6162 } 6163 if (true) { 6164 checkDuplicateProperties("Inject", key); 6165 } 6166 } 6167 } 6168 function callHook(hook, instance, type) { 6169 callWithAsyncErrorHandling( 6170 isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), 6171 instance, 6172 type 6173 ); 6174 } 6175 function createWatcher(raw, ctx, publicThis, key) { 6176 let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; 6177 if (isString(raw)) { 6178 const handler = ctx[raw]; 6179 if (isFunction(handler)) { 6180 { 6181 watch2(getter, handler); 6182 } 6183 } else if (true) { 6184 warn$1(`Invalid watch handler specified by key "${raw}"`, handler); 6185 } 6186 } else if (isFunction(raw)) { 6187 { 6188 watch2(getter, raw.bind(publicThis)); 6189 } 6190 } else if (isObject(raw)) { 6191 if (isArray(raw)) { 6192 raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); 6193 } else { 6194 const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; 6195 if (isFunction(handler)) { 6196 watch2(getter, handler, raw); 6197 } else if (true) { 6198 warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); 6199 } 6200 } 6201 } else if (true) { 6202 warn$1(`Invalid watch option: "${key}"`, raw); 6203 } 6204 } 6205 function resolveMergedOptions(instance) { 6206 const base = instance.type; 6207 const { mixins, extends: extendsOptions } = base; 6208 const { 6209 mixins: globalMixins, 6210 optionsCache: cache, 6211 config: { optionMergeStrategies } 6212 } = instance.appContext; 6213 const cached = cache.get(base); 6214 let resolved; 6215 if (cached) { 6216 resolved = cached; 6217 } else if (!globalMixins.length && !mixins && !extendsOptions) { 6218 { 6219 resolved = base; 6220 } 6221 } else { 6222 resolved = {}; 6223 if (globalMixins.length) { 6224 globalMixins.forEach( 6225 (m) => mergeOptions(resolved, m, optionMergeStrategies, true) 6226 ); 6227 } 6228 mergeOptions(resolved, base, optionMergeStrategies); 6229 } 6230 if (isObject(base)) { 6231 cache.set(base, resolved); 6232 } 6233 return resolved; 6234 } 6235 function mergeOptions(to, from, strats, asMixin = false) { 6236 const { mixins, extends: extendsOptions } = from; 6237 if (extendsOptions) { 6238 mergeOptions(to, extendsOptions, strats, true); 6239 } 6240 if (mixins) { 6241 mixins.forEach( 6242 (m) => mergeOptions(to, m, strats, true) 6243 ); 6244 } 6245 for (const key in from) { 6246 if (asMixin && key === "expose") { 6247 warn$1( 6248 `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` 6249 ); 6250 } else { 6251 const strat = internalOptionMergeStrats[key] || strats && strats[key]; 6252 to[key] = strat ? strat(to[key], from[key]) : from[key]; 6253 } 6254 } 6255 return to; 6256 } 6257 var internalOptionMergeStrats = { 6258 data: mergeDataFn, 6259 props: mergeEmitsOrPropsOptions, 6260 emits: mergeEmitsOrPropsOptions, 6261 // objects 6262 methods: mergeObjectOptions, 6263 computed: mergeObjectOptions, 6264 // lifecycle 6265 beforeCreate: mergeAsArray, 6266 created: mergeAsArray, 6267 beforeMount: mergeAsArray, 6268 mounted: mergeAsArray, 6269 beforeUpdate: mergeAsArray, 6270 updated: mergeAsArray, 6271 beforeDestroy: mergeAsArray, 6272 beforeUnmount: mergeAsArray, 6273 destroyed: mergeAsArray, 6274 unmounted: mergeAsArray, 6275 activated: mergeAsArray, 6276 deactivated: mergeAsArray, 6277 errorCaptured: mergeAsArray, 6278 serverPrefetch: mergeAsArray, 6279 // assets 6280 components: mergeObjectOptions, 6281 directives: mergeObjectOptions, 6282 // watch 6283 watch: mergeWatchOptions, 6284 // provide / inject 6285 provide: mergeDataFn, 6286 inject: mergeInject 6287 }; 6288 function mergeDataFn(to, from) { 6289 if (!from) { 6290 return to; 6291 } 6292 if (!to) { 6293 return from; 6294 } 6295 return function mergedDataFn() { 6296 return extend( 6297 isFunction(to) ? to.call(this, this) : to, 6298 isFunction(from) ? from.call(this, this) : from 6299 ); 6300 }; 6301 } 6302 function mergeInject(to, from) { 6303 return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); 6304 } 6305 function normalizeInject(raw) { 6306 if (isArray(raw)) { 6307 const res = {}; 6308 for (let i = 0; i < raw.length; i++) { 6309 res[raw[i]] = raw[i]; 6310 } 6311 return res; 6312 } 6313 return raw; 6314 } 6315 function mergeAsArray(to, from) { 6316 return to ? [...new Set([].concat(to, from))] : from; 6317 } 6318 function mergeObjectOptions(to, from) { 6319 return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; 6320 } 6321 function mergeEmitsOrPropsOptions(to, from) { 6322 if (to) { 6323 if (isArray(to) && isArray(from)) { 6324 return [.../* @__PURE__ */ new Set([...to, ...from])]; 6325 } 6326 return extend( 6327 /* @__PURE__ */ Object.create(null), 6328 normalizePropsOrEmits(to), 6329 normalizePropsOrEmits(from != null ? from : {}) 6330 ); 6331 } else { 6332 return from; 6333 } 6334 } 6335 function mergeWatchOptions(to, from) { 6336 if (!to) return from; 6337 if (!from) return to; 6338 const merged = extend(/* @__PURE__ */ Object.create(null), to); 6339 for (const key in from) { 6340 merged[key] = mergeAsArray(to[key], from[key]); 6341 } 6342 return merged; 6343 } 6344 function createAppContext() { 6345 return { 6346 app: null, 6347 config: { 6348 isNativeTag: NO, 6349 performance: false, 6350 globalProperties: {}, 6351 optionMergeStrategies: {}, 6352 errorHandler: void 0, 6353 warnHandler: void 0, 6354 compilerOptions: {} 6355 }, 6356 mixins: [], 6357 components: {}, 6358 directives: {}, 6359 provides: /* @__PURE__ */ Object.create(null), 6360 optionsCache: /* @__PURE__ */ new WeakMap(), 6361 propsCache: /* @__PURE__ */ new WeakMap(), 6362 emitsCache: /* @__PURE__ */ new WeakMap() 6363 }; 6364 } 6365 var uid$1 = 0; 6366 function createAppAPI(render2, hydrate2) { 6367 return function createApp2(rootComponent, rootProps = null) { 6368 if (!isFunction(rootComponent)) { 6369 rootComponent = extend({}, rootComponent); 6370 } 6371 if (rootProps != null && !isObject(rootProps)) { 6372 warn$1(`root props passed to app.mount() must be an object.`); 6373 rootProps = null; 6374 } 6375 const context = createAppContext(); 6376 const installedPlugins = /* @__PURE__ */ new WeakSet(); 6377 const pluginCleanupFns = []; 6378 let isMounted = false; 6379 const app = context.app = { 6380 _uid: uid$1++, 6381 _component: rootComponent, 6382 _props: rootProps, 6383 _container: null, 6384 _context: context, 6385 _instance: null, 6386 version, 6387 get config() { 6388 return context.config; 6389 }, 6390 set config(v) { 6391 if (true) { 6392 warn$1( 6393 `app.config cannot be replaced. Modify individual options instead.` 6394 ); 6395 } 6396 }, 6397 use(plugin, ...options) { 6398 if (installedPlugins.has(plugin)) { 6399 warn$1(`Plugin has already been applied to target app.`); 6400 } else if (plugin && isFunction(plugin.install)) { 6401 installedPlugins.add(plugin); 6402 plugin.install(app, ...options); 6403 } else if (isFunction(plugin)) { 6404 installedPlugins.add(plugin); 6405 plugin(app, ...options); 6406 } else if (true) { 6407 warn$1( 6408 `A plugin must either be a function or an object with an "install" function.` 6409 ); 6410 } 6411 return app; 6412 }, 6413 mixin(mixin) { 6414 if (__VUE_OPTIONS_API__) { 6415 if (!context.mixins.includes(mixin)) { 6416 context.mixins.push(mixin); 6417 } else if (true) { 6418 warn$1( 6419 "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") 6420 ); 6421 } 6422 } else if (true) { 6423 warn$1("Mixins are only available in builds supporting Options API"); 6424 } 6425 return app; 6426 }, 6427 component(name, component) { 6428 if (true) { 6429 validateComponentName(name, context.config); 6430 } 6431 if (!component) { 6432 return context.components[name]; 6433 } 6434 if (context.components[name]) { 6435 warn$1(`Component "${name}" has already been registered in target app.`); 6436 } 6437 context.components[name] = component; 6438 return app; 6439 }, 6440 directive(name, directive) { 6441 if (true) { 6442 validateDirectiveName(name); 6443 } 6444 if (!directive) { 6445 return context.directives[name]; 6446 } 6447 if (context.directives[name]) { 6448 warn$1(`Directive "${name}" has already been registered in target app.`); 6449 } 6450 context.directives[name] = directive; 6451 return app; 6452 }, 6453 mount(rootContainer, isHydrate, namespace) { 6454 if (!isMounted) { 6455 if (rootContainer.__vue_app__) { 6456 warn$1( 6457 `There is already an app instance mounted on the host container. 6458 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` 6459 ); 6460 } 6461 const vnode = app._ceVNode || createVNode(rootComponent, rootProps); 6462 vnode.appContext = context; 6463 if (namespace === true) { 6464 namespace = "svg"; 6465 } else if (namespace === false) { 6466 namespace = void 0; 6467 } 6468 if (true) { 6469 context.reload = () => { 6470 const cloned = cloneVNode(vnode); 6471 cloned.el = null; 6472 render2(cloned, rootContainer, namespace); 6473 }; 6474 } 6475 if (isHydrate && hydrate2) { 6476 hydrate2(vnode, rootContainer); 6477 } else { 6478 render2(vnode, rootContainer, namespace); 6479 } 6480 isMounted = true; 6481 app._container = rootContainer; 6482 rootContainer.__vue_app__ = app; 6483 if (true) { 6484 app._instance = vnode.component; 6485 devtoolsInitApp(app, version); 6486 } 6487 return getComponentPublicInstance(vnode.component); 6488 } else if (true) { 6489 warn$1( 6490 `App has already been mounted. 6491 If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` 6492 ); 6493 } 6494 }, 6495 onUnmount(cleanupFn) { 6496 if (typeof cleanupFn !== "function") { 6497 warn$1( 6498 `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` 6499 ); 6500 } 6501 pluginCleanupFns.push(cleanupFn); 6502 }, 6503 unmount() { 6504 if (isMounted) { 6505 callWithAsyncErrorHandling( 6506 pluginCleanupFns, 6507 app._instance, 6508 16 6509 ); 6510 render2(null, app._container); 6511 if (true) { 6512 app._instance = null; 6513 devtoolsUnmountApp(app); 6514 } 6515 delete app._container.__vue_app__; 6516 } else if (true) { 6517 warn$1(`Cannot unmount an app that is not mounted.`); 6518 } 6519 }, 6520 provide(key, value) { 6521 if (key in context.provides) { 6522 if (hasOwn(context.provides, key)) { 6523 warn$1( 6524 `App already provides property with key "${String(key)}". It will be overwritten with the new value.` 6525 ); 6526 } else { 6527 warn$1( 6528 `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.` 6529 ); 6530 } 6531 } 6532 context.provides[key] = value; 6533 return app; 6534 }, 6535 runWithContext(fn) { 6536 const lastApp = currentApp; 6537 currentApp = app; 6538 try { 6539 return fn(); 6540 } finally { 6541 currentApp = lastApp; 6542 } 6543 } 6544 }; 6545 return app; 6546 }; 6547 } 6548 var currentApp = null; 6549 function useModel(props, name, options = EMPTY_OBJ) { 6550 const i = getCurrentInstance(); 6551 if (!i) { 6552 warn$1(`useModel() called without active instance.`); 6553 return ref(); 6554 } 6555 const camelizedName = camelize(name); 6556 if (!i.propsOptions[0][camelizedName]) { 6557 warn$1(`useModel() called with prop "${name}" which is not declared.`); 6558 return ref(); 6559 } 6560 const hyphenatedName = hyphenate(name); 6561 const modifiers = getModelModifiers(props, camelizedName); 6562 const res = customRef((track2, trigger2) => { 6563 let localValue; 6564 let prevSetValue = EMPTY_OBJ; 6565 let prevEmittedValue; 6566 watchSyncEffect(() => { 6567 const propValue = props[camelizedName]; 6568 if (hasChanged(localValue, propValue)) { 6569 localValue = propValue; 6570 trigger2(); 6571 } 6572 }); 6573 return { 6574 get() { 6575 track2(); 6576 return options.get ? options.get(localValue) : localValue; 6577 }, 6578 set(value) { 6579 const emittedValue = options.set ? options.set(value) : value; 6580 if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) { 6581 return; 6582 } 6583 const rawProps = i.vnode.props; 6584 const hasVModel = !!(rawProps && // check if parent has passed v-model 6585 (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)); 6586 if (!hasVModel) { 6587 localValue = value; 6588 trigger2(); 6589 } 6590 i.emit(`update:${name}`, emittedValue); 6591 if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between 6592 // event listeners. If a v-model listener emits an intermediate value 6593 // and a following listener restores the model to its previous prop 6594 // value before parent updates are flushed, the parent render can be 6595 // deduped as having no prop change. Force a local update so DOM state 6596 // such as an input's value is synchronized back to the current model. 6597 hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) { 6598 trigger2(); 6599 } 6600 prevSetValue = value; 6601 prevEmittedValue = emittedValue; 6602 } 6603 }; 6604 }); 6605 res[Symbol.iterator] = () => { 6606 let i2 = 0; 6607 return { 6608 next() { 6609 if (i2 < 2) { 6610 return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false }; 6611 } else { 6612 return { done: true }; 6613 } 6614 } 6615 }; 6616 }; 6617 return res; 6618 } 6619 var getModelModifiers = (props, modelName) => { 6620 return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; 6621 }; 6622 function emit(instance, event, ...rawArgs) { 6623 if (instance.isUnmounted) return; 6624 const props = instance.vnode.props || EMPTY_OBJ; 6625 if (true) { 6626 const { 6627 emitsOptions, 6628 propsOptions: [propsOptions] 6629 } = instance; 6630 if (emitsOptions) { 6631 if (!(event in emitsOptions) && true) { 6632 if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) { 6633 warn$1( 6634 `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.` 6635 ); 6636 } 6637 } else { 6638 const validator = emitsOptions[event]; 6639 if (isFunction(validator)) { 6640 const isValid = validator(...rawArgs); 6641 if (!isValid) { 6642 warn$1( 6643 `Invalid event arguments: event validation failed for event "${event}".` 6644 ); 6645 } 6646 } 6647 } 6648 } 6649 } 6650 let args = rawArgs; 6651 const isModelListener2 = event.startsWith("update:"); 6652 const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7)); 6653 if (modifiers) { 6654 if (modifiers.trim) { 6655 args = rawArgs.map((a) => isString(a) ? a.trim() : a); 6656 } 6657 if (modifiers.number) { 6658 args = rawArgs.map(looseToNumber); 6659 } 6660 } 6661 if (true) { 6662 devtoolsComponentEmit(instance, event, args); 6663 } 6664 if (true) { 6665 const lowerCaseEvent = event.toLowerCase(); 6666 if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { 6667 warn$1( 6668 `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( 6669 instance, 6670 instance.type 6671 )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate( 6672 event 6673 )}" instead of "${event}".` 6674 ); 6675 } 6676 } 6677 let handlerName; 6678 let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) 6679 props[handlerName = toHandlerKey(camelize(event))]; 6680 if (!handler && isModelListener2) { 6681 handler = props[handlerName = toHandlerKey(hyphenate(event))]; 6682 } 6683 if (handler) { 6684 callWithAsyncErrorHandling( 6685 handler, 6686 instance, 6687 6, 6688 args 6689 ); 6690 } 6691 const onceHandler = props[handlerName + `Once`]; 6692 if (onceHandler) { 6693 if (!instance.emitted) { 6694 instance.emitted = {}; 6695 } else if (instance.emitted[handlerName]) { 6696 return; 6697 } 6698 instance.emitted[handlerName] = true; 6699 callWithAsyncErrorHandling( 6700 onceHandler, 6701 instance, 6702 6, 6703 args 6704 ); 6705 } 6706 } 6707 var mixinEmitsCache = /* @__PURE__ */ new WeakMap(); 6708 function normalizeEmitsOptions(comp, appContext, asMixin = false) { 6709 const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache; 6710 const cached = cache.get(comp); 6711 if (cached !== void 0) { 6712 return cached; 6713 } 6714 const raw = comp.emits; 6715 let normalized = {}; 6716 let hasExtends = false; 6717 if (__VUE_OPTIONS_API__ && !isFunction(comp)) { 6718 const extendEmits = (raw2) => { 6719 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); 6720 if (normalizedFromExtend) { 6721 hasExtends = true; 6722 extend(normalized, normalizedFromExtend); 6723 } 6724 }; 6725 if (!asMixin && appContext.mixins.length) { 6726 appContext.mixins.forEach(extendEmits); 6727 } 6728 if (comp.extends) { 6729 extendEmits(comp.extends); 6730 } 6731 if (comp.mixins) { 6732 comp.mixins.forEach(extendEmits); 6733 } 6734 } 6735 if (!raw && !hasExtends) { 6736 if (isObject(comp)) { 6737 cache.set(comp, null); 6738 } 6739 return null; 6740 } 6741 if (isArray(raw)) { 6742 raw.forEach((key) => normalized[key] = null); 6743 } else { 6744 extend(normalized, raw); 6745 } 6746 if (isObject(comp)) { 6747 cache.set(comp, normalized); 6748 } 6749 return normalized; 6750 } 6751 function isEmitListener(options, key) { 6752 if (!options || !isOn(key)) { 6753 return false; 6754 } 6755 key = key.slice(2); 6756 key = key === "Once" ? key : key.replace(/Once$/, ""); 6757 return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); 6758 } 6759 var accessedAttrs = false; 6760 function markAttrsAccessed() { 6761 accessedAttrs = true; 6762 } 6763 function renderComponentRoot(instance) { 6764 const { 6765 type: Component, 6766 vnode, 6767 proxy, 6768 withProxy, 6769 propsOptions: [propsOptions], 6770 slots, 6771 attrs, 6772 emit: emit2, 6773 render: render2, 6774 renderCache, 6775 props, 6776 data, 6777 setupState, 6778 ctx, 6779 inheritAttrs 6780 } = instance; 6781 const prev = setCurrentRenderingInstance(instance); 6782 let result; 6783 let fallthroughAttrs; 6784 if (true) { 6785 accessedAttrs = false; 6786 } 6787 try { 6788 if (vnode.shapeFlag & 4) { 6789 const proxyToUse = withProxy || proxy; 6790 const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { 6791 get(target, key, receiver) { 6792 warn$1( 6793 `Property '${String( 6794 key 6795 )}' was accessed via 'this'. Avoid using 'this' in templates.` 6796 ); 6797 return Reflect.get(target, key, receiver); 6798 } 6799 }) : proxyToUse; 6800 result = normalizeVNode( 6801 render2.call( 6802 thisProxy, 6803 proxyToUse, 6804 renderCache, 6805 true ? shallowReadonly(props) : props, 6806 setupState, 6807 data, 6808 ctx 6809 ) 6810 ); 6811 fallthroughAttrs = attrs; 6812 } else { 6813 const render22 = Component; 6814 if (attrs === props) { 6815 markAttrsAccessed(); 6816 } 6817 result = normalizeVNode( 6818 render22.length > 1 ? render22( 6819 true ? shallowReadonly(props) : props, 6820 true ? { 6821 get attrs() { 6822 markAttrsAccessed(); 6823 return shallowReadonly(attrs); 6824 }, 6825 slots, 6826 emit: emit2 6827 } : { attrs, slots, emit: emit2 } 6828 ) : render22( 6829 true ? shallowReadonly(props) : props, 6830 null 6831 ) 6832 ); 6833 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); 6834 } 6835 } catch (err) { 6836 blockStack.length = 0; 6837 handleError(err, instance, 1); 6838 result = createVNode(Comment); 6839 } 6840 let root = result; 6841 let setRoot = void 0; 6842 if (result.patchFlag > 0 && result.patchFlag & 2048) { 6843 [root, setRoot] = getChildRoot(result); 6844 } 6845 if (fallthroughAttrs && inheritAttrs !== false) { 6846 const keys = Object.keys(fallthroughAttrs); 6847 const { shapeFlag } = root; 6848 if (keys.length) { 6849 if (shapeFlag & (1 | 6)) { 6850 if (propsOptions && keys.some(isModelListener)) { 6851 fallthroughAttrs = filterModelListeners( 6852 fallthroughAttrs, 6853 propsOptions 6854 ); 6855 } 6856 root = cloneVNode(root, fallthroughAttrs, false, true); 6857 } else if (!accessedAttrs && root.type !== Comment) { 6858 const allAttrs = Object.keys(attrs); 6859 const eventAttrs = []; 6860 const extraAttrs = []; 6861 for (let i = 0, l = allAttrs.length; i < l; i++) { 6862 const key = allAttrs[i]; 6863 if (isOn(key)) { 6864 if (!isModelListener(key)) { 6865 eventAttrs.push(key[2].toLowerCase() + key.slice(3)); 6866 } 6867 } else { 6868 extraAttrs.push(key); 6869 } 6870 } 6871 if (extraAttrs.length) { 6872 warn$1( 6873 `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` 6874 ); 6875 } 6876 if (eventAttrs.length) { 6877 warn$1( 6878 `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` 6879 ); 6880 } 6881 } 6882 } 6883 } 6884 if (vnode.dirs) { 6885 if (!isElementRoot(root)) { 6886 warn$1( 6887 `Runtime directive used on component with non-element root node. The directives will not function as intended.` 6888 ); 6889 } 6890 root = cloneVNode(root, null, false, true); 6891 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; 6892 } 6893 if (vnode.transition) { 6894 if (!isElementRoot(root)) { 6895 warn$1( 6896 `Component inside <Transition> renders non-element root node that cannot be animated.` 6897 ); 6898 } 6899 setTransitionHooks(root, vnode.transition); 6900 } 6901 if (setRoot) { 6902 setRoot(root); 6903 } else { 6904 result = root; 6905 } 6906 setCurrentRenderingInstance(prev); 6907 return result; 6908 } 6909 var getChildRoot = (vnode) => { 6910 const rawChildren = vnode.children; 6911 const dynamicChildren = vnode.dynamicChildren; 6912 const childRoot = filterSingleRoot(rawChildren, false); 6913 if (!childRoot) { 6914 return [vnode, void 0]; 6915 } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { 6916 return getChildRoot(childRoot); 6917 } 6918 const index = rawChildren.indexOf(childRoot); 6919 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; 6920 const setRoot = (updatedRoot) => { 6921 rawChildren[index] = updatedRoot; 6922 if (dynamicChildren) { 6923 if (dynamicIndex > -1) { 6924 dynamicChildren[dynamicIndex] = updatedRoot; 6925 } else if (updatedRoot.patchFlag > 0) { 6926 vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; 6927 } 6928 } 6929 }; 6930 return [normalizeVNode(childRoot), setRoot]; 6931 }; 6932 function filterSingleRoot(children, recurse = true) { 6933 let singleRoot; 6934 for (let i = 0; i < children.length; i++) { 6935 const child = children[i]; 6936 if (isVNode(child)) { 6937 if (child.type !== Comment || child.children === "v-if") { 6938 if (singleRoot) { 6939 return; 6940 } else { 6941 singleRoot = child; 6942 if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { 6943 return filterSingleRoot(singleRoot.children); 6944 } 6945 } 6946 } 6947 } else { 6948 return; 6949 } 6950 } 6951 return singleRoot; 6952 } 6953 var getFunctionalFallthrough = (attrs) => { 6954 let res; 6955 for (const key in attrs) { 6956 if (key === "class" || key === "style" || isOn(key)) { 6957 (res || (res = {}))[key] = attrs[key]; 6958 } 6959 } 6960 return res; 6961 }; 6962 var filterModelListeners = (attrs, props) => { 6963 const res = {}; 6964 for (const key in attrs) { 6965 if (!isModelListener(key) || !(key.slice(9) in props)) { 6966 res[key] = attrs[key]; 6967 } 6968 } 6969 return res; 6970 }; 6971 var isElementRoot = (vnode) => { 6972 return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; 6973 }; 6974 function shouldUpdateComponent(prevVNode, nextVNode, optimized) { 6975 const { props: prevProps, children: prevChildren, component } = prevVNode; 6976 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; 6977 const emits = component.emitsOptions; 6978 if ((prevChildren || nextChildren) && isHmrUpdating) { 6979 return true; 6980 } 6981 if (nextVNode.dirs || nextVNode.transition) { 6982 return true; 6983 } 6984 if (optimized && patchFlag >= 0) { 6985 if (patchFlag & 1024) { 6986 return true; 6987 } 6988 if (patchFlag & 16) { 6989 if (!prevProps) { 6990 return !!nextProps; 6991 } 6992 return hasPropsChanged(prevProps, nextProps, emits); 6993 } else if (patchFlag & 8) { 6994 const dynamicProps = nextVNode.dynamicProps; 6995 for (let i = 0; i < dynamicProps.length; i++) { 6996 const key = dynamicProps[i]; 6997 if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) { 6998 return true; 6999 } 7000 } 7001 } 7002 } else { 7003 if (prevChildren || nextChildren) { 7004 if (!nextChildren || !nextChildren.$stable) { 7005 return true; 7006 } 7007 } 7008 if (prevProps === nextProps) { 7009 return false; 7010 } 7011 if (!prevProps) { 7012 return !!nextProps; 7013 } 7014 if (!nextProps) { 7015 return true; 7016 } 7017 return hasPropsChanged(prevProps, nextProps, emits); 7018 } 7019 return false; 7020 } 7021 function hasPropsChanged(prevProps, nextProps, emitsOptions) { 7022 const nextKeys = Object.keys(nextProps); 7023 if (nextKeys.length !== Object.keys(prevProps).length) { 7024 return true; 7025 } 7026 for (let i = 0; i < nextKeys.length; i++) { 7027 const key = nextKeys[i]; 7028 if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) { 7029 return true; 7030 } 7031 } 7032 return false; 7033 } 7034 function hasPropValueChanged(nextProps, prevProps, key) { 7035 const nextProp = nextProps[key]; 7036 const prevProp = prevProps[key]; 7037 if (key === "style" && isObject(nextProp) && isObject(prevProp)) { 7038 return !looseEqual(nextProp, prevProp); 7039 } 7040 return nextProp !== prevProp; 7041 } 7042 function updateHOCHostEl({ vnode, parent, suspense }, el) { 7043 while (parent) { 7044 const root = parent.subTree; 7045 if (root.suspense && root.suspense.activeBranch === vnode) { 7046 root.suspense.vnode.el = root.el = el; 7047 vnode = root; 7048 } 7049 if (root === vnode) { 7050 (vnode = parent.vnode).el = el; 7051 parent = parent.parent; 7052 } else { 7053 break; 7054 } 7055 } 7056 if (suspense && suspense.activeBranch === vnode) { 7057 suspense.vnode.el = el; 7058 } 7059 } 7060 var internalObjectProto = {}; 7061 var createInternalObject = () => Object.create(internalObjectProto); 7062 var isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; 7063 function initProps(instance, rawProps, isStateful, isSSR = false) { 7064 const props = {}; 7065 const attrs = createInternalObject(); 7066 instance.propsDefaults = /* @__PURE__ */ Object.create(null); 7067 setFullProps(instance, rawProps, props, attrs); 7068 for (const key in instance.propsOptions[0]) { 7069 if (!(key in props)) { 7070 props[key] = void 0; 7071 } 7072 } 7073 if (true) { 7074 validateProps(rawProps || {}, props, instance); 7075 } 7076 if (isStateful) { 7077 instance.props = isSSR ? props : shallowReactive(props); 7078 } else { 7079 if (!instance.type.props) { 7080 instance.props = attrs; 7081 } else { 7082 instance.props = props; 7083 } 7084 } 7085 instance.attrs = attrs; 7086 } 7087 function isInHmrContext(instance) { 7088 while (instance) { 7089 if (instance.type.__hmrId) return true; 7090 instance = instance.parent; 7091 } 7092 } 7093 function updateProps(instance, rawProps, rawPrevProps, optimized) { 7094 const { 7095 props, 7096 attrs, 7097 vnode: { patchFlag } 7098 } = instance; 7099 const rawCurrentProps = toRaw(props); 7100 const [options] = instance.propsOptions; 7101 let hasAttrsChanged = false; 7102 if ( 7103 // always force full diff in dev 7104 // - #1942 if hmr is enabled with sfc component 7105 // - vite#872 non-sfc component used by sfc component 7106 !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) 7107 ) { 7108 if (patchFlag & 8) { 7109 const propsToUpdate = instance.vnode.dynamicProps; 7110 for (let i = 0; i < propsToUpdate.length; i++) { 7111 let key = propsToUpdate[i]; 7112 if (isEmitListener(instance.emitsOptions, key)) { 7113 continue; 7114 } 7115 const value = rawProps[key]; 7116 if (options) { 7117 if (hasOwn(attrs, key)) { 7118 if (value !== attrs[key]) { 7119 attrs[key] = value; 7120 hasAttrsChanged = true; 7121 } 7122 } else { 7123 const camelizedKey = camelize(key); 7124 props[camelizedKey] = resolvePropValue( 7125 options, 7126 rawCurrentProps, 7127 camelizedKey, 7128 value, 7129 instance, 7130 false 7131 ); 7132 } 7133 } else { 7134 if (value !== attrs[key]) { 7135 attrs[key] = value; 7136 hasAttrsChanged = true; 7137 } 7138 } 7139 } 7140 } 7141 } else { 7142 if (setFullProps(instance, rawProps, props, attrs)) { 7143 hasAttrsChanged = true; 7144 } 7145 let kebabKey; 7146 for (const key in rawCurrentProps) { 7147 if (!rawProps || // for camelCase 7148 !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case 7149 // and converted to camelCase (#955) 7150 ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { 7151 if (options) { 7152 if (rawPrevProps && // for camelCase 7153 (rawPrevProps[key] !== void 0 || // for kebab-case 7154 rawPrevProps[kebabKey] !== void 0)) { 7155 props[key] = resolvePropValue( 7156 options, 7157 rawCurrentProps, 7158 key, 7159 void 0, 7160 instance, 7161 true 7162 ); 7163 } 7164 } else { 7165 delete props[key]; 7166 } 7167 } 7168 } 7169 if (attrs !== rawCurrentProps) { 7170 for (const key in attrs) { 7171 if (!rawProps || !hasOwn(rawProps, key) && true) { 7172 delete attrs[key]; 7173 hasAttrsChanged = true; 7174 } 7175 } 7176 } 7177 } 7178 if (hasAttrsChanged) { 7179 trigger(instance.attrs, "set", ""); 7180 } 7181 if (true) { 7182 validateProps(rawProps || {}, props, instance); 7183 } 7184 } 7185 function setFullProps(instance, rawProps, props, attrs) { 7186 const [options, needCastKeys] = instance.propsOptions; 7187 let hasAttrsChanged = false; 7188 let rawCastValues; 7189 if (rawProps) { 7190 for (let key in rawProps) { 7191 if (isReservedProp(key)) { 7192 continue; 7193 } 7194 const value = rawProps[key]; 7195 let camelKey; 7196 if (options && hasOwn(options, camelKey = camelize(key))) { 7197 if (!needCastKeys || !needCastKeys.includes(camelKey)) { 7198 props[camelKey] = value; 7199 } else { 7200 (rawCastValues || (rawCastValues = {}))[camelKey] = value; 7201 } 7202 } else if (!isEmitListener(instance.emitsOptions, key)) { 7203 if (!(key in attrs) || value !== attrs[key]) { 7204 attrs[key] = value; 7205 hasAttrsChanged = true; 7206 } 7207 } 7208 } 7209 } 7210 if (needCastKeys) { 7211 const rawCurrentProps = toRaw(props); 7212 const castValues = rawCastValues || EMPTY_OBJ; 7213 for (let i = 0; i < needCastKeys.length; i++) { 7214 const key = needCastKeys[i]; 7215 props[key] = resolvePropValue( 7216 options, 7217 rawCurrentProps, 7218 key, 7219 castValues[key], 7220 instance, 7221 !hasOwn(castValues, key) 7222 ); 7223 } 7224 } 7225 return hasAttrsChanged; 7226 } 7227 function resolvePropValue(options, props, key, value, instance, isAbsent) { 7228 const opt = options[key]; 7229 if (opt != null) { 7230 const hasDefault = hasOwn(opt, "default"); 7231 if (hasDefault && value === void 0) { 7232 const defaultValue = opt.default; 7233 if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { 7234 const { propsDefaults } = instance; 7235 if (key in propsDefaults) { 7236 value = propsDefaults[key]; 7237 } else { 7238 const reset = setCurrentInstance(instance); 7239 value = propsDefaults[key] = defaultValue.call( 7240 null, 7241 props 7242 ); 7243 reset(); 7244 } 7245 } else { 7246 value = defaultValue; 7247 } 7248 if (instance.ce) { 7249 instance.ce._setProp(key, value); 7250 } 7251 } 7252 if (opt[ 7253 0 7254 /* shouldCast */ 7255 ]) { 7256 if (isAbsent && !hasDefault) { 7257 value = false; 7258 } else if (opt[ 7259 1 7260 /* shouldCastTrue */ 7261 ] && (value === "" || value === hyphenate(key))) { 7262 value = true; 7263 } 7264 } 7265 } 7266 return value; 7267 } 7268 var mixinPropsCache = /* @__PURE__ */ new WeakMap(); 7269 function normalizePropsOptions(comp, appContext, asMixin = false) { 7270 const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache; 7271 const cached = cache.get(comp); 7272 if (cached) { 7273 return cached; 7274 } 7275 const raw = comp.props; 7276 const normalized = {}; 7277 const needCastKeys = []; 7278 let hasExtends = false; 7279 if (__VUE_OPTIONS_API__ && !isFunction(comp)) { 7280 const extendProps = (raw2) => { 7281 hasExtends = true; 7282 const [props, keys] = normalizePropsOptions(raw2, appContext, true); 7283 extend(normalized, props); 7284 if (keys) needCastKeys.push(...keys); 7285 }; 7286 if (!asMixin && appContext.mixins.length) { 7287 appContext.mixins.forEach(extendProps); 7288 } 7289 if (comp.extends) { 7290 extendProps(comp.extends); 7291 } 7292 if (comp.mixins) { 7293 comp.mixins.forEach(extendProps); 7294 } 7295 } 7296 if (!raw && !hasExtends) { 7297 if (isObject(comp)) { 7298 cache.set(comp, EMPTY_ARR); 7299 } 7300 return EMPTY_ARR; 7301 } 7302 if (isArray(raw)) { 7303 for (let i = 0; i < raw.length; i++) { 7304 if (!isString(raw[i])) { 7305 warn$1(`props must be strings when using array syntax.`, raw[i]); 7306 } 7307 const normalizedKey = camelize(raw[i]); 7308 if (validatePropName(normalizedKey)) { 7309 normalized[normalizedKey] = EMPTY_OBJ; 7310 } 7311 } 7312 } else if (raw) { 7313 if (!isObject(raw)) { 7314 warn$1(`invalid props options`, raw); 7315 } 7316 for (const key in raw) { 7317 const normalizedKey = camelize(key); 7318 if (validatePropName(normalizedKey)) { 7319 const opt = raw[key]; 7320 const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); 7321 const propType = prop.type; 7322 let shouldCast = false; 7323 let shouldCastTrue = true; 7324 if (isArray(propType)) { 7325 for (let index = 0; index < propType.length; ++index) { 7326 const type = propType[index]; 7327 const typeName = isFunction(type) && type.name; 7328 if (typeName === "Boolean") { 7329 shouldCast = true; 7330 break; 7331 } else if (typeName === "String") { 7332 shouldCastTrue = false; 7333 } 7334 } 7335 } else { 7336 shouldCast = isFunction(propType) && propType.name === "Boolean"; 7337 } 7338 prop[ 7339 0 7340 /* shouldCast */ 7341 ] = shouldCast; 7342 prop[ 7343 1 7344 /* shouldCastTrue */ 7345 ] = shouldCastTrue; 7346 if (shouldCast || hasOwn(prop, "default")) { 7347 needCastKeys.push(normalizedKey); 7348 } 7349 } 7350 } 7351 } 7352 const res = [normalized, needCastKeys]; 7353 if (isObject(comp)) { 7354 cache.set(comp, res); 7355 } 7356 return res; 7357 } 7358 function validatePropName(key) { 7359 if (key[0] !== "$" && !isReservedProp(key)) { 7360 return true; 7361 } else if (true) { 7362 warn$1(`Invalid prop name: "${key}" is a reserved property.`); 7363 } 7364 return false; 7365 } 7366 function getType(ctor) { 7367 if (ctor === null) { 7368 return "null"; 7369 } 7370 if (typeof ctor === "function") { 7371 return ctor.name || ""; 7372 } else if (typeof ctor === "object") { 7373 const name = ctor.constructor && ctor.constructor.name; 7374 return name || ""; 7375 } 7376 return ""; 7377 } 7378 function validateProps(rawProps, props, instance) { 7379 const resolvedValues = toRaw(props); 7380 const options = instance.propsOptions[0]; 7381 const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key)); 7382 for (const key in options) { 7383 let opt = options[key]; 7384 if (opt == null) continue; 7385 validateProp( 7386 key, 7387 resolvedValues[key], 7388 opt, 7389 true ? shallowReadonly(resolvedValues) : resolvedValues, 7390 !camelizePropsKey.includes(key) 7391 ); 7392 } 7393 } 7394 function validateProp(name, value, prop, props, isAbsent) { 7395 const { type, required, validator, skipCheck } = prop; 7396 if (required && isAbsent) { 7397 warn$1('Missing required prop: "' + name + '"'); 7398 return; 7399 } 7400 if (value == null && !required) { 7401 return; 7402 } 7403 if (type != null && type !== true && !skipCheck) { 7404 let isValid = false; 7405 const types = isArray(type) ? type : [type]; 7406 const expectedTypes = []; 7407 for (let i = 0; i < types.length && !isValid; i++) { 7408 const { valid, expectedType } = assertType(value, types[i]); 7409 expectedTypes.push(expectedType || ""); 7410 isValid = valid; 7411 } 7412 if (!isValid) { 7413 warn$1(getInvalidTypeMessage(name, value, expectedTypes)); 7414 return; 7415 } 7416 } 7417 if (validator && !validator(value, props)) { 7418 warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); 7419 } 7420 } 7421 var isSimpleType = makeMap( 7422 "String,Number,Boolean,Function,Symbol,BigInt" 7423 ); 7424 function assertType(value, type) { 7425 let valid; 7426 const expectedType = getType(type); 7427 if (expectedType === "null") { 7428 valid = value === null; 7429 } else if (isSimpleType(expectedType)) { 7430 const t = typeof value; 7431 valid = t === expectedType.toLowerCase(); 7432 if (!valid && t === "object") { 7433 valid = value instanceof type; 7434 } 7435 } else if (expectedType === "Object") { 7436 valid = isObject(value); 7437 } else if (expectedType === "Array") { 7438 valid = isArray(value); 7439 } else { 7440 valid = value instanceof type; 7441 } 7442 return { 7443 valid, 7444 expectedType 7445 }; 7446 } 7447 function getInvalidTypeMessage(name, value, expectedTypes) { 7448 if (expectedTypes.length === 0) { 7449 return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; 7450 } 7451 let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`; 7452 const expectedType = expectedTypes[0]; 7453 const receivedType = toRawType(value); 7454 const expectedValue = styleValue(value, expectedType); 7455 const receivedValue = styleValue(value, receivedType); 7456 if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) { 7457 message += ` with value ${expectedValue}`; 7458 } 7459 message += `, got ${receivedType} `; 7460 if (isExplicable(receivedType)) { 7461 message += `with value ${receivedValue}.`; 7462 } 7463 return message; 7464 } 7465 function styleValue(value, type) { 7466 if (isSymbol(value)) { 7467 return value.toString(); 7468 } else if (type === "String") { 7469 return `"${value}"`; 7470 } else if (type === "Number") { 7471 return `${Number(value)}`; 7472 } else { 7473 return `${value}`; 7474 } 7475 } 7476 function isExplicable(type) { 7477 const explicitTypes = ["string", "number", "boolean"]; 7478 return explicitTypes.some((elem) => type.toLowerCase() === elem); 7479 } 7480 function isCoercible(...args) { 7481 return args.every((elem) => { 7482 const value = elem.toLowerCase(); 7483 return value !== "boolean" && value !== "symbol"; 7484 }); 7485 } 7486 var isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable"; 7487 var normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; 7488 var normalizeSlot = (key, rawSlot, ctx) => { 7489 if (rawSlot._n) { 7490 return rawSlot; 7491 } 7492 const normalized = withCtx((...args) => { 7493 if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) { 7494 warn$1( 7495 `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` 7496 ); 7497 } 7498 return normalizeSlotValue(rawSlot(...args)); 7499 }, ctx); 7500 normalized._c = false; 7501 return normalized; 7502 }; 7503 var normalizeObjectSlots = (rawSlots, slots, instance) => { 7504 const ctx = rawSlots._ctx; 7505 for (const key in rawSlots) { 7506 if (isInternalKey(key)) continue; 7507 const value = rawSlots[key]; 7508 if (isFunction(value)) { 7509 slots[key] = normalizeSlot(key, value, ctx); 7510 } else if (value != null) { 7511 if (true) { 7512 warn$1( 7513 `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` 7514 ); 7515 } 7516 const normalized = normalizeSlotValue(value); 7517 slots[key] = () => normalized; 7518 } 7519 } 7520 }; 7521 var normalizeVNodeSlots = (instance, children) => { 7522 if (!isKeepAlive(instance.vnode) && true) { 7523 warn$1( 7524 `Non-function value encountered for default slot. Prefer function slots for better performance.` 7525 ); 7526 } 7527 const normalized = normalizeSlotValue(children); 7528 instance.slots.default = () => normalized; 7529 }; 7530 var assignSlots = (slots, children, optimized) => { 7531 for (const key in children) { 7532 if (optimized || !isInternalKey(key)) { 7533 slots[key] = children[key]; 7534 } 7535 } 7536 }; 7537 var initSlots = (instance, children, optimized) => { 7538 const slots = instance.slots = createInternalObject(); 7539 if (instance.vnode.shapeFlag & 32) { 7540 const type = children._; 7541 if (type) { 7542 assignSlots(slots, children, optimized); 7543 if (optimized) { 7544 def(slots, "_", type, true); 7545 } 7546 } else { 7547 normalizeObjectSlots(children, slots); 7548 } 7549 } else if (children) { 7550 normalizeVNodeSlots(instance, children); 7551 } 7552 }; 7553 var updateSlots = (instance, children, optimized) => { 7554 const { vnode, slots } = instance; 7555 let needDeletionCheck = true; 7556 let deletionComparisonTarget = EMPTY_OBJ; 7557 if (vnode.shapeFlag & 32) { 7558 const type = children._; 7559 if (type) { 7560 if (isHmrUpdating) { 7561 assignSlots(slots, children, optimized); 7562 trigger(instance, "set", "$slots"); 7563 } else if (optimized && type === 1) { 7564 needDeletionCheck = false; 7565 } else { 7566 assignSlots(slots, children, optimized); 7567 } 7568 } else { 7569 needDeletionCheck = !children.$stable; 7570 normalizeObjectSlots(children, slots); 7571 } 7572 deletionComparisonTarget = children; 7573 } else if (children) { 7574 normalizeVNodeSlots(instance, children); 7575 deletionComparisonTarget = { default: 1 }; 7576 } 7577 if (needDeletionCheck) { 7578 for (const key in slots) { 7579 if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { 7580 delete slots[key]; 7581 } 7582 } 7583 } 7584 }; 7585 var supported; 7586 var perf; 7587 function startMeasure(instance, type) { 7588 if (instance.appContext.config.performance && isSupported()) { 7589 perf.mark(`vue-${type}-${instance.uid}`); 7590 } 7591 if (true) { 7592 devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); 7593 } 7594 } 7595 function endMeasure(instance, type) { 7596 if (instance.appContext.config.performance && isSupported()) { 7597 const startTag = `vue-${type}-${instance.uid}`; 7598 const endTag = startTag + `:end`; 7599 const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`; 7600 perf.mark(endTag); 7601 perf.measure(measureName, startTag, endTag); 7602 perf.clearMeasures(measureName); 7603 perf.clearMarks(startTag); 7604 perf.clearMarks(endTag); 7605 } 7606 if (true) { 7607 devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); 7608 } 7609 } 7610 function isSupported() { 7611 if (supported !== void 0) { 7612 return supported; 7613 } 7614 if (typeof window !== "undefined" && window.performance) { 7615 supported = true; 7616 perf = window.performance; 7617 } else { 7618 supported = false; 7619 } 7620 return supported; 7621 } 7622 function initFeatureFlags() { 7623 const needWarn = []; 7624 if (typeof __VUE_OPTIONS_API__ !== "boolean") { 7625 needWarn.push(`__VUE_OPTIONS_API__`); 7626 getGlobalThis().__VUE_OPTIONS_API__ = true; 7627 } 7628 if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") { 7629 needWarn.push(`__VUE_PROD_DEVTOOLS__`); 7630 getGlobalThis().__VUE_PROD_DEVTOOLS__ = false; 7631 } 7632 if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") { 7633 needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`); 7634 getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false; 7635 } 7636 if (needWarn.length) { 7637 const multi = needWarn.length > 1; 7638 console.warn( 7639 `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle. 7640 7641 For more details, see https://link.vuejs.org/feature-flags.` 7642 ); 7643 } 7644 } 7645 var queuePostRenderEffect = queueEffectWithSuspense; 7646 function createRenderer(options) { 7647 return baseCreateRenderer(options); 7648 } 7649 function createHydrationRenderer(options) { 7650 return baseCreateRenderer(options, createHydrationFunctions); 7651 } 7652 function baseCreateRenderer(options, createHydrationFns) { 7653 { 7654 initFeatureFlags(); 7655 } 7656 const target = getGlobalThis(); 7657 target.__VUE__ = true; 7658 if (true) { 7659 setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); 7660 } 7661 const { 7662 insert: hostInsert, 7663 remove: hostRemove, 7664 patchProp: hostPatchProp, 7665 createElement: hostCreateElement, 7666 createText: hostCreateText, 7667 createComment: hostCreateComment, 7668 setText: hostSetText, 7669 setElementText: hostSetElementText, 7670 parentNode: hostParentNode, 7671 nextSibling: hostNextSibling, 7672 setScopeId: hostSetScopeId = NOOP, 7673 insertStaticContent: hostInsertStaticContent 7674 } = options; 7675 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { 7676 if (n1 === n2) { 7677 return; 7678 } 7679 if (n1 && !isSameVNodeType(n1, n2)) { 7680 anchor = getNextHostNode(n1); 7681 unmount(n1, parentComponent, parentSuspense, true); 7682 n1 = null; 7683 } 7684 if (n2.patchFlag === -2) { 7685 optimized = false; 7686 n2.dynamicChildren = null; 7687 } 7688 const { type, ref: ref2, shapeFlag } = n2; 7689 switch (type) { 7690 case Text: 7691 processText(n1, n2, container, anchor); 7692 break; 7693 case Comment: 7694 processCommentNode(n1, n2, container, anchor); 7695 break; 7696 case Static: 7697 if (n1 == null) { 7698 mountStaticNode(n2, container, anchor, namespace); 7699 } else if (true) { 7700 patchStaticNode(n1, n2, container, namespace); 7701 } 7702 break; 7703 case Fragment: 7704 processFragment( 7705 n1, 7706 n2, 7707 container, 7708 anchor, 7709 parentComponent, 7710 parentSuspense, 7711 namespace, 7712 slotScopeIds, 7713 optimized 7714 ); 7715 break; 7716 default: 7717 if (shapeFlag & 1) { 7718 processElement( 7719 n1, 7720 n2, 7721 container, 7722 anchor, 7723 parentComponent, 7724 parentSuspense, 7725 namespace, 7726 slotScopeIds, 7727 optimized 7728 ); 7729 } else if (shapeFlag & 6) { 7730 processComponent( 7731 n1, 7732 n2, 7733 container, 7734 anchor, 7735 parentComponent, 7736 parentSuspense, 7737 namespace, 7738 slotScopeIds, 7739 optimized 7740 ); 7741 } else if (shapeFlag & 64) { 7742 type.process( 7743 n1, 7744 n2, 7745 container, 7746 anchor, 7747 parentComponent, 7748 parentSuspense, 7749 namespace, 7750 slotScopeIds, 7751 optimized, 7752 internals 7753 ); 7754 } else if (shapeFlag & 128) { 7755 type.process( 7756 n1, 7757 n2, 7758 container, 7759 anchor, 7760 parentComponent, 7761 parentSuspense, 7762 namespace, 7763 slotScopeIds, 7764 optimized, 7765 internals 7766 ); 7767 } else if (true) { 7768 warn$1("Invalid VNode type:", type, `(${typeof type})`); 7769 } 7770 } 7771 if (ref2 != null && parentComponent) { 7772 setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2); 7773 } else if (ref2 == null && n1 && n1.ref != null) { 7774 setRef(n1.ref, null, parentSuspense, n1, true); 7775 } 7776 }; 7777 const processText = (n1, n2, container, anchor) => { 7778 if (n1 == null) { 7779 hostInsert( 7780 n2.el = hostCreateText(n2.children), 7781 container, 7782 anchor 7783 ); 7784 } else { 7785 const el = n2.el = n1.el; 7786 if (n2.children !== n1.children) { 7787 hostSetText(el, n2.children); 7788 } 7789 } 7790 }; 7791 const processCommentNode = (n1, n2, container, anchor) => { 7792 if (n1 == null) { 7793 hostInsert( 7794 n2.el = hostCreateComment(n2.children || ""), 7795 container, 7796 anchor 7797 ); 7798 } else { 7799 n2.el = n1.el; 7800 } 7801 }; 7802 const mountStaticNode = (n2, container, anchor, namespace) => { 7803 [n2.el, n2.anchor] = hostInsertStaticContent( 7804 n2.children, 7805 container, 7806 anchor, 7807 namespace, 7808 n2.el, 7809 n2.anchor 7810 ); 7811 }; 7812 const patchStaticNode = (n1, n2, container, namespace) => { 7813 if (n2.children !== n1.children) { 7814 const anchor = hostNextSibling(n1.anchor); 7815 removeStaticNode(n1); 7816 [n2.el, n2.anchor] = hostInsertStaticContent( 7817 n2.children, 7818 container, 7819 anchor, 7820 namespace 7821 ); 7822 } else { 7823 n2.el = n1.el; 7824 n2.anchor = n1.anchor; 7825 } 7826 }; 7827 const moveStaticNode = ({ el, anchor }, container, nextSibling) => { 7828 let next; 7829 while (el && el !== anchor) { 7830 next = hostNextSibling(el); 7831 hostInsert(el, container, nextSibling); 7832 el = next; 7833 } 7834 hostInsert(anchor, container, nextSibling); 7835 }; 7836 const removeStaticNode = ({ el, anchor }) => { 7837 let next; 7838 while (el && el !== anchor) { 7839 next = hostNextSibling(el); 7840 hostRemove(el); 7841 el = next; 7842 } 7843 hostRemove(anchor); 7844 }; 7845 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 7846 if (n2.type === "svg") { 7847 namespace = "svg"; 7848 } else if (n2.type === "math") { 7849 namespace = "mathml"; 7850 } 7851 if (n1 == null) { 7852 mountElement( 7853 n2, 7854 container, 7855 anchor, 7856 parentComponent, 7857 parentSuspense, 7858 namespace, 7859 slotScopeIds, 7860 optimized 7861 ); 7862 } else { 7863 const customElement = n1.el && n1.el._isVueCE ? n1.el : null; 7864 try { 7865 if (customElement) { 7866 customElement._beginPatch(); 7867 } 7868 patchElement( 7869 n1, 7870 n2, 7871 parentComponent, 7872 parentSuspense, 7873 namespace, 7874 slotScopeIds, 7875 optimized 7876 ); 7877 } finally { 7878 if (customElement) { 7879 customElement._endPatch(); 7880 } 7881 } 7882 } 7883 }; 7884 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 7885 let el; 7886 let vnodeHook; 7887 const { props, shapeFlag, transition, dirs } = vnode; 7888 el = vnode.el = hostCreateElement( 7889 vnode.type, 7890 namespace, 7891 props && props.is, 7892 props 7893 ); 7894 if (shapeFlag & 8) { 7895 hostSetElementText(el, vnode.children); 7896 } else if (shapeFlag & 16) { 7897 mountChildren( 7898 vnode.children, 7899 el, 7900 null, 7901 parentComponent, 7902 parentSuspense, 7903 resolveChildrenNamespace(vnode, namespace), 7904 slotScopeIds, 7905 optimized 7906 ); 7907 } 7908 if (dirs) { 7909 invokeDirectiveHook(vnode, null, parentComponent, "created"); 7910 } 7911 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); 7912 if (props) { 7913 for (const key in props) { 7914 if (key !== "value" && !isReservedProp(key)) { 7915 hostPatchProp(el, key, null, props[key], namespace, parentComponent); 7916 } 7917 } 7918 if ("value" in props) { 7919 hostPatchProp(el, "value", null, props.value, namespace); 7920 } 7921 if (vnodeHook = props.onVnodeBeforeMount) { 7922 invokeVNodeHook(vnodeHook, parentComponent, vnode); 7923 } 7924 } 7925 if (true) { 7926 def(el, "__vnode", vnode, true); 7927 def(el, "__vueParentComponent", parentComponent, true); 7928 } 7929 if (dirs) { 7930 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 7931 } 7932 const needCallTransitionHooks = needTransition(parentSuspense, transition); 7933 if (needCallTransitionHooks) { 7934 transition.beforeEnter(el); 7935 } 7936 hostInsert(el, container, anchor); 7937 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { 7938 const isHmr = isHmrUpdating; 7939 queuePostRenderEffect(() => { 7940 let prev; 7941 if (true) prev = setHmrUpdating(isHmr); 7942 try { 7943 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 7944 needCallTransitionHooks && transition.enter(el); 7945 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 7946 } finally { 7947 if (true) setHmrUpdating(prev); 7948 } 7949 }, parentSuspense); 7950 } 7951 }; 7952 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { 7953 if (scopeId) { 7954 hostSetScopeId(el, scopeId); 7955 } 7956 if (slotScopeIds) { 7957 for (let i = 0; i < slotScopeIds.length; i++) { 7958 hostSetScopeId(el, slotScopeIds[i]); 7959 } 7960 } 7961 if (parentComponent) { 7962 let subTree = parentComponent.subTree; 7963 if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { 7964 subTree = filterSingleRoot(subTree.children) || subTree; 7965 } 7966 if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { 7967 const parentVNode = parentComponent.vnode; 7968 setScopeId( 7969 el, 7970 parentVNode, 7971 parentVNode.scopeId, 7972 parentVNode.slotScopeIds, 7973 parentComponent.parent 7974 ); 7975 } 7976 } 7977 }; 7978 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { 7979 for (let i = start; i < children.length; i++) { 7980 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); 7981 patch( 7982 null, 7983 child, 7984 container, 7985 anchor, 7986 parentComponent, 7987 parentSuspense, 7988 namespace, 7989 slotScopeIds, 7990 optimized 7991 ); 7992 } 7993 }; 7994 const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 7995 const el = n2.el = n1.el; 7996 if (true) { 7997 el.__vnode = n2; 7998 } 7999 let { patchFlag, dynamicChildren, dirs } = n2; 8000 patchFlag |= n1.patchFlag & 16; 8001 const oldProps = n1.props || EMPTY_OBJ; 8002 const newProps = n2.props || EMPTY_OBJ; 8003 let vnodeHook; 8004 parentComponent && toggleRecurse(parentComponent, false); 8005 if (vnodeHook = newProps.onVnodeBeforeUpdate) { 8006 invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 8007 } 8008 if (dirs) { 8009 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); 8010 } 8011 parentComponent && toggleRecurse(parentComponent, true); 8012 if ( 8013 // HMR updated, force full diff 8014 isHmrUpdating || // #6385 the old vnode may be a user-wrapped non-isomorphic block 8015 // Force full diff when block metadata is unstable. 8016 dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length) 8017 ) { 8018 patchFlag = 0; 8019 optimized = false; 8020 dynamicChildren = null; 8021 } 8022 if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { 8023 hostSetElementText(el, ""); 8024 } 8025 if (dynamicChildren) { 8026 patchBlockChildren( 8027 n1.dynamicChildren, 8028 dynamicChildren, 8029 el, 8030 parentComponent, 8031 parentSuspense, 8032 resolveChildrenNamespace(n2, namespace), 8033 slotScopeIds 8034 ); 8035 if (true) { 8036 traverseStaticChildren(n1, n2); 8037 } 8038 } else if (!optimized) { 8039 patchChildren( 8040 n1, 8041 n2, 8042 el, 8043 null, 8044 parentComponent, 8045 parentSuspense, 8046 resolveChildrenNamespace(n2, namespace), 8047 slotScopeIds, 8048 false 8049 ); 8050 } 8051 if (patchFlag > 0) { 8052 if (patchFlag & 16) { 8053 patchProps(el, oldProps, newProps, parentComponent, namespace); 8054 } else { 8055 if (patchFlag & 2) { 8056 if (oldProps.class !== newProps.class) { 8057 hostPatchProp(el, "class", null, newProps.class, namespace); 8058 } 8059 } 8060 if (patchFlag & 4) { 8061 hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); 8062 } 8063 if (patchFlag & 8) { 8064 const propsToUpdate = n2.dynamicProps; 8065 for (let i = 0; i < propsToUpdate.length; i++) { 8066 const key = propsToUpdate[i]; 8067 const prev = oldProps[key]; 8068 const next = newProps[key]; 8069 if (next !== prev || key === "value") { 8070 hostPatchProp(el, key, prev, next, namespace, parentComponent); 8071 } 8072 } 8073 } 8074 } 8075 if (patchFlag & 1) { 8076 if (n1.children !== n2.children) { 8077 hostSetElementText(el, n2.children); 8078 } 8079 } 8080 } else if (!optimized && dynamicChildren == null) { 8081 patchProps(el, oldProps, newProps, parentComponent, namespace); 8082 } 8083 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { 8084 queuePostRenderEffect(() => { 8085 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 8086 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); 8087 }, parentSuspense); 8088 } 8089 }; 8090 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { 8091 for (let i = 0; i < newChildren.length; i++) { 8092 const oldVNode = oldChildren[i]; 8093 const newVNode = newChildren[i]; 8094 const container = ( 8095 // oldVNode may be an errored async setup() component inside Suspense 8096 // which will not have a mounted element 8097 oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent 8098 // of the Fragment itself so it can move its children. 8099 (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement 8100 // which also requires the correct parent container 8101 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. 8102 oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( 8103 // In other cases, the parent container is not actually used so we 8104 // just pass the block element here to avoid a DOM parentNode call. 8105 fallbackContainer 8106 ) 8107 ); 8108 patch( 8109 oldVNode, 8110 newVNode, 8111 container, 8112 null, 8113 parentComponent, 8114 parentSuspense, 8115 namespace, 8116 slotScopeIds, 8117 true 8118 ); 8119 } 8120 }; 8121 const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { 8122 if (oldProps !== newProps) { 8123 if (oldProps !== EMPTY_OBJ) { 8124 for (const key in oldProps) { 8125 if (!isReservedProp(key) && !(key in newProps)) { 8126 hostPatchProp( 8127 el, 8128 key, 8129 oldProps[key], 8130 null, 8131 namespace, 8132 parentComponent 8133 ); 8134 } 8135 } 8136 } 8137 for (const key in newProps) { 8138 if (isReservedProp(key)) continue; 8139 const next = newProps[key]; 8140 const prev = oldProps[key]; 8141 if (next !== prev && key !== "value") { 8142 hostPatchProp(el, key, prev, next, namespace, parentComponent); 8143 } 8144 } 8145 if ("value" in newProps) { 8146 hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); 8147 } 8148 } 8149 }; 8150 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 8151 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); 8152 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); 8153 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; 8154 if ( 8155 // #5523 dev root fragment may inherit directives 8156 isHmrUpdating || patchFlag & 2048 8157 ) { 8158 patchFlag = 0; 8159 optimized = false; 8160 dynamicChildren = null; 8161 } 8162 if (fragmentSlotScopeIds) { 8163 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 8164 } 8165 if (n1 == null) { 8166 hostInsert(fragmentStartAnchor, container, anchor); 8167 hostInsert(fragmentEndAnchor, container, anchor); 8168 mountChildren( 8169 // #10007 8170 // such fragment like `<></>` will be compiled into 8171 // a fragment which doesn't have a children. 8172 // In this case fallback to an empty array 8173 n2.children || [], 8174 container, 8175 fragmentEndAnchor, 8176 parentComponent, 8177 parentSuspense, 8178 namespace, 8179 slotScopeIds, 8180 optimized 8181 ); 8182 } else { 8183 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result 8184 // of renderSlot() with no valid children 8185 n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) { 8186 patchBlockChildren( 8187 n1.dynamicChildren, 8188 dynamicChildren, 8189 container, 8190 parentComponent, 8191 parentSuspense, 8192 namespace, 8193 slotScopeIds 8194 ); 8195 if (true) { 8196 traverseStaticChildren(n1, n2); 8197 } else if ( 8198 // #2080 if the stable fragment has a key, it's a <template v-for> that may 8199 // get moved around. Make sure all root level vnodes inherit el. 8200 // #2134 or if it's a component root, it may also get moved around 8201 // as the component is being moved. 8202 n2.key != null || parentComponent && n2 === parentComponent.subTree 8203 ) { 8204 traverseStaticChildren( 8205 n1, 8206 n2, 8207 true 8208 /* shallow */ 8209 ); 8210 } 8211 } else { 8212 patchChildren( 8213 n1, 8214 n2, 8215 container, 8216 fragmentEndAnchor, 8217 parentComponent, 8218 parentSuspense, 8219 namespace, 8220 slotScopeIds, 8221 optimized 8222 ); 8223 } 8224 } 8225 }; 8226 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 8227 n2.slotScopeIds = slotScopeIds; 8228 if (n1 == null) { 8229 if (n2.shapeFlag & 512) { 8230 parentComponent.ctx.activate( 8231 n2, 8232 container, 8233 anchor, 8234 namespace, 8235 optimized 8236 ); 8237 } else { 8238 mountComponent( 8239 n2, 8240 container, 8241 anchor, 8242 parentComponent, 8243 parentSuspense, 8244 namespace, 8245 optimized 8246 ); 8247 } 8248 } else { 8249 updateComponent(n1, n2, optimized); 8250 } 8251 }; 8252 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { 8253 const instance = initialVNode.component = createComponentInstance( 8254 initialVNode, 8255 parentComponent, 8256 parentSuspense 8257 ); 8258 if (instance.type.__hmrId) { 8259 registerHMR(instance); 8260 } 8261 if (true) { 8262 pushWarningContext(initialVNode); 8263 startMeasure(instance, `mount`); 8264 } 8265 if (isKeepAlive(initialVNode)) { 8266 instance.ctx.renderer = internals; 8267 } 8268 { 8269 if (true) { 8270 startMeasure(instance, `init`); 8271 } 8272 setupComponent(instance, false, optimized); 8273 if (true) { 8274 endMeasure(instance, `init`); 8275 } 8276 } 8277 if (isHmrUpdating) initialVNode.el = null; 8278 if (instance.asyncDep) { 8279 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); 8280 if (!initialVNode.el) { 8281 const placeholder = instance.subTree = createVNode(Comment); 8282 processCommentNode(null, placeholder, container, anchor); 8283 initialVNode.placeholder = placeholder.el; 8284 } 8285 } else { 8286 setupRenderEffect( 8287 instance, 8288 initialVNode, 8289 container, 8290 anchor, 8291 parentSuspense, 8292 namespace, 8293 optimized 8294 ); 8295 } 8296 if (true) { 8297 popWarningContext(); 8298 endMeasure(instance, `mount`); 8299 } 8300 }; 8301 const updateComponent = (n1, n2, optimized) => { 8302 const instance = n2.component = n1.component; 8303 if (shouldUpdateComponent(n1, n2, optimized)) { 8304 if (instance.asyncDep && !instance.asyncResolved) { 8305 if (true) { 8306 pushWarningContext(n2); 8307 } 8308 updateComponentPreRender(instance, n2, optimized); 8309 if (true) { 8310 popWarningContext(); 8311 } 8312 return; 8313 } else { 8314 instance.next = n2; 8315 instance.update(); 8316 } 8317 } else { 8318 n2.el = n1.el; 8319 instance.vnode = n2; 8320 } 8321 }; 8322 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { 8323 const componentUpdateFn = () => { 8324 if (!instance.isMounted) { 8325 let vnodeHook; 8326 const { el, props } = initialVNode; 8327 const { bm, m, parent, root, type } = instance; 8328 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); 8329 toggleRecurse(instance, false); 8330 if (bm) { 8331 invokeArrayFns(bm); 8332 } 8333 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { 8334 invokeVNodeHook(vnodeHook, parent, initialVNode); 8335 } 8336 toggleRecurse(instance, true); 8337 if (el && hydrateNode) { 8338 const hydrateSubTree = () => { 8339 if (true) { 8340 startMeasure(instance, `render`); 8341 } 8342 instance.subTree = renderComponentRoot(instance); 8343 if (true) { 8344 endMeasure(instance, `render`); 8345 } 8346 if (true) { 8347 startMeasure(instance, `hydrate`); 8348 } 8349 hydrateNode( 8350 el, 8351 instance.subTree, 8352 instance, 8353 parentSuspense, 8354 null 8355 ); 8356 if (true) { 8357 endMeasure(instance, `hydrate`); 8358 } 8359 }; 8360 if (isAsyncWrapperVNode && type.__asyncHydrate) { 8361 type.__asyncHydrate( 8362 el, 8363 instance, 8364 hydrateSubTree 8365 ); 8366 } else { 8367 hydrateSubTree(); 8368 } 8369 } else { 8370 if (root.ce && root.ce._hasShadowRoot()) { 8371 root.ce._injectChildStyle( 8372 type, 8373 instance.parent ? instance.parent.type : void 0 8374 ); 8375 } 8376 if (true) { 8377 startMeasure(instance, `render`); 8378 } 8379 const subTree = instance.subTree = renderComponentRoot(instance); 8380 if (true) { 8381 endMeasure(instance, `render`); 8382 } 8383 if (true) { 8384 startMeasure(instance, `patch`); 8385 } 8386 patch( 8387 null, 8388 subTree, 8389 container, 8390 anchor, 8391 instance, 8392 parentSuspense, 8393 namespace 8394 ); 8395 if (true) { 8396 endMeasure(instance, `patch`); 8397 } 8398 initialVNode.el = subTree.el; 8399 } 8400 if (m) { 8401 queuePostRenderEffect(m, parentSuspense); 8402 } 8403 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { 8404 const scopedInitialVNode = initialVNode; 8405 queuePostRenderEffect( 8406 () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), 8407 parentSuspense 8408 ); 8409 } 8410 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { 8411 instance.a && queuePostRenderEffect(instance.a, parentSuspense); 8412 } 8413 instance.isMounted = true; 8414 if (true) { 8415 devtoolsComponentAdded(instance); 8416 } 8417 initialVNode = container = anchor = null; 8418 } else { 8419 let { next, bu, u, parent, vnode } = instance; 8420 { 8421 const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); 8422 if (nonHydratedAsyncRoot) { 8423 if (next) { 8424 next.el = vnode.el; 8425 updateComponentPreRender(instance, next, optimized); 8426 } 8427 nonHydratedAsyncRoot.asyncDep.then(() => { 8428 queuePostRenderEffect(() => { 8429 if (!instance.isUnmounted) update(); 8430 }, parentSuspense); 8431 }); 8432 return; 8433 } 8434 } 8435 let originNext = next; 8436 let vnodeHook; 8437 if (true) { 8438 pushWarningContext(next || instance.vnode); 8439 } 8440 toggleRecurse(instance, false); 8441 if (next) { 8442 next.el = vnode.el; 8443 updateComponentPreRender(instance, next, optimized); 8444 } else { 8445 next = vnode; 8446 } 8447 if (bu) { 8448 invokeArrayFns(bu); 8449 } 8450 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { 8451 invokeVNodeHook(vnodeHook, parent, next, vnode); 8452 } 8453 toggleRecurse(instance, true); 8454 if (true) { 8455 startMeasure(instance, `render`); 8456 } 8457 const nextTree = renderComponentRoot(instance); 8458 if (true) { 8459 endMeasure(instance, `render`); 8460 } 8461 const prevTree = instance.subTree; 8462 instance.subTree = nextTree; 8463 if (true) { 8464 startMeasure(instance, `patch`); 8465 } 8466 patch( 8467 prevTree, 8468 nextTree, 8469 // parent may have changed if it's in a teleport 8470 hostParentNode(prevTree.el), 8471 // anchor may have changed if it's in a fragment 8472 getNextHostNode(prevTree), 8473 instance, 8474 parentSuspense, 8475 namespace 8476 ); 8477 if (true) { 8478 endMeasure(instance, `patch`); 8479 } 8480 next.el = nextTree.el; 8481 if (originNext === null) { 8482 updateHOCHostEl(instance, nextTree.el); 8483 } 8484 if (u) { 8485 queuePostRenderEffect(u, parentSuspense); 8486 } 8487 if (vnodeHook = next.props && next.props.onVnodeUpdated) { 8488 queuePostRenderEffect( 8489 () => invokeVNodeHook(vnodeHook, parent, next, vnode), 8490 parentSuspense 8491 ); 8492 } 8493 if (true) { 8494 devtoolsComponentUpdated(instance); 8495 } 8496 if (true) { 8497 popWarningContext(); 8498 } 8499 } 8500 }; 8501 instance.scope.on(); 8502 const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn); 8503 instance.scope.off(); 8504 const update = instance.update = effect2.run.bind(effect2); 8505 const job = instance.job = effect2.runIfDirty.bind(effect2); 8506 job.i = instance; 8507 job.id = instance.uid; 8508 effect2.scheduler = () => queueJob(job); 8509 toggleRecurse(instance, true); 8510 if (true) { 8511 effect2.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; 8512 effect2.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; 8513 } 8514 update(); 8515 }; 8516 const updateComponentPreRender = (instance, nextVNode, optimized) => { 8517 nextVNode.component = instance; 8518 const prevProps = instance.vnode.props; 8519 instance.vnode = nextVNode; 8520 instance.next = null; 8521 updateProps(instance, nextVNode.props, prevProps, optimized); 8522 updateSlots(instance, nextVNode.children, optimized); 8523 pauseTracking(); 8524 flushPreFlushCbs(instance); 8525 resetTracking(); 8526 }; 8527 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { 8528 const c1 = n1 && n1.children; 8529 const prevShapeFlag = n1 ? n1.shapeFlag : 0; 8530 const c2 = n2.children; 8531 const { patchFlag, shapeFlag } = n2; 8532 if (patchFlag > 0) { 8533 if (patchFlag & 128) { 8534 patchKeyedChildren( 8535 c1, 8536 c2, 8537 container, 8538 anchor, 8539 parentComponent, 8540 parentSuspense, 8541 namespace, 8542 slotScopeIds, 8543 optimized 8544 ); 8545 return; 8546 } else if (patchFlag & 256) { 8547 patchUnkeyedChildren( 8548 c1, 8549 c2, 8550 container, 8551 anchor, 8552 parentComponent, 8553 parentSuspense, 8554 namespace, 8555 slotScopeIds, 8556 optimized 8557 ); 8558 return; 8559 } 8560 } 8561 if (shapeFlag & 8) { 8562 if (prevShapeFlag & 16) { 8563 unmountChildren(c1, parentComponent, parentSuspense); 8564 } 8565 if (c2 !== c1) { 8566 hostSetElementText(container, c2); 8567 } 8568 } else { 8569 if (prevShapeFlag & 16) { 8570 if (shapeFlag & 16) { 8571 patchKeyedChildren( 8572 c1, 8573 c2, 8574 container, 8575 anchor, 8576 parentComponent, 8577 parentSuspense, 8578 namespace, 8579 slotScopeIds, 8580 optimized 8581 ); 8582 } else { 8583 unmountChildren(c1, parentComponent, parentSuspense, true); 8584 } 8585 } else { 8586 if (prevShapeFlag & 8) { 8587 hostSetElementText(container, ""); 8588 } 8589 if (shapeFlag & 16) { 8590 mountChildren( 8591 c2, 8592 container, 8593 anchor, 8594 parentComponent, 8595 parentSuspense, 8596 namespace, 8597 slotScopeIds, 8598 optimized 8599 ); 8600 } 8601 } 8602 } 8603 }; 8604 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 8605 c1 = c1 || EMPTY_ARR; 8606 c2 = c2 || EMPTY_ARR; 8607 const oldLength = c1.length; 8608 const newLength = c2.length; 8609 const commonLength = Math.min(oldLength, newLength); 8610 let i; 8611 for (i = 0; i < commonLength; i++) { 8612 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 8613 patch( 8614 c1[i], 8615 nextChild, 8616 container, 8617 null, 8618 parentComponent, 8619 parentSuspense, 8620 namespace, 8621 slotScopeIds, 8622 optimized 8623 ); 8624 } 8625 if (oldLength > newLength) { 8626 unmountChildren( 8627 c1, 8628 parentComponent, 8629 parentSuspense, 8630 true, 8631 false, 8632 commonLength 8633 ); 8634 } else { 8635 mountChildren( 8636 c2, 8637 container, 8638 anchor, 8639 parentComponent, 8640 parentSuspense, 8641 namespace, 8642 slotScopeIds, 8643 optimized, 8644 commonLength 8645 ); 8646 } 8647 }; 8648 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 8649 let i = 0; 8650 const l2 = c2.length; 8651 let e1 = c1.length - 1; 8652 let e2 = l2 - 1; 8653 while (i <= e1 && i <= e2) { 8654 const n1 = c1[i]; 8655 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 8656 if (isSameVNodeType(n1, n2)) { 8657 patch( 8658 n1, 8659 n2, 8660 container, 8661 null, 8662 parentComponent, 8663 parentSuspense, 8664 namespace, 8665 slotScopeIds, 8666 optimized 8667 ); 8668 } else { 8669 break; 8670 } 8671 i++; 8672 } 8673 while (i <= e1 && i <= e2) { 8674 const n1 = c1[e1]; 8675 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); 8676 if (isSameVNodeType(n1, n2)) { 8677 patch( 8678 n1, 8679 n2, 8680 container, 8681 null, 8682 parentComponent, 8683 parentSuspense, 8684 namespace, 8685 slotScopeIds, 8686 optimized 8687 ); 8688 } else { 8689 break; 8690 } 8691 e1--; 8692 e2--; 8693 } 8694 if (i > e1) { 8695 if (i <= e2) { 8696 const nextPos = e2 + 1; 8697 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; 8698 while (i <= e2) { 8699 patch( 8700 null, 8701 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), 8702 container, 8703 anchor, 8704 parentComponent, 8705 parentSuspense, 8706 namespace, 8707 slotScopeIds, 8708 optimized 8709 ); 8710 i++; 8711 } 8712 } 8713 } else if (i > e2) { 8714 while (i <= e1) { 8715 unmount(c1[i], parentComponent, parentSuspense, true); 8716 i++; 8717 } 8718 } else { 8719 const s1 = i; 8720 const s2 = i; 8721 const keyToNewIndexMap = /* @__PURE__ */ new Map(); 8722 for (i = s2; i <= e2; i++) { 8723 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 8724 if (nextChild.key != null) { 8725 if (keyToNewIndexMap.has(nextChild.key)) { 8726 warn$1( 8727 `Duplicate keys found during update:`, 8728 JSON.stringify(nextChild.key), 8729 `Make sure keys are unique.` 8730 ); 8731 } 8732 keyToNewIndexMap.set(nextChild.key, i); 8733 } 8734 } 8735 let j; 8736 let patched = 0; 8737 const toBePatched = e2 - s2 + 1; 8738 let moved = false; 8739 let maxNewIndexSoFar = 0; 8740 const newIndexToOldIndexMap = new Array(toBePatched); 8741 for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; 8742 for (i = s1; i <= e1; i++) { 8743 const prevChild = c1[i]; 8744 if (patched >= toBePatched) { 8745 unmount(prevChild, parentComponent, parentSuspense, true); 8746 continue; 8747 } 8748 let newIndex; 8749 if (prevChild.key != null) { 8750 newIndex = keyToNewIndexMap.get(prevChild.key); 8751 } else { 8752 for (j = s2; j <= e2; j++) { 8753 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { 8754 newIndex = j; 8755 break; 8756 } 8757 } 8758 } 8759 if (newIndex === void 0) { 8760 unmount(prevChild, parentComponent, parentSuspense, true); 8761 } else { 8762 newIndexToOldIndexMap[newIndex - s2] = i + 1; 8763 if (newIndex >= maxNewIndexSoFar) { 8764 maxNewIndexSoFar = newIndex; 8765 } else { 8766 moved = true; 8767 } 8768 patch( 8769 prevChild, 8770 c2[newIndex], 8771 container, 8772 null, 8773 parentComponent, 8774 parentSuspense, 8775 namespace, 8776 slotScopeIds, 8777 optimized 8778 ); 8779 patched++; 8780 } 8781 } 8782 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; 8783 j = increasingNewIndexSequence.length - 1; 8784 for (i = toBePatched - 1; i >= 0; i--) { 8785 const nextIndex = s2 + i; 8786 const nextChild = c2[nextIndex]; 8787 const anchorVNode = c2[nextIndex + 1]; 8788 const anchor = nextIndex + 1 < l2 ? ( 8789 // #13559, #14173 fallback to el placeholder for unresolved async component 8790 anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) 8791 ) : parentAnchor; 8792 if (newIndexToOldIndexMap[i] === 0) { 8793 patch( 8794 null, 8795 nextChild, 8796 container, 8797 anchor, 8798 parentComponent, 8799 parentSuspense, 8800 namespace, 8801 slotScopeIds, 8802 optimized 8803 ); 8804 } else if (moved) { 8805 if (j < 0 || i !== increasingNewIndexSequence[j]) { 8806 move(nextChild, container, anchor, 2); 8807 } else { 8808 j--; 8809 } 8810 } 8811 } 8812 } 8813 }; 8814 const move = (vnode, container, anchor, moveType, parentSuspense = null) => { 8815 const { el, type, transition, children, shapeFlag } = vnode; 8816 if (shapeFlag & 6) { 8817 move(vnode.component.subTree, container, anchor, moveType); 8818 return; 8819 } 8820 if (shapeFlag & 128) { 8821 vnode.suspense.move(container, anchor, moveType); 8822 return; 8823 } 8824 if (shapeFlag & 64) { 8825 type.move(vnode, container, anchor, internals); 8826 return; 8827 } 8828 if (type === Fragment) { 8829 hostInsert(el, container, anchor); 8830 for (let i = 0; i < children.length; i++) { 8831 move(children[i], container, anchor, moveType); 8832 } 8833 hostInsert(vnode.anchor, container, anchor); 8834 return; 8835 } 8836 if (type === Static) { 8837 moveStaticNode(vnode, container, anchor); 8838 return; 8839 } 8840 const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; 8841 if (needTransition2) { 8842 if (moveType === 0) { 8843 if (transition.persisted && !el[leaveCbKey]) { 8844 hostInsert(el, container, anchor); 8845 } else { 8846 transition.beforeEnter(el); 8847 hostInsert(el, container, anchor); 8848 queuePostRenderEffect(() => transition.enter(el), parentSuspense); 8849 } 8850 } else { 8851 const { leave, delayLeave, afterLeave } = transition; 8852 const remove22 = () => { 8853 if (vnode.ctx.isUnmounted) { 8854 hostRemove(el); 8855 } else { 8856 hostInsert(el, container, anchor); 8857 } 8858 }; 8859 const performLeave = () => { 8860 const wasLeaving = el._isLeaving || !!el[leaveCbKey]; 8861 if (el._isLeaving) { 8862 el[leaveCbKey]( 8863 true 8864 /* cancelled */ 8865 ); 8866 } 8867 if (transition.persisted && !wasLeaving) { 8868 remove22(); 8869 } else { 8870 leave(el, () => { 8871 remove22(); 8872 afterLeave && afterLeave(); 8873 }); 8874 } 8875 }; 8876 if (delayLeave) { 8877 delayLeave(el, remove22, performLeave); 8878 } else { 8879 performLeave(); 8880 } 8881 } 8882 } else { 8883 hostInsert(el, container, anchor); 8884 } 8885 }; 8886 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { 8887 const { 8888 type, 8889 props, 8890 ref: ref2, 8891 children, 8892 dynamicChildren, 8893 shapeFlag, 8894 patchFlag, 8895 dirs, 8896 cacheIndex, 8897 memo 8898 } = vnode; 8899 if (patchFlag === -2) { 8900 optimized = false; 8901 } 8902 if (ref2 != null) { 8903 pauseTracking(); 8904 setRef(ref2, null, parentSuspense, vnode, true); 8905 resetTracking(); 8906 } 8907 if (cacheIndex != null) { 8908 parentComponent.renderCache[cacheIndex] = void 0; 8909 } 8910 if (shapeFlag & 256) { 8911 parentComponent.ctx.deactivate(vnode); 8912 return; 8913 } 8914 const shouldInvokeDirs = shapeFlag & 1 && dirs; 8915 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); 8916 let vnodeHook; 8917 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { 8918 invokeVNodeHook(vnodeHook, parentComponent, vnode); 8919 } 8920 if (shapeFlag & 6) { 8921 unmountComponent(vnode.component, parentSuspense, doRemove); 8922 } else { 8923 if (shapeFlag & 128) { 8924 vnode.suspense.unmount(parentSuspense, doRemove); 8925 return; 8926 } 8927 if (shouldInvokeDirs) { 8928 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); 8929 } 8930 if (shapeFlag & 64) { 8931 vnode.type.remove( 8932 vnode, 8933 parentComponent, 8934 parentSuspense, 8935 internals, 8936 doRemove 8937 ); 8938 } else if (dynamicChildren && // #5154 8939 // when v-once is used inside a block, setBlockTracking(-1) marks the 8940 // parent block with hasOnce: true 8941 // so that it doesn't take the fast path during unmount - otherwise 8942 // components nested in v-once are never unmounted. 8943 !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments 8944 (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { 8945 unmountChildren( 8946 dynamicChildren, 8947 parentComponent, 8948 parentSuspense, 8949 false, 8950 true 8951 ); 8952 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { 8953 unmountChildren(children, parentComponent, parentSuspense); 8954 } 8955 if (doRemove) { 8956 remove2(vnode); 8957 } 8958 } 8959 const shouldInvalidateMemo = memo != null && cacheIndex == null; 8960 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) { 8961 queuePostRenderEffect(() => { 8962 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 8963 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); 8964 if (shouldInvalidateMemo) { 8965 vnode.el = null; 8966 } 8967 }, parentSuspense); 8968 } 8969 }; 8970 const remove2 = (vnode) => { 8971 const { type, el, anchor, transition } = vnode; 8972 if (type === Fragment) { 8973 if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { 8974 vnode.children.forEach((child) => { 8975 if (child.type === Comment) { 8976 hostRemove(child.el); 8977 } else { 8978 remove2(child); 8979 } 8980 }); 8981 } else { 8982 removeFragment(el, anchor); 8983 } 8984 return; 8985 } 8986 if (type === Static) { 8987 removeStaticNode(vnode); 8988 return; 8989 } 8990 const performRemove = () => { 8991 hostRemove(el); 8992 if (transition && !transition.persisted && transition.afterLeave) { 8993 transition.afterLeave(); 8994 } 8995 }; 8996 if (vnode.shapeFlag & 1 && transition && !transition.persisted) { 8997 const { leave, delayLeave } = transition; 8998 const performLeave = () => leave(el, performRemove); 8999 if (delayLeave) { 9000 delayLeave(vnode.el, performRemove, performLeave); 9001 } else { 9002 performLeave(); 9003 } 9004 } else { 9005 performRemove(); 9006 } 9007 }; 9008 const removeFragment = (cur, end) => { 9009 let next; 9010 while (cur !== end) { 9011 next = hostNextSibling(cur); 9012 hostRemove(cur); 9013 cur = next; 9014 } 9015 hostRemove(end); 9016 }; 9017 const unmountComponent = (instance, parentSuspense, doRemove) => { 9018 if (instance.type.__hmrId) { 9019 unregisterHMR(instance); 9020 } 9021 const { bum, scope, job, subTree, um, m, a } = instance; 9022 invalidateMount(m); 9023 invalidateMount(a); 9024 if (bum) { 9025 invokeArrayFns(bum); 9026 } 9027 scope.stop(); 9028 if (job) { 9029 job.flags |= 8; 9030 unmount(subTree, instance, parentSuspense, doRemove); 9031 } 9032 if (um) { 9033 queuePostRenderEffect(um, parentSuspense); 9034 } 9035 queuePostRenderEffect(() => { 9036 instance.isUnmounted = true; 9037 }, parentSuspense); 9038 if (true) { 9039 devtoolsComponentRemoved(instance); 9040 } 9041 }; 9042 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { 9043 for (let i = start; i < children.length; i++) { 9044 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); 9045 } 9046 }; 9047 const getNextHostNode = (vnode) => { 9048 if (vnode.shapeFlag & 6) { 9049 return getNextHostNode(vnode.component.subTree); 9050 } 9051 if (vnode.shapeFlag & 128) { 9052 return vnode.suspense.next(); 9053 } 9054 const el = hostNextSibling(vnode.anchor || vnode.el); 9055 const teleportEnd = el && el[TeleportEndKey]; 9056 return teleportEnd ? hostNextSibling(teleportEnd) : el; 9057 }; 9058 let isFlushing = false; 9059 const render2 = (vnode, container, namespace) => { 9060 let instance; 9061 if (vnode == null) { 9062 if (container._vnode) { 9063 unmount(container._vnode, null, null, true); 9064 instance = container._vnode.component; 9065 } 9066 } else { 9067 patch( 9068 container._vnode || null, 9069 vnode, 9070 container, 9071 null, 9072 null, 9073 null, 9074 namespace 9075 ); 9076 } 9077 container._vnode = vnode; 9078 if (!isFlushing) { 9079 isFlushing = true; 9080 flushPreFlushCbs(instance); 9081 flushPostFlushCbs(); 9082 isFlushing = false; 9083 } 9084 }; 9085 const internals = { 9086 p: patch, 9087 um: unmount, 9088 m: move, 9089 r: remove2, 9090 mt: mountComponent, 9091 mc: mountChildren, 9092 pc: patchChildren, 9093 pbc: patchBlockChildren, 9094 n: getNextHostNode, 9095 o: options 9096 }; 9097 let hydrate2; 9098 let hydrateNode; 9099 if (createHydrationFns) { 9100 [hydrate2, hydrateNode] = createHydrationFns( 9101 internals 9102 ); 9103 } 9104 return { 9105 render: render2, 9106 hydrate: hydrate2, 9107 createApp: createAppAPI(render2, hydrate2) 9108 }; 9109 } 9110 function resolveChildrenNamespace({ type, props }, currentNamespace) { 9111 return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; 9112 } 9113 function toggleRecurse({ effect: effect2, job }, allowed) { 9114 if (allowed) { 9115 effect2.flags |= 32; 9116 job.flags |= 4; 9117 } else { 9118 effect2.flags &= -33; 9119 job.flags &= -5; 9120 } 9121 } 9122 function needTransition(parentSuspense, transition) { 9123 return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; 9124 } 9125 function traverseStaticChildren(n1, n2, shallow = false) { 9126 const ch1 = n1.children; 9127 const ch2 = n2.children; 9128 if (isArray(ch1) && isArray(ch2)) { 9129 for (let i = 0; i < ch1.length; i++) { 9130 const c1 = ch1[i]; 9131 let c2 = ch2[i]; 9132 if (c2.shapeFlag & 1 && !c2.dynamicChildren) { 9133 if (c2.patchFlag <= 0 || c2.patchFlag === 32) { 9134 c2 = ch2[i] = cloneIfMounted(ch2[i]); 9135 c2.el = c1.el; 9136 } 9137 if (!shallow && c2.patchFlag !== -2) 9138 traverseStaticChildren(c1, c2); 9139 } 9140 if (c2.type === Text) { 9141 if (c2.patchFlag === -1) { 9142 c2 = ch2[i] = cloneIfMounted(c2); 9143 } 9144 c2.el = c1.el; 9145 } 9146 if (c2.type === Comment && !c2.el) { 9147 c2.el = c1.el; 9148 } 9149 if (true) { 9150 c2.el && (c2.el.__vnode = c2); 9151 } 9152 } 9153 } 9154 } 9155 function getSequence(arr) { 9156 const p2 = arr.slice(); 9157 const result = [0]; 9158 let i, j, u, v, c; 9159 const len = arr.length; 9160 for (i = 0; i < len; i++) { 9161 const arrI = arr[i]; 9162 if (arrI !== 0) { 9163 j = result[result.length - 1]; 9164 if (arr[j] < arrI) { 9165 p2[i] = j; 9166 result.push(i); 9167 continue; 9168 } 9169 u = 0; 9170 v = result.length - 1; 9171 while (u < v) { 9172 c = u + v >> 1; 9173 if (arr[result[c]] < arrI) { 9174 u = c + 1; 9175 } else { 9176 v = c; 9177 } 9178 } 9179 if (arrI < arr[result[u]]) { 9180 if (u > 0) { 9181 p2[i] = result[u - 1]; 9182 } 9183 result[u] = i; 9184 } 9185 } 9186 } 9187 u = result.length; 9188 v = result[u - 1]; 9189 while (u-- > 0) { 9190 result[u] = v; 9191 v = p2[v]; 9192 } 9193 return result; 9194 } 9195 function locateNonHydratedAsyncRoot(instance) { 9196 const subComponent = instance.subTree.component; 9197 if (subComponent) { 9198 if (subComponent.asyncDep && !subComponent.asyncResolved) { 9199 return subComponent; 9200 } else { 9201 return locateNonHydratedAsyncRoot(subComponent); 9202 } 9203 } 9204 } 9205 function invalidateMount(hooks) { 9206 if (hooks) { 9207 for (let i = 0; i < hooks.length; i++) 9208 hooks[i].flags |= 8; 9209 } 9210 } 9211 function resolveAsyncComponentPlaceholder(anchorVnode) { 9212 if (anchorVnode.placeholder) { 9213 return anchorVnode.placeholder; 9214 } 9215 const instance = anchorVnode.component; 9216 if (instance) { 9217 return resolveAsyncComponentPlaceholder(instance.subTree); 9218 } 9219 return null; 9220 } 9221 var isSuspense = (type) => type.__isSuspense; 9222 var suspenseId = 0; 9223 var SuspenseImpl = { 9224 name: "Suspense", 9225 // In order to make Suspense tree-shakable, we need to avoid importing it 9226 // directly in the renderer. The renderer checks for the __isSuspense flag 9227 // on a vnode's type and calls the `process` method, passing in renderer 9228 // internals. 9229 __isSuspense: true, 9230 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { 9231 if (n1 == null) { 9232 mountSuspense( 9233 n2, 9234 container, 9235 anchor, 9236 parentComponent, 9237 parentSuspense, 9238 namespace, 9239 slotScopeIds, 9240 optimized, 9241 rendererInternals 9242 ); 9243 } else { 9244 if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { 9245 n2.suspense = n1.suspense; 9246 n2.suspense.vnode = n2; 9247 n2.el = n1.el; 9248 return; 9249 } 9250 patchSuspense( 9251 n1, 9252 n2, 9253 container, 9254 anchor, 9255 parentComponent, 9256 namespace, 9257 slotScopeIds, 9258 optimized, 9259 rendererInternals 9260 ); 9261 } 9262 }, 9263 hydrate: hydrateSuspense, 9264 normalize: normalizeSuspenseChildren 9265 }; 9266 var Suspense = SuspenseImpl; 9267 function triggerEvent(vnode, name) { 9268 const eventListener = vnode.props && vnode.props[name]; 9269 if (isFunction(eventListener)) { 9270 eventListener(); 9271 } 9272 } 9273 function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { 9274 const { 9275 p: patch, 9276 o: { createElement } 9277 } = rendererInternals; 9278 const hiddenContainer = createElement("div"); 9279 const suspense = vnode.suspense = createSuspenseBoundary( 9280 vnode, 9281 parentSuspense, 9282 parentComponent, 9283 container, 9284 hiddenContainer, 9285 anchor, 9286 namespace, 9287 slotScopeIds, 9288 optimized, 9289 rendererInternals 9290 ); 9291 patch( 9292 null, 9293 suspense.pendingBranch = vnode.ssContent, 9294 hiddenContainer, 9295 null, 9296 parentComponent, 9297 suspense, 9298 namespace, 9299 slotScopeIds 9300 ); 9301 if (suspense.deps > 0) { 9302 triggerEvent(vnode, "onPending"); 9303 triggerEvent(vnode, "onFallback"); 9304 patch( 9305 null, 9306 vnode.ssFallback, 9307 container, 9308 anchor, 9309 parentComponent, 9310 null, 9311 // fallback tree will not have suspense context 9312 namespace, 9313 slotScopeIds 9314 ); 9315 setActiveBranch(suspense, vnode.ssFallback); 9316 } else { 9317 suspense.resolve(false, true); 9318 } 9319 } 9320 function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { 9321 const suspense = n2.suspense = n1.suspense; 9322 suspense.vnode = n2; 9323 n2.el = n1.el; 9324 const newBranch = n2.ssContent; 9325 const newFallback = n2.ssFallback; 9326 const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; 9327 if (pendingBranch) { 9328 suspense.pendingBranch = newBranch; 9329 if (isSameVNodeType(pendingBranch, newBranch)) { 9330 patch( 9331 pendingBranch, 9332 newBranch, 9333 suspense.hiddenContainer, 9334 null, 9335 parentComponent, 9336 suspense, 9337 namespace, 9338 slotScopeIds, 9339 optimized 9340 ); 9341 if (suspense.deps <= 0) { 9342 suspense.resolve(); 9343 } else if (isInFallback) { 9344 if (!isHydrating) { 9345 patch( 9346 activeBranch, 9347 newFallback, 9348 container, 9349 anchor, 9350 parentComponent, 9351 null, 9352 // fallback tree will not have suspense context 9353 namespace, 9354 slotScopeIds, 9355 optimized 9356 ); 9357 setActiveBranch(suspense, newFallback); 9358 } 9359 } 9360 } else { 9361 suspense.pendingId = suspenseId++; 9362 if (isHydrating) { 9363 suspense.isHydrating = false; 9364 suspense.activeBranch = pendingBranch; 9365 } else { 9366 unmount(pendingBranch, parentComponent, suspense); 9367 } 9368 suspense.deps = 0; 9369 suspense.effects.length = 0; 9370 suspense.hiddenContainer = createElement("div"); 9371 if (isInFallback) { 9372 patch( 9373 null, 9374 newBranch, 9375 suspense.hiddenContainer, 9376 null, 9377 parentComponent, 9378 suspense, 9379 namespace, 9380 slotScopeIds, 9381 optimized 9382 ); 9383 if (suspense.deps <= 0) { 9384 suspense.resolve(); 9385 } else { 9386 patch( 9387 activeBranch, 9388 newFallback, 9389 container, 9390 anchor, 9391 parentComponent, 9392 null, 9393 // fallback tree will not have suspense context 9394 namespace, 9395 slotScopeIds, 9396 optimized 9397 ); 9398 setActiveBranch(suspense, newFallback); 9399 } 9400 } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) { 9401 patch( 9402 activeBranch, 9403 newBranch, 9404 container, 9405 anchor, 9406 parentComponent, 9407 suspense, 9408 namespace, 9409 slotScopeIds, 9410 optimized 9411 ); 9412 suspense.resolve(true); 9413 } else { 9414 patch( 9415 null, 9416 newBranch, 9417 suspense.hiddenContainer, 9418 null, 9419 parentComponent, 9420 suspense, 9421 namespace, 9422 slotScopeIds, 9423 optimized 9424 ); 9425 if (suspense.deps <= 0) { 9426 suspense.resolve(); 9427 } 9428 } 9429 } 9430 } else { 9431 if (activeBranch && isSameVNodeType(activeBranch, newBranch)) { 9432 patch( 9433 activeBranch, 9434 newBranch, 9435 container, 9436 anchor, 9437 parentComponent, 9438 suspense, 9439 namespace, 9440 slotScopeIds, 9441 optimized 9442 ); 9443 setActiveBranch(suspense, newBranch); 9444 } else { 9445 triggerEvent(n2, "onPending"); 9446 suspense.pendingBranch = newBranch; 9447 if (newBranch.shapeFlag & 512) { 9448 suspense.pendingId = newBranch.component.suspenseId; 9449 } else { 9450 suspense.pendingId = suspenseId++; 9451 } 9452 patch( 9453 null, 9454 newBranch, 9455 suspense.hiddenContainer, 9456 null, 9457 parentComponent, 9458 suspense, 9459 namespace, 9460 slotScopeIds, 9461 optimized 9462 ); 9463 if (suspense.deps <= 0) { 9464 suspense.resolve(); 9465 } else { 9466 const { timeout, pendingId } = suspense; 9467 if (timeout > 0) { 9468 setTimeout(() => { 9469 if (suspense.pendingId === pendingId) { 9470 suspense.fallback(newFallback); 9471 } 9472 }, timeout); 9473 } else if (timeout === 0) { 9474 suspense.fallback(newFallback); 9475 } 9476 } 9477 } 9478 } 9479 } 9480 var hasWarned = false; 9481 function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { 9482 if (!hasWarned) { 9483 hasWarned = true; 9484 console[console.info ? "info" : "log"]( 9485 `<Suspense> is an experimental feature and its API will likely change.` 9486 ); 9487 } 9488 const { 9489 p: patch, 9490 m: move, 9491 um: unmount, 9492 n: next, 9493 o: { parentNode, remove: remove2 } 9494 } = rendererInternals; 9495 let parentSuspenseId; 9496 const isSuspensible = isVNodeSuspensible(vnode); 9497 if (isSuspensible) { 9498 if (parentSuspense && parentSuspense.pendingBranch) { 9499 parentSuspenseId = parentSuspense.pendingId; 9500 parentSuspense.deps++; 9501 } 9502 } 9503 const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; 9504 if (true) { 9505 assertNumber(timeout, `Suspense timeout`); 9506 } 9507 const initialAnchor = anchor; 9508 const suspense = { 9509 vnode, 9510 parent: parentSuspense, 9511 parentComponent, 9512 namespace, 9513 container, 9514 hiddenContainer, 9515 deps: 0, 9516 pendingId: suspenseId++, 9517 timeout: typeof timeout === "number" ? timeout : -1, 9518 activeBranch: null, 9519 isFallbackMountPending: false, 9520 pendingBranch: null, 9521 isInFallback: !isHydrating, 9522 isHydrating, 9523 isUnmounted: false, 9524 effects: [], 9525 resolve(resume = false, sync = false) { 9526 if (true) { 9527 if (!resume && !suspense.pendingBranch) { 9528 throw new Error( 9529 `suspense.resolve() is called without a pending branch.` 9530 ); 9531 } 9532 if (suspense.isUnmounted) { 9533 throw new Error( 9534 `suspense.resolve() is called on an already unmounted suspense boundary.` 9535 ); 9536 } 9537 } 9538 const { 9539 vnode: vnode2, 9540 activeBranch, 9541 pendingBranch, 9542 pendingId, 9543 effects, 9544 parentComponent: parentComponent2, 9545 container: container2, 9546 isInFallback 9547 } = suspense; 9548 let delayEnter = false; 9549 if (suspense.isHydrating) { 9550 suspense.isHydrating = false; 9551 } else if (!resume) { 9552 delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; 9553 let hasUpdatedAnchor = false; 9554 if (delayEnter) { 9555 activeBranch.transition.afterLeave = () => { 9556 if (pendingId === suspense.pendingId) { 9557 move( 9558 pendingBranch, 9559 container2, 9560 anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 9561 0 9562 ); 9563 queuePostFlushCb(effects); 9564 if (isInFallback && vnode2.ssFallback) { 9565 vnode2.ssFallback.el = null; 9566 } 9567 } 9568 }; 9569 } 9570 if (activeBranch && !suspense.isFallbackMountPending) { 9571 if (parentNode(activeBranch.el) === container2) { 9572 anchor = next(activeBranch); 9573 hasUpdatedAnchor = true; 9574 } 9575 unmount(activeBranch, parentComponent2, suspense, true); 9576 if (!delayEnter && isInFallback && vnode2.ssFallback) { 9577 queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense); 9578 } 9579 } 9580 if (!delayEnter) { 9581 move(pendingBranch, container2, anchor, 0); 9582 } 9583 } 9584 suspense.isFallbackMountPending = false; 9585 setActiveBranch(suspense, pendingBranch); 9586 suspense.pendingBranch = null; 9587 suspense.isInFallback = false; 9588 let parent = suspense.parent; 9589 let hasUnresolvedAncestor = false; 9590 while (parent) { 9591 if (parent.pendingBranch) { 9592 parent.effects.push(...effects); 9593 hasUnresolvedAncestor = true; 9594 break; 9595 } 9596 parent = parent.parent; 9597 } 9598 if (!hasUnresolvedAncestor && !delayEnter) { 9599 queuePostFlushCb(effects); 9600 } 9601 suspense.effects = []; 9602 if (isSuspensible) { 9603 if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { 9604 parentSuspense.deps--; 9605 if (parentSuspense.deps === 0 && !sync) { 9606 parentSuspense.resolve(); 9607 } 9608 } 9609 } 9610 triggerEvent(vnode2, "onResolve"); 9611 }, 9612 fallback(fallbackVNode) { 9613 if (!suspense.pendingBranch) { 9614 return; 9615 } 9616 const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; 9617 triggerEvent(vnode2, "onFallback"); 9618 const anchor2 = next(activeBranch); 9619 const mountFallback = () => { 9620 suspense.isFallbackMountPending = false; 9621 if (!suspense.isInFallback) { 9622 return; 9623 } 9624 patch( 9625 null, 9626 fallbackVNode, 9627 container2, 9628 anchor2, 9629 parentComponent2, 9630 null, 9631 // fallback tree will not have suspense context 9632 namespace2, 9633 slotScopeIds, 9634 optimized 9635 ); 9636 setActiveBranch(suspense, fallbackVNode); 9637 }; 9638 const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; 9639 if (delayEnter) { 9640 suspense.isFallbackMountPending = true; 9641 activeBranch.transition.afterLeave = mountFallback; 9642 } 9643 suspense.isInFallback = true; 9644 unmount( 9645 activeBranch, 9646 parentComponent2, 9647 null, 9648 // no suspense so unmount hooks fire now 9649 true 9650 // shouldRemove 9651 ); 9652 if (!delayEnter) { 9653 mountFallback(); 9654 } 9655 }, 9656 move(container2, anchor2, type) { 9657 suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); 9658 suspense.container = container2; 9659 }, 9660 next() { 9661 return suspense.activeBranch && next(suspense.activeBranch); 9662 }, 9663 registerDep(instance, setupRenderEffect, optimized2) { 9664 const isInPendingSuspense = !!suspense.pendingBranch; 9665 if (isInPendingSuspense) { 9666 suspense.deps++; 9667 } 9668 const hydratedEl = instance.vnode.el; 9669 instance.asyncDep.catch((err) => { 9670 handleError(err, instance, 0); 9671 }).then((asyncSetupResult) => { 9672 if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { 9673 return; 9674 } 9675 unsetCurrentInstance(); 9676 instance.asyncResolved = true; 9677 const { vnode: vnode2 } = instance; 9678 if (true) { 9679 pushWarningContext(vnode2); 9680 } 9681 handleSetupResult(instance, asyncSetupResult, false); 9682 if (hydratedEl) { 9683 vnode2.el = hydratedEl; 9684 } 9685 const placeholder = !hydratedEl && instance.subTree.el; 9686 setupRenderEffect( 9687 instance, 9688 vnode2, 9689 // component may have been moved before resolve. 9690 // if this is not a hydration, instance.subTree will be the comment 9691 // placeholder. 9692 parentNode(hydratedEl || instance.subTree.el), 9693 // anchor will not be used if this is hydration, so only need to 9694 // consider the comment placeholder case. 9695 hydratedEl ? null : next(instance.subTree), 9696 suspense, 9697 namespace, 9698 optimized2 9699 ); 9700 if (placeholder) { 9701 vnode2.placeholder = null; 9702 remove2(placeholder); 9703 } 9704 updateHOCHostEl(instance, vnode2.el); 9705 if (true) { 9706 popWarningContext(); 9707 } 9708 if (isInPendingSuspense && --suspense.deps === 0) { 9709 suspense.resolve(); 9710 } 9711 }); 9712 }, 9713 unmount(parentSuspense2, doRemove) { 9714 suspense.isUnmounted = true; 9715 if (suspense.activeBranch) { 9716 unmount( 9717 suspense.activeBranch, 9718 parentComponent, 9719 parentSuspense2, 9720 doRemove 9721 ); 9722 } 9723 if (suspense.pendingBranch) { 9724 unmount( 9725 suspense.pendingBranch, 9726 parentComponent, 9727 parentSuspense2, 9728 doRemove 9729 ); 9730 } 9731 } 9732 }; 9733 return suspense; 9734 } 9735 function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { 9736 const suspense = vnode.suspense = createSuspenseBoundary( 9737 vnode, 9738 parentSuspense, 9739 parentComponent, 9740 node.parentNode, 9741 // eslint-disable-next-line no-restricted-globals 9742 document.createElement("div"), 9743 null, 9744 namespace, 9745 slotScopeIds, 9746 optimized, 9747 rendererInternals, 9748 true 9749 ); 9750 const result = hydrateNode( 9751 node, 9752 suspense.pendingBranch = vnode.ssContent, 9753 parentComponent, 9754 suspense, 9755 slotScopeIds, 9756 optimized 9757 ); 9758 if (suspense.deps === 0) { 9759 suspense.resolve(false, true); 9760 } 9761 return result; 9762 } 9763 function normalizeSuspenseChildren(vnode) { 9764 const { shapeFlag, children } = vnode; 9765 const isSlotChildren = shapeFlag & 32; 9766 vnode.ssContent = normalizeSuspenseSlot( 9767 isSlotChildren ? children.default : children 9768 ); 9769 vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); 9770 } 9771 function normalizeSuspenseSlot(s) { 9772 let block; 9773 if (isFunction(s)) { 9774 const trackBlock = isBlockTreeEnabled && s._c; 9775 if (trackBlock) { 9776 s._d = false; 9777 openBlock(); 9778 } 9779 s = s(); 9780 if (trackBlock) { 9781 s._d = true; 9782 block = currentBlock; 9783 closeBlock(); 9784 } 9785 } 9786 if (isArray(s)) { 9787 const singleChild = filterSingleRoot(s); 9788 if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { 9789 warn$1(`<Suspense> slots expect a single root node.`); 9790 } 9791 s = singleChild; 9792 } 9793 s = normalizeVNode(s); 9794 if (block && !s.dynamicChildren) { 9795 s.dynamicChildren = block.filter((c) => c !== s); 9796 } 9797 return s; 9798 } 9799 function queueEffectWithSuspense(fn, suspense) { 9800 if (suspense && suspense.pendingBranch) { 9801 if (isArray(fn)) { 9802 suspense.effects.push(...fn); 9803 } else { 9804 suspense.effects.push(fn); 9805 } 9806 } else { 9807 queuePostFlushCb(fn); 9808 } 9809 } 9810 function setActiveBranch(suspense, branch) { 9811 suspense.activeBranch = branch; 9812 const { vnode, parentComponent } = suspense; 9813 let el = branch.el; 9814 while (!el && branch.component) { 9815 branch = branch.component.subTree; 9816 el = branch.el; 9817 } 9818 vnode.el = el; 9819 if (parentComponent && parentComponent.subTree === vnode) { 9820 parentComponent.vnode.el = el; 9821 updateHOCHostEl(parentComponent, el); 9822 } 9823 } 9824 function isVNodeSuspensible(vnode) { 9825 const suspensible = vnode.props && vnode.props.suspensible; 9826 return suspensible != null && suspensible !== false; 9827 } 9828 var Fragment = /* @__PURE__ */ Symbol.for("v-fgt"); 9829 var Text = /* @__PURE__ */ Symbol.for("v-txt"); 9830 var Comment = /* @__PURE__ */ Symbol.for("v-cmt"); 9831 var Static = /* @__PURE__ */ Symbol.for("v-stc"); 9832 var blockStack = []; 9833 var currentBlock = null; 9834 function openBlock(disableTracking = false) { 9835 blockStack.push(currentBlock = disableTracking ? null : []); 9836 } 9837 function closeBlock() { 9838 blockStack.pop(); 9839 currentBlock = blockStack[blockStack.length - 1] || null; 9840 } 9841 var isBlockTreeEnabled = 1; 9842 function setBlockTracking(value, inVOnce = false) { 9843 isBlockTreeEnabled += value; 9844 if (value < 0 && currentBlock && inVOnce) { 9845 currentBlock.hasOnce = true; 9846 } 9847 } 9848 function setupBlock(vnode) { 9849 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; 9850 closeBlock(); 9851 if (isBlockTreeEnabled > 0 && currentBlock) { 9852 currentBlock.push(vnode); 9853 } 9854 return vnode; 9855 } 9856 function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { 9857 return setupBlock( 9858 createBaseVNode( 9859 type, 9860 props, 9861 children, 9862 patchFlag, 9863 dynamicProps, 9864 shapeFlag, 9865 true 9866 ) 9867 ); 9868 } 9869 function createBlock(type, props, children, patchFlag, dynamicProps) { 9870 return setupBlock( 9871 createVNode( 9872 type, 9873 props, 9874 children, 9875 patchFlag, 9876 dynamicProps, 9877 true 9878 ) 9879 ); 9880 } 9881 function isVNode(value) { 9882 return value ? value.__v_isVNode === true : false; 9883 } 9884 function isSameVNodeType(n1, n2) { 9885 if (n2.shapeFlag & 6 && n1.component) { 9886 const dirtyInstances = hmrDirtyComponents.get(n2.type); 9887 if (dirtyInstances && dirtyInstances.has(n1.component)) { 9888 n1.shapeFlag &= -257; 9889 n2.shapeFlag &= -513; 9890 return false; 9891 } 9892 } 9893 return n1.type === n2.type && n1.key === n2.key; 9894 } 9895 var vnodeArgsTransformer; 9896 function transformVNodeArgs(transformer) { 9897 vnodeArgsTransformer = transformer; 9898 } 9899 var createVNodeWithArgsTransform = (...args) => { 9900 return _createVNode( 9901 ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args 9902 ); 9903 }; 9904 var normalizeKey = ({ key }) => key != null ? key : null; 9905 var normalizeRef = ({ 9906 ref: ref2, 9907 ref_key, 9908 ref_for 9909 }) => { 9910 if (typeof ref2 === "number") { 9911 ref2 = "" + ref2; 9912 } 9913 return ref2 != null ? isString(ref2) || isRef2(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null; 9914 }; 9915 function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { 9916 const vnode = { 9917 __v_isVNode: true, 9918 __v_skip: true, 9919 type, 9920 props, 9921 key: props && normalizeKey(props), 9922 ref: props && normalizeRef(props), 9923 scopeId: currentScopeId, 9924 slotScopeIds: null, 9925 children, 9926 component: null, 9927 suspense: null, 9928 ssContent: null, 9929 ssFallback: null, 9930 dirs: null, 9931 transition: null, 9932 el: null, 9933 anchor: null, 9934 target: null, 9935 targetStart: null, 9936 targetAnchor: null, 9937 staticCount: 0, 9938 shapeFlag, 9939 patchFlag, 9940 dynamicProps, 9941 dynamicChildren: null, 9942 appContext: null, 9943 ctx: currentRenderingInstance 9944 }; 9945 if (needFullChildrenNormalization) { 9946 normalizeChildren(vnode, children); 9947 if (shapeFlag & 128) { 9948 type.normalize(vnode); 9949 } 9950 } else if (children) { 9951 vnode.shapeFlag |= isString(children) ? 8 : 16; 9952 } 9953 if (vnode.key !== vnode.key) { 9954 warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); 9955 } 9956 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself 9957 !isBlockNode && // has current parent block 9958 currentBlock && // presence of a patch flag indicates this node needs patching on updates. 9959 // component nodes also should always be patched, because even if the 9960 // component doesn't need to update, it needs to persist the instance on to 9961 // the next vnode so that it can be properly unmounted later. 9962 (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the 9963 // vnode should not be considered dynamic due to handler caching. 9964 vnode.patchFlag !== 32) { 9965 currentBlock.push(vnode); 9966 } 9967 return vnode; 9968 } 9969 var createVNode = true ? createVNodeWithArgsTransform : _createVNode; 9970 function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { 9971 if (!type || type === NULL_DYNAMIC_COMPONENT) { 9972 if (!type) { 9973 warn$1(`Invalid vnode type when creating vnode: ${type}.`); 9974 } 9975 type = Comment; 9976 } 9977 if (isVNode(type)) { 9978 const cloned = cloneVNode( 9979 type, 9980 props, 9981 true 9982 /* mergeRef: true */ 9983 ); 9984 if (children) { 9985 normalizeChildren(cloned, children); 9986 } 9987 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { 9988 if (cloned.shapeFlag & 6) { 9989 currentBlock[currentBlock.indexOf(type)] = cloned; 9990 } else { 9991 currentBlock.push(cloned); 9992 } 9993 } 9994 cloned.patchFlag = -2; 9995 return cloned; 9996 } 9997 if (isClassComponent(type)) { 9998 type = type.__vccOpts; 9999 } 10000 if (props) { 10001 props = guardReactiveProps(props); 10002 let { class: klass, style } = props; 10003 if (klass && !isString(klass)) { 10004 props.class = normalizeClass(klass); 10005 } 10006 if (isObject(style)) { 10007 if (isProxy(style) && !isArray(style)) { 10008 style = extend({}, style); 10009 } 10010 props.style = normalizeStyle(style); 10011 } 10012 } 10013 const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; 10014 if (shapeFlag & 4 && isProxy(type)) { 10015 type = toRaw(type); 10016 warn$1( 10017 `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, 10018 ` 10019 Component that was made reactive: `, 10020 type 10021 ); 10022 } 10023 return createBaseVNode( 10024 type, 10025 props, 10026 children, 10027 patchFlag, 10028 dynamicProps, 10029 shapeFlag, 10030 isBlockNode, 10031 true 10032 ); 10033 } 10034 function guardReactiveProps(props) { 10035 if (!props) return null; 10036 return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; 10037 } 10038 function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { 10039 const { props, ref: ref2, patchFlag, children, transition } = vnode; 10040 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; 10041 const cloned = { 10042 __v_isVNode: true, 10043 __v_skip: true, 10044 type: vnode.type, 10045 props: mergedProps, 10046 key: mergedProps && normalizeKey(mergedProps), 10047 ref: extraProps && extraProps.ref ? ( 10048 // #2078 in the case of <component :is="vnode" ref="extra"/> 10049 // if the vnode itself already has a ref, cloneVNode will need to merge 10050 // the refs so the single vnode can be set on multiple refs 10051 mergeRef && ref2 ? isArray(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps) 10052 ) : ref2, 10053 scopeId: vnode.scopeId, 10054 slotScopeIds: vnode.slotScopeIds, 10055 children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children, 10056 target: vnode.target, 10057 targetStart: vnode.targetStart, 10058 targetAnchor: vnode.targetAnchor, 10059 staticCount: vnode.staticCount, 10060 shapeFlag: vnode.shapeFlag, 10061 // if the vnode is cloned with extra props, we can no longer assume its 10062 // existing patch flag to be reliable and need to add the FULL_PROPS flag. 10063 // note: preserve flag for fragments since they use the flag for children 10064 // fast paths only. 10065 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, 10066 dynamicProps: vnode.dynamicProps, 10067 dynamicChildren: vnode.dynamicChildren, 10068 appContext: vnode.appContext, 10069 dirs: vnode.dirs, 10070 transition, 10071 // These should technically only be non-null on mounted VNodes. However, 10072 // they *should* be copied for kept-alive vnodes. So we just always copy 10073 // them since them being non-null during a mount doesn't affect the logic as 10074 // they will simply be overwritten. 10075 component: vnode.component, 10076 suspense: vnode.suspense, 10077 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), 10078 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), 10079 placeholder: vnode.placeholder, 10080 el: vnode.el, 10081 anchor: vnode.anchor, 10082 ctx: vnode.ctx, 10083 ce: vnode.ce 10084 }; 10085 if (transition && cloneTransition) { 10086 setTransitionHooks( 10087 cloned, 10088 transition.clone(cloned) 10089 ); 10090 } 10091 return cloned; 10092 } 10093 function deepCloneVNode(vnode) { 10094 const cloned = cloneVNode(vnode); 10095 if (isArray(vnode.children)) { 10096 cloned.children = vnode.children.map(deepCloneVNode); 10097 } 10098 return cloned; 10099 } 10100 function createTextVNode(text = " ", flag = 0) { 10101 return createVNode(Text, null, text, flag); 10102 } 10103 function createStaticVNode(content, numberOfNodes) { 10104 const vnode = createVNode(Static, null, content); 10105 vnode.staticCount = numberOfNodes; 10106 return vnode; 10107 } 10108 function createCommentVNode(text = "", asBlock = false) { 10109 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); 10110 } 10111 function normalizeVNode(child) { 10112 if (child == null || typeof child === "boolean") { 10113 return createVNode(Comment); 10114 } else if (isArray(child)) { 10115 return createVNode( 10116 Fragment, 10117 null, 10118 // #3666, avoid reference pollution when reusing vnode 10119 child.slice() 10120 ); 10121 } else if (isVNode(child)) { 10122 return cloneIfMounted(child); 10123 } else { 10124 return createVNode(Text, null, String(child)); 10125 } 10126 } 10127 function cloneIfMounted(child) { 10128 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); 10129 } 10130 function normalizeChildren(vnode, children) { 10131 let type = 0; 10132 const { shapeFlag } = vnode; 10133 if (children == null) { 10134 children = null; 10135 } else if (isArray(children)) { 10136 type = 16; 10137 } else if (typeof children === "object") { 10138 if (shapeFlag & (1 | 64)) { 10139 const slot = children.default; 10140 if (slot) { 10141 slot._c && (slot._d = false); 10142 normalizeChildren(vnode, slot()); 10143 slot._c && (slot._d = true); 10144 } 10145 return; 10146 } else { 10147 type = 32; 10148 const slotFlag = children._; 10149 if (!slotFlag && !isInternalObject(children)) { 10150 children._ctx = currentRenderingInstance; 10151 } else if (slotFlag === 3 && currentRenderingInstance) { 10152 if (currentRenderingInstance.slots._ === 1) { 10153 children._ = 1; 10154 } else { 10155 children._ = 2; 10156 vnode.patchFlag |= 1024; 10157 } 10158 } 10159 } 10160 } else if (isFunction(children)) { 10161 if (shapeFlag & (1 | 64)) { 10162 normalizeChildren(vnode, { default: children }); 10163 return; 10164 } 10165 children = { default: children, _ctx: currentRenderingInstance }; 10166 type = 32; 10167 } else { 10168 children = String(children); 10169 if (shapeFlag & 64) { 10170 type = 16; 10171 children = [createTextVNode(children)]; 10172 } else { 10173 type = 8; 10174 } 10175 } 10176 vnode.children = children; 10177 vnode.shapeFlag |= type; 10178 } 10179 function mergeProps(...args) { 10180 const ret = {}; 10181 for (let i = 0; i < args.length; i++) { 10182 const toMerge = args[i]; 10183 for (const key in toMerge) { 10184 if (key === "class") { 10185 if (ret.class !== toMerge.class) { 10186 ret.class = normalizeClass([ret.class, toMerge.class]); 10187 } 10188 } else if (key === "style") { 10189 ret.style = normalizeStyle([ret.style, toMerge.style]); 10190 } else if (isOn(key)) { 10191 const existing = ret[key]; 10192 const incoming = toMerge[key]; 10193 if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { 10194 ret[key] = existing ? [].concat(existing, incoming) : incoming; 10195 } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain 10196 // the model listener. 10197 !isModelListener(key)) { 10198 ret[key] = incoming; 10199 } 10200 } else if (key !== "") { 10201 ret[key] = toMerge[key]; 10202 } 10203 } 10204 } 10205 return ret; 10206 } 10207 function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { 10208 callWithAsyncErrorHandling(hook, instance, 7, [ 10209 vnode, 10210 prevVNode 10211 ]); 10212 } 10213 var emptyAppContext = createAppContext(); 10214 var uid = 0; 10215 function createComponentInstance(vnode, parent, suspense) { 10216 const type = vnode.type; 10217 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; 10218 const instance = { 10219 uid: uid++, 10220 vnode, 10221 type, 10222 parent, 10223 appContext, 10224 root: null, 10225 // to be immediately set 10226 next: null, 10227 subTree: null, 10228 // will be set synchronously right after creation 10229 effect: null, 10230 update: null, 10231 // will be set synchronously right after creation 10232 job: null, 10233 scope: new EffectScope( 10234 true 10235 /* detached */ 10236 ), 10237 render: null, 10238 proxy: null, 10239 exposed: null, 10240 exposeProxy: null, 10241 withProxy: null, 10242 provides: parent ? parent.provides : Object.create(appContext.provides), 10243 ids: parent ? parent.ids : ["", 0, 0], 10244 accessCache: null, 10245 renderCache: [], 10246 // local resolved assets 10247 components: null, 10248 directives: null, 10249 // resolved props and emits options 10250 propsOptions: normalizePropsOptions(type, appContext), 10251 emitsOptions: normalizeEmitsOptions(type, appContext), 10252 // emit 10253 emit: null, 10254 // to be set immediately 10255 emitted: null, 10256 // props default value 10257 propsDefaults: EMPTY_OBJ, 10258 // inheritAttrs 10259 inheritAttrs: type.inheritAttrs, 10260 // state 10261 ctx: EMPTY_OBJ, 10262 data: EMPTY_OBJ, 10263 props: EMPTY_OBJ, 10264 attrs: EMPTY_OBJ, 10265 slots: EMPTY_OBJ, 10266 refs: EMPTY_OBJ, 10267 setupState: EMPTY_OBJ, 10268 setupContext: null, 10269 // suspense related 10270 suspense, 10271 suspenseId: suspense ? suspense.pendingId : 0, 10272 asyncDep: null, 10273 asyncResolved: false, 10274 // lifecycle hooks 10275 // not using enums here because it results in computed properties 10276 isMounted: false, 10277 isUnmounted: false, 10278 isDeactivated: false, 10279 bc: null, 10280 c: null, 10281 bm: null, 10282 m: null, 10283 bu: null, 10284 u: null, 10285 um: null, 10286 bum: null, 10287 da: null, 10288 a: null, 10289 rtg: null, 10290 rtc: null, 10291 ec: null, 10292 sp: null 10293 }; 10294 if (true) { 10295 instance.ctx = createDevRenderContext(instance); 10296 } else { 10297 instance.ctx = { _: instance }; 10298 } 10299 instance.root = parent ? parent.root : instance; 10300 instance.emit = emit.bind(null, instance); 10301 if (vnode.ce) { 10302 vnode.ce(instance); 10303 } 10304 return instance; 10305 } 10306 var currentInstance = null; 10307 var getCurrentInstance = () => currentInstance || currentRenderingInstance; 10308 var internalSetCurrentInstance; 10309 var setInSSRSetupState; 10310 { 10311 const g = getGlobalThis(); 10312 const registerGlobalSetter = (key, setter) => { 10313 let setters; 10314 if (!(setters = g[key])) setters = g[key] = []; 10315 setters.push(setter); 10316 return (v) => { 10317 if (setters.length > 1) setters.forEach((set) => set(v)); 10318 else setters[0](v); 10319 }; 10320 }; 10321 internalSetCurrentInstance = registerGlobalSetter( 10322 `__VUE_INSTANCE_SETTERS__`, 10323 (v) => currentInstance = v 10324 ); 10325 setInSSRSetupState = registerGlobalSetter( 10326 `__VUE_SSR_SETTERS__`, 10327 (v) => isInSSRComponentSetup = v 10328 ); 10329 } 10330 var setCurrentInstance = (instance) => { 10331 const prev = currentInstance; 10332 internalSetCurrentInstance(instance); 10333 instance.scope.on(); 10334 return () => { 10335 instance.scope.off(); 10336 internalSetCurrentInstance(prev); 10337 }; 10338 }; 10339 var unsetCurrentInstance = () => { 10340 currentInstance && currentInstance.scope.off(); 10341 internalSetCurrentInstance(null); 10342 }; 10343 var isBuiltInTag = makeMap("slot,component"); 10344 function validateComponentName(name, { isNativeTag }) { 10345 if (isBuiltInTag(name) || isNativeTag(name)) { 10346 warn$1( 10347 "Do not use built-in or reserved HTML elements as component id: " + name 10348 ); 10349 } 10350 } 10351 function isStatefulComponent(instance) { 10352 return instance.vnode.shapeFlag & 4; 10353 } 10354 var isInSSRComponentSetup = false; 10355 function setupComponent(instance, isSSR = false, optimized = false) { 10356 isSSR && setInSSRSetupState(isSSR); 10357 const { props, children } = instance.vnode; 10358 const isStateful = isStatefulComponent(instance); 10359 initProps(instance, props, isStateful, isSSR); 10360 initSlots(instance, children, optimized || isSSR); 10361 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; 10362 isSSR && setInSSRSetupState(false); 10363 return setupResult; 10364 } 10365 function setupStatefulComponent(instance, isSSR) { 10366 const Component = instance.type; 10367 if (true) { 10368 if (Component.name) { 10369 validateComponentName(Component.name, instance.appContext.config); 10370 } 10371 if (Component.components) { 10372 const names = Object.keys(Component.components); 10373 for (let i = 0; i < names.length; i++) { 10374 validateComponentName(names[i], instance.appContext.config); 10375 } 10376 } 10377 if (Component.directives) { 10378 const names = Object.keys(Component.directives); 10379 for (let i = 0; i < names.length; i++) { 10380 validateDirectiveName(names[i]); 10381 } 10382 } 10383 if (Component.compilerOptions && isRuntimeOnly()) { 10384 warn$1( 10385 `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` 10386 ); 10387 } 10388 } 10389 instance.accessCache = /* @__PURE__ */ Object.create(null); 10390 instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); 10391 if (true) { 10392 exposePropsOnRenderContext(instance); 10393 } 10394 const { setup } = Component; 10395 if (setup) { 10396 pauseTracking(); 10397 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; 10398 const reset = setCurrentInstance(instance); 10399 const setupResult = callWithErrorHandling( 10400 setup, 10401 instance, 10402 0, 10403 [ 10404 true ? shallowReadonly(instance.props) : instance.props, 10405 setupContext 10406 ] 10407 ); 10408 const isAsyncSetup = isPromise(setupResult); 10409 resetTracking(); 10410 reset(); 10411 if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { 10412 markAsyncBoundary(instance); 10413 } 10414 if (isAsyncSetup) { 10415 setupResult.then(unsetCurrentInstance, unsetCurrentInstance); 10416 if (isSSR) { 10417 return setupResult.then((resolvedResult) => { 10418 handleSetupResult(instance, resolvedResult, isSSR); 10419 }).catch((e) => { 10420 handleError(e, instance, 0); 10421 }); 10422 } else { 10423 instance.asyncDep = setupResult; 10424 if (!instance.suspense) { 10425 const name = formatComponentName(instance, Component); 10426 warn$1( 10427 `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` 10428 ); 10429 } 10430 } 10431 } else { 10432 handleSetupResult(instance, setupResult, isSSR); 10433 } 10434 } else { 10435 finishComponentSetup(instance, isSSR); 10436 } 10437 } 10438 function handleSetupResult(instance, setupResult, isSSR) { 10439 if (isFunction(setupResult)) { 10440 if (instance.type.__ssrInlineRender) { 10441 instance.ssrRender = setupResult; 10442 } else { 10443 instance.render = setupResult; 10444 } 10445 } else if (isObject(setupResult)) { 10446 if (isVNode(setupResult)) { 10447 warn$1( 10448 `setup() should not return VNodes directly - return a render function instead.` 10449 ); 10450 } 10451 if (true) { 10452 instance.devtoolsRawSetupState = setupResult; 10453 } 10454 instance.setupState = proxyRefs(setupResult); 10455 if (true) { 10456 exposeSetupStateOnRenderContext(instance); 10457 } 10458 } else if (setupResult !== void 0) { 10459 warn$1( 10460 `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` 10461 ); 10462 } 10463 finishComponentSetup(instance, isSSR); 10464 } 10465 var compile; 10466 var installWithProxy; 10467 function registerRuntimeCompiler(_compile) { 10468 compile = _compile; 10469 installWithProxy = (i) => { 10470 if (i.render._rc) { 10471 i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); 10472 } 10473 }; 10474 } 10475 var isRuntimeOnly = () => !compile; 10476 function finishComponentSetup(instance, isSSR, skipOptions) { 10477 const Component = instance.type; 10478 if (!instance.render) { 10479 if (!isSSR && compile && !Component.render) { 10480 const template = Component.template || __VUE_OPTIONS_API__ && resolveMergedOptions(instance).template; 10481 if (template) { 10482 if (true) { 10483 startMeasure(instance, `compile`); 10484 } 10485 const { isCustomElement, compilerOptions } = instance.appContext.config; 10486 const { delimiters, compilerOptions: componentCompilerOptions } = Component; 10487 const finalCompilerOptions = extend( 10488 extend( 10489 { 10490 isCustomElement, 10491 delimiters 10492 }, 10493 compilerOptions 10494 ), 10495 componentCompilerOptions 10496 ); 10497 Component.render = compile(template, finalCompilerOptions); 10498 if (true) { 10499 endMeasure(instance, `compile`); 10500 } 10501 } 10502 } 10503 instance.render = Component.render || NOOP; 10504 if (installWithProxy) { 10505 installWithProxy(instance); 10506 } 10507 } 10508 if (__VUE_OPTIONS_API__ && true) { 10509 const reset = setCurrentInstance(instance); 10510 pauseTracking(); 10511 try { 10512 applyOptions(instance); 10513 } finally { 10514 resetTracking(); 10515 reset(); 10516 } 10517 } 10518 if (!Component.render && instance.render === NOOP && !isSSR) { 10519 if (!compile && Component.template) { 10520 warn$1( 10521 `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` 10522 ); 10523 } else { 10524 warn$1(`Component is missing template or render function: `, Component); 10525 } 10526 } 10527 } 10528 var attrsProxyHandlers = true ? { 10529 get(target, key) { 10530 markAttrsAccessed(); 10531 track(target, "get", ""); 10532 return target[key]; 10533 }, 10534 set() { 10535 warn$1(`setupContext.attrs is readonly.`); 10536 return false; 10537 }, 10538 deleteProperty() { 10539 warn$1(`setupContext.attrs is readonly.`); 10540 return false; 10541 } 10542 } : { 10543 get(target, key) { 10544 track(target, "get", ""); 10545 return target[key]; 10546 } 10547 }; 10548 function getSlotsProxy(instance) { 10549 return new Proxy(instance.slots, { 10550 get(target, key) { 10551 track(instance, "get", "$slots"); 10552 return target[key]; 10553 } 10554 }); 10555 } 10556 function createSetupContext(instance) { 10557 const expose = (exposed) => { 10558 if (true) { 10559 if (instance.exposed) { 10560 warn$1(`expose() should be called only once per setup().`); 10561 } 10562 if (exposed != null) { 10563 let exposedType = typeof exposed; 10564 if (exposedType === "object") { 10565 if (isArray(exposed)) { 10566 exposedType = "array"; 10567 } else if (isRef2(exposed)) { 10568 exposedType = "ref"; 10569 } 10570 } 10571 if (exposedType !== "object") { 10572 warn$1( 10573 `expose() should be passed a plain object, received ${exposedType}.` 10574 ); 10575 } 10576 } 10577 } 10578 instance.exposed = exposed || {}; 10579 }; 10580 if (true) { 10581 let attrsProxy; 10582 let slotsProxy; 10583 return Object.freeze({ 10584 get attrs() { 10585 return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); 10586 }, 10587 get slots() { 10588 return slotsProxy || (slotsProxy = getSlotsProxy(instance)); 10589 }, 10590 get emit() { 10591 return (event, ...args) => instance.emit(event, ...args); 10592 }, 10593 expose 10594 }); 10595 } else { 10596 return { 10597 attrs: new Proxy(instance.attrs, attrsProxyHandlers), 10598 slots: instance.slots, 10599 emit: instance.emit, 10600 expose 10601 }; 10602 } 10603 } 10604 function getComponentPublicInstance(instance) { 10605 if (instance.exposed) { 10606 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { 10607 get(target, key) { 10608 if (key in target) { 10609 return target[key]; 10610 } else if (key in publicPropertiesMap) { 10611 return publicPropertiesMap[key](instance); 10612 } 10613 }, 10614 has(target, key) { 10615 return key in target || key in publicPropertiesMap; 10616 } 10617 })); 10618 } else { 10619 return instance.proxy; 10620 } 10621 } 10622 var classifyRE = /(?:^|[-_])\w/g; 10623 var classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); 10624 function getComponentName(Component, includeInferred = true) { 10625 return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; 10626 } 10627 function formatComponentName(instance, Component, isRoot = false) { 10628 let name = getComponentName(Component); 10629 if (!name && Component.__file) { 10630 const match = Component.__file.match(/([^/\\]+)\.\w+$/); 10631 if (match) { 10632 name = match[1]; 10633 } 10634 } 10635 if (!name && instance) { 10636 const inferFromRegistry = (registry) => { 10637 for (const key in registry) { 10638 if (registry[key] === Component) { 10639 return key; 10640 } 10641 } 10642 }; 10643 name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry( 10644 instance.parent.type.components 10645 ) || inferFromRegistry(instance.appContext.components); 10646 } 10647 return name ? classify(name) : isRoot ? `App` : `Anonymous`; 10648 } 10649 function isClassComponent(value) { 10650 return isFunction(value) && "__vccOpts" in value; 10651 } 10652 var computed2 = (getterOrOptions, debugOptions) => { 10653 const c = computed(getterOrOptions, debugOptions, isInSSRComponentSetup); 10654 if (true) { 10655 const i = getCurrentInstance(); 10656 if (i && i.appContext.config.warnRecursiveComputed) { 10657 c._warnRecursive = true; 10658 } 10659 } 10660 return c; 10661 }; 10662 function h(type, propsOrChildren, children) { 10663 try { 10664 setBlockTracking(-1); 10665 const l = arguments.length; 10666 if (l === 2) { 10667 if (isObject(propsOrChildren) && !isArray(propsOrChildren)) { 10668 if (isVNode(propsOrChildren)) { 10669 return createVNode(type, null, [propsOrChildren]); 10670 } 10671 return createVNode(type, propsOrChildren); 10672 } else { 10673 return createVNode(type, null, propsOrChildren); 10674 } 10675 } else { 10676 if (l > 3) { 10677 children = Array.prototype.slice.call(arguments, 2); 10678 } else if (l === 3 && isVNode(children)) { 10679 children = [children]; 10680 } 10681 return createVNode(type, propsOrChildren, children); 10682 } 10683 } finally { 10684 setBlockTracking(1); 10685 } 10686 } 10687 function initCustomFormatter() { 10688 if (typeof window === "undefined") { 10689 return; 10690 } 10691 const vueStyle = { style: "color:#3ba776" }; 10692 const numberStyle = { style: "color:#1677ff" }; 10693 const stringStyle = { style: "color:#f5222d" }; 10694 const keywordStyle = { style: "color:#eb2f96" }; 10695 const formatter = { 10696 __vue_custom_formatter: true, 10697 header(obj) { 10698 if (!isObject(obj)) { 10699 return null; 10700 } 10701 if (obj.__isVue) { 10702 return ["div", vueStyle, `VueInstance`]; 10703 } else if (isRef2(obj)) { 10704 pauseTracking(); 10705 const value = obj.value; 10706 resetTracking(); 10707 return [ 10708 "div", 10709 {}, 10710 ["span", vueStyle, genRefFlag(obj)], 10711 "<", 10712 formatValue(value), 10713 `>` 10714 ]; 10715 } else if (isReactive(obj)) { 10716 return [ 10717 "div", 10718 {}, 10719 ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], 10720 "<", 10721 formatValue(obj), 10722 `>${isReadonly(obj) ? ` (readonly)` : ``}` 10723 ]; 10724 } else if (isReadonly(obj)) { 10725 return [ 10726 "div", 10727 {}, 10728 ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], 10729 "<", 10730 formatValue(obj), 10731 ">" 10732 ]; 10733 } 10734 return null; 10735 }, 10736 hasBody(obj) { 10737 return obj && obj.__isVue; 10738 }, 10739 body(obj) { 10740 if (obj && obj.__isVue) { 10741 return [ 10742 "div", 10743 {}, 10744 ...formatInstance(obj.$) 10745 ]; 10746 } 10747 } 10748 }; 10749 function formatInstance(instance) { 10750 const blocks = []; 10751 if (instance.type.props && instance.props) { 10752 blocks.push(createInstanceBlock("props", toRaw(instance.props))); 10753 } 10754 if (instance.setupState !== EMPTY_OBJ) { 10755 blocks.push(createInstanceBlock("setup", instance.setupState)); 10756 } 10757 if (instance.data !== EMPTY_OBJ) { 10758 blocks.push(createInstanceBlock("data", toRaw(instance.data))); 10759 } 10760 const computed3 = extractKeys(instance, "computed"); 10761 if (computed3) { 10762 blocks.push(createInstanceBlock("computed", computed3)); 10763 } 10764 const injected = extractKeys(instance, "inject"); 10765 if (injected) { 10766 blocks.push(createInstanceBlock("injected", injected)); 10767 } 10768 blocks.push([ 10769 "div", 10770 {}, 10771 [ 10772 "span", 10773 { 10774 style: keywordStyle.style + ";opacity:0.66" 10775 }, 10776 "$ (internal): " 10777 ], 10778 ["object", { object: instance }] 10779 ]); 10780 return blocks; 10781 } 10782 function createInstanceBlock(type, target) { 10783 target = extend({}, target); 10784 if (!Object.keys(target).length) { 10785 return ["span", {}]; 10786 } 10787 return [ 10788 "div", 10789 { style: "line-height:1.25em;margin-bottom:0.6em" }, 10790 [ 10791 "div", 10792 { 10793 style: "color:#476582" 10794 }, 10795 type 10796 ], 10797 [ 10798 "div", 10799 { 10800 style: "padding-left:1.25em" 10801 }, 10802 ...Object.keys(target).map((key) => { 10803 return [ 10804 "div", 10805 {}, 10806 ["span", keywordStyle, key + ": "], 10807 formatValue(target[key], false) 10808 ]; 10809 }) 10810 ] 10811 ]; 10812 } 10813 function formatValue(v, asRaw = true) { 10814 if (typeof v === "number") { 10815 return ["span", numberStyle, v]; 10816 } else if (typeof v === "string") { 10817 return ["span", stringStyle, JSON.stringify(v)]; 10818 } else if (typeof v === "boolean") { 10819 return ["span", keywordStyle, v]; 10820 } else if (isObject(v)) { 10821 return ["object", { object: asRaw ? toRaw(v) : v }]; 10822 } else { 10823 return ["span", stringStyle, String(v)]; 10824 } 10825 } 10826 function extractKeys(instance, type) { 10827 const Comp = instance.type; 10828 if (isFunction(Comp)) { 10829 return; 10830 } 10831 const extracted = {}; 10832 for (const key in instance.ctx) { 10833 if (isKeyOfType(Comp, key, type)) { 10834 extracted[key] = instance.ctx[key]; 10835 } 10836 } 10837 return extracted; 10838 } 10839 function isKeyOfType(Comp, key, type) { 10840 const opts = Comp[type]; 10841 if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) { 10842 return true; 10843 } 10844 if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { 10845 return true; 10846 } 10847 if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { 10848 return true; 10849 } 10850 } 10851 function genRefFlag(v) { 10852 if (isShallow(v)) { 10853 return `ShallowRef`; 10854 } 10855 if (v.effect) { 10856 return `ComputedRef`; 10857 } 10858 return `Ref`; 10859 } 10860 if (window.devtoolsFormatters) { 10861 window.devtoolsFormatters.push(formatter); 10862 } else { 10863 window.devtoolsFormatters = [formatter]; 10864 } 10865 } 10866 function withMemo(memo, render2, cache, index) { 10867 const cached = cache[index]; 10868 if (cached && isMemoSame(cached, memo)) { 10869 return cached; 10870 } 10871 const ret = render2(); 10872 ret.memo = memo.slice(); 10873 ret.cacheIndex = index; 10874 return cache[index] = ret; 10875 } 10876 function isMemoSame(cached, memo) { 10877 const prev = cached.memo; 10878 if (prev.length != memo.length) { 10879 return false; 10880 } 10881 for (let i = 0; i < prev.length; i++) { 10882 if (hasChanged(prev[i], memo[i])) { 10883 return false; 10884 } 10885 } 10886 if (isBlockTreeEnabled > 0 && currentBlock) { 10887 currentBlock.push(cached); 10888 } 10889 return true; 10890 } 10891 var version = "3.5.39"; 10892 var warn2 = true ? warn$1 : NOOP; 10893 var ErrorTypeStrings = ErrorTypeStrings$1; 10894 var devtools = true ? devtools$1 : void 0; 10895 var setDevtoolsHook = true ? setDevtoolsHook$1 : NOOP; 10896 var _ssrUtils = { 10897 createComponentInstance, 10898 setupComponent, 10899 renderComponentRoot, 10900 setCurrentRenderingInstance, 10901 isVNode, 10902 normalizeVNode, 10903 getComponentPublicInstance, 10904 ensureValidVNode, 10905 pushWarningContext, 10906 popWarningContext 10907 }; 10908 var ssrUtils = _ssrUtils; 10909 var resolveFilter = null; 10910 var compatUtils = null; 10911 var DeprecationTypes = null; 10912 10913 // node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js 10914 var policy = void 0; 10915 var tt = typeof window !== "undefined" && window.trustedTypes; 10916 if (tt) { 10917 try { 10918 policy = tt.createPolicy("vue", { 10919 createHTML: (val) => val 10920 }); 10921 } catch (e) { 10922 warn2(`Error creating trusted types policy: ${e}`); 10923 } 10924 } 10925 var unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; 10926 var svgNS = "http://www.w3.org/2000/svg"; 10927 var mathmlNS = "http://www.w3.org/1998/Math/MathML"; 10928 var doc = typeof document !== "undefined" ? document : null; 10929 var templateContainer = doc && doc.createElement("template"); 10930 var nodeOps = { 10931 insert: (child, parent, anchor) => { 10932 parent.insertBefore(child, anchor || null); 10933 }, 10934 remove: (child) => { 10935 const parent = child.parentNode; 10936 if (parent) { 10937 parent.removeChild(child); 10938 } 10939 }, 10940 createElement: (tag, namespace, is, props) => { 10941 const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); 10942 if (tag === "select" && props && props.multiple != null) { 10943 el.setAttribute("multiple", props.multiple); 10944 } 10945 return el; 10946 }, 10947 createText: (text) => doc.createTextNode(text), 10948 createComment: (text) => doc.createComment(text), 10949 setText: (node, text) => { 10950 node.nodeValue = text; 10951 }, 10952 setElementText: (el, text) => { 10953 el.textContent = text; 10954 }, 10955 parentNode: (node) => node.parentNode, 10956 nextSibling: (node) => node.nextSibling, 10957 querySelector: (selector) => doc.querySelector(selector), 10958 setScopeId(el, id) { 10959 el.setAttribute(id, ""); 10960 }, 10961 // __UNSAFE__ 10962 // Reason: innerHTML. 10963 // Static content here can only come from compiled templates. 10964 // As long as the user only uses trusted templates, this is safe. 10965 insertStaticContent(content, parent, anchor, namespace, start, end) { 10966 const before = anchor ? anchor.previousSibling : parent.lastChild; 10967 if (start && (start === end || start.nextSibling)) { 10968 while (true) { 10969 parent.insertBefore(start.cloneNode(true), anchor); 10970 if (start === end || !(start = start.nextSibling)) break; 10971 } 10972 } else { 10973 templateContainer.innerHTML = unsafeToTrustedHTML( 10974 namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content 10975 ); 10976 const template = templateContainer.content; 10977 if (namespace === "svg" || namespace === "mathml") { 10978 const wrapper = template.firstChild; 10979 while (wrapper.firstChild) { 10980 template.appendChild(wrapper.firstChild); 10981 } 10982 template.removeChild(wrapper); 10983 } 10984 parent.insertBefore(template, anchor); 10985 } 10986 return [ 10987 // first 10988 before ? before.nextSibling : parent.firstChild, 10989 // last 10990 anchor ? anchor.previousSibling : parent.lastChild 10991 ]; 10992 } 10993 }; 10994 var TRANSITION = "transition"; 10995 var ANIMATION = "animation"; 10996 var vtcKey = /* @__PURE__ */ Symbol("_vtc"); 10997 var DOMTransitionPropsValidators = { 10998 name: String, 10999 type: String, 11000 css: { 11001 type: Boolean, 11002 default: true 11003 }, 11004 duration: [String, Number, Object], 11005 enterFromClass: String, 11006 enterActiveClass: String, 11007 enterToClass: String, 11008 appearFromClass: String, 11009 appearActiveClass: String, 11010 appearToClass: String, 11011 leaveFromClass: String, 11012 leaveActiveClass: String, 11013 leaveToClass: String 11014 }; 11015 var TransitionPropsValidators = extend( 11016 {}, 11017 BaseTransitionPropsValidators, 11018 DOMTransitionPropsValidators 11019 ); 11020 var decorate$1 = (t) => { 11021 t.displayName = "Transition"; 11022 t.props = TransitionPropsValidators; 11023 return t; 11024 }; 11025 var Transition = decorate$1( 11026 (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots) 11027 ); 11028 var callHook2 = (hook, args = []) => { 11029 if (isArray(hook)) { 11030 hook.forEach((h2) => h2(...args)); 11031 } else if (hook) { 11032 hook(...args); 11033 } 11034 }; 11035 var hasExplicitCallback = (hook) => { 11036 return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; 11037 }; 11038 function resolveTransitionProps(rawProps) { 11039 const baseProps = {}; 11040 for (const key in rawProps) { 11041 if (!(key in DOMTransitionPropsValidators)) { 11042 baseProps[key] = rawProps[key]; 11043 } 11044 } 11045 if (rawProps.css === false) { 11046 return baseProps; 11047 } 11048 const { 11049 name = "v", 11050 type, 11051 duration, 11052 enterFromClass = `${name}-enter-from`, 11053 enterActiveClass = `${name}-enter-active`, 11054 enterToClass = `${name}-enter-to`, 11055 appearFromClass = enterFromClass, 11056 appearActiveClass = enterActiveClass, 11057 appearToClass = enterToClass, 11058 leaveFromClass = `${name}-leave-from`, 11059 leaveActiveClass = `${name}-leave-active`, 11060 leaveToClass = `${name}-leave-to` 11061 } = rawProps; 11062 const durations = normalizeDuration(duration); 11063 const enterDuration = durations && durations[0]; 11064 const leaveDuration = durations && durations[1]; 11065 const { 11066 onBeforeEnter, 11067 onEnter, 11068 onEnterCancelled, 11069 onLeave, 11070 onLeaveCancelled, 11071 onBeforeAppear = onBeforeEnter, 11072 onAppear = onEnter, 11073 onAppearCancelled = onEnterCancelled 11074 } = baseProps; 11075 const finishEnter = (el, isAppear, done, isCancelled) => { 11076 el._enterCancelled = isCancelled; 11077 removeTransitionClass(el, isAppear ? appearToClass : enterToClass); 11078 removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); 11079 done && done(); 11080 }; 11081 const finishLeave = (el, done) => { 11082 el._isLeaving = false; 11083 removeTransitionClass(el, leaveFromClass); 11084 removeTransitionClass(el, leaveToClass); 11085 removeTransitionClass(el, leaveActiveClass); 11086 done && done(); 11087 }; 11088 const makeEnterHook = (isAppear) => { 11089 return (el, done) => { 11090 const hook = isAppear ? onAppear : onEnter; 11091 const resolve2 = () => finishEnter(el, isAppear, done); 11092 callHook2(hook, [el, resolve2]); 11093 nextFrame(() => { 11094 removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); 11095 addTransitionClass(el, isAppear ? appearToClass : enterToClass); 11096 if (!hasExplicitCallback(hook)) { 11097 whenTransitionEnds(el, type, enterDuration, resolve2); 11098 } 11099 }); 11100 }; 11101 }; 11102 return extend(baseProps, { 11103 onBeforeEnter(el) { 11104 callHook2(onBeforeEnter, [el]); 11105 addTransitionClass(el, enterFromClass); 11106 addTransitionClass(el, enterActiveClass); 11107 }, 11108 onBeforeAppear(el) { 11109 callHook2(onBeforeAppear, [el]); 11110 addTransitionClass(el, appearFromClass); 11111 addTransitionClass(el, appearActiveClass); 11112 }, 11113 onEnter: makeEnterHook(false), 11114 onAppear: makeEnterHook(true), 11115 onLeave(el, done) { 11116 el._isLeaving = true; 11117 const resolve2 = () => finishLeave(el, done); 11118 addTransitionClass(el, leaveFromClass); 11119 if (!el._enterCancelled) { 11120 forceReflow(el); 11121 addTransitionClass(el, leaveActiveClass); 11122 } else { 11123 addTransitionClass(el, leaveActiveClass); 11124 forceReflow(el); 11125 } 11126 nextFrame(() => { 11127 if (!el._isLeaving) { 11128 return; 11129 } 11130 removeTransitionClass(el, leaveFromClass); 11131 addTransitionClass(el, leaveToClass); 11132 if (!hasExplicitCallback(onLeave)) { 11133 whenTransitionEnds(el, type, leaveDuration, resolve2); 11134 } 11135 }); 11136 callHook2(onLeave, [el, resolve2]); 11137 }, 11138 onEnterCancelled(el) { 11139 finishEnter(el, false, void 0, true); 11140 callHook2(onEnterCancelled, [el]); 11141 }, 11142 onAppearCancelled(el) { 11143 finishEnter(el, true, void 0, true); 11144 callHook2(onAppearCancelled, [el]); 11145 }, 11146 onLeaveCancelled(el) { 11147 finishLeave(el); 11148 callHook2(onLeaveCancelled, [el]); 11149 } 11150 }); 11151 } 11152 function normalizeDuration(duration) { 11153 if (duration == null) { 11154 return null; 11155 } else if (isObject(duration)) { 11156 return [NumberOf(duration.enter), NumberOf(duration.leave)]; 11157 } else { 11158 const n = NumberOf(duration); 11159 return [n, n]; 11160 } 11161 } 11162 function NumberOf(val) { 11163 const res = toNumber(val); 11164 if (true) { 11165 assertNumber(res, "<transition> explicit duration"); 11166 } 11167 return res; 11168 } 11169 function addTransitionClass(el, cls) { 11170 cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); 11171 (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); 11172 } 11173 function removeTransitionClass(el, cls) { 11174 cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); 11175 const _vtc = el[vtcKey]; 11176 if (_vtc) { 11177 _vtc.delete(cls); 11178 if (!_vtc.size) { 11179 el[vtcKey] = void 0; 11180 } 11181 } 11182 } 11183 function nextFrame(cb) { 11184 requestAnimationFrame(() => { 11185 requestAnimationFrame(cb); 11186 }); 11187 } 11188 var endId = 0; 11189 function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) { 11190 const id = el._endId = ++endId; 11191 const resolveIfNotStale = () => { 11192 if (id === el._endId) { 11193 resolve2(); 11194 } 11195 }; 11196 if (explicitTimeout != null) { 11197 return setTimeout(resolveIfNotStale, explicitTimeout); 11198 } 11199 const { type, timeout, propCount } = getTransitionInfo(el, expectedType); 11200 if (!type) { 11201 return resolve2(); 11202 } 11203 const endEvent = type + "end"; 11204 let ended = 0; 11205 const end = () => { 11206 el.removeEventListener(endEvent, onEnd); 11207 resolveIfNotStale(); 11208 }; 11209 const onEnd = (e) => { 11210 if (e.target === el && ++ended >= propCount) { 11211 end(); 11212 } 11213 }; 11214 setTimeout(() => { 11215 if (ended < propCount) { 11216 end(); 11217 } 11218 }, timeout + 1); 11219 el.addEventListener(endEvent, onEnd); 11220 } 11221 function getTransitionInfo(el, expectedType) { 11222 const styles = window.getComputedStyle(el); 11223 const getStyleProperties = (key) => (styles[key] || "").split(", "); 11224 const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); 11225 const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); 11226 const transitionTimeout = getTimeout(transitionDelays, transitionDurations); 11227 const animationDelays = getStyleProperties(`${ANIMATION}Delay`); 11228 const animationDurations = getStyleProperties(`${ANIMATION}Duration`); 11229 const animationTimeout = getTimeout(animationDelays, animationDurations); 11230 let type = null; 11231 let timeout = 0; 11232 let propCount = 0; 11233 if (expectedType === TRANSITION) { 11234 if (transitionTimeout > 0) { 11235 type = TRANSITION; 11236 timeout = transitionTimeout; 11237 propCount = transitionDurations.length; 11238 } 11239 } else if (expectedType === ANIMATION) { 11240 if (animationTimeout > 0) { 11241 type = ANIMATION; 11242 timeout = animationTimeout; 11243 propCount = animationDurations.length; 11244 } 11245 } else { 11246 timeout = Math.max(transitionTimeout, animationTimeout); 11247 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; 11248 propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; 11249 } 11250 const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test( 11251 getStyleProperties(`${TRANSITION}Property`).toString() 11252 ); 11253 return { 11254 type, 11255 timeout, 11256 propCount, 11257 hasTransform 11258 }; 11259 } 11260 function getTimeout(delays, durations) { 11261 while (delays.length < durations.length) { 11262 delays = delays.concat(delays); 11263 } 11264 return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); 11265 } 11266 function toMs(s) { 11267 if (s === "auto") return 0; 11268 return Number(s.slice(0, -1).replace(",", ".")) * 1e3; 11269 } 11270 function forceReflow(el) { 11271 const targetDocument = el ? el.ownerDocument : document; 11272 return targetDocument.body.offsetHeight; 11273 } 11274 function patchClass(el, value, isSVG) { 11275 const transitionClasses = el[vtcKey]; 11276 if (transitionClasses) { 11277 value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); 11278 } 11279 if (value == null) { 11280 el.removeAttribute("class"); 11281 } else if (isSVG) { 11282 el.setAttribute("class", value); 11283 } else { 11284 el.className = value; 11285 } 11286 } 11287 var vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod"); 11288 var vShowHidden = /* @__PURE__ */ Symbol("_vsh"); 11289 var vShow = { 11290 // used for prop mismatch check during hydration 11291 name: "show", 11292 beforeMount(el, { value }, { transition }) { 11293 el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; 11294 if (transition && value) { 11295 transition.beforeEnter(el); 11296 } else { 11297 setDisplay(el, value); 11298 } 11299 }, 11300 mounted(el, { value }, { transition }) { 11301 if (transition && value) { 11302 transition.enter(el); 11303 } 11304 }, 11305 updated(el, { value, oldValue }, { transition }) { 11306 if (!value === !oldValue) return; 11307 if (transition) { 11308 if (value) { 11309 transition.beforeEnter(el); 11310 setDisplay(el, true); 11311 transition.enter(el); 11312 } else { 11313 transition.leave(el, () => { 11314 setDisplay(el, false); 11315 }); 11316 } 11317 } else { 11318 setDisplay(el, value); 11319 } 11320 }, 11321 beforeUnmount(el, { value }) { 11322 setDisplay(el, value); 11323 } 11324 }; 11325 function setDisplay(el, value) { 11326 el.style.display = value ? el[vShowOriginalDisplay] : "none"; 11327 el[vShowHidden] = !value; 11328 } 11329 function initVShowForSSR() { 11330 vShow.getSSRProps = ({ value }) => { 11331 if (!value) { 11332 return { style: { display: "none" } }; 11333 } 11334 }; 11335 } 11336 var CSS_VAR_TEXT = /* @__PURE__ */ Symbol(true ? "CSS_VAR_TEXT" : ""); 11337 function useCssVars(getter) { 11338 const instance = getCurrentInstance(); 11339 if (!instance) { 11340 warn2(`useCssVars is called without current active component instance.`); 11341 return; 11342 } 11343 const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { 11344 Array.from( 11345 document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) 11346 ).forEach((node) => setVarsOnNode(node, vars)); 11347 }; 11348 if (true) { 11349 instance.getCssVars = () => getter(instance.proxy); 11350 } 11351 const setVars = () => { 11352 const vars = getter(instance.proxy); 11353 if (instance.ce) { 11354 setVarsOnNode(instance.ce, vars); 11355 } else { 11356 setVarsOnVNode(instance.subTree, vars); 11357 } 11358 updateTeleports(vars); 11359 }; 11360 onBeforeUpdate(() => { 11361 queuePostFlushCb(setVars); 11362 }); 11363 onMounted(() => { 11364 watch2(setVars, NOOP, { flush: "post" }); 11365 const ob = new MutationObserver(setVars); 11366 ob.observe(instance.subTree.el.parentNode, { childList: true }); 11367 onUnmounted(() => ob.disconnect()); 11368 }); 11369 } 11370 function setVarsOnVNode(vnode, vars) { 11371 if (vnode.shapeFlag & 128) { 11372 const suspense = vnode.suspense; 11373 vnode = suspense.activeBranch; 11374 if (suspense.pendingBranch && !suspense.isHydrating) { 11375 suspense.effects.push(() => { 11376 setVarsOnVNode(suspense.activeBranch, vars); 11377 }); 11378 } 11379 } 11380 while (vnode.component) { 11381 vnode = vnode.component.subTree; 11382 } 11383 if (vnode.shapeFlag & 1 && vnode.el) { 11384 setVarsOnNode(vnode.el, vars); 11385 } else if (vnode.type === Fragment) { 11386 vnode.children.forEach((c) => setVarsOnVNode(c, vars)); 11387 } else if (vnode.type === Static) { 11388 let { el, anchor } = vnode; 11389 while (el) { 11390 setVarsOnNode(el, vars); 11391 if (el === anchor) break; 11392 el = el.nextSibling; 11393 } 11394 } 11395 } 11396 function setVarsOnNode(el, vars) { 11397 if (el.nodeType === 1) { 11398 const style = el.style; 11399 let cssText = ""; 11400 for (const key in vars) { 11401 const value = normalizeCssVarValue(vars[key]); 11402 style.setProperty(`--${key}`, value); 11403 cssText += `--${key}: ${value};`; 11404 } 11405 style[CSS_VAR_TEXT] = cssText; 11406 } 11407 } 11408 var displayRE = /(?:^|;)\s*display\s*:/; 11409 function patchStyle(el, prev, next) { 11410 const style = el.style; 11411 const isCssString = isString(next); 11412 let hasControlledDisplay = false; 11413 if (next && !isCssString) { 11414 if (prev) { 11415 if (!isString(prev)) { 11416 for (const key in prev) { 11417 if (next[key] == null) { 11418 setStyle(style, key, ""); 11419 } 11420 } 11421 } else { 11422 for (const prevStyle of prev.split(";")) { 11423 const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); 11424 if (next[key] == null) { 11425 setStyle(style, key, ""); 11426 } 11427 } 11428 } 11429 } 11430 for (const key in next) { 11431 if (key === "display") { 11432 hasControlledDisplay = true; 11433 } 11434 const value = next[key]; 11435 if (value != null) { 11436 if (!shouldPreserveTextareaResizeStyle( 11437 el, 11438 key, 11439 !isString(prev) && prev ? prev[key] : void 0, 11440 value 11441 )) { 11442 setStyle(style, key, value); 11443 } 11444 } else { 11445 setStyle(style, key, ""); 11446 } 11447 } 11448 } else { 11449 if (isCssString) { 11450 if (prev !== next) { 11451 const cssVarText = style[CSS_VAR_TEXT]; 11452 if (cssVarText) { 11453 next += ";" + cssVarText; 11454 } 11455 style.cssText = next; 11456 hasControlledDisplay = displayRE.test(next); 11457 } 11458 } else if (prev) { 11459 el.removeAttribute("style"); 11460 } 11461 } 11462 if (vShowOriginalDisplay in el) { 11463 el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; 11464 if (el[vShowHidden]) { 11465 style.display = "none"; 11466 } 11467 } 11468 } 11469 var semicolonRE = /[^\\];\s*$/; 11470 var importantRE = /\s*!important$/; 11471 function setStyle(style, name, val) { 11472 if (isArray(val)) { 11473 val.forEach((v) => setStyle(style, name, v)); 11474 } else { 11475 if (val == null) val = ""; 11476 if (true) { 11477 if (semicolonRE.test(val)) { 11478 warn2( 11479 `Unexpected semicolon at the end of '${name}' style value: '${val}'` 11480 ); 11481 } 11482 } 11483 if (name.startsWith("--")) { 11484 style.setProperty(name, val); 11485 } else { 11486 const prefixed = autoPrefix(style, name); 11487 if (importantRE.test(val)) { 11488 style.setProperty( 11489 hyphenate(prefixed), 11490 val.replace(importantRE, ""), 11491 "important" 11492 ); 11493 } else { 11494 style[prefixed] = val; 11495 } 11496 } 11497 } 11498 } 11499 var prefixes = ["Webkit", "Moz", "ms"]; 11500 var prefixCache = {}; 11501 function autoPrefix(style, rawName) { 11502 const cached = prefixCache[rawName]; 11503 if (cached) { 11504 return cached; 11505 } 11506 let name = camelize(rawName); 11507 if (name !== "filter" && name in style) { 11508 return prefixCache[rawName] = name; 11509 } 11510 name = capitalize(name); 11511 for (let i = 0; i < prefixes.length; i++) { 11512 const prefixed = prefixes[i] + name; 11513 if (prefixed in style) { 11514 return prefixCache[rawName] = prefixed; 11515 } 11516 } 11517 return rawName; 11518 } 11519 function shouldPreserveTextareaResizeStyle(el, key, prev, next) { 11520 return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next; 11521 } 11522 var xlinkNS = "http://www.w3.org/1999/xlink"; 11523 function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) { 11524 if (isSVG && key.startsWith("xlink:")) { 11525 if (value == null) { 11526 el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); 11527 } else { 11528 el.setAttributeNS(xlinkNS, key, value); 11529 } 11530 } else { 11531 if (value == null || isBoolean && !includeBooleanAttr(value)) { 11532 el.removeAttribute(key); 11533 } else { 11534 el.setAttribute( 11535 key, 11536 isBoolean ? "" : isSymbol(value) ? String(value) : value 11537 ); 11538 } 11539 } 11540 } 11541 function patchDOMProp(el, key, value, parentComponent, attrName) { 11542 if (key === "innerHTML" || key === "textContent") { 11543 if (value != null) { 11544 el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; 11545 } 11546 return; 11547 } 11548 const tag = el.tagName; 11549 if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally 11550 !tag.includes("-")) { 11551 const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; 11552 const newValue = value == null ? ( 11553 // #11647: value should be set as empty string for null and undefined, 11554 // but <input type="checkbox"> should be set as 'on'. 11555 el.type === "checkbox" ? "on" : "" 11556 ) : String(value); 11557 if (oldValue !== newValue || !("_value" in el)) { 11558 el.value = newValue; 11559 } 11560 if (value == null) { 11561 el.removeAttribute(key); 11562 } 11563 el._value = value; 11564 return; 11565 } 11566 let needRemove = false; 11567 if (value === "" || value == null) { 11568 const type = typeof el[key]; 11569 if (type === "boolean") { 11570 value = includeBooleanAttr(value); 11571 } else if (value == null && type === "string") { 11572 value = ""; 11573 needRemove = true; 11574 } else if (type === "number") { 11575 value = 0; 11576 needRemove = true; 11577 } 11578 } 11579 try { 11580 el[key] = value; 11581 } catch (e) { 11582 if (!needRemove) { 11583 warn2( 11584 `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, 11585 e 11586 ); 11587 } 11588 } 11589 needRemove && el.removeAttribute(attrName || key); 11590 } 11591 function addEventListener(el, event, handler, options) { 11592 el.addEventListener(event, handler, options); 11593 } 11594 function removeEventListener(el, event, handler, options) { 11595 el.removeEventListener(event, handler, options); 11596 } 11597 var veiKey = /* @__PURE__ */ Symbol("_vei"); 11598 function patchEvent(el, rawName, prevValue, nextValue, instance = null) { 11599 const invokers = el[veiKey] || (el[veiKey] = {}); 11600 const existingInvoker = invokers[rawName]; 11601 if (nextValue && existingInvoker) { 11602 existingInvoker.value = true ? sanitizeEventValue(nextValue, rawName) : nextValue; 11603 } else { 11604 const [name, options] = parseName(rawName); 11605 if (nextValue) { 11606 const invoker = invokers[rawName] = createInvoker( 11607 true ? sanitizeEventValue(nextValue, rawName) : nextValue, 11608 instance 11609 ); 11610 addEventListener(el, name, invoker, options); 11611 } else if (existingInvoker) { 11612 removeEventListener(el, name, existingInvoker, options); 11613 invokers[rawName] = void 0; 11614 } 11615 } 11616 } 11617 var optionsModifierRE = /(Once|Passive|Capture)$/; 11618 var optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/; 11619 function parseName(name) { 11620 let options; 11621 let m; 11622 while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) { 11623 if (!options) options = {}; 11624 name = name.slice(0, name.length - m[1].length); 11625 options[m[1].toLowerCase()] = true; 11626 } 11627 const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); 11628 return [event, options]; 11629 } 11630 var cachedNow = 0; 11631 var p = Promise.resolve(); 11632 var getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); 11633 function createInvoker(initialValue, instance) { 11634 const invoker = (e) => { 11635 if (!e._vts) { 11636 e._vts = Date.now(); 11637 } else if (e._vts <= invoker.attached) { 11638 return; 11639 } 11640 const value = invoker.value; 11641 if (isArray(value)) { 11642 const originalStop = e.stopImmediatePropagation; 11643 e.stopImmediatePropagation = () => { 11644 originalStop.call(e); 11645 e._stopped = true; 11646 }; 11647 const handlers = value.slice(); 11648 const args = [e]; 11649 for (let i = 0; i < handlers.length; i++) { 11650 if (e._stopped) { 11651 break; 11652 } 11653 const handler = handlers[i]; 11654 if (handler) { 11655 callWithAsyncErrorHandling( 11656 handler, 11657 instance, 11658 5, 11659 args 11660 ); 11661 } 11662 } 11663 } else { 11664 callWithAsyncErrorHandling( 11665 value, 11666 instance, 11667 5, 11668 [e] 11669 ); 11670 } 11671 }; 11672 invoker.value = initialValue; 11673 invoker.attached = getNow(); 11674 return invoker; 11675 } 11676 function sanitizeEventValue(value, propName) { 11677 if (isFunction(value) || isArray(value)) { 11678 return value; 11679 } 11680 warn2( 11681 `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? 11682 Expected function or array of functions, received type ${typeof value}.` 11683 ); 11684 return NOOP; 11685 } 11686 var isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter 11687 key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; 11688 var patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { 11689 const isSVG = namespace === "svg"; 11690 if (key === "class") { 11691 patchClass(el, nextValue, isSVG); 11692 } else if (key === "style") { 11693 patchStyle(el, prevValue, nextValue); 11694 } else if (isOn(key)) { 11695 if (!isModelListener(key)) { 11696 patchEvent(el, key, prevValue, nextValue, parentComponent); 11697 } 11698 } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { 11699 patchDOMProp(el, key, nextValue); 11700 if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { 11701 patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); 11702 } 11703 } else if ( 11704 // #11081 force set props for possible async custom element 11705 el._isVueCE && // #12408 check if it's declared prop or it's async custom element 11706 (shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private 11707 el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue))) 11708 ) { 11709 patchDOMProp(el, camelize(key), nextValue, parentComponent, key); 11710 } else { 11711 if (key === "true-value") { 11712 el._trueValue = nextValue; 11713 } else if (key === "false-value") { 11714 el._falseValue = nextValue; 11715 } 11716 patchAttr(el, key, nextValue, isSVG); 11717 } 11718 }; 11719 function shouldSetAsProp(el, key, value, isSVG) { 11720 if (isSVG) { 11721 if (key === "innerHTML" || key === "textContent") { 11722 return true; 11723 } 11724 if (key in el && isNativeOn(key) && isFunction(value)) { 11725 return true; 11726 } 11727 return false; 11728 } 11729 if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") { 11730 return false; 11731 } 11732 if (key === "sandbox" && el.tagName === "IFRAME") { 11733 return false; 11734 } 11735 if (key === "form") { 11736 return false; 11737 } 11738 if (key === "list" && el.tagName === "INPUT") { 11739 return false; 11740 } 11741 if (key === "type" && el.tagName === "TEXTAREA") { 11742 return false; 11743 } 11744 if (key === "width" || key === "height") { 11745 const tag = el.tagName; 11746 if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { 11747 return false; 11748 } 11749 } 11750 if (isNativeOn(key) && isString(value)) { 11751 return false; 11752 } 11753 return key in el; 11754 } 11755 function shouldSetAsPropForVueCE(el, key) { 11756 const props = ( 11757 // @ts-expect-error _def is private 11758 el._def.props 11759 ); 11760 if (!props) { 11761 return false; 11762 } 11763 const camelKey = camelize(key); 11764 return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey); 11765 } 11766 var REMOVAL = {}; 11767 function defineCustomElement(options, extraOptions, _createApp) { 11768 let Comp = defineComponent(options, extraOptions); 11769 if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions); 11770 class VueCustomElement extends VueElement { 11771 constructor(initialProps) { 11772 super(Comp, initialProps, _createApp); 11773 } 11774 } 11775 VueCustomElement.def = Comp; 11776 return VueCustomElement; 11777 } 11778 var defineSSRCustomElement = ((options, extraOptions) => { 11779 return defineCustomElement(options, extraOptions, createSSRApp); 11780 }); 11781 var BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { 11782 }; 11783 var VueElement = class _VueElement extends BaseClass { 11784 constructor(_def, _props = {}, _createApp = createApp) { 11785 super(); 11786 this._def = _def; 11787 this._props = _props; 11788 this._createApp = _createApp; 11789 this._isVueCE = true; 11790 this._instance = null; 11791 this._app = null; 11792 this._nonce = this._def.nonce; 11793 this._connected = false; 11794 this._resolved = false; 11795 this._patching = false; 11796 this._dirty = false; 11797 this._numberProps = null; 11798 this._styleChildren = /* @__PURE__ */ new WeakSet(); 11799 this._styleAnchors = /* @__PURE__ */ new WeakMap(); 11800 this._ob = null; 11801 if (this.shadowRoot && _createApp !== createApp) { 11802 this._root = this.shadowRoot; 11803 } else { 11804 if (this.shadowRoot) { 11805 warn2( 11806 `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` 11807 ); 11808 } 11809 if (_def.shadowRoot !== false) { 11810 this.attachShadow( 11811 extend({}, _def.shadowRootOptions, { 11812 mode: "open" 11813 }) 11814 ); 11815 this._root = this.shadowRoot; 11816 } else { 11817 this._root = this; 11818 } 11819 } 11820 } 11821 connectedCallback() { 11822 if (!this.isConnected) return; 11823 if (!this.shadowRoot && !this._resolved) { 11824 this._parseSlots(); 11825 } 11826 this._connected = true; 11827 let parent = this; 11828 while (parent = parent && // #12479 should check assignedSlot first to get correct parent 11829 (parent.assignedSlot || parent.parentNode || parent.host)) { 11830 if (parent instanceof _VueElement) { 11831 this._parent = parent; 11832 break; 11833 } 11834 } 11835 if (!this._instance) { 11836 if (this._resolved) { 11837 this._mount(this._def); 11838 } else { 11839 if (parent && parent._pendingResolve) { 11840 this._pendingResolve = parent._pendingResolve.then(() => { 11841 this._pendingResolve = void 0; 11842 this._resolveDef(); 11843 }); 11844 } else { 11845 this._resolveDef(); 11846 } 11847 } 11848 } 11849 } 11850 _setParent(parent = this._parent) { 11851 if (parent) { 11852 this._instance.parent = parent._instance; 11853 this._inheritParentContext(parent); 11854 } 11855 } 11856 _inheritParentContext(parent = this._parent) { 11857 if (parent && this._app) { 11858 Object.setPrototypeOf( 11859 this._app._context.provides, 11860 parent._instance.provides 11861 ); 11862 } 11863 } 11864 disconnectedCallback() { 11865 this._connected = false; 11866 nextTick(() => { 11867 if (!this._connected) { 11868 if (this._ob) { 11869 this._ob.disconnect(); 11870 this._ob = null; 11871 } 11872 this._app && this._app.unmount(); 11873 if (this._instance) this._instance.ce = void 0; 11874 this._app = this._instance = null; 11875 if (this._teleportTargets) { 11876 this._teleportTargets.clear(); 11877 this._teleportTargets = void 0; 11878 } 11879 } 11880 }); 11881 } 11882 _processMutations(mutations) { 11883 for (const m of mutations) { 11884 this._setAttr(m.attributeName); 11885 } 11886 } 11887 /** 11888 * resolve inner component definition (handle possible async component) 11889 */ 11890 _resolveDef() { 11891 if (this._pendingResolve) { 11892 return; 11893 } 11894 for (let i = 0; i < this.attributes.length; i++) { 11895 this._setAttr(this.attributes[i].name); 11896 } 11897 this._ob = new MutationObserver(this._processMutations.bind(this)); 11898 this._ob.observe(this, { attributes: true }); 11899 const resolve2 = (def2, isAsync = false) => { 11900 this._resolved = true; 11901 this._pendingResolve = void 0; 11902 const { props, styles } = def2; 11903 let numberProps; 11904 if (props && !isArray(props)) { 11905 for (const key in props) { 11906 const opt = props[key]; 11907 if (opt === Number || opt && opt.type === Number) { 11908 if (key in this._props) { 11909 this._props[key] = toNumber(this._props[key]); 11910 } 11911 (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true; 11912 } 11913 } 11914 } 11915 this._numberProps = numberProps; 11916 this._resolveProps(def2); 11917 if (this.shadowRoot) { 11918 this._applyStyles(styles); 11919 } else if (styles) { 11920 warn2( 11921 "Custom element style injection is not supported when using shadowRoot: false" 11922 ); 11923 } 11924 this._mount(def2); 11925 }; 11926 const asyncDef = this._def.__asyncLoader; 11927 if (asyncDef) { 11928 this._pendingResolve = asyncDef().then((def2) => { 11929 def2.configureApp = this._def.configureApp; 11930 resolve2(this._def = def2, true); 11931 }); 11932 } else { 11933 resolve2(this._def); 11934 } 11935 } 11936 _mount(def2) { 11937 if (!def2.name) { 11938 def2.name = "VueElement"; 11939 } 11940 this._app = this._createApp(def2); 11941 this._inheritParentContext(); 11942 if (def2.configureApp) { 11943 def2.configureApp(this._app); 11944 } 11945 this._app._ceVNode = this._createVNode(); 11946 this._app.mount(this._root); 11947 const exposed = this._instance && this._instance.exposed; 11948 if (!exposed) return; 11949 for (const key in exposed) { 11950 if (!hasOwn(this, key)) { 11951 Object.defineProperty(this, key, { 11952 // unwrap ref to be consistent with public instance behavior 11953 get: () => unref(exposed[key]) 11954 }); 11955 } else if (true) { 11956 warn2(`Exposed property "${key}" already exists on custom element.`); 11957 } 11958 } 11959 } 11960 _resolveProps(def2) { 11961 const { props } = def2; 11962 const declaredPropKeys = isArray(props) ? props : Object.keys(props || {}); 11963 for (const key of Object.keys(this)) { 11964 if (key[0] !== "_" && declaredPropKeys.includes(key)) { 11965 this._setProp(key, this[key]); 11966 } 11967 } 11968 for (const key of declaredPropKeys.map(camelize)) { 11969 Object.defineProperty(this, key, { 11970 get() { 11971 return this._getProp(key); 11972 }, 11973 set(val) { 11974 this._setProp(key, val, true, !this._patching); 11975 } 11976 }); 11977 } 11978 } 11979 _setAttr(key) { 11980 if (key.startsWith("data-v-")) return; 11981 const has = this.hasAttribute(key); 11982 let value = has ? this.getAttribute(key) : REMOVAL; 11983 const camelKey = camelize(key); 11984 if (has && this._numberProps && this._numberProps[camelKey]) { 11985 value = toNumber(value); 11986 } 11987 this._setProp(camelKey, value, false, true); 11988 } 11989 /** 11990 * @internal 11991 */ 11992 _getProp(key) { 11993 return this._props[key]; 11994 } 11995 /** 11996 * @internal 11997 */ 11998 _setProp(key, val, shouldReflect = true, shouldUpdate = false) { 11999 if (val !== this._props[key]) { 12000 this._dirty = true; 12001 if (val === REMOVAL) { 12002 delete this._props[key]; 12003 } else { 12004 this._props[key] = val; 12005 if (key === "key" && this._app) { 12006 this._app._ceVNode.key = val; 12007 } 12008 } 12009 if (shouldUpdate && this._instance) { 12010 this._update(); 12011 } 12012 if (shouldReflect) { 12013 const ob = this._ob; 12014 if (ob) { 12015 this._processMutations(ob.takeRecords()); 12016 ob.disconnect(); 12017 } 12018 if (val === true) { 12019 this.setAttribute(hyphenate(key), ""); 12020 } else if (typeof val === "string" || typeof val === "number") { 12021 this.setAttribute(hyphenate(key), val + ""); 12022 } else if (!val) { 12023 this.removeAttribute(hyphenate(key)); 12024 } 12025 ob && ob.observe(this, { attributes: true }); 12026 } 12027 } 12028 } 12029 _update() { 12030 const vnode = this._createVNode(); 12031 if (this._app) vnode.appContext = this._app._context; 12032 render(vnode, this._root); 12033 } 12034 _createVNode() { 12035 const baseProps = {}; 12036 if (!this.shadowRoot) { 12037 baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); 12038 } 12039 const vnode = createVNode(this._def, extend(baseProps, this._props)); 12040 if (!this._instance) { 12041 vnode.ce = (instance) => { 12042 this._instance = instance; 12043 instance.ce = this; 12044 instance.isCE = true; 12045 if (true) { 12046 instance.ceReload = (newStyles) => { 12047 if (this._styles) { 12048 this._styles.forEach((s) => this._root.removeChild(s)); 12049 this._styles.length = 0; 12050 } 12051 this._styleAnchors.delete(this._def); 12052 this._applyStyles(newStyles); 12053 this._instance = null; 12054 this._update(); 12055 }; 12056 } 12057 const dispatch = (event, args) => { 12058 this.dispatchEvent( 12059 new CustomEvent( 12060 event, 12061 isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args } 12062 ) 12063 ); 12064 }; 12065 instance.emit = (event, ...args) => { 12066 dispatch(event, args); 12067 if (hyphenate(event) !== event) { 12068 dispatch(hyphenate(event), args); 12069 } 12070 }; 12071 this._setParent(); 12072 }; 12073 } 12074 return vnode; 12075 } 12076 _applyStyles(styles, owner, parentComp) { 12077 if (!styles) return; 12078 if (owner) { 12079 if (owner === this._def || this._styleChildren.has(owner)) { 12080 return; 12081 } 12082 this._styleChildren.add(owner); 12083 } 12084 const nonce = this._nonce; 12085 const root = this.shadowRoot; 12086 const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root); 12087 let last = null; 12088 for (let i = styles.length - 1; i >= 0; i--) { 12089 const s = document.createElement("style"); 12090 if (nonce) s.setAttribute("nonce", nonce); 12091 s.textContent = styles[i]; 12092 root.insertBefore(s, last || insertionAnchor); 12093 last = s; 12094 if (i === 0) { 12095 if (!parentComp) this._styleAnchors.set(this._def, s); 12096 if (owner) this._styleAnchors.set(owner, s); 12097 } 12098 if (true) { 12099 if (owner) { 12100 if (owner.__hmrId) { 12101 if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map(); 12102 let entry = this._childStyles.get(owner.__hmrId); 12103 if (!entry) { 12104 this._childStyles.set(owner.__hmrId, entry = []); 12105 } 12106 entry.push(s); 12107 } 12108 } else { 12109 (this._styles || (this._styles = [])).push(s); 12110 } 12111 } 12112 } 12113 } 12114 _getStyleAnchor(comp) { 12115 if (!comp) { 12116 return null; 12117 } 12118 const anchor = this._styleAnchors.get(comp); 12119 if (anchor && anchor.parentNode === this.shadowRoot) { 12120 return anchor; 12121 } 12122 if (anchor) { 12123 this._styleAnchors.delete(comp); 12124 } 12125 return null; 12126 } 12127 _getRootStyleInsertionAnchor(root) { 12128 for (let i = 0; i < root.childNodes.length; i++) { 12129 const node = root.childNodes[i]; 12130 if (!(node instanceof HTMLStyleElement)) { 12131 return node; 12132 } 12133 } 12134 return null; 12135 } 12136 /** 12137 * Only called when shadowRoot is false 12138 */ 12139 _parseSlots() { 12140 const slots = this._slots = {}; 12141 let n; 12142 while (n = this.firstChild) { 12143 const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; 12144 (slots[slotName] || (slots[slotName] = [])).push(n); 12145 this.removeChild(n); 12146 } 12147 } 12148 /** 12149 * Only called when shadowRoot is false 12150 */ 12151 _renderSlots() { 12152 const outlets = this._getSlots(); 12153 const scopeId = this._instance.type.__scopeId; 12154 for (let i = 0; i < outlets.length; i++) { 12155 const o = outlets[i]; 12156 const slotName = o.getAttribute("name") || "default"; 12157 const content = this._slots[slotName]; 12158 const parent = o.parentNode; 12159 if (content) { 12160 for (const n of content) { 12161 if (scopeId && n.nodeType === 1) { 12162 const id = scopeId + "-s"; 12163 const walker = document.createTreeWalker(n, 1); 12164 n.setAttribute(id, ""); 12165 let child; 12166 while (child = walker.nextNode()) { 12167 child.setAttribute(id, ""); 12168 } 12169 } 12170 parent.insertBefore(n, o); 12171 } 12172 } else { 12173 while (o.firstChild) parent.insertBefore(o.firstChild, o); 12174 } 12175 parent.removeChild(o); 12176 } 12177 } 12178 /** 12179 * @internal 12180 */ 12181 _getSlots() { 12182 const roots = [this]; 12183 if (this._teleportTargets) { 12184 roots.push(...this._teleportTargets); 12185 } 12186 const slots = /* @__PURE__ */ new Set(); 12187 for (const root of roots) { 12188 const found = root.querySelectorAll("slot"); 12189 for (let i = 0; i < found.length; i++) { 12190 slots.add(found[i]); 12191 } 12192 } 12193 return Array.from(slots); 12194 } 12195 /** 12196 * @internal 12197 */ 12198 _injectChildStyle(comp, parentComp) { 12199 this._applyStyles(comp.styles, comp, parentComp); 12200 } 12201 /** 12202 * @internal 12203 */ 12204 _beginPatch() { 12205 this._patching = true; 12206 this._dirty = false; 12207 } 12208 /** 12209 * @internal 12210 */ 12211 _endPatch() { 12212 this._patching = false; 12213 if (this._dirty && this._instance) { 12214 this._update(); 12215 } 12216 } 12217 /** 12218 * @internal 12219 */ 12220 _hasShadowRoot() { 12221 return this._def.shadowRoot !== false; 12222 } 12223 /** 12224 * @internal 12225 */ 12226 _removeChildStyle(comp) { 12227 if (true) { 12228 this._styleChildren.delete(comp); 12229 this._styleAnchors.delete(comp); 12230 if (this._childStyles && comp.__hmrId) { 12231 const oldStyles = this._childStyles.get(comp.__hmrId); 12232 if (oldStyles) { 12233 oldStyles.forEach((s) => this._root.removeChild(s)); 12234 oldStyles.length = 0; 12235 } 12236 } 12237 } 12238 } 12239 }; 12240 function useHost(caller) { 12241 const instance = getCurrentInstance(); 12242 const el = instance && instance.ce; 12243 if (el) { 12244 return el; 12245 } else if (true) { 12246 if (!instance) { 12247 warn2( 12248 `${caller || "useHost"} called without an active component instance.` 12249 ); 12250 } else { 12251 warn2( 12252 `${caller || "useHost"} can only be used in components defined via defineCustomElement.` 12253 ); 12254 } 12255 } 12256 return null; 12257 } 12258 function useShadowRoot() { 12259 const el = true ? useHost("useShadowRoot") : useHost(); 12260 return el && el.shadowRoot; 12261 } 12262 function useCssModule(name = "$style") { 12263 { 12264 const instance = getCurrentInstance(); 12265 if (!instance) { 12266 warn2(`useCssModule must be called inside setup()`); 12267 return EMPTY_OBJ; 12268 } 12269 const modules = instance.type.__cssModules; 12270 if (!modules) { 12271 warn2(`Current instance does not have CSS modules injected.`); 12272 return EMPTY_OBJ; 12273 } 12274 const mod = modules[name]; 12275 if (!mod) { 12276 warn2(`Current instance does not have CSS module named "${name}".`); 12277 return EMPTY_OBJ; 12278 } 12279 return mod; 12280 } 12281 } 12282 var positionMap = /* @__PURE__ */ new WeakMap(); 12283 var newPositionMap = /* @__PURE__ */ new WeakMap(); 12284 var moveCbKey = /* @__PURE__ */ Symbol("_moveCb"); 12285 var enterCbKey2 = /* @__PURE__ */ Symbol("_enterCb"); 12286 var decorate = (t) => { 12287 delete t.props.mode; 12288 return t; 12289 }; 12290 var TransitionGroupImpl = decorate({ 12291 name: "TransitionGroup", 12292 props: extend({}, TransitionPropsValidators, { 12293 tag: String, 12294 moveClass: String 12295 }), 12296 setup(props, { slots }) { 12297 const instance = getCurrentInstance(); 12298 const state = useTransitionState(); 12299 let prevChildren; 12300 let children; 12301 onUpdated(() => { 12302 if (!prevChildren.length) { 12303 return; 12304 } 12305 const moveClass = props.moveClass || `${props.name || "v"}-move`; 12306 if (!hasCSSTransform( 12307 prevChildren[0].el, 12308 instance.vnode.el, 12309 moveClass 12310 )) { 12311 prevChildren = []; 12312 return; 12313 } 12314 prevChildren.forEach(callPendingCbs); 12315 prevChildren.forEach(recordPosition); 12316 const movedChildren = prevChildren.filter(applyTranslation); 12317 forceReflow(instance.vnode.el); 12318 movedChildren.forEach((c) => { 12319 const el = c.el; 12320 const style = el.style; 12321 addTransitionClass(el, moveClass); 12322 style.transform = style.webkitTransform = style.transitionDuration = ""; 12323 const cb = el[moveCbKey] = (e) => { 12324 if (e && e.target !== el) { 12325 return; 12326 } 12327 if (!e || e.propertyName.endsWith("transform")) { 12328 el.removeEventListener("transitionend", cb); 12329 el[moveCbKey] = null; 12330 removeTransitionClass(el, moveClass); 12331 } 12332 }; 12333 el.addEventListener("transitionend", cb); 12334 }); 12335 prevChildren = []; 12336 }); 12337 return () => { 12338 const rawProps = toRaw(props); 12339 const cssTransitionProps = resolveTransitionProps(rawProps); 12340 let tag = rawProps.tag || Fragment; 12341 prevChildren = []; 12342 if (children) { 12343 for (let i = 0; i < children.length; i++) { 12344 const child = children[i]; 12345 if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from. 12346 !child.el[vShowHidden]) { 12347 prevChildren.push(child); 12348 setTransitionHooks( 12349 child, 12350 resolveTransitionHooks( 12351 child, 12352 cssTransitionProps, 12353 state, 12354 instance 12355 ) 12356 ); 12357 positionMap.set(child, getPosition(child.el)); 12358 } 12359 } 12360 } 12361 children = slots.default ? getTransitionRawChildren(slots.default()) : []; 12362 for (let i = 0; i < children.length; i++) { 12363 const child = children[i]; 12364 if (child.key != null) { 12365 setTransitionHooks( 12366 child, 12367 resolveTransitionHooks(child, cssTransitionProps, state, instance) 12368 ); 12369 } else if (child.type !== Text) { 12370 warn2(`<TransitionGroup> children must be keyed.`); 12371 } 12372 } 12373 return createVNode(tag, null, children); 12374 }; 12375 } 12376 }); 12377 var TransitionGroup = TransitionGroupImpl; 12378 function callPendingCbs(c) { 12379 const el = c.el; 12380 if (el[moveCbKey]) { 12381 el[moveCbKey](); 12382 } 12383 if (el[enterCbKey2]) { 12384 el[enterCbKey2](); 12385 } 12386 } 12387 function recordPosition(c) { 12388 newPositionMap.set(c, getPosition(c.el)); 12389 } 12390 function applyTranslation(c) { 12391 const oldPos = positionMap.get(c); 12392 const newPos = newPositionMap.get(c); 12393 const dx = oldPos.left - newPos.left; 12394 const dy = oldPos.top - newPos.top; 12395 if (dx || dy) { 12396 const el = c.el; 12397 const s = el.style; 12398 const rect = el.getBoundingClientRect(); 12399 let scaleX = 1; 12400 let scaleY = 1; 12401 if (el.offsetWidth) scaleX = rect.width / el.offsetWidth; 12402 if (el.offsetHeight) scaleY = rect.height / el.offsetHeight; 12403 if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1; 12404 if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1; 12405 if (Math.abs(scaleX - 1) < 0.01) scaleX = 1; 12406 if (Math.abs(scaleY - 1) < 0.01) scaleY = 1; 12407 s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`; 12408 s.transitionDuration = "0s"; 12409 return c; 12410 } 12411 } 12412 function getPosition(el) { 12413 const rect = el.getBoundingClientRect(); 12414 return { 12415 left: rect.left, 12416 top: rect.top 12417 }; 12418 } 12419 function hasCSSTransform(el, root, moveClass) { 12420 const clone = el.cloneNode(); 12421 const _vtc = el[vtcKey]; 12422 if (_vtc) { 12423 _vtc.forEach((cls) => { 12424 cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); 12425 }); 12426 } 12427 moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); 12428 clone.style.display = "none"; 12429 const container = root.nodeType === 1 ? root : root.parentNode; 12430 container.appendChild(clone); 12431 const { hasTransform } = getTransitionInfo(clone); 12432 container.removeChild(clone); 12433 return hasTransform; 12434 } 12435 var getModelAssigner = (vnode) => { 12436 const fn = vnode.props["onUpdate:modelValue"] || false; 12437 return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn; 12438 }; 12439 function onCompositionStart(e) { 12440 e.target.composing = true; 12441 } 12442 function onCompositionEnd(e) { 12443 const target = e.target; 12444 if (target.composing) { 12445 target.composing = false; 12446 target.dispatchEvent(new Event("input")); 12447 } 12448 } 12449 var assignKey = /* @__PURE__ */ Symbol("_assign"); 12450 function castValue(value, trim, number) { 12451 if (trim) value = value.trim(); 12452 if (number) value = looseToNumber(value); 12453 return value; 12454 } 12455 var vModelText = { 12456 created(el, { modifiers: { lazy, trim, number } }, vnode) { 12457 el[assignKey] = getModelAssigner(vnode); 12458 const castToNumber = number || vnode.props && vnode.props.type === "number"; 12459 addEventListener(el, lazy ? "change" : "input", (e) => { 12460 if (e.target.composing) return; 12461 el[assignKey](castValue(el.value, trim, castToNumber)); 12462 }); 12463 if (trim || castToNumber) { 12464 addEventListener(el, "change", () => { 12465 el.value = castValue(el.value, trim, castToNumber); 12466 }); 12467 } 12468 if (!lazy) { 12469 addEventListener(el, "compositionstart", onCompositionStart); 12470 addEventListener(el, "compositionend", onCompositionEnd); 12471 addEventListener(el, "change", onCompositionEnd); 12472 } 12473 }, 12474 // set value on mounted so it's after min/max for type="range" 12475 mounted(el, { value }) { 12476 el.value = value == null ? "" : value; 12477 }, 12478 beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { 12479 el[assignKey] = getModelAssigner(vnode); 12480 if (el.composing) return; 12481 const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; 12482 const newValue = value == null ? "" : value; 12483 if (elValue === newValue) { 12484 return; 12485 } 12486 const rootNode = el.getRootNode(); 12487 if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") { 12488 if (lazy && value === oldValue) { 12489 return; 12490 } 12491 if (trim && el.value.trim() === newValue) { 12492 return; 12493 } 12494 } 12495 el.value = newValue; 12496 } 12497 }; 12498 var vModelCheckbox = { 12499 // #4096 array checkboxes need to be deep traversed 12500 deep: true, 12501 created(el, _, vnode) { 12502 el[assignKey] = getModelAssigner(vnode); 12503 addEventListener(el, "change", () => { 12504 const modelValue = el._modelValue; 12505 const elementValue = getValue(el); 12506 const checked = el.checked; 12507 const assign = el[assignKey]; 12508 if (isArray(modelValue)) { 12509 const index = looseIndexOf(modelValue, elementValue); 12510 const found = index !== -1; 12511 if (checked && !found) { 12512 assign(modelValue.concat(elementValue)); 12513 } else if (!checked && found) { 12514 const filtered = [...modelValue]; 12515 filtered.splice(index, 1); 12516 assign(filtered); 12517 } 12518 } else if (isSet(modelValue)) { 12519 const cloned = new Set(modelValue); 12520 if (checked) { 12521 cloned.add(elementValue); 12522 } else { 12523 cloned.delete(elementValue); 12524 } 12525 assign(cloned); 12526 } else { 12527 assign(getCheckboxValue(el, checked)); 12528 } 12529 }); 12530 }, 12531 // set initial checked on mount to wait for true-value/false-value 12532 mounted: setChecked, 12533 beforeUpdate(el, binding, vnode) { 12534 el[assignKey] = getModelAssigner(vnode); 12535 setChecked(el, binding, vnode); 12536 } 12537 }; 12538 function setChecked(el, { value, oldValue }, vnode) { 12539 el._modelValue = value; 12540 let checked; 12541 if (isArray(value)) { 12542 checked = looseIndexOf(value, vnode.props.value) > -1; 12543 } else if (isSet(value)) { 12544 checked = value.has(vnode.props.value); 12545 } else { 12546 if (value === oldValue) return; 12547 checked = looseEqual(value, getCheckboxValue(el, true)); 12548 } 12549 if (el.checked !== checked) { 12550 el.checked = checked; 12551 } 12552 } 12553 var vModelRadio = { 12554 created(el, { value }, vnode) { 12555 el.checked = looseEqual(value, vnode.props.value); 12556 el[assignKey] = getModelAssigner(vnode); 12557 addEventListener(el, "change", () => { 12558 el[assignKey](getValue(el)); 12559 }); 12560 }, 12561 beforeUpdate(el, { value, oldValue }, vnode) { 12562 el[assignKey] = getModelAssigner(vnode); 12563 if (value !== oldValue) { 12564 el.checked = looseEqual(value, vnode.props.value); 12565 } 12566 } 12567 }; 12568 var vModelSelect = { 12569 // <select multiple> value need to be deep traversed 12570 deep: true, 12571 created(el, { value, modifiers: { number } }, vnode) { 12572 const isSetModel = isSet(value); 12573 addEventListener(el, "change", () => { 12574 const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( 12575 (o) => number ? looseToNumber(getValue(o)) : getValue(o) 12576 ); 12577 el[assignKey]( 12578 el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] 12579 ); 12580 el._assigning = true; 12581 nextTick(() => { 12582 el._assigning = false; 12583 }); 12584 }); 12585 el[assignKey] = getModelAssigner(vnode); 12586 }, 12587 // set value in mounted & updated because <select> relies on its children 12588 // <option>s. 12589 mounted(el, { value }) { 12590 setSelected(el, value); 12591 }, 12592 beforeUpdate(el, _binding, vnode) { 12593 el[assignKey] = getModelAssigner(vnode); 12594 }, 12595 updated(el, { value }) { 12596 if (!el._assigning) { 12597 setSelected(el, value); 12598 } 12599 } 12600 }; 12601 function setSelected(el, value) { 12602 const isMultiple = el.multiple; 12603 const isArrayValue = isArray(value); 12604 if (isMultiple && !isArrayValue && !isSet(value)) { 12605 warn2( 12606 `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` 12607 ); 12608 return; 12609 } 12610 for (let i = 0, l = el.options.length; i < l; i++) { 12611 const option = el.options[i]; 12612 const optionValue = getValue(option); 12613 if (isMultiple) { 12614 if (isArrayValue) { 12615 const optionType = typeof optionValue; 12616 if (optionType === "string" || optionType === "number") { 12617 option.selected = value.some((v) => String(v) === String(optionValue)); 12618 } else { 12619 option.selected = looseIndexOf(value, optionValue) > -1; 12620 } 12621 } else { 12622 option.selected = value.has(optionValue); 12623 } 12624 } else if (looseEqual(getValue(option), value)) { 12625 if (el.selectedIndex !== i) el.selectedIndex = i; 12626 return; 12627 } 12628 } 12629 if (!isMultiple && el.selectedIndex !== -1) { 12630 el.selectedIndex = -1; 12631 } 12632 } 12633 function getValue(el) { 12634 return "_value" in el ? el._value : el.value; 12635 } 12636 function getCheckboxValue(el, checked) { 12637 const key = checked ? "_trueValue" : "_falseValue"; 12638 return key in el ? el[key] : checked; 12639 } 12640 var vModelDynamic = { 12641 created(el, binding, vnode) { 12642 callModelHook(el, binding, vnode, null, "created"); 12643 }, 12644 mounted(el, binding, vnode) { 12645 callModelHook(el, binding, vnode, null, "mounted"); 12646 }, 12647 beforeUpdate(el, binding, vnode, prevVNode) { 12648 callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); 12649 }, 12650 updated(el, binding, vnode, prevVNode) { 12651 callModelHook(el, binding, vnode, prevVNode, "updated"); 12652 } 12653 }; 12654 function resolveDynamicModel(tagName, type) { 12655 switch (tagName) { 12656 case "SELECT": 12657 return vModelSelect; 12658 case "TEXTAREA": 12659 return vModelText; 12660 default: 12661 switch (type) { 12662 case "checkbox": 12663 return vModelCheckbox; 12664 case "radio": 12665 return vModelRadio; 12666 default: 12667 return vModelText; 12668 } 12669 } 12670 } 12671 function callModelHook(el, binding, vnode, prevVNode, hook) { 12672 const modelToUse = resolveDynamicModel( 12673 el.tagName, 12674 vnode.props && vnode.props.type 12675 ); 12676 const fn = modelToUse[hook]; 12677 fn && fn(el, binding, vnode, prevVNode); 12678 } 12679 function initVModelForSSR() { 12680 vModelText.getSSRProps = ({ value }) => ({ value }); 12681 vModelRadio.getSSRProps = ({ value }, vnode) => { 12682 if (vnode.props && looseEqual(vnode.props.value, value)) { 12683 return { checked: true }; 12684 } 12685 }; 12686 vModelCheckbox.getSSRProps = ({ value }, vnode) => { 12687 if (isArray(value)) { 12688 if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) { 12689 return { checked: true }; 12690 } 12691 } else if (isSet(value)) { 12692 if (vnode.props && value.has(vnode.props.value)) { 12693 return { checked: true }; 12694 } 12695 } else if (value) { 12696 return { checked: true }; 12697 } 12698 }; 12699 vModelDynamic.getSSRProps = (binding, vnode) => { 12700 if (typeof vnode.type !== "string") { 12701 return; 12702 } 12703 const modelToUse = resolveDynamicModel( 12704 // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase 12705 vnode.type.toUpperCase(), 12706 vnode.props && vnode.props.type 12707 ); 12708 if (modelToUse.getSSRProps) { 12709 return modelToUse.getSSRProps(binding, vnode); 12710 } 12711 }; 12712 } 12713 var systemModifiers = ["ctrl", "shift", "alt", "meta"]; 12714 var modifierGuards = { 12715 stop: (e) => e.stopPropagation(), 12716 prevent: (e) => e.preventDefault(), 12717 self: (e) => e.target !== e.currentTarget, 12718 ctrl: (e) => !e.ctrlKey, 12719 shift: (e) => !e.shiftKey, 12720 alt: (e) => !e.altKey, 12721 meta: (e) => !e.metaKey, 12722 left: (e) => "button" in e && e.button !== 0, 12723 middle: (e) => "button" in e && e.button !== 1, 12724 right: (e) => "button" in e && e.button !== 2, 12725 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) 12726 }; 12727 var withModifiers = (fn, modifiers) => { 12728 if (!fn) return fn; 12729 const cache = fn._withMods || (fn._withMods = {}); 12730 const cacheKey = modifiers.join("."); 12731 return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => { 12732 for (let i = 0; i < modifiers.length; i++) { 12733 const guard = modifierGuards[modifiers[i]]; 12734 if (guard && guard(event, modifiers)) return; 12735 } 12736 return fn(event, ...args); 12737 })); 12738 }; 12739 var keyNames = { 12740 esc: "escape", 12741 space: " ", 12742 up: "arrow-up", 12743 left: "arrow-left", 12744 right: "arrow-right", 12745 down: "arrow-down", 12746 delete: "backspace" 12747 }; 12748 var withKeys = (fn, modifiers) => { 12749 const cache = fn._withKeys || (fn._withKeys = {}); 12750 const cacheKey = modifiers.join("."); 12751 return cache[cacheKey] || (cache[cacheKey] = ((event) => { 12752 if (!("key" in event)) { 12753 return; 12754 } 12755 const eventKey = hyphenate(event.key); 12756 if (modifiers.some( 12757 (k) => k === eventKey || keyNames[k] === eventKey 12758 )) { 12759 return fn(event); 12760 } 12761 })); 12762 }; 12763 var rendererOptions = extend({ patchProp }, nodeOps); 12764 var renderer; 12765 var enabledHydration = false; 12766 function ensureRenderer() { 12767 return renderer || (renderer = createRenderer(rendererOptions)); 12768 } 12769 function ensureHydrationRenderer() { 12770 renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions); 12771 enabledHydration = true; 12772 return renderer; 12773 } 12774 var render = ((...args) => { 12775 ensureRenderer().render(...args); 12776 }); 12777 var hydrate = ((...args) => { 12778 ensureHydrationRenderer().hydrate(...args); 12779 }); 12780 var createApp = ((...args) => { 12781 const app = ensureRenderer().createApp(...args); 12782 if (true) { 12783 injectNativeTagCheck(app); 12784 injectCompilerOptionsCheck(app); 12785 } 12786 const { mount } = app; 12787 app.mount = (containerOrSelector) => { 12788 const container = normalizeContainer(containerOrSelector); 12789 if (!container) return; 12790 const component = app._component; 12791 if (!isFunction(component) && !component.render && !component.template) { 12792 component.template = container.innerHTML; 12793 } 12794 if (container.nodeType === 1) { 12795 container.textContent = ""; 12796 } 12797 const proxy = mount(container, false, resolveRootNamespace(container)); 12798 if (container instanceof Element) { 12799 container.removeAttribute("v-cloak"); 12800 container.setAttribute("data-v-app", ""); 12801 } 12802 return proxy; 12803 }; 12804 return app; 12805 }); 12806 var createSSRApp = ((...args) => { 12807 const app = ensureHydrationRenderer().createApp(...args); 12808 if (true) { 12809 injectNativeTagCheck(app); 12810 injectCompilerOptionsCheck(app); 12811 } 12812 const { mount } = app; 12813 app.mount = (containerOrSelector) => { 12814 const container = normalizeContainer(containerOrSelector); 12815 if (container) { 12816 return mount(container, true, resolveRootNamespace(container)); 12817 } 12818 }; 12819 return app; 12820 }); 12821 function resolveRootNamespace(container) { 12822 if (container instanceof SVGElement) { 12823 return "svg"; 12824 } 12825 if (typeof MathMLElement === "function" && container instanceof MathMLElement) { 12826 return "mathml"; 12827 } 12828 } 12829 function injectNativeTagCheck(app) { 12830 Object.defineProperty(app.config, "isNativeTag", { 12831 value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), 12832 writable: false 12833 }); 12834 } 12835 function injectCompilerOptionsCheck(app) { 12836 if (isRuntimeOnly()) { 12837 const isCustomElement = app.config.isCustomElement; 12838 Object.defineProperty(app.config, "isCustomElement", { 12839 get() { 12840 return isCustomElement; 12841 }, 12842 set() { 12843 warn2( 12844 `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` 12845 ); 12846 } 12847 }); 12848 const compilerOptions = app.config.compilerOptions; 12849 const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. 12850 - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. 12851 - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader 12852 - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; 12853 Object.defineProperty(app.config, "compilerOptions", { 12854 get() { 12855 warn2(msg); 12856 return compilerOptions; 12857 }, 12858 set() { 12859 warn2(msg); 12860 } 12861 }); 12862 } 12863 } 12864 function normalizeContainer(container) { 12865 if (isString(container)) { 12866 const res = document.querySelector(container); 12867 if (!res) { 12868 warn2( 12869 `Failed to mount app: mount target selector "${container}" returned null.` 12870 ); 12871 } 12872 return res; 12873 } 12874 if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { 12875 warn2( 12876 `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` 12877 ); 12878 } 12879 return container; 12880 } 12881 var ssrDirectiveInitialized = false; 12882 var initDirectivesForSSR = () => { 12883 if (!ssrDirectiveInitialized) { 12884 ssrDirectiveInitialized = true; 12885 initVModelForSSR(); 12886 initVShowForSSR(); 12887 } 12888 }; 12889 12890 // node_modules/vue/dist/vue.runtime.esm-bundler.js 12891 function initDev() { 12892 { 12893 initCustomFormatter(); 12894 } 12895 } 12896 if (true) { 12897 initDev(); 12898 } 12899 var compile2 = () => { 12900 if (true) { 12901 warn2( 12902 `Runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` 12903 ); 12904 } 12905 }; 12906 12907 export { 12908 camelize, 12909 capitalize, 12910 toHandlerKey, 12911 normalizeStyle, 12912 normalizeClass, 12913 normalizeProps, 12914 toDisplayString, 12915 EffectScope, 12916 effectScope, 12917 getCurrentScope, 12918 onScopeDispose, 12919 ReactiveEffect, 12920 effect, 12921 stop, 12922 reactive, 12923 shallowReactive, 12924 readonly, 12925 shallowReadonly, 12926 isReactive, 12927 isReadonly, 12928 isShallow, 12929 isProxy, 12930 toRaw, 12931 markRaw, 12932 isRef2 as isRef, 12933 ref, 12934 shallowRef, 12935 triggerRef, 12936 unref, 12937 toValue, 12938 proxyRefs, 12939 customRef, 12940 toRefs, 12941 toRef, 12942 TrackOpTypes, 12943 TriggerOpTypes, 12944 getCurrentWatcher, 12945 onWatcherCleanup, 12946 assertNumber, 12947 ErrorCodes, 12948 callWithErrorHandling, 12949 callWithAsyncErrorHandling, 12950 handleError, 12951 nextTick, 12952 queuePostFlushCb, 12953 pushScopeId, 12954 popScopeId, 12955 withScopeId, 12956 withCtx, 12957 withDirectives, 12958 provide, 12959 inject, 12960 hasInjectionContext, 12961 ssrContextKey, 12962 useSSRContext, 12963 watchEffect, 12964 watchPostEffect, 12965 watchSyncEffect, 12966 watch2 as watch, 12967 Teleport, 12968 useTransitionState, 12969 BaseTransitionPropsValidators, 12970 BaseTransition, 12971 resolveTransitionHooks, 12972 setTransitionHooks, 12973 getTransitionRawChildren, 12974 defineComponent, 12975 useId, 12976 useTemplateRef, 12977 hydrateOnIdle, 12978 hydrateOnVisible, 12979 hydrateOnMediaQuery, 12980 hydrateOnInteraction, 12981 defineAsyncComponent, 12982 KeepAlive, 12983 onActivated, 12984 onDeactivated, 12985 onBeforeMount, 12986 onMounted, 12987 onBeforeUpdate, 12988 onUpdated, 12989 onBeforeUnmount, 12990 onUnmounted, 12991 onServerPrefetch, 12992 onRenderTriggered, 12993 onRenderTracked, 12994 onErrorCaptured, 12995 resolveComponent, 12996 resolveDynamicComponent, 12997 resolveDirective, 12998 renderList, 12999 createSlots, 13000 renderSlot, 13001 toHandlers, 13002 defineProps, 13003 defineEmits, 13004 defineExpose, 13005 defineOptions, 13006 defineSlots, 13007 defineModel, 13008 withDefaults, 13009 useSlots, 13010 useAttrs, 13011 mergeDefaults, 13012 mergeModels, 13013 createPropsRestProxy, 13014 withAsyncContext, 13015 useModel, 13016 createRenderer, 13017 createHydrationRenderer, 13018 Suspense, 13019 Fragment, 13020 Text, 13021 Comment, 13022 Static, 13023 openBlock, 13024 setBlockTracking, 13025 createElementBlock, 13026 createBlock, 13027 isVNode, 13028 transformVNodeArgs, 13029 createBaseVNode, 13030 createVNode, 13031 guardReactiveProps, 13032 cloneVNode, 13033 createTextVNode, 13034 createStaticVNode, 13035 createCommentVNode, 13036 mergeProps, 13037 getCurrentInstance, 13038 registerRuntimeCompiler, 13039 isRuntimeOnly, 13040 computed2 as computed, 13041 h, 13042 initCustomFormatter, 13043 withMemo, 13044 isMemoSame, 13045 version, 13046 warn2 as warn, 13047 ErrorTypeStrings, 13048 devtools, 13049 setDevtoolsHook, 13050 ssrUtils, 13051 resolveFilter, 13052 compatUtils, 13053 DeprecationTypes, 13054 nodeOps, 13055 Transition, 13056 vShow, 13057 useCssVars, 13058 patchProp, 13059 defineCustomElement, 13060 defineSSRCustomElement, 13061 VueElement, 13062 useHost, 13063 useShadowRoot, 13064 useCssModule, 13065 TransitionGroup, 13066 vModelText, 13067 vModelCheckbox, 13068 vModelRadio, 13069 vModelSelect, 13070 vModelDynamic, 13071 withModifiers, 13072 withKeys, 13073 render, 13074 hydrate, 13075 createApp, 13076 createSSRApp, 13077 initDirectivesForSSR, 13078 compile2 as compile 13079 }; 13080 //# sourceMappingURL=chunk-LRIOPKVT.js.map