1import { 2 __export 3} from "/node_modules/.vite/deps/chunk-SNAQBZPT.js?v=6d0dd766"; 4
vendor: 5,914 bytes, lines 5-167
5// node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js 6var runtime_dom_esm_bundler_exports = {}; 7__export(runtime_dom_esm_bundler_exports, { 8 BaseTransition: () => BaseTransition, 9 BaseTransitionPropsValidators: () => BaseTransitionPropsValidators, 10 Comment: () => Comment, 11 DeprecationTypes: () => DeprecationTypes, 12 EffectScope: () => EffectScope, 13 ErrorCodes: () => ErrorCodes, 14 ErrorTypeStrings: () => ErrorTypeStrings, 15 Fragment: () => Fragment, 16 KeepAlive: () => KeepAlive, 17 ReactiveEffect: () => ReactiveEffect, 18 Static: () => Static, 19 Suspense: () => Suspense, 20 Teleport: () => Teleport, 21 Text: () => Text, 22 TrackOpTypes: () => TrackOpTypes, 23 Transition: () => Transition, 24 TransitionGroup: () => TransitionGroup, 25 TriggerOpTypes: () => TriggerOpTypes, 26 VueElement: () => VueElement, 27 assertNumber: () => assertNumber, 28 callWithAsyncErrorHandling: () => callWithAsyncErrorHandling, 29 callWithErrorHandling: () => callWithErrorHandling, 30 camelize: () => camelize, 31 capitalize: () => capitalize, 32 cloneVNode: () => cloneVNode, 33 compatUtils: () => compatUtils, 34 computed: () => computed2, 35 createApp: () => createApp, 36 createBlock: () => createBlock, 37 createCommentVNode: () => createCommentVNode, 38 createElementBlock: () => createElementBlock, 39 createElementVNode: () => createBaseVNode, 40 createHydrationRenderer: () => createHydrationRenderer, 41 createPropsRestProxy: () => createPropsRestProxy, 42 createRenderer: () => createRenderer, 43 createSSRApp: () => createSSRApp, 44 createSlots: () => createSlots, 45 createStaticVNode: () => createStaticVNode, 46 createTextVNode: () => createTextVNode, 47 createVNode: () => createVNode, 48 customRef: () => customRef, 49 defineAsyncComponent: () => defineAsyncComponent, 50 defineComponent: () => defineComponent, 51 defineCustomElement: () => defineCustomElement, 52 defineEmits: () => defineEmits, 53 defineExpose: () => defineExpose, 54 defineModel: () => defineModel, 55 defineOptions: () => defineOptions, 56 defineProps: () => defineProps, 57 defineSSRCustomElement: () => defineSSRCustomElement, 58 defineSlots: () => defineSlots, 59 devtools: () => devtools, 60 effect: () => effect, 61 effectScope: () => effectScope, 62 getCurrentInstance: () => getCurrentInstance, 63 getCurrentScope: () => getCurrentScope, 64 getTransitionRawChildren: () => getTransitionRawChildren, 65 guardReactiveProps: () => guardReactiveProps, 66 h: () => h, 67 handleError: () => handleError, 68 hasInjectionContext: () => hasInjectionContext, 69 hydrate: () => hydrate, 70 initCustomFormatter: () => initCustomFormatter, 71 initDirectivesForSSR: () => initDirectivesForSSR, 72 inject: () => inject, 73 isMemoSame: () => isMemoSame, 74 isProxy: () => isProxy, 75 isReactive: () => isReactive, 76 isReadonly: () => isReadonly, 77 isRef: () => isRef2, 78 isRuntimeOnly: () => isRuntimeOnly, 79 isShallow: () => isShallow, 80 isVNode: () => isVNode, 81 markRaw: () => markRaw, 82 mergeDefaults: () => mergeDefaults, 83 mergeModels: () => mergeModels, 84 mergeProps: () => mergeProps, 85 nextTick: () => nextTick, 86 normalizeClass: () => normalizeClass, 87 normalizeProps: () => normalizeProps, 88 normalizeStyle: () => normalizeStyle, 89 onActivated: () => onActivated, 90 onBeforeMount: () => onBeforeMount, 91 onBeforeUnmount: () => onBeforeUnmount, 92 onBeforeUpdate: () => onBeforeUpdate, 93 onDeactivated: () => onDeactivated, 94 onErrorCaptured: () => onErrorCaptured, 95 onMounted: () => onMounted, 96 onRenderTracked: () => onRenderTracked, 97 onRenderTriggered: () => onRenderTriggered, 98 onScopeDispose: () => onScopeDispose, 99 onServerPrefetch: () => onServerPrefetch, 100 onUnmounted: () => onUnmounted, 101 onUpdated: () => onUpdated, 102 openBlock: () => openBlock, 103 popScopeId: () => popScopeId, 104 provide: () => provide, 105 proxyRefs: () => proxyRefs, 106 pushScopeId: () => pushScopeId, 107 queuePostFlushCb: () => queuePostFlushCb, 108 reactive: () => reactive, 109 readonly: () => readonly, 110 ref: () => ref, 111 registerRuntimeCompiler: () => registerRuntimeCompiler, 112 render: () => render, 113 renderList: () => renderList, 114 renderSlot: () => renderSlot, 115 resolveComponent: () => resolveComponent, 116 resolveDirective: () => resolveDirective, 117 resolveDynamicComponent: () => resolveDynamicComponent, 118 resolveFilter: () => resolveFilter, 119 resolveTransitionHooks: () => resolveTransitionHooks, 120 setBlockTracking: () => setBlockTracking, 121 setDevtoolsHook: () => setDevtoolsHook, 122 setTransitionHooks: () => setTransitionHooks, 123 shallowReactive: () => shallowReactive, 124 shallowReadonly: () => shallowReadonly, 125 shallowRef: () => shallowRef, 126 ssrContextKey: () => ssrContextKey, 127 ssrUtils: () => ssrUtils, 128 stop: () => stop, 129 toDisplayString: () => toDisplayString, 130 toHandlerKey: () => toHandlerKey, 131 toHandlers: () => toHandlers, 132 toRaw: () => toRaw, 133 toRef: () => toRef, 134 toRefs: () => toRefs, 135 toValue: () => toValue, 136 transformVNodeArgs: () => transformVNodeArgs, 137 triggerRef: () => triggerRef, 138 unref: () => unref, 139 useAttrs: () => useAttrs, 140 useCssModule: () => useCssModule, 141 useCssVars: () => useCssVars, 142 useModel: () => useModel, 143 useSSRContext: () => useSSRContext, 144 useSlots: () => useSlots, 145 useTransitionState: () => useTransitionState, 146 vModelCheckbox: () => vModelCheckbox, 147 vModelDynamic: () => vModelDynamic, 148 vModelRadio: () => vModelRadio, 149 vModelSelect: () => vModelSelect, 150 vModelText: () => vModelText, 151 vShow: () => vShow, 152 version: () => version, 153 warn: () => warn2, 154 watch: () => watch, 155 watchEffect: () => watchEffect, 156 watchPostEffect: () => watchPostEffect, 157 watchSyncEffect: () => watchSyncEffect, 158 withAsyncContext: () => withAsyncContext, 159 withCtx: () => withCtx, 160 withDefaults: () => withDefaults, 161 withDirectives: () => withDirectives, 162 withKeys: () => withKeys, 163 withMemo: () => withMemo, 164 withModifiers: () => withModifiers, 165 withScopeId: () => withScopeId 166}); 167
vendor: 16,759 bytes, lines 168-519
168// node_modules/.pnpm/@[email protected]/node_modules/@vue/shared/dist/shared.esm-bundler.js 169function makeMap(str, expectsLowerCase) { 170 const set2 = new Set(str.split(",")); 171 return expectsLowerCase ? (val) => set2.has(val.toLowerCase()) : (val) => set2.has(val); 172} 173var EMPTY_OBJ = true ? Object.freeze({}) : {}; 174var EMPTY_ARR = true ? Object.freeze([]) : []; 175var NOOP = () => { 176}; 177var NO = () => false; 178var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter 179(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); 180var isModelListener = (key) => key.startsWith("onUpdate:"); 181var extend = Object.assign; 182var remove = (arr, el) => { 183 const i = arr.indexOf(el); 184 if (i > -1) { 185 arr.splice(i, 1); 186 } 187}; 188var hasOwnProperty = Object.prototype.hasOwnProperty; 189var hasOwn = (val, key) => hasOwnProperty.call(val, key); 190var isArray = Array.isArray; 191var isMap = (val) => toTypeString(val) === "[object Map]"; 192var isSet = (val) => toTypeString(val) === "[object Set]"; 193var isDate = (val) => toTypeString(val) === "[object Date]"; 194var isRegExp = (val) => toTypeString(val) === "[object RegExp]"; 195var isFunction = (val) => typeof val === "function"; 196var isString = (val) => typeof val === "string"; 197var isSymbol = (val) => typeof val === "symbol"; 198var isObject = (val) => val !== null && typeof val === "object"; 199var isPromise = (val) => { 200 return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); 201}; 202var objectToString = Object.prototype.toString; 203var toTypeString = (value) => objectToString.call(value); 204var toRawType = (value) => { 205 return toTypeString(value).slice(8, -1); 206}; 207var isPlainObject = (val) => toTypeString(val) === "[object Object]"; 208var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; 209var isReservedProp = makeMap( 210 // the leading comma is intentional so empty string "" is also included 211 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" 212); 213var isBuiltInDirective = makeMap( 214 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" 215); 216var cacheStringFunction = (fn) => { 217 const cache = /* @__PURE__ */ Object.create(null); 218 return (str) => { 219 const hit = cache[str]; 220 return hit || (cache[str] = fn(str)); 221 }; 222}; 223var camelizeRE = /-(\w)/g; 224var camelize = cacheStringFunction((str) => { 225 return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); 226}); 227var hyphenateRE = /\B([A-Z])/g; 228var hyphenate = cacheStringFunction( 229 (str) => str.replace(hyphenateRE, "-$1").toLowerCase() 230); 231var capitalize = cacheStringFunction((str) => { 232 return str.charAt(0).toUpperCase() + str.slice(1); 233}); 234var toHandlerKey = cacheStringFunction((str) => { 235 const s = str ? `on${capitalize(str)}` : ``; 236 return s; 237}); 238var hasChanged = (value, oldValue) => !Object.is(value, oldValue); 239var invokeArrayFns = (fns, ...arg) => { 240 for (let i = 0; i < fns.length; i++) { 241 fns[i](...arg); 242 } 243}; 244var def = (obj, key, value, writable = false) => { 245 Object.defineProperty(obj, key, { 246 configurable: true, 247 enumerable: false, 248 writable, 249 value 250 }); 251}; 252var looseToNumber = (val) => { 253 const n = parseFloat(val); 254 return isNaN(n) ? val : n; 255}; 256var toNumber = (val) => { 257 const n = isString(val) ? Number(val) : NaN; 258 return isNaN(n) ? val : n; 259}; 260var _globalThis; 261var getGlobalThis = () => { 262 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); 263}; 264var PatchFlagNames = { 265 [1]: `TEXT`, 266 [2]: `CLASS`, 267 [4]: `STYLE`, 268 [8]: `PROPS`, 269 [16]: `FULL_PROPS`, 270 [32]: `NEED_HYDRATION`, 271 [64]: `STABLE_FRAGMENT`, 272 [128]: `KEYED_FRAGMENT`, 273 [256]: `UNKEYED_FRAGMENT`, 274 [512]: `NEED_PATCH`, 275 [1024]: `DYNAMIC_SLOTS`, 276 [2048]: `DEV_ROOT_FRAGMENT`, 277 [-1]: `HOISTED`, 278 [-2]: `BAIL` 279}; 280var slotFlagsText = { 281 [1]: "STABLE", 282 [2]: "DYNAMIC", 283 [3]: "FORWARDED" 284}; 285var 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"; 286var isGloballyAllowed = makeMap(GLOBALS_ALLOWED); 287var range = 2; 288function generateCodeFrame(source, start = 0, end = source.length) { 289 start = Math.max(0, Math.min(start, source.length)); 290 end = Math.max(0, Math.min(end, source.length)); 291 if (start > end) return ""; 292 let lines = source.split(/(\r?\n)/); 293 const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); 294 lines = lines.filter((_, idx) => idx % 2 === 0); 295 let count = 0; 296 const res = []; 297 for (let i = 0; i < lines.length; i++) { 298 count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); 299 if (count >= start) { 300 for (let j = i - range; j <= i + range || end > count; j++) { 301 if (j < 0 || j >= lines.length) continue; 302 const line = j + 1; 303 res.push( 304 `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` 305 ); 306 const lineLength = lines[j].length; 307 const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; 308 if (j === i) { 309 const pad = start - (count - (lineLength + newLineSeqLength)); 310 const length = Math.max( 311 1, 312 end > count ? lineLength - pad : end - start 313 ); 314 res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); 315 } else if (j > i) { 316 if (end > count) { 317 const length = Math.max(Math.min(end - count, lineLength), 1); 318 res.push(` | ` + "^".repeat(length)); 319 } 320 count += lineLength + newLineSeqLength; 321 } 322 } 323 break; 324 } 325 } 326 return res.join("\n"); 327} 328function normalizeStyle(value) { 329 if (isArray(value)) { 330 const res = {}; 331 for (let i = 0; i < value.length; i++) { 332 const item = value[i]; 333 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); 334 if (normalized) { 335 for (const key in normalized) { 336 res[key] = normalized[key]; 337 } 338 } 339 } 340 return res; 341 } else if (isString(value) || isObject(value)) { 342 return value; 343 } 344} 345var listDelimiterRE = /;(?![^(]*\))/g; 346var propertyDelimiterRE = /:([^]+)/; 347var styleCommentRE = /\/\*[^]*?\*\//g; 348function parseStringStyle(cssText) { 349 const ret = {}; 350 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { 351 if (item) { 352 const tmp = item.split(propertyDelimiterRE); 353 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); 354 } 355 }); 356 return ret; 357} 358function stringifyStyle(styles) { 359 let ret = ""; 360 if (!styles || isString(styles)) { 361 return ret; 362 } 363 for (const key in styles) { 364 const value = styles[key]; 365 if (isString(value) || typeof value === "number") { 366 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); 367 ret += `${normalizedKey}:${value};`; 368 } 369 } 370 return ret; 371} 372function normalizeClass(value) { 373 let res = ""; 374 if (isString(value)) { 375 res = value; 376 } else if (isArray(value)) { 377 for (let i = 0; i < value.length; i++) { 378 const normalized = normalizeClass(value[i]); 379 if (normalized) { 380 res += normalized + " "; 381 } 382 } 383 } else if (isObject(value)) { 384 for (const name in value) { 385 if (value[name]) { 386 res += name + " "; 387 } 388 } 389 } 390 return res.trim(); 391} 392function normalizeProps(props) { 393 if (!props) return null; 394 let { class: klass, style } = props; 395 if (klass && !isString(klass)) { 396 props.class = normalizeClass(klass); 397 } 398 if (style) { 399 props.style = normalizeStyle(style); 400 } 401 return props; 402} 403var 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"; 404var 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"; 405var 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"; 406var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; 407var isHTMLTag = makeMap(HTML_TAGS); 408var isSVGTag = makeMap(SVG_TAGS); 409var isMathMLTag = makeMap(MATH_TAGS); 410var isVoidTag = makeMap(VOID_TAGS); 411var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; 412var isSpecialBooleanAttr = makeMap(specialBooleanAttrs); 413var isBooleanAttr = makeMap( 414 specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` 415); 416function includeBooleanAttr(value) { 417 return !!value || value === ""; 418} 419var isKnownHtmlAttr = makeMap( 420 `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` 421); 422var isKnownSvgAttr = makeMap( 423 `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` 424); 425function isRenderableAttrValue(value) { 426 if (value == null) { 427 return false; 428 } 429 const type = typeof value; 430 return type === "string" || type === "number" || type === "boolean"; 431} 432function looseCompareArrays(a, b) { 433 if (a.length !== b.length) return false; 434 let equal = true; 435 for (let i = 0; equal && i < a.length; i++) { 436 equal = looseEqual(a[i], b[i]); 437 } 438 return equal; 439} 440function looseEqual(a, b) { 441 if (a === b) return true; 442 let aValidType = isDate(a); 443 let bValidType = isDate(b); 444 if (aValidType || bValidType) { 445 return aValidType && bValidType ? a.getTime() === b.getTime() : false; 446 } 447 aValidType = isSymbol(a); 448 bValidType = isSymbol(b); 449 if (aValidType || bValidType) { 450 return a === b; 451 } 452 aValidType = isArray(a); 453 bValidType = isArray(b); 454 if (aValidType || bValidType) { 455 return aValidType && bValidType ? looseCompareArrays(a, b) : false; 456 } 457 aValidType = isObject(a); 458 bValidType = isObject(b); 459 if (aValidType || bValidType) { 460 if (!aValidType || !bValidType) { 461 return false; 462 } 463 const aKeysCount = Object.keys(a).length; 464 const bKeysCount = Object.keys(b).length; 465 if (aKeysCount !== bKeysCount) { 466 return false; 467 } 468 for (const key in a) { 469 const aHasKey = a.hasOwnProperty(key); 470 const bHasKey = b.hasOwnProperty(key); 471 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { 472 return false; 473 } 474 } 475 } 476 return String(a) === String(b); 477} 478function looseIndexOf(arr, val) { 479 return arr.findIndex((item) => looseEqual(item, val)); 480} 481var isRef = (val) => { 482 return !!(val && val.__v_isRef === true); 483}; 484var toDisplayString = (val) => { 485 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); 486}; 487var replacer = (_key, val) => { 488 if (isRef(val)) { 489 return replacer(_key, val.value); 490 } else if (isMap(val)) { 491 return { 492 [`Map(${val.size})`]: [...val.entries()].reduce( 493 (entries, [key, val2], i) => { 494 entries[stringifySymbol(key, i) + " =>"] = val2; 495 return entries; 496 }, 497 {} 498 ) 499 }; 500 } else if (isSet(val)) { 501 return { 502 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) 503 }; 504 } else if (isSymbol(val)) { 505 return stringifySymbol(val); 506 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { 507 return String(val); 508 } 509 return val; 510}; 511var stringifySymbol = (v, i = "") => { 512 var _a; 513 return ( 514 // Symbol.description in es2019+ so we need to cast here to pass 515 // the lib: es2016 check 516 isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v 517 ); 518}; 519
vendor: 33,104 bytes, lines 520-1715
520// node_modules/.pnpm/@[email protected]/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js 521function warn(msg, ...args) { 522 console.warn(`[Vue warn] ${msg}`, ...args); 523} 524var activeEffectScope; 525var EffectScope = class { 526 constructor(detached = false) { 527 this.detached = detached; 528 this._active = true; 529 this.effects = []; 530 this.cleanups = []; 531 this.parent = activeEffectScope; 532 if (!detached && activeEffectScope) { 533 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( 534 this 535 ) - 1; 536 } 537 } 538 get active() { 539 return this._active; 540 } 541 run(fn) { 542 if (this._active) { 543 const currentEffectScope = activeEffectScope; 544 try { 545 activeEffectScope = this; 546 return fn(); 547 } finally { 548 activeEffectScope = currentEffectScope; 549 } 550 } else if (true) { 551 warn(`cannot run an inactive effect scope.`); 552 } 553 } 554 /** 555 * This should only be called on non-detached scopes 556 * @internal 557 */ 558 on() { 559 activeEffectScope = this; 560 } 561 /** 562 * This should only be called on non-detached scopes 563 * @internal 564 */ 565 off() { 566 activeEffectScope = this.parent; 567 } 568 stop(fromParent) { 569 if (this._active) { 570 let i, l; 571 for (i = 0, l = this.effects.length; i < l; i++) { 572 this.effects[i].stop(); 573 } 574 for (i = 0, l = this.cleanups.length; i < l; i++) { 575 this.cleanups[i](); 576 } 577 if (this.scopes) { 578 for (i = 0, l = this.scopes.length; i < l; i++) { 579 this.scopes[i].stop(true); 580 } 581 } 582 if (!this.detached && this.parent && !fromParent) { 583 const last = this.parent.scopes.pop(); 584 if (last && last !== this) { 585 this.parent.scopes[this.index] = last; 586 last.index = this.index; 587 } 588 } 589 this.parent = void 0; 590 this._active = false; 591 } 592 } 593}; 594function effectScope(detached) { 595 return new EffectScope(detached); 596} 597function recordEffectScope(effect2, scope = activeEffectScope) { 598 if (scope && scope.active) { 599 scope.effects.push(effect2); 600 } 601} 602function getCurrentScope() { 603 return activeEffectScope; 604} 605function onScopeDispose(fn) { 606 if (activeEffectScope) { 607 activeEffectScope.cleanups.push(fn); 608 } else if (true) { 609 warn( 610 `onScopeDispose() is called when there is no active effect scope to be associated with.` 611 ); 612 } 613} 614var activeEffect; 615var ReactiveEffect = class { 616 constructor(fn, trigger2, scheduler, scope) { 617 this.fn = fn; 618 this.trigger = trigger2; 619 this.scheduler = scheduler; 620 this.active = true; 621 this.deps = []; 622 this._dirtyLevel = 4; 623 this._trackId = 0; 624 this._runnings = 0; 625 this._shouldSchedule = false; 626 this._depsLength = 0; 627 recordEffectScope(this, scope); 628 } 629 get dirty() { 630 if (this._dirtyLevel === 2 || this._dirtyLevel === 3) { 631 this._dirtyLevel = 1; 632 pauseTracking(); 633 for (let i = 0; i < this._depsLength; i++) { 634 const dep = this.deps[i]; 635 if (dep.computed) { 636 triggerComputed(dep.computed); 637 if (this._dirtyLevel >= 4) { 638 break; 639 } 640 } 641 } 642 if (this._dirtyLevel === 1) { 643 this._dirtyLevel = 0; 644 } 645 resetTracking(); 646 } 647 return this._dirtyLevel >= 4; 648 } 649 set dirty(v) { 650 this._dirtyLevel = v ? 4 : 0; 651 } 652 run() { 653 this._dirtyLevel = 0; 654 if (!this.active) { 655 return this.fn(); 656 } 657 let lastShouldTrack = shouldTrack; 658 let lastEffect = activeEffect; 659 try { 660 shouldTrack = true; 661 activeEffect = this; 662 this._runnings++; 663 preCleanupEffect(this); 664 return this.fn(); 665 } finally { 666 postCleanupEffect(this); 667 this._runnings--; 668 activeEffect = lastEffect; 669 shouldTrack = lastShouldTrack; 670 } 671 } 672 stop() { 673 if (this.active) { 674 preCleanupEffect(this); 675 postCleanupEffect(this); 676 this.onStop && this.onStop(); 677 this.active = false; 678 } 679 } 680}; 681function triggerComputed(computed3) { 682 return computed3.value; 683} 684function preCleanupEffect(effect2) { 685 effect2._trackId++; 686 effect2._depsLength = 0; 687} 688function postCleanupEffect(effect2) { 689 if (effect2.deps.length > effect2._depsLength) { 690 for (let i = effect2._depsLength; i < effect2.deps.length; i++) { 691 cleanupDepEffect(effect2.deps[i], effect2); 692 } 693 effect2.deps.length = effect2._depsLength; 694 } 695} 696function cleanupDepEffect(dep, effect2) { 697 const trackId = dep.get(effect2); 698 if (trackId !== void 0 && effect2._trackId !== trackId) { 699 dep.delete(effect2); 700 if (dep.size === 0) { 701 dep.cleanup(); 702 } 703 } 704} 705function effect(fn, options) { 706 if (fn.effect instanceof ReactiveEffect) { 707 fn = fn.effect.fn; 708 } 709 const _effect = new ReactiveEffect(fn, NOOP, () => { 710 if (_effect.dirty) { 711 _effect.run(); 712 } 713 }); 714 if (options) { 715 extend(_effect, options); 716 if (options.scope) recordEffectScope(_effect, options.scope); 717 } 718 if (!options || !options.lazy) { 719 _effect.run(); 720 } 721 const runner = _effect.run.bind(_effect); 722 runner.effect = _effect; 723 return runner; 724} 725function stop(runner) { 726 runner.effect.stop(); 727} 728var shouldTrack = true; 729var pauseScheduleStack = 0; 730var trackStack = []; 731function pauseTracking() { 732 trackStack.push(shouldTrack); 733 shouldTrack = false; 734} 735function resetTracking() { 736 const last = trackStack.pop(); 737 shouldTrack = last === void 0 ? true : last; 738} 739function pauseScheduling() { 740 pauseScheduleStack++; 741} 742function resetScheduling() { 743 pauseScheduleStack--; 744 while (!pauseScheduleStack && queueEffectSchedulers.length) { 745 queueEffectSchedulers.shift()(); 746 } 747} 748function trackEffect(effect2, dep, debuggerEventExtraInfo) { 749 var _a; 750 if (dep.get(effect2) !== effect2._trackId) { 751 dep.set(effect2, effect2._trackId); 752 const oldDep = effect2.deps[effect2._depsLength]; 753 if (oldDep !== dep) { 754 if (oldDep) { 755 cleanupDepEffect(oldDep, effect2); 756 } 757 effect2.deps[effect2._depsLength++] = dep; 758 } else { 759 effect2._depsLength++; 760 } 761 if (true) { 762 (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo)); 763 } 764 } 765} 766var queueEffectSchedulers = []; 767function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) { 768 var _a; 769 pauseScheduling(); 770 for (const effect2 of dep.keys()) { 771 let tracking; 772 if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) { 773 effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0); 774 effect2._dirtyLevel = dirtyLevel; 775 } 776 if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) { 777 if (true) { 778 (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo)); 779 } 780 effect2.trigger(); 781 if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) { 782 effect2._shouldSchedule = false; 783 if (effect2.scheduler) { 784 queueEffectSchedulers.push(effect2.scheduler); 785 } 786 } 787 } 788 } 789 resetScheduling(); 790} 791var createDep = (cleanup, computed3) => { 792 const dep = /* @__PURE__ */ new Map(); 793 dep.cleanup = cleanup; 794 dep.computed = computed3; 795 return dep; 796}; 797var targetMap = /* @__PURE__ */ new WeakMap(); 798var ITERATE_KEY = Symbol(true ? "iterate" : ""); 799var MAP_KEY_ITERATE_KEY = Symbol(true ? "Map key iterate" : ""); 800function track(target, type, key) { 801 if (shouldTrack && activeEffect) { 802 let depsMap = targetMap.get(target); 803 if (!depsMap) { 804 targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); 805 } 806 let dep = depsMap.get(key); 807 if (!dep) { 808 depsMap.set(key, dep = createDep(() => depsMap.delete(key))); 809 } 810 trackEffect( 811 activeEffect, 812 dep, 813 true ? { 814 target, 815 type, 816 key 817 } : void 0 818 ); 819 } 820} 821function trigger(target, type, key, newValue, oldValue, oldTarget) { 822 const depsMap = targetMap.get(target); 823 if (!depsMap) { 824 return; 825 } 826 let deps = []; 827 if (type === "clear") { 828 deps = [...depsMap.values()]; 829 } else if (key === "length" && isArray(target)) { 830 const newLength = Number(newValue); 831 depsMap.forEach((dep, key2) => { 832 if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) { 833 deps.push(dep); 834 } 835 }); 836 } else { 837 if (key !== void 0) { 838 deps.push(depsMap.get(key)); 839 } 840 switch (type) { 841 case "add": 842 if (!isArray(target)) { 843 deps.push(depsMap.get(ITERATE_KEY)); 844 if (isMap(target)) { 845 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 846 } 847 } else if (isIntegerKey(key)) { 848 deps.push(depsMap.get("length")); 849 } 850 break; 851 case "delete": 852 if (!isArray(target)) { 853 deps.push(depsMap.get(ITERATE_KEY)); 854 if (isMap(target)) { 855 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 856 } 857 } 858 break; 859 case "set": 860 if (isMap(target)) { 861 deps.push(depsMap.get(ITERATE_KEY)); 862 } 863 break; 864 } 865 } 866 pauseScheduling(); 867 for (const dep of deps) { 868 if (dep) { 869 triggerEffects( 870 dep, 871 4, 872 true ? { 873 target, 874 type, 875 key, 876 newValue, 877 oldValue, 878 oldTarget 879 } : void 0 880 ); 881 } 882 } 883 resetScheduling(); 884} 885function getDepFromReactive(object, key) { 886 const depsMap = targetMap.get(object); 887 return depsMap && depsMap.get(key); 888} 889var isNonTrackableKeys = makeMap(`__proto__,__v_isRef,__isVue`); 890var builtInSymbols = new Set( 891 Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) 892); 893var arrayInstrumentations = createArrayInstrumentations(); 894function createArrayInstrumentations() { 895 const instrumentations = {}; 896 ["includes", "indexOf", "lastIndexOf"].forEach((key) => { 897 instrumentations[key] = function(...args) { 898 const arr = toRaw(this); 899 for (let i = 0, l = this.length; i < l; i++) { 900 track(arr, "get", i + ""); 901 } 902 const res = arr[key](...args); 903 if (res === -1 || res === false) { 904 return arr[key](...args.map(toRaw)); 905 } else { 906 return res; 907 } 908 }; 909 }); 910 ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { 911 instrumentations[key] = function(...args) { 912 pauseTracking(); 913 pauseScheduling(); 914 const res = toRaw(this)[key].apply(this, args); 915 resetScheduling(); 916 resetTracking(); 917 return res; 918 }; 919 }); 920 return instrumentations; 921} 922function hasOwnProperty2(key) { 923 if (!isSymbol(key)) key = String(key); 924 const obj = toRaw(this); 925 track(obj, "has", key); 926 return obj.hasOwnProperty(key); 927} 928var BaseReactiveHandler = class { 929 constructor(_isReadonly = false, _isShallow = false) { 930 this._isReadonly = _isReadonly; 931 this._isShallow = _isShallow; 932 } 933 get(target, key, receiver) { 934 const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; 935 if (key === "__v_isReactive") { 936 return !isReadonly2; 937 } else if (key === "__v_isReadonly") { 938 return isReadonly2; 939 } else if (key === "__v_isShallow") { 940 return isShallow2; 941 } else if (key === "__v_raw") { 942 if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype 943 // this means the reciever is a user proxy of the reactive proxy 944 Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { 945 return target; 946 } 947 return; 948 } 949 const targetIsArray = isArray(target); 950 if (!isReadonly2) { 951 if (targetIsArray && hasOwn(arrayInstrumentations, key)) { 952 return Reflect.get(arrayInstrumentations, key, receiver); 953 } 954 if (key === "hasOwnProperty") { 955 return hasOwnProperty2; 956 } 957 } 958 const res = Reflect.get(target, key, receiver); 959 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { 960 return res; 961 } 962 if (!isReadonly2) { 963 track(target, "get", key); 964 } 965 if (isShallow2) { 966 return res; 967 } 968 if (isRef2(res)) { 969 return targetIsArray && isIntegerKey(key) ? res : res.value; 970 } 971 if (isObject(res)) { 972 return isReadonly2 ? readonly(res) : reactive(res); 973 } 974 return res; 975 } 976}; 977var MutableReactiveHandler = class extends BaseReactiveHandler { 978 constructor(isShallow2 = false) { 979 super(false, isShallow2); 980 } 981 set(target, key, value, receiver) { 982 let oldValue = target[key]; 983 if (!this._isShallow) { 984 const isOldValueReadonly = isReadonly(oldValue); 985 if (!isShallow(value) && !isReadonly(value)) { 986 oldValue = toRaw(oldValue); 987 value = toRaw(value); 988 } 989 if (!isArray(target) && isRef2(oldValue) && !isRef2(value)) { 990 if (isOldValueReadonly) { 991 return false; 992 } else { 993 oldValue.value = value; 994 return true; 995 } 996 } 997 } 998 const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); 999 const result = Reflect.set(target, key, value, receiver); 1000 if (target === toRaw(receiver)) { 1001 if (!hadKey) { 1002 trigger(target, "add", key, value); 1003 } else if (hasChanged(value, oldValue)) { 1004 trigger(target, "set", key, value, oldValue); 1005 } 1006 } 1007 return result; 1008 } 1009 deleteProperty(target, key) { 1010 const hadKey = hasOwn(target, key); 1011 const oldValue = target[key]; 1012 const result = Reflect.deleteProperty(target, key); 1013 if (result && hadKey) { 1014 trigger(target, "delete", key, void 0, oldValue); 1015 } 1016 return result; 1017 } 1018 has(target, key) { 1019 const result = Reflect.has(target, key); 1020 if (!isSymbol(key) || !builtInSymbols.has(key)) { 1021 track(target, "has", key); 1022 } 1023 return result; 1024 } 1025 ownKeys(target) { 1026 track( 1027 target, 1028 "iterate", 1029 isArray(target) ? "length" : ITERATE_KEY 1030 ); 1031 return Reflect.ownKeys(target); 1032 } 1033}; 1034var ReadonlyReactiveHandler = class extends BaseReactiveHandler { 1035 constructor(isShallow2 = false) { 1036 super(true, isShallow2); 1037 } 1038 set(target, key) { 1039 if (true) { 1040 warn( 1041 `Set operation on key "${String(key)}" failed: target is readonly.`, 1042 target 1043 ); 1044 } 1045 return true; 1046 } 1047 deleteProperty(target, key) { 1048 if (true) { 1049 warn( 1050 `Delete operation on key "${String(key)}" failed: target is readonly.`, 1051 target 1052 ); 1053 } 1054 return true; 1055 } 1056}; 1057var mutableHandlers = new MutableReactiveHandler(); 1058var readonlyHandlers = new ReadonlyReactiveHandler(); 1059var shallowReactiveHandlers = new MutableReactiveHandler( 1060 true 1061); 1062var shallowReadonlyHandlers = new ReadonlyReactiveHandler(true); 1063var toShallow = (value) => value; 1064var getProto = (v) => Reflect.getPrototypeOf(v); 1065function get(target, key, isReadonly2 = false, isShallow2 = false) { 1066 target = target["__v_raw"]; 1067 const rawTarget = toRaw(target); 1068 const rawKey = toRaw(key); 1069 if (!isReadonly2) { 1070 if (hasChanged(key, rawKey)) { 1071 track(rawTarget, "get", key); 1072 } 1073 track(rawTarget, "get", rawKey); 1074 } 1075 const { has: has2 } = getProto(rawTarget); 1076 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 1077 if (has2.call(rawTarget, key)) { 1078 return wrap(target.get(key)); 1079 } else if (has2.call(rawTarget, rawKey)) { 1080 return wrap(target.get(rawKey)); 1081 } else if (target !== rawTarget) { 1082 target.get(key); 1083 } 1084} 1085function has(key, isReadonly2 = false) { 1086 const target = this["__v_raw"]; 1087 const rawTarget = toRaw(target); 1088 const rawKey = toRaw(key); 1089 if (!isReadonly2) { 1090 if (hasChanged(key, rawKey)) { 1091 track(rawTarget, "has", key); 1092 } 1093 track(rawTarget, "has", rawKey); 1094 } 1095 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); 1096} 1097function size(target, isReadonly2 = false) { 1098 target = target["__v_raw"]; 1099 !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY); 1100 return Reflect.get(target, "size", target); 1101} 1102function add(value, _isShallow = false) { 1103 if (!_isShallow && !isShallow(value) && !isReadonly(value)) { 1104 value = toRaw(value); 1105 } 1106 const target = toRaw(this); 1107 const proto = getProto(target); 1108 const hadKey = proto.has.call(target, value); 1109 if (!hadKey) { 1110 target.add(value); 1111 trigger(target, "add", value, value); 1112 } 1113 return this; 1114} 1115function set(key, value, _isShallow = false) { 1116 if (!_isShallow && !isShallow(value) && !isReadonly(value)) { 1117 value = toRaw(value); 1118 } 1119 const target = toRaw(this); 1120 const { has: has2, get: get2 } = getProto(target); 1121 let hadKey = has2.call(target, key); 1122 if (!hadKey) { 1123 key = toRaw(key); 1124 hadKey = has2.call(target, key); 1125 } else if (true) { 1126 checkIdentityKeys(target, has2, key); 1127 } 1128 const oldValue = get2.call(target, key); 1129 target.set(key, value); 1130 if (!hadKey) { 1131 trigger(target, "add", key, value); 1132 } else if (hasChanged(value, oldValue)) { 1133 trigger(target, "set", key, value, oldValue); 1134 } 1135 return this; 1136} 1137function deleteEntry(key) { 1138 const target = toRaw(this); 1139 const { has: has2, get: get2 } = getProto(target); 1140 let hadKey = has2.call(target, key); 1141 if (!hadKey) { 1142 key = toRaw(key); 1143 hadKey = has2.call(target, key); 1144 } else if (true) { 1145 checkIdentityKeys(target, has2, key); 1146 } 1147 const oldValue = get2 ? get2.call(target, key) : void 0; 1148 const result = target.delete(key); 1149 if (hadKey) { 1150 trigger(target, "delete", key, void 0, oldValue); 1151 } 1152 return result; 1153} 1154function clear() { 1155 const target = toRaw(this); 1156 const hadItems = target.size !== 0; 1157 const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0; 1158 const result = target.clear(); 1159 if (hadItems) { 1160 trigger(target, "clear", void 0, void 0, oldTarget); 1161 } 1162 return result; 1163} 1164function createForEach(isReadonly2, isShallow2) { 1165 return function forEach(callback, thisArg) { 1166 const observed = this; 1167 const target = observed["__v_raw"]; 1168 const rawTarget = toRaw(target); 1169 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 1170 !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); 1171 return target.forEach((value, key) => { 1172 return callback.call(thisArg, wrap(value), wrap(key), observed); 1173 }); 1174 }; 1175} 1176function createIterableMethod(method, isReadonly2, isShallow2) { 1177 return function(...args) { 1178 const target = this["__v_raw"]; 1179 const rawTarget = toRaw(target); 1180 const targetIsMap = isMap(rawTarget); 1181 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; 1182 const isKeyOnly = method === "keys" && targetIsMap; 1183 const innerIterator = target[method](...args); 1184 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 1185 !isReadonly2 && track( 1186 rawTarget, 1187 "iterate", 1188 isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY 1189 ); 1190 return { 1191 // iterator protocol 1192 next() { 1193 const { value, done } = innerIterator.next(); 1194 return done ? { value, done } : { 1195 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), 1196 done 1197 }; 1198 }, 1199 // iterable protocol 1200 [Symbol.iterator]() { 1201 return this; 1202 } 1203 }; 1204 }; 1205} 1206function createReadonlyMethod(type) { 1207 return function(...args) { 1208 if (true) { 1209 const key = args[0] ? `on key "${args[0]}" ` : ``; 1210 warn( 1211 `${capitalize(type)} operation ${key}failed: target is readonly.`, 1212 toRaw(this) 1213 ); 1214 } 1215 return type === "delete" ? false : type === "clear" ? void 0 : this; 1216 }; 1217} 1218function createInstrumentations() { 1219 const mutableInstrumentations2 = { 1220 get(key) { 1221 return get(this, key); 1222 }, 1223 get size() { 1224 return size(this); 1225 }, 1226 has, 1227 add, 1228 set, 1229 delete: deleteEntry, 1230 clear, 1231 forEach: createForEach(false, false) 1232 }; 1233 const shallowInstrumentations2 = { 1234 get(key) { 1235 return get(this, key, false, true); 1236 }, 1237 get size() { 1238 return size(this); 1239 }, 1240 has, 1241 add(value) { 1242 return add.call(this, value, true); 1243 }, 1244 set(key, value) { 1245 return set.call(this, key, value, true); 1246 }, 1247 delete: deleteEntry, 1248 clear, 1249 forEach: createForEach(false, true) 1250 }; 1251 const readonlyInstrumentations2 = { 1252 get(key) { 1253 return get(this, key, true); 1254 }, 1255 get size() { 1256 return size(this, true); 1257 }, 1258 has(key) { 1259 return has.call(this, key, true); 1260 }, 1261 add: createReadonlyMethod("add"), 1262 set: createReadonlyMethod("set"), 1263 delete: createReadonlyMethod("delete"), 1264 clear: createReadonlyMethod("clear"), 1265 forEach: createForEach(true, false) 1266 }; 1267 const shallowReadonlyInstrumentations2 = { 1268 get(key) { 1269 return get(this, key, true, true); 1270 }, 1271 get size() { 1272 return size(this, true); 1273 }, 1274 has(key) { 1275 return has.call(this, key, true); 1276 }, 1277 add: createReadonlyMethod("add"), 1278 set: createReadonlyMethod("set"), 1279 delete: createReadonlyMethod("delete"), 1280 clear: createReadonlyMethod("clear"), 1281 forEach: createForEach(true, true) 1282 }; 1283 const iteratorMethods = [ 1284 "keys", 1285 "values", 1286 "entries", 1287 Symbol.iterator 1288 ]; 1289 iteratorMethods.forEach((method) => { 1290 mutableInstrumentations2[method] = createIterableMethod(method, false, false); 1291 readonlyInstrumentations2[method] = createIterableMethod(method, true, false); 1292 shallowInstrumentations2[method] = createIterableMethod(method, false, true); 1293 shallowReadonlyInstrumentations2[method] = createIterableMethod( 1294 method, 1295 true, 1296 true 1297 ); 1298 }); 1299 return [ 1300 mutableInstrumentations2, 1301 readonlyInstrumentations2, 1302 shallowInstrumentations2, 1303 shallowReadonlyInstrumentations2 1304 ]; 1305} 1306var [ 1307 mutableInstrumentations, 1308 readonlyInstrumentations, 1309 shallowInstrumentations, 1310 shallowReadonlyInstrumentations 1311] = createInstrumentations(); 1312function createInstrumentationGetter(isReadonly2, shallow) { 1313 const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; 1314 return (target, key, receiver) => { 1315 if (key === "__v_isReactive") { 1316 return !isReadonly2; 1317 } else if (key === "__v_isReadonly") { 1318 return isReadonly2; 1319 } else if (key === "__v_raw") { 1320 return target; 1321 } 1322 return Reflect.get( 1323 hasOwn(instrumentations, key) && key in target ? instrumentations : target, 1324 key, 1325 receiver 1326 ); 1327 }; 1328} 1329var mutableCollectionHandlers = { 1330 get: createInstrumentationGetter(false, false) 1331}; 1332var shallowCollectionHandlers = { 1333 get: createInstrumentationGetter(false, true) 1334}; 1335var readonlyCollectionHandlers = { 1336 get: createInstrumentationGetter(true, false) 1337}; 1338var shallowReadonlyCollectionHandlers = { 1339 get: createInstrumentationGetter(true, true) 1340}; 1341function checkIdentityKeys(target, has2, key) { 1342 const rawKey = toRaw(key); 1343 if (rawKey !== key && has2.call(target, rawKey)) { 1344 const type = toRawType(target); 1345 warn( 1346 `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.` 1347 ); 1348 } 1349} 1350var reactiveMap = /* @__PURE__ */ new WeakMap(); 1351var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); 1352var readonlyMap = /* @__PURE__ */ new WeakMap(); 1353var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); 1354function targetTypeMap(rawType) { 1355 switch (rawType) { 1356 case "Object": 1357 case "Array": 1358 return 1; 1359 case "Map": 1360 case "Set": 1361 case "WeakMap": 1362 case "WeakSet": 1363 return 2; 1364 default: 1365 return 0; 1366 } 1367} 1368function getTargetType(value) { 1369 return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); 1370} 1371function reactive(target) { 1372 if (isReadonly(target)) { 1373 return target; 1374 } 1375 return createReactiveObject( 1376 target, 1377 false, 1378 mutableHandlers, 1379 mutableCollectionHandlers, 1380 reactiveMap 1381 ); 1382} 1383function shallowReactive(target) { 1384 return createReactiveObject( 1385 target, 1386 false, 1387 shallowReactiveHandlers, 1388 shallowCollectionHandlers, 1389 shallowReactiveMap 1390 ); 1391} 1392function readonly(target) { 1393 return createReactiveObject( 1394 target, 1395 true, 1396 readonlyHandlers, 1397 readonlyCollectionHandlers, 1398 readonlyMap 1399 ); 1400} 1401function shallowReadonly(target) { 1402 return createReactiveObject( 1403 target, 1404 true, 1405 shallowReadonlyHandlers, 1406 shallowReadonlyCollectionHandlers, 1407 shallowReadonlyMap 1408 ); 1409} 1410function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { 1411 if (!isObject(target)) { 1412 if (true) { 1413 warn( 1414 `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( 1415 target 1416 )}` 1417 ); 1418 } 1419 return target; 1420 } 1421 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { 1422 return target; 1423 } 1424 const existingProxy = proxyMap.get(target); 1425 if (existingProxy) { 1426 return existingProxy; 1427 } 1428 const targetType = getTargetType(target); 1429 if (targetType === 0) { 1430 return target; 1431 } 1432 const proxy = new Proxy( 1433 target, 1434 targetType === 2 ? collectionHandlers : baseHandlers 1435 ); 1436 proxyMap.set(target, proxy); 1437 return proxy; 1438} 1439function isReactive(value) { 1440 if (isReadonly(value)) { 1441 return isReactive(value["__v_raw"]); 1442 } 1443 return !!(value && value["__v_isReactive"]); 1444} 1445function isReadonly(value) { 1446 return !!(value && value["__v_isReadonly"]); 1447} 1448function isShallow(value) { 1449 return !!(value && value["__v_isShallow"]); 1450} 1451function isProxy(value) { 1452 return value ? !!value["__v_raw"] : false; 1453} 1454function toRaw(observed) { 1455 const raw = observed && observed["__v_raw"]; 1456 return raw ? toRaw(raw) : observed; 1457} 1458function markRaw(value) { 1459 if (Object.isExtensible(value)) { 1460 def(value, "__v_skip", true); 1461 } 1462 return value; 1463} 1464var toReactive = (value) => isObject(value) ? reactive(value) : value; 1465var toReadonly = (value) => isObject(value) ? readonly(value) : value; 1466var COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`; 1467var ComputedRefImpl = class { 1468 constructor(getter, _setter, isReadonly2, isSSR) { 1469 this.getter = getter; 1470 this._setter = _setter; 1471 this.dep = void 0; 1472 this.__v_isRef = true; 1473 this["__v_isReadonly"] = false; 1474 this.effect = new ReactiveEffect( 1475 () => getter(this._value), 1476 () => triggerRefValue( 1477 this, 1478 this.effect._dirtyLevel === 2 ? 2 : 3 1479 ) 1480 ); 1481 this.effect.computed = this; 1482 this.effect.active = this._cacheable = !isSSR; 1483 this["__v_isReadonly"] = isReadonly2; 1484 } 1485 get value() { 1486 const self2 = toRaw(this); 1487 if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) { 1488 triggerRefValue(self2, 4); 1489 } 1490 trackRefValue(self2); 1491 if (self2.effect._dirtyLevel >= 2) { 1492 if (this._warnRecursive) { 1493 warn(COMPUTED_SIDE_EFFECT_WARN, ` 1494 1495getter: `, this.getter); 1496 } 1497 triggerRefValue(self2, 2); 1498 } 1499 return self2._value; 1500 } 1501 set value(newValue) { 1502 this._setter(newValue); 1503 } 1504 // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x 1505 get _dirty() { 1506 return this.effect.dirty; 1507 } 1508 set _dirty(v) { 1509 this.effect.dirty = v; 1510 } 1511 // #endregion 1512}; 1513function computed(getterOrOptions, debugOptions, isSSR = false) { 1514 let getter; 1515 let setter; 1516 const onlyGetter = isFunction(getterOrOptions); 1517 if (onlyGetter) { 1518 getter = getterOrOptions; 1519 setter = true ? () => { 1520 warn("Write operation failed: computed value is readonly"); 1521 } : NOOP; 1522 } else { 1523 getter = getterOrOptions.get; 1524 setter = getterOrOptions.set; 1525 } 1526 const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); 1527 if (debugOptions && !isSSR) { 1528 cRef.effect.onTrack = debugOptions.onTrack; 1529 cRef.effect.onTrigger = debugOptions.onTrigger; 1530 } 1531 return cRef; 1532} 1533function trackRefValue(ref2) { 1534 var _a; 1535 if (shouldTrack && activeEffect) { 1536 ref2 = toRaw(ref2); 1537 trackEffect( 1538 activeEffect, 1539 (_a = ref2.dep) != null ? _a : ref2.dep = createDep( 1540 () => ref2.dep = void 0, 1541 ref2 instanceof ComputedRefImpl ? ref2 : void 0 1542 ), 1543 true ? { 1544 target: ref2, 1545 type: "get", 1546 key: "value" 1547 } : void 0 1548 ); 1549 } 1550} 1551function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) { 1552 ref2 = toRaw(ref2); 1553 const dep = ref2.dep; 1554 if (dep) { 1555 triggerEffects( 1556 dep, 1557 dirtyLevel, 1558 true ? { 1559 target: ref2, 1560 type: "set", 1561 key: "value", 1562 newValue: newVal, 1563 oldValue: oldVal 1564 } : void 0 1565 ); 1566 } 1567} 1568function isRef2(r) { 1569 return !!(r && r.__v_isRef === true); 1570} 1571function ref(value) { 1572 return createRef(value, false); 1573} 1574function shallowRef(value) { 1575 return createRef(value, true); 1576} 1577function createRef(rawValue, shallow) { 1578 if (isRef2(rawValue)) { 1579 return rawValue; 1580 } 1581 return new RefImpl(rawValue, shallow); 1582} 1583var RefImpl = class { 1584 constructor(value, __v_isShallow) { 1585 this.__v_isShallow = __v_isShallow; 1586 this.dep = void 0; 1587 this.__v_isRef = true; 1588 this._rawValue = __v_isShallow ? value : toRaw(value); 1589 this._value = __v_isShallow ? value : toReactive(value); 1590 } 1591 get value() { 1592 trackRefValue(this); 1593 return this._value; 1594 } 1595 set value(newVal) { 1596 const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); 1597 newVal = useDirectValue ? newVal : toRaw(newVal); 1598 if (hasChanged(newVal, this._rawValue)) { 1599 const oldVal = this._rawValue; 1600 this._rawValue = newVal; 1601 this._value = useDirectValue ? newVal : toReactive(newVal); 1602 triggerRefValue(this, 4, newVal, oldVal); 1603 } 1604 } 1605}; 1606function triggerRef(ref2) { 1607 triggerRefValue(ref2, 4, true ? ref2.value : void 0); 1608} 1609function unref(ref2) { 1610 return isRef2(ref2) ? ref2.value : ref2; 1611} 1612function toValue(source) { 1613 return isFunction(source) ? source() : unref(source); 1614} 1615var shallowUnwrapHandlers = { 1616 get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), 1617 set: (target, key, value, receiver) => { 1618 const oldValue = target[key]; 1619 if (isRef2(oldValue) && !isRef2(value)) { 1620 oldValue.value = value; 1621 return true; 1622 } else { 1623 return Reflect.set(target, key, value, receiver); 1624 } 1625 } 1626}; 1627function proxyRefs(objectWithRefs) { 1628 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); 1629} 1630var CustomRefImpl = class { 1631 constructor(factory) { 1632 this.dep = void 0; 1633 this.__v_isRef = true; 1634 const { get: get2, set: set2 } = factory( 1635 () => trackRefValue(this), 1636 () => triggerRefValue(this) 1637 ); 1638 this._get = get2; 1639 this._set = set2; 1640 } 1641 get value() { 1642 return this._get(); 1643 } 1644 set value(newVal) { 1645 this._set(newVal); 1646 } 1647}; 1648function customRef(factory) { 1649 return new CustomRefImpl(factory); 1650} 1651function toRefs(object) { 1652 if (!isProxy(object)) { 1653 warn(`toRefs() expects a reactive object but received a plain one.`); 1654 } 1655 const ret = isArray(object) ? new Array(object.length) : {}; 1656 for (const key in object) { 1657 ret[key] = propertyToRef(object, key); 1658 } 1659 return ret; 1660} 1661var ObjectRefImpl = class { 1662 constructor(_object, _key, _defaultValue) { 1663 this._object = _object; 1664 this._key = _key; 1665 this._defaultValue = _defaultValue; 1666 this.__v_isRef = true; 1667 } 1668 get value() { 1669 const val = this._object[this._key]; 1670 return val === void 0 ? this._defaultValue : val; 1671 } 1672 set value(newVal) { 1673 this._object[this._key] = newVal; 1674 } 1675 get dep() { 1676 return getDepFromReactive(toRaw(this._object), this._key); 1677 } 1678}; 1679var GetterRefImpl = class { 1680 constructor(_getter) { 1681 this._getter = _getter; 1682 this.__v_isRef = true; 1683 this.__v_isReadonly = true; 1684 } 1685 get value() { 1686 return this._getter(); 1687 } 1688}; 1689function toRef(source, key, defaultValue) { 1690 if (isRef2(source)) { 1691 return source; 1692 } else if (isFunction(source)) { 1693 return new GetterRefImpl(source); 1694 } else if (isObject(source) && arguments.length > 1) { 1695 return propertyToRef(source, key, defaultValue); 1696 } else { 1697 return ref(source); 1698 } 1699} 1700function propertyToRef(source, key, defaultValue) { 1701 const val = source[key]; 1702 return isRef2(val) ? val : new ObjectRefImpl(source, key, defaultValue); 1703} 1704var TrackOpTypes = { 1705 "GET": "get", 1706 "HAS": "has", 1707 "ITERATE": "iterate" 1708}; 1709var TriggerOpTypes = { 1710 "SET": "set", 1711 "ADD": "add", 1712 "DELETE": "delete", 1713 "CLEAR": "clear" 1714}; 1715
vendor: 241,221 bytes, lines 1716-9885
1716// node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js 1717var stack = []; 1718function pushWarningContext(vnode) { 1719 stack.push(vnode); 1720} 1721function popWarningContext() { 1722 stack.pop(); 1723} 1724var isWarning = false; 1725function warn$1(msg, ...args) { 1726 if (isWarning) return; 1727 isWarning = true; 1728 pauseTracking(); 1729 const instance = stack.length ? stack[stack.length - 1].component : null; 1730 const appWarnHandler = instance && instance.appContext.config.warnHandler; 1731 const trace = getComponentTrace(); 1732 if (appWarnHandler) { 1733 callWithErrorHandling( 1734 appWarnHandler, 1735 instance, 1736 11, 1737 [ 1738 // eslint-disable-next-line no-restricted-syntax 1739 msg + args.map((a) => { 1740 var _a, _b; 1741 return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); 1742 }).join(""), 1743 instance && instance.proxy, 1744 trace.map( 1745 ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` 1746 ).join("\n"), 1747 trace 1748 ] 1749 ); 1750 } else { 1751 const warnArgs = [`[Vue warn]: ${msg}`, ...args]; 1752 if (trace.length && // avoid spamming console during tests 1753 true) { 1754 warnArgs.push(` 1755`, ...formatTrace(trace)); 1756 } 1757 console.warn(...warnArgs); 1758 } 1759 resetTracking(); 1760 isWarning = false; 1761} 1762function getComponentTrace() { 1763 let currentVNode = stack[stack.length - 1]; 1764 if (!currentVNode) { 1765 return []; 1766 } 1767 const normalizedStack = []; 1768 while (currentVNode) { 1769 const last = normalizedStack[0]; 1770 if (last && last.vnode === currentVNode) { 1771 last.recurseCount++; 1772 } else { 1773 normalizedStack.push({ 1774 vnode: currentVNode, 1775 recurseCount: 0 1776 }); 1777 } 1778 const parentInstance = currentVNode.component && currentVNode.component.parent; 1779 currentVNode = parentInstance && parentInstance.vnode; 1780 } 1781 return normalizedStack; 1782} 1783function formatTrace(trace) { 1784 const logs = []; 1785 trace.forEach((entry, i) => { 1786 logs.push(...i === 0 ? [] : [` 1787`], ...formatTraceEntry(entry)); 1788 }); 1789 return logs; 1790} 1791function formatTraceEntry({ vnode, recurseCount }) { 1792 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; 1793 const isRoot = vnode.component ? vnode.component.parent == null : false; 1794 const open = ` at <${formatComponentName( 1795 vnode.component, 1796 vnode.type, 1797 isRoot 1798 )}`; 1799 const close = `>` + postfix; 1800 return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; 1801} 1802function formatProps(props) { 1803 const res = []; 1804 const keys = Object.keys(props); 1805 keys.slice(0, 3).forEach((key) => { 1806 res.push(...formatProp(key, props[key])); 1807 }); 1808 if (keys.length > 3) { 1809 res.push(` ...`); 1810 } 1811 return res; 1812} 1813function formatProp(key, value, raw) { 1814 if (isString(value)) { 1815 value = JSON.stringify(value); 1816 return raw ? value : [`${key}=${value}`]; 1817 } else if (typeof value === "number" || typeof value === "boolean" || value == null) { 1818 return raw ? value : [`${key}=${value}`]; 1819 } else if (isRef2(value)) { 1820 value = formatProp(key, toRaw(value.value), true); 1821 return raw ? value : [`${key}=Ref<`, value, `>`]; 1822 } else if (isFunction(value)) { 1823 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; 1824 } else { 1825 value = toRaw(value); 1826 return raw ? value : [`${key}=`, value]; 1827 } 1828} 1829function assertNumber(val, type) { 1830 if (false) return; 1831 if (val === void 0) { 1832 return; 1833 } else if (typeof val !== "number") { 1834 warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); 1835 } else if (isNaN(val)) { 1836 warn$1(`${type} is NaN - the duration expression might be incorrect.`); 1837 } 1838} 1839var ErrorCodes = { 1840 "SETUP_FUNCTION": 0, 1841 "0": "SETUP_FUNCTION", 1842 "RENDER_FUNCTION": 1, 1843 "1": "RENDER_FUNCTION", 1844 "WATCH_GETTER": 2, 1845 "2": "WATCH_GETTER", 1846 "WATCH_CALLBACK": 3, 1847 "3": "WATCH_CALLBACK", 1848 "WATCH_CLEANUP": 4, 1849 "4": "WATCH_CLEANUP", 1850 "NATIVE_EVENT_HANDLER": 5, 1851 "5": "NATIVE_EVENT_HANDLER", 1852 "COMPONENT_EVENT_HANDLER": 6, 1853 "6": "COMPONENT_EVENT_HANDLER", 1854 "VNODE_HOOK": 7, 1855 "7": "VNODE_HOOK", 1856 "DIRECTIVE_HOOK": 8, 1857 "8": "DIRECTIVE_HOOK", 1858 "TRANSITION_HOOK": 9, 1859 "9": "TRANSITION_HOOK", 1860 "APP_ERROR_HANDLER": 10, 1861 "10": "APP_ERROR_HANDLER", 1862 "APP_WARN_HANDLER": 11, 1863 "11": "APP_WARN_HANDLER", 1864 "FUNCTION_REF": 12, 1865 "12": "FUNCTION_REF", 1866 "ASYNC_COMPONENT_LOADER": 13, 1867 "13": "ASYNC_COMPONENT_LOADER", 1868 "SCHEDULER": 14, 1869 "14": "SCHEDULER", 1870 "COMPONENT_UPDATE": 15, 1871 "15": "COMPONENT_UPDATE" 1872}; 1873var ErrorTypeStrings$1 = { 1874 ["sp"]: "serverPrefetch hook", 1875 ["bc"]: "beforeCreate hook", 1876 ["c"]: "created hook", 1877 ["bm"]: "beforeMount hook", 1878 ["m"]: "mounted hook", 1879 ["bu"]: "beforeUpdate hook", 1880 ["u"]: "updated", 1881 ["bum"]: "beforeUnmount hook", 1882 ["um"]: "unmounted hook", 1883 ["a"]: "activated hook", 1884 ["da"]: "deactivated hook", 1885 ["ec"]: "errorCaptured hook", 1886 ["rtc"]: "renderTracked hook", 1887 ["rtg"]: "renderTriggered hook", 1888 [0]: "setup function", 1889 [1]: "render function", 1890 [2]: "watcher getter", 1891 [3]: "watcher callback", 1892 [4]: "watcher cleanup function", 1893 [5]: "native event handler", 1894 [6]: "component event handler", 1895 [7]: "vnode hook", 1896 [8]: "directive hook", 1897 [9]: "transition hook", 1898 [10]: "app errorHandler", 1899 [11]: "app warnHandler", 1900 [12]: "ref function", 1901 [13]: "async component loader", 1902 [14]: "scheduler flush", 1903 [15]: "component update" 1904}; 1905function callWithErrorHandling(fn, instance, type, args) { 1906 try { 1907 return args ? fn(...args) : fn(); 1908 } catch (err) { 1909 handleError(err, instance, type); 1910 } 1911} 1912function callWithAsyncErrorHandling(fn, instance, type, args) { 1913 if (isFunction(fn)) { 1914 const res = callWithErrorHandling(fn, instance, type, args); 1915 if (res && isPromise(res)) { 1916 res.catch((err) => { 1917 handleError(err, instance, type); 1918 }); 1919 } 1920 return res; 1921 } 1922 if (isArray(fn)) { 1923 const values = []; 1924 for (let i = 0; i < fn.length; i++) { 1925 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); 1926 } 1927 return values; 1928 } else if (true) { 1929 warn$1( 1930 `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` 1931 ); 1932 } 1933} 1934function handleError(err, instance, type, throwInDev = true) { 1935 const contextVNode = instance ? instance.vnode : null; 1936 if (instance) { 1937 let cur = instance.parent; 1938 const exposedInstance = instance.proxy; 1939 const errorInfo = true ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; 1940 while (cur) { 1941 const errorCapturedHooks = cur.ec; 1942 if (errorCapturedHooks) { 1943 for (let i = 0; i < errorCapturedHooks.length; i++) { 1944 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { 1945 return; 1946 } 1947 } 1948 } 1949 cur = cur.parent; 1950 } 1951 const appErrorHandler = instance.appContext.config.errorHandler; 1952 if (appErrorHandler) { 1953 pauseTracking(); 1954 callWithErrorHandling( 1955 appErrorHandler, 1956 null, 1957 10, 1958 [err, exposedInstance, errorInfo] 1959 ); 1960 resetTracking(); 1961 return; 1962 } 1963 } 1964 logError(err, type, contextVNode, throwInDev); 1965} 1966function logError(err, type, contextVNode, throwInDev = true) { 1967 if (true) { 1968 const info = ErrorTypeStrings$1[type]; 1969 if (contextVNode) { 1970 pushWarningContext(contextVNode); 1971 } 1972 warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); 1973 if (contextVNode) { 1974 popWarningContext(); 1975 } 1976 if (throwInDev) { 1977 throw err; 1978 } else { 1979 console.error(err); 1980 } 1981 } else { 1982 console.error(err); 1983 } 1984} 1985var isFlushing = false; 1986var isFlushPending = false; 1987var queue = []; 1988var flushIndex = 0; 1989var pendingPostFlushCbs = []; 1990var activePostFlushCbs = null; 1991var postFlushIndex = 0; 1992var resolvedPromise = Promise.resolve(); 1993var currentFlushPromise = null; 1994var RECURSION_LIMIT = 100; 1995function nextTick(fn) { 1996 const p2 = currentFlushPromise || resolvedPromise; 1997 return fn ? p2.then(this ? fn.bind(this) : fn) : p2; 1998} 1999function findInsertionIndex(id) { 2000 let start = flushIndex + 1; 2001 let end = queue.length; 2002 while (start < end) { 2003 const middle = start + end >>> 1; 2004 const middleJob = queue[middle]; 2005 const middleJobId = getId(middleJob); 2006 if (middleJobId < id || middleJobId === id && middleJob.pre) { 2007 start = middle + 1; 2008 } else { 2009 end = middle; 2010 } 2011 } 2012 return start; 2013} 2014function queueJob(job) { 2015 if (!queue.length || !queue.includes( 2016 job, 2017 isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex 2018 )) { 2019 if (job.id == null) { 2020 queue.push(job); 2021 } else { 2022 queue.splice(findInsertionIndex(job.id), 0, job); 2023 } 2024 queueFlush(); 2025 } 2026} 2027function queueFlush() { 2028 if (!isFlushing && !isFlushPending) { 2029 isFlushPending = true; 2030 currentFlushPromise = resolvedPromise.then(flushJobs); 2031 } 2032} 2033function invalidateJob(job) { 2034 const i = queue.indexOf(job); 2035 if (i > flushIndex) { 2036 queue.splice(i, 1); 2037 } 2038} 2039function queuePostFlushCb(cb) { 2040 if (!isArray(cb)) { 2041 if (!activePostFlushCbs || !activePostFlushCbs.includes( 2042 cb, 2043 cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex 2044 )) { 2045 pendingPostFlushCbs.push(cb); 2046 } 2047 } else { 2048 pendingPostFlushCbs.push(...cb); 2049 } 2050 queueFlush(); 2051} 2052function flushPreFlushCbs(instance, seen2, i = isFlushing ? flushIndex + 1 : 0) { 2053 if (true) { 2054 seen2 = seen2 || /* @__PURE__ */ new Map(); 2055 } 2056 for (; i < queue.length; i++) { 2057 const cb = queue[i]; 2058 if (cb && cb.pre) { 2059 if (instance && cb.id !== instance.uid) { 2060 continue; 2061 } 2062 if (checkRecursiveUpdates(seen2, cb)) { 2063 continue; 2064 } 2065 queue.splice(i, 1); 2066 i--; 2067 cb(); 2068 } 2069 } 2070} 2071function flushPostFlushCbs(seen2) { 2072 if (pendingPostFlushCbs.length) { 2073 const deduped = [...new Set(pendingPostFlushCbs)].sort( 2074 (a, b) => getId(a) - getId(b) 2075 ); 2076 pendingPostFlushCbs.length = 0; 2077 if (activePostFlushCbs) { 2078 activePostFlushCbs.push(...deduped); 2079 return; 2080 } 2081 activePostFlushCbs = deduped; 2082 if (true) { 2083 seen2 = seen2 || /* @__PURE__ */ new Map(); 2084 } 2085 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { 2086 const cb = activePostFlushCbs[postFlushIndex]; 2087 if (checkRecursiveUpdates(seen2, cb)) { 2088 continue; 2089 } 2090 if (cb.active !== false) cb(); 2091 } 2092 activePostFlushCbs = null; 2093 postFlushIndex = 0; 2094 } 2095} 2096var getId = (job) => job.id == null ? Infinity : job.id; 2097var comparator = (a, b) => { 2098 const diff = getId(a) - getId(b); 2099 if (diff === 0) { 2100 if (a.pre && !b.pre) return -1; 2101 if (b.pre && !a.pre) return 1; 2102 } 2103 return diff; 2104}; 2105function flushJobs(seen2) { 2106 isFlushPending = false; 2107 isFlushing = true; 2108 if (true) { 2109 seen2 = seen2 || /* @__PURE__ */ new Map(); 2110 } 2111 queue.sort(comparator); 2112 const check = true ? (job) => checkRecursiveUpdates(seen2, job) : NOOP; 2113 try { 2114 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { 2115 const job = queue[flushIndex]; 2116 if (job && job.active !== false) { 2117 if (check(job)) { 2118 continue; 2119 } 2120 callWithErrorHandling( 2121 job, 2122 job.i, 2123 job.i ? 15 : 14 2124 ); 2125 } 2126 } 2127 } finally { 2128 flushIndex = 0; 2129 queue.length = 0; 2130 flushPostFlushCbs(seen2); 2131 isFlushing = false; 2132 currentFlushPromise = null; 2133 if (queue.length || pendingPostFlushCbs.length) { 2134 flushJobs(seen2); 2135 } 2136 } 2137} 2138function checkRecursiveUpdates(seen2, fn) { 2139 if (!seen2.has(fn)) { 2140 seen2.set(fn, 1); 2141 } else { 2142 const count = seen2.get(fn); 2143 if (count > RECURSION_LIMIT) { 2144 const instance = fn.i; 2145 const componentName = instance && getComponentName(instance.type); 2146 handleError( 2147 `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.`, 2148 null, 2149 10 2150 ); 2151 return true; 2152 } else { 2153 seen2.set(fn, count + 1); 2154 } 2155 } 2156} 2157var isHmrUpdating = false; 2158var hmrDirtyComponents = /* @__PURE__ */ new Map(); 2159if (true) { 2160 getGlobalThis().__VUE_HMR_RUNTIME__ = { 2161 createRecord: tryWrap(createRecord), 2162 rerender: tryWrap(rerender), 2163 reload: tryWrap(reload) 2164 }; 2165} 2166var map = /* @__PURE__ */ new Map(); 2167function registerHMR(instance) { 2168 const id = instance.type.__hmrId; 2169 let record = map.get(id); 2170 if (!record) { 2171 createRecord(id, instance.type); 2172 record = map.get(id); 2173 } 2174 record.instances.add(instance); 2175} 2176function unregisterHMR(instance) { 2177 map.get(instance.type.__hmrId).instances.delete(instance); 2178} 2179function createRecord(id, initialDef) { 2180 if (map.has(id)) { 2181 return false; 2182 } 2183 map.set(id, { 2184 initialDef: normalizeClassComponent(initialDef), 2185 instances: /* @__PURE__ */ new Set() 2186 }); 2187 return true; 2188} 2189function normalizeClassComponent(component) { 2190 return isClassComponent(component) ? component.__vccOpts : component; 2191} 2192function rerender(id, newRender) { 2193 const record = map.get(id); 2194 if (!record) { 2195 return; 2196 } 2197 record.initialDef.render = newRender; 2198 [...record.instances].forEach((instance) => { 2199 if (newRender) { 2200 instance.render = newRender; 2201 normalizeClassComponent(instance.type).render = newRender; 2202 } 2203 instance.renderCache = []; 2204 isHmrUpdating = true; 2205 instance.effect.dirty = true; 2206 instance.update(); 2207 isHmrUpdating = false; 2208 }); 2209} 2210function reload(id, newComp) { 2211 const record = map.get(id); 2212 if (!record) return; 2213 newComp = normalizeClassComponent(newComp); 2214 updateComponentDef(record.initialDef, newComp); 2215 const instances = [...record.instances]; 2216 for (let i = 0; i < instances.length; i++) { 2217 const instance = instances[i]; 2218 const oldComp = normalizeClassComponent(instance.type); 2219 let dirtyInstances = hmrDirtyComponents.get(oldComp); 2220 if (!dirtyInstances) { 2221 if (oldComp !== record.initialDef) { 2222 updateComponentDef(oldComp, newComp); 2223 } 2224 hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); 2225 } 2226 dirtyInstances.add(instance); 2227 instance.appContext.propsCache.delete(instance.type); 2228 instance.appContext.emitsCache.delete(instance.type); 2229 instance.appContext.optionsCache.delete(instance.type); 2230 if (instance.ceReload) { 2231 dirtyInstances.add(instance); 2232 instance.ceReload(newComp.styles); 2233 dirtyInstances.delete(instance); 2234 } else if (instance.parent) { 2235 instance.parent.effect.dirty = true; 2236 queueJob(() => { 2237 instance.parent.update(); 2238 dirtyInstances.delete(instance); 2239 }); 2240 } else if (instance.appContext.reload) { 2241 instance.appContext.reload(); 2242 } else if (typeof window !== "undefined") { 2243 window.location.reload(); 2244 } else { 2245 console.warn( 2246 "[HMR] Root or manually mounted instance modified. Full reload required." 2247 ); 2248 } 2249 } 2250 queuePostFlushCb(() => { 2251 hmrDirtyComponents.clear(); 2252 }); 2253} 2254function updateComponentDef(oldComp, newComp) { 2255 extend(oldComp, newComp); 2256 for (const key in oldComp) { 2257 if (key !== "__file" && !(key in newComp)) { 2258 delete oldComp[key]; 2259 } 2260 } 2261} 2262function tryWrap(fn) { 2263 return (id, arg) => { 2264 try { 2265 return fn(id, arg); 2266 } catch (e) { 2267 console.error(e); 2268 console.warn( 2269 `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` 2270 ); 2271 } 2272 }; 2273} 2274var devtools$1; 2275var buffer = []; 2276var devtoolsNotInstalled = false; 2277function emit$1(event, ...args) { 2278 if (devtools$1) { 2279 devtools$1.emit(event, ...args); 2280 } else if (!devtoolsNotInstalled) { 2281 buffer.push({ event, args }); 2282 } 2283} 2284function setDevtoolsHook$1(hook, target) { 2285 var _a, _b; 2286 devtools$1 = hook; 2287 if (devtools$1) { 2288 devtools$1.enabled = true; 2289 buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); 2290 buffer = []; 2291 } else if ( 2292 // handle late devtools injection - only do this if we are in an actual 2293 // browser environment to avoid the timer handle stalling test runner exit 2294 // (#4815) 2295 typeof window !== "undefined" && // some envs mock window but not fully 2296 window.HTMLElement && // also exclude jsdom 2297 // eslint-disable-next-line no-restricted-syntax 2298 !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) 2299 ) { 2300 const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; 2301 replay.push((newHook) => { 2302 setDevtoolsHook$1(newHook, target); 2303 }); 2304 setTimeout(() => { 2305 if (!devtools$1) { 2306 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; 2307 devtoolsNotInstalled = true; 2308 buffer = []; 2309 } 2310 }, 3e3); 2311 } else { 2312 devtoolsNotInstalled = true; 2313 buffer = []; 2314 } 2315} 2316function devtoolsInitApp(app, version2) { 2317 emit$1("app:init", app, version2, { 2318 Fragment, 2319 Text, 2320 Comment, 2321 Static 2322 }); 2323} 2324function devtoolsUnmountApp(app) { 2325 emit$1("app:unmount", app); 2326} 2327var devtoolsComponentAdded = createDevtoolsComponentHook( 2328 "component:added" 2329 /* COMPONENT_ADDED */ 2330); 2331var devtoolsComponentUpdated = createDevtoolsComponentHook( 2332 "component:updated" 2333 /* COMPONENT_UPDATED */ 2334); 2335var _devtoolsComponentRemoved = createDevtoolsComponentHook( 2336 "component:removed" 2337 /* COMPONENT_REMOVED */ 2338); 2339var devtoolsComponentRemoved = (component) => { 2340 if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered 2341 !devtools$1.cleanupBuffer(component)) { 2342 _devtoolsComponentRemoved(component); 2343 } 2344}; 2345function createDevtoolsComponentHook(hook) { 2346 return (component) => { 2347 emit$1( 2348 hook, 2349 component.appContext.app, 2350 component.uid, 2351 component.parent ? component.parent.uid : void 0, 2352 component 2353 ); 2354 }; 2355} 2356var devtoolsPerfStart = createDevtoolsPerformanceHook( 2357 "perf:start" 2358 /* PERFORMANCE_START */ 2359); 2360var devtoolsPerfEnd = createDevtoolsPerformanceHook( 2361 "perf:end" 2362 /* PERFORMANCE_END */ 2363); 2364function createDevtoolsPerformanceHook(hook) { 2365 return (component, type, time) => { 2366 emit$1(hook, component.appContext.app, component.uid, component, type, time); 2367 }; 2368} 2369function devtoolsComponentEmit(component, event, params) { 2370 emit$1( 2371 "component:emit", 2372 component.appContext.app, 2373 component, 2374 event, 2375 params 2376 ); 2377} 2378var currentRenderingInstance = null; 2379var currentScopeId = null; 2380function setCurrentRenderingInstance(instance) { 2381 const prev = currentRenderingInstance; 2382 currentRenderingInstance = instance; 2383 currentScopeId = instance && instance.type.__scopeId || null; 2384 return prev; 2385} 2386function pushScopeId(id) { 2387 currentScopeId = id; 2388} 2389function popScopeId() { 2390 currentScopeId = null; 2391} 2392var withScopeId = (_id) => withCtx; 2393function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { 2394 if (!ctx) return fn; 2395 if (fn._n) { 2396 return fn; 2397 } 2398 const renderFnWithContext = (...args) => { 2399 if (renderFnWithContext._d) { 2400 setBlockTracking(-1); 2401 } 2402 const prevInstance = setCurrentRenderingInstance(ctx); 2403 let res; 2404 try { 2405 res = fn(...args); 2406 } finally { 2407 setCurrentRenderingInstance(prevInstance); 2408 if (renderFnWithContext._d) { 2409 setBlockTracking(1); 2410 } 2411 } 2412 if (true) { 2413 devtoolsComponentUpdated(ctx); 2414 } 2415 return res; 2416 }; 2417 renderFnWithContext._n = true; 2418 renderFnWithContext._c = true; 2419 renderFnWithContext._d = true; 2420 return renderFnWithContext; 2421} 2422function validateDirectiveName(name) { 2423 if (isBuiltInDirective(name)) { 2424 warn$1("Do not use built-in directive ids as custom directive id: " + name); 2425 } 2426} 2427function withDirectives(vnode, directives) { 2428 if (currentRenderingInstance === null) { 2429 warn$1(`withDirectives can only be used inside render functions.`); 2430 return vnode; 2431 } 2432 const instance = getComponentPublicInstance(currentRenderingInstance); 2433 const bindings = vnode.dirs || (vnode.dirs = []); 2434 for (let i = 0; i < directives.length; i++) { 2435 let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; 2436 if (dir) { 2437 if (isFunction(dir)) { 2438 dir = { 2439 mounted: dir, 2440 updated: dir 2441 }; 2442 } 2443 if (dir.deep) { 2444 traverse(value); 2445 } 2446 bindings.push({ 2447 dir, 2448 instance, 2449 value, 2450 oldValue: void 0, 2451 arg, 2452 modifiers 2453 }); 2454 } 2455 } 2456 return vnode; 2457} 2458function invokeDirectiveHook(vnode, prevVNode, instance, name) { 2459 const bindings = vnode.dirs; 2460 const oldBindings = prevVNode && prevVNode.dirs; 2461 for (let i = 0; i < bindings.length; i++) { 2462 const binding = bindings[i]; 2463 if (oldBindings) { 2464 binding.oldValue = oldBindings[i].value; 2465 } 2466 let hook = binding.dir[name]; 2467 if (hook) { 2468 pauseTracking(); 2469 callWithAsyncErrorHandling(hook, instance, 8, [ 2470 vnode.el, 2471 binding, 2472 vnode, 2473 prevVNode 2474 ]); 2475 resetTracking(); 2476 } 2477 } 2478} 2479var leaveCbKey = Symbol("_leaveCb"); 2480var enterCbKey = Symbol("_enterCb"); 2481function useTransitionState() { 2482 const state = { 2483 isMounted: false, 2484 isLeaving: false, 2485 isUnmounting: false, 2486 leavingVNodes: /* @__PURE__ */ new Map() 2487 }; 2488 onMounted(() => { 2489 state.isMounted = true; 2490 }); 2491 onBeforeUnmount(() => { 2492 state.isUnmounting = true; 2493 }); 2494 return state; 2495} 2496var TransitionHookValidator = [Function, Array]; 2497var BaseTransitionPropsValidators = { 2498 mode: String, 2499 appear: Boolean, 2500 persisted: Boolean, 2501 // enter 2502 onBeforeEnter: TransitionHookValidator, 2503 onEnter: TransitionHookValidator, 2504 onAfterEnter: TransitionHookValidator, 2505 onEnterCancelled: TransitionHookValidator, 2506 // leave 2507 onBeforeLeave: TransitionHookValidator, 2508 onLeave: TransitionHookValidator, 2509 onAfterLeave: TransitionHookValidator, 2510 onLeaveCancelled: TransitionHookValidator, 2511 // appear 2512 onBeforeAppear: TransitionHookValidator, 2513 onAppear: TransitionHookValidator, 2514 onAfterAppear: TransitionHookValidator, 2515 onAppearCancelled: TransitionHookValidator 2516}; 2517var recursiveGetSubtree = (instance) => { 2518 const subTree = instance.subTree; 2519 return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; 2520}; 2521var BaseTransitionImpl = { 2522 name: `BaseTransition`, 2523 props: BaseTransitionPropsValidators, 2524 setup(props, { slots }) { 2525 const instance = getCurrentInstance(); 2526 const state = useTransitionState(); 2527 return () => { 2528 const children = slots.default && getTransitionRawChildren(slots.default(), true); 2529 if (!children || !children.length) { 2530 return; 2531 } 2532 let child = children[0]; 2533 if (children.length > 1) { 2534 let hasFound = false; 2535 for (const c of children) { 2536 if (c.type !== Comment) { 2537 if (hasFound) { 2538 warn$1( 2539 "<transition> can only be used on a single element or component. Use <transition-group> for lists." 2540 ); 2541 break; 2542 } 2543 child = c; 2544 hasFound = true; 2545 if (false) break; 2546 } 2547 } 2548 } 2549 const rawProps = toRaw(props); 2550 const { mode } = rawProps; 2551 if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { 2552 warn$1(`invalid <transition> mode: ${mode}`); 2553 } 2554 if (state.isLeaving) { 2555 return emptyPlaceholder(child); 2556 } 2557 const innerChild = getKeepAliveChild(child); 2558 if (!innerChild) { 2559 return emptyPlaceholder(child); 2560 } 2561 let enterHooks = resolveTransitionHooks( 2562 innerChild, 2563 rawProps, 2564 state, 2565 instance, 2566 // #11061, ensure enterHooks is fresh after clone 2567 (hooks) => enterHooks = hooks 2568 ); 2569 setTransitionHooks(innerChild, enterHooks); 2570 const oldChild = instance.subTree; 2571 const oldInnerChild = oldChild && getKeepAliveChild(oldChild); 2572 if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { 2573 const leavingHooks = resolveTransitionHooks( 2574 oldInnerChild, 2575 rawProps, 2576 state, 2577 instance 2578 ); 2579 setTransitionHooks(oldInnerChild, leavingHooks); 2580 if (mode === "out-in" && innerChild.type !== Comment) { 2581 state.isLeaving = true; 2582 leavingHooks.afterLeave = () => { 2583 state.isLeaving = false; 2584 if (instance.update.active !== false) { 2585 instance.effect.dirty = true; 2586 instance.update(); 2587 } 2588 }; 2589 return emptyPlaceholder(child); 2590 } else if (mode === "in-out" && innerChild.type !== Comment) { 2591 leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { 2592 const leavingVNodesCache = getLeavingNodesForType( 2593 state, 2594 oldInnerChild 2595 ); 2596 leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; 2597 el[leaveCbKey] = () => { 2598 earlyRemove(); 2599 el[leaveCbKey] = void 0; 2600 delete enterHooks.delayedLeave; 2601 }; 2602 enterHooks.delayedLeave = delayedLeave; 2603 }; 2604 } 2605 } 2606 return child; 2607 }; 2608 } 2609}; 2610var BaseTransition = BaseTransitionImpl; 2611function getLeavingNodesForType(state, vnode) { 2612 const { leavingVNodes } = state; 2613 let leavingVNodesCache = leavingVNodes.get(vnode.type); 2614 if (!leavingVNodesCache) { 2615 leavingVNodesCache = /* @__PURE__ */ Object.create(null); 2616 leavingVNodes.set(vnode.type, leavingVNodesCache); 2617 } 2618 return leavingVNodesCache; 2619} 2620function resolveTransitionHooks(vnode, props, state, instance, postClone) { 2621 const { 2622 appear, 2623 mode, 2624 persisted = false, 2625 onBeforeEnter, 2626 onEnter, 2627 onAfterEnter, 2628 onEnterCancelled, 2629 onBeforeLeave, 2630 onLeave, 2631 onAfterLeave, 2632 onLeaveCancelled, 2633 onBeforeAppear, 2634 onAppear, 2635 onAfterAppear, 2636 onAppearCancelled 2637 } = props; 2638 const key = String(vnode.key); 2639 const leavingVNodesCache = getLeavingNodesForType(state, vnode); 2640 const callHook3 = (hook, args) => { 2641 hook && callWithAsyncErrorHandling( 2642 hook, 2643 instance, 2644 9, 2645 args 2646 ); 2647 }; 2648 const callAsyncHook = (hook, args) => { 2649 const done = args[1]; 2650 callHook3(hook, args); 2651 if (isArray(hook)) { 2652 if (hook.every((hook2) => hook2.length <= 1)) done(); 2653 } else if (hook.length <= 1) { 2654 done(); 2655 } 2656 }; 2657 const hooks = { 2658 mode, 2659 persisted, 2660 beforeEnter(el) { 2661 let hook = onBeforeEnter; 2662 if (!state.isMounted) { 2663 if (appear) { 2664 hook = onBeforeAppear || onBeforeEnter; 2665 } else { 2666 return; 2667 } 2668 } 2669 if (el[leaveCbKey]) { 2670 el[leaveCbKey]( 2671 true 2672 /* cancelled */ 2673 ); 2674 } 2675 const leavingVNode = leavingVNodesCache[key]; 2676 if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { 2677 leavingVNode.el[leaveCbKey](); 2678 } 2679 callHook3(hook, [el]); 2680 }, 2681 enter(el) { 2682 let hook = onEnter; 2683 let afterHook = onAfterEnter; 2684 let cancelHook = onEnterCancelled; 2685 if (!state.isMounted) { 2686 if (appear) { 2687 hook = onAppear || onEnter; 2688 afterHook = onAfterAppear || onAfterEnter; 2689 cancelHook = onAppearCancelled || onEnterCancelled; 2690 } else { 2691 return; 2692 } 2693 } 2694 let called = false; 2695 const done = el[enterCbKey] = (cancelled) => { 2696 if (called) return; 2697 called = true; 2698 if (cancelled) { 2699 callHook3(cancelHook, [el]); 2700 } else { 2701 callHook3(afterHook, [el]); 2702 } 2703 if (hooks.delayedLeave) { 2704 hooks.delayedLeave(); 2705 } 2706 el[enterCbKey] = void 0; 2707 }; 2708 if (hook) { 2709 callAsyncHook(hook, [el, done]); 2710 } else { 2711 done(); 2712 } 2713 }, 2714 leave(el, remove2) { 2715 const key2 = String(vnode.key); 2716 if (el[enterCbKey]) { 2717 el[enterCbKey]( 2718 true 2719 /* cancelled */ 2720 ); 2721 } 2722 if (state.isUnmounting) { 2723 return remove2(); 2724 } 2725 callHook3(onBeforeLeave, [el]); 2726 let called = false; 2727 const done = el[leaveCbKey] = (cancelled) => { 2728 if (called) return; 2729 called = true; 2730 remove2(); 2731 if (cancelled) { 2732 callHook3(onLeaveCancelled, [el]); 2733 } else { 2734 callHook3(onAfterLeave, [el]); 2735 } 2736 el[leaveCbKey] = void 0; 2737 if (leavingVNodesCache[key2] === vnode) { 2738 delete leavingVNodesCache[key2]; 2739 } 2740 }; 2741 leavingVNodesCache[key2] = vnode; 2742 if (onLeave) { 2743 callAsyncHook(onLeave, [el, done]); 2744 } else { 2745 done(); 2746 } 2747 }, 2748 clone(vnode2) { 2749 const hooks2 = resolveTransitionHooks( 2750 vnode2, 2751 props, 2752 state, 2753 instance, 2754 postClone 2755 ); 2756 if (postClone) postClone(hooks2); 2757 return hooks2; 2758 } 2759 }; 2760 return hooks; 2761} 2762function emptyPlaceholder(vnode) { 2763 if (isKeepAlive(vnode)) { 2764 vnode = cloneVNode(vnode); 2765 vnode.children = null; 2766 return vnode; 2767 } 2768} 2769function getKeepAliveChild(vnode) { 2770 if (!isKeepAlive(vnode)) { 2771 return vnode; 2772 } 2773 if (vnode.component) { 2774 return vnode.component.subTree; 2775 } 2776 const { shapeFlag, children } = vnode; 2777 if (children) { 2778 if (shapeFlag & 16) { 2779 return children[0]; 2780 } 2781 if (shapeFlag & 32 && isFunction(children.default)) { 2782 return children.default(); 2783 } 2784 } 2785} 2786function setTransitionHooks(vnode, hooks) { 2787 if (vnode.shapeFlag & 6 && vnode.component) { 2788 setTransitionHooks(vnode.component.subTree, hooks); 2789 } else if (vnode.shapeFlag & 128) { 2790 vnode.ssContent.transition = hooks.clone(vnode.ssContent); 2791 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); 2792 } else { 2793 vnode.transition = hooks; 2794 } 2795} 2796function getTransitionRawChildren(children, keepComment = false, parentKey) { 2797 let ret = []; 2798 let keyedFragmentCount = 0; 2799 for (let i = 0; i < children.length; i++) { 2800 let child = children[i]; 2801 const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); 2802 if (child.type === Fragment) { 2803 if (child.patchFlag & 128) keyedFragmentCount++; 2804 ret = ret.concat( 2805 getTransitionRawChildren(child.children, keepComment, key) 2806 ); 2807 } else if (keepComment || child.type !== Comment) { 2808 ret.push(key != null ? cloneVNode(child, { key }) : child); 2809 } 2810 } 2811 if (keyedFragmentCount > 1) { 2812 for (let i = 0; i < ret.length; i++) { 2813 ret[i].patchFlag = -2; 2814 } 2815 } 2816 return ret; 2817} 2818function defineComponent(options, extraOptions) { 2819 return isFunction(options) ? ( 2820 // #8326: extend call and options.name access are considered side-effects 2821 // by Rollup, so we have to wrap it in a pure-annotated IIFE. 2822 (() => extend({ name: options.name }, extraOptions, { setup: options }))() 2823 ) : options; 2824} 2825var isAsyncWrapper = (i) => !!i.type.__asyncLoader; 2826function defineAsyncComponent(source) { 2827 if (isFunction(source)) { 2828 source = { loader: source }; 2829 } 2830 const { 2831 loader, 2832 loadingComponent, 2833 errorComponent, 2834 delay = 200, 2835 timeout, 2836 // undefined = never times out 2837 suspensible = true, 2838 onError: userOnError 2839 } = source; 2840 let pendingRequest = null; 2841 let resolvedComp; 2842 let retries = 0; 2843 const retry = () => { 2844 retries++; 2845 pendingRequest = null; 2846 return load(); 2847 }; 2848 const load = () => { 2849 let thisRequest; 2850 return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { 2851 err = err instanceof Error ? err : new Error(String(err)); 2852 if (userOnError) { 2853 return new Promise((resolve2, reject) => { 2854 const userRetry = () => resolve2(retry()); 2855 const userFail = () => reject(err); 2856 userOnError(err, userRetry, userFail, retries + 1); 2857 }); 2858 } else { 2859 throw err; 2860 } 2861 }).then((comp) => { 2862 if (thisRequest !== pendingRequest && pendingRequest) { 2863 return pendingRequest; 2864 } 2865 if (!comp) { 2866 warn$1( 2867 `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` 2868 ); 2869 } 2870 if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { 2871 comp = comp.default; 2872 } 2873 if (comp && !isObject(comp) && !isFunction(comp)) { 2874 throw new Error(`Invalid async component load result: ${comp}`); 2875 } 2876 resolvedComp = comp; 2877 return comp; 2878 })); 2879 }; 2880 return defineComponent({ 2881 name: "AsyncComponentWrapper", 2882 __asyncLoader: load, 2883 get __asyncResolved() { 2884 return resolvedComp; 2885 }, 2886 setup() { 2887 const instance = currentInstance; 2888 if (resolvedComp) { 2889 return () => createInnerComp(resolvedComp, instance); 2890 } 2891 const onError = (err) => { 2892 pendingRequest = null; 2893 handleError( 2894 err, 2895 instance, 2896 13, 2897 !errorComponent 2898 ); 2899 }; 2900 if (suspensible && instance.suspense || isInSSRComponentSetup) { 2901 return load().then((comp) => { 2902 return () => createInnerComp(comp, instance); 2903 }).catch((err) => { 2904 onError(err); 2905 return () => errorComponent ? createVNode(errorComponent, { 2906 error: err 2907 }) : null; 2908 }); 2909 } 2910 const loaded = ref(false); 2911 const error = ref(); 2912 const delayed = ref(!!delay); 2913 if (delay) { 2914 setTimeout(() => { 2915 delayed.value = false; 2916 }, delay); 2917 } 2918 if (timeout != null) { 2919 setTimeout(() => { 2920 if (!loaded.value && !error.value) { 2921 const err = new Error( 2922 `Async component timed out after ${timeout}ms.` 2923 ); 2924 onError(err); 2925 error.value = err; 2926 } 2927 }, timeout); 2928 } 2929 load().then(() => { 2930 loaded.value = true; 2931 if (instance.parent && isKeepAlive(instance.parent.vnode)) { 2932 instance.parent.effect.dirty = true; 2933 queueJob(instance.parent.update); 2934 } 2935 }).catch((err) => { 2936 onError(err); 2937 error.value = err; 2938 }); 2939 return () => { 2940 if (loaded.value && resolvedComp) { 2941 return createInnerComp(resolvedComp, instance); 2942 } else if (error.value && errorComponent) { 2943 return createVNode(errorComponent, { 2944 error: error.value 2945 }); 2946 } else if (loadingComponent && !delayed.value) { 2947 return createVNode(loadingComponent); 2948 } 2949 }; 2950 } 2951 }); 2952} 2953function createInnerComp(comp, parent) { 2954 const { ref: ref2, props, children, ce } = parent.vnode; 2955 const vnode = createVNode(comp, props, children); 2956 vnode.ref = ref2; 2957 vnode.ce = ce; 2958 delete parent.vnode.ce; 2959 return vnode; 2960} 2961var isKeepAlive = (vnode) => vnode.type.__isKeepAlive; 2962var KeepAliveImpl = { 2963 name: `KeepAlive`, 2964 // Marker for special handling inside the renderer. We are not using a === 2965 // check directly on KeepAlive in the renderer, because importing it directly 2966 // would prevent it from being tree-shaken. 2967 __isKeepAlive: true, 2968 props: { 2969 include: [String, RegExp, Array], 2970 exclude: [String, RegExp, Array], 2971 max: [String, Number] 2972 }, 2973 setup(props, { slots }) { 2974 const instance = getCurrentInstance(); 2975 const sharedContext = instance.ctx; 2976 if (!sharedContext.renderer) { 2977 return () => { 2978 const children = slots.default && slots.default(); 2979 return children && children.length === 1 ? children[0] : children; 2980 }; 2981 } 2982 const cache = /* @__PURE__ */ new Map(); 2983 const keys = /* @__PURE__ */ new Set(); 2984 let current = null; 2985 if (true) { 2986 instance.__v_cache = cache; 2987 } 2988 const parentSuspense = instance.suspense; 2989 const { 2990 renderer: { 2991 p: patch, 2992 m: move, 2993 um: _unmount, 2994 o: { createElement } 2995 } 2996 } = sharedContext; 2997 const storageContainer = createElement("div"); 2998 sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { 2999 const instance2 = vnode.component; 3000 move(vnode, container, anchor, 0, parentSuspense); 3001 patch( 3002 instance2.vnode, 3003 vnode, 3004 container, 3005 anchor, 3006 instance2, 3007 parentSuspense, 3008 namespace, 3009 vnode.slotScopeIds, 3010 optimized 3011 ); 3012 queuePostRenderEffect(() => { 3013 instance2.isDeactivated = false; 3014 if (instance2.a) { 3015 invokeArrayFns(instance2.a); 3016 } 3017 const vnodeHook = vnode.props && vnode.props.onVnodeMounted; 3018 if (vnodeHook) { 3019 invokeVNodeHook(vnodeHook, instance2.parent, vnode); 3020 } 3021 }, parentSuspense); 3022 if (true) { 3023 devtoolsComponentAdded(instance2); 3024 } 3025 }; 3026 sharedContext.deactivate = (vnode) => { 3027 const instance2 = vnode.component; 3028 invalidateMount(instance2.m); 3029 invalidateMount(instance2.a); 3030 move(vnode, storageContainer, null, 1, parentSuspense); 3031 queuePostRenderEffect(() => { 3032 if (instance2.da) { 3033 invokeArrayFns(instance2.da); 3034 } 3035 const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; 3036 if (vnodeHook) { 3037 invokeVNodeHook(vnodeHook, instance2.parent, vnode); 3038 } 3039 instance2.isDeactivated = true; 3040 }, parentSuspense); 3041 if (true) { 3042 devtoolsComponentAdded(instance2); 3043 } 3044 }; 3045 function unmount(vnode) { 3046 resetShapeFlag(vnode); 3047 _unmount(vnode, instance, parentSuspense, true); 3048 } 3049 function pruneCache(filter) { 3050 cache.forEach((vnode, key) => { 3051 const name = getComponentName(vnode.type); 3052 if (name && (!filter || !filter(name))) { 3053 pruneCacheEntry(key); 3054 } 3055 }); 3056 } 3057 function pruneCacheEntry(key) { 3058 const cached = cache.get(key); 3059 if (!current || !isSameVNodeType(cached, current)) { 3060 unmount(cached); 3061 } else if (current) { 3062 resetShapeFlag(current); 3063 } 3064 cache.delete(key); 3065 keys.delete(key); 3066 } 3067 watch( 3068 () => [props.include, props.exclude], 3069 ([include, exclude]) => { 3070 include && pruneCache((name) => matches(include, name)); 3071 exclude && pruneCache((name) => !matches(exclude, name)); 3072 }, 3073 // prune post-render after `current` has been updated 3074 { flush: "post", deep: true } 3075 ); 3076 let pendingCacheKey = null; 3077 const cacheSubtree = () => { 3078 if (pendingCacheKey != null) { 3079 if (isSuspense(instance.subTree.type)) { 3080 queuePostRenderEffect(() => { 3081 cache.set(pendingCacheKey, getInnerChild(instance.subTree)); 3082 }, instance.subTree.suspense); 3083 } else { 3084 cache.set(pendingCacheKey, getInnerChild(instance.subTree)); 3085 } 3086 } 3087 }; 3088 onMounted(cacheSubtree); 3089 onUpdated(cacheSubtree); 3090 onBeforeUnmount(() => { 3091 cache.forEach((cached) => { 3092 const { subTree, suspense } = instance; 3093 const vnode = getInnerChild(subTree); 3094 if (cached.type === vnode.type && cached.key === vnode.key) { 3095 resetShapeFlag(vnode); 3096 const da = vnode.component.da; 3097 da && queuePostRenderEffect(da, suspense); 3098 return; 3099 } 3100 unmount(cached); 3101 }); 3102 }); 3103 return () => { 3104 pendingCacheKey = null; 3105 if (!slots.default) { 3106 return null; 3107 } 3108 const children = slots.default(); 3109 const rawVNode = children[0]; 3110 if (children.length > 1) { 3111 if (true) { 3112 warn$1(`KeepAlive should contain exactly one component child.`); 3113 } 3114 current = null; 3115 return children; 3116 } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { 3117 current = null; 3118 return rawVNode; 3119 } 3120 let vnode = getInnerChild(rawVNode); 3121 const comp = vnode.type; 3122 const name = getComponentName( 3123 isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp 3124 ); 3125 const { include, exclude, max } = props; 3126 if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { 3127 current = vnode; 3128 return rawVNode; 3129 } 3130 const key = vnode.key == null ? comp : vnode.key; 3131 const cachedVNode = cache.get(key); 3132 if (vnode.el) { 3133 vnode = cloneVNode(vnode); 3134 if (rawVNode.shapeFlag & 128) { 3135 rawVNode.ssContent = vnode; 3136 } 3137 } 3138 pendingCacheKey = key; 3139 if (cachedVNode) { 3140 vnode.el = cachedVNode.el; 3141 vnode.component = cachedVNode.component; 3142 if (vnode.transition) { 3143 setTransitionHooks(vnode, vnode.transition); 3144 } 3145 vnode.shapeFlag |= 512; 3146 keys.delete(key); 3147 keys.add(key); 3148 } else { 3149 keys.add(key); 3150 if (max && keys.size > parseInt(max, 10)) { 3151 pruneCacheEntry(keys.values().next().value); 3152 } 3153 } 3154 vnode.shapeFlag |= 256; 3155 current = vnode; 3156 return isSuspense(rawVNode.type) ? rawVNode : vnode; 3157 }; 3158 } 3159}; 3160var KeepAlive = KeepAliveImpl; 3161function matches(pattern, name) { 3162 if (isArray(pattern)) { 3163 return pattern.some((p2) => matches(p2, name)); 3164 } else if (isString(pattern)) { 3165 return pattern.split(",").includes(name); 3166 } else if (isRegExp(pattern)) { 3167 return pattern.test(name); 3168 } 3169 return false; 3170} 3171function onActivated(hook, target) { 3172 registerKeepAliveHook(hook, "a", target); 3173} 3174function onDeactivated(hook, target) { 3175 registerKeepAliveHook(hook, "da", target); 3176} 3177function registerKeepAliveHook(hook, type, target = currentInstance) { 3178 const wrappedHook = hook.__wdc || (hook.__wdc = () => { 3179 let current = target; 3180 while (current) { 3181 if (current.isDeactivated) { 3182 return; 3183 } 3184 current = current.parent; 3185 } 3186 return hook(); 3187 }); 3188 injectHook(type, wrappedHook, target); 3189 if (target) { 3190 let current = target.parent; 3191 while (current && current.parent) { 3192 if (isKeepAlive(current.parent.vnode)) { 3193 injectToKeepAliveRoot(wrappedHook, type, target, current); 3194 } 3195 current = current.parent; 3196 } 3197 } 3198} 3199function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { 3200 const injected = injectHook( 3201 type, 3202 hook, 3203 keepAliveRoot, 3204 true 3205 /* prepend */ 3206 ); 3207 onUnmounted(() => { 3208 remove(keepAliveRoot[type], injected); 3209 }, target); 3210} 3211function resetShapeFlag(vnode) { 3212 vnode.shapeFlag &= ~256; 3213 vnode.shapeFlag &= ~512; 3214} 3215function getInnerChild(vnode) { 3216 return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; 3217} 3218function injectHook(type, hook, target = currentInstance, prepend = false) { 3219 if (target) { 3220 const hooks = target[type] || (target[type] = []); 3221 const wrappedHook = hook.__weh || (hook.__weh = (...args) => { 3222 pauseTracking(); 3223 const reset2 = setCurrentInstance(target); 3224 const res = callWithAsyncErrorHandling(hook, target, type, args); 3225 reset2(); 3226 resetTracking(); 3227 return res; 3228 }); 3229 if (prepend) { 3230 hooks.unshift(wrappedHook); 3231 } else { 3232 hooks.push(wrappedHook); 3233 } 3234 return wrappedHook; 3235 } else if (true) { 3236 const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); 3237 warn$1( 3238 `${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.` 3239 ); 3240 } 3241} 3242var createHook = (lifecycle) => (hook, target = currentInstance) => { 3243 if (!isInSSRComponentSetup || lifecycle === "sp") { 3244 injectHook(lifecycle, (...args) => hook(...args), target); 3245 } 3246}; 3247var onBeforeMount = createHook("bm"); 3248var onMounted = createHook("m"); 3249var onBeforeUpdate = createHook("bu"); 3250var onUpdated = createHook("u"); 3251var onBeforeUnmount = createHook("bum"); 3252var onUnmounted = createHook("um"); 3253var onServerPrefetch = createHook("sp"); 3254var onRenderTriggered = createHook( 3255 "rtg" 3256); 3257var onRenderTracked = createHook( 3258 "rtc" 3259); 3260function onErrorCaptured(hook, target = currentInstance) { 3261 injectHook("ec", hook, target); 3262} 3263var COMPONENTS = "components"; 3264var DIRECTIVES = "directives"; 3265function resolveComponent(name, maybeSelfReference) { 3266 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; 3267} 3268var NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); 3269function resolveDynamicComponent(component) { 3270 if (isString(component)) { 3271 return resolveAsset(COMPONENTS, component, false) || component; 3272 } else { 3273 return component || NULL_DYNAMIC_COMPONENT; 3274 } 3275} 3276function resolveDirective(name) { 3277 return resolveAsset(DIRECTIVES, name); 3278} 3279function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { 3280 const instance = currentRenderingInstance || currentInstance; 3281 if (instance) { 3282 const Component = instance.type; 3283 if (type === COMPONENTS) { 3284 const selfName = getComponentName( 3285 Component, 3286 false 3287 ); 3288 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { 3289 return Component; 3290 } 3291 } 3292 const res = ( 3293 // local registration 3294 // check instance[type] first which is resolved for options API 3295 resolve(instance[type] || Component[type], name) || // global registration 3296 resolve(instance.appContext[type], name) 3297 ); 3298 if (!res && maybeSelfReference) { 3299 return Component; 3300 } 3301 if (warnMissing && !res) { 3302 const extra = type === COMPONENTS ? ` 3303If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; 3304 warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); 3305 } 3306 return res; 3307 } else if (true) { 3308 warn$1( 3309 `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` 3310 ); 3311 } 3312} 3313function resolve(registry, name) { 3314 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); 3315} 3316function renderList(source, renderItem, cache, index) { 3317 let ret; 3318 const cached = cache && cache[index]; 3319 if (isArray(source) || isString(source)) { 3320 ret = new Array(source.length); 3321 for (let i = 0, l = source.length; i < l; i++) { 3322 ret[i] = renderItem(source[i], i, void 0, cached && cached[i]); 3323 } 3324 } else if (typeof source === "number") { 3325 if (!Number.isInteger(source)) { 3326 warn$1(`The v-for range expect an integer value but got ${source}.`); 3327 } 3328 ret = new Array(source); 3329 for (let i = 0; i < source; i++) { 3330 ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); 3331 } 3332 } else if (isObject(source)) { 3333 if (source[Symbol.iterator]) { 3334 ret = Array.from( 3335 source, 3336 (item, i) => renderItem(item, i, void 0, cached && cached[i]) 3337 ); 3338 } else { 3339 const keys = Object.keys(source); 3340 ret = new Array(keys.length); 3341 for (let i = 0, l = keys.length; i < l; i++) { 3342 const key = keys[i]; 3343 ret[i] = renderItem(source[key], key, i, cached && cached[i]); 3344 } 3345 } 3346 } else { 3347 ret = []; 3348 } 3349 if (cache) { 3350 cache[index] = ret; 3351 } 3352 return ret; 3353} 3354function createSlots(slots, dynamicSlots) { 3355 for (let i = 0; i < dynamicSlots.length; i++) { 3356 const slot = dynamicSlots[i]; 3357 if (isArray(slot)) { 3358 for (let j = 0; j < slot.length; j++) { 3359 slots[slot[j].name] = slot[j].fn; 3360 } 3361 } else if (slot) { 3362 slots[slot.name] = slot.key ? (...args) => { 3363 const res = slot.fn(...args); 3364 if (res) res.key = slot.key; 3365 return res; 3366 } : slot.fn; 3367 } 3368 } 3369 return slots; 3370} 3371function renderSlot(slots, name, props = {}, fallback, noSlotted) { 3372 if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { 3373 if (name !== "default") props.name = name; 3374 return createVNode("slot", props, fallback && fallback()); 3375 } 3376 let slot = slots[name]; 3377 if (slot && slot.length > 1) { 3378 warn$1( 3379 `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.` 3380 ); 3381 slot = () => []; 3382 } 3383 if (slot && slot._c) { 3384 slot._d = false; 3385 } 3386 openBlock(); 3387 const validSlotContent = slot && ensureValidVNode(slot(props)); 3388 const rendered = createBlock( 3389 Fragment, 3390 { 3391 key: (props.key || // slot content array of a dynamic conditional slot may have a branch 3392 // key attached in the `createSlots` helper, respect that 3393 validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content 3394 (!validSlotContent && fallback ? "_fb" : "") 3395 }, 3396 validSlotContent || (fallback ? fallback() : []), 3397 validSlotContent && slots._ === 1 ? 64 : -2 3398 ); 3399 if (!noSlotted && rendered.scopeId) { 3400 rendered.slotScopeIds = [rendered.scopeId + "-s"]; 3401 } 3402 if (slot && slot._c) { 3403 slot._d = true; 3404 } 3405 return rendered; 3406} 3407function ensureValidVNode(vnodes) { 3408 return vnodes.some((child) => { 3409 if (!isVNode(child)) return true; 3410 if (child.type === Comment) return false; 3411 if (child.type === Fragment && !ensureValidVNode(child.children)) 3412 return false; 3413 return true; 3414 }) ? vnodes : null; 3415} 3416function toHandlers(obj, preserveCaseIfNecessary) { 3417 const ret = {}; 3418 if (!isObject(obj)) { 3419 warn$1(`v-on with no argument expects an object value.`); 3420 return ret; 3421 } 3422 for (const key in obj) { 3423 ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; 3424 } 3425 return ret; 3426} 3427var getPublicInstance = (i) => { 3428 if (!i) return null; 3429 if (isStatefulComponent(i)) return getComponentPublicInstance(i); 3430 return getPublicInstance(i.parent); 3431}; 3432var publicPropertiesMap = ( 3433 // Move PURE marker to new line to workaround compiler discarding it 3434 // due to type annotation 3435 extend(/* @__PURE__ */ Object.create(null), { 3436 $: (i) => i, 3437 $el: (i) => i.vnode.el, 3438 $data: (i) => i.data, 3439 $props: (i) => true ? shallowReadonly(i.props) : i.props, 3440 $attrs: (i) => true ? shallowReadonly(i.attrs) : i.attrs, 3441 $slots: (i) => true ? shallowReadonly(i.slots) : i.slots, 3442 $refs: (i) => true ? shallowReadonly(i.refs) : i.refs, 3443 $parent: (i) => getPublicInstance(i.parent), 3444 $root: (i) => getPublicInstance(i.root), 3445 $emit: (i) => i.emit, 3446 $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type, 3447 $forceUpdate: (i) => i.f || (i.f = () => { 3448 i.effect.dirty = true; 3449 queueJob(i.update); 3450 }), 3451 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), 3452 $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP 3453 }) 3454); 3455var isReservedPrefix = (key) => key === "_" || key === "$"; 3456var hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); 3457var PublicInstanceProxyHandlers = { 3458 get({ _: instance }, key) { 3459 if (key === "__v_skip") { 3460 return true; 3461 } 3462 const { ctx, setupState, data, props, accessCache, type, appContext } = instance; 3463 if (key === "__isVue") { 3464 return true; 3465 } 3466 let normalizedProps; 3467 if (key[0] !== "$") { 3468 const n = accessCache[key]; 3469 if (n !== void 0) { 3470 switch (n) { 3471 case 1: 3472 return setupState[key]; 3473 case 2: 3474 return data[key]; 3475 case 4: 3476 return ctx[key]; 3477 case 3: 3478 return props[key]; 3479 } 3480 } else if (hasSetupBinding(setupState, key)) { 3481 accessCache[key] = 1; 3482 return setupState[key]; 3483 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { 3484 accessCache[key] = 2; 3485 return data[key]; 3486 } else if ( 3487 // only cache other properties when instance has declared (thus stable) 3488 // props 3489 (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) 3490 ) { 3491 accessCache[key] = 3; 3492 return props[key]; 3493 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 3494 accessCache[key] = 4; 3495 return ctx[key]; 3496 } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) { 3497 accessCache[key] = 0; 3498 } 3499 } 3500 const publicGetter = publicPropertiesMap[key]; 3501 let cssModule, globalProperties; 3502 if (publicGetter) { 3503 if (key === "$attrs") { 3504 track(instance.attrs, "get", ""); 3505 markAttrsAccessed(); 3506 } else if (key === "$slots") { 3507 track(instance, "get", key); 3508 } 3509 return publicGetter(instance); 3510 } else if ( 3511 // css module (injected by vue-loader) 3512 (cssModule = type.__cssModules) && (cssModule = cssModule[key]) 3513 ) { 3514 return cssModule; 3515 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 3516 accessCache[key] = 4; 3517 return ctx[key]; 3518 } else if ( 3519 // global properties 3520 globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) 3521 ) { 3522 { 3523 return globalProperties[key]; 3524 } 3525 } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading 3526 // to infinite warning loop 3527 key.indexOf("__v") !== 0)) { 3528 if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { 3529 warn$1( 3530 `Property ${JSON.stringify( 3531 key 3532 )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` 3533 ); 3534 } else if (instance === currentRenderingInstance) { 3535 warn$1( 3536 `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` 3537 ); 3538 } 3539 } 3540 }, 3541 set({ _: instance }, key, value) { 3542 const { data, setupState, ctx } = instance; 3543 if (hasSetupBinding(setupState, key)) { 3544 setupState[key] = value; 3545 return true; 3546 } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { 3547 warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); 3548 return false; 3549 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { 3550 data[key] = value; 3551 return true; 3552 } else if (hasOwn(instance.props, key)) { 3553 warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); 3554 return false; 3555 } 3556 if (key[0] === "$" && key.slice(1) in instance) { 3557 warn$1( 3558 `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` 3559 ); 3560 return false; 3561 } else { 3562 if (key in instance.appContext.config.globalProperties) { 3563 Object.defineProperty(ctx, key, { 3564 enumerable: true, 3565 configurable: true, 3566 value 3567 }); 3568 } else { 3569 ctx[key] = value; 3570 } 3571 } 3572 return true; 3573 }, 3574 has({ 3575 _: { data, setupState, accessCache, ctx, appContext, propsOptions } 3576 }, key) { 3577 let normalizedProps; 3578 return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); 3579 }, 3580 defineProperty(target, key, descriptor) { 3581 if (descriptor.get != null) { 3582 target._.accessCache[key] = 0; 3583 } else if (hasOwn(descriptor, "value")) { 3584 this.set(target, key, descriptor.value, null); 3585 } 3586 return Reflect.defineProperty(target, key, descriptor); 3587 } 3588}; 3589if (true) { 3590 PublicInstanceProxyHandlers.ownKeys = (target) => { 3591 warn$1( 3592 `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` 3593 ); 3594 return Reflect.ownKeys(target); 3595 }; 3596} 3597var RuntimeCompiledPublicInstanceProxyHandlers = extend( 3598 {}, 3599 PublicInstanceProxyHandlers, 3600 { 3601 get(target, key) { 3602 if (key === Symbol.unscopables) { 3603 return; 3604 } 3605 return PublicInstanceProxyHandlers.get(target, key, target); 3606 }, 3607 has(_, key) { 3608 const has2 = key[0] !== "_" && !isGloballyAllowed(key); 3609 if (!has2 && PublicInstanceProxyHandlers.has(_, key)) { 3610 warn$1( 3611 `Property ${JSON.stringify( 3612 key 3613 )} should not start with _ which is a reserved prefix for Vue internals.` 3614 ); 3615 } 3616 return has2; 3617 } 3618 } 3619); 3620function createDevRenderContext(instance) { 3621 const target = {}; 3622 Object.defineProperty(target, `_`, { 3623 configurable: true, 3624 enumerable: false, 3625 get: () => instance 3626 }); 3627 Object.keys(publicPropertiesMap).forEach((key) => { 3628 Object.defineProperty(target, key, { 3629 configurable: true, 3630 enumerable: false, 3631 get: () => publicPropertiesMap[key](instance), 3632 // intercepted by the proxy so no need for implementation, 3633 // but needed to prevent set errors 3634 set: NOOP 3635 }); 3636 }); 3637 return target; 3638} 3639function exposePropsOnRenderContext(instance) { 3640 const { 3641 ctx, 3642 propsOptions: [propsOptions] 3643 } = instance; 3644 if (propsOptions) { 3645 Object.keys(propsOptions).forEach((key) => { 3646 Object.defineProperty(ctx, key, { 3647 enumerable: true, 3648 configurable: true, 3649 get: () => instance.props[key], 3650 set: NOOP 3651 }); 3652 }); 3653 } 3654} 3655function exposeSetupStateOnRenderContext(instance) { 3656 const { ctx, setupState } = instance; 3657 Object.keys(toRaw(setupState)).forEach((key) => { 3658 if (!setupState.__isScriptSetup) { 3659 if (isReservedPrefix(key[0])) { 3660 warn$1( 3661 `setup() return property ${JSON.stringify( 3662 key 3663 )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` 3664 ); 3665 return; 3666 } 3667 Object.defineProperty(ctx, key, { 3668 enumerable: true, 3669 configurable: true, 3670 get: () => setupState[key], 3671 set: NOOP 3672 }); 3673 } 3674 }); 3675} 3676var warnRuntimeUsage = (method) => warn$1( 3677 `${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.` 3678); 3679function defineProps() { 3680 if (true) { 3681 warnRuntimeUsage(`defineProps`); 3682 } 3683 return null; 3684} 3685function defineEmits() { 3686 if (true) { 3687 warnRuntimeUsage(`defineEmits`); 3688 } 3689 return null; 3690} 3691function defineExpose(exposed) { 3692 if (true) { 3693 warnRuntimeUsage(`defineExpose`); 3694 } 3695} 3696function defineOptions(options) { 3697 if (true) { 3698 warnRuntimeUsage(`defineOptions`); 3699 } 3700} 3701function defineSlots() { 3702 if (true) { 3703 warnRuntimeUsage(`defineSlots`); 3704 } 3705 return null; 3706} 3707function defineModel() { 3708 if (true) { 3709 warnRuntimeUsage("defineModel"); 3710 } 3711} 3712function withDefaults(props, defaults) { 3713 if (true) { 3714 warnRuntimeUsage(`withDefaults`); 3715 } 3716 return null; 3717} 3718function useSlots() { 3719 return getContext().slots; 3720} 3721function useAttrs() { 3722 return getContext().attrs; 3723} 3724function getContext() { 3725 const i = getCurrentInstance(); 3726 if (!i) { 3727 warn$1(`useContext() called without active instance.`); 3728 } 3729 return i.setupContext || (i.setupContext = createSetupContext(i)); 3730} 3731function normalizePropsOrEmits(props) { 3732 return isArray(props) ? props.reduce( 3733 (normalized, p2) => (normalized[p2] = null, normalized), 3734 {} 3735 ) : props; 3736} 3737function mergeDefaults(raw, defaults) { 3738 const props = normalizePropsOrEmits(raw); 3739 for (const key in defaults) { 3740 if (key.startsWith("__skip")) continue; 3741 let opt = props[key]; 3742 if (opt) { 3743 if (isArray(opt) || isFunction(opt)) { 3744 opt = props[key] = { type: opt, default: defaults[key] }; 3745 } else { 3746 opt.default = defaults[key]; 3747 } 3748 } else if (opt === null) { 3749 opt = props[key] = { default: defaults[key] }; 3750 } else if (true) { 3751 warn$1(`props default key "${key}" has no corresponding declaration.`); 3752 } 3753 if (opt && defaults[`__skip_${key}`]) { 3754 opt.skipFactory = true; 3755 } 3756 } 3757 return props; 3758} 3759function mergeModels(a, b) { 3760 if (!a || !b) return a || b; 3761 if (isArray(a) && isArray(b)) return a.concat(b); 3762 return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); 3763} 3764function createPropsRestProxy(props, excludedKeys) { 3765 const ret = {}; 3766 for (const key in props) { 3767 if (!excludedKeys.includes(key)) { 3768 Object.defineProperty(ret, key, { 3769 enumerable: true, 3770 get: () => props[key] 3771 }); 3772 } 3773 } 3774 return ret; 3775} 3776function withAsyncContext(getAwaitable) { 3777 const ctx = getCurrentInstance(); 3778 if (!ctx) { 3779 warn$1( 3780 `withAsyncContext called without active current instance. This is likely a bug.` 3781 ); 3782 } 3783 let awaitable = getAwaitable(); 3784 unsetCurrentInstance(); 3785 if (isPromise(awaitable)) { 3786 awaitable = awaitable.catch((e) => { 3787 setCurrentInstance(ctx); 3788 throw e; 3789 }); 3790 } 3791 return [awaitable, () => setCurrentInstance(ctx)]; 3792} 3793function createDuplicateChecker() { 3794 const cache = /* @__PURE__ */ Object.create(null); 3795 return (type, key) => { 3796 if (cache[key]) { 3797 warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); 3798 } else { 3799 cache[key] = type; 3800 } 3801 }; 3802} 3803var shouldCacheAccess = true; 3804function applyOptions(instance) { 3805 const options = resolveMergedOptions(instance); 3806 const publicThis = instance.proxy; 3807 const ctx = instance.ctx; 3808 shouldCacheAccess = false; 3809 if (options.beforeCreate) { 3810 callHook(options.beforeCreate, instance, "bc"); 3811 } 3812 const { 3813 // state 3814 data: dataOptions, 3815 computed: computedOptions, 3816 methods, 3817 watch: watchOptions, 3818 provide: provideOptions, 3819 inject: injectOptions, 3820 // lifecycle 3821 created, 3822 beforeMount, 3823 mounted, 3824 beforeUpdate, 3825 updated, 3826 activated, 3827 deactivated, 3828 beforeDestroy, 3829 beforeUnmount, 3830 destroyed, 3831 unmounted, 3832 render: render2, 3833 renderTracked, 3834 renderTriggered, 3835 errorCaptured, 3836 serverPrefetch, 3837 // public API 3838 expose, 3839 inheritAttrs, 3840 // assets 3841 components, 3842 directives, 3843 filters 3844 } = options; 3845 const checkDuplicateProperties = true ? createDuplicateChecker() : null; 3846 if (true) { 3847 const [propsOptions] = instance.propsOptions; 3848 if (propsOptions) { 3849 for (const key in propsOptions) { 3850 checkDuplicateProperties("Props", key); 3851 } 3852 } 3853 } 3854 if (injectOptions) { 3855 resolveInjections(injectOptions, ctx, checkDuplicateProperties); 3856 } 3857 if (methods) { 3858 for (const key in methods) { 3859 const methodHandler = methods[key]; 3860 if (isFunction(methodHandler)) { 3861 if (true) { 3862 Object.defineProperty(ctx, key, { 3863 value: methodHandler.bind(publicThis), 3864 configurable: true, 3865 enumerable: true, 3866 writable: true 3867 }); 3868 } else { 3869 ctx[key] = methodHandler.bind(publicThis); 3870 } 3871 if (true) { 3872 checkDuplicateProperties("Methods", key); 3873 } 3874 } else if (true) { 3875 warn$1( 3876 `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` 3877 ); 3878 } 3879 } 3880 } 3881 if (dataOptions) { 3882 if (!isFunction(dataOptions)) { 3883 warn$1( 3884 `The data option must be a function. Plain object usage is no longer supported.` 3885 ); 3886 } 3887 const data = dataOptions.call(publicThis, publicThis); 3888 if (isPromise(data)) { 3889 warn$1( 3890 `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` 3891 ); 3892 } 3893 if (!isObject(data)) { 3894 warn$1(`data() should return an object.`); 3895 } else { 3896 instance.data = reactive(data); 3897 if (true) { 3898 for (const key in data) { 3899 checkDuplicateProperties("Data", key); 3900 if (!isReservedPrefix(key[0])) { 3901 Object.defineProperty(ctx, key, { 3902 configurable: true, 3903 enumerable: true, 3904 get: () => data[key], 3905 set: NOOP 3906 }); 3907 } 3908 } 3909 } 3910 } 3911 } 3912 shouldCacheAccess = true; 3913 if (computedOptions) { 3914 for (const key in computedOptions) { 3915 const opt = computedOptions[key]; 3916 const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; 3917 if (get2 === NOOP) { 3918 warn$1(`Computed property "${key}" has no getter.`); 3919 } 3920 const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : true ? () => { 3921 warn$1( 3922 `Write operation failed: computed property "${key}" is readonly.` 3923 ); 3924 } : NOOP; 3925 const c = computed2({ 3926 get: get2, 3927 set: set2 3928 }); 3929 Object.defineProperty(ctx, key, { 3930 enumerable: true, 3931 configurable: true, 3932 get: () => c.value, 3933 set: (v) => c.value = v 3934 }); 3935 if (true) { 3936 checkDuplicateProperties("Computed", key); 3937 } 3938 } 3939 } 3940 if (watchOptions) { 3941 for (const key in watchOptions) { 3942 createWatcher(watchOptions[key], ctx, publicThis, key); 3943 } 3944 } 3945 if (provideOptions) { 3946 const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; 3947 Reflect.ownKeys(provides).forEach((key) => { 3948 provide(key, provides[key]); 3949 }); 3950 } 3951 if (created) { 3952 callHook(created, instance, "c"); 3953 } 3954 function registerLifecycleHook(register, hook) { 3955 if (isArray(hook)) { 3956 hook.forEach((_hook) => register(_hook.bind(publicThis))); 3957 } else if (hook) { 3958 register(hook.bind(publicThis)); 3959 } 3960 } 3961 registerLifecycleHook(onBeforeMount, beforeMount); 3962 registerLifecycleHook(onMounted, mounted); 3963 registerLifecycleHook(onBeforeUpdate, beforeUpdate); 3964 registerLifecycleHook(onUpdated, updated); 3965 registerLifecycleHook(onActivated, activated); 3966 registerLifecycleHook(onDeactivated, deactivated); 3967 registerLifecycleHook(onErrorCaptured, errorCaptured); 3968 registerLifecycleHook(onRenderTracked, renderTracked); 3969 registerLifecycleHook(onRenderTriggered, renderTriggered); 3970 registerLifecycleHook(onBeforeUnmount, beforeUnmount); 3971 registerLifecycleHook(onUnmounted, unmounted); 3972 registerLifecycleHook(onServerPrefetch, serverPrefetch); 3973 if (isArray(expose)) { 3974 if (expose.length) { 3975 const exposed = instance.exposed || (instance.exposed = {}); 3976 expose.forEach((key) => { 3977 Object.defineProperty(exposed, key, { 3978 get: () => publicThis[key], 3979 set: (val) => publicThis[key] = val 3980 }); 3981 }); 3982 } else if (!instance.exposed) { 3983 instance.exposed = {}; 3984 } 3985 } 3986 if (render2 && instance.render === NOOP) { 3987 instance.render = render2; 3988 } 3989 if (inheritAttrs != null) { 3990 instance.inheritAttrs = inheritAttrs; 3991 } 3992 if (components) instance.components = components; 3993 if (directives) instance.directives = directives; 3994} 3995function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { 3996 if (isArray(injectOptions)) { 3997 injectOptions = normalizeInject(injectOptions); 3998 } 3999 for (const key in injectOptions) { 4000 const opt = injectOptions[key]; 4001 let injected; 4002 if (isObject(opt)) { 4003 if ("default" in opt) { 4004 injected = inject( 4005 opt.from || key, 4006 opt.default, 4007 true 4008 ); 4009 } else { 4010 injected = inject(opt.from || key); 4011 } 4012 } else { 4013 injected = inject(opt); 4014 } 4015 if (isRef2(injected)) { 4016 Object.defineProperty(ctx, key, { 4017 enumerable: true, 4018 configurable: true, 4019 get: () => injected.value, 4020 set: (v) => injected.value = v 4021 }); 4022 } else { 4023 ctx[key] = injected; 4024 } 4025 if (true) { 4026 checkDuplicateProperties("Inject", key); 4027 } 4028 } 4029} 4030function callHook(hook, instance, type) { 4031 callWithAsyncErrorHandling( 4032 isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), 4033 instance, 4034 type 4035 ); 4036} 4037function createWatcher(raw, ctx, publicThis, key) { 4038 const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; 4039 if (isString(raw)) { 4040 const handler = ctx[raw]; 4041 if (isFunction(handler)) { 4042 watch(getter, handler); 4043 } else if (true) { 4044 warn$1(`Invalid watch handler specified by key "${raw}"`, handler); 4045 } 4046 } else if (isFunction(raw)) { 4047 watch(getter, raw.bind(publicThis)); 4048 } else if (isObject(raw)) { 4049 if (isArray(raw)) { 4050 raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); 4051 } else { 4052 const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; 4053 if (isFunction(handler)) { 4054 watch(getter, handler, raw); 4055 } else if (true) { 4056 warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); 4057 } 4058 } 4059 } else if (true) { 4060 warn$1(`Invalid watch option: "${key}"`, raw); 4061 } 4062} 4063function resolveMergedOptions(instance) { 4064 const base = instance.type; 4065 const { mixins, extends: extendsOptions } = base; 4066 const { 4067 mixins: globalMixins, 4068 optionsCache: cache, 4069 config: { optionMergeStrategies } 4070 } = instance.appContext; 4071 const cached = cache.get(base); 4072 let resolved; 4073 if (cached) { 4074 resolved = cached; 4075 } else if (!globalMixins.length && !mixins && !extendsOptions) { 4076 { 4077 resolved = base; 4078 } 4079 } else { 4080 resolved = {}; 4081 if (globalMixins.length) { 4082 globalMixins.forEach( 4083 (m) => mergeOptions(resolved, m, optionMergeStrategies, true) 4084 ); 4085 } 4086 mergeOptions(resolved, base, optionMergeStrategies); 4087 } 4088 if (isObject(base)) { 4089 cache.set(base, resolved); 4090 } 4091 return resolved; 4092} 4093function mergeOptions(to, from, strats, asMixin = false) { 4094 const { mixins, extends: extendsOptions } = from; 4095 if (extendsOptions) { 4096 mergeOptions(to, extendsOptions, strats, true); 4097 } 4098 if (mixins) { 4099 mixins.forEach( 4100 (m) => mergeOptions(to, m, strats, true) 4101 ); 4102 } 4103 for (const key in from) { 4104 if (asMixin && key === "expose") { 4105 warn$1( 4106 `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` 4107 ); 4108 } else { 4109 const strat = internalOptionMergeStrats[key] || strats && strats[key]; 4110 to[key] = strat ? strat(to[key], from[key]) : from[key]; 4111 } 4112 } 4113 return to; 4114} 4115var internalOptionMergeStrats = { 4116 data: mergeDataFn, 4117 props: mergeEmitsOrPropsOptions, 4118 emits: mergeEmitsOrPropsOptions, 4119 // objects 4120 methods: mergeObjectOptions, 4121 computed: mergeObjectOptions, 4122 // lifecycle 4123 beforeCreate: mergeAsArray, 4124 created: mergeAsArray, 4125 beforeMount: mergeAsArray, 4126 mounted: mergeAsArray, 4127 beforeUpdate: mergeAsArray, 4128 updated: mergeAsArray, 4129 beforeDestroy: mergeAsArray, 4130 beforeUnmount: mergeAsArray, 4131 destroyed: mergeAsArray, 4132 unmounted: mergeAsArray, 4133 activated: mergeAsArray, 4134 deactivated: mergeAsArray, 4135 errorCaptured: mergeAsArray, 4136 serverPrefetch: mergeAsArray, 4137 // assets 4138 components: mergeObjectOptions, 4139 directives: mergeObjectOptions, 4140 // watch 4141 watch: mergeWatchOptions, 4142 // provide / inject 4143 provide: mergeDataFn, 4144 inject: mergeInject 4145}; 4146function mergeDataFn(to, from) { 4147 if (!from) { 4148 return to; 4149 } 4150 if (!to) { 4151 return from; 4152 } 4153 return function mergedDataFn() { 4154 return extend( 4155 isFunction(to) ? to.call(this, this) : to, 4156 isFunction(from) ? from.call(this, this) : from 4157 ); 4158 }; 4159} 4160function mergeInject(to, from) { 4161 return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); 4162} 4163function normalizeInject(raw) { 4164 if (isArray(raw)) { 4165 const res = {}; 4166 for (let i = 0; i < raw.length; i++) { 4167 res[raw[i]] = raw[i]; 4168 } 4169 return res; 4170 } 4171 return raw; 4172} 4173function mergeAsArray(to, from) { 4174 return to ? [...new Set([].concat(to, from))] : from; 4175} 4176function mergeObjectOptions(to, from) { 4177 return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; 4178} 4179function mergeEmitsOrPropsOptions(to, from) { 4180 if (to) { 4181 if (isArray(to) && isArray(from)) { 4182 return [.../* @__PURE__ */ new Set([...to, ...from])]; 4183 } 4184 return extend( 4185 /* @__PURE__ */ Object.create(null), 4186 normalizePropsOrEmits(to), 4187 normalizePropsOrEmits(from != null ? from : {}) 4188 ); 4189 } else { 4190 return from; 4191 } 4192} 4193function mergeWatchOptions(to, from) { 4194 if (!to) return from; 4195 if (!from) return to; 4196 const merged = extend(/* @__PURE__ */ Object.create(null), to); 4197 for (const key in from) { 4198 merged[key] = mergeAsArray(to[key], from[key]); 4199 } 4200 return merged; 4201} 4202function createAppContext() { 4203 return { 4204 app: null, 4205 config: { 4206 isNativeTag: NO, 4207 performance: false, 4208 globalProperties: {}, 4209 optionMergeStrategies: {}, 4210 errorHandler: void 0, 4211 warnHandler: void 0, 4212 compilerOptions: {} 4213 }, 4214 mixins: [], 4215 components: {}, 4216 directives: {}, 4217 provides: /* @__PURE__ */ Object.create(null), 4218 optionsCache: /* @__PURE__ */ new WeakMap(), 4219 propsCache: /* @__PURE__ */ new WeakMap(), 4220 emitsCache: /* @__PURE__ */ new WeakMap() 4221 }; 4222} 4223var uid$1 = 0; 4224function createAppAPI(render2, hydrate2) { 4225 return function createApp2(rootComponent, rootProps = null) { 4226 if (!isFunction(rootComponent)) { 4227 rootComponent = extend({}, rootComponent); 4228 } 4229 if (rootProps != null && !isObject(rootProps)) { 4230 warn$1(`root props passed to app.mount() must be an object.`); 4231 rootProps = null; 4232 } 4233 const context = createAppContext(); 4234 const installedPlugins = /* @__PURE__ */ new WeakSet(); 4235 let isMounted = false; 4236 const app = context.app = { 4237 _uid: uid$1++, 4238 _component: rootComponent, 4239 _props: rootProps, 4240 _container: null, 4241 _context: context, 4242 _instance: null, 4243 version, 4244 get config() { 4245 return context.config; 4246 }, 4247 set config(v) { 4248 if (true) { 4249 warn$1( 4250 `app.config cannot be replaced. Modify individual options instead.` 4251 ); 4252 } 4253 }, 4254 use(plugin, ...options) { 4255 if (installedPlugins.has(plugin)) { 4256 warn$1(`Plugin has already been applied to target app.`); 4257 } else if (plugin && isFunction(plugin.install)) { 4258 installedPlugins.add(plugin); 4259 plugin.install(app, ...options); 4260 } else if (isFunction(plugin)) { 4261 installedPlugins.add(plugin); 4262 plugin(app, ...options); 4263 } else if (true) { 4264 warn$1( 4265 `A plugin must either be a function or an object with an "install" function.` 4266 ); 4267 } 4268 return app; 4269 }, 4270 mixin(mixin) { 4271 if (__VUE_OPTIONS_API__) { 4272 if (!context.mixins.includes(mixin)) { 4273 context.mixins.push(mixin); 4274 } else if (true) { 4275 warn$1( 4276 "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") 4277 ); 4278 } 4279 } else if (true) { 4280 warn$1("Mixins are only available in builds supporting Options API"); 4281 } 4282 return app; 4283 }, 4284 component(name, component) { 4285 if (true) { 4286 validateComponentName(name, context.config); 4287 } 4288 if (!component) { 4289 return context.components[name]; 4290 } 4291 if (context.components[name]) { 4292 warn$1(`Component "${name}" has already been registered in target app.`); 4293 } 4294 context.components[name] = component; 4295 return app; 4296 }, 4297 directive(name, directive) { 4298 if (true) { 4299 validateDirectiveName(name); 4300 } 4301 if (!directive) { 4302 return context.directives[name]; 4303 } 4304 if (context.directives[name]) { 4305 warn$1(`Directive "${name}" has already been registered in target app.`); 4306 } 4307 context.directives[name] = directive; 4308 return app; 4309 }, 4310 mount(rootContainer, isHydrate, namespace) { 4311 if (!isMounted) { 4312 if (rootContainer.__vue_app__) { 4313 warn$1( 4314 `There is already an app instance mounted on the host container. 4315 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` 4316 ); 4317 } 4318 const vnode = createVNode(rootComponent, rootProps); 4319 vnode.appContext = context; 4320 if (namespace === true) { 4321 namespace = "svg"; 4322 } else if (namespace === false) { 4323 namespace = void 0; 4324 } 4325 if (true) { 4326 context.reload = () => { 4327 render2( 4328 cloneVNode(vnode), 4329 rootContainer, 4330 namespace 4331 ); 4332 }; 4333 } 4334 if (isHydrate && hydrate2) { 4335 hydrate2(vnode, rootContainer); 4336 } else { 4337 render2(vnode, rootContainer, namespace); 4338 } 4339 isMounted = true; 4340 app._container = rootContainer; 4341 rootContainer.__vue_app__ = app; 4342 if (true) { 4343 app._instance = vnode.component; 4344 devtoolsInitApp(app, version); 4345 } 4346 return getComponentPublicInstance(vnode.component); 4347 } else if (true) { 4348 warn$1( 4349 `App has already been mounted. 4350If 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)\`` 4351 ); 4352 } 4353 }, 4354 unmount() { 4355 if (isMounted) { 4356 render2(null, app._container); 4357 if (true) { 4358 app._instance = null; 4359 devtoolsUnmountApp(app); 4360 } 4361 delete app._container.__vue_app__; 4362 } else if (true) { 4363 warn$1(`Cannot unmount an app that is not mounted.`); 4364 } 4365 }, 4366 provide(key, value) { 4367 if (key in context.provides) { 4368 warn$1( 4369 `App already provides property with key "${String(key)}". It will be overwritten with the new value.` 4370 ); 4371 } 4372 context.provides[key] = value; 4373 return app; 4374 }, 4375 runWithContext(fn) { 4376 const lastApp = currentApp; 4377 currentApp = app; 4378 try { 4379 return fn(); 4380 } finally { 4381 currentApp = lastApp; 4382 } 4383 } 4384 }; 4385 return app; 4386 }; 4387} 4388var currentApp = null; 4389function provide(key, value) { 4390 if (!currentInstance) { 4391 if (true) { 4392 warn$1(`provide() can only be used inside setup().`); 4393 } 4394 } else { 4395 let provides = currentInstance.provides; 4396 const parentProvides = currentInstance.parent && currentInstance.parent.provides; 4397 if (parentProvides === provides) { 4398 provides = currentInstance.provides = Object.create(parentProvides); 4399 } 4400 provides[key] = value; 4401 } 4402} 4403function inject(key, defaultValue, treatDefaultAsFactory = false) { 4404 const instance = currentInstance || currentRenderingInstance; 4405 if (instance || currentApp) { 4406 const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides; 4407 if (provides && key in provides) { 4408 return provides[key]; 4409 } else if (arguments.length > 1) { 4410 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; 4411 } else if (true) { 4412 warn$1(`injection "${String(key)}" not found.`); 4413 } 4414 } else if (true) { 4415 warn$1(`inject() can only be used inside setup() or functional components.`); 4416 } 4417} 4418function hasInjectionContext() { 4419 return !!(currentInstance || currentRenderingInstance || currentApp); 4420} 4421var internalObjectProto = {}; 4422var createInternalObject = () => Object.create(internalObjectProto); 4423var isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; 4424function initProps(instance, rawProps, isStateful, isSSR = false) { 4425 const props = {}; 4426 const attrs = createInternalObject(); 4427 instance.propsDefaults = /* @__PURE__ */ Object.create(null); 4428 setFullProps(instance, rawProps, props, attrs); 4429 for (const key in instance.propsOptions[0]) { 4430 if (!(key in props)) { 4431 props[key] = void 0; 4432 } 4433 } 4434 if (true) { 4435 validateProps(rawProps || {}, props, instance); 4436 } 4437 if (isStateful) { 4438 instance.props = isSSR ? props : shallowReactive(props); 4439 } else { 4440 if (!instance.type.props) { 4441 instance.props = attrs; 4442 } else { 4443 instance.props = props; 4444 } 4445 } 4446 instance.attrs = attrs; 4447} 4448function isInHmrContext(instance) { 4449 while (instance) { 4450 if (instance.type.__hmrId) return true; 4451 instance = instance.parent; 4452 } 4453} 4454function updateProps(instance, rawProps, rawPrevProps, optimized) { 4455 const { 4456 props, 4457 attrs, 4458 vnode: { patchFlag } 4459 } = instance; 4460 const rawCurrentProps = toRaw(props); 4461 const [options] = instance.propsOptions; 4462 let hasAttrsChanged = false; 4463 if ( 4464 // always force full diff in dev 4465 // - #1942 if hmr is enabled with sfc component 4466 // - vite#872 non-sfc component used by sfc component 4467 !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) 4468 ) { 4469 if (patchFlag & 8) { 4470 const propsToUpdate = instance.vnode.dynamicProps; 4471 for (let i = 0; i < propsToUpdate.length; i++) { 4472 let key = propsToUpdate[i]; 4473 if (isEmitListener(instance.emitsOptions, key)) { 4474 continue; 4475 } 4476 const value = rawProps[key]; 4477 if (options) { 4478 if (hasOwn(attrs, key)) { 4479 if (value !== attrs[key]) { 4480 attrs[key] = value; 4481 hasAttrsChanged = true; 4482 } 4483 } else { 4484 const camelizedKey = camelize(key); 4485 props[camelizedKey] = resolvePropValue( 4486 options, 4487 rawCurrentProps, 4488 camelizedKey, 4489 value, 4490 instance, 4491 false 4492 ); 4493 } 4494 } else { 4495 if (value !== attrs[key]) { 4496 attrs[key] = value; 4497 hasAttrsChanged = true; 4498 } 4499 } 4500 } 4501 } 4502 } else { 4503 if (setFullProps(instance, rawProps, props, attrs)) { 4504 hasAttrsChanged = true; 4505 } 4506 let kebabKey; 4507 for (const key in rawCurrentProps) { 4508 if (!rawProps || // for camelCase 4509 !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case 4510 // and converted to camelCase (#955) 4511 ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { 4512 if (options) { 4513 if (rawPrevProps && // for camelCase 4514 (rawPrevProps[key] !== void 0 || // for kebab-case 4515 rawPrevProps[kebabKey] !== void 0)) { 4516 props[key] = resolvePropValue( 4517 options, 4518 rawCurrentProps, 4519 key, 4520 void 0, 4521 instance, 4522 true 4523 ); 4524 } 4525 } else { 4526 delete props[key]; 4527 } 4528 } 4529 } 4530 if (attrs !== rawCurrentProps) { 4531 for (const key in attrs) { 4532 if (!rawProps || !hasOwn(rawProps, key) && true) { 4533 delete attrs[key]; 4534 hasAttrsChanged = true; 4535 } 4536 } 4537 } 4538 } 4539 if (hasAttrsChanged) { 4540 trigger(instance.attrs, "set", ""); 4541 } 4542 if (true) { 4543 validateProps(rawProps || {}, props, instance); 4544 } 4545} 4546function setFullProps(instance, rawProps, props, attrs) { 4547 const [options, needCastKeys] = instance.propsOptions; 4548 let hasAttrsChanged = false; 4549 let rawCastValues; 4550 if (rawProps) { 4551 for (let key in rawProps) { 4552 if (isReservedProp(key)) { 4553 continue; 4554 } 4555 const value = rawProps[key]; 4556 let camelKey; 4557 if (options && hasOwn(options, camelKey = camelize(key))) { 4558 if (!needCastKeys || !needCastKeys.includes(camelKey)) { 4559 props[camelKey] = value; 4560 } else { 4561 (rawCastValues || (rawCastValues = {}))[camelKey] = value; 4562 } 4563 } else if (!isEmitListener(instance.emitsOptions, key)) { 4564 if (!(key in attrs) || value !== attrs[key]) { 4565 attrs[key] = value; 4566 hasAttrsChanged = true; 4567 } 4568 } 4569 } 4570 } 4571 if (needCastKeys) { 4572 const rawCurrentProps = toRaw(props); 4573 const castValues = rawCastValues || EMPTY_OBJ; 4574 for (let i = 0; i < needCastKeys.length; i++) { 4575 const key = needCastKeys[i]; 4576 props[key] = resolvePropValue( 4577 options, 4578 rawCurrentProps, 4579 key, 4580 castValues[key], 4581 instance, 4582 !hasOwn(castValues, key) 4583 ); 4584 } 4585 } 4586 return hasAttrsChanged; 4587} 4588function resolvePropValue(options, props, key, value, instance, isAbsent) { 4589 const opt = options[key]; 4590 if (opt != null) { 4591 const hasDefault = hasOwn(opt, "default"); 4592 if (hasDefault && value === void 0) { 4593 const defaultValue = opt.default; 4594 if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { 4595 const { propsDefaults } = instance; 4596 if (key in propsDefaults) { 4597 value = propsDefaults[key]; 4598 } else { 4599 const reset2 = setCurrentInstance(instance); 4600 value = propsDefaults[key] = defaultValue.call( 4601 null, 4602 props 4603 ); 4604 reset2(); 4605 } 4606 } else { 4607 value = defaultValue; 4608 } 4609 } 4610 if (opt[ 4611 0 4612 /* shouldCast */ 4613 ]) { 4614 if (isAbsent && !hasDefault) { 4615 value = false; 4616 } else if (opt[ 4617 1 4618 /* shouldCastTrue */ 4619 ] && (value === "" || value === hyphenate(key))) { 4620 value = true; 4621 } 4622 } 4623 } 4624 return value; 4625} 4626var mixinPropsCache = /* @__PURE__ */ new WeakMap(); 4627function normalizePropsOptions(comp, appContext, asMixin = false) { 4628 const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache; 4629 const cached = cache.get(comp); 4630 if (cached) { 4631 return cached; 4632 } 4633 const raw = comp.props; 4634 const normalized = {}; 4635 const needCastKeys = []; 4636 let hasExtends = false; 4637 if (__VUE_OPTIONS_API__ && !isFunction(comp)) { 4638 const extendProps = (raw2) => { 4639 hasExtends = true; 4640 const [props, keys] = normalizePropsOptions(raw2, appContext, true); 4641 extend(normalized, props); 4642 if (keys) needCastKeys.push(...keys); 4643 }; 4644 if (!asMixin && appContext.mixins.length) { 4645 appContext.mixins.forEach(extendProps); 4646 } 4647 if (comp.extends) { 4648 extendProps(comp.extends); 4649 } 4650 if (comp.mixins) { 4651 comp.mixins.forEach(extendProps); 4652 } 4653 } 4654 if (!raw && !hasExtends) { 4655 if (isObject(comp)) { 4656 cache.set(comp, EMPTY_ARR); 4657 } 4658 return EMPTY_ARR; 4659 } 4660 if (isArray(raw)) { 4661 for (let i = 0; i < raw.length; i++) { 4662 if (!isString(raw[i])) { 4663 warn$1(`props must be strings when using array syntax.`, raw[i]); 4664 } 4665 const normalizedKey = camelize(raw[i]); 4666 if (validatePropName(normalizedKey)) { 4667 normalized[normalizedKey] = EMPTY_OBJ; 4668 } 4669 } 4670 } else if (raw) { 4671 if (!isObject(raw)) { 4672 warn$1(`invalid props options`, raw); 4673 } 4674 for (const key in raw) { 4675 const normalizedKey = camelize(key); 4676 if (validatePropName(normalizedKey)) { 4677 const opt = raw[key]; 4678 const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); 4679 if (prop) { 4680 const booleanIndex = getTypeIndex(Boolean, prop.type); 4681 const stringIndex = getTypeIndex(String, prop.type); 4682 prop[ 4683 0 4684 /* shouldCast */ 4685 ] = booleanIndex > -1; 4686 prop[ 4687 1 4688 /* shouldCastTrue */ 4689 ] = stringIndex < 0 || booleanIndex < stringIndex; 4690 if (booleanIndex > -1 || hasOwn(prop, "default")) { 4691 needCastKeys.push(normalizedKey); 4692 } 4693 } 4694 } 4695 } 4696 } 4697 const res = [normalized, needCastKeys]; 4698 if (isObject(comp)) { 4699 cache.set(comp, res); 4700 } 4701 return res; 4702} 4703function validatePropName(key) { 4704 if (key[0] !== "$" && !isReservedProp(key)) { 4705 return true; 4706 } else if (true) { 4707 warn$1(`Invalid prop name: "${key}" is a reserved property.`); 4708 } 4709 return false; 4710} 4711function getType(ctor) { 4712 if (ctor === null) { 4713 return "null"; 4714 } 4715 if (typeof ctor === "function") { 4716 return ctor.name || ""; 4717 } else if (typeof ctor === "object") { 4718 const name = ctor.constructor && ctor.constructor.name; 4719 return name || ""; 4720 } 4721 return ""; 4722} 4723function isSameType(a, b) { 4724 return getType(a) === getType(b); 4725} 4726function getTypeIndex(type, expectedTypes) { 4727 if (isArray(expectedTypes)) { 4728 return expectedTypes.findIndex((t) => isSameType(t, type)); 4729 } else if (isFunction(expectedTypes)) { 4730 return isSameType(expectedTypes, type) ? 0 : -1; 4731 } 4732 return -1; 4733} 4734function validateProps(rawProps, props, instance) { 4735 const resolvedValues = toRaw(props); 4736 const options = instance.propsOptions[0]; 4737 for (const key in options) { 4738 let opt = options[key]; 4739 if (opt == null) continue; 4740 validateProp( 4741 key, 4742 resolvedValues[key], 4743 opt, 4744 true ? shallowReadonly(resolvedValues) : resolvedValues, 4745 !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)) 4746 ); 4747 } 4748} 4749function validateProp(name, value, prop, props, isAbsent) { 4750 const { type, required, validator, skipCheck } = prop; 4751 if (required && isAbsent) { 4752 warn$1('Missing required prop: "' + name + '"'); 4753 return; 4754 } 4755 if (value == null && !required) { 4756 return; 4757 } 4758 if (type != null && type !== true && !skipCheck) { 4759 let isValid = false; 4760 const types = isArray(type) ? type : [type]; 4761 const expectedTypes = []; 4762 for (let i = 0; i < types.length && !isValid; i++) { 4763 const { valid, expectedType } = assertType(value, types[i]); 4764 expectedTypes.push(expectedType || ""); 4765 isValid = valid; 4766 } 4767 if (!isValid) { 4768 warn$1(getInvalidTypeMessage(name, value, expectedTypes)); 4769 return; 4770 } 4771 } 4772 if (validator && !validator(value, props)) { 4773 warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); 4774 } 4775} 4776var isSimpleType = makeMap( 4777 "String,Number,Boolean,Function,Symbol,BigInt" 4778); 4779function assertType(value, type) { 4780 let valid; 4781 const expectedType = getType(type); 4782 if (isSimpleType(expectedType)) { 4783 const t = typeof value; 4784 valid = t === expectedType.toLowerCase(); 4785 if (!valid && t === "object") { 4786 valid = value instanceof type; 4787 } 4788 } else if (expectedType === "Object") { 4789 valid = isObject(value); 4790 } else if (expectedType === "Array") { 4791 valid = isArray(value); 4792 } else if (expectedType === "null") { 4793 valid = value === null; 4794 } else { 4795 valid = value instanceof type; 4796 } 4797 return { 4798 valid, 4799 expectedType 4800 }; 4801} 4802function getInvalidTypeMessage(name, value, expectedTypes) { 4803 if (expectedTypes.length === 0) { 4804 return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; 4805 } 4806 let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`; 4807 const expectedType = expectedTypes[0]; 4808 const receivedType = toRawType(value); 4809 const expectedValue = styleValue(value, expectedType); 4810 const receivedValue = styleValue(value, receivedType); 4811 if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { 4812 message += ` with value ${expectedValue}`; 4813 } 4814 message += `, got ${receivedType} `; 4815 if (isExplicable(receivedType)) { 4816 message += `with value ${receivedValue}.`; 4817 } 4818 return message; 4819} 4820function styleValue(value, type) { 4821 if (type === "String") { 4822 return `"${value}"`; 4823 } else if (type === "Number") { 4824 return `${Number(value)}`; 4825 } else { 4826 return `${value}`; 4827 } 4828} 4829function isExplicable(type) { 4830 const explicitTypes = ["string", "number", "boolean"]; 4831 return explicitTypes.some((elem) => type.toLowerCase() === elem); 4832} 4833function isBoolean(...args) { 4834 return args.some((elem) => elem.toLowerCase() === "boolean"); 4835} 4836var isInternalKey = (key) => key[0] === "_" || key === "$stable"; 4837var normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; 4838var normalizeSlot = (key, rawSlot, ctx) => { 4839 if (rawSlot._n) { 4840 return rawSlot; 4841 } 4842 const normalized = withCtx((...args) => { 4843 if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { 4844 warn$1( 4845 `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.` 4846 ); 4847 } 4848 return normalizeSlotValue(rawSlot(...args)); 4849 }, ctx); 4850 normalized._c = false; 4851 return normalized; 4852}; 4853var normalizeObjectSlots = (rawSlots, slots, instance) => { 4854 const ctx = rawSlots._ctx; 4855 for (const key in rawSlots) { 4856 if (isInternalKey(key)) continue; 4857 const value = rawSlots[key]; 4858 if (isFunction(value)) { 4859 slots[key] = normalizeSlot(key, value, ctx); 4860 } else if (value != null) { 4861 if (true) { 4862 warn$1( 4863 `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` 4864 ); 4865 } 4866 const normalized = normalizeSlotValue(value); 4867 slots[key] = () => normalized; 4868 } 4869 } 4870}; 4871var normalizeVNodeSlots = (instance, children) => { 4872 if (!isKeepAlive(instance.vnode) && true) { 4873 warn$1( 4874 `Non-function value encountered for default slot. Prefer function slots for better performance.` 4875 ); 4876 } 4877 const normalized = normalizeSlotValue(children); 4878 instance.slots.default = () => normalized; 4879}; 4880var assignSlots = (slots, children, optimized) => { 4881 for (const key in children) { 4882 if (optimized || key !== "_") { 4883 slots[key] = children[key]; 4884 } 4885 } 4886}; 4887var initSlots = (instance, children, optimized) => { 4888 const slots = instance.slots = createInternalObject(); 4889 if (instance.vnode.shapeFlag & 32) { 4890 const type = children._; 4891 if (type) { 4892 assignSlots(slots, children, optimized); 4893 if (optimized) { 4894 def(slots, "_", type, true); 4895 } 4896 } else { 4897 normalizeObjectSlots(children, slots); 4898 } 4899 } else if (children) { 4900 normalizeVNodeSlots(instance, children); 4901 } 4902}; 4903var updateSlots = (instance, children, optimized) => { 4904 const { vnode, slots } = instance; 4905 let needDeletionCheck = true; 4906 let deletionComparisonTarget = EMPTY_OBJ; 4907 if (vnode.shapeFlag & 32) { 4908 const type = children._; 4909 if (type) { 4910 if (isHmrUpdating) { 4911 assignSlots(slots, children, optimized); 4912 trigger(instance, "set", "$slots"); 4913 } else if (optimized && type === 1) { 4914 needDeletionCheck = false; 4915 } else { 4916 assignSlots(slots, children, optimized); 4917 } 4918 } else { 4919 needDeletionCheck = !children.$stable; 4920 normalizeObjectSlots(children, slots); 4921 } 4922 deletionComparisonTarget = children; 4923 } else if (children) { 4924 normalizeVNodeSlots(instance, children); 4925 deletionComparisonTarget = { default: 1 }; 4926 } 4927 if (needDeletionCheck) { 4928 for (const key in slots) { 4929 if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { 4930 delete slots[key]; 4931 } 4932 } 4933 } 4934}; 4935function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { 4936 if (isArray(rawRef)) { 4937 rawRef.forEach( 4938 (r, i) => setRef( 4939 r, 4940 oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), 4941 parentSuspense, 4942 vnode, 4943 isUnmount 4944 ) 4945 ); 4946 return; 4947 } 4948 if (isAsyncWrapper(vnode) && !isUnmount) { 4949 return; 4950 } 4951 const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; 4952 const value = isUnmount ? null : refValue; 4953 const { i: owner, r: ref2 } = rawRef; 4954 if (!owner) { 4955 warn$1( 4956 `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` 4957 ); 4958 return; 4959 } 4960 const oldRef = oldRawRef && oldRawRef.r; 4961 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; 4962 const setupState = owner.setupState; 4963 if (oldRef != null && oldRef !== ref2) { 4964 if (isString(oldRef)) { 4965 refs[oldRef] = null; 4966 if (hasOwn(setupState, oldRef)) { 4967 setupState[oldRef] = null; 4968 } 4969 } else if (isRef2(oldRef)) { 4970 oldRef.value = null; 4971 } 4972 } 4973 if (isFunction(ref2)) { 4974 callWithErrorHandling(ref2, owner, 12, [value, refs]); 4975 } else { 4976 const _isString = isString(ref2); 4977 const _isRef = isRef2(ref2); 4978 if (_isString || _isRef) { 4979 const doSet = () => { 4980 if (rawRef.f) { 4981 const existing = _isString ? hasOwn(setupState, ref2) ? setupState[ref2] : refs[ref2] : ref2.value; 4982 if (isUnmount) { 4983 isArray(existing) && remove(existing, refValue); 4984 } else { 4985 if (!isArray(existing)) { 4986 if (_isString) { 4987 refs[ref2] = [refValue]; 4988 if (hasOwn(setupState, ref2)) { 4989 setupState[ref2] = refs[ref2]; 4990 } 4991 } else { 4992 ref2.value = [refValue]; 4993 if (rawRef.k) refs[rawRef.k] = ref2.value; 4994 } 4995 } else if (!existing.includes(refValue)) { 4996 existing.push(refValue); 4997 } 4998 } 4999 } else if (_isString) { 5000 refs[ref2] = value; 5001 if (hasOwn(setupState, ref2)) { 5002 setupState[ref2] = value; 5003 } 5004 } else if (_isRef) { 5005 ref2.value = value; 5006 if (rawRef.k) refs[rawRef.k] = value; 5007 } else if (true) { 5008 warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`); 5009 } 5010 }; 5011 if (value) { 5012 doSet.id = -1; 5013 queuePostRenderEffect(doSet, parentSuspense); 5014 } else { 5015 doSet(); 5016 } 5017 } else if (true) { 5018 warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`); 5019 } 5020 } 5021} 5022var TeleportEndKey = Symbol("_vte"); 5023var isTeleport = (type) => type.__isTeleport; 5024var isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); 5025var isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; 5026var isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; 5027var resolveTarget = (props, select) => { 5028 const targetSelector = props && props.to; 5029 if (isString(targetSelector)) { 5030 if (!select) { 5031 warn$1( 5032 `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` 5033 ); 5034 return null; 5035 } else { 5036 const target = select(targetSelector); 5037 if (!target && !isTeleportDisabled(props)) { 5038 warn$1( 5039 `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.` 5040 ); 5041 } 5042 return target; 5043 } 5044 } else { 5045 if (!targetSelector && !isTeleportDisabled(props)) { 5046 warn$1(`Invalid Teleport target: ${targetSelector}`); 5047 } 5048 return targetSelector; 5049 } 5050}; 5051var TeleportImpl = { 5052 name: "Teleport", 5053 __isTeleport: true, 5054 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { 5055 const { 5056 mc: mountChildren, 5057 pc: patchChildren, 5058 pbc: patchBlockChildren, 5059 o: { insert, querySelector, createText, createComment } 5060 } = internals; 5061 const disabled = isTeleportDisabled(n2.props); 5062 let { shapeFlag, children, dynamicChildren } = n2; 5063 if (isHmrUpdating) { 5064 optimized = false; 5065 dynamicChildren = null; 5066 } 5067 if (n1 == null) { 5068 const placeholder = n2.el = true ? createComment("teleport start") : createText(""); 5069 const mainAnchor = n2.anchor = true ? createComment("teleport end") : createText(""); 5070 const target = n2.target = resolveTarget(n2.props, querySelector); 5071 const targetStart = n2.targetStart = createText(""); 5072 const targetAnchor = n2.targetAnchor = createText(""); 5073 insert(placeholder, container, anchor); 5074 insert(mainAnchor, container, anchor); 5075 targetStart[TeleportEndKey] = targetAnchor; 5076 if (target) { 5077 insert(targetStart, target); 5078 insert(targetAnchor, target); 5079 if (namespace === "svg" || isTargetSVG(target)) { 5080 namespace = "svg"; 5081 } else if (namespace === "mathml" || isTargetMathML(target)) { 5082 namespace = "mathml"; 5083 } 5084 } else if (!disabled) { 5085 warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`); 5086 } 5087 const mount = (container2, anchor2) => { 5088 if (shapeFlag & 16) { 5089 mountChildren( 5090 children, 5091 container2, 5092 anchor2, 5093 parentComponent, 5094 parentSuspense, 5095 namespace, 5096 slotScopeIds, 5097 optimized 5098 ); 5099 } 5100 }; 5101 if (disabled) { 5102 mount(container, mainAnchor); 5103 } else if (target) { 5104 mount(target, targetAnchor); 5105 } 5106 } else { 5107 n2.el = n1.el; 5108 n2.targetStart = n1.targetStart; 5109 const mainAnchor = n2.anchor = n1.anchor; 5110 const target = n2.target = n1.target; 5111 const targetAnchor = n2.targetAnchor = n1.targetAnchor; 5112 const wasDisabled = isTeleportDisabled(n1.props); 5113 const currentContainer = wasDisabled ? container : target; 5114 const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; 5115 if (namespace === "svg" || isTargetSVG(target)) { 5116 namespace = "svg"; 5117 } else if (namespace === "mathml" || isTargetMathML(target)) { 5118 namespace = "mathml"; 5119 } 5120 if (dynamicChildren) { 5121 patchBlockChildren( 5122 n1.dynamicChildren, 5123 dynamicChildren, 5124 currentContainer, 5125 parentComponent, 5126 parentSuspense, 5127 namespace, 5128 slotScopeIds 5129 ); 5130 traverseStaticChildren(n1, n2, true); 5131 } else if (!optimized) { 5132 patchChildren( 5133 n1, 5134 n2, 5135 currentContainer, 5136 currentAnchor, 5137 parentComponent, 5138 parentSuspense, 5139 namespace, 5140 slotScopeIds, 5141 false 5142 ); 5143 } 5144 if (disabled) { 5145 if (!wasDisabled) { 5146 moveTeleport( 5147 n2, 5148 container, 5149 mainAnchor, 5150 internals, 5151 1 5152 ); 5153 } else { 5154 if (n2.props && n1.props && n2.props.to !== n1.props.to) { 5155 n2.props.to = n1.props.to; 5156 } 5157 } 5158 } else { 5159 if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { 5160 const nextTarget = n2.target = resolveTarget( 5161 n2.props, 5162 querySelector 5163 ); 5164 if (nextTarget) { 5165 moveTeleport( 5166 n2, 5167 nextTarget, 5168 null, 5169 internals, 5170 0 5171 ); 5172 } else if (true) { 5173 warn$1( 5174 "Invalid Teleport target on update:", 5175 target, 5176 `(${typeof target})` 5177 ); 5178 } 5179 } else if (wasDisabled) { 5180 moveTeleport( 5181 n2, 5182 target, 5183 targetAnchor, 5184 internals, 5185 1 5186 ); 5187 } 5188 } 5189 } 5190 updateCssVars(n2); 5191 }, 5192 remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { 5193 const { 5194 shapeFlag, 5195 children, 5196 anchor, 5197 targetStart, 5198 targetAnchor, 5199 target, 5200 props 5201 } = vnode; 5202 if (target) { 5203 hostRemove(targetStart); 5204 hostRemove(targetAnchor); 5205 } 5206 doRemove && hostRemove(anchor); 5207 if (shapeFlag & 16) { 5208 const shouldRemove = doRemove || !isTeleportDisabled(props); 5209 for (let i = 0; i < children.length; i++) { 5210 const child = children[i]; 5211 unmount( 5212 child, 5213 parentComponent, 5214 parentSuspense, 5215 shouldRemove, 5216 !!child.dynamicChildren 5217 ); 5218 } 5219 } 5220 }, 5221 move: moveTeleport, 5222 hydrate: hydrateTeleport 5223}; 5224function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { 5225 if (moveType === 0) { 5226 insert(vnode.targetAnchor, container, parentAnchor); 5227 } 5228 const { el, anchor, shapeFlag, children, props } = vnode; 5229 const isReorder = moveType === 2; 5230 if (isReorder) { 5231 insert(el, container, parentAnchor); 5232 } 5233 if (!isReorder || isTeleportDisabled(props)) { 5234 if (shapeFlag & 16) { 5235 for (let i = 0; i < children.length; i++) { 5236 move( 5237 children[i], 5238 container, 5239 parentAnchor, 5240 2 5241 ); 5242 } 5243 } 5244 } 5245 if (isReorder) { 5246 insert(anchor, container, parentAnchor); 5247 } 5248} 5249function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { 5250 o: { nextSibling, parentNode, querySelector } 5251}, hydrateChildren) { 5252 const target = vnode.target = resolveTarget( 5253 vnode.props, 5254 querySelector 5255 ); 5256 if (target) { 5257 const targetNode = target._lpa || target.firstChild; 5258 if (vnode.shapeFlag & 16) { 5259 if (isTeleportDisabled(vnode.props)) { 5260 vnode.anchor = hydrateChildren( 5261 nextSibling(node), 5262 vnode, 5263 parentNode(node), 5264 parentComponent, 5265 parentSuspense, 5266 slotScopeIds, 5267 optimized 5268 ); 5269 vnode.targetAnchor = targetNode; 5270 } else { 5271 vnode.anchor = nextSibling(node); 5272 let targetAnchor = targetNode; 5273 while (targetAnchor) { 5274 targetAnchor = nextSibling(targetAnchor); 5275 if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") { 5276 vnode.targetAnchor = targetAnchor; 5277 target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); 5278 break; 5279 } 5280 } 5281 hydrateChildren( 5282 targetNode, 5283 vnode, 5284 target, 5285 parentComponent, 5286 parentSuspense, 5287 slotScopeIds, 5288 optimized 5289 ); 5290 } 5291 } 5292 updateCssVars(vnode); 5293 } 5294 return vnode.anchor && nextSibling(vnode.anchor); 5295} 5296var Teleport = TeleportImpl; 5297function updateCssVars(vnode) { 5298 const ctx = vnode.ctx; 5299 if (ctx && ctx.ut) { 5300 let node = vnode.children[0].el; 5301 while (node && node !== vnode.targetAnchor) { 5302 if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); 5303 node = node.nextSibling; 5304 } 5305 ctx.ut(); 5306 } 5307} 5308var hasLoggedMismatchError = false; 5309var logMismatchError = () => { 5310 if (hasLoggedMismatchError) { 5311 return; 5312 } 5313 console.error("Hydration completed but contains mismatches."); 5314 hasLoggedMismatchError = true; 5315}; 5316var isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; 5317var isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); 5318var getContainerType = (container) => { 5319 if (isSVGContainer(container)) return "svg"; 5320 if (isMathMLContainer(container)) return "mathml"; 5321 return void 0; 5322}; 5323var isComment = (node) => node.nodeType === 8; 5324function createHydrationFunctions(rendererInternals) { 5325 const { 5326 mt: mountComponent, 5327 p: patch, 5328 o: { 5329 patchProp: patchProp2, 5330 createText, 5331 nextSibling, 5332 parentNode, 5333 remove: remove2, 5334 insert, 5335 createComment 5336 } 5337 } = rendererInternals; 5338 const hydrate2 = (vnode, container) => { 5339 if (!container.hasChildNodes()) { 5340 warn$1( 5341 `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` 5342 ); 5343 patch(null, vnode, container); 5344 flushPostFlushCbs(); 5345 container._vnode = vnode; 5346 return; 5347 } 5348 hydrateNode(container.firstChild, vnode, null, null, null); 5349 flushPostFlushCbs(); 5350 container._vnode = vnode; 5351 }; 5352 const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { 5353 optimized = optimized || !!vnode.dynamicChildren; 5354 const isFragmentStart = isComment(node) && node.data === "["; 5355 const onMismatch = () => handleMismatch( 5356 node, 5357 vnode, 5358 parentComponent, 5359 parentSuspense, 5360 slotScopeIds, 5361 isFragmentStart 5362 ); 5363 const { type, ref: ref2, shapeFlag, patchFlag } = vnode; 5364 let domType = node.nodeType; 5365 vnode.el = node; 5366 if (true) { 5367 def(node, "__vnode", vnode, true); 5368 def(node, "__vueParentComponent", parentComponent, true); 5369 } 5370 if (patchFlag === -2) { 5371 optimized = false; 5372 vnode.dynamicChildren = null; 5373 } 5374 let nextNode = null; 5375 switch (type) { 5376 case Text: 5377 if (domType !== 3) { 5378 if (vnode.children === "") { 5379 insert(vnode.el = createText(""), parentNode(node), node); 5380 nextNode = node; 5381 } else { 5382 nextNode = onMismatch(); 5383 } 5384 } else { 5385 if (node.data !== vnode.children) { 5386 warn$1( 5387 `Hydration text mismatch in`, 5388 node.parentNode, 5389 ` 5390 - rendered on server: ${JSON.stringify( 5391 node.data 5392 )} 5393 - expected on client: ${JSON.stringify(vnode.children)}` 5394 ); 5395 logMismatchError(); 5396 node.data = vnode.children; 5397 } 5398 nextNode = nextSibling(node); 5399 } 5400 break; 5401 case Comment: 5402 if (isTemplateNode2(node)) { 5403 nextNode = nextSibling(node); 5404 replaceNode( 5405 vnode.el = node.content.firstChild, 5406 node, 5407 parentComponent 5408 ); 5409 } else if (domType !== 8 || isFragmentStart) { 5410 nextNode = onMismatch(); 5411 } else { 5412 nextNode = nextSibling(node); 5413 } 5414 break; 5415 case Static: 5416 if (isFragmentStart) { 5417 node = nextSibling(node); 5418 domType = node.nodeType; 5419 } 5420 if (domType === 1 || domType === 3) { 5421 nextNode = node; 5422 const needToAdoptContent = !vnode.children.length; 5423 for (let i = 0; i < vnode.staticCount; i++) { 5424 if (needToAdoptContent) 5425 vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; 5426 if (i === vnode.staticCount - 1) { 5427 vnode.anchor = nextNode; 5428 } 5429 nextNode = nextSibling(nextNode); 5430 } 5431 return isFragmentStart ? nextSibling(nextNode) : nextNode; 5432 } else { 5433 onMismatch(); 5434 } 5435 break; 5436 case Fragment: 5437 if (!isFragmentStart) { 5438 nextNode = onMismatch(); 5439 } else { 5440 nextNode = hydrateFragment( 5441 node, 5442 vnode, 5443 parentComponent, 5444 parentSuspense, 5445 slotScopeIds, 5446 optimized 5447 ); 5448 } 5449 break; 5450 default: 5451 if (shapeFlag & 1) { 5452 if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode2(node)) { 5453 nextNode = onMismatch(); 5454 } else { 5455 nextNode = hydrateElement( 5456 node, 5457 vnode, 5458 parentComponent, 5459 parentSuspense, 5460 slotScopeIds, 5461 optimized 5462 ); 5463 } 5464 } else if (shapeFlag & 6) { 5465 vnode.slotScopeIds = slotScopeIds; 5466 const container = parentNode(node); 5467 if (isFragmentStart) { 5468 nextNode = locateClosingAnchor(node); 5469 } else if (isComment(node) && node.data === "teleport start") { 5470 nextNode = locateClosingAnchor(node, node.data, "teleport end"); 5471 } else { 5472 nextNode = nextSibling(node); 5473 } 5474 mountComponent( 5475 vnode, 5476 container, 5477 null, 5478 parentComponent, 5479 parentSuspense, 5480 getContainerType(container), 5481 optimized 5482 ); 5483 if (isAsyncWrapper(vnode)) { 5484 let subTree; 5485 if (isFragmentStart) { 5486 subTree = createVNode(Fragment); 5487 subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; 5488 } else { 5489 subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); 5490 } 5491 subTree.el = node; 5492 vnode.component.subTree = subTree; 5493 } 5494 } else if (shapeFlag & 64) { 5495 if (domType !== 8) { 5496 nextNode = onMismatch(); 5497 } else { 5498 nextNode = vnode.type.hydrate( 5499 node, 5500 vnode, 5501 parentComponent, 5502 parentSuspense, 5503 slotScopeIds, 5504 optimized, 5505 rendererInternals, 5506 hydrateChildren 5507 ); 5508 } 5509 } else if (shapeFlag & 128) { 5510 nextNode = vnode.type.hydrate( 5511 node, 5512 vnode, 5513 parentComponent, 5514 parentSuspense, 5515 getContainerType(parentNode(node)), 5516 slotScopeIds, 5517 optimized, 5518 rendererInternals, 5519 hydrateNode 5520 ); 5521 } else if (true) { 5522 warn$1("Invalid HostVNode type:", type, `(${typeof type})`); 5523 } 5524 } 5525 if (ref2 != null) { 5526 setRef(ref2, null, parentSuspense, vnode); 5527 } 5528 return nextNode; 5529 }; 5530 const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 5531 optimized = optimized || !!vnode.dynamicChildren; 5532 const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; 5533 const forcePatch = type === "input" || type === "option"; 5534 if (true) { 5535 if (dirs) { 5536 invokeDirectiveHook(vnode, null, parentComponent, "created"); 5537 } 5538 let needCallTransitionHooks = false; 5539 if (isTemplateNode2(el)) { 5540 needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; 5541 const content = el.content.firstChild; 5542 if (needCallTransitionHooks) { 5543 transition.beforeEnter(content); 5544 } 5545 replaceNode(content, el, parentComponent); 5546 vnode.el = el = content; 5547 } 5548 if (shapeFlag & 16 && // skip if element has innerHTML / textContent 5549 !(props && (props.innerHTML || props.textContent))) { 5550 let next = hydrateChildren( 5551 el.firstChild, 5552 vnode, 5553 el, 5554 parentComponent, 5555 parentSuspense, 5556 slotScopeIds, 5557 optimized 5558 ); 5559 let hasWarned2 = false; 5560 while (next) { 5561 if (!hasWarned2) { 5562 warn$1( 5563 `Hydration children mismatch on`, 5564 el, 5565 ` 5566Server rendered element contains more child nodes than client vdom.` 5567 ); 5568 hasWarned2 = true; 5569 } 5570 logMismatchError(); 5571 const cur = next; 5572 next = next.nextSibling; 5573 remove2(cur); 5574 } 5575 } else if (shapeFlag & 8) { 5576 if (el.textContent !== vnode.children) { 5577 warn$1( 5578 `Hydration text content mismatch on`, 5579 el, 5580 ` 5581 - rendered on server: ${el.textContent} 5582 - expected on client: ${vnode.children}` 5583 ); 5584 logMismatchError(); 5585 el.textContent = vnode.children; 5586 } 5587 } 5588 if (props) { 5589 if (true) { 5590 for (const key in props) { 5591 if (// #11189 skip if this node has directives that have created hooks 5592 // as it could have mutated the DOM in any possible way 5593 !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { 5594 logMismatchError(); 5595 } 5596 if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers 5597 key[0] === ".") { 5598 patchProp2(el, key, null, props[key], void 0, parentComponent); 5599 } 5600 } 5601 } else if (props.onClick) { 5602 patchProp2( 5603 el, 5604 "onClick", 5605 null, 5606 props.onClick, 5607 void 0, 5608 parentComponent 5609 ); 5610 } else if (patchFlag & 4 && isReactive(props.style)) { 5611 for (const key in props.style) props.style[key]; 5612 } 5613 } 5614 let vnodeHooks; 5615 if (vnodeHooks = props && props.onVnodeBeforeMount) { 5616 invokeVNodeHook(vnodeHooks, parentComponent, vnode); 5617 } 5618 if (dirs) { 5619 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 5620 } 5621 if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { 5622 queueEffectWithSuspense(() => { 5623 vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); 5624 needCallTransitionHooks && transition.enter(el); 5625 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 5626 }, parentSuspense); 5627 } 5628 } 5629 return el.nextSibling; 5630 }; 5631 const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { 5632 optimized = optimized || !!parentVNode.dynamicChildren; 5633 const children = parentVNode.children; 5634 const l = children.length; 5635 let hasWarned2 = false; 5636 for (let i = 0; i < l; i++) { 5637 const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); 5638 const isText2 = vnode.type === Text; 5639 if (node) { 5640 if (isText2 && !optimized) { 5641 let next = children[i + 1]; 5642 if (next && (next = normalizeVNode(next)).type === Text) { 5643 insert( 5644 createText( 5645 node.data.slice(vnode.children.length) 5646 ), 5647 container, 5648 nextSibling(node) 5649 ); 5650 node.data = vnode.children; 5651 } 5652 } 5653 node = hydrateNode( 5654 node, 5655 vnode, 5656 parentComponent, 5657 parentSuspense, 5658 slotScopeIds, 5659 optimized 5660 ); 5661 } else if (isText2 && !vnode.children) { 5662 insert(vnode.el = createText(""), container); 5663 } else { 5664 if (!hasWarned2) { 5665 warn$1( 5666 `Hydration children mismatch on`, 5667 container, 5668 ` 5669Server rendered element contains fewer child nodes than client vdom.` 5670 ); 5671 hasWarned2 = true; 5672 } 5673 logMismatchError(); 5674 patch( 5675 null, 5676 vnode, 5677 container, 5678 null, 5679 parentComponent, 5680 parentSuspense, 5681 getContainerType(container), 5682 slotScopeIds 5683 ); 5684 } 5685 } 5686 return node; 5687 }; 5688 const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 5689 const { slotScopeIds: fragmentSlotScopeIds } = vnode; 5690 if (fragmentSlotScopeIds) { 5691 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 5692 } 5693 const container = parentNode(node); 5694 const next = hydrateChildren( 5695 nextSibling(node), 5696 vnode, 5697 container, 5698 parentComponent, 5699 parentSuspense, 5700 slotScopeIds, 5701 optimized 5702 ); 5703 if (next && isComment(next) && next.data === "]") { 5704 return nextSibling(vnode.anchor = next); 5705 } else { 5706 logMismatchError(); 5707 insert(vnode.anchor = createComment(`]`), container, next); 5708 return next; 5709 } 5710 }; 5711 const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { 5712 warn$1( 5713 `Hydration node mismatch: 5714- rendered on server:`, 5715 node, 5716 node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, 5717 ` 5718- expected on client:`, 5719 vnode.type 5720 ); 5721 logMismatchError(); 5722 vnode.el = null; 5723 if (isFragment) { 5724 const end = locateClosingAnchor(node); 5725 while (true) { 5726 const next2 = nextSibling(node); 5727 if (next2 && next2 !== end) { 5728 remove2(next2); 5729 } else { 5730 break; 5731 } 5732 } 5733 } 5734 const next = nextSibling(node); 5735 const container = parentNode(node); 5736 remove2(node); 5737 patch( 5738 null, 5739 vnode, 5740 container, 5741 next, 5742 parentComponent, 5743 parentSuspense, 5744 getContainerType(container), 5745 slotScopeIds 5746 ); 5747 return next; 5748 }; 5749 const locateClosingAnchor = (node, open = "[", close = "]") => { 5750 let match = 0; 5751 while (node) { 5752 node = nextSibling(node); 5753 if (node && isComment(node)) { 5754 if (node.data === open) match++; 5755 if (node.data === close) { 5756 if (match === 0) { 5757 return nextSibling(node); 5758 } else { 5759 match--; 5760 } 5761 } 5762 } 5763 } 5764 return node; 5765 }; 5766 const replaceNode = (newNode, oldNode, parentComponent) => { 5767 const parentNode2 = oldNode.parentNode; 5768 if (parentNode2) { 5769 parentNode2.replaceChild(newNode, oldNode); 5770 } 5771 let parent = parentComponent; 5772 while (parent) { 5773 if (parent.vnode.el === oldNode) { 5774 parent.vnode.el = parent.subTree.el = newNode; 5775 } 5776 parent = parent.parent; 5777 } 5778 }; 5779 const isTemplateNode2 = (node) => { 5780 return node.nodeType === 1 && node.tagName.toLowerCase() === "template"; 5781 }; 5782 return [hydrate2, hydrateNode]; 5783} 5784function propHasMismatch(el, key, clientValue, vnode, instance) { 5785 let mismatchType; 5786 let mismatchKey; 5787 let actual; 5788 let expected; 5789 if (key === "class") { 5790 actual = el.getAttribute("class"); 5791 expected = normalizeClass(clientValue); 5792 if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { 5793 mismatchType = mismatchKey = `class`; 5794 } 5795 } else if (key === "style") { 5796 actual = el.getAttribute("style") || ""; 5797 expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); 5798 const actualMap = toStyleMap(actual); 5799 const expectedMap = toStyleMap(expected); 5800 if (vnode.dirs) { 5801 for (const { dir, value } of vnode.dirs) { 5802 if (dir.name === "show" && !value) { 5803 expectedMap.set("display", "none"); 5804 } 5805 } 5806 } 5807 if (instance) { 5808 resolveCssVars(instance, vnode, expectedMap); 5809 } 5810 if (!isMapEqual(actualMap, expectedMap)) { 5811 mismatchType = mismatchKey = "style"; 5812 } 5813 } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { 5814 if (isBooleanAttr(key)) { 5815 actual = el.hasAttribute(key); 5816 expected = includeBooleanAttr(clientValue); 5817 } else if (clientValue == null) { 5818 actual = el.hasAttribute(key); 5819 expected = false; 5820 } else { 5821 if (el.hasAttribute(key)) { 5822 actual = el.getAttribute(key); 5823 } else if (key === "value" && el.tagName === "TEXTAREA") { 5824 actual = el.value; 5825 } else { 5826 actual = false; 5827 } 5828 expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; 5829 } 5830 if (actual !== expected) { 5831 mismatchType = `attribute`; 5832 mismatchKey = key; 5833 } 5834 } 5835 if (mismatchType) { 5836 const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; 5837 const preSegment = `Hydration ${mismatchType} mismatch on`; 5838 const postSegment = ` 5839 - rendered on server: ${format(actual)} 5840 - expected on client: ${format(expected)} 5841 Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. 5842 You should fix the source of the mismatch.`; 5843 { 5844 warn$1(preSegment, el, postSegment); 5845 } 5846 return true; 5847 } 5848 return false; 5849} 5850function toClassSet(str) { 5851 return new Set(str.trim().split(/\s+/)); 5852} 5853function isSetEqual(a, b) { 5854 if (a.size !== b.size) { 5855 return false; 5856 } 5857 for (const s of a) { 5858 if (!b.has(s)) { 5859 return false; 5860 } 5861 } 5862 return true; 5863} 5864function toStyleMap(str) { 5865 const styleMap = /* @__PURE__ */ new Map(); 5866 for (const item of str.split(";")) { 5867 let [key, value] = item.split(":"); 5868 key = key.trim(); 5869 value = value && value.trim(); 5870 if (key && value) { 5871 styleMap.set(key, value); 5872 } 5873 } 5874 return styleMap; 5875} 5876function isMapEqual(a, b) { 5877 if (a.size !== b.size) { 5878 return false; 5879 } 5880 for (const [key, value] of a) { 5881 if (value !== b.get(key)) { 5882 return false; 5883 } 5884 } 5885 return true; 5886} 5887function resolveCssVars(instance, vnode, expectedMap) { 5888 const root = instance.subTree; 5889 if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { 5890 const cssVars = instance.getCssVars(); 5891 for (const key in cssVars) { 5892 expectedMap.set(`--${key}`, String(cssVars[key])); 5893 } 5894 } 5895 if (vnode === root && instance.parent) { 5896 resolveCssVars(instance.parent, instance.vnode, expectedMap); 5897 } 5898} 5899var supported; 5900var perf; 5901function startMeasure(instance, type) { 5902 if (instance.appContext.config.performance && isSupported()) { 5903 perf.mark(`vue-${type}-${instance.uid}`); 5904 } 5905 if (true) { 5906 devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); 5907 } 5908} 5909function endMeasure(instance, type) { 5910 if (instance.appContext.config.performance && isSupported()) { 5911 const startTag = `vue-${type}-${instance.uid}`; 5912 const endTag = startTag + `:end`; 5913 perf.mark(endTag); 5914 perf.measure( 5915 `<${formatComponentName(instance, instance.type)}> ${type}`, 5916 startTag, 5917 endTag 5918 ); 5919 perf.clearMarks(startTag); 5920 perf.clearMarks(endTag); 5921 } 5922 if (true) { 5923 devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); 5924 } 5925} 5926function isSupported() { 5927 if (supported !== void 0) { 5928 return supported; 5929 } 5930 if (typeof window !== "undefined" && window.performance) { 5931 supported = true; 5932 perf = window.performance; 5933 } else { 5934 supported = false; 5935 } 5936 return supported; 5937} 5938function initFeatureFlags() { 5939 const needWarn = []; 5940 if (typeof __VUE_OPTIONS_API__ !== "boolean") { 5941 needWarn.push(`__VUE_OPTIONS_API__`); 5942 getGlobalThis().__VUE_OPTIONS_API__ = true; 5943 } 5944 if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") { 5945 needWarn.push(`__VUE_PROD_DEVTOOLS__`); 5946 getGlobalThis().__VUE_PROD_DEVTOOLS__ = false; 5947 } 5948 if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") { 5949 needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`); 5950 getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false; 5951 } 5952 if (needWarn.length) { 5953 const multi = needWarn.length > 1; 5954 console.warn( 5955 `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. 5956 5957For more details, see https://link.vuejs.org/feature-flags.` 5958 ); 5959 } 5960} 5961var queuePostRenderEffect = queueEffectWithSuspense; 5962function createRenderer(options) { 5963 return baseCreateRenderer(options); 5964} 5965function createHydrationRenderer(options) { 5966 return baseCreateRenderer(options, createHydrationFunctions); 5967} 5968function baseCreateRenderer(options, createHydrationFns) { 5969 { 5970 initFeatureFlags(); 5971 } 5972 const target = getGlobalThis(); 5973 target.__VUE__ = true; 5974 if (true) { 5975 setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); 5976 } 5977 const { 5978 insert: hostInsert, 5979 remove: hostRemove, 5980 patchProp: hostPatchProp, 5981 createElement: hostCreateElement, 5982 createText: hostCreateText, 5983 createComment: hostCreateComment, 5984 setText: hostSetText, 5985 setElementText: hostSetElementText, 5986 parentNode: hostParentNode, 5987 nextSibling: hostNextSibling, 5988 setScopeId: hostSetScopeId = NOOP, 5989 insertStaticContent: hostInsertStaticContent 5990 } = options; 5991 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { 5992 if (n1 === n2) { 5993 return; 5994 } 5995 if (n1 && !isSameVNodeType(n1, n2)) { 5996 anchor = getNextHostNode(n1); 5997 unmount(n1, parentComponent, parentSuspense, true); 5998 n1 = null; 5999 } 6000 if (n2.patchFlag === -2) { 6001 optimized = false; 6002 n2.dynamicChildren = null; 6003 } 6004 const { type, ref: ref2, shapeFlag } = n2; 6005 switch (type) { 6006 case Text: 6007 processText(n1, n2, container, anchor); 6008 break; 6009 case Comment: 6010 processCommentNode(n1, n2, container, anchor); 6011 break; 6012 case Static: 6013 if (n1 == null) { 6014 mountStaticNode(n2, container, anchor, namespace); 6015 } else if (true) { 6016 patchStaticNode(n1, n2, container, namespace); 6017 } 6018 break; 6019 case Fragment: 6020 processFragment( 6021 n1, 6022 n2, 6023 container, 6024 anchor, 6025 parentComponent, 6026 parentSuspense, 6027 namespace, 6028 slotScopeIds, 6029 optimized 6030 ); 6031 break; 6032 default: 6033 if (shapeFlag & 1) { 6034 processElement( 6035 n1, 6036 n2, 6037 container, 6038 anchor, 6039 parentComponent, 6040 parentSuspense, 6041 namespace, 6042 slotScopeIds, 6043 optimized 6044 ); 6045 } else if (shapeFlag & 6) { 6046 processComponent( 6047 n1, 6048 n2, 6049 container, 6050 anchor, 6051 parentComponent, 6052 parentSuspense, 6053 namespace, 6054 slotScopeIds, 6055 optimized 6056 ); 6057 } else if (shapeFlag & 64) { 6058 type.process( 6059 n1, 6060 n2, 6061 container, 6062 anchor, 6063 parentComponent, 6064 parentSuspense, 6065 namespace, 6066 slotScopeIds, 6067 optimized, 6068 internals 6069 ); 6070 } else if (shapeFlag & 128) { 6071 type.process( 6072 n1, 6073 n2, 6074 container, 6075 anchor, 6076 parentComponent, 6077 parentSuspense, 6078 namespace, 6079 slotScopeIds, 6080 optimized, 6081 internals 6082 ); 6083 } else if (true) { 6084 warn$1("Invalid VNode type:", type, `(${typeof type})`); 6085 } 6086 } 6087 if (ref2 != null && parentComponent) { 6088 setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2); 6089 } 6090 }; 6091 const processText = (n1, n2, container, anchor) => { 6092 if (n1 == null) { 6093 hostInsert( 6094 n2.el = hostCreateText(n2.children), 6095 container, 6096 anchor 6097 ); 6098 } else { 6099 const el = n2.el = n1.el; 6100 if (n2.children !== n1.children) { 6101 hostSetText(el, n2.children); 6102 } 6103 } 6104 }; 6105 const processCommentNode = (n1, n2, container, anchor) => { 6106 if (n1 == null) { 6107 hostInsert( 6108 n2.el = hostCreateComment(n2.children || ""), 6109 container, 6110 anchor 6111 ); 6112 } else { 6113 n2.el = n1.el; 6114 } 6115 }; 6116 const mountStaticNode = (n2, container, anchor, namespace) => { 6117 [n2.el, n2.anchor] = hostInsertStaticContent( 6118 n2.children, 6119 container, 6120 anchor, 6121 namespace, 6122 n2.el, 6123 n2.anchor 6124 ); 6125 }; 6126 const patchStaticNode = (n1, n2, container, namespace) => { 6127 if (n2.children !== n1.children) { 6128 const anchor = hostNextSibling(n1.anchor); 6129 removeStaticNode(n1); 6130 [n2.el, n2.anchor] = hostInsertStaticContent( 6131 n2.children, 6132 container, 6133 anchor, 6134 namespace 6135 ); 6136 } else { 6137 n2.el = n1.el; 6138 n2.anchor = n1.anchor; 6139 } 6140 }; 6141 const moveStaticNode = ({ el, anchor }, container, nextSibling) => { 6142 let next; 6143 while (el && el !== anchor) { 6144 next = hostNextSibling(el); 6145 hostInsert(el, container, nextSibling); 6146 el = next; 6147 } 6148 hostInsert(anchor, container, nextSibling); 6149 }; 6150 const removeStaticNode = ({ el, anchor }) => { 6151 let next; 6152 while (el && el !== anchor) { 6153 next = hostNextSibling(el); 6154 hostRemove(el); 6155 el = next; 6156 } 6157 hostRemove(anchor); 6158 }; 6159 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6160 if (n2.type === "svg") { 6161 namespace = "svg"; 6162 } else if (n2.type === "math") { 6163 namespace = "mathml"; 6164 } 6165 if (n1 == null) { 6166 mountElement( 6167 n2, 6168 container, 6169 anchor, 6170 parentComponent, 6171 parentSuspense, 6172 namespace, 6173 slotScopeIds, 6174 optimized 6175 ); 6176 } else { 6177 patchElement( 6178 n1, 6179 n2, 6180 parentComponent, 6181 parentSuspense, 6182 namespace, 6183 slotScopeIds, 6184 optimized 6185 ); 6186 } 6187 }; 6188 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6189 let el; 6190 let vnodeHook; 6191 const { props, shapeFlag, transition, dirs } = vnode; 6192 el = vnode.el = hostCreateElement( 6193 vnode.type, 6194 namespace, 6195 props && props.is, 6196 props 6197 ); 6198 if (shapeFlag & 8) { 6199 hostSetElementText(el, vnode.children); 6200 } else if (shapeFlag & 16) { 6201 mountChildren( 6202 vnode.children, 6203 el, 6204 null, 6205 parentComponent, 6206 parentSuspense, 6207 resolveChildrenNamespace(vnode, namespace), 6208 slotScopeIds, 6209 optimized 6210 ); 6211 } 6212 if (dirs) { 6213 invokeDirectiveHook(vnode, null, parentComponent, "created"); 6214 } 6215 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); 6216 if (props) { 6217 for (const key in props) { 6218 if (key !== "value" && !isReservedProp(key)) { 6219 hostPatchProp(el, key, null, props[key], namespace, parentComponent); 6220 } 6221 } 6222 if ("value" in props) { 6223 hostPatchProp(el, "value", null, props.value, namespace); 6224 } 6225 if (vnodeHook = props.onVnodeBeforeMount) { 6226 invokeVNodeHook(vnodeHook, parentComponent, vnode); 6227 } 6228 } 6229 if (true) { 6230 def(el, "__vnode", vnode, true); 6231 def(el, "__vueParentComponent", parentComponent, true); 6232 } 6233 if (dirs) { 6234 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 6235 } 6236 const needCallTransitionHooks = needTransition(parentSuspense, transition); 6237 if (needCallTransitionHooks) { 6238 transition.beforeEnter(el); 6239 } 6240 hostInsert(el, container, anchor); 6241 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { 6242 queuePostRenderEffect(() => { 6243 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 6244 needCallTransitionHooks && transition.enter(el); 6245 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 6246 }, parentSuspense); 6247 } 6248 }; 6249 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { 6250 if (scopeId) { 6251 hostSetScopeId(el, scopeId); 6252 } 6253 if (slotScopeIds) { 6254 for (let i = 0; i < slotScopeIds.length; i++) { 6255 hostSetScopeId(el, slotScopeIds[i]); 6256 } 6257 } 6258 if (parentComponent) { 6259 let subTree = parentComponent.subTree; 6260 if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { 6261 subTree = filterSingleRoot(subTree.children) || subTree; 6262 } 6263 if (vnode === subTree) { 6264 const parentVNode = parentComponent.vnode; 6265 setScopeId( 6266 el, 6267 parentVNode, 6268 parentVNode.scopeId, 6269 parentVNode.slotScopeIds, 6270 parentComponent.parent 6271 ); 6272 } 6273 } 6274 }; 6275 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { 6276 for (let i = start; i < children.length; i++) { 6277 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); 6278 patch( 6279 null, 6280 child, 6281 container, 6282 anchor, 6283 parentComponent, 6284 parentSuspense, 6285 namespace, 6286 slotScopeIds, 6287 optimized 6288 ); 6289 } 6290 }; 6291 const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6292 const el = n2.el = n1.el; 6293 if (true) { 6294 el.__vnode = n2; 6295 } 6296 let { patchFlag, dynamicChildren, dirs } = n2; 6297 patchFlag |= n1.patchFlag & 16; 6298 const oldProps = n1.props || EMPTY_OBJ; 6299 const newProps = n2.props || EMPTY_OBJ; 6300 let vnodeHook; 6301 parentComponent && toggleRecurse(parentComponent, false); 6302 if (vnodeHook = newProps.onVnodeBeforeUpdate) { 6303 invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 6304 } 6305 if (dirs) { 6306 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); 6307 } 6308 parentComponent && toggleRecurse(parentComponent, true); 6309 if (isHmrUpdating) { 6310 patchFlag = 0; 6311 optimized = false; 6312 dynamicChildren = null; 6313 } 6314 if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { 6315 hostSetElementText(el, ""); 6316 } 6317 if (dynamicChildren) { 6318 patchBlockChildren( 6319 n1.dynamicChildren, 6320 dynamicChildren, 6321 el, 6322 parentComponent, 6323 parentSuspense, 6324 resolveChildrenNamespace(n2, namespace), 6325 slotScopeIds 6326 ); 6327 if (true) { 6328 traverseStaticChildren(n1, n2); 6329 } 6330 } else if (!optimized) { 6331 patchChildren( 6332 n1, 6333 n2, 6334 el, 6335 null, 6336 parentComponent, 6337 parentSuspense, 6338 resolveChildrenNamespace(n2, namespace), 6339 slotScopeIds, 6340 false 6341 ); 6342 } 6343 if (patchFlag > 0) { 6344 if (patchFlag & 16) { 6345 patchProps(el, oldProps, newProps, parentComponent, namespace); 6346 } else { 6347 if (patchFlag & 2) { 6348 if (oldProps.class !== newProps.class) { 6349 hostPatchProp(el, "class", null, newProps.class, namespace); 6350 } 6351 } 6352 if (patchFlag & 4) { 6353 hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); 6354 } 6355 if (patchFlag & 8) { 6356 const propsToUpdate = n2.dynamicProps; 6357 for (let i = 0; i < propsToUpdate.length; i++) { 6358 const key = propsToUpdate[i]; 6359 const prev = oldProps[key]; 6360 const next = newProps[key]; 6361 if (next !== prev || key === "value") { 6362 hostPatchProp(el, key, prev, next, namespace, parentComponent); 6363 } 6364 } 6365 } 6366 } 6367 if (patchFlag & 1) { 6368 if (n1.children !== n2.children) { 6369 hostSetElementText(el, n2.children); 6370 } 6371 } 6372 } else if (!optimized && dynamicChildren == null) { 6373 patchProps(el, oldProps, newProps, parentComponent, namespace); 6374 } 6375 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { 6376 queuePostRenderEffect(() => { 6377 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 6378 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); 6379 }, parentSuspense); 6380 } 6381 }; 6382 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { 6383 for (let i = 0; i < newChildren.length; i++) { 6384 const oldVNode = oldChildren[i]; 6385 const newVNode = newChildren[i]; 6386 const container = ( 6387 // oldVNode may be an errored async setup() component inside Suspense 6388 // which will not have a mounted element 6389 oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent 6390 // of the Fragment itself so it can move its children. 6391 (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement 6392 // which also requires the correct parent container 6393 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. 6394 oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( 6395 // In other cases, the parent container is not actually used so we 6396 // just pass the block element here to avoid a DOM parentNode call. 6397 fallbackContainer 6398 ) 6399 ); 6400 patch( 6401 oldVNode, 6402 newVNode, 6403 container, 6404 null, 6405 parentComponent, 6406 parentSuspense, 6407 namespace, 6408 slotScopeIds, 6409 true 6410 ); 6411 } 6412 }; 6413 const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { 6414 if (oldProps !== newProps) { 6415 if (oldProps !== EMPTY_OBJ) { 6416 for (const key in oldProps) { 6417 if (!isReservedProp(key) && !(key in newProps)) { 6418 hostPatchProp( 6419 el, 6420 key, 6421 oldProps[key], 6422 null, 6423 namespace, 6424 parentComponent 6425 ); 6426 } 6427 } 6428 } 6429 for (const key in newProps) { 6430 if (isReservedProp(key)) continue; 6431 const next = newProps[key]; 6432 const prev = oldProps[key]; 6433 if (next !== prev && key !== "value") { 6434 hostPatchProp(el, key, prev, next, namespace, parentComponent); 6435 } 6436 } 6437 if ("value" in newProps) { 6438 hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); 6439 } 6440 } 6441 }; 6442 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6443 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); 6444 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); 6445 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; 6446 if ( 6447 // #5523 dev root fragment may inherit directives 6448 isHmrUpdating || patchFlag & 2048 6449 ) { 6450 patchFlag = 0; 6451 optimized = false; 6452 dynamicChildren = null; 6453 } 6454 if (fragmentSlotScopeIds) { 6455 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 6456 } 6457 if (n1 == null) { 6458 hostInsert(fragmentStartAnchor, container, anchor); 6459 hostInsert(fragmentEndAnchor, container, anchor); 6460 mountChildren( 6461 // #10007 6462 // such fragment like `<></>` will be compiled into 6463 // a fragment which doesn't have a children. 6464 // In this case fallback to an empty array 6465 n2.children || [], 6466 container, 6467 fragmentEndAnchor, 6468 parentComponent, 6469 parentSuspense, 6470 namespace, 6471 slotScopeIds, 6472 optimized 6473 ); 6474 } else { 6475 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result 6476 // of renderSlot() with no valid children 6477 n1.dynamicChildren) { 6478 patchBlockChildren( 6479 n1.dynamicChildren, 6480 dynamicChildren, 6481 container, 6482 parentComponent, 6483 parentSuspense, 6484 namespace, 6485 slotScopeIds 6486 ); 6487 if (true) { 6488 traverseStaticChildren(n1, n2); 6489 } else if ( 6490 // #2080 if the stable fragment has a key, it's a <template v-for> that may 6491 // get moved around. Make sure all root level vnodes inherit el. 6492 // #2134 or if it's a component root, it may also get moved around 6493 // as the component is being moved. 6494 n2.key != null || parentComponent && n2 === parentComponent.subTree 6495 ) { 6496 traverseStaticChildren( 6497 n1, 6498 n2, 6499 true 6500 /* shallow */ 6501 ); 6502 } 6503 } else { 6504 patchChildren( 6505 n1, 6506 n2, 6507 container, 6508 fragmentEndAnchor, 6509 parentComponent, 6510 parentSuspense, 6511 namespace, 6512 slotScopeIds, 6513 optimized 6514 ); 6515 } 6516 } 6517 }; 6518 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6519 n2.slotScopeIds = slotScopeIds; 6520 if (n1 == null) { 6521 if (n2.shapeFlag & 512) { 6522 parentComponent.ctx.activate( 6523 n2, 6524 container, 6525 anchor, 6526 namespace, 6527 optimized 6528 ); 6529 } else { 6530 mountComponent( 6531 n2, 6532 container, 6533 anchor, 6534 parentComponent, 6535 parentSuspense, 6536 namespace, 6537 optimized 6538 ); 6539 } 6540 } else { 6541 updateComponent(n1, n2, optimized); 6542 } 6543 }; 6544 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { 6545 const instance = initialVNode.component = createComponentInstance( 6546 initialVNode, 6547 parentComponent, 6548 parentSuspense 6549 ); 6550 if (instance.type.__hmrId) { 6551 registerHMR(instance); 6552 } 6553 if (true) { 6554 pushWarningContext(initialVNode); 6555 startMeasure(instance, `mount`); 6556 } 6557 if (isKeepAlive(initialVNode)) { 6558 instance.ctx.renderer = internals; 6559 } 6560 { 6561 if (true) { 6562 startMeasure(instance, `init`); 6563 } 6564 setupComponent(instance, false, optimized); 6565 if (true) { 6566 endMeasure(instance, `init`); 6567 } 6568 } 6569 if (instance.asyncDep) { 6570 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); 6571 if (!initialVNode.el) { 6572 const placeholder = instance.subTree = createVNode(Comment); 6573 processCommentNode(null, placeholder, container, anchor); 6574 } 6575 } else { 6576 setupRenderEffect( 6577 instance, 6578 initialVNode, 6579 container, 6580 anchor, 6581 parentSuspense, 6582 namespace, 6583 optimized 6584 ); 6585 } 6586 if (true) { 6587 popWarningContext(); 6588 endMeasure(instance, `mount`); 6589 } 6590 }; 6591 const updateComponent = (n1, n2, optimized) => { 6592 const instance = n2.component = n1.component; 6593 if (shouldUpdateComponent(n1, n2, optimized)) { 6594 if (instance.asyncDep && !instance.asyncResolved) { 6595 if (true) { 6596 pushWarningContext(n2); 6597 } 6598 updateComponentPreRender(instance, n2, optimized); 6599 if (true) { 6600 popWarningContext(); 6601 } 6602 return; 6603 } else { 6604 instance.next = n2; 6605 invalidateJob(instance.update); 6606 instance.effect.dirty = true; 6607 instance.update(); 6608 } 6609 } else { 6610 n2.el = n1.el; 6611 instance.vnode = n2; 6612 } 6613 }; 6614 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { 6615 const componentUpdateFn = () => { 6616 if (!instance.isMounted) { 6617 let vnodeHook; 6618 const { el, props } = initialVNode; 6619 const { bm, m, parent } = instance; 6620 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); 6621 toggleRecurse(instance, false); 6622 if (bm) { 6623 invokeArrayFns(bm); 6624 } 6625 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { 6626 invokeVNodeHook(vnodeHook, parent, initialVNode); 6627 } 6628 toggleRecurse(instance, true); 6629 if (el && hydrateNode) { 6630 const hydrateSubTree = () => { 6631 if (true) { 6632 startMeasure(instance, `render`); 6633 } 6634 instance.subTree = renderComponentRoot(instance); 6635 if (true) { 6636 endMeasure(instance, `render`); 6637 } 6638 if (true) { 6639 startMeasure(instance, `hydrate`); 6640 } 6641 hydrateNode( 6642 el, 6643 instance.subTree, 6644 instance, 6645 parentSuspense, 6646 null 6647 ); 6648 if (true) { 6649 endMeasure(instance, `hydrate`); 6650 } 6651 }; 6652 if (isAsyncWrapperVNode) { 6653 initialVNode.type.__asyncLoader().then( 6654 // note: we are moving the render call into an async callback, 6655 // which means it won't track dependencies - but it's ok because 6656 // a server-rendered async wrapper is already in resolved state 6657 // and it will never need to change. 6658 () => !instance.isUnmounted && hydrateSubTree() 6659 ); 6660 } else { 6661 hydrateSubTree(); 6662 } 6663 } else { 6664 if (true) { 6665 startMeasure(instance, `render`); 6666 } 6667 const subTree = instance.subTree = renderComponentRoot(instance); 6668 if (true) { 6669 endMeasure(instance, `render`); 6670 } 6671 if (true) { 6672 startMeasure(instance, `patch`); 6673 } 6674 patch( 6675 null, 6676 subTree, 6677 container, 6678 anchor, 6679 instance, 6680 parentSuspense, 6681 namespace 6682 ); 6683 if (true) { 6684 endMeasure(instance, `patch`); 6685 } 6686 initialVNode.el = subTree.el; 6687 } 6688 if (m) { 6689 queuePostRenderEffect(m, parentSuspense); 6690 } 6691 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { 6692 const scopedInitialVNode = initialVNode; 6693 queuePostRenderEffect( 6694 () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), 6695 parentSuspense 6696 ); 6697 } 6698 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { 6699 instance.a && queuePostRenderEffect(instance.a, parentSuspense); 6700 } 6701 instance.isMounted = true; 6702 if (true) { 6703 devtoolsComponentAdded(instance); 6704 } 6705 initialVNode = container = anchor = null; 6706 } else { 6707 let { next, bu, u, parent, vnode } = instance; 6708 { 6709 const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); 6710 if (nonHydratedAsyncRoot) { 6711 if (next) { 6712 next.el = vnode.el; 6713 updateComponentPreRender(instance, next, optimized); 6714 } 6715 nonHydratedAsyncRoot.asyncDep.then(() => { 6716 if (!instance.isUnmounted) { 6717 componentUpdateFn(); 6718 } 6719 }); 6720 return; 6721 } 6722 } 6723 let originNext = next; 6724 let vnodeHook; 6725 if (true) { 6726 pushWarningContext(next || instance.vnode); 6727 } 6728 toggleRecurse(instance, false); 6729 if (next) { 6730 next.el = vnode.el; 6731 updateComponentPreRender(instance, next, optimized); 6732 } else { 6733 next = vnode; 6734 } 6735 if (bu) { 6736 invokeArrayFns(bu); 6737 } 6738 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { 6739 invokeVNodeHook(vnodeHook, parent, next, vnode); 6740 } 6741 toggleRecurse(instance, true); 6742 if (true) { 6743 startMeasure(instance, `render`); 6744 } 6745 const nextTree = renderComponentRoot(instance); 6746 if (true) { 6747 endMeasure(instance, `render`); 6748 } 6749 const prevTree = instance.subTree; 6750 instance.subTree = nextTree; 6751 if (true) { 6752 startMeasure(instance, `patch`); 6753 } 6754 patch( 6755 prevTree, 6756 nextTree, 6757 // parent may have changed if it's in a teleport 6758 hostParentNode(prevTree.el), 6759 // anchor may have changed if it's in a fragment 6760 getNextHostNode(prevTree), 6761 instance, 6762 parentSuspense, 6763 namespace 6764 ); 6765 if (true) { 6766 endMeasure(instance, `patch`); 6767 } 6768 next.el = nextTree.el; 6769 if (originNext === null) { 6770 updateHOCHostEl(instance, nextTree.el); 6771 } 6772 if (u) { 6773 queuePostRenderEffect(u, parentSuspense); 6774 } 6775 if (vnodeHook = next.props && next.props.onVnodeUpdated) { 6776 queuePostRenderEffect( 6777 () => invokeVNodeHook(vnodeHook, parent, next, vnode), 6778 parentSuspense 6779 ); 6780 } 6781 if (true) { 6782 devtoolsComponentUpdated(instance); 6783 } 6784 if (true) { 6785 popWarningContext(); 6786 } 6787 } 6788 }; 6789 const effect2 = instance.effect = new ReactiveEffect( 6790 componentUpdateFn, 6791 NOOP, 6792 () => queueJob(update), 6793 instance.scope 6794 // track it in component's effect scope 6795 ); 6796 const update = instance.update = () => { 6797 if (effect2.dirty) { 6798 effect2.run(); 6799 } 6800 }; 6801 update.i = instance; 6802 update.id = instance.uid; 6803 toggleRecurse(instance, true); 6804 if (true) { 6805 effect2.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; 6806 effect2.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; 6807 } 6808 update(); 6809 }; 6810 const updateComponentPreRender = (instance, nextVNode, optimized) => { 6811 nextVNode.component = instance; 6812 const prevProps = instance.vnode.props; 6813 instance.vnode = nextVNode; 6814 instance.next = null; 6815 updateProps(instance, nextVNode.props, prevProps, optimized); 6816 updateSlots(instance, nextVNode.children, optimized); 6817 pauseTracking(); 6818 flushPreFlushCbs(instance); 6819 resetTracking(); 6820 }; 6821 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { 6822 const c1 = n1 && n1.children; 6823 const prevShapeFlag = n1 ? n1.shapeFlag : 0; 6824 const c2 = n2.children; 6825 const { patchFlag, shapeFlag } = n2; 6826 if (patchFlag > 0) { 6827 if (patchFlag & 128) { 6828 patchKeyedChildren( 6829 c1, 6830 c2, 6831 container, 6832 anchor, 6833 parentComponent, 6834 parentSuspense, 6835 namespace, 6836 slotScopeIds, 6837 optimized 6838 ); 6839 return; 6840 } else if (patchFlag & 256) { 6841 patchUnkeyedChildren( 6842 c1, 6843 c2, 6844 container, 6845 anchor, 6846 parentComponent, 6847 parentSuspense, 6848 namespace, 6849 slotScopeIds, 6850 optimized 6851 ); 6852 return; 6853 } 6854 } 6855 if (shapeFlag & 8) { 6856 if (prevShapeFlag & 16) { 6857 unmountChildren(c1, parentComponent, parentSuspense); 6858 } 6859 if (c2 !== c1) { 6860 hostSetElementText(container, c2); 6861 } 6862 } else { 6863 if (prevShapeFlag & 16) { 6864 if (shapeFlag & 16) { 6865 patchKeyedChildren( 6866 c1, 6867 c2, 6868 container, 6869 anchor, 6870 parentComponent, 6871 parentSuspense, 6872 namespace, 6873 slotScopeIds, 6874 optimized 6875 ); 6876 } else { 6877 unmountChildren(c1, parentComponent, parentSuspense, true); 6878 } 6879 } else { 6880 if (prevShapeFlag & 8) { 6881 hostSetElementText(container, ""); 6882 } 6883 if (shapeFlag & 16) { 6884 mountChildren( 6885 c2, 6886 container, 6887 anchor, 6888 parentComponent, 6889 parentSuspense, 6890 namespace, 6891 slotScopeIds, 6892 optimized 6893 ); 6894 } 6895 } 6896 } 6897 }; 6898 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6899 c1 = c1 || EMPTY_ARR; 6900 c2 = c2 || EMPTY_ARR; 6901 const oldLength = c1.length; 6902 const newLength = c2.length; 6903 const commonLength = Math.min(oldLength, newLength); 6904 let i; 6905 for (i = 0; i < commonLength; i++) { 6906 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 6907 patch( 6908 c1[i], 6909 nextChild, 6910 container, 6911 null, 6912 parentComponent, 6913 parentSuspense, 6914 namespace, 6915 slotScopeIds, 6916 optimized 6917 ); 6918 } 6919 if (oldLength > newLength) { 6920 unmountChildren( 6921 c1, 6922 parentComponent, 6923 parentSuspense, 6924 true, 6925 false, 6926 commonLength 6927 ); 6928 } else { 6929 mountChildren( 6930 c2, 6931 container, 6932 anchor, 6933 parentComponent, 6934 parentSuspense, 6935 namespace, 6936 slotScopeIds, 6937 optimized, 6938 commonLength 6939 ); 6940 } 6941 }; 6942 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 6943 let i = 0; 6944 const l2 = c2.length; 6945 let e1 = c1.length - 1; 6946 let e2 = l2 - 1; 6947 while (i <= e1 && i <= e2) { 6948 const n1 = c1[i]; 6949 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 6950 if (isSameVNodeType(n1, n2)) { 6951 patch( 6952 n1, 6953 n2, 6954 container, 6955 null, 6956 parentComponent, 6957 parentSuspense, 6958 namespace, 6959 slotScopeIds, 6960 optimized 6961 ); 6962 } else { 6963 break; 6964 } 6965 i++; 6966 } 6967 while (i <= e1 && i <= e2) { 6968 const n1 = c1[e1]; 6969 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); 6970 if (isSameVNodeType(n1, n2)) { 6971 patch( 6972 n1, 6973 n2, 6974 container, 6975 null, 6976 parentComponent, 6977 parentSuspense, 6978 namespace, 6979 slotScopeIds, 6980 optimized 6981 ); 6982 } else { 6983 break; 6984 } 6985 e1--; 6986 e2--; 6987 } 6988 if (i > e1) { 6989 if (i <= e2) { 6990 const nextPos = e2 + 1; 6991 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; 6992 while (i <= e2) { 6993 patch( 6994 null, 6995 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), 6996 container, 6997 anchor, 6998 parentComponent, 6999 parentSuspense, 7000 namespace, 7001 slotScopeIds, 7002 optimized 7003 ); 7004 i++; 7005 } 7006 } 7007 } else if (i > e2) { 7008 while (i <= e1) { 7009 unmount(c1[i], parentComponent, parentSuspense, true); 7010 i++; 7011 } 7012 } else { 7013 const s1 = i; 7014 const s2 = i; 7015 const keyToNewIndexMap = /* @__PURE__ */ new Map(); 7016 for (i = s2; i <= e2; i++) { 7017 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 7018 if (nextChild.key != null) { 7019 if (keyToNewIndexMap.has(nextChild.key)) { 7020 warn$1( 7021 `Duplicate keys found during update:`, 7022 JSON.stringify(nextChild.key), 7023 `Make sure keys are unique.` 7024 ); 7025 } 7026 keyToNewIndexMap.set(nextChild.key, i); 7027 } 7028 } 7029 let j; 7030 let patched = 0; 7031 const toBePatched = e2 - s2 + 1; 7032 let moved = false; 7033 let maxNewIndexSoFar = 0; 7034 const newIndexToOldIndexMap = new Array(toBePatched); 7035 for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; 7036 for (i = s1; i <= e1; i++) { 7037 const prevChild = c1[i]; 7038 if (patched >= toBePatched) { 7039 unmount(prevChild, parentComponent, parentSuspense, true); 7040 continue; 7041 } 7042 let newIndex; 7043 if (prevChild.key != null) { 7044 newIndex = keyToNewIndexMap.get(prevChild.key); 7045 } else { 7046 for (j = s2; j <= e2; j++) { 7047 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { 7048 newIndex = j; 7049 break; 7050 } 7051 } 7052 } 7053 if (newIndex === void 0) { 7054 unmount(prevChild, parentComponent, parentSuspense, true); 7055 } else { 7056 newIndexToOldIndexMap[newIndex - s2] = i + 1; 7057 if (newIndex >= maxNewIndexSoFar) { 7058 maxNewIndexSoFar = newIndex; 7059 } else { 7060 moved = true; 7061 } 7062 patch( 7063 prevChild, 7064 c2[newIndex], 7065 container, 7066 null, 7067 parentComponent, 7068 parentSuspense, 7069 namespace, 7070 slotScopeIds, 7071 optimized 7072 ); 7073 patched++; 7074 } 7075 } 7076 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; 7077 j = increasingNewIndexSequence.length - 1; 7078 for (i = toBePatched - 1; i >= 0; i--) { 7079 const nextIndex = s2 + i; 7080 const nextChild = c2[nextIndex]; 7081 const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; 7082 if (newIndexToOldIndexMap[i] === 0) { 7083 patch( 7084 null, 7085 nextChild, 7086 container, 7087 anchor, 7088 parentComponent, 7089 parentSuspense, 7090 namespace, 7091 slotScopeIds, 7092 optimized 7093 ); 7094 } else if (moved) { 7095 if (j < 0 || i !== increasingNewIndexSequence[j]) { 7096 move(nextChild, container, anchor, 2); 7097 } else { 7098 j--; 7099 } 7100 } 7101 } 7102 } 7103 }; 7104 const move = (vnode, container, anchor, moveType, parentSuspense = null) => { 7105 const { el, type, transition, children, shapeFlag } = vnode; 7106 if (shapeFlag & 6) { 7107 move(vnode.component.subTree, container, anchor, moveType); 7108 return; 7109 } 7110 if (shapeFlag & 128) { 7111 vnode.suspense.move(container, anchor, moveType); 7112 return; 7113 } 7114 if (shapeFlag & 64) { 7115 type.move(vnode, container, anchor, internals); 7116 return; 7117 } 7118 if (type === Fragment) { 7119 hostInsert(el, container, anchor); 7120 for (let i = 0; i < children.length; i++) { 7121 move(children[i], container, anchor, moveType); 7122 } 7123 hostInsert(vnode.anchor, container, anchor); 7124 return; 7125 } 7126 if (type === Static) { 7127 moveStaticNode(vnode, container, anchor); 7128 return; 7129 } 7130 const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; 7131 if (needTransition2) { 7132 if (moveType === 0) { 7133 transition.beforeEnter(el); 7134 hostInsert(el, container, anchor); 7135 queuePostRenderEffect(() => transition.enter(el), parentSuspense); 7136 } else { 7137 const { leave, delayLeave, afterLeave } = transition; 7138 const remove22 = () => hostInsert(el, container, anchor); 7139 const performLeave = () => { 7140 leave(el, () => { 7141 remove22(); 7142 afterLeave && afterLeave(); 7143 }); 7144 }; 7145 if (delayLeave) { 7146 delayLeave(el, remove22, performLeave); 7147 } else { 7148 performLeave(); 7149 } 7150 } 7151 } else { 7152 hostInsert(el, container, anchor); 7153 } 7154 }; 7155 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { 7156 const { 7157 type, 7158 props, 7159 ref: ref2, 7160 children, 7161 dynamicChildren, 7162 shapeFlag, 7163 patchFlag, 7164 dirs, 7165 cacheIndex 7166 } = vnode; 7167 if (patchFlag === -2) { 7168 optimized = false; 7169 } 7170 if (ref2 != null) { 7171 setRef(ref2, null, parentSuspense, vnode, true); 7172 } 7173 if (cacheIndex != null) { 7174 parentComponent.renderCache[cacheIndex] = void 0; 7175 } 7176 if (shapeFlag & 256) { 7177 parentComponent.ctx.deactivate(vnode); 7178 return; 7179 } 7180 const shouldInvokeDirs = shapeFlag & 1 && dirs; 7181 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); 7182 let vnodeHook; 7183 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { 7184 invokeVNodeHook(vnodeHook, parentComponent, vnode); 7185 } 7186 if (shapeFlag & 6) { 7187 unmountComponent(vnode.component, parentSuspense, doRemove); 7188 } else { 7189 if (shapeFlag & 128) { 7190 vnode.suspense.unmount(parentSuspense, doRemove); 7191 return; 7192 } 7193 if (shouldInvokeDirs) { 7194 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); 7195 } 7196 if (shapeFlag & 64) { 7197 vnode.type.remove( 7198 vnode, 7199 parentComponent, 7200 parentSuspense, 7201 internals, 7202 doRemove 7203 ); 7204 } else if (dynamicChildren && // #5154 7205 // when v-once is used inside a block, setBlockTracking(-1) marks the 7206 // parent block with hasOnce: true 7207 // so that it doesn't take the fast path during unmount - otherwise 7208 // components nested in v-once are never unmounted. 7209 !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments 7210 (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { 7211 unmountChildren( 7212 dynamicChildren, 7213 parentComponent, 7214 parentSuspense, 7215 false, 7216 true 7217 ); 7218 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { 7219 unmountChildren(children, parentComponent, parentSuspense); 7220 } 7221 if (doRemove) { 7222 remove2(vnode); 7223 } 7224 } 7225 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { 7226 queuePostRenderEffect(() => { 7227 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 7228 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); 7229 }, parentSuspense); 7230 } 7231 }; 7232 const remove2 = (vnode) => { 7233 const { type, el, anchor, transition } = vnode; 7234 if (type === Fragment) { 7235 if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { 7236 vnode.children.forEach((child) => { 7237 if (child.type === Comment) { 7238 hostRemove(child.el); 7239 } else { 7240 remove2(child); 7241 } 7242 }); 7243 } else { 7244 removeFragment(el, anchor); 7245 } 7246 return; 7247 } 7248 if (type === Static) { 7249 removeStaticNode(vnode); 7250 return; 7251 } 7252 const performRemove = () => { 7253 hostRemove(el); 7254 if (transition && !transition.persisted && transition.afterLeave) { 7255 transition.afterLeave(); 7256 } 7257 }; 7258 if (vnode.shapeFlag & 1 && transition && !transition.persisted) { 7259 const { leave, delayLeave } = transition; 7260 const performLeave = () => leave(el, performRemove); 7261 if (delayLeave) { 7262 delayLeave(vnode.el, performRemove, performLeave); 7263 } else { 7264 performLeave(); 7265 } 7266 } else { 7267 performRemove(); 7268 } 7269 }; 7270 const removeFragment = (cur, end) => { 7271 let next; 7272 while (cur !== end) { 7273 next = hostNextSibling(cur); 7274 hostRemove(cur); 7275 cur = next; 7276 } 7277 hostRemove(end); 7278 }; 7279 const unmountComponent = (instance, parentSuspense, doRemove) => { 7280 if (instance.type.__hmrId) { 7281 unregisterHMR(instance); 7282 } 7283 const { bum, scope, update, subTree, um, m, a } = instance; 7284 invalidateMount(m); 7285 invalidateMount(a); 7286 if (bum) { 7287 invokeArrayFns(bum); 7288 } 7289 scope.stop(); 7290 if (update) { 7291 update.active = false; 7292 unmount(subTree, instance, parentSuspense, doRemove); 7293 } 7294 if (um) { 7295 queuePostRenderEffect(um, parentSuspense); 7296 } 7297 queuePostRenderEffect(() => { 7298 instance.isUnmounted = true; 7299 }, parentSuspense); 7300 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { 7301 parentSuspense.deps--; 7302 if (parentSuspense.deps === 0) { 7303 parentSuspense.resolve(); 7304 } 7305 } 7306 if (true) { 7307 devtoolsComponentRemoved(instance); 7308 } 7309 }; 7310 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { 7311 for (let i = start; i < children.length; i++) { 7312 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); 7313 } 7314 }; 7315 const getNextHostNode = (vnode) => { 7316 if (vnode.shapeFlag & 6) { 7317 return getNextHostNode(vnode.component.subTree); 7318 } 7319 if (vnode.shapeFlag & 128) { 7320 return vnode.suspense.next(); 7321 } 7322 const el = hostNextSibling(vnode.anchor || vnode.el); 7323 const teleportEnd = el && el[TeleportEndKey]; 7324 return teleportEnd ? hostNextSibling(teleportEnd) : el; 7325 }; 7326 let isFlushing2 = false; 7327 const render2 = (vnode, container, namespace) => { 7328 if (vnode == null) { 7329 if (container._vnode) { 7330 unmount(container._vnode, null, null, true); 7331 } 7332 } else { 7333 patch( 7334 container._vnode || null, 7335 vnode, 7336 container, 7337 null, 7338 null, 7339 null, 7340 namespace 7341 ); 7342 } 7343 if (!isFlushing2) { 7344 isFlushing2 = true; 7345 flushPreFlushCbs(); 7346 flushPostFlushCbs(); 7347 isFlushing2 = false; 7348 } 7349 container._vnode = vnode; 7350 }; 7351 const internals = { 7352 p: patch, 7353 um: unmount, 7354 m: move, 7355 r: remove2, 7356 mt: mountComponent, 7357 mc: mountChildren, 7358 pc: patchChildren, 7359 pbc: patchBlockChildren, 7360 n: getNextHostNode, 7361 o: options 7362 }; 7363 let hydrate2; 7364 let hydrateNode; 7365 if (createHydrationFns) { 7366 [hydrate2, hydrateNode] = createHydrationFns( 7367 internals 7368 ); 7369 } 7370 return { 7371 render: render2, 7372 hydrate: hydrate2, 7373 createApp: createAppAPI(render2, hydrate2) 7374 }; 7375} 7376function resolveChildrenNamespace({ type, props }, currentNamespace) { 7377 return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; 7378} 7379function toggleRecurse({ effect: effect2, update }, allowed) { 7380 effect2.allowRecurse = update.allowRecurse = allowed; 7381} 7382function needTransition(parentSuspense, transition) { 7383 return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; 7384} 7385function traverseStaticChildren(n1, n2, shallow = false) { 7386 const ch1 = n1.children; 7387 const ch2 = n2.children; 7388 if (isArray(ch1) && isArray(ch2)) { 7389 for (let i = 0; i < ch1.length; i++) { 7390 const c1 = ch1[i]; 7391 let c2 = ch2[i]; 7392 if (c2.shapeFlag & 1 && !c2.dynamicChildren) { 7393 if (c2.patchFlag <= 0 || c2.patchFlag === 32) { 7394 c2 = ch2[i] = cloneIfMounted(ch2[i]); 7395 c2.el = c1.el; 7396 } 7397 if (!shallow && c2.patchFlag !== -2) 7398 traverseStaticChildren(c1, c2); 7399 } 7400 if (c2.type === Text) { 7401 c2.el = c1.el; 7402 } 7403 if (c2.type === Comment && !c2.el) { 7404 c2.el = c1.el; 7405 } 7406 } 7407 } 7408} 7409function getSequence(arr) { 7410 const p2 = arr.slice(); 7411 const result = [0]; 7412 let i, j, u, v, c; 7413 const len = arr.length; 7414 for (i = 0; i < len; i++) { 7415 const arrI = arr[i]; 7416 if (arrI !== 0) { 7417 j = result[result.length - 1]; 7418 if (arr[j] < arrI) { 7419 p2[i] = j; 7420 result.push(i); 7421 continue; 7422 } 7423 u = 0; 7424 v = result.length - 1; 7425 while (u < v) { 7426 c = u + v >> 1; 7427 if (arr[result[c]] < arrI) { 7428 u = c + 1; 7429 } else { 7430 v = c; 7431 } 7432 } 7433 if (arrI < arr[result[u]]) { 7434 if (u > 0) { 7435 p2[i] = result[u - 1]; 7436 } 7437 result[u] = i; 7438 } 7439 } 7440 } 7441 u = result.length; 7442 v = result[u - 1]; 7443 while (u-- > 0) { 7444 result[u] = v; 7445 v = p2[v]; 7446 } 7447 return result; 7448} 7449function locateNonHydratedAsyncRoot(instance) { 7450 const subComponent = instance.subTree.component; 7451 if (subComponent) { 7452 if (subComponent.asyncDep && !subComponent.asyncResolved) { 7453 return subComponent; 7454 } else { 7455 return locateNonHydratedAsyncRoot(subComponent); 7456 } 7457 } 7458} 7459function invalidateMount(hooks) { 7460 if (hooks) { 7461 for (let i = 0; i < hooks.length; i++) hooks[i].active = false; 7462 } 7463} 7464var ssrContextKey = Symbol.for("v-scx"); 7465var useSSRContext = () => { 7466 { 7467 const ctx = inject(ssrContextKey); 7468 if (!ctx) { 7469 warn$1( 7470 `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` 7471 ); 7472 } 7473 return ctx; 7474 } 7475}; 7476function watchEffect(effect2, options) { 7477 return doWatch(effect2, null, options); 7478} 7479function watchPostEffect(effect2, options) { 7480 return doWatch( 7481 effect2, 7482 null, 7483 true ? extend({}, options, { flush: "post" }) : { flush: "post" } 7484 ); 7485} 7486function watchSyncEffect(effect2, options) { 7487 return doWatch( 7488 effect2, 7489 null, 7490 true ? extend({}, options, { flush: "sync" }) : { flush: "sync" } 7491 ); 7492} 7493var INITIAL_WATCHER_VALUE = {}; 7494function watch(source, cb, options) { 7495 if (!isFunction(cb)) { 7496 warn$1( 7497 `\`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.` 7498 ); 7499 } 7500 return doWatch(source, cb, options); 7501} 7502function doWatch(source, cb, { 7503 immediate, 7504 deep, 7505 flush, 7506 once, 7507 onTrack, 7508 onTrigger 7509} = EMPTY_OBJ) { 7510 if (cb && once) { 7511 const _cb = cb; 7512 cb = (...args) => { 7513 _cb(...args); 7514 unwatch(); 7515 }; 7516 } 7517 if (deep !== void 0 && typeof deep === "number") { 7518 warn$1( 7519 `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.` 7520 ); 7521 } 7522 if (!cb) { 7523 if (immediate !== void 0) { 7524 warn$1( 7525 `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` 7526 ); 7527 } 7528 if (deep !== void 0) { 7529 warn$1( 7530 `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` 7531 ); 7532 } 7533 if (once !== void 0) { 7534 warn$1( 7535 `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` 7536 ); 7537 } 7538 } 7539 const warnInvalidSource = (s) => { 7540 warn$1( 7541 `Invalid watch source: `, 7542 s, 7543 `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` 7544 ); 7545 }; 7546 const instance = currentInstance; 7547 const reactiveGetter = (source2) => deep === true ? source2 : ( 7548 // for deep: false, only traverse root-level properties 7549 traverse(source2, deep === false ? 1 : void 0) 7550 ); 7551 let getter; 7552 let forceTrigger = false; 7553 let isMultiSource = false; 7554 if (isRef2(source)) { 7555 getter = () => source.value; 7556 forceTrigger = isShallow(source); 7557 } else if (isReactive(source)) { 7558 getter = () => reactiveGetter(source); 7559 forceTrigger = true; 7560 } else if (isArray(source)) { 7561 isMultiSource = true; 7562 forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); 7563 getter = () => source.map((s) => { 7564 if (isRef2(s)) { 7565 return s.value; 7566 } else if (isReactive(s)) { 7567 return reactiveGetter(s); 7568 } else if (isFunction(s)) { 7569 return callWithErrorHandling(s, instance, 2); 7570 } else { 7571 warnInvalidSource(s); 7572 } 7573 }); 7574 } else if (isFunction(source)) { 7575 if (cb) { 7576 getter = () => callWithErrorHandling(source, instance, 2); 7577 } else { 7578 getter = () => { 7579 if (cleanup) { 7580 cleanup(); 7581 } 7582 return callWithAsyncErrorHandling( 7583 source, 7584 instance, 7585 3, 7586 [onCleanup] 7587 ); 7588 }; 7589 } 7590 } else { 7591 getter = NOOP; 7592 warnInvalidSource(source); 7593 } 7594 if (cb && deep) { 7595 const baseGetter = getter; 7596 getter = () => traverse(baseGetter()); 7597 } 7598 let cleanup; 7599 let onCleanup = (fn) => { 7600 cleanup = effect2.onStop = () => { 7601 callWithErrorHandling(fn, instance, 4); 7602 cleanup = effect2.onStop = void 0; 7603 }; 7604 }; 7605 let ssrCleanup; 7606 if (isInSSRComponentSetup) { 7607 onCleanup = NOOP; 7608 if (!cb) { 7609 getter(); 7610 } else if (immediate) { 7611 callWithAsyncErrorHandling(cb, instance, 3, [ 7612 getter(), 7613 isMultiSource ? [] : void 0, 7614 onCleanup 7615 ]); 7616 } 7617 if (flush === "sync") { 7618 const ctx = useSSRContext(); 7619 ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); 7620 } else { 7621 return NOOP; 7622 } 7623 } 7624 let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; 7625 const job = () => { 7626 if (!effect2.active || !effect2.dirty) { 7627 return; 7628 } 7629 if (cb) { 7630 const newValue = effect2.run(); 7631 if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) { 7632 if (cleanup) { 7633 cleanup(); 7634 } 7635 callWithAsyncErrorHandling(cb, instance, 3, [ 7636 newValue, 7637 // pass undefined as the old value when it's changed for the first time 7638 oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, 7639 onCleanup 7640 ]); 7641 oldValue = newValue; 7642 } 7643 } else { 7644 effect2.run(); 7645 } 7646 }; 7647 job.allowRecurse = !!cb; 7648 let scheduler; 7649 if (flush === "sync") { 7650 scheduler = job; 7651 } else if (flush === "post") { 7652 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); 7653 } else { 7654 job.pre = true; 7655 if (instance) job.id = instance.uid; 7656 scheduler = () => queueJob(job); 7657 } 7658 const effect2 = new ReactiveEffect(getter, NOOP, scheduler); 7659 const scope = getCurrentScope(); 7660 const unwatch = () => { 7661 effect2.stop(); 7662 if (scope) { 7663 remove(scope.effects, effect2); 7664 } 7665 }; 7666 if (true) { 7667 effect2.onTrack = onTrack; 7668 effect2.onTrigger = onTrigger; 7669 } 7670 if (cb) { 7671 if (immediate) { 7672 job(); 7673 } else { 7674 oldValue = effect2.run(); 7675 } 7676 } else if (flush === "post") { 7677 queuePostRenderEffect( 7678 effect2.run.bind(effect2), 7679 instance && instance.suspense 7680 ); 7681 } else { 7682 effect2.run(); 7683 } 7684 if (ssrCleanup) ssrCleanup.push(unwatch); 7685 return unwatch; 7686} 7687function instanceWatch(source, value, options) { 7688 const publicThis = this.proxy; 7689 const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); 7690 let cb; 7691 if (isFunction(value)) { 7692 cb = value; 7693 } else { 7694 cb = value.handler; 7695 options = value; 7696 } 7697 const reset2 = setCurrentInstance(this); 7698 const res = doWatch(getter, cb.bind(publicThis), options); 7699 reset2(); 7700 return res; 7701} 7702function createPathGetter(ctx, path) { 7703 const segments = path.split("."); 7704 return () => { 7705 let cur = ctx; 7706 for (let i = 0; i < segments.length && cur; i++) { 7707 cur = cur[segments[i]]; 7708 } 7709 return cur; 7710 }; 7711} 7712function traverse(value, depth = Infinity, seen2) { 7713 if (depth <= 0 || !isObject(value) || value["__v_skip"]) { 7714 return value; 7715 } 7716 seen2 = seen2 || /* @__PURE__ */ new Set(); 7717 if (seen2.has(value)) { 7718 return value; 7719 } 7720 seen2.add(value); 7721 depth--; 7722 if (isRef2(value)) { 7723 traverse(value.value, depth, seen2); 7724 } else if (isArray(value)) { 7725 for (let i = 0; i < value.length; i++) { 7726 traverse(value[i], depth, seen2); 7727 } 7728 } else if (isSet(value) || isMap(value)) { 7729 value.forEach((v) => { 7730 traverse(v, depth, seen2); 7731 }); 7732 } else if (isPlainObject(value)) { 7733 for (const key in value) { 7734 traverse(value[key], depth, seen2); 7735 } 7736 for (const key of Object.getOwnPropertySymbols(value)) { 7737 if (Object.prototype.propertyIsEnumerable.call(value, key)) { 7738 traverse(value[key], depth, seen2); 7739 } 7740 } 7741 } 7742 return value; 7743} 7744function useModel(props, name, options = EMPTY_OBJ) { 7745 const i = getCurrentInstance(); 7746 if (!i) { 7747 warn$1(`useModel() called without active instance.`); 7748 return ref(); 7749 } 7750 if (!i.propsOptions[0][name]) { 7751 warn$1(`useModel() called with prop "${name}" which is not declared.`); 7752 return ref(); 7753 } 7754 const camelizedName = camelize(name); 7755 const hyphenatedName = hyphenate(name); 7756 const modifiers = getModelModifiers(props, name); 7757 const res = customRef((track2, trigger2) => { 7758 let localValue; 7759 let prevSetValue = EMPTY_OBJ; 7760 let prevEmittedValue; 7761 watchSyncEffect(() => { 7762 const propValue = props[name]; 7763 if (hasChanged(localValue, propValue)) { 7764 localValue = propValue; 7765 trigger2(); 7766 } 7767 }); 7768 return { 7769 get() { 7770 track2(); 7771 return options.get ? options.get(localValue) : localValue; 7772 }, 7773 set(value) { 7774 if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) { 7775 return; 7776 } 7777 const rawProps = i.vnode.props; 7778 if (!(rawProps && // check if parent has passed v-model 7779 (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { 7780 localValue = value; 7781 trigger2(); 7782 } 7783 const emittedValue = options.set ? options.set(value) : value; 7784 i.emit(`update:${name}`, emittedValue); 7785 if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) { 7786 trigger2(); 7787 } 7788 prevSetValue = value; 7789 prevEmittedValue = emittedValue; 7790 } 7791 }; 7792 }); 7793 res[Symbol.iterator] = () => { 7794 let i2 = 0; 7795 return { 7796 next() { 7797 if (i2 < 2) { 7798 return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false }; 7799 } else { 7800 return { done: true }; 7801 } 7802 } 7803 }; 7804 }; 7805 return res; 7806} 7807var getModelModifiers = (props, modelName) => { 7808 return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; 7809}; 7810function emit(instance, event, ...rawArgs) { 7811 if (instance.isUnmounted) return; 7812 const props = instance.vnode.props || EMPTY_OBJ; 7813 if (true) { 7814 const { 7815 emitsOptions, 7816 propsOptions: [propsOptions] 7817 } = instance; 7818 if (emitsOptions) { 7819 if (!(event in emitsOptions) && true) { 7820 if (!propsOptions || !(toHandlerKey(event) in propsOptions)) { 7821 warn$1( 7822 `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.` 7823 ); 7824 } 7825 } else { 7826 const validator = emitsOptions[event]; 7827 if (isFunction(validator)) { 7828 const isValid = validator(...rawArgs); 7829 if (!isValid) { 7830 warn$1( 7831 `Invalid event arguments: event validation failed for event "${event}".` 7832 ); 7833 } 7834 } 7835 } 7836 } 7837 } 7838 let args = rawArgs; 7839 const isModelListener2 = event.startsWith("update:"); 7840 const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7)); 7841 if (modifiers) { 7842 if (modifiers.trim) { 7843 args = rawArgs.map((a) => isString(a) ? a.trim() : a); 7844 } 7845 if (modifiers.number) { 7846 args = rawArgs.map(looseToNumber); 7847 } 7848 } 7849 if (true) { 7850 devtoolsComponentEmit(instance, event, args); 7851 } 7852 if (true) { 7853 const lowerCaseEvent = event.toLowerCase(); 7854 if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { 7855 warn$1( 7856 `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( 7857 instance, 7858 instance.type 7859 )} 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( 7860 event 7861 )}" instead of "${event}".` 7862 ); 7863 } 7864 } 7865 let handlerName; 7866 let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) 7867 props[handlerName = toHandlerKey(camelize(event))]; 7868 if (!handler && isModelListener2) { 7869 handler = props[handlerName = toHandlerKey(hyphenate(event))]; 7870 } 7871 if (handler) { 7872 callWithAsyncErrorHandling( 7873 handler, 7874 instance, 7875 6, 7876 args 7877 ); 7878 } 7879 const onceHandler = props[handlerName + `Once`]; 7880 if (onceHandler) { 7881 if (!instance.emitted) { 7882 instance.emitted = {}; 7883 } else if (instance.emitted[handlerName]) { 7884 return; 7885 } 7886 instance.emitted[handlerName] = true; 7887 callWithAsyncErrorHandling( 7888 onceHandler, 7889 instance, 7890 6, 7891 args 7892 ); 7893 } 7894} 7895function normalizeEmitsOptions(comp, appContext, asMixin = false) { 7896 const cache = appContext.emitsCache; 7897 const cached = cache.get(comp); 7898 if (cached !== void 0) { 7899 return cached; 7900 } 7901 const raw = comp.emits; 7902 let normalized = {}; 7903 let hasExtends = false; 7904 if (__VUE_OPTIONS_API__ && !isFunction(comp)) { 7905 const extendEmits = (raw2) => { 7906 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); 7907 if (normalizedFromExtend) { 7908 hasExtends = true; 7909 extend(normalized, normalizedFromExtend); 7910 } 7911 }; 7912 if (!asMixin && appContext.mixins.length) { 7913 appContext.mixins.forEach(extendEmits); 7914 } 7915 if (comp.extends) { 7916 extendEmits(comp.extends); 7917 } 7918 if (comp.mixins) { 7919 comp.mixins.forEach(extendEmits); 7920 } 7921 } 7922 if (!raw && !hasExtends) { 7923 if (isObject(comp)) { 7924 cache.set(comp, null); 7925 } 7926 return null; 7927 } 7928 if (isArray(raw)) { 7929 raw.forEach((key) => normalized[key] = null); 7930 } else { 7931 extend(normalized, raw); 7932 } 7933 if (isObject(comp)) { 7934 cache.set(comp, normalized); 7935 } 7936 return normalized; 7937} 7938function isEmitListener(options, key) { 7939 if (!options || !isOn(key)) { 7940 return false; 7941 } 7942 key = key.slice(2).replace(/Once$/, ""); 7943 return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); 7944} 7945var accessedAttrs = false; 7946function markAttrsAccessed() { 7947 accessedAttrs = true; 7948} 7949function renderComponentRoot(instance) { 7950 const { 7951 type: Component, 7952 vnode, 7953 proxy, 7954 withProxy, 7955 propsOptions: [propsOptions], 7956 slots, 7957 attrs, 7958 emit: emit2, 7959 render: render2, 7960 renderCache, 7961 props, 7962 data, 7963 setupState, 7964 ctx, 7965 inheritAttrs 7966 } = instance; 7967 const prev = setCurrentRenderingInstance(instance); 7968 let result; 7969 let fallthroughAttrs; 7970 if (true) { 7971 accessedAttrs = false; 7972 } 7973 try { 7974 if (vnode.shapeFlag & 4) { 7975 const proxyToUse = withProxy || proxy; 7976 const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { 7977 get(target, key, receiver) { 7978 warn$1( 7979 `Property '${String( 7980 key 7981 )}' was accessed via 'this'. Avoid using 'this' in templates.` 7982 ); 7983 return Reflect.get(target, key, receiver); 7984 } 7985 }) : proxyToUse; 7986 result = normalizeVNode( 7987 render2.call( 7988 thisProxy, 7989 proxyToUse, 7990 renderCache, 7991 true ? shallowReadonly(props) : props, 7992 setupState, 7993 data, 7994 ctx 7995 ) 7996 ); 7997 fallthroughAttrs = attrs; 7998 } else { 7999 const render22 = Component; 8000 if (attrs === props) { 8001 markAttrsAccessed(); 8002 } 8003 result = normalizeVNode( 8004 render22.length > 1 ? render22( 8005 true ? shallowReadonly(props) : props, 8006 true ? { 8007 get attrs() { 8008 markAttrsAccessed(); 8009 return shallowReadonly(attrs); 8010 }, 8011 slots, 8012 emit: emit2 8013 } : { attrs, slots, emit: emit2 } 8014 ) : render22( 8015 true ? shallowReadonly(props) : props, 8016 null 8017 ) 8018 ); 8019 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); 8020 } 8021 } catch (err) { 8022 blockStack.length = 0; 8023 handleError(err, instance, 1); 8024 result = createVNode(Comment); 8025 } 8026 let root = result; 8027 let setRoot = void 0; 8028 if (result.patchFlag > 0 && result.patchFlag & 2048) { 8029 [root, setRoot] = getChildRoot(result); 8030 } 8031 if (fallthroughAttrs && inheritAttrs !== false) { 8032 const keys = Object.keys(fallthroughAttrs); 8033 const { shapeFlag } = root; 8034 if (keys.length) { 8035 if (shapeFlag & (1 | 6)) { 8036 if (propsOptions && keys.some(isModelListener)) { 8037 fallthroughAttrs = filterModelListeners( 8038 fallthroughAttrs, 8039 propsOptions 8040 ); 8041 } 8042 root = cloneVNode(root, fallthroughAttrs, false, true); 8043 } else if (!accessedAttrs && root.type !== Comment) { 8044 const allAttrs = Object.keys(attrs); 8045 const eventAttrs = []; 8046 const extraAttrs = []; 8047 for (let i = 0, l = allAttrs.length; i < l; i++) { 8048 const key = allAttrs[i]; 8049 if (isOn(key)) { 8050 if (!isModelListener(key)) { 8051 eventAttrs.push(key[2].toLowerCase() + key.slice(3)); 8052 } 8053 } else { 8054 extraAttrs.push(key); 8055 } 8056 } 8057 if (extraAttrs.length) { 8058 warn$1( 8059 `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.` 8060 ); 8061 } 8062 if (eventAttrs.length) { 8063 warn$1( 8064 `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.` 8065 ); 8066 } 8067 } 8068 } 8069 } 8070 if (vnode.dirs) { 8071 if (!isElementRoot(root)) { 8072 warn$1( 8073 `Runtime directive used on component with non-element root node. The directives will not function as intended.` 8074 ); 8075 } 8076 root = cloneVNode(root, null, false, true); 8077 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; 8078 } 8079 if (vnode.transition) { 8080 if (!isElementRoot(root)) { 8081 warn$1( 8082 `Component inside <Transition> renders non-element root node that cannot be animated.` 8083 ); 8084 } 8085 root.transition = vnode.transition; 8086 } 8087 if (setRoot) { 8088 setRoot(root); 8089 } else { 8090 result = root; 8091 } 8092 setCurrentRenderingInstance(prev); 8093 return result; 8094} 8095var getChildRoot = (vnode) => { 8096 const rawChildren = vnode.children; 8097 const dynamicChildren = vnode.dynamicChildren; 8098 const childRoot = filterSingleRoot(rawChildren, false); 8099 if (!childRoot) { 8100 return [vnode, void 0]; 8101 } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { 8102 return getChildRoot(childRoot); 8103 } 8104 const index = rawChildren.indexOf(childRoot); 8105 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; 8106 const setRoot = (updatedRoot) => { 8107 rawChildren[index] = updatedRoot; 8108 if (dynamicChildren) { 8109 if (dynamicIndex > -1) { 8110 dynamicChildren[dynamicIndex] = updatedRoot; 8111 } else if (updatedRoot.patchFlag > 0) { 8112 vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; 8113 } 8114 } 8115 }; 8116 return [normalizeVNode(childRoot), setRoot]; 8117}; 8118function filterSingleRoot(children, recurse = true) { 8119 let singleRoot; 8120 for (let i = 0; i < children.length; i++) { 8121 const child = children[i]; 8122 if (isVNode(child)) { 8123 if (child.type !== Comment || child.children === "v-if") { 8124 if (singleRoot) { 8125 return; 8126 } else { 8127 singleRoot = child; 8128 if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { 8129 return filterSingleRoot(singleRoot.children); 8130 } 8131 } 8132 } 8133 } else { 8134 return; 8135 } 8136 } 8137 return singleRoot; 8138} 8139var getFunctionalFallthrough = (attrs) => { 8140 let res; 8141 for (const key in attrs) { 8142 if (key === "class" || key === "style" || isOn(key)) { 8143 (res || (res = {}))[key] = attrs[key]; 8144 } 8145 } 8146 return res; 8147}; 8148var filterModelListeners = (attrs, props) => { 8149 const res = {}; 8150 for (const key in attrs) { 8151 if (!isModelListener(key) || !(key.slice(9) in props)) { 8152 res[key] = attrs[key]; 8153 } 8154 } 8155 return res; 8156}; 8157var isElementRoot = (vnode) => { 8158 return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; 8159}; 8160function shouldUpdateComponent(prevVNode, nextVNode, optimized) { 8161 const { props: prevProps, children: prevChildren, component } = prevVNode; 8162 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; 8163 const emits = component.emitsOptions; 8164 if ((prevChildren || nextChildren) && isHmrUpdating) { 8165 return true; 8166 } 8167 if (nextVNode.dirs || nextVNode.transition) { 8168 return true; 8169 } 8170 if (optimized && patchFlag >= 0) { 8171 if (patchFlag & 1024) { 8172 return true; 8173 } 8174 if (patchFlag & 16) { 8175 if (!prevProps) { 8176 return !!nextProps; 8177 } 8178 return hasPropsChanged(prevProps, nextProps, emits); 8179 } else if (patchFlag & 8) { 8180 const dynamicProps = nextVNode.dynamicProps; 8181 for (let i = 0; i < dynamicProps.length; i++) { 8182 const key = dynamicProps[i]; 8183 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { 8184 return true; 8185 } 8186 } 8187 } 8188 } else { 8189 if (prevChildren || nextChildren) { 8190 if (!nextChildren || !nextChildren.$stable) { 8191 return true; 8192 } 8193 } 8194 if (prevProps === nextProps) { 8195 return false; 8196 } 8197 if (!prevProps) { 8198 return !!nextProps; 8199 } 8200 if (!nextProps) { 8201 return true; 8202 } 8203 return hasPropsChanged(prevProps, nextProps, emits); 8204 } 8205 return false; 8206} 8207function hasPropsChanged(prevProps, nextProps, emitsOptions) { 8208 const nextKeys = Object.keys(nextProps); 8209 if (nextKeys.length !== Object.keys(prevProps).length) { 8210 return true; 8211 } 8212 for (let i = 0; i < nextKeys.length; i++) { 8213 const key = nextKeys[i]; 8214 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { 8215 return true; 8216 } 8217 } 8218 return false; 8219} 8220function updateHOCHostEl({ vnode, parent }, el) { 8221 while (parent) { 8222 const root = parent.subTree; 8223 if (root.suspense && root.suspense.activeBranch === vnode) { 8224 root.el = vnode.el; 8225 } 8226 if (root === vnode) { 8227 (vnode = parent.vnode).el = el; 8228 parent = parent.parent; 8229 } else { 8230 break; 8231 } 8232 } 8233} 8234var isSuspense = (type) => type.__isSuspense; 8235var suspenseId = 0; 8236var SuspenseImpl = { 8237 name: "Suspense", 8238 // In order to make Suspense tree-shakable, we need to avoid importing it 8239 // directly in the renderer. The renderer checks for the __isSuspense flag 8240 // on a vnode's type and calls the `process` method, passing in renderer 8241 // internals. 8242 __isSuspense: true, 8243 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { 8244 if (n1 == null) { 8245 mountSuspense( 8246 n2, 8247 container, 8248 anchor, 8249 parentComponent, 8250 parentSuspense, 8251 namespace, 8252 slotScopeIds, 8253 optimized, 8254 rendererInternals 8255 ); 8256 } else { 8257 if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { 8258 n2.suspense = n1.suspense; 8259 n2.suspense.vnode = n2; 8260 n2.el = n1.el; 8261 return; 8262 } 8263 patchSuspense( 8264 n1, 8265 n2, 8266 container, 8267 anchor, 8268 parentComponent, 8269 namespace, 8270 slotScopeIds, 8271 optimized, 8272 rendererInternals 8273 ); 8274 } 8275 }, 8276 hydrate: hydrateSuspense, 8277 normalize: normalizeSuspenseChildren 8278}; 8279var Suspense = SuspenseImpl; 8280function triggerEvent(vnode, name) { 8281 const eventListener = vnode.props && vnode.props[name]; 8282 if (isFunction(eventListener)) { 8283 eventListener(); 8284 } 8285} 8286function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { 8287 const { 8288 p: patch, 8289 o: { createElement } 8290 } = rendererInternals; 8291 const hiddenContainer = createElement("div"); 8292 const suspense = vnode.suspense = createSuspenseBoundary( 8293 vnode, 8294 parentSuspense, 8295 parentComponent, 8296 container, 8297 hiddenContainer, 8298 anchor, 8299 namespace, 8300 slotScopeIds, 8301 optimized, 8302 rendererInternals 8303 ); 8304 patch( 8305 null, 8306 suspense.pendingBranch = vnode.ssContent, 8307 hiddenContainer, 8308 null, 8309 parentComponent, 8310 suspense, 8311 namespace, 8312 slotScopeIds 8313 ); 8314 if (suspense.deps > 0) { 8315 triggerEvent(vnode, "onPending"); 8316 triggerEvent(vnode, "onFallback"); 8317 patch( 8318 null, 8319 vnode.ssFallback, 8320 container, 8321 anchor, 8322 parentComponent, 8323 null, 8324 // fallback tree will not have suspense context 8325 namespace, 8326 slotScopeIds 8327 ); 8328 setActiveBranch(suspense, vnode.ssFallback); 8329 } else { 8330 suspense.resolve(false, true); 8331 } 8332} 8333function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { 8334 const suspense = n2.suspense = n1.suspense; 8335 suspense.vnode = n2; 8336 n2.el = n1.el; 8337 const newBranch = n2.ssContent; 8338 const newFallback = n2.ssFallback; 8339 const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; 8340 if (pendingBranch) { 8341 suspense.pendingBranch = newBranch; 8342 if (isSameVNodeType(newBranch, pendingBranch)) { 8343 patch( 8344 pendingBranch, 8345 newBranch, 8346 suspense.hiddenContainer, 8347 null, 8348 parentComponent, 8349 suspense, 8350 namespace, 8351 slotScopeIds, 8352 optimized 8353 ); 8354 if (suspense.deps <= 0) { 8355 suspense.resolve(); 8356 } else if (isInFallback) { 8357 if (!isHydrating) { 8358 patch( 8359 activeBranch, 8360 newFallback, 8361 container, 8362 anchor, 8363 parentComponent, 8364 null, 8365 // fallback tree will not have suspense context 8366 namespace, 8367 slotScopeIds, 8368 optimized 8369 ); 8370 setActiveBranch(suspense, newFallback); 8371 } 8372 } 8373 } else { 8374 suspense.pendingId = suspenseId++; 8375 if (isHydrating) { 8376 suspense.isHydrating = false; 8377 suspense.activeBranch = pendingBranch; 8378 } else { 8379 unmount(pendingBranch, parentComponent, suspense); 8380 } 8381 suspense.deps = 0; 8382 suspense.effects.length = 0; 8383 suspense.hiddenContainer = createElement("div"); 8384 if (isInFallback) { 8385 patch( 8386 null, 8387 newBranch, 8388 suspense.hiddenContainer, 8389 null, 8390 parentComponent, 8391 suspense, 8392 namespace, 8393 slotScopeIds, 8394 optimized 8395 ); 8396 if (suspense.deps <= 0) { 8397 suspense.resolve(); 8398 } else { 8399 patch( 8400 activeBranch, 8401 newFallback, 8402 container, 8403 anchor, 8404 parentComponent, 8405 null, 8406 // fallback tree will not have suspense context 8407 namespace, 8408 slotScopeIds, 8409 optimized 8410 ); 8411 setActiveBranch(suspense, newFallback); 8412 } 8413 } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { 8414 patch( 8415 activeBranch, 8416 newBranch, 8417 container, 8418 anchor, 8419 parentComponent, 8420 suspense, 8421 namespace, 8422 slotScopeIds, 8423 optimized 8424 ); 8425 suspense.resolve(true); 8426 } else { 8427 patch( 8428 null, 8429 newBranch, 8430 suspense.hiddenContainer, 8431 null, 8432 parentComponent, 8433 suspense, 8434 namespace, 8435 slotScopeIds, 8436 optimized 8437 ); 8438 if (suspense.deps <= 0) { 8439 suspense.resolve(); 8440 } 8441 } 8442 } 8443 } else { 8444 if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { 8445 patch( 8446 activeBranch, 8447 newBranch, 8448 container, 8449 anchor, 8450 parentComponent, 8451 suspense, 8452 namespace, 8453 slotScopeIds, 8454 optimized 8455 ); 8456 setActiveBranch(suspense, newBranch); 8457 } else { 8458 triggerEvent(n2, "onPending"); 8459 suspense.pendingBranch = newBranch; 8460 if (newBranch.shapeFlag & 512) { 8461 suspense.pendingId = newBranch.component.suspenseId; 8462 } else { 8463 suspense.pendingId = suspenseId++; 8464 } 8465 patch( 8466 null, 8467 newBranch, 8468 suspense.hiddenContainer, 8469 null, 8470 parentComponent, 8471 suspense, 8472 namespace, 8473 slotScopeIds, 8474 optimized 8475 ); 8476 if (suspense.deps <= 0) { 8477 suspense.resolve(); 8478 } else { 8479 const { timeout, pendingId } = suspense; 8480 if (timeout > 0) { 8481 setTimeout(() => { 8482 if (suspense.pendingId === pendingId) { 8483 suspense.fallback(newFallback); 8484 } 8485 }, timeout); 8486 } else if (timeout === 0) { 8487 suspense.fallback(newFallback); 8488 } 8489 } 8490 } 8491 } 8492} 8493var hasWarned = false; 8494function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { 8495 if (!hasWarned) { 8496 hasWarned = true; 8497 console[console.info ? "info" : "log"]( 8498 `<Suspense> is an experimental feature and its API will likely change.` 8499 ); 8500 } 8501 const { 8502 p: patch, 8503 m: move, 8504 um: unmount, 8505 n: next, 8506 o: { parentNode, remove: remove2 } 8507 } = rendererInternals; 8508 let parentSuspenseId; 8509 const isSuspensible = isVNodeSuspensible(vnode); 8510 if (isSuspensible) { 8511 if (parentSuspense && parentSuspense.pendingBranch) { 8512 parentSuspenseId = parentSuspense.pendingId; 8513 parentSuspense.deps++; 8514 } 8515 } 8516 const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; 8517 if (true) { 8518 assertNumber(timeout, `Suspense timeout`); 8519 } 8520 const initialAnchor = anchor; 8521 const suspense = { 8522 vnode, 8523 parent: parentSuspense, 8524 parentComponent, 8525 namespace, 8526 container, 8527 hiddenContainer, 8528 deps: 0, 8529 pendingId: suspenseId++, 8530 timeout: typeof timeout === "number" ? timeout : -1, 8531 activeBranch: null, 8532 pendingBranch: null, 8533 isInFallback: !isHydrating, 8534 isHydrating, 8535 isUnmounted: false, 8536 effects: [], 8537 resolve(resume = false, sync = false) { 8538 if (true) { 8539 if (!resume && !suspense.pendingBranch) { 8540 throw new Error( 8541 `suspense.resolve() is called without a pending branch.` 8542 ); 8543 } 8544 if (suspense.isUnmounted) { 8545 throw new Error( 8546 `suspense.resolve() is called on an already unmounted suspense boundary.` 8547 ); 8548 } 8549 } 8550 const { 8551 vnode: vnode2, 8552 activeBranch, 8553 pendingBranch, 8554 pendingId, 8555 effects, 8556 parentComponent: parentComponent2, 8557 container: container2 8558 } = suspense; 8559 let delayEnter = false; 8560 if (suspense.isHydrating) { 8561 suspense.isHydrating = false; 8562 } else if (!resume) { 8563 delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; 8564 if (delayEnter) { 8565 activeBranch.transition.afterLeave = () => { 8566 if (pendingId === suspense.pendingId) { 8567 move( 8568 pendingBranch, 8569 container2, 8570 anchor === initialAnchor ? next(activeBranch) : anchor, 8571 0 8572 ); 8573 queuePostFlushCb(effects); 8574 } 8575 }; 8576 } 8577 if (activeBranch) { 8578 if (parentNode(activeBranch.el) !== suspense.hiddenContainer) { 8579 anchor = next(activeBranch); 8580 } 8581 unmount(activeBranch, parentComponent2, suspense, true); 8582 } 8583 if (!delayEnter) { 8584 move(pendingBranch, container2, anchor, 0); 8585 } 8586 } 8587 setActiveBranch(suspense, pendingBranch); 8588 suspense.pendingBranch = null; 8589 suspense.isInFallback = false; 8590 let parent = suspense.parent; 8591 let hasUnresolvedAncestor = false; 8592 while (parent) { 8593 if (parent.pendingBranch) { 8594 parent.effects.push(...effects); 8595 hasUnresolvedAncestor = true; 8596 break; 8597 } 8598 parent = parent.parent; 8599 } 8600 if (!hasUnresolvedAncestor && !delayEnter) { 8601 queuePostFlushCb(effects); 8602 } 8603 suspense.effects = []; 8604 if (isSuspensible) { 8605 if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { 8606 parentSuspense.deps--; 8607 if (parentSuspense.deps === 0 && !sync) { 8608 parentSuspense.resolve(); 8609 } 8610 } 8611 } 8612 triggerEvent(vnode2, "onResolve"); 8613 }, 8614 fallback(fallbackVNode) { 8615 if (!suspense.pendingBranch) { 8616 return; 8617 } 8618 const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; 8619 triggerEvent(vnode2, "onFallback"); 8620 const anchor2 = next(activeBranch); 8621 const mountFallback = () => { 8622 if (!suspense.isInFallback) { 8623 return; 8624 } 8625 patch( 8626 null, 8627 fallbackVNode, 8628 container2, 8629 anchor2, 8630 parentComponent2, 8631 null, 8632 // fallback tree will not have suspense context 8633 namespace2, 8634 slotScopeIds, 8635 optimized 8636 ); 8637 setActiveBranch(suspense, fallbackVNode); 8638 }; 8639 const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; 8640 if (delayEnter) { 8641 activeBranch.transition.afterLeave = mountFallback; 8642 } 8643 suspense.isInFallback = true; 8644 unmount( 8645 activeBranch, 8646 parentComponent2, 8647 null, 8648 // no suspense so unmount hooks fire now 8649 true 8650 // shouldRemove 8651 ); 8652 if (!delayEnter) { 8653 mountFallback(); 8654 } 8655 }, 8656 move(container2, anchor2, type) { 8657 suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); 8658 suspense.container = container2; 8659 }, 8660 next() { 8661 return suspense.activeBranch && next(suspense.activeBranch); 8662 }, 8663 registerDep(instance, setupRenderEffect, optimized2) { 8664 const isInPendingSuspense = !!suspense.pendingBranch; 8665 if (isInPendingSuspense) { 8666 suspense.deps++; 8667 } 8668 const hydratedEl = instance.vnode.el; 8669 instance.asyncDep.catch((err) => { 8670 handleError(err, instance, 0); 8671 }).then((asyncSetupResult) => { 8672 if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { 8673 return; 8674 } 8675 instance.asyncResolved = true; 8676 const { vnode: vnode2 } = instance; 8677 if (true) { 8678 pushWarningContext(vnode2); 8679 } 8680 handleSetupResult(instance, asyncSetupResult, false); 8681 if (hydratedEl) { 8682 vnode2.el = hydratedEl; 8683 } 8684 const placeholder = !hydratedEl && instance.subTree.el; 8685 setupRenderEffect( 8686 instance, 8687 vnode2, 8688 // component may have been moved before resolve. 8689 // if this is not a hydration, instance.subTree will be the comment 8690 // placeholder. 8691 parentNode(hydratedEl || instance.subTree.el), 8692 // anchor will not be used if this is hydration, so only need to 8693 // consider the comment placeholder case. 8694 hydratedEl ? null : next(instance.subTree), 8695 suspense, 8696 namespace, 8697 optimized2 8698 ); 8699 if (placeholder) { 8700 remove2(placeholder); 8701 } 8702 updateHOCHostEl(instance, vnode2.el); 8703 if (true) { 8704 popWarningContext(); 8705 } 8706 if (isInPendingSuspense && --suspense.deps === 0) { 8707 suspense.resolve(); 8708 } 8709 }); 8710 }, 8711 unmount(parentSuspense2, doRemove) { 8712 suspense.isUnmounted = true; 8713 if (suspense.activeBranch) { 8714 unmount( 8715 suspense.activeBranch, 8716 parentComponent, 8717 parentSuspense2, 8718 doRemove 8719 ); 8720 } 8721 if (suspense.pendingBranch) { 8722 unmount( 8723 suspense.pendingBranch, 8724 parentComponent, 8725 parentSuspense2, 8726 doRemove 8727 ); 8728 } 8729 } 8730 }; 8731 return suspense; 8732} 8733function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { 8734 const suspense = vnode.suspense = createSuspenseBoundary( 8735 vnode, 8736 parentSuspense, 8737 parentComponent, 8738 node.parentNode, 8739 // eslint-disable-next-line no-restricted-globals 8740 document.createElement("div"), 8741 null, 8742 namespace, 8743 slotScopeIds, 8744 optimized, 8745 rendererInternals, 8746 true 8747 ); 8748 const result = hydrateNode( 8749 node, 8750 suspense.pendingBranch = vnode.ssContent, 8751 parentComponent, 8752 suspense, 8753 slotScopeIds, 8754 optimized 8755 ); 8756 if (suspense.deps === 0) { 8757 suspense.resolve(false, true); 8758 } 8759 return result; 8760} 8761function normalizeSuspenseChildren(vnode) { 8762 const { shapeFlag, children } = vnode; 8763 const isSlotChildren = shapeFlag & 32; 8764 vnode.ssContent = normalizeSuspenseSlot( 8765 isSlotChildren ? children.default : children 8766 ); 8767 vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); 8768} 8769function normalizeSuspenseSlot(s) { 8770 let block; 8771 if (isFunction(s)) { 8772 const trackBlock = isBlockTreeEnabled && s._c; 8773 if (trackBlock) { 8774 s._d = false; 8775 openBlock(); 8776 } 8777 s = s(); 8778 if (trackBlock) { 8779 s._d = true; 8780 block = currentBlock; 8781 closeBlock(); 8782 } 8783 } 8784 if (isArray(s)) { 8785 const singleChild = filterSingleRoot(s); 8786 if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { 8787 warn$1(`<Suspense> slots expect a single root node.`); 8788 } 8789 s = singleChild; 8790 } 8791 s = normalizeVNode(s); 8792 if (block && !s.dynamicChildren) { 8793 s.dynamicChildren = block.filter((c) => c !== s); 8794 } 8795 return s; 8796} 8797function queueEffectWithSuspense(fn, suspense) { 8798 if (suspense && suspense.pendingBranch) { 8799 if (isArray(fn)) { 8800 suspense.effects.push(...fn); 8801 } else { 8802 suspense.effects.push(fn); 8803 } 8804 } else { 8805 queuePostFlushCb(fn); 8806 } 8807} 8808function setActiveBranch(suspense, branch) { 8809 suspense.activeBranch = branch; 8810 const { vnode, parentComponent } = suspense; 8811 let el = branch.el; 8812 while (!el && branch.component) { 8813 branch = branch.component.subTree; 8814 el = branch.el; 8815 } 8816 vnode.el = el; 8817 if (parentComponent && parentComponent.subTree === vnode) { 8818 parentComponent.vnode.el = el; 8819 updateHOCHostEl(parentComponent, el); 8820 } 8821} 8822function isVNodeSuspensible(vnode) { 8823 const suspensible = vnode.props && vnode.props.suspensible; 8824 return suspensible != null && suspensible !== false; 8825} 8826var Fragment = Symbol.for("v-fgt"); 8827var Text = Symbol.for("v-txt"); 8828var Comment = Symbol.for("v-cmt"); 8829var Static = Symbol.for("v-stc"); 8830var blockStack = []; 8831var currentBlock = null; 8832function openBlock(disableTracking = false) { 8833 blockStack.push(currentBlock = disableTracking ? null : []); 8834} 8835function closeBlock() { 8836 blockStack.pop(); 8837 currentBlock = blockStack[blockStack.length - 1] || null; 8838} 8839var isBlockTreeEnabled = 1; 8840function setBlockTracking(value) { 8841 isBlockTreeEnabled += value; 8842 if (value < 0 && currentBlock) { 8843 currentBlock.hasOnce = true; 8844 } 8845} 8846function setupBlock(vnode) { 8847 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; 8848 closeBlock(); 8849 if (isBlockTreeEnabled > 0 && currentBlock) { 8850 currentBlock.push(vnode); 8851 } 8852 return vnode; 8853} 8854function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { 8855 return setupBlock( 8856 createBaseVNode( 8857 type, 8858 props, 8859 children, 8860 patchFlag, 8861 dynamicProps, 8862 shapeFlag, 8863 true 8864 ) 8865 ); 8866} 8867function createBlock(type, props, children, patchFlag, dynamicProps) { 8868 return setupBlock( 8869 createVNode( 8870 type, 8871 props, 8872 children, 8873 patchFlag, 8874 dynamicProps, 8875 true 8876 ) 8877 ); 8878} 8879function isVNode(value) { 8880 return value ? value.__v_isVNode === true : false; 8881} 8882function isSameVNodeType(n1, n2) { 8883 if (n2.shapeFlag & 6 && n1.component) { 8884 const dirtyInstances = hmrDirtyComponents.get(n2.type); 8885 if (dirtyInstances && dirtyInstances.has(n1.component)) { 8886 n1.shapeFlag &= ~256; 8887 n2.shapeFlag &= ~512; 8888 return false; 8889 } 8890 } 8891 return n1.type === n2.type && n1.key === n2.key; 8892} 8893var vnodeArgsTransformer; 8894function transformVNodeArgs(transformer) { 8895 vnodeArgsTransformer = transformer; 8896} 8897var createVNodeWithArgsTransform = (...args) => { 8898 return _createVNode( 8899 ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args 8900 ); 8901}; 8902var normalizeKey = ({ key }) => key != null ? key : null; 8903var normalizeRef = ({ 8904 ref: ref2, 8905 ref_key, 8906 ref_for 8907}) => { 8908 if (typeof ref2 === "number") { 8909 ref2 = "" + ref2; 8910 } 8911 return ref2 != null ? isString(ref2) || isRef2(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null; 8912}; 8913function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { 8914 const vnode = { 8915 __v_isVNode: true, 8916 __v_skip: true, 8917 type, 8918 props, 8919 key: props && normalizeKey(props), 8920 ref: props && normalizeRef(props), 8921 scopeId: currentScopeId, 8922 slotScopeIds: null, 8923 children, 8924 component: null, 8925 suspense: null, 8926 ssContent: null, 8927 ssFallback: null, 8928 dirs: null, 8929 transition: null, 8930 el: null, 8931 anchor: null, 8932 target: null, 8933 targetStart: null, 8934 targetAnchor: null, 8935 staticCount: 0, 8936 shapeFlag, 8937 patchFlag, 8938 dynamicProps, 8939 dynamicChildren: null, 8940 appContext: null, 8941 ctx: currentRenderingInstance 8942 }; 8943 if (needFullChildrenNormalization) { 8944 normalizeChildren(vnode, children); 8945 if (shapeFlag & 128) { 8946 type.normalize(vnode); 8947 } 8948 } else if (children) { 8949 vnode.shapeFlag |= isString(children) ? 8 : 16; 8950 } 8951 if (vnode.key !== vnode.key) { 8952 warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); 8953 } 8954 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself 8955 !isBlockNode && // has current parent block 8956 currentBlock && // presence of a patch flag indicates this node needs patching on updates. 8957 // component nodes also should always be patched, because even if the 8958 // component doesn't need to update, it needs to persist the instance on to 8959 // the next vnode so that it can be properly unmounted later. 8960 (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the 8961 // vnode should not be considered dynamic due to handler caching. 8962 vnode.patchFlag !== 32) { 8963 currentBlock.push(vnode); 8964 } 8965 return vnode; 8966} 8967var createVNode = true ? createVNodeWithArgsTransform : _createVNode; 8968function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { 8969 if (!type || type === NULL_DYNAMIC_COMPONENT) { 8970 if (!type) { 8971 warn$1(`Invalid vnode type when creating vnode: ${type}.`); 8972 } 8973 type = Comment; 8974 } 8975 if (isVNode(type)) { 8976 const cloned = cloneVNode( 8977 type, 8978 props, 8979 true 8980 /* mergeRef: true */ 8981 ); 8982 if (children) { 8983 normalizeChildren(cloned, children); 8984 } 8985 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { 8986 if (cloned.shapeFlag & 6) { 8987 currentBlock[currentBlock.indexOf(type)] = cloned; 8988 } else { 8989 currentBlock.push(cloned); 8990 } 8991 } 8992 cloned.patchFlag = -2; 8993 return cloned; 8994 } 8995 if (isClassComponent(type)) { 8996 type = type.__vccOpts; 8997 } 8998 if (props) { 8999 props = guardReactiveProps(props); 9000 let { class: klass, style } = props; 9001 if (klass && !isString(klass)) { 9002 props.class = normalizeClass(klass); 9003 } 9004 if (isObject(style)) { 9005 if (isProxy(style) && !isArray(style)) { 9006 style = extend({}, style); 9007 } 9008 props.style = normalizeStyle(style); 9009 } 9010 } 9011 const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; 9012 if (shapeFlag & 4 && isProxy(type)) { 9013 type = toRaw(type); 9014 warn$1( 9015 `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\`.`, 9016 ` 9017Component that was made reactive: `, 9018 type 9019 ); 9020 } 9021 return createBaseVNode( 9022 type, 9023 props, 9024 children, 9025 patchFlag, 9026 dynamicProps, 9027 shapeFlag, 9028 isBlockNode, 9029 true 9030 ); 9031} 9032function guardReactiveProps(props) { 9033 if (!props) return null; 9034 return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; 9035} 9036function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { 9037 const { props, ref: ref2, patchFlag, children, transition } = vnode; 9038 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; 9039 const cloned = { 9040 __v_isVNode: true, 9041 __v_skip: true, 9042 type: vnode.type, 9043 props: mergedProps, 9044 key: mergedProps && normalizeKey(mergedProps), 9045 ref: extraProps && extraProps.ref ? ( 9046 // #2078 in the case of <component :is="vnode" ref="extra"/> 9047 // if the vnode itself already has a ref, cloneVNode will need to merge 9048 // the refs so the single vnode can be set on multiple refs 9049 mergeRef && ref2 ? isArray(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps) 9050 ) : ref2, 9051 scopeId: vnode.scopeId, 9052 slotScopeIds: vnode.slotScopeIds, 9053 children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children, 9054 target: vnode.target, 9055 targetStart: vnode.targetStart, 9056 targetAnchor: vnode.targetAnchor, 9057 staticCount: vnode.staticCount, 9058 shapeFlag: vnode.shapeFlag, 9059 // if the vnode is cloned with extra props, we can no longer assume its 9060 // existing patch flag to be reliable and need to add the FULL_PROPS flag. 9061 // note: preserve flag for fragments since they use the flag for children 9062 // fast paths only. 9063 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, 9064 dynamicProps: vnode.dynamicProps, 9065 dynamicChildren: vnode.dynamicChildren, 9066 appContext: vnode.appContext, 9067 dirs: vnode.dirs, 9068 transition, 9069 // These should technically only be non-null on mounted VNodes. However, 9070 // they *should* be copied for kept-alive vnodes. So we just always copy 9071 // them since them being non-null during a mount doesn't affect the logic as 9072 // they will simply be overwritten. 9073 component: vnode.component, 9074 suspense: vnode.suspense, 9075 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), 9076 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), 9077 el: vnode.el, 9078 anchor: vnode.anchor, 9079 ctx: vnode.ctx, 9080 ce: vnode.ce 9081 }; 9082 if (transition && cloneTransition) { 9083 setTransitionHooks( 9084 cloned, 9085 transition.clone(cloned) 9086 ); 9087 } 9088 return cloned; 9089} 9090function deepCloneVNode(vnode) { 9091 const cloned = cloneVNode(vnode); 9092 if (isArray(vnode.children)) { 9093 cloned.children = vnode.children.map(deepCloneVNode); 9094 } 9095 return cloned; 9096} 9097function createTextVNode(text = " ", flag = 0) { 9098 return createVNode(Text, null, text, flag); 9099} 9100function createStaticVNode(content, numberOfNodes) { 9101 const vnode = createVNode(Static, null, content); 9102 vnode.staticCount = numberOfNodes; 9103 return vnode; 9104} 9105function createCommentVNode(text = "", asBlock = false) { 9106 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); 9107} 9108function normalizeVNode(child) { 9109 if (child == null || typeof child === "boolean") { 9110 return createVNode(Comment); 9111 } else if (isArray(child)) { 9112 return createVNode( 9113 Fragment, 9114 null, 9115 // #3666, avoid reference pollution when reusing vnode 9116 child.slice() 9117 ); 9118 } else if (typeof child === "object") { 9119 return cloneIfMounted(child); 9120 } else { 9121 return createVNode(Text, null, String(child)); 9122 } 9123} 9124function cloneIfMounted(child) { 9125 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); 9126} 9127function normalizeChildren(vnode, children) { 9128 let type = 0; 9129 const { shapeFlag } = vnode; 9130 if (children == null) { 9131 children = null; 9132 } else if (isArray(children)) { 9133 type = 16; 9134 } else if (typeof children === "object") { 9135 if (shapeFlag & (1 | 64)) { 9136 const slot = children.default; 9137 if (slot) { 9138 slot._c && (slot._d = false); 9139 normalizeChildren(vnode, slot()); 9140 slot._c && (slot._d = true); 9141 } 9142 return; 9143 } else { 9144 type = 32; 9145 const slotFlag = children._; 9146 if (!slotFlag && !isInternalObject(children)) { 9147 children._ctx = currentRenderingInstance; 9148 } else if (slotFlag === 3 && currentRenderingInstance) { 9149 if (currentRenderingInstance.slots._ === 1) { 9150 children._ = 1; 9151 } else { 9152 children._ = 2; 9153 vnode.patchFlag |= 1024; 9154 } 9155 } 9156 } 9157 } else if (isFunction(children)) { 9158 children = { default: children, _ctx: currentRenderingInstance }; 9159 type = 32; 9160 } else { 9161 children = String(children); 9162 if (shapeFlag & 64) { 9163 type = 16; 9164 children = [createTextVNode(children)]; 9165 } else { 9166 type = 8; 9167 } 9168 } 9169 vnode.children = children; 9170 vnode.shapeFlag |= type; 9171} 9172function mergeProps(...args) { 9173 const ret = {}; 9174 for (let i = 0; i < args.length; i++) { 9175 const toMerge = args[i]; 9176 for (const key in toMerge) { 9177 if (key === "class") { 9178 if (ret.class !== toMerge.class) { 9179 ret.class = normalizeClass([ret.class, toMerge.class]); 9180 } 9181 } else if (key === "style") { 9182 ret.style = normalizeStyle([ret.style, toMerge.style]); 9183 } else if (isOn(key)) { 9184 const existing = ret[key]; 9185 const incoming = toMerge[key]; 9186 if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { 9187 ret[key] = existing ? [].concat(existing, incoming) : incoming; 9188 } 9189 } else if (key !== "") { 9190 ret[key] = toMerge[key]; 9191 } 9192 } 9193 } 9194 return ret; 9195} 9196function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { 9197 callWithAsyncErrorHandling(hook, instance, 7, [ 9198 vnode, 9199 prevVNode 9200 ]); 9201} 9202var emptyAppContext = createAppContext(); 9203var uid = 0; 9204function createComponentInstance(vnode, parent, suspense) { 9205 const type = vnode.type; 9206 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; 9207 const instance = { 9208 uid: uid++, 9209 vnode, 9210 type, 9211 parent, 9212 appContext, 9213 root: null, 9214 // to be immediately set 9215 next: null, 9216 subTree: null, 9217 // will be set synchronously right after creation 9218 effect: null, 9219 update: null, 9220 // will be set synchronously right after creation 9221 scope: new EffectScope( 9222 true 9223 /* detached */ 9224 ), 9225 render: null, 9226 proxy: null, 9227 exposed: null, 9228 exposeProxy: null, 9229 withProxy: null, 9230 provides: parent ? parent.provides : Object.create(appContext.provides), 9231 accessCache: null, 9232 renderCache: [], 9233 // local resolved assets 9234 components: null, 9235 directives: null, 9236 // resolved props and emits options 9237 propsOptions: normalizePropsOptions(type, appContext), 9238 emitsOptions: normalizeEmitsOptions(type, appContext), 9239 // emit 9240 emit: null, 9241 // to be set immediately 9242 emitted: null, 9243 // props default value 9244 propsDefaults: EMPTY_OBJ, 9245 // inheritAttrs 9246 inheritAttrs: type.inheritAttrs, 9247 // state 9248 ctx: EMPTY_OBJ, 9249 data: EMPTY_OBJ, 9250 props: EMPTY_OBJ, 9251 attrs: EMPTY_OBJ, 9252 slots: EMPTY_OBJ, 9253 refs: EMPTY_OBJ, 9254 setupState: EMPTY_OBJ, 9255 setupContext: null, 9256 // suspense related 9257 suspense, 9258 suspenseId: suspense ? suspense.pendingId : 0, 9259 asyncDep: null, 9260 asyncResolved: false, 9261 // lifecycle hooks 9262 // not using enums here because it results in computed properties 9263 isMounted: false, 9264 isUnmounted: false, 9265 isDeactivated: false, 9266 bc: null, 9267 c: null, 9268 bm: null, 9269 m: null, 9270 bu: null, 9271 u: null, 9272 um: null, 9273 bum: null, 9274 da: null, 9275 a: null, 9276 rtg: null, 9277 rtc: null, 9278 ec: null, 9279 sp: null 9280 }; 9281 if (true) { 9282 instance.ctx = createDevRenderContext(instance); 9283 } else { 9284 instance.ctx = { _: instance }; 9285 } 9286 instance.root = parent ? parent.root : instance; 9287 instance.emit = emit.bind(null, instance); 9288 if (vnode.ce) { 9289 vnode.ce(instance); 9290 } 9291 return instance; 9292} 9293var currentInstance = null; 9294var getCurrentInstance = () => currentInstance || currentRenderingInstance; 9295var internalSetCurrentInstance; 9296var setInSSRSetupState; 9297{ 9298 const g = getGlobalThis(); 9299 const registerGlobalSetter = (key, setter) => { 9300 let setters; 9301 if (!(setters = g[key])) setters = g[key] = []; 9302 setters.push(setter); 9303 return (v) => { 9304 if (setters.length > 1) setters.forEach((set2) => set2(v)); 9305 else setters[0](v); 9306 }; 9307 }; 9308 internalSetCurrentInstance = registerGlobalSetter( 9309 `__VUE_INSTANCE_SETTERS__`, 9310 (v) => currentInstance = v 9311 ); 9312 setInSSRSetupState = registerGlobalSetter( 9313 `__VUE_SSR_SETTERS__`, 9314 (v) => isInSSRComponentSetup = v 9315 ); 9316} 9317var setCurrentInstance = (instance) => { 9318 const prev = currentInstance; 9319 internalSetCurrentInstance(instance); 9320 instance.scope.on(); 9321 return () => { 9322 instance.scope.off(); 9323 internalSetCurrentInstance(prev); 9324 }; 9325}; 9326var unsetCurrentInstance = () => { 9327 currentInstance && currentInstance.scope.off(); 9328 internalSetCurrentInstance(null); 9329}; 9330var isBuiltInTag = makeMap("slot,component"); 9331function validateComponentName(name, { isNativeTag }) { 9332 if (isBuiltInTag(name) || isNativeTag(name)) { 9333 warn$1( 9334 "Do not use built-in or reserved HTML elements as component id: " + name 9335 ); 9336 } 9337} 9338function isStatefulComponent(instance) { 9339 return instance.vnode.shapeFlag & 4; 9340} 9341var isInSSRComponentSetup = false; 9342function setupComponent(instance, isSSR = false, optimized = false) { 9343 isSSR && setInSSRSetupState(isSSR); 9344 const { props, children } = instance.vnode; 9345 const isStateful = isStatefulComponent(instance); 9346 initProps(instance, props, isStateful, isSSR); 9347 initSlots(instance, children, optimized); 9348 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; 9349 isSSR && setInSSRSetupState(false); 9350 return setupResult; 9351} 9352function setupStatefulComponent(instance, isSSR) { 9353 var _a; 9354 const Component = instance.type; 9355 if (true) { 9356 if (Component.name) { 9357 validateComponentName(Component.name, instance.appContext.config); 9358 } 9359 if (Component.components) { 9360 const names = Object.keys(Component.components); 9361 for (let i = 0; i < names.length; i++) { 9362 validateComponentName(names[i], instance.appContext.config); 9363 } 9364 } 9365 if (Component.directives) { 9366 const names = Object.keys(Component.directives); 9367 for (let i = 0; i < names.length; i++) { 9368 validateDirectiveName(names[i]); 9369 } 9370 } 9371 if (Component.compilerOptions && isRuntimeOnly()) { 9372 warn$1( 9373 `"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.` 9374 ); 9375 } 9376 } 9377 instance.accessCache = /* @__PURE__ */ Object.create(null); 9378 instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); 9379 if (true) { 9380 exposePropsOnRenderContext(instance); 9381 } 9382 const { setup } = Component; 9383 if (setup) { 9384 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; 9385 const reset2 = setCurrentInstance(instance); 9386 pauseTracking(); 9387 const setupResult = callWithErrorHandling( 9388 setup, 9389 instance, 9390 0, 9391 [ 9392 true ? shallowReadonly(instance.props) : instance.props, 9393 setupContext 9394 ] 9395 ); 9396 resetTracking(); 9397 reset2(); 9398 if (isPromise(setupResult)) { 9399 setupResult.then(unsetCurrentInstance, unsetCurrentInstance); 9400 if (isSSR) { 9401 return setupResult.then((resolvedResult) => { 9402 handleSetupResult(instance, resolvedResult, isSSR); 9403 }).catch((e) => { 9404 handleError(e, instance, 0); 9405 }); 9406 } else { 9407 instance.asyncDep = setupResult; 9408 if (!instance.suspense) { 9409 const name = (_a = Component.name) != null ? _a : "Anonymous"; 9410 warn$1( 9411 `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.` 9412 ); 9413 } 9414 } 9415 } else { 9416 handleSetupResult(instance, setupResult, isSSR); 9417 } 9418 } else { 9419 finishComponentSetup(instance, isSSR); 9420 } 9421} 9422function handleSetupResult(instance, setupResult, isSSR) { 9423 if (isFunction(setupResult)) { 9424 if (instance.type.__ssrInlineRender) { 9425 instance.ssrRender = setupResult; 9426 } else { 9427 instance.render = setupResult; 9428 } 9429 } else if (isObject(setupResult)) { 9430 if (isVNode(setupResult)) { 9431 warn$1( 9432 `setup() should not return VNodes directly - return a render function instead.` 9433 ); 9434 } 9435 if (true) { 9436 instance.devtoolsRawSetupState = setupResult; 9437 } 9438 instance.setupState = proxyRefs(setupResult); 9439 if (true) { 9440 exposeSetupStateOnRenderContext(instance); 9441 } 9442 } else if (setupResult !== void 0) { 9443 warn$1( 9444 `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` 9445 ); 9446 } 9447 finishComponentSetup(instance, isSSR); 9448} 9449var compile; 9450var installWithProxy; 9451function registerRuntimeCompiler(_compile) { 9452 compile = _compile; 9453 installWithProxy = (i) => { 9454 if (i.render._rc) { 9455 i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); 9456 } 9457 }; 9458} 9459var isRuntimeOnly = () => !compile; 9460function finishComponentSetup(instance, isSSR, skipOptions) { 9461 const Component = instance.type; 9462 if (!instance.render) { 9463 if (!isSSR && compile && !Component.render) { 9464 const template = Component.template || resolveMergedOptions(instance).template; 9465 if (template) { 9466 if (true) { 9467 startMeasure(instance, `compile`); 9468 } 9469 const { isCustomElement, compilerOptions } = instance.appContext.config; 9470 const { delimiters, compilerOptions: componentCompilerOptions } = Component; 9471 const finalCompilerOptions = extend( 9472 extend( 9473 { 9474 isCustomElement, 9475 delimiters 9476 }, 9477 compilerOptions 9478 ), 9479 componentCompilerOptions 9480 ); 9481 Component.render = compile(template, finalCompilerOptions); 9482 if (true) { 9483 endMeasure(instance, `compile`); 9484 } 9485 } 9486 } 9487 instance.render = Component.render || NOOP; 9488 if (installWithProxy) { 9489 installWithProxy(instance); 9490 } 9491 } 9492 if (__VUE_OPTIONS_API__ && true) { 9493 const reset2 = setCurrentInstance(instance); 9494 pauseTracking(); 9495 try { 9496 applyOptions(instance); 9497 } finally { 9498 resetTracking(); 9499 reset2(); 9500 } 9501 } 9502 if (!Component.render && instance.render === NOOP && !isSSR) { 9503 if (!compile && Component.template) { 9504 warn$1( 9505 `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".` 9506 ); 9507 } else { 9508 warn$1(`Component is missing template or render function: `, Component); 9509 } 9510 } 9511} 9512var attrsProxyHandlers = true ? { 9513 get(target, key) { 9514 markAttrsAccessed(); 9515 track(target, "get", ""); 9516 return target[key]; 9517 }, 9518 set() { 9519 warn$1(`setupContext.attrs is readonly.`); 9520 return false; 9521 }, 9522 deleteProperty() { 9523 warn$1(`setupContext.attrs is readonly.`); 9524 return false; 9525 } 9526} : { 9527 get(target, key) { 9528 track(target, "get", ""); 9529 return target[key]; 9530 } 9531}; 9532function getSlotsProxy(instance) { 9533 return new Proxy(instance.slots, { 9534 get(target, key) { 9535 track(instance, "get", "$slots"); 9536 return target[key]; 9537 } 9538 }); 9539} 9540function createSetupContext(instance) { 9541 const expose = (exposed) => { 9542 if (true) { 9543 if (instance.exposed) { 9544 warn$1(`expose() should be called only once per setup().`); 9545 } 9546 if (exposed != null) { 9547 let exposedType = typeof exposed; 9548 if (exposedType === "object") { 9549 if (isArray(exposed)) { 9550 exposedType = "array"; 9551 } else if (isRef2(exposed)) { 9552 exposedType = "ref"; 9553 } 9554 } 9555 if (exposedType !== "object") { 9556 warn$1( 9557 `expose() should be passed a plain object, received ${exposedType}.` 9558 ); 9559 } 9560 } 9561 } 9562 instance.exposed = exposed || {}; 9563 }; 9564 if (true) { 9565 let attrsProxy; 9566 let slotsProxy; 9567 return Object.freeze({ 9568 get attrs() { 9569 return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); 9570 }, 9571 get slots() { 9572 return slotsProxy || (slotsProxy = getSlotsProxy(instance)); 9573 }, 9574 get emit() { 9575 return (event, ...args) => instance.emit(event, ...args); 9576 }, 9577 expose 9578 }); 9579 } else { 9580 return { 9581 attrs: new Proxy(instance.attrs, attrsProxyHandlers), 9582 slots: instance.slots, 9583 emit: instance.emit, 9584 expose 9585 }; 9586 } 9587} 9588function getComponentPublicInstance(instance) { 9589 if (instance.exposed) { 9590 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { 9591 get(target, key) { 9592 if (key in target) { 9593 return target[key]; 9594 } else if (key in publicPropertiesMap) { 9595 return publicPropertiesMap[key](instance); 9596 } 9597 }, 9598 has(target, key) { 9599 return key in target || key in publicPropertiesMap; 9600 } 9601 })); 9602 } else { 9603 return instance.proxy; 9604 } 9605} 9606var classifyRE = /(?:^|[-_])(\w)/g; 9607var classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); 9608function getComponentName(Component, includeInferred = true) { 9609 return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; 9610} 9611function formatComponentName(instance, Component, isRoot = false) { 9612 let name = getComponentName(Component); 9613 if (!name && Component.__file) { 9614 const match = Component.__file.match(/([^/\\]+)\.\w+$/); 9615 if (match) { 9616 name = match[1]; 9617 } 9618 } 9619 if (!name && instance && instance.parent) { 9620 const inferFromRegistry = (registry) => { 9621 for (const key in registry) { 9622 if (registry[key] === Component) { 9623 return key; 9624 } 9625 } 9626 }; 9627 name = inferFromRegistry( 9628 instance.components || instance.parent.type.components 9629 ) || inferFromRegistry(instance.appContext.components); 9630 } 9631 return name ? classify(name) : isRoot ? `App` : `Anonymous`; 9632} 9633function isClassComponent(value) { 9634 return isFunction(value) && "__vccOpts" in value; 9635} 9636var computed2 = (getterOrOptions, debugOptions) => { 9637 const c = computed(getterOrOptions, debugOptions, isInSSRComponentSetup); 9638 if (true) { 9639 const i = getCurrentInstance(); 9640 if (i && i.appContext.config.warnRecursiveComputed) { 9641 c._warnRecursive = true; 9642 } 9643 } 9644 return c; 9645}; 9646function h(type, propsOrChildren, children) { 9647 const l = arguments.length; 9648 if (l === 2) { 9649 if (isObject(propsOrChildren) && !isArray(propsOrChildren)) { 9650 if (isVNode(propsOrChildren)) { 9651 return createVNode(type, null, [propsOrChildren]); 9652 } 9653 return createVNode(type, propsOrChildren); 9654 } else { 9655 return createVNode(type, null, propsOrChildren); 9656 } 9657 } else { 9658 if (l > 3) { 9659 children = Array.prototype.slice.call(arguments, 2); 9660 } else if (l === 3 && isVNode(children)) { 9661 children = [children]; 9662 } 9663 return createVNode(type, propsOrChildren, children); 9664 } 9665} 9666function initCustomFormatter() { 9667 if (typeof window === "undefined") { 9668 return; 9669 } 9670 const vueStyle = { style: "color:#3ba776" }; 9671 const numberStyle = { style: "color:#1677ff" }; 9672 const stringStyle = { style: "color:#f5222d" }; 9673 const keywordStyle = { style: "color:#eb2f96" }; 9674 const formatter = { 9675 __vue_custom_formatter: true, 9676 header(obj) { 9677 if (!isObject(obj)) { 9678 return null; 9679 } 9680 if (obj.__isVue) { 9681 return ["div", vueStyle, `VueInstance`]; 9682 } else if (isRef2(obj)) { 9683 return [ 9684 "div", 9685 {}, 9686 ["span", vueStyle, genRefFlag(obj)], 9687 "<", 9688 formatValue(obj.value), 9689 `>` 9690 ]; 9691 } else if (isReactive(obj)) { 9692 return [ 9693 "div", 9694 {}, 9695 ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], 9696 "<", 9697 formatValue(obj), 9698 `>${isReadonly(obj) ? ` (readonly)` : ``}` 9699 ]; 9700 } else if (isReadonly(obj)) { 9701 return [ 9702 "div", 9703 {}, 9704 ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], 9705 "<", 9706 formatValue(obj), 9707 ">" 9708 ]; 9709 } 9710 return null; 9711 }, 9712 hasBody(obj) { 9713 return obj && obj.__isVue; 9714 }, 9715 body(obj) { 9716 if (obj && obj.__isVue) { 9717 return [ 9718 "div", 9719 {}, 9720 ...formatInstance(obj.$) 9721 ]; 9722 } 9723 } 9724 }; 9725 function formatInstance(instance) { 9726 const blocks = []; 9727 if (instance.type.props && instance.props) { 9728 blocks.push(createInstanceBlock("props", toRaw(instance.props))); 9729 } 9730 if (instance.setupState !== EMPTY_OBJ) { 9731 blocks.push(createInstanceBlock("setup", instance.setupState)); 9732 } 9733 if (instance.data !== EMPTY_OBJ) { 9734 blocks.push(createInstanceBlock("data", toRaw(instance.data))); 9735 } 9736 const computed3 = extractKeys(instance, "computed"); 9737 if (computed3) { 9738 blocks.push(createInstanceBlock("computed", computed3)); 9739 } 9740 const injected = extractKeys(instance, "inject"); 9741 if (injected) { 9742 blocks.push(createInstanceBlock("injected", injected)); 9743 } 9744 blocks.push([ 9745 "div", 9746 {}, 9747 [ 9748 "span", 9749 { 9750 style: keywordStyle.style + ";opacity:0.66" 9751 }, 9752 "$ (internal): " 9753 ], 9754 ["object", { object: instance }] 9755 ]); 9756 return blocks; 9757 } 9758 function createInstanceBlock(type, target) { 9759 target = extend({}, target); 9760 if (!Object.keys(target).length) { 9761 return ["span", {}]; 9762 } 9763 return [ 9764 "div", 9765 { style: "line-height:1.25em;margin-bottom:0.6em" }, 9766 [ 9767 "div", 9768 { 9769 style: "color:#476582" 9770 }, 9771 type 9772 ], 9773 [ 9774 "div", 9775 { 9776 style: "padding-left:1.25em" 9777 }, 9778 ...Object.keys(target).map((key) => { 9779 return [ 9780 "div", 9781 {}, 9782 ["span", keywordStyle, key + ": "], 9783 formatValue(target[key], false) 9784 ]; 9785 }) 9786 ] 9787 ]; 9788 } 9789 function formatValue(v, asRaw = true) { 9790 if (typeof v === "number") { 9791 return ["span", numberStyle, v]; 9792 } else if (typeof v === "string") { 9793 return ["span", stringStyle, JSON.stringify(v)]; 9794 } else if (typeof v === "boolean") { 9795 return ["span", keywordStyle, v]; 9796 } else if (isObject(v)) { 9797 return ["object", { object: asRaw ? toRaw(v) : v }]; 9798 } else { 9799 return ["span", stringStyle, String(v)]; 9800 } 9801 } 9802 function extractKeys(instance, type) { 9803 const Comp = instance.type; 9804 if (isFunction(Comp)) { 9805 return; 9806 } 9807 const extracted = {}; 9808 for (const key in instance.ctx) { 9809 if (isKeyOfType(Comp, key, type)) { 9810 extracted[key] = instance.ctx[key]; 9811 } 9812 } 9813 return extracted; 9814 } 9815 function isKeyOfType(Comp, key, type) { 9816 const opts = Comp[type]; 9817 if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) { 9818 return true; 9819 } 9820 if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { 9821 return true; 9822 } 9823 if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { 9824 return true; 9825 } 9826 } 9827 function genRefFlag(v) { 9828 if (isShallow(v)) { 9829 return `ShallowRef`; 9830 } 9831 if (v.effect) { 9832 return `ComputedRef`; 9833 } 9834 return `Ref`; 9835 } 9836 if (window.devtoolsFormatters) { 9837 window.devtoolsFormatters.push(formatter); 9838 } else { 9839 window.devtoolsFormatters = [formatter]; 9840 } 9841} 9842function withMemo(memo, render2, cache, index) { 9843 const cached = cache[index]; 9844 if (cached && isMemoSame(cached, memo)) { 9845 return cached; 9846 } 9847 const ret = render2(); 9848 ret.memo = memo.slice(); 9849 ret.cacheIndex = index; 9850 return cache[index] = ret; 9851} 9852function isMemoSame(cached, memo) { 9853 const prev = cached.memo; 9854 if (prev.length != memo.length) { 9855 return false; 9856 } 9857 for (let i = 0; i < prev.length; i++) { 9858 if (hasChanged(prev[i], memo[i])) { 9859 return false; 9860 } 9861 } 9862 if (isBlockTreeEnabled > 0 && currentBlock) { 9863 currentBlock.push(cached); 9864 } 9865 return true; 9866} 9867var version = "3.4.34"; 9868var warn2 = true ? warn$1 : NOOP; 9869var ErrorTypeStrings = ErrorTypeStrings$1; 9870var devtools = true ? devtools$1 : void 0; 9871var setDevtoolsHook = true ? setDevtoolsHook$1 : NOOP; 9872var _ssrUtils = { 9873 createComponentInstance, 9874 setupComponent, 9875 renderComponentRoot, 9876 setCurrentRenderingInstance, 9877 isVNode, 9878 normalizeVNode, 9879 getComponentPublicInstance 9880}; 9881var ssrUtils = _ssrUtils; 9882var resolveFilter = null; 9883var compatUtils = null; 9884var DeprecationTypes = null; 9885
vendor: 47,896 bytes, lines 9886-11468
9886// node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js 9887var svgNS = "http://www.w3.org/2000/svg"; 9888var mathmlNS = "http://www.w3.org/1998/Math/MathML"; 9889var doc = typeof document !== "undefined" ? document : null; 9890var templateContainer = doc && doc.createElement("template"); 9891var nodeOps = { 9892 insert: (child, parent, anchor) => { 9893 parent.insertBefore(child, anchor || null); 9894 }, 9895 remove: (child) => { 9896 const parent = child.parentNode; 9897 if (parent) { 9898 parent.removeChild(child); 9899 } 9900 }, 9901 createElement: (tag, namespace, is, props) => { 9902 const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); 9903 if (tag === "select" && props && props.multiple != null) { 9904 el.setAttribute("multiple", props.multiple); 9905 } 9906 return el; 9907 }, 9908 createText: (text) => doc.createTextNode(text), 9909 createComment: (text) => doc.createComment(text), 9910 setText: (node, text) => { 9911 node.nodeValue = text; 9912 }, 9913 setElementText: (el, text) => { 9914 el.textContent = text; 9915 }, 9916 parentNode: (node) => node.parentNode, 9917 nextSibling: (node) => node.nextSibling, 9918 querySelector: (selector) => doc.querySelector(selector), 9919 setScopeId(el, id) { 9920 el.setAttribute(id, ""); 9921 }, 9922 // __UNSAFE__ 9923 // Reason: innerHTML. 9924 // Static content here can only come from compiled templates. 9925 // As long as the user only uses trusted templates, this is safe. 9926 insertStaticContent(content, parent, anchor, namespace, start, end) { 9927 const before = anchor ? anchor.previousSibling : parent.lastChild; 9928 if (start && (start === end || start.nextSibling)) { 9929 while (true) { 9930 parent.insertBefore(start.cloneNode(true), anchor); 9931 if (start === end || !(start = start.nextSibling)) break; 9932 } 9933 } else { 9934 templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content; 9935 const template = templateContainer.content; 9936 if (namespace === "svg" || namespace === "mathml") { 9937 const wrapper = template.firstChild; 9938 while (wrapper.firstChild) { 9939 template.appendChild(wrapper.firstChild); 9940 } 9941 template.removeChild(wrapper); 9942 } 9943 parent.insertBefore(template, anchor); 9944 } 9945 return [ 9946 // first 9947 before ? before.nextSibling : parent.firstChild, 9948 // last 9949 anchor ? anchor.previousSibling : parent.lastChild 9950 ]; 9951 } 9952}; 9953var TRANSITION = "transition"; 9954var ANIMATION = "animation"; 9955var vtcKey = Symbol("_vtc"); 9956var Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots); 9957Transition.displayName = "Transition"; 9958var DOMTransitionPropsValidators = { 9959 name: String, 9960 type: String, 9961 css: { 9962 type: Boolean, 9963 default: true 9964 }, 9965 duration: [String, Number, Object], 9966 enterFromClass: String, 9967 enterActiveClass: String, 9968 enterToClass: String, 9969 appearFromClass: String, 9970 appearActiveClass: String, 9971 appearToClass: String, 9972 leaveFromClass: String, 9973 leaveActiveClass: String, 9974 leaveToClass: String 9975}; 9976var TransitionPropsValidators = Transition.props = extend( 9977 {}, 9978 BaseTransitionPropsValidators, 9979 DOMTransitionPropsValidators 9980); 9981var callHook2 = (hook, args = []) => { 9982 if (isArray(hook)) { 9983 hook.forEach((h2) => h2(...args)); 9984 } else if (hook) { 9985 hook(...args); 9986 } 9987}; 9988var hasExplicitCallback = (hook) => { 9989 return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; 9990}; 9991function resolveTransitionProps(rawProps) { 9992 const baseProps = {}; 9993 for (const key in rawProps) { 9994 if (!(key in DOMTransitionPropsValidators)) { 9995 baseProps[key] = rawProps[key]; 9996 } 9997 } 9998 if (rawProps.css === false) { 9999 return baseProps; 10000 } 10001 const { 10002 name = "v", 10003 type, 10004 duration, 10005 enterFromClass = `${name}-enter-from`, 10006 enterActiveClass = `${name}-enter-active`, 10007 enterToClass = `${name}-enter-to`, 10008 appearFromClass = enterFromClass, 10009 appearActiveClass = enterActiveClass, 10010 appearToClass = enterToClass, 10011 leaveFromClass = `${name}-leave-from`, 10012 leaveActiveClass = `${name}-leave-active`, 10013 leaveToClass = `${name}-leave-to` 10014 } = rawProps; 10015 const durations = normalizeDuration(duration); 10016 const enterDuration = durations && durations[0]; 10017 const leaveDuration = durations && durations[1]; 10018 const { 10019 onBeforeEnter, 10020 onEnter, 10021 onEnterCancelled, 10022 onLeave, 10023 onLeaveCancelled, 10024 onBeforeAppear = onBeforeEnter, 10025 onAppear = onEnter, 10026 onAppearCancelled = onEnterCancelled 10027 } = baseProps; 10028 const finishEnter = (el, isAppear, done) => { 10029 removeTransitionClass(el, isAppear ? appearToClass : enterToClass); 10030 removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); 10031 done && done(); 10032 }; 10033 const finishLeave = (el, done) => { 10034 el._isLeaving = false; 10035 removeTransitionClass(el, leaveFromClass); 10036 removeTransitionClass(el, leaveToClass); 10037 removeTransitionClass(el, leaveActiveClass); 10038 done && done(); 10039 }; 10040 const makeEnterHook = (isAppear) => { 10041 return (el, done) => { 10042 const hook = isAppear ? onAppear : onEnter; 10043 const resolve2 = () => finishEnter(el, isAppear, done); 10044 callHook2(hook, [el, resolve2]); 10045 nextFrame(() => { 10046 removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); 10047 addTransitionClass(el, isAppear ? appearToClass : enterToClass); 10048 if (!hasExplicitCallback(hook)) { 10049 whenTransitionEnds(el, type, enterDuration, resolve2); 10050 } 10051 }); 10052 }; 10053 }; 10054 return extend(baseProps, { 10055 onBeforeEnter(el) { 10056 callHook2(onBeforeEnter, [el]); 10057 addTransitionClass(el, enterFromClass); 10058 addTransitionClass(el, enterActiveClass); 10059 }, 10060 onBeforeAppear(el) { 10061 callHook2(onBeforeAppear, [el]); 10062 addTransitionClass(el, appearFromClass); 10063 addTransitionClass(el, appearActiveClass); 10064 }, 10065 onEnter: makeEnterHook(false), 10066 onAppear: makeEnterHook(true), 10067 onLeave(el, done) { 10068 el._isLeaving = true; 10069 const resolve2 = () => finishLeave(el, done); 10070 addTransitionClass(el, leaveFromClass); 10071 addTransitionClass(el, leaveActiveClass); 10072 forceReflow(); 10073 nextFrame(() => { 10074 if (!el._isLeaving) { 10075 return; 10076 } 10077 removeTransitionClass(el, leaveFromClass); 10078 addTransitionClass(el, leaveToClass); 10079 if (!hasExplicitCallback(onLeave)) { 10080 whenTransitionEnds(el, type, leaveDuration, resolve2); 10081 } 10082 }); 10083 callHook2(onLeave, [el, resolve2]); 10084 }, 10085 onEnterCancelled(el) { 10086 finishEnter(el, false); 10087 callHook2(onEnterCancelled, [el]); 10088 }, 10089 onAppearCancelled(el) { 10090 finishEnter(el, true); 10091 callHook2(onAppearCancelled, [el]); 10092 }, 10093 onLeaveCancelled(el) { 10094 finishLeave(el); 10095 callHook2(onLeaveCancelled, [el]); 10096 } 10097 }); 10098} 10099function normalizeDuration(duration) { 10100 if (duration == null) { 10101 return null; 10102 } else if (isObject(duration)) { 10103 return [NumberOf(duration.enter), NumberOf(duration.leave)]; 10104 } else { 10105 const n = NumberOf(duration); 10106 return [n, n]; 10107 } 10108} 10109function NumberOf(val) { 10110 const res = toNumber(val); 10111 if (true) { 10112 assertNumber(res, "<transition> explicit duration"); 10113 } 10114 return res; 10115} 10116function addTransitionClass(el, cls) { 10117 cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); 10118 (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); 10119} 10120function removeTransitionClass(el, cls) { 10121 cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); 10122 const _vtc = el[vtcKey]; 10123 if (_vtc) { 10124 _vtc.delete(cls); 10125 if (!_vtc.size) { 10126 el[vtcKey] = void 0; 10127 } 10128 } 10129} 10130function nextFrame(cb) { 10131 requestAnimationFrame(() => { 10132 requestAnimationFrame(cb); 10133 }); 10134} 10135var endId = 0; 10136function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) { 10137 const id = el._endId = ++endId; 10138 const resolveIfNotStale = () => { 10139 if (id === el._endId) { 10140 resolve2(); 10141 } 10142 }; 10143 if (explicitTimeout) { 10144 return setTimeout(resolveIfNotStale, explicitTimeout); 10145 } 10146 const { type, timeout, propCount } = getTransitionInfo(el, expectedType); 10147 if (!type) { 10148 return resolve2(); 10149 } 10150 const endEvent = type + "end"; 10151 let ended = 0; 10152 const end = () => { 10153 el.removeEventListener(endEvent, onEnd); 10154 resolveIfNotStale(); 10155 }; 10156 const onEnd = (e) => { 10157 if (e.target === el && ++ended >= propCount) { 10158 end(); 10159 } 10160 }; 10161 setTimeout(() => { 10162 if (ended < propCount) { 10163 end(); 10164 } 10165 }, timeout + 1); 10166 el.addEventListener(endEvent, onEnd); 10167} 10168function getTransitionInfo(el, expectedType) { 10169 const styles = window.getComputedStyle(el); 10170 const getStyleProperties = (key) => (styles[key] || "").split(", "); 10171 const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); 10172 const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); 10173 const transitionTimeout = getTimeout(transitionDelays, transitionDurations); 10174 const animationDelays = getStyleProperties(`${ANIMATION}Delay`); 10175 const animationDurations = getStyleProperties(`${ANIMATION}Duration`); 10176 const animationTimeout = getTimeout(animationDelays, animationDurations); 10177 let type = null; 10178 let timeout = 0; 10179 let propCount = 0; 10180 if (expectedType === TRANSITION) { 10181 if (transitionTimeout > 0) { 10182 type = TRANSITION; 10183 timeout = transitionTimeout; 10184 propCount = transitionDurations.length; 10185 } 10186 } else if (expectedType === ANIMATION) { 10187 if (animationTimeout > 0) { 10188 type = ANIMATION; 10189 timeout = animationTimeout; 10190 propCount = animationDurations.length; 10191 } 10192 } else { 10193 timeout = Math.max(transitionTimeout, animationTimeout); 10194 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; 10195 propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; 10196 } 10197 const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( 10198 getStyleProperties(`${TRANSITION}Property`).toString() 10199 ); 10200 return { 10201 type, 10202 timeout, 10203 propCount, 10204 hasTransform 10205 }; 10206} 10207function getTimeout(delays, durations) { 10208 while (delays.length < durations.length) { 10209 delays = delays.concat(delays); 10210 } 10211 return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); 10212} 10213function toMs(s) { 10214 if (s === "auto") return 0; 10215 return Number(s.slice(0, -1).replace(",", ".")) * 1e3; 10216} 10217function forceReflow() { 10218 return document.body.offsetHeight; 10219} 10220function patchClass(el, value, isSVG) { 10221 const transitionClasses = el[vtcKey]; 10222 if (transitionClasses) { 10223 value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); 10224 } 10225 if (value == null) { 10226 el.removeAttribute("class"); 10227 } else if (isSVG) { 10228 el.setAttribute("class", value); 10229 } else { 10230 el.className = value; 10231 } 10232} 10233var vShowOriginalDisplay = Symbol("_vod"); 10234var vShowHidden = Symbol("_vsh"); 10235var vShow = { 10236 beforeMount(el, { value }, { transition }) { 10237 el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; 10238 if (transition && value) { 10239 transition.beforeEnter(el); 10240 } else { 10241 setDisplay(el, value); 10242 } 10243 }, 10244 mounted(el, { value }, { transition }) { 10245 if (transition && value) { 10246 transition.enter(el); 10247 } 10248 }, 10249 updated(el, { value, oldValue }, { transition }) { 10250 if (!value === !oldValue) return; 10251 if (transition) { 10252 if (value) { 10253 transition.beforeEnter(el); 10254 setDisplay(el, true); 10255 transition.enter(el); 10256 } else { 10257 transition.leave(el, () => { 10258 setDisplay(el, false); 10259 }); 10260 } 10261 } else { 10262 setDisplay(el, value); 10263 } 10264 }, 10265 beforeUnmount(el, { value }) { 10266 setDisplay(el, value); 10267 } 10268}; 10269if (true) { 10270 vShow.name = "show"; 10271} 10272function setDisplay(el, value) { 10273 el.style.display = value ? el[vShowOriginalDisplay] : "none"; 10274 el[vShowHidden] = !value; 10275} 10276function initVShowForSSR() { 10277 vShow.getSSRProps = ({ value }) => { 10278 if (!value) { 10279 return { style: { display: "none" } }; 10280 } 10281 }; 10282} 10283var CSS_VAR_TEXT = Symbol(true ? "CSS_VAR_TEXT" : ""); 10284function useCssVars(getter) { 10285 const instance = getCurrentInstance(); 10286 if (!instance) { 10287 warn2(`useCssVars is called without current active component instance.`); 10288 return; 10289 } 10290 const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { 10291 Array.from( 10292 document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) 10293 ).forEach((node) => setVarsOnNode(node, vars)); 10294 }; 10295 if (true) { 10296 instance.getCssVars = () => getter(instance.proxy); 10297 } 10298 const setVars = () => { 10299 const vars = getter(instance.proxy); 10300 setVarsOnVNode(instance.subTree, vars); 10301 updateTeleports(vars); 10302 }; 10303 onMounted(() => { 10304 watchPostEffect(setVars); 10305 const ob = new MutationObserver(setVars); 10306 ob.observe(instance.subTree.el.parentNode, { childList: true }); 10307 onUnmounted(() => ob.disconnect()); 10308 }); 10309} 10310function setVarsOnVNode(vnode, vars) { 10311 if (vnode.shapeFlag & 128) { 10312 const suspense = vnode.suspense; 10313 vnode = suspense.activeBranch; 10314 if (suspense.pendingBranch && !suspense.isHydrating) { 10315 suspense.effects.push(() => { 10316 setVarsOnVNode(suspense.activeBranch, vars); 10317 }); 10318 } 10319 } 10320 while (vnode.component) { 10321 vnode = vnode.component.subTree; 10322 } 10323 if (vnode.shapeFlag & 1 && vnode.el) { 10324 setVarsOnNode(vnode.el, vars); 10325 } else if (vnode.type === Fragment) { 10326 vnode.children.forEach((c) => setVarsOnVNode(c, vars)); 10327 } else if (vnode.type === Static) { 10328 let { el, anchor } = vnode; 10329 while (el) { 10330 setVarsOnNode(el, vars); 10331 if (el === anchor) break; 10332 el = el.nextSibling; 10333 } 10334 } 10335} 10336function setVarsOnNode(el, vars) { 10337 if (el.nodeType === 1) { 10338 const style = el.style; 10339 let cssText = ""; 10340 for (const key in vars) { 10341 style.setProperty(`--${key}`, vars[key]); 10342 cssText += `--${key}: ${vars[key]};`; 10343 } 10344 style[CSS_VAR_TEXT] = cssText; 10345 } 10346} 10347var displayRE = /(^|;)\s*display\s*:/; 10348function patchStyle(el, prev, next) { 10349 const style = el.style; 10350 const isCssString = isString(next); 10351 let hasControlledDisplay = false; 10352 if (next && !isCssString) { 10353 if (prev) { 10354 if (!isString(prev)) { 10355 for (const key in prev) { 10356 if (next[key] == null) { 10357 setStyle(style, key, ""); 10358 } 10359 } 10360 } else { 10361 for (const prevStyle of prev.split(";")) { 10362 const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); 10363 if (next[key] == null) { 10364 setStyle(style, key, ""); 10365 } 10366 } 10367 } 10368 } 10369 for (const key in next) { 10370 if (key === "display") { 10371 hasControlledDisplay = true; 10372 } 10373 setStyle(style, key, next[key]); 10374 } 10375 } else { 10376 if (isCssString) { 10377 if (prev !== next) { 10378 const cssVarText = style[CSS_VAR_TEXT]; 10379 if (cssVarText) { 10380 next += ";" + cssVarText; 10381 } 10382 style.cssText = next; 10383 hasControlledDisplay = displayRE.test(next); 10384 } 10385 } else if (prev) { 10386 el.removeAttribute("style"); 10387 } 10388 } 10389 if (vShowOriginalDisplay in el) { 10390 el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; 10391 if (el[vShowHidden]) { 10392 style.display = "none"; 10393 } 10394 } 10395} 10396var semicolonRE = /[^\\];\s*$/; 10397var importantRE = /\s*!important$/; 10398function setStyle(style, name, val) { 10399 if (isArray(val)) { 10400 val.forEach((v) => setStyle(style, name, v)); 10401 } else { 10402 if (val == null) val = ""; 10403 if (true) { 10404 if (semicolonRE.test(val)) { 10405 warn2( 10406 `Unexpected semicolon at the end of '${name}' style value: '${val}'` 10407 ); 10408 } 10409 } 10410 if (name.startsWith("--")) { 10411 style.setProperty(name, val); 10412 } else { 10413 const prefixed = autoPrefix(style, name); 10414 if (importantRE.test(val)) { 10415 style.setProperty( 10416 hyphenate(prefixed), 10417 val.replace(importantRE, ""), 10418 "important" 10419 ); 10420 } else { 10421 style[prefixed] = val; 10422 } 10423 } 10424 } 10425} 10426var prefixes = ["Webkit", "Moz", "ms"]; 10427var prefixCache = {}; 10428function autoPrefix(style, rawName) { 10429 const cached = prefixCache[rawName]; 10430 if (cached) { 10431 return cached; 10432 } 10433 let name = camelize(rawName); 10434 if (name !== "filter" && name in style) { 10435 return prefixCache[rawName] = name; 10436 } 10437 name = capitalize(name); 10438 for (let i = 0; i < prefixes.length; i++) { 10439 const prefixed = prefixes[i] + name; 10440 if (prefixed in style) { 10441 return prefixCache[rawName] = prefixed; 10442 } 10443 } 10444 return rawName; 10445} 10446var xlinkNS = "http://www.w3.org/1999/xlink"; 10447function patchAttr(el, key, value, isSVG, instance, isBoolean2 = isSpecialBooleanAttr(key)) { 10448 if (isSVG && key.startsWith("xlink:")) { 10449 if (value == null) { 10450 el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); 10451 } else { 10452 el.setAttributeNS(xlinkNS, key, value); 10453 } 10454 } else { 10455 if (value == null || isBoolean2 && !includeBooleanAttr(value)) { 10456 el.removeAttribute(key); 10457 } else { 10458 el.setAttribute( 10459 key, 10460 isBoolean2 ? "" : isSymbol(value) ? String(value) : value 10461 ); 10462 } 10463 } 10464} 10465function patchDOMProp(el, key, value, parentComponent) { 10466 if (key === "innerHTML" || key === "textContent") { 10467 if (value == null) return; 10468 el[key] = value; 10469 return; 10470 } 10471 const tag = el.tagName; 10472 if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally 10473 !tag.includes("-")) { 10474 const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; 10475 const newValue = value == null ? "" : String(value); 10476 if (oldValue !== newValue || !("_value" in el)) { 10477 el.value = newValue; 10478 } 10479 if (value == null) { 10480 el.removeAttribute(key); 10481 } 10482 el._value = value; 10483 return; 10484 } 10485 let needRemove = false; 10486 if (value === "" || value == null) { 10487 const type = typeof el[key]; 10488 if (type === "boolean") { 10489 value = includeBooleanAttr(value); 10490 } else if (value == null && type === "string") { 10491 value = ""; 10492 needRemove = true; 10493 } else if (type === "number") { 10494 value = 0; 10495 needRemove = true; 10496 } 10497 } 10498 try { 10499 el[key] = value; 10500 } catch (e) { 10501 if (!needRemove) { 10502 warn2( 10503 `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, 10504 e 10505 ); 10506 } 10507 } 10508 needRemove && el.removeAttribute(key); 10509} 10510function addEventListener(el, event, handler, options) { 10511 el.addEventListener(event, handler, options); 10512} 10513function removeEventListener(el, event, handler, options) { 10514 el.removeEventListener(event, handler, options); 10515} 10516var veiKey = Symbol("_vei"); 10517function patchEvent(el, rawName, prevValue, nextValue, instance = null) { 10518 const invokers = el[veiKey] || (el[veiKey] = {}); 10519 const existingInvoker = invokers[rawName]; 10520 if (nextValue && existingInvoker) { 10521 existingInvoker.value = true ? sanitizeEventValue(nextValue, rawName) : nextValue; 10522 } else { 10523 const [name, options] = parseName(rawName); 10524 if (nextValue) { 10525 const invoker = invokers[rawName] = createInvoker( 10526 true ? sanitizeEventValue(nextValue, rawName) : nextValue, 10527 instance 10528 ); 10529 addEventListener(el, name, invoker, options); 10530 } else if (existingInvoker) { 10531 removeEventListener(el, name, existingInvoker, options); 10532 invokers[rawName] = void 0; 10533 } 10534 } 10535} 10536var optionsModifierRE = /(?:Once|Passive|Capture)$/; 10537function parseName(name) { 10538 let options; 10539 if (optionsModifierRE.test(name)) { 10540 options = {}; 10541 let m; 10542 while (m = name.match(optionsModifierRE)) { 10543 name = name.slice(0, name.length - m[0].length); 10544 options[m[0].toLowerCase()] = true; 10545 } 10546 } 10547 const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); 10548 return [event, options]; 10549} 10550var cachedNow = 0; 10551var p = Promise.resolve(); 10552var getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); 10553function createInvoker(initialValue, instance) { 10554 const invoker = (e) => { 10555 if (!e._vts) { 10556 e._vts = Date.now(); 10557 } else if (e._vts <= invoker.attached) { 10558 return; 10559 } 10560 callWithAsyncErrorHandling( 10561 patchStopImmediatePropagation(e, invoker.value), 10562 instance, 10563 5, 10564 [e] 10565 ); 10566 }; 10567 invoker.value = initialValue; 10568 invoker.attached = getNow(); 10569 return invoker; 10570} 10571function sanitizeEventValue(value, propName) { 10572 if (isFunction(value) || isArray(value)) { 10573 return value; 10574 } 10575 warn2( 10576 `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? 10577Expected function or array of functions, received type ${typeof value}.` 10578 ); 10579 return NOOP; 10580} 10581function patchStopImmediatePropagation(e, value) { 10582 if (isArray(value)) { 10583 const originalStop = e.stopImmediatePropagation; 10584 e.stopImmediatePropagation = () => { 10585 originalStop.call(e); 10586 e._stopped = true; 10587 }; 10588 return value.map( 10589 (fn) => (e2) => !e2._stopped && fn && fn(e2) 10590 ); 10591 } else { 10592 return value; 10593 } 10594} 10595var isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter 10596key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; 10597var patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { 10598 const isSVG = namespace === "svg"; 10599 if (key === "class") { 10600 patchClass(el, nextValue, isSVG); 10601 } else if (key === "style") { 10602 patchStyle(el, prevValue, nextValue); 10603 } else if (isOn(key)) { 10604 if (!isModelListener(key)) { 10605 patchEvent(el, key, prevValue, nextValue, parentComponent); 10606 } 10607 } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { 10608 patchDOMProp(el, key, nextValue); 10609 if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { 10610 patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); 10611 } 10612 } else { 10613 if (key === "true-value") { 10614 el._trueValue = nextValue; 10615 } else if (key === "false-value") { 10616 el._falseValue = nextValue; 10617 } 10618 patchAttr(el, key, nextValue, isSVG); 10619 } 10620}; 10621function shouldSetAsProp(el, key, value, isSVG) { 10622 if (isSVG) { 10623 if (key === "innerHTML" || key === "textContent") { 10624 return true; 10625 } 10626 if (key in el && isNativeOn(key) && isFunction(value)) { 10627 return true; 10628 } 10629 return false; 10630 } 10631 if (key === "spellcheck" || key === "draggable" || key === "translate") { 10632 return false; 10633 } 10634 if (key === "form") { 10635 return false; 10636 } 10637 if (key === "list" && el.tagName === "INPUT") { 10638 return false; 10639 } 10640 if (key === "type" && el.tagName === "TEXTAREA") { 10641 return false; 10642 } 10643 if (key === "width" || key === "height") { 10644 const tag = el.tagName; 10645 if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { 10646 return false; 10647 } 10648 } 10649 if (isNativeOn(key) && isString(value)) { 10650 return false; 10651 } 10652 return key in el; 10653} 10654function defineCustomElement(options, extraOptions, hydrate2) { 10655 const Comp = defineComponent(options, extraOptions); 10656 class VueCustomElement extends VueElement { 10657 constructor(initialProps) { 10658 super(Comp, initialProps, hydrate2); 10659 } 10660 } 10661 VueCustomElement.def = Comp; 10662 return VueCustomElement; 10663} 10664var defineSSRCustomElement = (options, extraOptions) => { 10665 return defineCustomElement(options, extraOptions, hydrate); 10666}; 10667var BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { 10668}; 10669var VueElement = class _VueElement extends BaseClass { 10670 constructor(_def, _props = {}, hydrate2) { 10671 super(); 10672 this._def = _def; 10673 this._props = _props; 10674 this._instance = null; 10675 this._connected = false; 10676 this._resolved = false; 10677 this._numberProps = null; 10678 this._ob = null; 10679 if (this.shadowRoot && hydrate2) { 10680 hydrate2(this._createVNode(), this.shadowRoot); 10681 } else { 10682 if (this.shadowRoot) { 10683 warn2( 10684 `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` 10685 ); 10686 } 10687 this.attachShadow({ mode: "open" }); 10688 if (!this._def.__asyncLoader) { 10689 this._resolveProps(this._def); 10690 } 10691 } 10692 } 10693 connectedCallback() { 10694 this._connected = true; 10695 if (!this._instance) { 10696 if (this._resolved) { 10697 this._update(); 10698 } else { 10699 this._resolveDef(); 10700 } 10701 } 10702 } 10703 disconnectedCallback() { 10704 this._connected = false; 10705 nextTick(() => { 10706 if (!this._connected) { 10707 if (this._ob) { 10708 this._ob.disconnect(); 10709 this._ob = null; 10710 } 10711 render(null, this.shadowRoot); 10712 this._instance = null; 10713 } 10714 }); 10715 } 10716 /** 10717 * resolve inner component definition (handle possible async component) 10718 */ 10719 _resolveDef() { 10720 this._resolved = true; 10721 for (let i = 0; i < this.attributes.length; i++) { 10722 this._setAttr(this.attributes[i].name); 10723 } 10724 this._ob = new MutationObserver((mutations) => { 10725 for (const m of mutations) { 10726 this._setAttr(m.attributeName); 10727 } 10728 }); 10729 this._ob.observe(this, { attributes: true }); 10730 const resolve2 = (def2, isAsync = false) => { 10731 const { props, styles } = def2; 10732 let numberProps; 10733 if (props && !isArray(props)) { 10734 for (const key in props) { 10735 const opt = props[key]; 10736 if (opt === Number || opt && opt.type === Number) { 10737 if (key in this._props) { 10738 this._props[key] = toNumber(this._props[key]); 10739 } 10740 (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true; 10741 } 10742 } 10743 } 10744 this._numberProps = numberProps; 10745 if (isAsync) { 10746 this._resolveProps(def2); 10747 } 10748 this._applyStyles(styles); 10749 this._update(); 10750 }; 10751 const asyncDef = this._def.__asyncLoader; 10752 if (asyncDef) { 10753 asyncDef().then((def2) => resolve2(def2, true)); 10754 } else { 10755 resolve2(this._def); 10756 } 10757 } 10758 _resolveProps(def2) { 10759 const { props } = def2; 10760 const declaredPropKeys = isArray(props) ? props : Object.keys(props || {}); 10761 for (const key of Object.keys(this)) { 10762 if (key[0] !== "_" && declaredPropKeys.includes(key)) { 10763 this._setProp(key, this[key], true, false); 10764 } 10765 } 10766 for (const key of declaredPropKeys.map(camelize)) { 10767 Object.defineProperty(this, key, { 10768 get() { 10769 return this._getProp(key); 10770 }, 10771 set(val) { 10772 this._setProp(key, val); 10773 } 10774 }); 10775 } 10776 } 10777 _setAttr(key) { 10778 let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0; 10779 const camelKey = camelize(key); 10780 if (this._numberProps && this._numberProps[camelKey]) { 10781 value = toNumber(value); 10782 } 10783 this._setProp(camelKey, value, false); 10784 } 10785 /** 10786 * @internal 10787 */ 10788 _getProp(key) { 10789 return this._props[key]; 10790 } 10791 /** 10792 * @internal 10793 */ 10794 _setProp(key, val, shouldReflect = true, shouldUpdate = true) { 10795 if (val !== this._props[key]) { 10796 this._props[key] = val; 10797 if (shouldUpdate && this._instance) { 10798 this._update(); 10799 } 10800 if (shouldReflect) { 10801 if (val === true) { 10802 this.setAttribute(hyphenate(key), ""); 10803 } else if (typeof val === "string" || typeof val === "number") { 10804 this.setAttribute(hyphenate(key), val + ""); 10805 } else if (!val) { 10806 this.removeAttribute(hyphenate(key)); 10807 } 10808 } 10809 } 10810 } 10811 _update() { 10812 render(this._createVNode(), this.shadowRoot); 10813 } 10814 _createVNode() { 10815 const vnode = createVNode(this._def, extend({}, this._props)); 10816 if (!this._instance) { 10817 vnode.ce = (instance) => { 10818 this._instance = instance; 10819 instance.isCE = true; 10820 if (true) { 10821 instance.ceReload = (newStyles) => { 10822 if (this._styles) { 10823 this._styles.forEach((s) => this.shadowRoot.removeChild(s)); 10824 this._styles.length = 0; 10825 } 10826 this._applyStyles(newStyles); 10827 this._instance = null; 10828 this._update(); 10829 }; 10830 } 10831 const dispatch = (event, args) => { 10832 this.dispatchEvent( 10833 new CustomEvent(event, { 10834 detail: args 10835 }) 10836 ); 10837 }; 10838 instance.emit = (event, ...args) => { 10839 dispatch(event, args); 10840 if (hyphenate(event) !== event) { 10841 dispatch(hyphenate(event), args); 10842 } 10843 }; 10844 let parent = this; 10845 while (parent = parent && (parent.parentNode || parent.host)) { 10846 if (parent instanceof _VueElement) { 10847 instance.parent = parent._instance; 10848 instance.provides = parent._instance.provides; 10849 break; 10850 } 10851 } 10852 }; 10853 } 10854 return vnode; 10855 } 10856 _applyStyles(styles) { 10857 if (styles) { 10858 styles.forEach((css) => { 10859 const s = document.createElement("style"); 10860 s.textContent = css; 10861 this.shadowRoot.appendChild(s); 10862 if (true) { 10863 (this._styles || (this._styles = [])).push(s); 10864 } 10865 }); 10866 } 10867 } 10868}; 10869function useCssModule(name = "$style") { 10870 { 10871 const instance = getCurrentInstance(); 10872 if (!instance) { 10873 warn2(`useCssModule must be called inside setup()`); 10874 return EMPTY_OBJ; 10875 } 10876 const modules = instance.type.__cssModules; 10877 if (!modules) { 10878 warn2(`Current instance does not have CSS modules injected.`); 10879 return EMPTY_OBJ; 10880 } 10881 const mod = modules[name]; 10882 if (!mod) { 10883 warn2(`Current instance does not have CSS module named "${name}".`); 10884 return EMPTY_OBJ; 10885 } 10886 return mod; 10887 } 10888} 10889var positionMap = /* @__PURE__ */ new WeakMap(); 10890var newPositionMap = /* @__PURE__ */ new WeakMap(); 10891var moveCbKey = Symbol("_moveCb"); 10892var enterCbKey2 = Symbol("_enterCb"); 10893var TransitionGroupImpl = { 10894 name: "TransitionGroup", 10895 props: extend({}, TransitionPropsValidators, { 10896 tag: String, 10897 moveClass: String 10898 }), 10899 setup(props, { slots }) { 10900 const instance = getCurrentInstance(); 10901 const state = useTransitionState(); 10902 let prevChildren; 10903 let children; 10904 onUpdated(() => { 10905 if (!prevChildren.length) { 10906 return; 10907 } 10908 const moveClass = props.moveClass || `${props.name || "v"}-move`; 10909 if (!hasCSSTransform( 10910 prevChildren[0].el, 10911 instance.vnode.el, 10912 moveClass 10913 )) { 10914 return; 10915 } 10916 prevChildren.forEach(callPendingCbs); 10917 prevChildren.forEach(recordPosition); 10918 const movedChildren = prevChildren.filter(applyTranslation); 10919 forceReflow(); 10920 movedChildren.forEach((c) => { 10921 const el = c.el; 10922 const style = el.style; 10923 addTransitionClass(el, moveClass); 10924 style.transform = style.webkitTransform = style.transitionDuration = ""; 10925 const cb = el[moveCbKey] = (e) => { 10926 if (e && e.target !== el) { 10927 return; 10928 } 10929 if (!e || /transform$/.test(e.propertyName)) { 10930 el.removeEventListener("transitionend", cb); 10931 el[moveCbKey] = null; 10932 removeTransitionClass(el, moveClass); 10933 } 10934 }; 10935 el.addEventListener("transitionend", cb); 10936 }); 10937 }); 10938 return () => { 10939 const rawProps = toRaw(props); 10940 const cssTransitionProps = resolveTransitionProps(rawProps); 10941 let tag = rawProps.tag || Fragment; 10942 prevChildren = []; 10943 if (children) { 10944 for (let i = 0; i < children.length; i++) { 10945 const child = children[i]; 10946 if (child.el && child.el instanceof Element) { 10947 prevChildren.push(child); 10948 setTransitionHooks( 10949 child, 10950 resolveTransitionHooks( 10951 child, 10952 cssTransitionProps, 10953 state, 10954 instance 10955 ) 10956 ); 10957 positionMap.set( 10958 child, 10959 child.el.getBoundingClientRect() 10960 ); 10961 } 10962 } 10963 } 10964 children = slots.default ? getTransitionRawChildren(slots.default()) : []; 10965 for (let i = 0; i < children.length; i++) { 10966 const child = children[i]; 10967 if (child.key != null) { 10968 setTransitionHooks( 10969 child, 10970 resolveTransitionHooks(child, cssTransitionProps, state, instance) 10971 ); 10972 } else if (true) { 10973 warn2(`<TransitionGroup> children must be keyed.`); 10974 } 10975 } 10976 return createVNode(tag, null, children); 10977 }; 10978 } 10979}; 10980var removeMode = (props) => delete props.mode; 10981removeMode(TransitionGroupImpl.props); 10982var TransitionGroup = TransitionGroupImpl; 10983function callPendingCbs(c) { 10984 const el = c.el; 10985 if (el[moveCbKey]) { 10986 el[moveCbKey](); 10987 } 10988 if (el[enterCbKey2]) { 10989 el[enterCbKey2](); 10990 } 10991} 10992function recordPosition(c) { 10993 newPositionMap.set(c, c.el.getBoundingClientRect()); 10994} 10995function applyTranslation(c) { 10996 const oldPos = positionMap.get(c); 10997 const newPos = newPositionMap.get(c); 10998 const dx = oldPos.left - newPos.left; 10999 const dy = oldPos.top - newPos.top; 11000 if (dx || dy) { 11001 const s = c.el.style; 11002 s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; 11003 s.transitionDuration = "0s"; 11004 return c; 11005 } 11006} 11007function hasCSSTransform(el, root, moveClass) { 11008 const clone = el.cloneNode(); 11009 const _vtc = el[vtcKey]; 11010 if (_vtc) { 11011 _vtc.forEach((cls) => { 11012 cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); 11013 }); 11014 } 11015 moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); 11016 clone.style.display = "none"; 11017 const container = root.nodeType === 1 ? root : root.parentNode; 11018 container.appendChild(clone); 11019 const { hasTransform } = getTransitionInfo(clone); 11020 container.removeChild(clone); 11021 return hasTransform; 11022} 11023var getModelAssigner = (vnode) => { 11024 const fn = vnode.props["onUpdate:modelValue"] || false; 11025 return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn; 11026}; 11027function onCompositionStart(e) { 11028 e.target.composing = true; 11029} 11030function onCompositionEnd(e) { 11031 const target = e.target; 11032 if (target.composing) { 11033 target.composing = false; 11034 target.dispatchEvent(new Event("input")); 11035 } 11036} 11037var assignKey = Symbol("_assign"); 11038var vModelText = { 11039 created(el, { modifiers: { lazy, trim, number } }, vnode) { 11040 el[assignKey] = getModelAssigner(vnode); 11041 const castToNumber = number || vnode.props && vnode.props.type === "number"; 11042 addEventListener(el, lazy ? "change" : "input", (e) => { 11043 if (e.target.composing) return; 11044 let domValue = el.value; 11045 if (trim) { 11046 domValue = domValue.trim(); 11047 } 11048 if (castToNumber) { 11049 domValue = looseToNumber(domValue); 11050 } 11051 el[assignKey](domValue); 11052 }); 11053 if (trim) { 11054 addEventListener(el, "change", () => { 11055 el.value = el.value.trim(); 11056 }); 11057 } 11058 if (!lazy) { 11059 addEventListener(el, "compositionstart", onCompositionStart); 11060 addEventListener(el, "compositionend", onCompositionEnd); 11061 addEventListener(el, "change", onCompositionEnd); 11062 } 11063 }, 11064 // set value on mounted so it's after min/max for type="range" 11065 mounted(el, { value }) { 11066 el.value = value == null ? "" : value; 11067 }, 11068 beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { 11069 el[assignKey] = getModelAssigner(vnode); 11070 if (el.composing) return; 11071 const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; 11072 const newValue = value == null ? "" : value; 11073 if (elValue === newValue) { 11074 return; 11075 } 11076 if (document.activeElement === el && el.type !== "range") { 11077 if (lazy && value === oldValue) { 11078 return; 11079 } 11080 if (trim && el.value.trim() === newValue) { 11081 return; 11082 } 11083 } 11084 el.value = newValue; 11085 } 11086}; 11087var vModelCheckbox = { 11088 // #4096 array checkboxes need to be deep traversed 11089 deep: true, 11090 created(el, _, vnode) { 11091 el[assignKey] = getModelAssigner(vnode); 11092 addEventListener(el, "change", () => { 11093 const modelValue = el._modelValue; 11094 const elementValue = getValue(el); 11095 const checked = el.checked; 11096 const assign = el[assignKey]; 11097 if (isArray(modelValue)) { 11098 const index = looseIndexOf(modelValue, elementValue); 11099 const found = index !== -1; 11100 if (checked && !found) { 11101 assign(modelValue.concat(elementValue)); 11102 } else if (!checked && found) { 11103 const filtered = [...modelValue]; 11104 filtered.splice(index, 1); 11105 assign(filtered); 11106 } 11107 } else if (isSet(modelValue)) { 11108 const cloned = new Set(modelValue); 11109 if (checked) { 11110 cloned.add(elementValue); 11111 } else { 11112 cloned.delete(elementValue); 11113 } 11114 assign(cloned); 11115 } else { 11116 assign(getCheckboxValue(el, checked)); 11117 } 11118 }); 11119 }, 11120 // set initial checked on mount to wait for true-value/false-value 11121 mounted: setChecked, 11122 beforeUpdate(el, binding, vnode) { 11123 el[assignKey] = getModelAssigner(vnode); 11124 setChecked(el, binding, vnode); 11125 } 11126}; 11127function setChecked(el, { value, oldValue }, vnode) { 11128 el._modelValue = value; 11129 if (isArray(value)) { 11130 el.checked = looseIndexOf(value, vnode.props.value) > -1; 11131 } else if (isSet(value)) { 11132 el.checked = value.has(vnode.props.value); 11133 } else if (value !== oldValue) { 11134 el.checked = looseEqual(value, getCheckboxValue(el, true)); 11135 } 11136} 11137var vModelRadio = { 11138 created(el, { value }, vnode) { 11139 el.checked = looseEqual(value, vnode.props.value); 11140 el[assignKey] = getModelAssigner(vnode); 11141 addEventListener(el, "change", () => { 11142 el[assignKey](getValue(el)); 11143 }); 11144 }, 11145 beforeUpdate(el, { value, oldValue }, vnode) { 11146 el[assignKey] = getModelAssigner(vnode); 11147 if (value !== oldValue) { 11148 el.checked = looseEqual(value, vnode.props.value); 11149 } 11150 } 11151}; 11152var vModelSelect = { 11153 // <select multiple> value need to be deep traversed 11154 deep: true, 11155 created(el, { value, modifiers: { number } }, vnode) { 11156 const isSetModel = isSet(value); 11157 addEventListener(el, "change", () => { 11158 const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( 11159 (o) => number ? looseToNumber(getValue(o)) : getValue(o) 11160 ); 11161 el[assignKey]( 11162 el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] 11163 ); 11164 el._assigning = true; 11165 nextTick(() => { 11166 el._assigning = false; 11167 }); 11168 }); 11169 el[assignKey] = getModelAssigner(vnode); 11170 }, 11171 // set value in mounted & updated because <select> relies on its children 11172 // <option>s. 11173 mounted(el, { value, modifiers: { number } }) { 11174 setSelected(el, value); 11175 }, 11176 beforeUpdate(el, _binding, vnode) { 11177 el[assignKey] = getModelAssigner(vnode); 11178 }, 11179 updated(el, { value, modifiers: { number } }) { 11180 if (!el._assigning) { 11181 setSelected(el, value); 11182 } 11183 } 11184}; 11185function setSelected(el, value, number) { 11186 const isMultiple = el.multiple; 11187 const isArrayValue = isArray(value); 11188 if (isMultiple && !isArrayValue && !isSet(value)) { 11189 warn2( 11190 `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` 11191 ); 11192 return; 11193 } 11194 for (let i = 0, l = el.options.length; i < l; i++) { 11195 const option = el.options[i]; 11196 const optionValue = getValue(option); 11197 if (isMultiple) { 11198 if (isArrayValue) { 11199 const optionType = typeof optionValue; 11200 if (optionType === "string" || optionType === "number") { 11201 option.selected = value.some((v) => String(v) === String(optionValue)); 11202 } else { 11203 option.selected = looseIndexOf(value, optionValue) > -1; 11204 } 11205 } else { 11206 option.selected = value.has(optionValue); 11207 } 11208 } else if (looseEqual(getValue(option), value)) { 11209 if (el.selectedIndex !== i) el.selectedIndex = i; 11210 return; 11211 } 11212 } 11213 if (!isMultiple && el.selectedIndex !== -1) { 11214 el.selectedIndex = -1; 11215 } 11216} 11217function getValue(el) { 11218 return "_value" in el ? el._value : el.value; 11219} 11220function getCheckboxValue(el, checked) { 11221 const key = checked ? "_trueValue" : "_falseValue"; 11222 return key in el ? el[key] : checked; 11223} 11224var vModelDynamic = { 11225 created(el, binding, vnode) { 11226 callModelHook(el, binding, vnode, null, "created"); 11227 }, 11228 mounted(el, binding, vnode) { 11229 callModelHook(el, binding, vnode, null, "mounted"); 11230 }, 11231 beforeUpdate(el, binding, vnode, prevVNode) { 11232 callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); 11233 }, 11234 updated(el, binding, vnode, prevVNode) { 11235 callModelHook(el, binding, vnode, prevVNode, "updated"); 11236 } 11237}; 11238function resolveDynamicModel(tagName, type) { 11239 switch (tagName) { 11240 case "SELECT": 11241 return vModelSelect; 11242 case "TEXTAREA": 11243 return vModelText; 11244 default: 11245 switch (type) { 11246 case "checkbox": 11247 return vModelCheckbox; 11248 case "radio": 11249 return vModelRadio; 11250 default: 11251 return vModelText; 11252 } 11253 } 11254} 11255function callModelHook(el, binding, vnode, prevVNode, hook) { 11256 const modelToUse = resolveDynamicModel( 11257 el.tagName, 11258 vnode.props && vnode.props.type 11259 ); 11260 const fn = modelToUse[hook]; 11261 fn && fn(el, binding, vnode, prevVNode); 11262} 11263function initVModelForSSR() { 11264 vModelText.getSSRProps = ({ value }) => ({ value }); 11265 vModelRadio.getSSRProps = ({ value }, vnode) => { 11266 if (vnode.props && looseEqual(vnode.props.value, value)) { 11267 return { checked: true }; 11268 } 11269 }; 11270 vModelCheckbox.getSSRProps = ({ value }, vnode) => { 11271 if (isArray(value)) { 11272 if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) { 11273 return { checked: true }; 11274 } 11275 } else if (isSet(value)) { 11276 if (vnode.props && value.has(vnode.props.value)) { 11277 return { checked: true }; 11278 } 11279 } else if (value) { 11280 return { checked: true }; 11281 } 11282 }; 11283 vModelDynamic.getSSRProps = (binding, vnode) => { 11284 if (typeof vnode.type !== "string") { 11285 return; 11286 } 11287 const modelToUse = resolveDynamicModel( 11288 // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase 11289 vnode.type.toUpperCase(), 11290 vnode.props && vnode.props.type 11291 ); 11292 if (modelToUse.getSSRProps) { 11293 return modelToUse.getSSRProps(binding, vnode); 11294 } 11295 }; 11296} 11297var systemModifiers = ["ctrl", "shift", "alt", "meta"]; 11298var modifierGuards = { 11299 stop: (e) => e.stopPropagation(), 11300 prevent: (e) => e.preventDefault(), 11301 self: (e) => e.target !== e.currentTarget, 11302 ctrl: (e) => !e.ctrlKey, 11303 shift: (e) => !e.shiftKey, 11304 alt: (e) => !e.altKey, 11305 meta: (e) => !e.metaKey, 11306 left: (e) => "button" in e && e.button !== 0, 11307 middle: (e) => "button" in e && e.button !== 1, 11308 right: (e) => "button" in e && e.button !== 2, 11309 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) 11310}; 11311var withModifiers = (fn, modifiers) => { 11312 const cache = fn._withMods || (fn._withMods = {}); 11313 const cacheKey = modifiers.join("."); 11314 return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { 11315 for (let i = 0; i < modifiers.length; i++) { 11316 const guard = modifierGuards[modifiers[i]]; 11317 if (guard && guard(event, modifiers)) return; 11318 } 11319 return fn(event, ...args); 11320 }); 11321}; 11322var keyNames = { 11323 esc: "escape", 11324 space: " ", 11325 up: "arrow-up", 11326 left: "arrow-left", 11327 right: "arrow-right", 11328 down: "arrow-down", 11329 delete: "backspace" 11330}; 11331var withKeys = (fn, modifiers) => { 11332 const cache = fn._withKeys || (fn._withKeys = {}); 11333 const cacheKey = modifiers.join("."); 11334 return cache[cacheKey] || (cache[cacheKey] = (event) => { 11335 if (!("key" in event)) { 11336 return; 11337 } 11338 const eventKey = hyphenate(event.key); 11339 if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) { 11340 return fn(event); 11341 } 11342 }); 11343}; 11344var rendererOptions = extend({ patchProp }, nodeOps); 11345var renderer; 11346var enabledHydration = false; 11347function ensureRenderer() { 11348 return renderer || (renderer = createRenderer(rendererOptions)); 11349} 11350function ensureHydrationRenderer() { 11351 renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions); 11352 enabledHydration = true; 11353 return renderer; 11354} 11355var render = (...args) => { 11356 ensureRenderer().render(...args); 11357}; 11358var hydrate = (...args) => { 11359 ensureHydrationRenderer().hydrate(...args); 11360}; 11361var createApp = (...args) => { 11362 const app = ensureRenderer().createApp(...args); 11363 if (true) { 11364 injectNativeTagCheck(app); 11365 injectCompilerOptionsCheck(app); 11366 } 11367 const { mount } = app; 11368 app.mount = (containerOrSelector) => { 11369 const container = normalizeContainer(containerOrSelector); 11370 if (!container) return; 11371 const component = app._component; 11372 if (!isFunction(component) && !component.render && !component.template) { 11373 component.template = container.innerHTML; 11374 } 11375 container.innerHTML = ""; 11376 const proxy = mount(container, false, resolveRootNamespace(container)); 11377 if (container instanceof Element) { 11378 container.removeAttribute("v-cloak"); 11379 container.setAttribute("data-v-app", ""); 11380 } 11381 return proxy; 11382 }; 11383 return app; 11384}; 11385var createSSRApp = (...args) => { 11386 const app = ensureHydrationRenderer().createApp(...args); 11387 if (true) { 11388 injectNativeTagCheck(app); 11389 injectCompilerOptionsCheck(app); 11390 } 11391 const { mount } = app; 11392 app.mount = (containerOrSelector) => { 11393 const container = normalizeContainer(containerOrSelector); 11394 if (container) { 11395 return mount(container, true, resolveRootNamespace(container)); 11396 } 11397 }; 11398 return app; 11399}; 11400function resolveRootNamespace(container) { 11401 if (container instanceof SVGElement) { 11402 return "svg"; 11403 } 11404 if (typeof MathMLElement === "function" && container instanceof MathMLElement) { 11405 return "mathml"; 11406 } 11407} 11408function injectNativeTagCheck(app) { 11409 Object.defineProperty(app.config, "isNativeTag", { 11410 value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), 11411 writable: false 11412 }); 11413} 11414function injectCompilerOptionsCheck(app) { 11415 if (isRuntimeOnly()) { 11416 const isCustomElement = app.config.isCustomElement; 11417 Object.defineProperty(app.config, "isCustomElement", { 11418 get() { 11419 return isCustomElement; 11420 }, 11421 set() { 11422 warn2( 11423 `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` 11424 ); 11425 } 11426 }); 11427 const compilerOptions = app.config.compilerOptions; 11428 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. 11429- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. 11430- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader 11431- 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`; 11432 Object.defineProperty(app.config, "compilerOptions", { 11433 get() { 11434 warn2(msg); 11435 return compilerOptions; 11436 }, 11437 set() { 11438 warn2(msg); 11439 } 11440 }); 11441 } 11442} 11443function normalizeContainer(container) { 11444 if (isString(container)) { 11445 const res = document.querySelector(container); 11446 if (!res) { 11447 warn2( 11448 `Failed to mount app: mount target selector "${container}" returned null.` 11449 ); 11450 } 11451 return res; 11452 } 11453 if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { 11454 warn2( 11455 `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` 11456 ); 11457 } 11458 return container; 11459} 11460var ssrDirectiveInitialized = false; 11461var initDirectivesForSSR = () => { 11462 if (!ssrDirectiveInitialized) { 11463 ssrDirectiveInitialized = true; 11464 initVModelForSSR(); 11465 initVShowForSSR(); 11466 } 11467}; 11468
vendor: 148,786 bytes, lines 11469-16638
11469// node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js 11470var FRAGMENT = Symbol(true ? `Fragment` : ``); 11471var TELEPORT = Symbol(true ? `Teleport` : ``); 11472var SUSPENSE = Symbol(true ? `Suspense` : ``); 11473var KEEP_ALIVE = Symbol(true ? `KeepAlive` : ``); 11474var BASE_TRANSITION = Symbol(true ? `BaseTransition` : ``); 11475var OPEN_BLOCK = Symbol(true ? `openBlock` : ``); 11476var CREATE_BLOCK = Symbol(true ? `createBlock` : ``); 11477var CREATE_ELEMENT_BLOCK = Symbol(true ? `createElementBlock` : ``); 11478var CREATE_VNODE = Symbol(true ? `createVNode` : ``); 11479var CREATE_ELEMENT_VNODE = Symbol(true ? `createElementVNode` : ``); 11480var CREATE_COMMENT = Symbol(true ? `createCommentVNode` : ``); 11481var CREATE_TEXT = Symbol(true ? `createTextVNode` : ``); 11482var CREATE_STATIC = Symbol(true ? `createStaticVNode` : ``); 11483var RESOLVE_COMPONENT = Symbol(true ? `resolveComponent` : ``); 11484var RESOLVE_DYNAMIC_COMPONENT = Symbol( 11485 true ? `resolveDynamicComponent` : `` 11486); 11487var RESOLVE_DIRECTIVE = Symbol(true ? `resolveDirective` : ``); 11488var RESOLVE_FILTER = Symbol(true ? `resolveFilter` : ``); 11489var WITH_DIRECTIVES = Symbol(true ? `withDirectives` : ``); 11490var RENDER_LIST = Symbol(true ? `renderList` : ``); 11491var RENDER_SLOT = Symbol(true ? `renderSlot` : ``); 11492var CREATE_SLOTS = Symbol(true ? `createSlots` : ``); 11493var TO_DISPLAY_STRING = Symbol(true ? `toDisplayString` : ``); 11494var MERGE_PROPS = Symbol(true ? `mergeProps` : ``); 11495var NORMALIZE_CLASS = Symbol(true ? `normalizeClass` : ``); 11496var NORMALIZE_STYLE = Symbol(true ? `normalizeStyle` : ``); 11497var NORMALIZE_PROPS = Symbol(true ? `normalizeProps` : ``); 11498var GUARD_REACTIVE_PROPS = Symbol(true ? `guardReactiveProps` : ``); 11499var TO_HANDLERS = Symbol(true ? `toHandlers` : ``); 11500var CAMELIZE = Symbol(true ? `camelize` : ``); 11501var CAPITALIZE = Symbol(true ? `capitalize` : ``); 11502var TO_HANDLER_KEY = Symbol(true ? `toHandlerKey` : ``); 11503var SET_BLOCK_TRACKING = Symbol(true ? `setBlockTracking` : ``); 11504var PUSH_SCOPE_ID = Symbol(true ? `pushScopeId` : ``); 11505var POP_SCOPE_ID = Symbol(true ? `popScopeId` : ``); 11506var WITH_CTX = Symbol(true ? `withCtx` : ``); 11507var UNREF = Symbol(true ? `unref` : ``); 11508var IS_REF = Symbol(true ? `isRef` : ``); 11509var WITH_MEMO = Symbol(true ? `withMemo` : ``); 11510var IS_MEMO_SAME = Symbol(true ? `isMemoSame` : ``); 11511var helperNameMap = { 11512 [FRAGMENT]: `Fragment`, 11513 [TELEPORT]: `Teleport`, 11514 [SUSPENSE]: `Suspense`, 11515 [KEEP_ALIVE]: `KeepAlive`, 11516 [BASE_TRANSITION]: `BaseTransition`, 11517 [OPEN_BLOCK]: `openBlock`, 11518 [CREATE_BLOCK]: `createBlock`, 11519 [CREATE_ELEMENT_BLOCK]: `createElementBlock`, 11520 [CREATE_VNODE]: `createVNode`, 11521 [CREATE_ELEMENT_VNODE]: `createElementVNode`, 11522 [CREATE_COMMENT]: `createCommentVNode`, 11523 [CREATE_TEXT]: `createTextVNode`, 11524 [CREATE_STATIC]: `createStaticVNode`, 11525 [RESOLVE_COMPONENT]: `resolveComponent`, 11526 [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, 11527 [RESOLVE_DIRECTIVE]: `resolveDirective`, 11528 [RESOLVE_FILTER]: `resolveFilter`, 11529 [WITH_DIRECTIVES]: `withDirectives`, 11530 [RENDER_LIST]: `renderList`, 11531 [RENDER_SLOT]: `renderSlot`, 11532 [CREATE_SLOTS]: `createSlots`, 11533 [TO_DISPLAY_STRING]: `toDisplayString`, 11534 [MERGE_PROPS]: `mergeProps`, 11535 [NORMALIZE_CLASS]: `normalizeClass`, 11536 [NORMALIZE_STYLE]: `normalizeStyle`, 11537 [NORMALIZE_PROPS]: `normalizeProps`, 11538 [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, 11539 [TO_HANDLERS]: `toHandlers`, 11540 [CAMELIZE]: `camelize`, 11541 [CAPITALIZE]: `capitalize`, 11542 [TO_HANDLER_KEY]: `toHandlerKey`, 11543 [SET_BLOCK_TRACKING]: `setBlockTracking`, 11544 [PUSH_SCOPE_ID]: `pushScopeId`, 11545 [POP_SCOPE_ID]: `popScopeId`, 11546 [WITH_CTX]: `withCtx`, 11547 [UNREF]: `unref`, 11548 [IS_REF]: `isRef`, 11549 [WITH_MEMO]: `withMemo`, 11550 [IS_MEMO_SAME]: `isMemoSame` 11551}; 11552function registerRuntimeHelpers(helpers) { 11553 Object.getOwnPropertySymbols(helpers).forEach((s) => { 11554 helperNameMap[s] = helpers[s]; 11555 }); 11556} 11557var locStub = { 11558 start: { line: 1, column: 1, offset: 0 }, 11559 end: { line: 1, column: 1, offset: 0 }, 11560 source: "" 11561}; 11562function createRoot(children, source = "") { 11563 return { 11564 type: 0, 11565 source, 11566 children, 11567 helpers: /* @__PURE__ */ new Set(), 11568 components: [], 11569 directives: [], 11570 hoists: [], 11571 imports: [], 11572 cached: 0, 11573 temps: 0, 11574 codegenNode: void 0, 11575 loc: locStub 11576 }; 11577} 11578function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent2 = false, loc = locStub) { 11579 if (context) { 11580 if (isBlock) { 11581 context.helper(OPEN_BLOCK); 11582 context.helper(getVNodeBlockHelper(context.inSSR, isComponent2)); 11583 } else { 11584 context.helper(getVNodeHelper(context.inSSR, isComponent2)); 11585 } 11586 if (directives) { 11587 context.helper(WITH_DIRECTIVES); 11588 } 11589 } 11590 return { 11591 type: 13, 11592 tag, 11593 props, 11594 children, 11595 patchFlag, 11596 dynamicProps, 11597 directives, 11598 isBlock, 11599 disableTracking, 11600 isComponent: isComponent2, 11601 loc 11602 }; 11603} 11604function createArrayExpression(elements, loc = locStub) { 11605 return { 11606 type: 17, 11607 loc, 11608 elements 11609 }; 11610} 11611function createObjectExpression(properties, loc = locStub) { 11612 return { 11613 type: 15, 11614 loc, 11615 properties 11616 }; 11617} 11618function createObjectProperty(key, value) { 11619 return { 11620 type: 16, 11621 loc: locStub, 11622 key: isString(key) ? createSimpleExpression(key, true) : key, 11623 value 11624 }; 11625} 11626function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { 11627 return { 11628 type: 4, 11629 loc, 11630 content, 11631 isStatic, 11632 constType: isStatic ? 3 : constType 11633 }; 11634} 11635function createCompoundExpression(children, loc = locStub) { 11636 return { 11637 type: 8, 11638 loc, 11639 children 11640 }; 11641} 11642function createCallExpression(callee, args = [], loc = locStub) { 11643 return { 11644 type: 14, 11645 loc, 11646 callee, 11647 arguments: args 11648 }; 11649} 11650function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { 11651 return { 11652 type: 18, 11653 params, 11654 returns, 11655 newline, 11656 isSlot, 11657 loc 11658 }; 11659} 11660function createConditionalExpression(test, consequent, alternate, newline = true) { 11661 return { 11662 type: 19, 11663 test, 11664 consequent, 11665 alternate, 11666 newline, 11667 loc: locStub 11668 }; 11669} 11670function createCacheExpression(index, value, isVOnce = false) { 11671 return { 11672 type: 20, 11673 index, 11674 value, 11675 isVOnce, 11676 loc: locStub 11677 }; 11678} 11679function createBlockStatement(body) { 11680 return { 11681 type: 21, 11682 body, 11683 loc: locStub 11684 }; 11685} 11686function getVNodeHelper(ssr, isComponent2) { 11687 return ssr || isComponent2 ? CREATE_VNODE : CREATE_ELEMENT_VNODE; 11688} 11689function getVNodeBlockHelper(ssr, isComponent2) { 11690 return ssr || isComponent2 ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; 11691} 11692function convertToBlock(node, { helper, removeHelper, inSSR }) { 11693 if (!node.isBlock) { 11694 node.isBlock = true; 11695 removeHelper(getVNodeHelper(inSSR, node.isComponent)); 11696 helper(OPEN_BLOCK); 11697 helper(getVNodeBlockHelper(inSSR, node.isComponent)); 11698 } 11699} 11700var defaultDelimitersOpen = new Uint8Array([123, 123]); 11701var defaultDelimitersClose = new Uint8Array([125, 125]); 11702function isTagStartChar(c) { 11703 return c >= 97 && c <= 122 || c >= 65 && c <= 90; 11704} 11705function isWhitespace(c) { 11706 return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; 11707} 11708function isEndOfTagSection(c) { 11709 return c === 47 || c === 62 || isWhitespace(c); 11710} 11711function toCharCodes(str) { 11712 const ret = new Uint8Array(str.length); 11713 for (let i = 0; i < str.length; i++) { 11714 ret[i] = str.charCodeAt(i); 11715 } 11716 return ret; 11717} 11718var Sequences = { 11719 Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), 11720 // CDATA[ 11721 CdataEnd: new Uint8Array([93, 93, 62]), 11722 // ]]> 11723 CommentEnd: new Uint8Array([45, 45, 62]), 11724 // `-->` 11725 ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), 11726 // `<\/script` 11727 StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), 11728 // `</style` 11729 TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), 11730 // `</title` 11731 TextareaEnd: new Uint8Array([ 11732 60, 11733 47, 11734 116, 11735 101, 11736 120, 11737 116, 11738 97, 11739 114, 11740 101, 11741 97 11742 ]) 11743 // `</textarea 11744}; 11745var Tokenizer = class { 11746 constructor(stack3, cbs) { 11747 this.stack = stack3; 11748 this.cbs = cbs; 11749 this.state = 1; 11750 this.buffer = ""; 11751 this.sectionStart = 0; 11752 this.index = 0; 11753 this.entityStart = 0; 11754 this.baseState = 1; 11755 this.inRCDATA = false; 11756 this.inXML = false; 11757 this.inVPre = false; 11758 this.newlines = []; 11759 this.mode = 0; 11760 this.delimiterOpen = defaultDelimitersOpen; 11761 this.delimiterClose = defaultDelimitersClose; 11762 this.delimiterIndex = -1; 11763 this.currentSequence = void 0; 11764 this.sequenceIndex = 0; 11765 } 11766 get inSFCRoot() { 11767 return this.mode === 2 && this.stack.length === 0; 11768 } 11769 reset() { 11770 this.state = 1; 11771 this.mode = 0; 11772 this.buffer = ""; 11773 this.sectionStart = 0; 11774 this.index = 0; 11775 this.baseState = 1; 11776 this.inRCDATA = false; 11777 this.currentSequence = void 0; 11778 this.newlines.length = 0; 11779 this.delimiterOpen = defaultDelimitersOpen; 11780 this.delimiterClose = defaultDelimitersClose; 11781 } 11782 /** 11783 * Generate Position object with line / column information using recorded 11784 * newline positions. We know the index is always going to be an already 11785 * processed index, so all the newlines up to this index should have been 11786 * recorded. 11787 */ 11788 getPos(index) { 11789 let line = 1; 11790 let column = index + 1; 11791 for (let i = this.newlines.length - 1; i >= 0; i--) { 11792 const newlineIndex = this.newlines[i]; 11793 if (index > newlineIndex) { 11794 line = i + 2; 11795 column = index - newlineIndex; 11796 break; 11797 } 11798 } 11799 return { 11800 column, 11801 line, 11802 offset: index 11803 }; 11804 } 11805 peek() { 11806 return this.buffer.charCodeAt(this.index + 1); 11807 } 11808 stateText(c) { 11809 if (c === 60) { 11810 if (this.index > this.sectionStart) { 11811 this.cbs.ontext(this.sectionStart, this.index); 11812 } 11813 this.state = 5; 11814 this.sectionStart = this.index; 11815 } else if (!this.inVPre && c === this.delimiterOpen[0]) { 11816 this.state = 2; 11817 this.delimiterIndex = 0; 11818 this.stateInterpolationOpen(c); 11819 } 11820 } 11821 stateInterpolationOpen(c) { 11822 if (c === this.delimiterOpen[this.delimiterIndex]) { 11823 if (this.delimiterIndex === this.delimiterOpen.length - 1) { 11824 const start = this.index + 1 - this.delimiterOpen.length; 11825 if (start > this.sectionStart) { 11826 this.cbs.ontext(this.sectionStart, start); 11827 } 11828 this.state = 3; 11829 this.sectionStart = start; 11830 } else { 11831 this.delimiterIndex++; 11832 } 11833 } else if (this.inRCDATA) { 11834 this.state = 32; 11835 this.stateInRCDATA(c); 11836 } else { 11837 this.state = 1; 11838 this.stateText(c); 11839 } 11840 } 11841 stateInterpolation(c) { 11842 if (c === this.delimiterClose[0]) { 11843 this.state = 4; 11844 this.delimiterIndex = 0; 11845 this.stateInterpolationClose(c); 11846 } 11847 } 11848 stateInterpolationClose(c) { 11849 if (c === this.delimiterClose[this.delimiterIndex]) { 11850 if (this.delimiterIndex === this.delimiterClose.length - 1) { 11851 this.cbs.oninterpolation(this.sectionStart, this.index + 1); 11852 if (this.inRCDATA) { 11853 this.state = 32; 11854 } else { 11855 this.state = 1; 11856 } 11857 this.sectionStart = this.index + 1; 11858 } else { 11859 this.delimiterIndex++; 11860 } 11861 } else { 11862 this.state = 3; 11863 this.stateInterpolation(c); 11864 } 11865 } 11866 stateSpecialStartSequence(c) { 11867 const isEnd = this.sequenceIndex === this.currentSequence.length; 11868 const isMatch = isEnd ? ( 11869 // If we are at the end of the sequence, make sure the tag name has ended 11870 isEndOfTagSection(c) 11871 ) : ( 11872 // Otherwise, do a case-insensitive comparison 11873 (c | 32) === this.currentSequence[this.sequenceIndex] 11874 ); 11875 if (!isMatch) { 11876 this.inRCDATA = false; 11877 } else if (!isEnd) { 11878 this.sequenceIndex++; 11879 return; 11880 } 11881 this.sequenceIndex = 0; 11882 this.state = 6; 11883 this.stateInTagName(c); 11884 } 11885 /** Look for an end tag. For <title> and <textarea>, also decode entities. */ 11886 stateInRCDATA(c) { 11887 if (this.sequenceIndex === this.currentSequence.length) { 11888 if (c === 62 || isWhitespace(c)) { 11889 const endOfText = this.index - this.currentSequence.length; 11890 if (this.sectionStart < endOfText) { 11891 const actualIndex = this.index; 11892 this.index = endOfText; 11893 this.cbs.ontext(this.sectionStart, endOfText); 11894 this.index = actualIndex; 11895 } 11896 this.sectionStart = endOfText + 2; 11897 this.stateInClosingTagName(c); 11898 this.inRCDATA = false; 11899 return; 11900 } 11901 this.sequenceIndex = 0; 11902 } 11903 if ((c | 32) === this.currentSequence[this.sequenceIndex]) { 11904 this.sequenceIndex += 1; 11905 } else if (this.sequenceIndex === 0) { 11906 if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { 11907 if (c === this.delimiterOpen[0]) { 11908 this.state = 2; 11909 this.delimiterIndex = 0; 11910 this.stateInterpolationOpen(c); 11911 } 11912 } else if (this.fastForwardTo(60)) { 11913 this.sequenceIndex = 1; 11914 } 11915 } else { 11916 this.sequenceIndex = Number(c === 60); 11917 } 11918 } 11919 stateCDATASequence(c) { 11920 if (c === Sequences.Cdata[this.sequenceIndex]) { 11921 if (++this.sequenceIndex === Sequences.Cdata.length) { 11922 this.state = 28; 11923 this.currentSequence = Sequences.CdataEnd; 11924 this.sequenceIndex = 0; 11925 this.sectionStart = this.index + 1; 11926 } 11927 } else { 11928 this.sequenceIndex = 0; 11929 this.state = 23; 11930 this.stateInDeclaration(c); 11931 } 11932 } 11933 /** 11934 * When we wait for one specific character, we can speed things up 11935 * by skipping through the buffer until we find it. 11936 * 11937 * @returns Whether the character was found. 11938 */ 11939 fastForwardTo(c) { 11940 while (++this.index < this.buffer.length) { 11941 const cc = this.buffer.charCodeAt(this.index); 11942 if (cc === 10) { 11943 this.newlines.push(this.index); 11944 } 11945 if (cc === c) { 11946 return true; 11947 } 11948 } 11949 this.index = this.buffer.length - 1; 11950 return false; 11951 } 11952 /** 11953 * Comments and CDATA end with `-->` and `]]>`. 11954 * 11955 * Their common qualities are: 11956 * - Their end sequences have a distinct character they start with. 11957 * - That character is then repeated, so we have to check multiple repeats. 11958 * - All characters but the start character of the sequence can be skipped. 11959 */ 11960 stateInCommentLike(c) { 11961 if (c === this.currentSequence[this.sequenceIndex]) { 11962 if (++this.sequenceIndex === this.currentSequence.length) { 11963 if (this.currentSequence === Sequences.CdataEnd) { 11964 this.cbs.oncdata(this.sectionStart, this.index - 2); 11965 } else { 11966 this.cbs.oncomment(this.sectionStart, this.index - 2); 11967 } 11968 this.sequenceIndex = 0; 11969 this.sectionStart = this.index + 1; 11970 this.state = 1; 11971 } 11972 } else if (this.sequenceIndex === 0) { 11973 if (this.fastForwardTo(this.currentSequence[0])) { 11974 this.sequenceIndex = 1; 11975 } 11976 } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { 11977 this.sequenceIndex = 0; 11978 } 11979 } 11980 startSpecial(sequence, offset) { 11981 this.enterRCDATA(sequence, offset); 11982 this.state = 31; 11983 } 11984 enterRCDATA(sequence, offset) { 11985 this.inRCDATA = true; 11986 this.currentSequence = sequence; 11987 this.sequenceIndex = offset; 11988 } 11989 stateBeforeTagName(c) { 11990 if (c === 33) { 11991 this.state = 22; 11992 this.sectionStart = this.index + 1; 11993 } else if (c === 63) { 11994 this.state = 24; 11995 this.sectionStart = this.index + 1; 11996 } else if (isTagStartChar(c)) { 11997 this.sectionStart = this.index; 11998 if (this.mode === 0) { 11999 this.state = 6; 12000 } else if (this.inSFCRoot) { 12001 this.state = 34; 12002 } else if (!this.inXML) { 12003 if (c === 116) { 12004 this.state = 30; 12005 } else { 12006 this.state = c === 115 ? 29 : 6; 12007 } 12008 } else { 12009 this.state = 6; 12010 } 12011 } else if (c === 47) { 12012 this.state = 8; 12013 } else { 12014 this.state = 1; 12015 this.stateText(c); 12016 } 12017 } 12018 stateInTagName(c) { 12019 if (isEndOfTagSection(c)) { 12020 this.handleTagName(c); 12021 } 12022 } 12023 stateInSFCRootTagName(c) { 12024 if (isEndOfTagSection(c)) { 12025 const tag = this.buffer.slice(this.sectionStart, this.index); 12026 if (tag !== "template") { 12027 this.enterRCDATA(toCharCodes(`</` + tag), 0); 12028 } 12029 this.handleTagName(c); 12030 } 12031 } 12032 handleTagName(c) { 12033 this.cbs.onopentagname(this.sectionStart, this.index); 12034 this.sectionStart = -1; 12035 this.state = 11; 12036 this.stateBeforeAttrName(c); 12037 } 12038 stateBeforeClosingTagName(c) { 12039 if (isWhitespace(c)) ; 12040 else if (c === 62) { 12041 if (true) { 12042 this.cbs.onerr(14, this.index); 12043 } 12044 this.state = 1; 12045 this.sectionStart = this.index + 1; 12046 } else { 12047 this.state = isTagStartChar(c) ? 9 : 27; 12048 this.sectionStart = this.index; 12049 } 12050 } 12051 stateInClosingTagName(c) { 12052 if (c === 62 || isWhitespace(c)) { 12053 this.cbs.onclosetag(this.sectionStart, this.index); 12054 this.sectionStart = -1; 12055 this.state = 10; 12056 this.stateAfterClosingTagName(c); 12057 } 12058 } 12059 stateAfterClosingTagName(c) { 12060 if (c === 62) { 12061 this.state = 1; 12062 this.sectionStart = this.index + 1; 12063 } 12064 } 12065 stateBeforeAttrName(c) { 12066 if (c === 62) { 12067 this.cbs.onopentagend(this.index); 12068 if (this.inRCDATA) { 12069 this.state = 32; 12070 } else { 12071 this.state = 1; 12072 } 12073 this.sectionStart = this.index + 1; 12074 } else if (c === 47) { 12075 this.state = 7; 12076 if (this.peek() !== 62) { 12077 this.cbs.onerr(22, this.index); 12078 } 12079 } else if (c === 60 && this.peek() === 47) { 12080 this.cbs.onopentagend(this.index); 12081 this.state = 5; 12082 this.sectionStart = this.index; 12083 } else if (!isWhitespace(c)) { 12084 if (c === 61) { 12085 this.cbs.onerr( 12086 19, 12087 this.index 12088 ); 12089 } 12090 this.handleAttrStart(c); 12091 } 12092 } 12093 handleAttrStart(c) { 12094 if (c === 118 && this.peek() === 45) { 12095 this.state = 13; 12096 this.sectionStart = this.index; 12097 } else if (c === 46 || c === 58 || c === 64 || c === 35) { 12098 this.cbs.ondirname(this.index, this.index + 1); 12099 this.state = 14; 12100 this.sectionStart = this.index + 1; 12101 } else { 12102 this.state = 12; 12103 this.sectionStart = this.index; 12104 } 12105 } 12106 stateInSelfClosingTag(c) { 12107 if (c === 62) { 12108 this.cbs.onselfclosingtag(this.index); 12109 this.state = 1; 12110 this.sectionStart = this.index + 1; 12111 this.inRCDATA = false; 12112 } else if (!isWhitespace(c)) { 12113 this.state = 11; 12114 this.stateBeforeAttrName(c); 12115 } 12116 } 12117 stateInAttrName(c) { 12118 if (c === 61 || isEndOfTagSection(c)) { 12119 this.cbs.onattribname(this.sectionStart, this.index); 12120 this.handleAttrNameEnd(c); 12121 } else if (c === 34 || c === 39 || c === 60) { 12122 this.cbs.onerr( 12123 17, 12124 this.index 12125 ); 12126 } 12127 } 12128 stateInDirName(c) { 12129 if (c === 61 || isEndOfTagSection(c)) { 12130 this.cbs.ondirname(this.sectionStart, this.index); 12131 this.handleAttrNameEnd(c); 12132 } else if (c === 58) { 12133 this.cbs.ondirname(this.sectionStart, this.index); 12134 this.state = 14; 12135 this.sectionStart = this.index + 1; 12136 } else if (c === 46) { 12137 this.cbs.ondirname(this.sectionStart, this.index); 12138 this.state = 16; 12139 this.sectionStart = this.index + 1; 12140 } 12141 } 12142 stateInDirArg(c) { 12143 if (c === 61 || isEndOfTagSection(c)) { 12144 this.cbs.ondirarg(this.sectionStart, this.index); 12145 this.handleAttrNameEnd(c); 12146 } else if (c === 91) { 12147 this.state = 15; 12148 } else if (c === 46) { 12149 this.cbs.ondirarg(this.sectionStart, this.index); 12150 this.state = 16; 12151 this.sectionStart = this.index + 1; 12152 } 12153 } 12154 stateInDynamicDirArg(c) { 12155 if (c === 93) { 12156 this.state = 14; 12157 } else if (c === 61 || isEndOfTagSection(c)) { 12158 this.cbs.ondirarg(this.sectionStart, this.index + 1); 12159 this.handleAttrNameEnd(c); 12160 if (true) { 12161 this.cbs.onerr( 12162 27, 12163 this.index 12164 ); 12165 } 12166 } 12167 } 12168 stateInDirModifier(c) { 12169 if (c === 61 || isEndOfTagSection(c)) { 12170 this.cbs.ondirmodifier(this.sectionStart, this.index); 12171 this.handleAttrNameEnd(c); 12172 } else if (c === 46) { 12173 this.cbs.ondirmodifier(this.sectionStart, this.index); 12174 this.sectionStart = this.index + 1; 12175 } 12176 } 12177 handleAttrNameEnd(c) { 12178 this.sectionStart = this.index; 12179 this.state = 17; 12180 this.cbs.onattribnameend(this.index); 12181 this.stateAfterAttrName(c); 12182 } 12183 stateAfterAttrName(c) { 12184 if (c === 61) { 12185 this.state = 18; 12186 } else if (c === 47 || c === 62) { 12187 this.cbs.onattribend(0, this.sectionStart); 12188 this.sectionStart = -1; 12189 this.state = 11; 12190 this.stateBeforeAttrName(c); 12191 } else if (!isWhitespace(c)) { 12192 this.cbs.onattribend(0, this.sectionStart); 12193 this.handleAttrStart(c); 12194 } 12195 } 12196 stateBeforeAttrValue(c) { 12197 if (c === 34) { 12198 this.state = 19; 12199 this.sectionStart = this.index + 1; 12200 } else if (c === 39) { 12201 this.state = 20; 12202 this.sectionStart = this.index + 1; 12203 } else if (!isWhitespace(c)) { 12204 this.sectionStart = this.index; 12205 this.state = 21; 12206 this.stateInAttrValueNoQuotes(c); 12207 } 12208 } 12209 handleInAttrValue(c, quote) { 12210 if (c === quote || this.fastForwardTo(quote)) { 12211 this.cbs.onattribdata(this.sectionStart, this.index); 12212 this.sectionStart = -1; 12213 this.cbs.onattribend( 12214 quote === 34 ? 3 : 2, 12215 this.index + 1 12216 ); 12217 this.state = 11; 12218 } 12219 } 12220 stateInAttrValueDoubleQuotes(c) { 12221 this.handleInAttrValue(c, 34); 12222 } 12223 stateInAttrValueSingleQuotes(c) { 12224 this.handleInAttrValue(c, 39); 12225 } 12226 stateInAttrValueNoQuotes(c) { 12227 if (isWhitespace(c) || c === 62) { 12228 this.cbs.onattribdata(this.sectionStart, this.index); 12229 this.sectionStart = -1; 12230 this.cbs.onattribend(1, this.index); 12231 this.state = 11; 12232 this.stateBeforeAttrName(c); 12233 } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { 12234 this.cbs.onerr( 12235 18, 12236 this.index 12237 ); 12238 } else ; 12239 } 12240 stateBeforeDeclaration(c) { 12241 if (c === 91) { 12242 this.state = 26; 12243 this.sequenceIndex = 0; 12244 } else { 12245 this.state = c === 45 ? 25 : 23; 12246 } 12247 } 12248 stateInDeclaration(c) { 12249 if (c === 62 || this.fastForwardTo(62)) { 12250 this.state = 1; 12251 this.sectionStart = this.index + 1; 12252 } 12253 } 12254 stateInProcessingInstruction(c) { 12255 if (c === 62 || this.fastForwardTo(62)) { 12256 this.cbs.onprocessinginstruction(this.sectionStart, this.index); 12257 this.state = 1; 12258 this.sectionStart = this.index + 1; 12259 } 12260 } 12261 stateBeforeComment(c) { 12262 if (c === 45) { 12263 this.state = 28; 12264 this.currentSequence = Sequences.CommentEnd; 12265 this.sequenceIndex = 2; 12266 this.sectionStart = this.index + 1; 12267 } else { 12268 this.state = 23; 12269 } 12270 } 12271 stateInSpecialComment(c) { 12272 if (c === 62 || this.fastForwardTo(62)) { 12273 this.cbs.oncomment(this.sectionStart, this.index); 12274 this.state = 1; 12275 this.sectionStart = this.index + 1; 12276 } 12277 } 12278 stateBeforeSpecialS(c) { 12279 if (c === Sequences.ScriptEnd[3]) { 12280 this.startSpecial(Sequences.ScriptEnd, 4); 12281 } else if (c === Sequences.StyleEnd[3]) { 12282 this.startSpecial(Sequences.StyleEnd, 4); 12283 } else { 12284 this.state = 6; 12285 this.stateInTagName(c); 12286 } 12287 } 12288 stateBeforeSpecialT(c) { 12289 if (c === Sequences.TitleEnd[3]) { 12290 this.startSpecial(Sequences.TitleEnd, 4); 12291 } else if (c === Sequences.TextareaEnd[3]) { 12292 this.startSpecial(Sequences.TextareaEnd, 4); 12293 } else { 12294 this.state = 6; 12295 this.stateInTagName(c); 12296 } 12297 } 12298 startEntity() { 12299 } 12300 stateInEntity() { 12301 } 12302 /** 12303 * Iterates through the buffer, calling the function corresponding to the current state. 12304 * 12305 * States that are more likely to be hit are higher up, as a performance improvement. 12306 */ 12307 parse(input) { 12308 this.buffer = input; 12309 while (this.index < this.buffer.length) { 12310 const c = this.buffer.charCodeAt(this.index); 12311 if (c === 10) { 12312 this.newlines.push(this.index); 12313 } 12314 switch (this.state) { 12315 case 1: { 12316 this.stateText(c); 12317 break; 12318 } 12319 case 2: { 12320 this.stateInterpolationOpen(c); 12321 break; 12322 } 12323 case 3: { 12324 this.stateInterpolation(c); 12325 break; 12326 } 12327 case 4: { 12328 this.stateInterpolationClose(c); 12329 break; 12330 } 12331 case 31: { 12332 this.stateSpecialStartSequence(c); 12333 break; 12334 } 12335 case 32: { 12336 this.stateInRCDATA(c); 12337 break; 12338 } 12339 case 26: { 12340 this.stateCDATASequence(c); 12341 break; 12342 } 12343 case 19: { 12344 this.stateInAttrValueDoubleQuotes(c); 12345 break; 12346 } 12347 case 12: { 12348 this.stateInAttrName(c); 12349 break; 12350 } 12351 case 13: { 12352 this.stateInDirName(c); 12353 break; 12354 } 12355 case 14: { 12356 this.stateInDirArg(c); 12357 break; 12358 } 12359 case 15: { 12360 this.stateInDynamicDirArg(c); 12361 break; 12362 } 12363 case 16: { 12364 this.stateInDirModifier(c); 12365 break; 12366 } 12367 case 28: { 12368 this.stateInCommentLike(c); 12369 break; 12370 } 12371 case 27: { 12372 this.stateInSpecialComment(c); 12373 break; 12374 } 12375 case 11: { 12376 this.stateBeforeAttrName(c); 12377 break; 12378 } 12379 case 6: { 12380 this.stateInTagName(c); 12381 break; 12382 } 12383 case 34: { 12384 this.stateInSFCRootTagName(c); 12385 break; 12386 } 12387 case 9: { 12388 this.stateInClosingTagName(c); 12389 break; 12390 } 12391 case 5: { 12392 this.stateBeforeTagName(c); 12393 break; 12394 } 12395 case 17: { 12396 this.stateAfterAttrName(c); 12397 break; 12398 } 12399 case 20: { 12400 this.stateInAttrValueSingleQuotes(c); 12401 break; 12402 } 12403 case 18: { 12404 this.stateBeforeAttrValue(c); 12405 break; 12406 } 12407 case 8: { 12408 this.stateBeforeClosingTagName(c); 12409 break; 12410 } 12411 case 10: { 12412 this.stateAfterClosingTagName(c); 12413 break; 12414 } 12415 case 29: { 12416 this.stateBeforeSpecialS(c); 12417 break; 12418 } 12419 case 30: { 12420 this.stateBeforeSpecialT(c); 12421 break; 12422 } 12423 case 21: { 12424 this.stateInAttrValueNoQuotes(c); 12425 break; 12426 } 12427 case 7: { 12428 this.stateInSelfClosingTag(c); 12429 break; 12430 } 12431 case 23: { 12432 this.stateInDeclaration(c); 12433 break; 12434 } 12435 case 22: { 12436 this.stateBeforeDeclaration(c); 12437 break; 12438 } 12439 case 25: { 12440 this.stateBeforeComment(c); 12441 break; 12442 } 12443 case 24: { 12444 this.stateInProcessingInstruction(c); 12445 break; 12446 } 12447 case 33: { 12448 this.stateInEntity(); 12449 break; 12450 } 12451 } 12452 this.index++; 12453 } 12454 this.cleanup(); 12455 this.finish(); 12456 } 12457 /** 12458 * Remove data that has already been consumed from the buffer. 12459 */ 12460 cleanup() { 12461 if (this.sectionStart !== this.index) { 12462 if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { 12463 this.cbs.ontext(this.sectionStart, this.index); 12464 this.sectionStart = this.index; 12465 } else if (this.state === 19 || this.state === 20 || this.state === 21) { 12466 this.cbs.onattribdata(this.sectionStart, this.index); 12467 this.sectionStart = this.index; 12468 } 12469 } 12470 } 12471 finish() { 12472 this.handleTrailingData(); 12473 this.cbs.onend(); 12474 } 12475 /** Handle any trailing data. */ 12476 handleTrailingData() { 12477 const endIndex = this.buffer.length; 12478 if (this.sectionStart >= endIndex) { 12479 return; 12480 } 12481 if (this.state === 28) { 12482 if (this.currentSequence === Sequences.CdataEnd) { 12483 this.cbs.oncdata(this.sectionStart, endIndex); 12484 } else { 12485 this.cbs.oncomment(this.sectionStart, endIndex); 12486 } 12487 } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; 12488 else { 12489 this.cbs.ontext(this.sectionStart, endIndex); 12490 } 12491 } 12492 emitCodePoint(cp, consumed) { 12493 } 12494}; 12495var deprecationData = { 12496 ["COMPILER_IS_ON_ELEMENT"]: { 12497 message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, 12498 link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` 12499 }, 12500 ["COMPILER_V_BIND_SYNC"]: { 12501 message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, 12502 link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` 12503 }, 12504 ["COMPILER_V_BIND_OBJECT_ORDER"]: { 12505 message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, 12506 link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` 12507 }, 12508 ["COMPILER_V_ON_NATIVE"]: { 12509 message: `.native modifier for v-on has been removed as is no longer necessary.`, 12510 link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` 12511 }, 12512 ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { 12513 message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, 12514 link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` 12515 }, 12516 ["COMPILER_NATIVE_TEMPLATE"]: { 12517 message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` 12518 }, 12519 ["COMPILER_INLINE_TEMPLATE"]: { 12520 message: `"inline-template" has been removed in Vue 3.`, 12521 link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` 12522 }, 12523 ["COMPILER_FILTERS"]: { 12524 message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, 12525 link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` 12526 } 12527}; 12528function getCompatValue(key, { compatConfig }) { 12529 const value = compatConfig && compatConfig[key]; 12530 if (key === "MODE") { 12531 return value || 3; 12532 } else { 12533 return value; 12534 } 12535} 12536function isCompatEnabled(key, context) { 12537 const mode = getCompatValue("MODE", context); 12538 const value = getCompatValue(key, context); 12539 return mode === 3 ? value === true : value !== false; 12540} 12541function checkCompatEnabled(key, context, loc, ...args) { 12542 const enabled = isCompatEnabled(key, context); 12543 if (enabled) { 12544 warnDeprecation(key, context, loc, ...args); 12545 } 12546 return enabled; 12547} 12548function warnDeprecation(key, context, loc, ...args) { 12549 const val = getCompatValue(key, context); 12550 if (val === "suppress-warning") { 12551 return; 12552 } 12553 const { message, link } = deprecationData[key]; 12554 const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` 12555 Details: ${link}` : ``}`; 12556 const err = new SyntaxError(msg); 12557 err.code = key; 12558 if (loc) err.loc = loc; 12559 context.onWarn(err); 12560} 12561function defaultOnError(error) { 12562 throw error; 12563} 12564function defaultOnWarn(msg) { 12565 console.warn(`[Vue warn] ${msg.message}`); 12566} 12567function createCompilerError(code, loc, messages, additionalMessage) { 12568 const msg = true ? (messages || errorMessages)[code] + (additionalMessage || ``) : `https://vuejs.org/error-reference/#compiler-${code}`; 12569 const error = new SyntaxError(String(msg)); 12570 error.code = code; 12571 error.loc = loc; 12572 return error; 12573} 12574var errorMessages = { 12575 // parse errors 12576 [0]: "Illegal comment.", 12577 [1]: "CDATA section is allowed only in XML context.", 12578 [2]: "Duplicate attribute.", 12579 [3]: "End tag cannot have attributes.", 12580 [4]: "Illegal '/' in tags.", 12581 [5]: "Unexpected EOF in tag.", 12582 [6]: "Unexpected EOF in CDATA section.", 12583 [7]: "Unexpected EOF in comment.", 12584 [8]: "Unexpected EOF in script.", 12585 [9]: "Unexpected EOF in tag.", 12586 [10]: "Incorrectly closed comment.", 12587 [11]: "Incorrectly opened comment.", 12588 [12]: "Illegal tag name. Use '<' to print '<'.", 12589 [13]: "Attribute value was expected.", 12590 [14]: "End tag name was expected.", 12591 [15]: "Whitespace was expected.", 12592 [16]: "Unexpected '<!--' in comment.", 12593 [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, 12594 [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", 12595 [19]: "Attribute name cannot start with '='.", 12596 [21]: "'<?' is allowed only in XML context.", 12597 [20]: `Unexpected null character.`, 12598 [22]: "Illegal '/' in tags.", 12599 // Vue-specific parse errors 12600 [23]: "Invalid end tag.", 12601 [24]: "Element is missing end tag.", 12602 [25]: "Interpolation end sign was not found.", 12603 [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", 12604 [26]: "Legal directive name was expected.", 12605 // transform errors 12606 [28]: `v-if/v-else-if is missing expression.`, 12607 [29]: `v-if/else branches must use unique keys.`, 12608 [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, 12609 [31]: `v-for is missing expression.`, 12610 [32]: `v-for has invalid expression.`, 12611 [33]: `<template v-for> key should be placed on the <template> tag.`, 12612 [34]: `v-bind is missing expression.`, 12613 [52]: `v-bind with same-name shorthand only allows static argument.`, 12614 [35]: `v-on is missing expression.`, 12615 [36]: `Unexpected custom directive on <slot> outlet.`, 12616 [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, 12617 [38]: `Duplicate slot names found. `, 12618 [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, 12619 [40]: `v-slot can only be used on components or <template> tags.`, 12620 [41]: `v-model is missing expression.`, 12621 [42]: `v-model value must be a valid JavaScript member expression.`, 12622 [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, 12623 [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. 12624Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, 12625 [45]: `Error parsing JavaScript expression: `, 12626 [46]: `<KeepAlive> expects exactly one child component.`, 12627 [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, 12628 // generic errors 12629 [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, 12630 [48]: `ES module mode is not supported in this build of compiler.`, 12631 [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, 12632 [50]: `"scopeId" option is only supported in module mode.`, 12633 // just to fulfill types 12634 [53]: `` 12635}; 12636var isStaticExp = (p2) => p2.type === 4 && p2.isStatic; 12637function isCoreComponent(tag) { 12638 switch (tag) { 12639 case "Teleport": 12640 case "teleport": 12641 return TELEPORT; 12642 case "Suspense": 12643 case "suspense": 12644 return SUSPENSE; 12645 case "KeepAlive": 12646 case "keep-alive": 12647 return KEEP_ALIVE; 12648 case "BaseTransition": 12649 case "base-transition": 12650 return BASE_TRANSITION; 12651 } 12652} 12653var nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; 12654var isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); 12655var validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; 12656var validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; 12657var whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; 12658var isMemberExpressionBrowser = (path) => { 12659 path = path.trim().replace(whitespaceRE, (s) => s.trim()); 12660 let state = 0; 12661 let stateStack = []; 12662 let currentOpenBracketCount = 0; 12663 let currentOpenParensCount = 0; 12664 let currentStringType = null; 12665 for (let i = 0; i < path.length; i++) { 12666 const char = path.charAt(i); 12667 switch (state) { 12668 case 0: 12669 if (char === "[") { 12670 stateStack.push(state); 12671 state = 1; 12672 currentOpenBracketCount++; 12673 } else if (char === "(") { 12674 stateStack.push(state); 12675 state = 2; 12676 currentOpenParensCount++; 12677 } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { 12678 return false; 12679 } 12680 break; 12681 case 1: 12682 if (char === `'` || char === `"` || char === "`") { 12683 stateStack.push(state); 12684 state = 3; 12685 currentStringType = char; 12686 } else if (char === `[`) { 12687 currentOpenBracketCount++; 12688 } else if (char === `]`) { 12689 if (!--currentOpenBracketCount) { 12690 state = stateStack.pop(); 12691 } 12692 } 12693 break; 12694 case 2: 12695 if (char === `'` || char === `"` || char === "`") { 12696 stateStack.push(state); 12697 state = 3; 12698 currentStringType = char; 12699 } else if (char === `(`) { 12700 currentOpenParensCount++; 12701 } else if (char === `)`) { 12702 if (i === path.length - 1) { 12703 return false; 12704 } 12705 if (!--currentOpenParensCount) { 12706 state = stateStack.pop(); 12707 } 12708 } 12709 break; 12710 case 3: 12711 if (char === currentStringType) { 12712 state = stateStack.pop(); 12713 currentStringType = null; 12714 } 12715 break; 12716 } 12717 } 12718 return !currentOpenBracketCount && !currentOpenParensCount; 12719}; 12720var isMemberExpression = isMemberExpressionBrowser; 12721function assert(condition, msg) { 12722 if (!condition) { 12723 throw new Error(msg || `unexpected compiler condition`); 12724 } 12725} 12726function findDir(node, name, allowEmpty = false) { 12727 for (let i = 0; i < node.props.length; i++) { 12728 const p2 = node.props[i]; 12729 if (p2.type === 7 && (allowEmpty || p2.exp) && (isString(name) ? p2.name === name : name.test(p2.name))) { 12730 return p2; 12731 } 12732 } 12733} 12734function findProp(node, name, dynamicOnly = false, allowEmpty = false) { 12735 for (let i = 0; i < node.props.length; i++) { 12736 const p2 = node.props[i]; 12737 if (p2.type === 6) { 12738 if (dynamicOnly) continue; 12739 if (p2.name === name && (p2.value || allowEmpty)) { 12740 return p2; 12741 } 12742 } else if (p2.name === "bind" && (p2.exp || allowEmpty) && isStaticArgOf(p2.arg, name)) { 12743 return p2; 12744 } 12745 } 12746} 12747function isStaticArgOf(arg, name) { 12748 return !!(arg && isStaticExp(arg) && arg.content === name); 12749} 12750function hasDynamicKeyVBind(node) { 12751 return node.props.some( 12752 (p2) => p2.type === 7 && p2.name === "bind" && (!p2.arg || // v-bind="obj" 12753 p2.arg.type !== 4 || // v-bind:[_ctx.foo] 12754 !p2.arg.isStatic) 12755 // v-bind:[foo] 12756 ); 12757} 12758function isText$1(node) { 12759 return node.type === 5 || node.type === 2; 12760} 12761function isVSlot(p2) { 12762 return p2.type === 7 && p2.name === "slot"; 12763} 12764function isTemplateNode(node) { 12765 return node.type === 1 && node.tagType === 3; 12766} 12767function isSlotOutlet(node) { 12768 return node.type === 1 && node.tagType === 2; 12769} 12770var propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); 12771function getUnnormalizedProps(props, callPath = []) { 12772 if (props && !isString(props) && props.type === 14) { 12773 const callee = props.callee; 12774 if (!isString(callee) && propsHelperSet.has(callee)) { 12775 return getUnnormalizedProps( 12776 props.arguments[0], 12777 callPath.concat(props) 12778 ); 12779 } 12780 } 12781 return [props, callPath]; 12782} 12783function injectProp(node, prop, context) { 12784 let propsWithInjection; 12785 let props = node.type === 13 ? node.props : node.arguments[2]; 12786 let callPath = []; 12787 let parentCall; 12788 if (props && !isString(props) && props.type === 14) { 12789 const ret = getUnnormalizedProps(props); 12790 props = ret[0]; 12791 callPath = ret[1]; 12792 parentCall = callPath[callPath.length - 1]; 12793 } 12794 if (props == null || isString(props)) { 12795 propsWithInjection = createObjectExpression([prop]); 12796 } else if (props.type === 14) { 12797 const first = props.arguments[0]; 12798 if (!isString(first) && first.type === 15) { 12799 if (!hasProp(prop, first)) { 12800 first.properties.unshift(prop); 12801 } 12802 } else { 12803 if (props.callee === TO_HANDLERS) { 12804 propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ 12805 createObjectExpression([prop]), 12806 props 12807 ]); 12808 } else { 12809 props.arguments.unshift(createObjectExpression([prop])); 12810 } 12811 } 12812 !propsWithInjection && (propsWithInjection = props); 12813 } else if (props.type === 15) { 12814 if (!hasProp(prop, props)) { 12815 props.properties.unshift(prop); 12816 } 12817 propsWithInjection = props; 12818 } else { 12819 propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ 12820 createObjectExpression([prop]), 12821 props 12822 ]); 12823 if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { 12824 parentCall = callPath[callPath.length - 2]; 12825 } 12826 } 12827 if (node.type === 13) { 12828 if (parentCall) { 12829 parentCall.arguments[0] = propsWithInjection; 12830 } else { 12831 node.props = propsWithInjection; 12832 } 12833 } else { 12834 if (parentCall) { 12835 parentCall.arguments[0] = propsWithInjection; 12836 } else { 12837 node.arguments[2] = propsWithInjection; 12838 } 12839 } 12840} 12841function hasProp(prop, props) { 12842 let result = false; 12843 if (prop.key.type === 4) { 12844 const propKeyName = prop.key.content; 12845 result = props.properties.some( 12846 (p2) => p2.key.type === 4 && p2.key.content === propKeyName 12847 ); 12848 } 12849 return result; 12850} 12851function toValidAssetId(name, type) { 12852 return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { 12853 return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); 12854 })}`; 12855} 12856function getMemoedVNodeCall(node) { 12857 if (node.type === 14 && node.callee === WITH_MEMO) { 12858 return node.arguments[1].returns; 12859 } else { 12860 return node; 12861 } 12862} 12863var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; 12864var defaultParserOptions = { 12865 parseMode: "base", 12866 ns: 0, 12867 delimiters: [`{{`, `}}`], 12868 getNamespace: () => 0, 12869 isVoidTag: NO, 12870 isPreTag: NO, 12871 isCustomElement: NO, 12872 onError: defaultOnError, 12873 onWarn: defaultOnWarn, 12874 comments: true, 12875 prefixIdentifiers: false 12876}; 12877var currentOptions = defaultParserOptions; 12878var currentRoot = null; 12879var currentInput = ""; 12880var currentOpenTag = null; 12881var currentProp = null; 12882var currentAttrValue = ""; 12883var currentAttrStartIndex = -1; 12884var currentAttrEndIndex = -1; 12885var inPre = 0; 12886var inVPre = false; 12887var currentVPreBoundary = null; 12888var stack2 = []; 12889var tokenizer = new Tokenizer(stack2, { 12890 onerr: emitError, 12891 ontext(start, end) { 12892 onText(getSlice(start, end), start, end); 12893 }, 12894 ontextentity(char, start, end) { 12895 onText(char, start, end); 12896 }, 12897 oninterpolation(start, end) { 12898 if (inVPre) { 12899 return onText(getSlice(start, end), start, end); 12900 } 12901 let innerStart = start + tokenizer.delimiterOpen.length; 12902 let innerEnd = end - tokenizer.delimiterClose.length; 12903 while (isWhitespace(currentInput.charCodeAt(innerStart))) { 12904 innerStart++; 12905 } 12906 while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { 12907 innerEnd--; 12908 } 12909 let exp = getSlice(innerStart, innerEnd); 12910 if (exp.includes("&")) { 12911 { 12912 exp = currentOptions.decodeEntities(exp, false); 12913 } 12914 } 12915 addNode({ 12916 type: 5, 12917 content: createExp(exp, false, getLoc(innerStart, innerEnd)), 12918 loc: getLoc(start, end) 12919 }); 12920 }, 12921 onopentagname(start, end) { 12922 const name = getSlice(start, end); 12923 currentOpenTag = { 12924 type: 1, 12925 tag: name, 12926 ns: currentOptions.getNamespace(name, stack2[0], currentOptions.ns), 12927 tagType: 0, 12928 // will be refined on tag close 12929 props: [], 12930 children: [], 12931 loc: getLoc(start - 1, end), 12932 codegenNode: void 0 12933 }; 12934 }, 12935 onopentagend(end) { 12936 endOpenTag(end); 12937 }, 12938 onclosetag(start, end) { 12939 const name = getSlice(start, end); 12940 if (!currentOptions.isVoidTag(name)) { 12941 let found = false; 12942 for (let i = 0; i < stack2.length; i++) { 12943 const e = stack2[i]; 12944 if (e.tag.toLowerCase() === name.toLowerCase()) { 12945 found = true; 12946 if (i > 0) { 12947 emitError(24, stack2[0].loc.start.offset); 12948 } 12949 for (let j = 0; j <= i; j++) { 12950 const el = stack2.shift(); 12951 onCloseTag(el, end, j < i); 12952 } 12953 break; 12954 } 12955 } 12956 if (!found) { 12957 emitError(23, backTrack(start, 60)); 12958 } 12959 } 12960 }, 12961 onselfclosingtag(end) { 12962 const name = currentOpenTag.tag; 12963 currentOpenTag.isSelfClosing = true; 12964 endOpenTag(end); 12965 if (stack2[0] && stack2[0].tag === name) { 12966 onCloseTag(stack2.shift(), end); 12967 } 12968 }, 12969 onattribname(start, end) { 12970 currentProp = { 12971 type: 6, 12972 name: getSlice(start, end), 12973 nameLoc: getLoc(start, end), 12974 value: void 0, 12975 loc: getLoc(start) 12976 }; 12977 }, 12978 ondirname(start, end) { 12979 const raw = getSlice(start, end); 12980 const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); 12981 if (!inVPre && name === "") { 12982 emitError(26, start); 12983 } 12984 if (inVPre || name === "") { 12985 currentProp = { 12986 type: 6, 12987 name: raw, 12988 nameLoc: getLoc(start, end), 12989 value: void 0, 12990 loc: getLoc(start) 12991 }; 12992 } else { 12993 currentProp = { 12994 type: 7, 12995 name, 12996 rawName: raw, 12997 exp: void 0, 12998 arg: void 0, 12999 modifiers: raw === "." ? ["prop"] : [], 13000 loc: getLoc(start) 13001 }; 13002 if (name === "pre") { 13003 inVPre = tokenizer.inVPre = true; 13004 currentVPreBoundary = currentOpenTag; 13005 const props = currentOpenTag.props; 13006 for (let i = 0; i < props.length; i++) { 13007 if (props[i].type === 7) { 13008 props[i] = dirToAttr(props[i]); 13009 } 13010 } 13011 } 13012 } 13013 }, 13014 ondirarg(start, end) { 13015 if (start === end) return; 13016 const arg = getSlice(start, end); 13017 if (inVPre) { 13018 currentProp.name += arg; 13019 setLocEnd(currentProp.nameLoc, end); 13020 } else { 13021 const isStatic = arg[0] !== `[`; 13022 currentProp.arg = createExp( 13023 isStatic ? arg : arg.slice(1, -1), 13024 isStatic, 13025 getLoc(start, end), 13026 isStatic ? 3 : 0 13027 ); 13028 } 13029 }, 13030 ondirmodifier(start, end) { 13031 const mod = getSlice(start, end); 13032 if (inVPre) { 13033 currentProp.name += "." + mod; 13034 setLocEnd(currentProp.nameLoc, end); 13035 } else if (currentProp.name === "slot") { 13036 const arg = currentProp.arg; 13037 if (arg) { 13038 arg.content += "." + mod; 13039 setLocEnd(arg.loc, end); 13040 } 13041 } else { 13042 currentProp.modifiers.push(mod); 13043 } 13044 }, 13045 onattribdata(start, end) { 13046 currentAttrValue += getSlice(start, end); 13047 if (currentAttrStartIndex < 0) currentAttrStartIndex = start; 13048 currentAttrEndIndex = end; 13049 }, 13050 onattribentity(char, start, end) { 13051 currentAttrValue += char; 13052 if (currentAttrStartIndex < 0) currentAttrStartIndex = start; 13053 currentAttrEndIndex = end; 13054 }, 13055 onattribnameend(end) { 13056 const start = currentProp.loc.start.offset; 13057 const name = getSlice(start, end); 13058 if (currentProp.type === 7) { 13059 currentProp.rawName = name; 13060 } 13061 if (currentOpenTag.props.some( 13062 (p2) => (p2.type === 7 ? p2.rawName : p2.name) === name 13063 )) { 13064 emitError(2, start); 13065 } 13066 }, 13067 onattribend(quote, end) { 13068 if (currentOpenTag && currentProp) { 13069 setLocEnd(currentProp.loc, end); 13070 if (quote !== 0) { 13071 if (currentAttrValue.includes("&")) { 13072 currentAttrValue = currentOptions.decodeEntities( 13073 currentAttrValue, 13074 true 13075 ); 13076 } 13077 if (currentProp.type === 6) { 13078 if (currentProp.name === "class") { 13079 currentAttrValue = condense(currentAttrValue).trim(); 13080 } 13081 if (quote === 1 && !currentAttrValue) { 13082 emitError(13, end); 13083 } 13084 currentProp.value = { 13085 type: 2, 13086 content: currentAttrValue, 13087 loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) 13088 }; 13089 if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { 13090 tokenizer.enterRCDATA(toCharCodes(`</template`), 0); 13091 } 13092 } else { 13093 let expParseMode = 0; 13094 currentProp.exp = createExp( 13095 currentAttrValue, 13096 false, 13097 getLoc(currentAttrStartIndex, currentAttrEndIndex), 13098 0, 13099 expParseMode 13100 ); 13101 if (currentProp.name === "for") { 13102 currentProp.forParseResult = parseForExpression(currentProp.exp); 13103 } 13104 let syncIndex = -1; 13105 if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.indexOf("sync")) > -1 && checkCompatEnabled( 13106 "COMPILER_V_BIND_SYNC", 13107 currentOptions, 13108 currentProp.loc, 13109 currentProp.rawName 13110 )) { 13111 currentProp.name = "model"; 13112 currentProp.modifiers.splice(syncIndex, 1); 13113 } 13114 } 13115 } 13116 if (currentProp.type !== 7 || currentProp.name !== "pre") { 13117 currentOpenTag.props.push(currentProp); 13118 } 13119 } 13120 currentAttrValue = ""; 13121 currentAttrStartIndex = currentAttrEndIndex = -1; 13122 }, 13123 oncomment(start, end) { 13124 if (currentOptions.comments) { 13125 addNode({ 13126 type: 3, 13127 content: getSlice(start, end), 13128 loc: getLoc(start - 4, end + 3) 13129 }); 13130 } 13131 }, 13132 onend() { 13133 const end = currentInput.length; 13134 if (tokenizer.state !== 1) { 13135 switch (tokenizer.state) { 13136 case 5: 13137 case 8: 13138 emitError(5, end); 13139 break; 13140 case 3: 13141 case 4: 13142 emitError( 13143 25, 13144 tokenizer.sectionStart 13145 ); 13146 break; 13147 case 28: 13148 if (tokenizer.currentSequence === Sequences.CdataEnd) { 13149 emitError(6, end); 13150 } else { 13151 emitError(7, end); 13152 } 13153 break; 13154 case 6: 13155 case 7: 13156 case 9: 13157 case 11: 13158 case 12: 13159 case 13: 13160 case 14: 13161 case 15: 13162 case 16: 13163 case 17: 13164 case 18: 13165 case 19: 13166 case 20: 13167 case 21: 13168 emitError(9, end); 13169 break; 13170 } 13171 } 13172 for (let index = 0; index < stack2.length; index++) { 13173 onCloseTag(stack2[index], end - 1); 13174 emitError(24, stack2[index].loc.start.offset); 13175 } 13176 }, 13177 oncdata(start, end) { 13178 if (stack2[0].ns !== 0) { 13179 onText(getSlice(start, end), start, end); 13180 } else { 13181 emitError(1, start - 9); 13182 } 13183 }, 13184 onprocessinginstruction(start) { 13185 if ((stack2[0] ? stack2[0].ns : currentOptions.ns) === 0) { 13186 emitError( 13187 21, 13188 start - 1 13189 ); 13190 } 13191 } 13192}); 13193var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 13194var stripParensRE = /^\(|\)$/g; 13195function parseForExpression(input) { 13196 const loc = input.loc; 13197 const exp = input.content; 13198 const inMatch = exp.match(forAliasRE); 13199 if (!inMatch) return; 13200 const [, LHS, RHS] = inMatch; 13201 const createAliasExpression = (content, offset, asParam = false) => { 13202 const start = loc.start.offset + offset; 13203 const end = start + content.length; 13204 return createExp( 13205 content, 13206 false, 13207 getLoc(start, end), 13208 0, 13209 asParam ? 1 : 0 13210 /* Normal */ 13211 ); 13212 }; 13213 const result = { 13214 source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), 13215 value: void 0, 13216 key: void 0, 13217 index: void 0, 13218 finalized: false 13219 }; 13220 let valueContent = LHS.trim().replace(stripParensRE, "").trim(); 13221 const trimmedOffset = LHS.indexOf(valueContent); 13222 const iteratorMatch = valueContent.match(forIteratorRE); 13223 if (iteratorMatch) { 13224 valueContent = valueContent.replace(forIteratorRE, "").trim(); 13225 const keyContent = iteratorMatch[1].trim(); 13226 let keyOffset; 13227 if (keyContent) { 13228 keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); 13229 result.key = createAliasExpression(keyContent, keyOffset, true); 13230 } 13231 if (iteratorMatch[2]) { 13232 const indexContent = iteratorMatch[2].trim(); 13233 if (indexContent) { 13234 result.index = createAliasExpression( 13235 indexContent, 13236 exp.indexOf( 13237 indexContent, 13238 result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length 13239 ), 13240 true 13241 ); 13242 } 13243 } 13244 } 13245 if (valueContent) { 13246 result.value = createAliasExpression(valueContent, trimmedOffset, true); 13247 } 13248 return result; 13249} 13250function getSlice(start, end) { 13251 return currentInput.slice(start, end); 13252} 13253function endOpenTag(end) { 13254 if (tokenizer.inSFCRoot) { 13255 currentOpenTag.innerLoc = getLoc(end + 1, end + 1); 13256 } 13257 addNode(currentOpenTag); 13258 const { tag, ns } = currentOpenTag; 13259 if (ns === 0 && currentOptions.isPreTag(tag)) { 13260 inPre++; 13261 } 13262 if (currentOptions.isVoidTag(tag)) { 13263 onCloseTag(currentOpenTag, end); 13264 } else { 13265 stack2.unshift(currentOpenTag); 13266 if (ns === 1 || ns === 2) { 13267 tokenizer.inXML = true; 13268 } 13269 } 13270 currentOpenTag = null; 13271} 13272function onText(content, start, end) { 13273 { 13274 const tag = stack2[0] && stack2[0].tag; 13275 if (tag !== "script" && tag !== "style" && content.includes("&")) { 13276 content = currentOptions.decodeEntities(content, false); 13277 } 13278 } 13279 const parent = stack2[0] || currentRoot; 13280 const lastNode = parent.children[parent.children.length - 1]; 13281 if (lastNode && lastNode.type === 2) { 13282 lastNode.content += content; 13283 setLocEnd(lastNode.loc, end); 13284 } else { 13285 parent.children.push({ 13286 type: 2, 13287 content, 13288 loc: getLoc(start, end) 13289 }); 13290 } 13291} 13292function onCloseTag(el, end, isImplied = false) { 13293 if (isImplied) { 13294 setLocEnd(el.loc, backTrack(end, 60)); 13295 } else { 13296 setLocEnd(el.loc, lookAhead(end, 62) + 1); 13297 } 13298 if (tokenizer.inSFCRoot) { 13299 if (el.children.length) { 13300 el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end); 13301 } else { 13302 el.innerLoc.end = extend({}, el.innerLoc.start); 13303 } 13304 el.innerLoc.source = getSlice( 13305 el.innerLoc.start.offset, 13306 el.innerLoc.end.offset 13307 ); 13308 } 13309 const { tag, ns } = el; 13310 if (!inVPre) { 13311 if (tag === "slot") { 13312 el.tagType = 2; 13313 } else if (isFragmentTemplate(el)) { 13314 el.tagType = 3; 13315 } else if (isComponent(el)) { 13316 el.tagType = 1; 13317 } 13318 } 13319 if (!tokenizer.inRCDATA) { 13320 el.children = condenseWhitespace(el.children, el.tag); 13321 } 13322 if (ns === 0 && currentOptions.isPreTag(tag)) { 13323 inPre--; 13324 } 13325 if (currentVPreBoundary === el) { 13326 inVPre = tokenizer.inVPre = false; 13327 currentVPreBoundary = null; 13328 } 13329 if (tokenizer.inXML && (stack2[0] ? stack2[0].ns : currentOptions.ns) === 0) { 13330 tokenizer.inXML = false; 13331 } 13332 { 13333 const props = el.props; 13334 if (isCompatEnabled( 13335 "COMPILER_V_IF_V_FOR_PRECEDENCE", 13336 currentOptions 13337 )) { 13338 let hasIf = false; 13339 let hasFor = false; 13340 for (let i = 0; i < props.length; i++) { 13341 const p2 = props[i]; 13342 if (p2.type === 7) { 13343 if (p2.name === "if") { 13344 hasIf = true; 13345 } else if (p2.name === "for") { 13346 hasFor = true; 13347 } 13348 } 13349 if (hasIf && hasFor) { 13350 warnDeprecation( 13351 "COMPILER_V_IF_V_FOR_PRECEDENCE", 13352 currentOptions, 13353 el.loc 13354 ); 13355 break; 13356 } 13357 } 13358 } 13359 if (!tokenizer.inSFCRoot && isCompatEnabled( 13360 "COMPILER_NATIVE_TEMPLATE", 13361 currentOptions 13362 ) && el.tag === "template" && !isFragmentTemplate(el)) { 13363 warnDeprecation( 13364 "COMPILER_NATIVE_TEMPLATE", 13365 currentOptions, 13366 el.loc 13367 ); 13368 const parent = stack2[0] || currentRoot; 13369 const index = parent.children.indexOf(el); 13370 parent.children.splice(index, 1, ...el.children); 13371 } 13372 const inlineTemplateProp = props.find( 13373 (p2) => p2.type === 6 && p2.name === "inline-template" 13374 ); 13375 if (inlineTemplateProp && checkCompatEnabled( 13376 "COMPILER_INLINE_TEMPLATE", 13377 currentOptions, 13378 inlineTemplateProp.loc 13379 ) && el.children.length) { 13380 inlineTemplateProp.value = { 13381 type: 2, 13382 content: getSlice( 13383 el.children[0].loc.start.offset, 13384 el.children[el.children.length - 1].loc.end.offset 13385 ), 13386 loc: inlineTemplateProp.loc 13387 }; 13388 } 13389 } 13390} 13391function lookAhead(index, c) { 13392 let i = index; 13393 while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; 13394 return i; 13395} 13396function backTrack(index, c) { 13397 let i = index; 13398 while (currentInput.charCodeAt(i) !== c && i >= 0) i--; 13399 return i; 13400} 13401var specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); 13402function isFragmentTemplate({ tag, props }) { 13403 if (tag === "template") { 13404 for (let i = 0; i < props.length; i++) { 13405 if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { 13406 return true; 13407 } 13408 } 13409 } 13410 return false; 13411} 13412function isComponent({ tag, props }) { 13413 if (currentOptions.isCustomElement(tag)) { 13414 return false; 13415 } 13416 if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { 13417 return true; 13418 } 13419 for (let i = 0; i < props.length; i++) { 13420 const p2 = props[i]; 13421 if (p2.type === 6) { 13422 if (p2.name === "is" && p2.value) { 13423 if (p2.value.content.startsWith("vue:")) { 13424 return true; 13425 } else if (checkCompatEnabled( 13426 "COMPILER_IS_ON_ELEMENT", 13427 currentOptions, 13428 p2.loc 13429 )) { 13430 return true; 13431 } 13432 } 13433 } else if ( 13434 // :is on plain element - only treat as component in compat mode 13435 p2.name === "bind" && isStaticArgOf(p2.arg, "is") && checkCompatEnabled( 13436 "COMPILER_IS_ON_ELEMENT", 13437 currentOptions, 13438 p2.loc 13439 ) 13440 ) { 13441 return true; 13442 } 13443 } 13444 return false; 13445} 13446function isUpperCase(c) { 13447 return c > 64 && c < 91; 13448} 13449var windowsNewlineRE = /\r\n/g; 13450function condenseWhitespace(nodes, tag) { 13451 const shouldCondense = currentOptions.whitespace !== "preserve"; 13452 let removedWhitespace = false; 13453 for (let i = 0; i < nodes.length; i++) { 13454 const node = nodes[i]; 13455 if (node.type === 2) { 13456 if (!inPre) { 13457 if (isAllWhitespace(node.content)) { 13458 const prev = nodes[i - 1] && nodes[i - 1].type; 13459 const next = nodes[i + 1] && nodes[i + 1].type; 13460 if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { 13461 removedWhitespace = true; 13462 nodes[i] = null; 13463 } else { 13464 node.content = " "; 13465 } 13466 } else if (shouldCondense) { 13467 node.content = condense(node.content); 13468 } 13469 } else { 13470 node.content = node.content.replace(windowsNewlineRE, "\n"); 13471 } 13472 } 13473 } 13474 if (inPre && tag && currentOptions.isPreTag(tag)) { 13475 const first = nodes[0]; 13476 if (first && first.type === 2) { 13477 first.content = first.content.replace(/^\r?\n/, ""); 13478 } 13479 } 13480 return removedWhitespace ? nodes.filter(Boolean) : nodes; 13481} 13482function isAllWhitespace(str) { 13483 for (let i = 0; i < str.length; i++) { 13484 if (!isWhitespace(str.charCodeAt(i))) { 13485 return false; 13486 } 13487 } 13488 return true; 13489} 13490function hasNewlineChar(str) { 13491 for (let i = 0; i < str.length; i++) { 13492 const c = str.charCodeAt(i); 13493 if (c === 10 || c === 13) { 13494 return true; 13495 } 13496 } 13497 return false; 13498} 13499function condense(str) { 13500 let ret = ""; 13501 let prevCharIsWhitespace = false; 13502 for (let i = 0; i < str.length; i++) { 13503 if (isWhitespace(str.charCodeAt(i))) { 13504 if (!prevCharIsWhitespace) { 13505 ret += " "; 13506 prevCharIsWhitespace = true; 13507 } 13508 } else { 13509 ret += str[i]; 13510 prevCharIsWhitespace = false; 13511 } 13512 } 13513 return ret; 13514} 13515function addNode(node) { 13516 (stack2[0] || currentRoot).children.push(node); 13517} 13518function getLoc(start, end) { 13519 return { 13520 start: tokenizer.getPos(start), 13521 // @ts-expect-error allow late attachment 13522 end: end == null ? end : tokenizer.getPos(end), 13523 // @ts-expect-error allow late attachment 13524 source: end == null ? end : getSlice(start, end) 13525 }; 13526} 13527function setLocEnd(loc, end) { 13528 loc.end = tokenizer.getPos(end); 13529 loc.source = getSlice(loc.start.offset, end); 13530} 13531function dirToAttr(dir) { 13532 const attr = { 13533 type: 6, 13534 name: dir.rawName, 13535 nameLoc: getLoc( 13536 dir.loc.start.offset, 13537 dir.loc.start.offset + dir.rawName.length 13538 ), 13539 value: void 0, 13540 loc: dir.loc 13541 }; 13542 if (dir.exp) { 13543 const loc = dir.exp.loc; 13544 if (loc.end.offset < dir.loc.end.offset) { 13545 loc.start.offset--; 13546 loc.start.column--; 13547 loc.end.offset++; 13548 loc.end.column++; 13549 } 13550 attr.value = { 13551 type: 2, 13552 content: dir.exp.content, 13553 loc 13554 }; 13555 } 13556 return attr; 13557} 13558function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0) { 13559 const exp = createSimpleExpression(content, isStatic, loc, constType); 13560 return exp; 13561} 13562function emitError(code, index, message) { 13563 currentOptions.onError( 13564 createCompilerError(code, getLoc(index, index), void 0, message) 13565 ); 13566} 13567function reset() { 13568 tokenizer.reset(); 13569 currentOpenTag = null; 13570 currentProp = null; 13571 currentAttrValue = ""; 13572 currentAttrStartIndex = -1; 13573 currentAttrEndIndex = -1; 13574 stack2.length = 0; 13575} 13576function baseParse(input, options) { 13577 reset(); 13578 currentInput = input; 13579 currentOptions = extend({}, defaultParserOptions); 13580 if (options) { 13581 let key; 13582 for (key in options) { 13583 if (options[key] != null) { 13584 currentOptions[key] = options[key]; 13585 } 13586 } 13587 } 13588 if (true) { 13589 if (!currentOptions.decodeEntities) { 13590 throw new Error( 13591 `[@vue/compiler-core] decodeEntities option is required in browser builds.` 13592 ); 13593 } 13594 } 13595 tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; 13596 tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; 13597 const delimiters = options && options.delimiters; 13598 if (delimiters) { 13599 tokenizer.delimiterOpen = toCharCodes(delimiters[0]); 13600 tokenizer.delimiterClose = toCharCodes(delimiters[1]); 13601 } 13602 const root = currentRoot = createRoot([], input); 13603 tokenizer.parse(currentInput); 13604 root.loc = getLoc(0, input.length); 13605 root.children = condenseWhitespace(root.children); 13606 currentRoot = null; 13607 return root; 13608} 13609function hoistStatic(root, context) { 13610 walk( 13611 root, 13612 context, 13613 // Root node is unfortunately non-hoistable due to potential parent 13614 // fallthrough attributes. 13615 isSingleElementRoot(root, root.children[0]) 13616 ); 13617} 13618function isSingleElementRoot(root, child) { 13619 const { children } = root; 13620 return children.length === 1 && child.type === 1 && !isSlotOutlet(child); 13621} 13622function walk(node, context, doNotHoistNode = false) { 13623 const { children } = node; 13624 const originalCount = children.length; 13625 let hoistedCount = 0; 13626 for (let i = 0; i < children.length; i++) { 13627 const child = children[i]; 13628 if (child.type === 1 && child.tagType === 0) { 13629 const constantType = doNotHoistNode ? 0 : getConstantType(child, context); 13630 if (constantType > 0) { 13631 if (constantType >= 2) { 13632 child.codegenNode.patchFlag = -1; 13633 child.codegenNode = context.hoist(child.codegenNode); 13634 hoistedCount++; 13635 continue; 13636 } 13637 } else { 13638 const codegenNode = child.codegenNode; 13639 if (codegenNode.type === 13) { 13640 const flag = codegenNode.patchFlag; 13641 if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { 13642 const props = getNodeProps(child); 13643 if (props) { 13644 codegenNode.props = context.hoist(props); 13645 } 13646 } 13647 if (codegenNode.dynamicProps) { 13648 codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); 13649 } 13650 } 13651 } 13652 } 13653 if (child.type === 1) { 13654 const isComponent2 = child.tagType === 1; 13655 if (isComponent2) { 13656 context.scopes.vSlot++; 13657 } 13658 walk(child, context); 13659 if (isComponent2) { 13660 context.scopes.vSlot--; 13661 } 13662 } else if (child.type === 11) { 13663 walk(child, context, child.children.length === 1); 13664 } else if (child.type === 9) { 13665 for (let i2 = 0; i2 < child.branches.length; i2++) { 13666 walk( 13667 child.branches[i2], 13668 context, 13669 child.branches[i2].children.length === 1 13670 ); 13671 } 13672 } 13673 } 13674 if (hoistedCount && context.transformHoist) { 13675 context.transformHoist(children, context, node); 13676 } 13677 if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) { 13678 const hoisted = context.hoist( 13679 createArrayExpression(node.codegenNode.children) 13680 ); 13681 if (context.hmr) { 13682 hoisted.content = `[...${hoisted.content}]`; 13683 } 13684 node.codegenNode.children = hoisted; 13685 } 13686} 13687function getConstantType(node, context) { 13688 const { constantCache } = context; 13689 switch (node.type) { 13690 case 1: 13691 if (node.tagType !== 0) { 13692 return 0; 13693 } 13694 const cached = constantCache.get(node); 13695 if (cached !== void 0) { 13696 return cached; 13697 } 13698 const codegenNode = node.codegenNode; 13699 if (codegenNode.type !== 13) { 13700 return 0; 13701 } 13702 if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { 13703 return 0; 13704 } 13705 if (codegenNode.patchFlag === void 0) { 13706 let returnType2 = 3; 13707 const generatedPropsType = getGeneratedPropsConstantType(node, context); 13708 if (generatedPropsType === 0) { 13709 constantCache.set(node, 0); 13710 return 0; 13711 } 13712 if (generatedPropsType < returnType2) { 13713 returnType2 = generatedPropsType; 13714 } 13715 for (let i = 0; i < node.children.length; i++) { 13716 const childType = getConstantType(node.children[i], context); 13717 if (childType === 0) { 13718 constantCache.set(node, 0); 13719 return 0; 13720 } 13721 if (childType < returnType2) { 13722 returnType2 = childType; 13723 } 13724 } 13725 if (returnType2 > 1) { 13726 for (let i = 0; i < node.props.length; i++) { 13727 const p2 = node.props[i]; 13728 if (p2.type === 7 && p2.name === "bind" && p2.exp) { 13729 const expType = getConstantType(p2.exp, context); 13730 if (expType === 0) { 13731 constantCache.set(node, 0); 13732 return 0; 13733 } 13734 if (expType < returnType2) { 13735 returnType2 = expType; 13736 } 13737 } 13738 } 13739 } 13740 if (codegenNode.isBlock) { 13741 for (let i = 0; i < node.props.length; i++) { 13742 const p2 = node.props[i]; 13743 if (p2.type === 7) { 13744 constantCache.set(node, 0); 13745 return 0; 13746 } 13747 } 13748 context.removeHelper(OPEN_BLOCK); 13749 context.removeHelper( 13750 getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) 13751 ); 13752 codegenNode.isBlock = false; 13753 context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); 13754 } 13755 constantCache.set(node, returnType2); 13756 return returnType2; 13757 } else { 13758 constantCache.set(node, 0); 13759 return 0; 13760 } 13761 case 2: 13762 case 3: 13763 return 3; 13764 case 9: 13765 case 11: 13766 case 10: 13767 return 0; 13768 case 5: 13769 case 12: 13770 return getConstantType(node.content, context); 13771 case 4: 13772 return node.constType; 13773 case 8: 13774 let returnType = 3; 13775 for (let i = 0; i < node.children.length; i++) { 13776 const child = node.children[i]; 13777 if (isString(child) || isSymbol(child)) { 13778 continue; 13779 } 13780 const childType = getConstantType(child, context); 13781 if (childType === 0) { 13782 return 0; 13783 } else if (childType < returnType) { 13784 returnType = childType; 13785 } 13786 } 13787 return returnType; 13788 default: 13789 if (true) ; 13790 return 0; 13791 } 13792} 13793var allowHoistedHelperSet = /* @__PURE__ */ new Set([ 13794 NORMALIZE_CLASS, 13795 NORMALIZE_STYLE, 13796 NORMALIZE_PROPS, 13797 GUARD_REACTIVE_PROPS 13798]); 13799function getConstantTypeOfHelperCall(value, context) { 13800 if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { 13801 const arg = value.arguments[0]; 13802 if (arg.type === 4) { 13803 return getConstantType(arg, context); 13804 } else if (arg.type === 14) { 13805 return getConstantTypeOfHelperCall(arg, context); 13806 } 13807 } 13808 return 0; 13809} 13810function getGeneratedPropsConstantType(node, context) { 13811 let returnType = 3; 13812 const props = getNodeProps(node); 13813 if (props && props.type === 15) { 13814 const { properties } = props; 13815 for (let i = 0; i < properties.length; i++) { 13816 const { key, value } = properties[i]; 13817 const keyType = getConstantType(key, context); 13818 if (keyType === 0) { 13819 return keyType; 13820 } 13821 if (keyType < returnType) { 13822 returnType = keyType; 13823 } 13824 let valueType; 13825 if (value.type === 4) { 13826 valueType = getConstantType(value, context); 13827 } else if (value.type === 14) { 13828 valueType = getConstantTypeOfHelperCall(value, context); 13829 } else { 13830 valueType = 0; 13831 } 13832 if (valueType === 0) { 13833 return valueType; 13834 } 13835 if (valueType < returnType) { 13836 returnType = valueType; 13837 } 13838 } 13839 } 13840 return returnType; 13841} 13842function getNodeProps(node) { 13843 const codegenNode = node.codegenNode; 13844 if (codegenNode.type === 13) { 13845 return codegenNode.props; 13846 } 13847} 13848function createTransformContext(root, { 13849 filename = "", 13850 prefixIdentifiers = false, 13851 hoistStatic: hoistStatic2 = false, 13852 hmr = false, 13853 cacheHandlers = false, 13854 nodeTransforms = [], 13855 directiveTransforms = {}, 13856 transformHoist = null, 13857 isBuiltInComponent = NOOP, 13858 isCustomElement = NOOP, 13859 expressionPlugins = [], 13860 scopeId = null, 13861 slotted = true, 13862 ssr = false, 13863 inSSR = false, 13864 ssrCssVars = ``, 13865 bindingMetadata = EMPTY_OBJ, 13866 inline = false, 13867 isTS = false, 13868 onError = defaultOnError, 13869 onWarn = defaultOnWarn, 13870 compatConfig 13871}) { 13872 const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); 13873 const context = { 13874 // options 13875 filename, 13876 selfName: nameMatch && capitalize(camelize(nameMatch[1])), 13877 prefixIdentifiers, 13878 hoistStatic: hoistStatic2, 13879 hmr, 13880 cacheHandlers, 13881 nodeTransforms, 13882 directiveTransforms, 13883 transformHoist, 13884 isBuiltInComponent, 13885 isCustomElement, 13886 expressionPlugins, 13887 scopeId, 13888 slotted, 13889 ssr, 13890 inSSR, 13891 ssrCssVars, 13892 bindingMetadata, 13893 inline, 13894 isTS, 13895 onError, 13896 onWarn, 13897 compatConfig, 13898 // state 13899 root, 13900 helpers: /* @__PURE__ */ new Map(), 13901 components: /* @__PURE__ */ new Set(), 13902 directives: /* @__PURE__ */ new Set(), 13903 hoists: [], 13904 imports: [], 13905 constantCache: /* @__PURE__ */ new WeakMap(), 13906 temps: 0, 13907 cached: 0, 13908 identifiers: /* @__PURE__ */ Object.create(null), 13909 scopes: { 13910 vFor: 0, 13911 vSlot: 0, 13912 vPre: 0, 13913 vOnce: 0 13914 }, 13915 parent: null, 13916 grandParent: null, 13917 currentNode: root, 13918 childIndex: 0, 13919 inVOnce: false, 13920 // methods 13921 helper(name) { 13922 const count = context.helpers.get(name) || 0; 13923 context.helpers.set(name, count + 1); 13924 return name; 13925 }, 13926 removeHelper(name) { 13927 const count = context.helpers.get(name); 13928 if (count) { 13929 const currentCount = count - 1; 13930 if (!currentCount) { 13931 context.helpers.delete(name); 13932 } else { 13933 context.helpers.set(name, currentCount); 13934 } 13935 } 13936 }, 13937 helperString(name) { 13938 return `_${helperNameMap[context.helper(name)]}`; 13939 }, 13940 replaceNode(node) { 13941 if (true) { 13942 if (!context.currentNode) { 13943 throw new Error(`Node being replaced is already removed.`); 13944 } 13945 if (!context.parent) { 13946 throw new Error(`Cannot replace root node.`); 13947 } 13948 } 13949 context.parent.children[context.childIndex] = context.currentNode = node; 13950 }, 13951 removeNode(node) { 13952 if (!context.parent) { 13953 throw new Error(`Cannot remove root node.`); 13954 } 13955 const list = context.parent.children; 13956 const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; 13957 if (removalIndex < 0) { 13958 throw new Error(`node being removed is not a child of current parent`); 13959 } 13960 if (!node || node === context.currentNode) { 13961 context.currentNode = null; 13962 context.onNodeRemoved(); 13963 } else { 13964 if (context.childIndex > removalIndex) { 13965 context.childIndex--; 13966 context.onNodeRemoved(); 13967 } 13968 } 13969 context.parent.children.splice(removalIndex, 1); 13970 }, 13971 onNodeRemoved: NOOP, 13972 addIdentifiers(exp) { 13973 }, 13974 removeIdentifiers(exp) { 13975 }, 13976 hoist(exp) { 13977 if (isString(exp)) exp = createSimpleExpression(exp); 13978 context.hoists.push(exp); 13979 const identifier = createSimpleExpression( 13980 `_hoisted_${context.hoists.length}`, 13981 false, 13982 exp.loc, 13983 2 13984 ); 13985 identifier.hoisted = exp; 13986 return identifier; 13987 }, 13988 cache(exp, isVNode2 = false) { 13989 return createCacheExpression(context.cached++, exp, isVNode2); 13990 } 13991 }; 13992 { 13993 context.filters = /* @__PURE__ */ new Set(); 13994 } 13995 return context; 13996} 13997function transform(root, options) { 13998 const context = createTransformContext(root, options); 13999 traverseNode(root, context); 14000 if (options.hoistStatic) { 14001 hoistStatic(root, context); 14002 } 14003 if (!options.ssr) { 14004 createRootCodegen(root, context); 14005 } 14006 root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); 14007 root.components = [...context.components]; 14008 root.directives = [...context.directives]; 14009 root.imports = context.imports; 14010 root.hoists = context.hoists; 14011 root.temps = context.temps; 14012 root.cached = context.cached; 14013 root.transformed = true; 14014 { 14015 root.filters = [...context.filters]; 14016 } 14017} 14018function createRootCodegen(root, context) { 14019 const { helper } = context; 14020 const { children } = root; 14021 if (children.length === 1) { 14022 const child = children[0]; 14023 if (isSingleElementRoot(root, child) && child.codegenNode) { 14024 const codegenNode = child.codegenNode; 14025 if (codegenNode.type === 13) { 14026 convertToBlock(codegenNode, context); 14027 } 14028 root.codegenNode = codegenNode; 14029 } else { 14030 root.codegenNode = child; 14031 } 14032 } else if (children.length > 1) { 14033 let patchFlag = 64; 14034 let patchFlagText = PatchFlagNames[64]; 14035 if (children.filter((c) => c.type !== 3).length === 1) { 14036 patchFlag |= 2048; 14037 patchFlagText += `, ${PatchFlagNames[2048]}`; 14038 } 14039 root.codegenNode = createVNodeCall( 14040 context, 14041 helper(FRAGMENT), 14042 void 0, 14043 root.children, 14044 patchFlag, 14045 void 0, 14046 void 0, 14047 true, 14048 void 0, 14049 false 14050 ); 14051 } else ; 14052} 14053function traverseChildren(parent, context) { 14054 let i = 0; 14055 const nodeRemoved = () => { 14056 i--; 14057 }; 14058 for (; i < parent.children.length; i++) { 14059 const child = parent.children[i]; 14060 if (isString(child)) continue; 14061 context.grandParent = context.parent; 14062 context.parent = parent; 14063 context.childIndex = i; 14064 context.onNodeRemoved = nodeRemoved; 14065 traverseNode(child, context); 14066 } 14067} 14068function traverseNode(node, context) { 14069 context.currentNode = node; 14070 const { nodeTransforms } = context; 14071 const exitFns = []; 14072 for (let i2 = 0; i2 < nodeTransforms.length; i2++) { 14073 const onExit = nodeTransforms[i2](node, context); 14074 if (onExit) { 14075 if (isArray(onExit)) { 14076 exitFns.push(...onExit); 14077 } else { 14078 exitFns.push(onExit); 14079 } 14080 } 14081 if (!context.currentNode) { 14082 return; 14083 } else { 14084 node = context.currentNode; 14085 } 14086 } 14087 switch (node.type) { 14088 case 3: 14089 if (!context.ssr) { 14090 context.helper(CREATE_COMMENT); 14091 } 14092 break; 14093 case 5: 14094 if (!context.ssr) { 14095 context.helper(TO_DISPLAY_STRING); 14096 } 14097 break; 14098 case 9: 14099 for (let i2 = 0; i2 < node.branches.length; i2++) { 14100 traverseNode(node.branches[i2], context); 14101 } 14102 break; 14103 case 10: 14104 case 11: 14105 case 1: 14106 case 0: 14107 traverseChildren(node, context); 14108 break; 14109 } 14110 context.currentNode = node; 14111 let i = exitFns.length; 14112 while (i--) { 14113 exitFns[i](); 14114 } 14115} 14116function createStructuralDirectiveTransform(name, fn) { 14117 const matches2 = isString(name) ? (n) => n === name : (n) => name.test(n); 14118 return (node, context) => { 14119 if (node.type === 1) { 14120 const { props } = node; 14121 if (node.tagType === 3 && props.some(isVSlot)) { 14122 return; 14123 } 14124 const exitFns = []; 14125 for (let i = 0; i < props.length; i++) { 14126 const prop = props[i]; 14127 if (prop.type === 7 && matches2(prop.name)) { 14128 props.splice(i, 1); 14129 i--; 14130 const onExit = fn(node, prop, context); 14131 if (onExit) exitFns.push(onExit); 14132 } 14133 } 14134 return exitFns; 14135 } 14136 }; 14137} 14138var PURE_ANNOTATION = `/*#__PURE__*/`; 14139var aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; 14140function createCodegenContext(ast, { 14141 mode = "function", 14142 prefixIdentifiers = mode === "module", 14143 sourceMap = false, 14144 filename = `template.vue.html`, 14145 scopeId = null, 14146 optimizeImports = false, 14147 runtimeGlobalName = `Vue`, 14148 runtimeModuleName = `vue`, 14149 ssrRuntimeModuleName = "vue/server-renderer", 14150 ssr = false, 14151 isTS = false, 14152 inSSR = false 14153}) { 14154 const context = { 14155 mode, 14156 prefixIdentifiers, 14157 sourceMap, 14158 filename, 14159 scopeId, 14160 optimizeImports, 14161 runtimeGlobalName, 14162 runtimeModuleName, 14163 ssrRuntimeModuleName, 14164 ssr, 14165 isTS, 14166 inSSR, 14167 source: ast.source, 14168 code: ``, 14169 column: 1, 14170 line: 1, 14171 offset: 0, 14172 indentLevel: 0, 14173 pure: false, 14174 map: void 0, 14175 helper(key) { 14176 return `_${helperNameMap[key]}`; 14177 }, 14178 push(code, newlineIndex = -2, node) { 14179 context.code += code; 14180 }, 14181 indent() { 14182 newline(++context.indentLevel); 14183 }, 14184 deindent(withoutNewLine = false) { 14185 if (withoutNewLine) { 14186 --context.indentLevel; 14187 } else { 14188 newline(--context.indentLevel); 14189 } 14190 }, 14191 newline() { 14192 newline(context.indentLevel); 14193 } 14194 }; 14195 function newline(n) { 14196 context.push( 14197 "\n" + ` `.repeat(n), 14198 0 14199 /* Start */ 14200 ); 14201 } 14202 return context; 14203} 14204function generate(ast, options = {}) { 14205 const context = createCodegenContext(ast, options); 14206 if (options.onContextCreated) options.onContextCreated(context); 14207 const { 14208 mode, 14209 push, 14210 prefixIdentifiers, 14211 indent, 14212 deindent, 14213 newline, 14214 scopeId, 14215 ssr 14216 } = context; 14217 const helpers = Array.from(ast.helpers); 14218 const hasHelpers = helpers.length > 0; 14219 const useWithBlock = !prefixIdentifiers && mode !== "module"; 14220 const preambleContext = context; 14221 { 14222 genFunctionPreamble(ast, preambleContext); 14223 } 14224 const functionName = ssr ? `ssrRender` : `render`; 14225 const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; 14226 const signature = args.join(", "); 14227 { 14228 push(`function ${functionName}(${signature}) {`); 14229 } 14230 indent(); 14231 if (useWithBlock) { 14232 push(`with (_ctx) {`); 14233 indent(); 14234 if (hasHelpers) { 14235 push( 14236 `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue 14237`, 14238 -1 14239 /* End */ 14240 ); 14241 newline(); 14242 } 14243 } 14244 if (ast.components.length) { 14245 genAssets(ast.components, "component", context); 14246 if (ast.directives.length || ast.temps > 0) { 14247 newline(); 14248 } 14249 } 14250 if (ast.directives.length) { 14251 genAssets(ast.directives, "directive", context); 14252 if (ast.temps > 0) { 14253 newline(); 14254 } 14255 } 14256 if (ast.filters && ast.filters.length) { 14257 newline(); 14258 genAssets(ast.filters, "filter", context); 14259 newline(); 14260 } 14261 if (ast.temps > 0) { 14262 push(`let `); 14263 for (let i = 0; i < ast.temps; i++) { 14264 push(`${i > 0 ? `, ` : ``}_temp${i}`); 14265 } 14266 } 14267 if (ast.components.length || ast.directives.length || ast.temps) { 14268 push( 14269 ` 14270`, 14271 0 14272 /* Start */ 14273 ); 14274 newline(); 14275 } 14276 if (!ssr) { 14277 push(`return `); 14278 } 14279 if (ast.codegenNode) { 14280 genNode(ast.codegenNode, context); 14281 } else { 14282 push(`null`); 14283 } 14284 if (useWithBlock) { 14285 deindent(); 14286 push(`}`); 14287 } 14288 deindent(); 14289 push(`}`); 14290 return { 14291 ast, 14292 code: context.code, 14293 preamble: ``, 14294 map: context.map ? context.map.toJSON() : void 0 14295 }; 14296} 14297function genFunctionPreamble(ast, context) { 14298 const { 14299 ssr, 14300 prefixIdentifiers, 14301 push, 14302 newline, 14303 runtimeModuleName, 14304 runtimeGlobalName, 14305 ssrRuntimeModuleName 14306 } = context; 14307 const VueBinding = runtimeGlobalName; 14308 const helpers = Array.from(ast.helpers); 14309 if (helpers.length > 0) { 14310 { 14311 push( 14312 `const _Vue = ${VueBinding} 14313`, 14314 -1 14315 /* End */ 14316 ); 14317 if (ast.hoists.length) { 14318 const staticHelpers = [ 14319 CREATE_VNODE, 14320 CREATE_ELEMENT_VNODE, 14321 CREATE_COMMENT, 14322 CREATE_TEXT, 14323 CREATE_STATIC 14324 ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); 14325 push( 14326 `const { ${staticHelpers} } = _Vue 14327`, 14328 -1 14329 /* End */ 14330 ); 14331 } 14332 } 14333 } 14334 genHoists(ast.hoists, context); 14335 newline(); 14336 push(`return `); 14337} 14338function genAssets(assets, type, { helper, push, newline, isTS }) { 14339 const resolver = helper( 14340 type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE 14341 ); 14342 for (let i = 0; i < assets.length; i++) { 14343 let id = assets[i]; 14344 const maybeSelfReference = id.endsWith("__self"); 14345 if (maybeSelfReference) { 14346 id = id.slice(0, -6); 14347 } 14348 push( 14349 `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` 14350 ); 14351 if (i < assets.length - 1) { 14352 newline(); 14353 } 14354 } 14355} 14356function genHoists(hoists, context) { 14357 if (!hoists.length) { 14358 return; 14359 } 14360 context.pure = true; 14361 const { push, newline, helper, scopeId, mode } = context; 14362 newline(); 14363 for (let i = 0; i < hoists.length; i++) { 14364 const exp = hoists[i]; 14365 if (exp) { 14366 push( 14367 `const _hoisted_${i + 1} = ${``}` 14368 ); 14369 genNode(exp, context); 14370 newline(); 14371 } 14372 } 14373 context.pure = false; 14374} 14375function isText(n) { 14376 return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; 14377} 14378function genNodeListAsArray(nodes, context) { 14379 const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n)); 14380 context.push(`[`); 14381 multilines && context.indent(); 14382 genNodeList(nodes, context, multilines); 14383 multilines && context.deindent(); 14384 context.push(`]`); 14385} 14386function genNodeList(nodes, context, multilines = false, comma = true) { 14387 const { push, newline } = context; 14388 for (let i = 0; i < nodes.length; i++) { 14389 const node = nodes[i]; 14390 if (isString(node)) { 14391 push( 14392 node, 14393 -3 14394 /* Unknown */ 14395 ); 14396 } else if (isArray(node)) { 14397 genNodeListAsArray(node, context); 14398 } else { 14399 genNode(node, context); 14400 } 14401 if (i < nodes.length - 1) { 14402 if (multilines) { 14403 comma && push(","); 14404 newline(); 14405 } else { 14406 comma && push(", "); 14407 } 14408 } 14409 } 14410} 14411function genNode(node, context) { 14412 if (isString(node)) { 14413 context.push( 14414 node, 14415 -3 14416 /* Unknown */ 14417 ); 14418 return; 14419 } 14420 if (isSymbol(node)) { 14421 context.push(context.helper(node)); 14422 return; 14423 } 14424 switch (node.type) { 14425 case 1: 14426 case 9: 14427 case 11: 14428 assert( 14429 node.codegenNode != null, 14430 `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` 14431 ); 14432 genNode(node.codegenNode, context); 14433 break; 14434 case 2: 14435 genText(node, context); 14436 break; 14437 case 4: 14438 genExpression(node, context); 14439 break; 14440 case 5: 14441 genInterpolation(node, context); 14442 break; 14443 case 12: 14444 genNode(node.codegenNode, context); 14445 break; 14446 case 8: 14447 genCompoundExpression(node, context); 14448 break; 14449 case 3: 14450 genComment(node, context); 14451 break; 14452 case 13: 14453 genVNodeCall(node, context); 14454 break; 14455 case 14: 14456 genCallExpression(node, context); 14457 break; 14458 case 15: 14459 genObjectExpression(node, context); 14460 break; 14461 case 17: 14462 genArrayExpression(node, context); 14463 break; 14464 case 18: 14465 genFunctionExpression(node, context); 14466 break; 14467 case 19: 14468 genConditionalExpression(node, context); 14469 break; 14470 case 20: 14471 genCacheExpression(node, context); 14472 break; 14473 case 21: 14474 genNodeList(node.body, context, true, false); 14475 break; 14476 case 22: 14477 break; 14478 case 23: 14479 break; 14480 case 24: 14481 break; 14482 case 25: 14483 break; 14484 case 26: 14485 break; 14486 case 10: 14487 break; 14488 default: 14489 if (true) { 14490 assert(false, `unhandled codegen node type: ${node.type}`); 14491 const exhaustiveCheck = node; 14492 return exhaustiveCheck; 14493 } 14494 } 14495} 14496function genText(node, context) { 14497 context.push(JSON.stringify(node.content), -3, node); 14498} 14499function genExpression(node, context) { 14500 const { content, isStatic } = node; 14501 context.push( 14502 isStatic ? JSON.stringify(content) : content, 14503 -3, 14504 node 14505 ); 14506} 14507function genInterpolation(node, context) { 14508 const { push, helper, pure } = context; 14509 if (pure) push(PURE_ANNOTATION); 14510 push(`${helper(TO_DISPLAY_STRING)}(`); 14511 genNode(node.content, context); 14512 push(`)`); 14513} 14514function genCompoundExpression(node, context) { 14515 for (let i = 0; i < node.children.length; i++) { 14516 const child = node.children[i]; 14517 if (isString(child)) { 14518 context.push( 14519 child, 14520 -3 14521 /* Unknown */ 14522 ); 14523 } else { 14524 genNode(child, context); 14525 } 14526 } 14527} 14528function genExpressionAsPropertyKey(node, context) { 14529 const { push } = context; 14530 if (node.type === 8) { 14531 push(`[`); 14532 genCompoundExpression(node, context); 14533 push(`]`); 14534 } else if (node.isStatic) { 14535 const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); 14536 push(text, -2, node); 14537 } else { 14538 push(`[${node.content}]`, -3, node); 14539 } 14540} 14541function genComment(node, context) { 14542 const { push, helper, pure } = context; 14543 if (pure) { 14544 push(PURE_ANNOTATION); 14545 } 14546 push( 14547 `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, 14548 -3, 14549 node 14550 ); 14551} 14552function genVNodeCall(node, context) { 14553 const { push, helper, pure } = context; 14554 const { 14555 tag, 14556 props, 14557 children, 14558 patchFlag, 14559 dynamicProps, 14560 directives, 14561 isBlock, 14562 disableTracking, 14563 isComponent: isComponent2 14564 } = node; 14565 let patchFlagString; 14566 if (patchFlag) { 14567 if (true) { 14568 if (patchFlag < 0) { 14569 patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`; 14570 } else { 14571 const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `); 14572 patchFlagString = patchFlag + ` /* ${flagNames} */`; 14573 } 14574 } else { 14575 patchFlagString = String(patchFlag); 14576 } 14577 } 14578 if (directives) { 14579 push(helper(WITH_DIRECTIVES) + `(`); 14580 } 14581 if (isBlock) { 14582 push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); 14583 } 14584 if (pure) { 14585 push(PURE_ANNOTATION); 14586 } 14587 const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent2) : getVNodeHelper(context.inSSR, isComponent2); 14588 push(helper(callHelper) + `(`, -2, node); 14589 genNodeList( 14590 genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), 14591 context 14592 ); 14593 push(`)`); 14594 if (isBlock) { 14595 push(`)`); 14596 } 14597 if (directives) { 14598 push(`, `); 14599 genNode(directives, context); 14600 push(`)`); 14601 } 14602} 14603function genNullableArgs(args) { 14604 let i = args.length; 14605 while (i--) { 14606 if (args[i] != null) break; 14607 } 14608 return args.slice(0, i + 1).map((arg) => arg || `null`); 14609} 14610function genCallExpression(node, context) { 14611 const { push, helper, pure } = context; 14612 const callee = isString(node.callee) ? node.callee : helper(node.callee); 14613 if (pure) { 14614 push(PURE_ANNOTATION); 14615 } 14616 push(callee + `(`, -2, node); 14617 genNodeList(node.arguments, context); 14618 push(`)`); 14619} 14620function genObjectExpression(node, context) { 14621 const { push, indent, deindent, newline } = context; 14622 const { properties } = node; 14623 if (!properties.length) { 14624 push(`{}`, -2, node); 14625 return; 14626 } 14627 const multilines = properties.length > 1 || properties.some((p2) => p2.value.type !== 4); 14628 push(multilines ? `{` : `{ `); 14629 multilines && indent(); 14630 for (let i = 0; i < properties.length; i++) { 14631 const { key, value } = properties[i]; 14632 genExpressionAsPropertyKey(key, context); 14633 push(`: `); 14634 genNode(value, context); 14635 if (i < properties.length - 1) { 14636 push(`,`); 14637 newline(); 14638 } 14639 } 14640 multilines && deindent(); 14641 push(multilines ? `}` : ` }`); 14642} 14643function genArrayExpression(node, context) { 14644 genNodeListAsArray(node.elements, context); 14645} 14646function genFunctionExpression(node, context) { 14647 const { push, indent, deindent } = context; 14648 const { params, returns, body, newline, isSlot } = node; 14649 if (isSlot) { 14650 push(`_${helperNameMap[WITH_CTX]}(`); 14651 } 14652 push(`(`, -2, node); 14653 if (isArray(params)) { 14654 genNodeList(params, context); 14655 } else if (params) { 14656 genNode(params, context); 14657 } 14658 push(`) => `); 14659 if (newline || body) { 14660 push(`{`); 14661 indent(); 14662 } 14663 if (returns) { 14664 if (newline) { 14665 push(`return `); 14666 } 14667 if (isArray(returns)) { 14668 genNodeListAsArray(returns, context); 14669 } else { 14670 genNode(returns, context); 14671 } 14672 } else if (body) { 14673 genNode(body, context); 14674 } 14675 if (newline || body) { 14676 deindent(); 14677 push(`}`); 14678 } 14679 if (isSlot) { 14680 if (node.isNonScopedSlot) { 14681 push(`, undefined, true`); 14682 } 14683 push(`)`); 14684 } 14685} 14686function genConditionalExpression(node, context) { 14687 const { test, consequent, alternate, newline: needNewline } = node; 14688 const { push, indent, deindent, newline } = context; 14689 if (test.type === 4) { 14690 const needsParens = !isSimpleIdentifier(test.content); 14691 needsParens && push(`(`); 14692 genExpression(test, context); 14693 needsParens && push(`)`); 14694 } else { 14695 push(`(`); 14696 genNode(test, context); 14697 push(`)`); 14698 } 14699 needNewline && indent(); 14700 context.indentLevel++; 14701 needNewline || push(` `); 14702 push(`? `); 14703 genNode(consequent, context); 14704 context.indentLevel--; 14705 needNewline && newline(); 14706 needNewline || push(` `); 14707 push(`: `); 14708 const isNested = alternate.type === 19; 14709 if (!isNested) { 14710 context.indentLevel++; 14711 } 14712 genNode(alternate, context); 14713 if (!isNested) { 14714 context.indentLevel--; 14715 } 14716 needNewline && deindent( 14717 true 14718 /* without newline */ 14719 ); 14720} 14721function genCacheExpression(node, context) { 14722 const { push, helper, indent, deindent, newline } = context; 14723 push(`_cache[${node.index}] || (`); 14724 if (node.isVOnce) { 14725 indent(); 14726 push(`${helper(SET_BLOCK_TRACKING)}(-1),`); 14727 newline(); 14728 push(`(`); 14729 } 14730 push(`_cache[${node.index}] = `); 14731 genNode(node.value, context); 14732 if (node.isVOnce) { 14733 push(`).cacheIndex = ${node.index},`); 14734 newline(); 14735 push(`${helper(SET_BLOCK_TRACKING)}(1),`); 14736 newline(); 14737 push(`_cache[${node.index}]`); 14738 deindent(); 14739 } 14740 push(`)`); 14741} 14742var prohibitedKeywordRE = new RegExp( 14743 "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" 14744); 14745var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; 14746function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { 14747 const exp = node.content; 14748 if (!exp.trim()) { 14749 return; 14750 } 14751 try { 14752 new Function( 14753 asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` 14754 ); 14755 } catch (e) { 14756 let message = e.message; 14757 const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); 14758 if (keywordMatch) { 14759 message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; 14760 } 14761 context.onError( 14762 createCompilerError( 14763 45, 14764 node.loc, 14765 void 0, 14766 message 14767 ) 14768 ); 14769 } 14770} 14771var transformExpression = (node, context) => { 14772 if (node.type === 5) { 14773 node.content = processExpression( 14774 node.content, 14775 context 14776 ); 14777 } else if (node.type === 1) { 14778 for (let i = 0; i < node.props.length; i++) { 14779 const dir = node.props[i]; 14780 if (dir.type === 7 && dir.name !== "for") { 14781 const exp = dir.exp; 14782 const arg = dir.arg; 14783 if (exp && exp.type === 4 && !(dir.name === "on" && arg)) { 14784 dir.exp = processExpression( 14785 exp, 14786 context, 14787 // slot args must be processed as function params 14788 dir.name === "slot" 14789 ); 14790 } 14791 if (arg && arg.type === 4 && !arg.isStatic) { 14792 dir.arg = processExpression(arg, context); 14793 } 14794 } 14795 } 14796 } 14797}; 14798function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { 14799 { 14800 if (true) { 14801 validateBrowserExpression(node, context, asParams, asRawStatements); 14802 } 14803 return node; 14804 } 14805} 14806var transformIf = createStructuralDirectiveTransform( 14807 /^(if|else|else-if)$/, 14808 (node, dir, context) => { 14809 return processIf(node, dir, context, (ifNode, branch, isRoot) => { 14810 const siblings = context.parent.children; 14811 let i = siblings.indexOf(ifNode); 14812 let key = 0; 14813 while (i-- >= 0) { 14814 const sibling = siblings[i]; 14815 if (sibling && sibling.type === 9) { 14816 key += sibling.branches.length; 14817 } 14818 } 14819 return () => { 14820 if (isRoot) { 14821 ifNode.codegenNode = createCodegenNodeForBranch( 14822 branch, 14823 key, 14824 context 14825 ); 14826 } else { 14827 const parentCondition = getParentCondition(ifNode.codegenNode); 14828 parentCondition.alternate = createCodegenNodeForBranch( 14829 branch, 14830 key + ifNode.branches.length - 1, 14831 context 14832 ); 14833 } 14834 }; 14835 }); 14836 } 14837); 14838function processIf(node, dir, context, processCodegen) { 14839 if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { 14840 const loc = dir.exp ? dir.exp.loc : node.loc; 14841 context.onError( 14842 createCompilerError(28, dir.loc) 14843 ); 14844 dir.exp = createSimpleExpression(`true`, false, loc); 14845 } 14846 if (dir.exp) { 14847 validateBrowserExpression(dir.exp, context); 14848 } 14849 if (dir.name === "if") { 14850 const branch = createIfBranch(node, dir); 14851 const ifNode = { 14852 type: 9, 14853 loc: node.loc, 14854 branches: [branch] 14855 }; 14856 context.replaceNode(ifNode); 14857 if (processCodegen) { 14858 return processCodegen(ifNode, branch, true); 14859 } 14860 } else { 14861 const siblings = context.parent.children; 14862 const comments = []; 14863 let i = siblings.indexOf(node); 14864 while (i-- >= -1) { 14865 const sibling = siblings[i]; 14866 if (sibling && sibling.type === 3) { 14867 context.removeNode(sibling); 14868 comments.unshift(sibling); 14869 continue; 14870 } 14871 if (sibling && sibling.type === 2 && !sibling.content.trim().length) { 14872 context.removeNode(sibling); 14873 continue; 14874 } 14875 if (sibling && sibling.type === 9) { 14876 if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { 14877 context.onError( 14878 createCompilerError(30, node.loc) 14879 ); 14880 } 14881 context.removeNode(); 14882 const branch = createIfBranch(node, dir); 14883 if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition> 14884 !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { 14885 branch.children = [...comments, ...branch.children]; 14886 } 14887 if (true) { 14888 const key = branch.userKey; 14889 if (key) { 14890 sibling.branches.forEach(({ userKey }) => { 14891 if (isSameKey(userKey, key)) { 14892 context.onError( 14893 createCompilerError( 14894 29, 14895 branch.userKey.loc 14896 ) 14897 ); 14898 } 14899 }); 14900 } 14901 } 14902 sibling.branches.push(branch); 14903 const onExit = processCodegen && processCodegen(sibling, branch, false); 14904 traverseNode(branch, context); 14905 if (onExit) onExit(); 14906 context.currentNode = null; 14907 } else { 14908 context.onError( 14909 createCompilerError(30, node.loc) 14910 ); 14911 } 14912 break; 14913 } 14914 } 14915} 14916function createIfBranch(node, dir) { 14917 const isTemplateIf = node.tagType === 3; 14918 return { 14919 type: 10, 14920 loc: node.loc, 14921 condition: dir.name === "else" ? void 0 : dir.exp, 14922 children: isTemplateIf && !findDir(node, "for") ? node.children : [node], 14923 userKey: findProp(node, `key`), 14924 isTemplateIf 14925 }; 14926} 14927function createCodegenNodeForBranch(branch, keyIndex, context) { 14928 if (branch.condition) { 14929 return createConditionalExpression( 14930 branch.condition, 14931 createChildrenCodegenNode(branch, keyIndex, context), 14932 // make sure to pass in asBlock: true so that the comment node call 14933 // closes the current block. 14934 createCallExpression(context.helper(CREATE_COMMENT), [ 14935 true ? '"v-if"' : '""', 14936 "true" 14937 ]) 14938 ); 14939 } else { 14940 return createChildrenCodegenNode(branch, keyIndex, context); 14941 } 14942} 14943function createChildrenCodegenNode(branch, keyIndex, context) { 14944 const { helper } = context; 14945 const keyProperty = createObjectProperty( 14946 `key`, 14947 createSimpleExpression( 14948 `${keyIndex}`, 14949 false, 14950 locStub, 14951 2 14952 ) 14953 ); 14954 const { children } = branch; 14955 const firstChild = children[0]; 14956 const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; 14957 if (needFragmentWrapper) { 14958 if (children.length === 1 && firstChild.type === 11) { 14959 const vnodeCall = firstChild.codegenNode; 14960 injectProp(vnodeCall, keyProperty, context); 14961 return vnodeCall; 14962 } else { 14963 let patchFlag = 64; 14964 let patchFlagText = PatchFlagNames[64]; 14965 if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { 14966 patchFlag |= 2048; 14967 patchFlagText += `, ${PatchFlagNames[2048]}`; 14968 } 14969 return createVNodeCall( 14970 context, 14971 helper(FRAGMENT), 14972 createObjectExpression([keyProperty]), 14973 children, 14974 patchFlag, 14975 void 0, 14976 void 0, 14977 true, 14978 false, 14979 false, 14980 branch.loc 14981 ); 14982 } 14983 } else { 14984 const ret = firstChild.codegenNode; 14985 const vnodeCall = getMemoedVNodeCall(ret); 14986 if (vnodeCall.type === 13) { 14987 convertToBlock(vnodeCall, context); 14988 } 14989 injectProp(vnodeCall, keyProperty, context); 14990 return ret; 14991 } 14992} 14993function isSameKey(a, b) { 14994 if (!a || a.type !== b.type) { 14995 return false; 14996 } 14997 if (a.type === 6) { 14998 if (a.value.content !== b.value.content) { 14999 return false; 15000 } 15001 } else { 15002 const exp = a.exp; 15003 const branchExp = b.exp; 15004 if (exp.type !== branchExp.type) { 15005 return false; 15006 } 15007 if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { 15008 return false; 15009 } 15010 } 15011 return true; 15012} 15013function getParentCondition(node) { 15014 while (true) { 15015 if (node.type === 19) { 15016 if (node.alternate.type === 19) { 15017 node = node.alternate; 15018 } else { 15019 return node; 15020 } 15021 } else if (node.type === 20) { 15022 node = node.value; 15023 } 15024 } 15025} 15026var transformBind = (dir, _node, context) => { 15027 const { modifiers, loc } = dir; 15028 const arg = dir.arg; 15029 let { exp } = dir; 15030 if (exp && exp.type === 4 && !exp.content.trim()) { 15031 { 15032 exp = void 0; 15033 } 15034 } 15035 if (!exp) { 15036 if (arg.type !== 4 || !arg.isStatic) { 15037 context.onError( 15038 createCompilerError( 15039 52, 15040 arg.loc 15041 ) 15042 ); 15043 return { 15044 props: [ 15045 createObjectProperty(arg, createSimpleExpression("", true, loc)) 15046 ] 15047 }; 15048 } 15049 transformBindShorthand(dir); 15050 exp = dir.exp; 15051 } 15052 if (arg.type !== 4) { 15053 arg.children.unshift(`(`); 15054 arg.children.push(`) || ""`); 15055 } else if (!arg.isStatic) { 15056 arg.content = `${arg.content} || ""`; 15057 } 15058 if (modifiers.includes("camel")) { 15059 if (arg.type === 4) { 15060 if (arg.isStatic) { 15061 arg.content = camelize(arg.content); 15062 } else { 15063 arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; 15064 } 15065 } else { 15066 arg.children.unshift(`${context.helperString(CAMELIZE)}(`); 15067 arg.children.push(`)`); 15068 } 15069 } 15070 if (!context.inSSR) { 15071 if (modifiers.includes("prop")) { 15072 injectPrefix(arg, "."); 15073 } 15074 if (modifiers.includes("attr")) { 15075 injectPrefix(arg, "^"); 15076 } 15077 } 15078 return { 15079 props: [createObjectProperty(arg, exp)] 15080 }; 15081}; 15082var transformBindShorthand = (dir, context) => { 15083 const arg = dir.arg; 15084 const propName = camelize(arg.content); 15085 dir.exp = createSimpleExpression(propName, false, arg.loc); 15086}; 15087var injectPrefix = (arg, prefix) => { 15088 if (arg.type === 4) { 15089 if (arg.isStatic) { 15090 arg.content = prefix + arg.content; 15091 } else { 15092 arg.content = `\`${prefix}\${${arg.content}}\``; 15093 } 15094 } else { 15095 arg.children.unshift(`'${prefix}' + (`); 15096 arg.children.push(`)`); 15097 } 15098}; 15099var transformFor = createStructuralDirectiveTransform( 15100 "for", 15101 (node, dir, context) => { 15102 const { helper, removeHelper } = context; 15103 return processFor(node, dir, context, (forNode) => { 15104 const renderExp = createCallExpression(helper(RENDER_LIST), [ 15105 forNode.source 15106 ]); 15107 const isTemplate = isTemplateNode(node); 15108 const memo = findDir(node, "memo"); 15109 const keyProp = findProp(node, `key`, false, true); 15110 if (keyProp && keyProp.type === 7 && !keyProp.exp) { 15111 transformBindShorthand(keyProp); 15112 } 15113 const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); 15114 const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; 15115 const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; 15116 const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; 15117 forNode.codegenNode = createVNodeCall( 15118 context, 15119 helper(FRAGMENT), 15120 void 0, 15121 renderExp, 15122 fragmentFlag, 15123 void 0, 15124 void 0, 15125 true, 15126 !isStableFragment, 15127 false, 15128 node.loc 15129 ); 15130 return () => { 15131 let childBlock; 15132 const { children } = forNode; 15133 if (isTemplate) { 15134 node.children.some((c) => { 15135 if (c.type === 1) { 15136 const key = findProp(c, "key"); 15137 if (key) { 15138 context.onError( 15139 createCompilerError( 15140 33, 15141 key.loc 15142 ) 15143 ); 15144 return true; 15145 } 15146 } 15147 }); 15148 } 15149 const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; 15150 const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; 15151 if (slotOutlet) { 15152 childBlock = slotOutlet.codegenNode; 15153 if (isTemplate && keyProperty) { 15154 injectProp(childBlock, keyProperty, context); 15155 } 15156 } else if (needFragmentWrapper) { 15157 childBlock = createVNodeCall( 15158 context, 15159 helper(FRAGMENT), 15160 keyProperty ? createObjectExpression([keyProperty]) : void 0, 15161 node.children, 15162 64, 15163 void 0, 15164 void 0, 15165 true, 15166 void 0, 15167 false 15168 ); 15169 } else { 15170 childBlock = children[0].codegenNode; 15171 if (isTemplate && keyProperty) { 15172 injectProp(childBlock, keyProperty, context); 15173 } 15174 if (childBlock.isBlock !== !isStableFragment) { 15175 if (childBlock.isBlock) { 15176 removeHelper(OPEN_BLOCK); 15177 removeHelper( 15178 getVNodeBlockHelper(context.inSSR, childBlock.isComponent) 15179 ); 15180 } else { 15181 removeHelper( 15182 getVNodeHelper(context.inSSR, childBlock.isComponent) 15183 ); 15184 } 15185 } 15186 childBlock.isBlock = !isStableFragment; 15187 if (childBlock.isBlock) { 15188 helper(OPEN_BLOCK); 15189 helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); 15190 } else { 15191 helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); 15192 } 15193 } 15194 if (memo) { 15195 const loop = createFunctionExpression( 15196 createForLoopParams(forNode.parseResult, [ 15197 createSimpleExpression(`_cached`) 15198 ]) 15199 ); 15200 loop.body = createBlockStatement([ 15201 createCompoundExpression([`const _memo = (`, memo.exp, `)`]), 15202 createCompoundExpression([ 15203 `if (_cached`, 15204 ...keyExp ? [` && _cached.key === `, keyExp] : [], 15205 ` && ${context.helperString( 15206 IS_MEMO_SAME 15207 )}(_cached, _memo)) return _cached` 15208 ]), 15209 createCompoundExpression([`const _item = `, childBlock]), 15210 createSimpleExpression(`_item.memo = _memo`), 15211 createSimpleExpression(`return _item`) 15212 ]); 15213 renderExp.arguments.push( 15214 loop, 15215 createSimpleExpression(`_cache`), 15216 createSimpleExpression(String(context.cached++)) 15217 ); 15218 } else { 15219 renderExp.arguments.push( 15220 createFunctionExpression( 15221 createForLoopParams(forNode.parseResult), 15222 childBlock, 15223 true 15224 ) 15225 ); 15226 } 15227 }; 15228 }); 15229 } 15230); 15231function processFor(node, dir, context, processCodegen) { 15232 if (!dir.exp) { 15233 context.onError( 15234 createCompilerError(31, dir.loc) 15235 ); 15236 return; 15237 } 15238 const parseResult = dir.forParseResult; 15239 if (!parseResult) { 15240 context.onError( 15241 createCompilerError(32, dir.loc) 15242 ); 15243 return; 15244 } 15245 finalizeForParseResult(parseResult, context); 15246 const { addIdentifiers, removeIdentifiers, scopes } = context; 15247 const { source, value, key, index } = parseResult; 15248 const forNode = { 15249 type: 11, 15250 loc: dir.loc, 15251 source, 15252 valueAlias: value, 15253 keyAlias: key, 15254 objectIndexAlias: index, 15255 parseResult, 15256 children: isTemplateNode(node) ? node.children : [node] 15257 }; 15258 context.replaceNode(forNode); 15259 scopes.vFor++; 15260 const onExit = processCodegen && processCodegen(forNode); 15261 return () => { 15262 scopes.vFor--; 15263 if (onExit) onExit(); 15264 }; 15265} 15266function finalizeForParseResult(result, context) { 15267 if (result.finalized) return; 15268 if (true) { 15269 validateBrowserExpression(result.source, context); 15270 if (result.key) { 15271 validateBrowserExpression( 15272 result.key, 15273 context, 15274 true 15275 ); 15276 } 15277 if (result.index) { 15278 validateBrowserExpression( 15279 result.index, 15280 context, 15281 true 15282 ); 15283 } 15284 if (result.value) { 15285 validateBrowserExpression( 15286 result.value, 15287 context, 15288 true 15289 ); 15290 } 15291 } 15292 result.finalized = true; 15293} 15294function createForLoopParams({ value, key, index }, memoArgs = []) { 15295 return createParamsList([value, key, index, ...memoArgs]); 15296} 15297function createParamsList(args) { 15298 let i = args.length; 15299 while (i--) { 15300 if (args[i]) break; 15301 } 15302 return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); 15303} 15304var defaultFallback = createSimpleExpression(`undefined`, false); 15305var trackSlotScopes = (node, context) => { 15306 if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { 15307 const vSlot = findDir(node, "slot"); 15308 if (vSlot) { 15309 vSlot.exp; 15310 context.scopes.vSlot++; 15311 return () => { 15312 context.scopes.vSlot--; 15313 }; 15314 } 15315 } 15316}; 15317var buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( 15318 props, 15319 children, 15320 false, 15321 true, 15322 children.length ? children[0].loc : loc 15323); 15324function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { 15325 context.helper(WITH_CTX); 15326 const { children, loc } = node; 15327 const slotsProperties = []; 15328 const dynamicSlots = []; 15329 let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; 15330 const onComponentSlot = findDir(node, "slot", true); 15331 if (onComponentSlot) { 15332 const { arg, exp } = onComponentSlot; 15333 if (arg && !isStaticExp(arg)) { 15334 hasDynamicSlots = true; 15335 } 15336 slotsProperties.push( 15337 createObjectProperty( 15338 arg || createSimpleExpression("default", true), 15339 buildSlotFn(exp, void 0, children, loc) 15340 ) 15341 ); 15342 } 15343 let hasTemplateSlots = false; 15344 let hasNamedDefaultSlot = false; 15345 const implicitDefaultChildren = []; 15346 const seenSlotNames = /* @__PURE__ */ new Set(); 15347 let conditionalBranchIndex = 0; 15348 for (let i = 0; i < children.length; i++) { 15349 const slotElement = children[i]; 15350 let slotDir; 15351 if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { 15352 if (slotElement.type !== 3) { 15353 implicitDefaultChildren.push(slotElement); 15354 } 15355 continue; 15356 } 15357 if (onComponentSlot) { 15358 context.onError( 15359 createCompilerError(37, slotDir.loc) 15360 ); 15361 break; 15362 } 15363 hasTemplateSlots = true; 15364 const { children: slotChildren, loc: slotLoc } = slotElement; 15365 const { 15366 arg: slotName = createSimpleExpression(`default`, true), 15367 exp: slotProps, 15368 loc: dirLoc 15369 } = slotDir; 15370 let staticSlotName; 15371 if (isStaticExp(slotName)) { 15372 staticSlotName = slotName ? slotName.content : `default`; 15373 } else { 15374 hasDynamicSlots = true; 15375 } 15376 const vFor = findDir(slotElement, "for"); 15377 const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); 15378 let vIf; 15379 let vElse; 15380 if (vIf = findDir(slotElement, "if")) { 15381 hasDynamicSlots = true; 15382 dynamicSlots.push( 15383 createConditionalExpression( 15384 vIf.exp, 15385 buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), 15386 defaultFallback 15387 ) 15388 ); 15389 } else if (vElse = findDir( 15390 slotElement, 15391 /^else(-if)?$/, 15392 true 15393 /* allowEmpty */ 15394 )) { 15395 let j = i; 15396 let prev; 15397 while (j--) { 15398 prev = children[j]; 15399 if (prev.type !== 3) { 15400 break; 15401 } 15402 } 15403 if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { 15404 let conditional = dynamicSlots[dynamicSlots.length - 1]; 15405 while (conditional.alternate.type === 19) { 15406 conditional = conditional.alternate; 15407 } 15408 conditional.alternate = vElse.exp ? createConditionalExpression( 15409 vElse.exp, 15410 buildDynamicSlot( 15411 slotName, 15412 slotFunction, 15413 conditionalBranchIndex++ 15414 ), 15415 defaultFallback 15416 ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); 15417 } else { 15418 context.onError( 15419 createCompilerError(30, vElse.loc) 15420 ); 15421 } 15422 } else if (vFor) { 15423 hasDynamicSlots = true; 15424 const parseResult = vFor.forParseResult; 15425 if (parseResult) { 15426 finalizeForParseResult(parseResult, context); 15427 dynamicSlots.push( 15428 createCallExpression(context.helper(RENDER_LIST), [ 15429 parseResult.source, 15430 createFunctionExpression( 15431 createForLoopParams(parseResult), 15432 buildDynamicSlot(slotName, slotFunction), 15433 true 15434 ) 15435 ]) 15436 ); 15437 } else { 15438 context.onError( 15439 createCompilerError( 15440 32, 15441 vFor.loc 15442 ) 15443 ); 15444 } 15445 } else { 15446 if (staticSlotName) { 15447 if (seenSlotNames.has(staticSlotName)) { 15448 context.onError( 15449 createCompilerError( 15450 38, 15451 dirLoc 15452 ) 15453 ); 15454 continue; 15455 } 15456 seenSlotNames.add(staticSlotName); 15457 if (staticSlotName === "default") { 15458 hasNamedDefaultSlot = true; 15459 } 15460 } 15461 slotsProperties.push(createObjectProperty(slotName, slotFunction)); 15462 } 15463 } 15464 if (!onComponentSlot) { 15465 const buildDefaultSlotProperty = (props, children2) => { 15466 const fn = buildSlotFn(props, void 0, children2, loc); 15467 if (context.compatConfig) { 15468 fn.isNonScopedSlot = true; 15469 } 15470 return createObjectProperty(`default`, fn); 15471 }; 15472 if (!hasTemplateSlots) { 15473 slotsProperties.push(buildDefaultSlotProperty(void 0, children)); 15474 } else if (implicitDefaultChildren.length && // #3766 15475 // with whitespace: 'preserve', whitespaces between slots will end up in 15476 // implicitDefaultChildren. Ignore if all implicit children are whitespaces. 15477 implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { 15478 if (hasNamedDefaultSlot) { 15479 context.onError( 15480 createCompilerError( 15481 39, 15482 implicitDefaultChildren[0].loc 15483 ) 15484 ); 15485 } else { 15486 slotsProperties.push( 15487 buildDefaultSlotProperty(void 0, implicitDefaultChildren) 15488 ); 15489 } 15490 } 15491 } 15492 const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; 15493 let slots = createObjectExpression( 15494 slotsProperties.concat( 15495 createObjectProperty( 15496 `_`, 15497 // 2 = compiled but dynamic = can skip normalization, but must run diff 15498 // 1 = compiled and static = can skip normalization AND diff as optimized 15499 createSimpleExpression( 15500 slotFlag + (true ? ` /* ${slotFlagsText[slotFlag]} */` : ``), 15501 false 15502 ) 15503 ) 15504 ), 15505 loc 15506 ); 15507 if (dynamicSlots.length) { 15508 slots = createCallExpression(context.helper(CREATE_SLOTS), [ 15509 slots, 15510 createArrayExpression(dynamicSlots) 15511 ]); 15512 } 15513 return { 15514 slots, 15515 hasDynamicSlots 15516 }; 15517} 15518function buildDynamicSlot(name, fn, index) { 15519 const props = [ 15520 createObjectProperty(`name`, name), 15521 createObjectProperty(`fn`, fn) 15522 ]; 15523 if (index != null) { 15524 props.push( 15525 createObjectProperty(`key`, createSimpleExpression(String(index), true)) 15526 ); 15527 } 15528 return createObjectExpression(props); 15529} 15530function hasForwardedSlots(children) { 15531 for (let i = 0; i < children.length; i++) { 15532 const child = children[i]; 15533 switch (child.type) { 15534 case 1: 15535 if (child.tagType === 2 || hasForwardedSlots(child.children)) { 15536 return true; 15537 } 15538 break; 15539 case 9: 15540 if (hasForwardedSlots(child.branches)) return true; 15541 break; 15542 case 10: 15543 case 11: 15544 if (hasForwardedSlots(child.children)) return true; 15545 break; 15546 } 15547 } 15548 return false; 15549} 15550function isNonWhitespaceContent(node) { 15551 if (node.type !== 2 && node.type !== 12) 15552 return true; 15553 return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); 15554} 15555var directiveImportMap = /* @__PURE__ */ new WeakMap(); 15556var transformElement = (node, context) => { 15557 return function postTransformElement() { 15558 node = context.currentNode; 15559 if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { 15560 return; 15561 } 15562 const { tag, props } = node; 15563 const isComponent2 = node.tagType === 1; 15564 let vnodeTag = isComponent2 ? resolveComponentType(node, context) : `"${tag}"`; 15565 const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; 15566 let vnodeProps; 15567 let vnodeChildren; 15568 let patchFlag = 0; 15569 let vnodeDynamicProps; 15570 let dynamicPropNames; 15571 let vnodeDirectives; 15572 let shouldUseBlock = ( 15573 // dynamic component may resolve to plain elements 15574 isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent2 && // <svg> and <foreignObject> must be forced into blocks so that block 15575 // updates inside get proper isSVG flag at runtime. (#639, #643) 15576 // This is technically web-specific, but splitting the logic out of core 15577 // leads to too much unnecessary complexity. 15578 (tag === "svg" || tag === "foreignObject" || tag === "math") 15579 ); 15580 if (props.length > 0) { 15581 const propsBuildResult = buildProps( 15582 node, 15583 context, 15584 void 0, 15585 isComponent2, 15586 isDynamicComponent 15587 ); 15588 vnodeProps = propsBuildResult.props; 15589 patchFlag = propsBuildResult.patchFlag; 15590 dynamicPropNames = propsBuildResult.dynamicPropNames; 15591 const directives = propsBuildResult.directives; 15592 vnodeDirectives = directives && directives.length ? createArrayExpression( 15593 directives.map((dir) => buildDirectiveArgs(dir, context)) 15594 ) : void 0; 15595 if (propsBuildResult.shouldUseBlock) { 15596 shouldUseBlock = true; 15597 } 15598 } 15599 if (node.children.length > 0) { 15600 if (vnodeTag === KEEP_ALIVE) { 15601 shouldUseBlock = true; 15602 patchFlag |= 1024; 15603 if (node.children.length > 1) { 15604 context.onError( 15605 createCompilerError(46, { 15606 start: node.children[0].loc.start, 15607 end: node.children[node.children.length - 1].loc.end, 15608 source: "" 15609 }) 15610 ); 15611 } 15612 } 15613 const shouldBuildAsSlots = isComponent2 && // Teleport is not a real component and has dedicated runtime handling 15614 vnodeTag !== TELEPORT && // explained above. 15615 vnodeTag !== KEEP_ALIVE; 15616 if (shouldBuildAsSlots) { 15617 const { slots, hasDynamicSlots } = buildSlots(node, context); 15618 vnodeChildren = slots; 15619 if (hasDynamicSlots) { 15620 patchFlag |= 1024; 15621 } 15622 } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { 15623 const child = node.children[0]; 15624 const type = child.type; 15625 const hasDynamicTextChild = type === 5 || type === 8; 15626 if (hasDynamicTextChild && getConstantType(child, context) === 0) { 15627 patchFlag |= 1; 15628 } 15629 if (hasDynamicTextChild || type === 2) { 15630 vnodeChildren = child; 15631 } else { 15632 vnodeChildren = node.children; 15633 } 15634 } else { 15635 vnodeChildren = node.children; 15636 } 15637 } 15638 if (dynamicPropNames && dynamicPropNames.length) { 15639 vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); 15640 } 15641 node.codegenNode = createVNodeCall( 15642 context, 15643 vnodeTag, 15644 vnodeProps, 15645 vnodeChildren, 15646 patchFlag === 0 ? void 0 : patchFlag, 15647 vnodeDynamicProps, 15648 vnodeDirectives, 15649 !!shouldUseBlock, 15650 false, 15651 isComponent2, 15652 node.loc 15653 ); 15654 }; 15655}; 15656function resolveComponentType(node, context, ssr = false) { 15657 let { tag } = node; 15658 const isExplicitDynamic = isComponentTag(tag); 15659 const isProp = findProp( 15660 node, 15661 "is", 15662 false, 15663 true 15664 /* allow empty */ 15665 ); 15666 if (isProp) { 15667 if (isExplicitDynamic || isCompatEnabled( 15668 "COMPILER_IS_ON_ELEMENT", 15669 context 15670 )) { 15671 let exp; 15672 if (isProp.type === 6) { 15673 exp = isProp.value && createSimpleExpression(isProp.value.content, true); 15674 } else { 15675 exp = isProp.exp; 15676 if (!exp) { 15677 exp = createSimpleExpression(`is`, false, isProp.loc); 15678 } 15679 } 15680 if (exp) { 15681 return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ 15682 exp 15683 ]); 15684 } 15685 } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { 15686 tag = isProp.value.content.slice(4); 15687 } 15688 } 15689 const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); 15690 if (builtIn) { 15691 if (!ssr) context.helper(builtIn); 15692 return builtIn; 15693 } 15694 context.helper(RESOLVE_COMPONENT); 15695 context.components.add(tag); 15696 return toValidAssetId(tag, `component`); 15697} 15698function buildProps(node, context, props = node.props, isComponent2, isDynamicComponent, ssr = false) { 15699 const { tag, loc: elementLoc, children } = node; 15700 let properties = []; 15701 const mergeArgs = []; 15702 const runtimeDirectives = []; 15703 const hasChildren = children.length > 0; 15704 let shouldUseBlock = false; 15705 let patchFlag = 0; 15706 let hasRef = false; 15707 let hasClassBinding = false; 15708 let hasStyleBinding = false; 15709 let hasHydrationEventBinding = false; 15710 let hasDynamicKeys = false; 15711 let hasVnodeHook = false; 15712 const dynamicPropNames = []; 15713 const pushMergeArg = (arg) => { 15714 if (properties.length) { 15715 mergeArgs.push( 15716 createObjectExpression(dedupeProperties(properties), elementLoc) 15717 ); 15718 properties = []; 15719 } 15720 if (arg) mergeArgs.push(arg); 15721 }; 15722 const pushRefVForMarker = () => { 15723 if (context.scopes.vFor > 0) { 15724 properties.push( 15725 createObjectProperty( 15726 createSimpleExpression("ref_for", true), 15727 createSimpleExpression("true") 15728 ) 15729 ); 15730 } 15731 }; 15732 const analyzePatchFlag = ({ key, value }) => { 15733 if (isStaticExp(key)) { 15734 const name = key.content; 15735 const isEventHandler = isOn(name); 15736 if (isEventHandler && (!isComponent2 || isDynamicComponent) && // omit the flag for click handlers because hydration gives click 15737 // dedicated fast path. 15738 name.toLowerCase() !== "onclick" && // omit v-model handlers 15739 name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks 15740 !isReservedProp(name)) { 15741 hasHydrationEventBinding = true; 15742 } 15743 if (isEventHandler && isReservedProp(name)) { 15744 hasVnodeHook = true; 15745 } 15746 if (isEventHandler && value.type === 14) { 15747 value = value.arguments[0]; 15748 } 15749 if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { 15750 return; 15751 } 15752 if (name === "ref") { 15753 hasRef = true; 15754 } else if (name === "class") { 15755 hasClassBinding = true; 15756 } else if (name === "style") { 15757 hasStyleBinding = true; 15758 } else if (name !== "key" && !dynamicPropNames.includes(name)) { 15759 dynamicPropNames.push(name); 15760 } 15761 if (isComponent2 && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { 15762 dynamicPropNames.push(name); 15763 } 15764 } else { 15765 hasDynamicKeys = true; 15766 } 15767 }; 15768 for (let i = 0; i < props.length; i++) { 15769 const prop = props[i]; 15770 if (prop.type === 6) { 15771 const { loc, name, nameLoc, value } = prop; 15772 let isStatic = true; 15773 if (name === "ref") { 15774 hasRef = true; 15775 pushRefVForMarker(); 15776 } 15777 if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( 15778 "COMPILER_IS_ON_ELEMENT", 15779 context 15780 ))) { 15781 continue; 15782 } 15783 properties.push( 15784 createObjectProperty( 15785 createSimpleExpression(name, true, nameLoc), 15786 createSimpleExpression( 15787 value ? value.content : "", 15788 isStatic, 15789 value ? value.loc : loc 15790 ) 15791 ) 15792 ); 15793 } else { 15794 const { name, arg, exp, loc, modifiers } = prop; 15795 const isVBind = name === "bind"; 15796 const isVOn = name === "on"; 15797 if (name === "slot") { 15798 if (!isComponent2) { 15799 context.onError( 15800 createCompilerError(40, loc) 15801 ); 15802 } 15803 continue; 15804 } 15805 if (name === "once" || name === "memo") { 15806 continue; 15807 } 15808 if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( 15809 "COMPILER_IS_ON_ELEMENT", 15810 context 15811 ))) { 15812 continue; 15813 } 15814 if (isVOn && ssr) { 15815 continue; 15816 } 15817 if ( 15818 // #938: elements with dynamic keys should be forced into blocks 15819 isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked 15820 // before children 15821 isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") 15822 ) { 15823 shouldUseBlock = true; 15824 } 15825 if (isVBind && isStaticArgOf(arg, "ref")) { 15826 pushRefVForMarker(); 15827 } 15828 if (!arg && (isVBind || isVOn)) { 15829 hasDynamicKeys = true; 15830 if (exp) { 15831 if (isVBind) { 15832 pushRefVForMarker(); 15833 pushMergeArg(); 15834 { 15835 if (true) { 15836 const hasOverridableKeys = mergeArgs.some((arg2) => { 15837 if (arg2.type === 15) { 15838 return arg2.properties.some(({ key }) => { 15839 if (key.type !== 4 || !key.isStatic) { 15840 return true; 15841 } 15842 return key.content !== "class" && key.content !== "style" && !isOn(key.content); 15843 }); 15844 } else { 15845 return true; 15846 } 15847 }); 15848 if (hasOverridableKeys) { 15849 checkCompatEnabled( 15850 "COMPILER_V_BIND_OBJECT_ORDER", 15851 context, 15852 loc 15853 ); 15854 } 15855 } 15856 if (isCompatEnabled( 15857 "COMPILER_V_BIND_OBJECT_ORDER", 15858 context 15859 )) { 15860 mergeArgs.unshift(exp); 15861 continue; 15862 } 15863 } 15864 mergeArgs.push(exp); 15865 } else { 15866 pushMergeArg({ 15867 type: 14, 15868 loc, 15869 callee: context.helper(TO_HANDLERS), 15870 arguments: isComponent2 ? [exp] : [exp, `true`] 15871 }); 15872 } 15873 } else { 15874 context.onError( 15875 createCompilerError( 15876 isVBind ? 34 : 35, 15877 loc 15878 ) 15879 ); 15880 } 15881 continue; 15882 } 15883 if (isVBind && modifiers.includes("prop")) { 15884 patchFlag |= 32; 15885 } 15886 const directiveTransform = context.directiveTransforms[name]; 15887 if (directiveTransform) { 15888 const { props: props2, needRuntime } = directiveTransform(prop, node, context); 15889 !ssr && props2.forEach(analyzePatchFlag); 15890 if (isVOn && arg && !isStaticExp(arg)) { 15891 pushMergeArg(createObjectExpression(props2, elementLoc)); 15892 } else { 15893 properties.push(...props2); 15894 } 15895 if (needRuntime) { 15896 runtimeDirectives.push(prop); 15897 if (isSymbol(needRuntime)) { 15898 directiveImportMap.set(prop, needRuntime); 15899 } 15900 } 15901 } else if (!isBuiltInDirective(name)) { 15902 runtimeDirectives.push(prop); 15903 if (hasChildren) { 15904 shouldUseBlock = true; 15905 } 15906 } 15907 } 15908 } 15909 let propsExpression = void 0; 15910 if (mergeArgs.length) { 15911 pushMergeArg(); 15912 if (mergeArgs.length > 1) { 15913 propsExpression = createCallExpression( 15914 context.helper(MERGE_PROPS), 15915 mergeArgs, 15916 elementLoc 15917 ); 15918 } else { 15919 propsExpression = mergeArgs[0]; 15920 } 15921 } else if (properties.length) { 15922 propsExpression = createObjectExpression( 15923 dedupeProperties(properties), 15924 elementLoc 15925 ); 15926 } 15927 if (hasDynamicKeys) { 15928 patchFlag |= 16; 15929 } else { 15930 if (hasClassBinding && !isComponent2) { 15931 patchFlag |= 2; 15932 } 15933 if (hasStyleBinding && !isComponent2) { 15934 patchFlag |= 4; 15935 } 15936 if (dynamicPropNames.length) { 15937 patchFlag |= 8; 15938 } 15939 if (hasHydrationEventBinding) { 15940 patchFlag |= 32; 15941 } 15942 } 15943 if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { 15944 patchFlag |= 512; 15945 } 15946 if (!context.inSSR && propsExpression) { 15947 switch (propsExpression.type) { 15948 case 15: 15949 let classKeyIndex = -1; 15950 let styleKeyIndex = -1; 15951 let hasDynamicKey = false; 15952 for (let i = 0; i < propsExpression.properties.length; i++) { 15953 const key = propsExpression.properties[i].key; 15954 if (isStaticExp(key)) { 15955 if (key.content === "class") { 15956 classKeyIndex = i; 15957 } else if (key.content === "style") { 15958 styleKeyIndex = i; 15959 } 15960 } else if (!key.isHandlerKey) { 15961 hasDynamicKey = true; 15962 } 15963 } 15964 const classProp = propsExpression.properties[classKeyIndex]; 15965 const styleProp = propsExpression.properties[styleKeyIndex]; 15966 if (!hasDynamicKey) { 15967 if (classProp && !isStaticExp(classProp.value)) { 15968 classProp.value = createCallExpression( 15969 context.helper(NORMALIZE_CLASS), 15970 [classProp.value] 15971 ); 15972 } 15973 if (styleProp && // the static style is compiled into an object, 15974 // so use `hasStyleBinding` to ensure that it is a dynamic style binding 15975 (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, 15976 // v-bind:style with static literal object 15977 styleProp.value.type === 17)) { 15978 styleProp.value = createCallExpression( 15979 context.helper(NORMALIZE_STYLE), 15980 [styleProp.value] 15981 ); 15982 } 15983 } else { 15984 propsExpression = createCallExpression( 15985 context.helper(NORMALIZE_PROPS), 15986 [propsExpression] 15987 ); 15988 } 15989 break; 15990 case 14: 15991 break; 15992 default: 15993 propsExpression = createCallExpression( 15994 context.helper(NORMALIZE_PROPS), 15995 [ 15996 createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ 15997 propsExpression 15998 ]) 15999 ] 16000 ); 16001 break; 16002 } 16003 } 16004 return { 16005 props: propsExpression, 16006 directives: runtimeDirectives, 16007 patchFlag, 16008 dynamicPropNames, 16009 shouldUseBlock 16010 }; 16011} 16012function dedupeProperties(properties) { 16013 const knownProps = /* @__PURE__ */ new Map(); 16014 const deduped = []; 16015 for (let i = 0; i < properties.length; i++) { 16016 const prop = properties[i]; 16017 if (prop.key.type === 8 || !prop.key.isStatic) { 16018 deduped.push(prop); 16019 continue; 16020 } 16021 const name = prop.key.content; 16022 const existing = knownProps.get(name); 16023 if (existing) { 16024 if (name === "style" || name === "class" || isOn(name)) { 16025 mergeAsArray2(existing, prop); 16026 } 16027 } else { 16028 knownProps.set(name, prop); 16029 deduped.push(prop); 16030 } 16031 } 16032 return deduped; 16033} 16034function mergeAsArray2(existing, incoming) { 16035 if (existing.value.type === 17) { 16036 existing.value.elements.push(incoming.value); 16037 } else { 16038 existing.value = createArrayExpression( 16039 [existing.value, incoming.value], 16040 existing.loc 16041 ); 16042 } 16043} 16044function buildDirectiveArgs(dir, context) { 16045 const dirArgs = []; 16046 const runtime = directiveImportMap.get(dir); 16047 if (runtime) { 16048 dirArgs.push(context.helperString(runtime)); 16049 } else { 16050 { 16051 context.helper(RESOLVE_DIRECTIVE); 16052 context.directives.add(dir.name); 16053 dirArgs.push(toValidAssetId(dir.name, `directive`)); 16054 } 16055 } 16056 const { loc } = dir; 16057 if (dir.exp) dirArgs.push(dir.exp); 16058 if (dir.arg) { 16059 if (!dir.exp) { 16060 dirArgs.push(`void 0`); 16061 } 16062 dirArgs.push(dir.arg); 16063 } 16064 if (Object.keys(dir.modifiers).length) { 16065 if (!dir.arg) { 16066 if (!dir.exp) { 16067 dirArgs.push(`void 0`); 16068 } 16069 dirArgs.push(`void 0`); 16070 } 16071 const trueExpression = createSimpleExpression(`true`, false, loc); 16072 dirArgs.push( 16073 createObjectExpression( 16074 dir.modifiers.map( 16075 (modifier) => createObjectProperty(modifier, trueExpression) 16076 ), 16077 loc 16078 ) 16079 ); 16080 } 16081 return createArrayExpression(dirArgs, dir.loc); 16082} 16083function stringifyDynamicPropNames(props) { 16084 let propsNamesString = `[`; 16085 for (let i = 0, l = props.length; i < l; i++) { 16086 propsNamesString += JSON.stringify(props[i]); 16087 if (i < l - 1) propsNamesString += ", "; 16088 } 16089 return propsNamesString + `]`; 16090} 16091function isComponentTag(tag) { 16092 return tag === "component" || tag === "Component"; 16093} 16094var transformSlotOutlet = (node, context) => { 16095 if (isSlotOutlet(node)) { 16096 const { children, loc } = node; 16097 const { slotName, slotProps } = processSlotOutlet(node, context); 16098 const slotArgs = [ 16099 context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, 16100 slotName, 16101 "{}", 16102 "undefined", 16103 "true" 16104 ]; 16105 let expectedLen = 2; 16106 if (slotProps) { 16107 slotArgs[2] = slotProps; 16108 expectedLen = 3; 16109 } 16110 if (children.length) { 16111 slotArgs[3] = createFunctionExpression([], children, false, false, loc); 16112 expectedLen = 4; 16113 } 16114 if (context.scopeId && !context.slotted) { 16115 expectedLen = 5; 16116 } 16117 slotArgs.splice(expectedLen); 16118 node.codegenNode = createCallExpression( 16119 context.helper(RENDER_SLOT), 16120 slotArgs, 16121 loc 16122 ); 16123 } 16124}; 16125function processSlotOutlet(node, context) { 16126 let slotName = `"default"`; 16127 let slotProps = void 0; 16128 const nonNameProps = []; 16129 for (let i = 0; i < node.props.length; i++) { 16130 const p2 = node.props[i]; 16131 if (p2.type === 6) { 16132 if (p2.value) { 16133 if (p2.name === "name") { 16134 slotName = JSON.stringify(p2.value.content); 16135 } else { 16136 p2.name = camelize(p2.name); 16137 nonNameProps.push(p2); 16138 } 16139 } 16140 } else { 16141 if (p2.name === "bind" && isStaticArgOf(p2.arg, "name")) { 16142 if (p2.exp) { 16143 slotName = p2.exp; 16144 } else if (p2.arg && p2.arg.type === 4) { 16145 const name = camelize(p2.arg.content); 16146 slotName = p2.exp = createSimpleExpression(name, false, p2.arg.loc); 16147 } 16148 } else { 16149 if (p2.name === "bind" && p2.arg && isStaticExp(p2.arg)) { 16150 p2.arg.content = camelize(p2.arg.content); 16151 } 16152 nonNameProps.push(p2); 16153 } 16154 } 16155 } 16156 if (nonNameProps.length > 0) { 16157 const { props, directives } = buildProps( 16158 node, 16159 context, 16160 nonNameProps, 16161 false, 16162 false 16163 ); 16164 slotProps = props; 16165 if (directives.length) { 16166 context.onError( 16167 createCompilerError( 16168 36, 16169 directives[0].loc 16170 ) 16171 ); 16172 } 16173 } 16174 return { 16175 slotName, 16176 slotProps 16177 }; 16178} 16179var fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; 16180var transformOn = (dir, node, context, augmentor) => { 16181 const { loc, modifiers, arg } = dir; 16182 if (!dir.exp && !modifiers.length) { 16183 context.onError(createCompilerError(35, loc)); 16184 } 16185 let eventName; 16186 if (arg.type === 4) { 16187 if (arg.isStatic) { 16188 let rawName = arg.content; 16189 if (rawName.startsWith("vnode")) { 16190 context.onError(createCompilerError(51, arg.loc)); 16191 } 16192 if (rawName.startsWith("vue:")) { 16193 rawName = `vnode-${rawName.slice(4)}`; 16194 } 16195 const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( 16196 // for non-element and vnode lifecycle event listeners, auto convert 16197 // it to camelCase. See issue #2249 16198 toHandlerKey(camelize(rawName)) 16199 ) : ( 16200 // preserve case for plain element listeners that have uppercase 16201 // letters, as these may be custom elements' custom events 16202 `on:${rawName}` 16203 ); 16204 eventName = createSimpleExpression(eventString, true, arg.loc); 16205 } else { 16206 eventName = createCompoundExpression([ 16207 `${context.helperString(TO_HANDLER_KEY)}(`, 16208 arg, 16209 `)` 16210 ]); 16211 } 16212 } else { 16213 eventName = arg; 16214 eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); 16215 eventName.children.push(`)`); 16216 } 16217 let exp = dir.exp; 16218 if (exp && !exp.content.trim()) { 16219 exp = void 0; 16220 } 16221 let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; 16222 if (exp) { 16223 const isMemberExp = isMemberExpression(exp.content); 16224 const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content)); 16225 const hasMultipleStatements = exp.content.includes(`;`); 16226 if (true) { 16227 validateBrowserExpression( 16228 exp, 16229 context, 16230 false, 16231 hasMultipleStatements 16232 ); 16233 } 16234 if (isInlineStatement || shouldCache && isMemberExp) { 16235 exp = createCompoundExpression([ 16236 `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, 16237 exp, 16238 hasMultipleStatements ? `}` : `)` 16239 ]); 16240 } 16241 } 16242 let ret = { 16243 props: [ 16244 createObjectProperty( 16245 eventName, 16246 exp || createSimpleExpression(`() => {}`, false, loc) 16247 ) 16248 ] 16249 }; 16250 if (augmentor) { 16251 ret = augmentor(ret); 16252 } 16253 if (shouldCache) { 16254 ret.props[0].value = context.cache(ret.props[0].value); 16255 } 16256 ret.props.forEach((p2) => p2.key.isHandlerKey = true); 16257 return ret; 16258}; 16259var transformText = (node, context) => { 16260 if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { 16261 return () => { 16262 const children = node.children; 16263 let currentContainer = void 0; 16264 let hasText = false; 16265 for (let i = 0; i < children.length; i++) { 16266 const child = children[i]; 16267 if (isText$1(child)) { 16268 hasText = true; 16269 for (let j = i + 1; j < children.length; j++) { 16270 const next = children[j]; 16271 if (isText$1(next)) { 16272 if (!currentContainer) { 16273 currentContainer = children[i] = createCompoundExpression( 16274 [child], 16275 child.loc 16276 ); 16277 } 16278 currentContainer.children.push(` + `, next); 16279 children.splice(j, 1); 16280 j--; 16281 } else { 16282 currentContainer = void 0; 16283 break; 16284 } 16285 } 16286 } 16287 } 16288 if (!hasText || // if this is a plain element with a single text child, leave it 16289 // as-is since the runtime has dedicated fast path for this by directly 16290 // setting textContent of the element. 16291 // for component root it's always normalized anyway. 16292 children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 16293 // custom directives can potentially add DOM elements arbitrarily, 16294 // we need to avoid setting textContent of the element at runtime 16295 // to avoid accidentally overwriting the DOM elements added 16296 // by the user through custom directives. 16297 !node.props.find( 16298 (p2) => p2.type === 7 && !context.directiveTransforms[p2.name] 16299 ) && // in compat mode, <template> tags with no special directives 16300 // will be rendered as a fragment so its children must be 16301 // converted into vnodes. 16302 !(node.tag === "template"))) { 16303 return; 16304 } 16305 for (let i = 0; i < children.length; i++) { 16306 const child = children[i]; 16307 if (isText$1(child) || child.type === 8) { 16308 const callArgs = []; 16309 if (child.type !== 2 || child.content !== " ") { 16310 callArgs.push(child); 16311 } 16312 if (!context.ssr && getConstantType(child, context) === 0) { 16313 callArgs.push( 16314 1 + (true ? ` /* ${PatchFlagNames[1]} */` : ``) 16315 ); 16316 } 16317 children[i] = { 16318 type: 12, 16319 content: child, 16320 loc: child.loc, 16321 codegenNode: createCallExpression( 16322 context.helper(CREATE_TEXT), 16323 callArgs 16324 ) 16325 }; 16326 } 16327 } 16328 }; 16329 } 16330}; 16331var seen$1 = /* @__PURE__ */ new WeakSet(); 16332var transformOnce = (node, context) => { 16333 if (node.type === 1 && findDir(node, "once", true)) { 16334 if (seen$1.has(node) || context.inVOnce || context.inSSR) { 16335 return; 16336 } 16337 seen$1.add(node); 16338 context.inVOnce = true; 16339 context.helper(SET_BLOCK_TRACKING); 16340 return () => { 16341 context.inVOnce = false; 16342 const cur = context.currentNode; 16343 if (cur.codegenNode) { 16344 cur.codegenNode = context.cache( 16345 cur.codegenNode, 16346 true 16347 /* isVNode */ 16348 ); 16349 } 16350 }; 16351 } 16352}; 16353var transformModel = (dir, node, context) => { 16354 const { exp, arg } = dir; 16355 if (!exp) { 16356 context.onError( 16357 createCompilerError(41, dir.loc) 16358 ); 16359 return createTransformProps(); 16360 } 16361 const rawExp = exp.loc.source; 16362 const expString = exp.type === 4 ? exp.content : rawExp; 16363 const bindingType = context.bindingMetadata[rawExp]; 16364 if (bindingType === "props" || bindingType === "props-aliased") { 16365 context.onError(createCompilerError(44, exp.loc)); 16366 return createTransformProps(); 16367 } 16368 const maybeRef = false; 16369 if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) { 16370 context.onError( 16371 createCompilerError(42, exp.loc) 16372 ); 16373 return createTransformProps(); 16374 } 16375 const propName = arg ? arg : createSimpleExpression("modelValue", true); 16376 const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; 16377 let assignmentExp; 16378 const eventArg = context.isTS ? `($event: any)` : `$event`; 16379 { 16380 assignmentExp = createCompoundExpression([ 16381 `${eventArg} => ((`, 16382 exp, 16383 `) = $event)` 16384 ]); 16385 } 16386 const props = [ 16387 // modelValue: foo 16388 createObjectProperty(propName, dir.exp), 16389 // "onUpdate:modelValue": $event => (foo = $event) 16390 createObjectProperty(eventName, assignmentExp) 16391 ]; 16392 if (dir.modifiers.length && node.tagType === 1) { 16393 const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); 16394 const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; 16395 props.push( 16396 createObjectProperty( 16397 modifiersKey, 16398 createSimpleExpression( 16399 `{ ${modifiers} }`, 16400 false, 16401 dir.loc, 16402 2 16403 ) 16404 ) 16405 ); 16406 } 16407 return createTransformProps(props); 16408}; 16409function createTransformProps(props = []) { 16410 return { props }; 16411} 16412var validDivisionCharRE = /[\w).+\-_$\]]/; 16413var transformFilter = (node, context) => { 16414 if (!isCompatEnabled("COMPILER_FILTERS", context)) { 16415 return; 16416 } 16417 if (node.type === 5) { 16418 rewriteFilter(node.content, context); 16419 } else if (node.type === 1) { 16420 node.props.forEach((prop) => { 16421 if (prop.type === 7 && prop.name !== "for" && prop.exp) { 16422 rewriteFilter(prop.exp, context); 16423 } 16424 }); 16425 } 16426}; 16427function rewriteFilter(node, context) { 16428 if (node.type === 4) { 16429 parseFilter(node, context); 16430 } else { 16431 for (let i = 0; i < node.children.length; i++) { 16432 const child = node.children[i]; 16433 if (typeof child !== "object") continue; 16434 if (child.type === 4) { 16435 parseFilter(child, context); 16436 } else if (child.type === 8) { 16437 rewriteFilter(node, context); 16438 } else if (child.type === 5) { 16439 rewriteFilter(child.content, context); 16440 } 16441 } 16442 } 16443} 16444function parseFilter(node, context) { 16445 const exp = node.content; 16446 let inSingle = false; 16447 let inDouble = false; 16448 let inTemplateString = false; 16449 let inRegex = false; 16450 let curly = 0; 16451 let square = 0; 16452 let paren = 0; 16453 let lastFilterIndex = 0; 16454 let c, prev, i, expression, filters = []; 16455 for (i = 0; i < exp.length; i++) { 16456 prev = c; 16457 c = exp.charCodeAt(i); 16458 if (inSingle) { 16459 if (c === 39 && prev !== 92) inSingle = false; 16460 } else if (inDouble) { 16461 if (c === 34 && prev !== 92) inDouble = false; 16462 } else if (inTemplateString) { 16463 if (c === 96 && prev !== 92) inTemplateString = false; 16464 } else if (inRegex) { 16465 if (c === 47 && prev !== 92) inRegex = false; 16466 } else if (c === 124 && // pipe 16467 exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { 16468 if (expression === void 0) { 16469 lastFilterIndex = i + 1; 16470 expression = exp.slice(0, i).trim(); 16471 } else { 16472 pushFilter(); 16473 } 16474 } else { 16475 switch (c) { 16476 case 34: 16477 inDouble = true; 16478 break; 16479 case 39: 16480 inSingle = true; 16481 break; 16482 case 96: 16483 inTemplateString = true; 16484 break; 16485 case 40: 16486 paren++; 16487 break; 16488 case 41: 16489 paren--; 16490 break; 16491 case 91: 16492 square++; 16493 break; 16494 case 93: 16495 square--; 16496 break; 16497 case 123: 16498 curly++; 16499 break; 16500 case 125: 16501 curly--; 16502 break; 16503 } 16504 if (c === 47) { 16505 let j = i - 1; 16506 let p2; 16507 for (; j >= 0; j--) { 16508 p2 = exp.charAt(j); 16509 if (p2 !== " ") break; 16510 } 16511 if (!p2 || !validDivisionCharRE.test(p2)) { 16512 inRegex = true; 16513 } 16514 } 16515 } 16516 } 16517 if (expression === void 0) { 16518 expression = exp.slice(0, i).trim(); 16519 } else if (lastFilterIndex !== 0) { 16520 pushFilter(); 16521 } 16522 function pushFilter() { 16523 filters.push(exp.slice(lastFilterIndex, i).trim()); 16524 lastFilterIndex = i + 1; 16525 } 16526 if (filters.length) { 16527 warnDeprecation( 16528 "COMPILER_FILTERS", 16529 context, 16530 node.loc 16531 ); 16532 for (i = 0; i < filters.length; i++) { 16533 expression = wrapFilter(expression, filters[i], context); 16534 } 16535 node.content = expression; 16536 node.ast = void 0; 16537 } 16538} 16539function wrapFilter(exp, filter, context) { 16540 context.helper(RESOLVE_FILTER); 16541 const i = filter.indexOf("("); 16542 if (i < 0) { 16543 context.filters.add(filter); 16544 return `${toValidAssetId(filter, "filter")}(${exp})`; 16545 } else { 16546 const name = filter.slice(0, i); 16547 const args = filter.slice(i + 1); 16548 context.filters.add(name); 16549 return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; 16550 } 16551} 16552var seen = /* @__PURE__ */ new WeakSet(); 16553var transformMemo = (node, context) => { 16554 if (node.type === 1) { 16555 const dir = findDir(node, "memo"); 16556 if (!dir || seen.has(node)) { 16557 return; 16558 } 16559 seen.add(node); 16560 return () => { 16561 const codegenNode = node.codegenNode || context.currentNode.codegenNode; 16562 if (codegenNode && codegenNode.type === 13) { 16563 if (node.tagType !== 1) { 16564 convertToBlock(codegenNode, context); 16565 } 16566 node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ 16567 dir.exp, 16568 createFunctionExpression(void 0, codegenNode), 16569 `_cache`, 16570 String(context.cached++) 16571 ]); 16572 } 16573 }; 16574 } 16575}; 16576function getBaseTransformPreset(prefixIdentifiers) { 16577 return [ 16578 [ 16579 transformOnce, 16580 transformIf, 16581 transformMemo, 16582 transformFor, 16583 ...[transformFilter], 16584 ...true ? [transformExpression] : [], 16585 transformSlotOutlet, 16586 transformElement, 16587 trackSlotScopes, 16588 transformText 16589 ], 16590 { 16591 on: transformOn, 16592 bind: transformBind, 16593 model: transformModel 16594 } 16595 ]; 16596} 16597function baseCompile(source, options = {}) { 16598 const onError = options.onError || defaultOnError; 16599 const isModuleMode = options.mode === "module"; 16600 { 16601 if (options.prefixIdentifiers === true) { 16602 onError(createCompilerError(47)); 16603 } else if (isModuleMode) { 16604 onError(createCompilerError(48)); 16605 } 16606 } 16607 const prefixIdentifiers = false; 16608 if (options.cacheHandlers) { 16609 onError(createCompilerError(49)); 16610 } 16611 if (options.scopeId && !isModuleMode) { 16612 onError(createCompilerError(50)); 16613 } 16614 const resolvedOptions = extend({}, options, { 16615 prefixIdentifiers 16616 }); 16617 const ast = isString(source) ? baseParse(source, resolvedOptions) : source; 16618 const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); 16619 transform( 16620 ast, 16621 extend({}, resolvedOptions, { 16622 nodeTransforms: [ 16623 ...nodeTransforms, 16624 ...options.nodeTransforms || [] 16625 // user transforms 16626 ], 16627 directiveTransforms: extend( 16628 {}, 16629 directiveTransforms, 16630 options.directiveTransforms || {} 16631 // user transforms 16632 ) 16633 }) 16634 ); 16635 return generate(ast, resolvedOptions); 16636} 16637var noopDirectiveTransform = () => ({ props: [] }); 16638
vendor: 13,559 bytes, lines 16639-17093
16639// node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js 16640var V_MODEL_RADIO = Symbol(true ? `vModelRadio` : ``); 16641var V_MODEL_CHECKBOX = Symbol(true ? `vModelCheckbox` : ``); 16642var V_MODEL_TEXT = Symbol(true ? `vModelText` : ``); 16643var V_MODEL_SELECT = Symbol(true ? `vModelSelect` : ``); 16644var V_MODEL_DYNAMIC = Symbol(true ? `vModelDynamic` : ``); 16645var V_ON_WITH_MODIFIERS = Symbol(true ? `vOnModifiersGuard` : ``); 16646var V_ON_WITH_KEYS = Symbol(true ? `vOnKeysGuard` : ``); 16647var V_SHOW = Symbol(true ? `vShow` : ``); 16648var TRANSITION2 = Symbol(true ? `Transition` : ``); 16649var TRANSITION_GROUP = Symbol(true ? `TransitionGroup` : ``); 16650registerRuntimeHelpers({ 16651 [V_MODEL_RADIO]: `vModelRadio`, 16652 [V_MODEL_CHECKBOX]: `vModelCheckbox`, 16653 [V_MODEL_TEXT]: `vModelText`, 16654 [V_MODEL_SELECT]: `vModelSelect`, 16655 [V_MODEL_DYNAMIC]: `vModelDynamic`, 16656 [V_ON_WITH_MODIFIERS]: `withModifiers`, 16657 [V_ON_WITH_KEYS]: `withKeys`, 16658 [V_SHOW]: `vShow`, 16659 [TRANSITION2]: `Transition`, 16660 [TRANSITION_GROUP]: `TransitionGroup` 16661}); 16662var decoder; 16663function decodeHtmlBrowser(raw, asAttr = false) { 16664 if (!decoder) { 16665 decoder = document.createElement("div"); 16666 } 16667 if (asAttr) { 16668 decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; 16669 return decoder.children[0].getAttribute("foo"); 16670 } else { 16671 decoder.innerHTML = raw; 16672 return decoder.textContent; 16673 } 16674} 16675var parserOptions = { 16676 parseMode: "html", 16677 isVoidTag, 16678 isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), 16679 isPreTag: (tag) => tag === "pre", 16680 decodeEntities: decodeHtmlBrowser, 16681 isBuiltInComponent: (tag) => { 16682 if (tag === "Transition" || tag === "transition") { 16683 return TRANSITION2; 16684 } else if (tag === "TransitionGroup" || tag === "transition-group") { 16685 return TRANSITION_GROUP; 16686 } 16687 }, 16688 // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher 16689 getNamespace(tag, parent, rootNamespace) { 16690 let ns = parent ? parent.ns : rootNamespace; 16691 if (parent && ns === 2) { 16692 if (parent.tag === "annotation-xml") { 16693 if (tag === "svg") { 16694 return 1; 16695 } 16696 if (parent.props.some( 16697 (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") 16698 )) { 16699 ns = 0; 16700 } 16701 } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { 16702 ns = 0; 16703 } 16704 } else if (parent && ns === 1) { 16705 if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { 16706 ns = 0; 16707 } 16708 } 16709 if (ns === 0) { 16710 if (tag === "svg") { 16711 return 1; 16712 } 16713 if (tag === "math") { 16714 return 2; 16715 } 16716 } 16717 return ns; 16718 } 16719}; 16720var transformStyle = (node) => { 16721 if (node.type === 1) { 16722 node.props.forEach((p2, i) => { 16723 if (p2.type === 6 && p2.name === "style" && p2.value) { 16724 node.props[i] = { 16725 type: 7, 16726 name: `bind`, 16727 arg: createSimpleExpression(`style`, true, p2.loc), 16728 exp: parseInlineCSS(p2.value.content, p2.loc), 16729 modifiers: [], 16730 loc: p2.loc 16731 }; 16732 } 16733 }); 16734 } 16735}; 16736var parseInlineCSS = (cssText, loc) => { 16737 const normalized = parseStringStyle(cssText); 16738 return createSimpleExpression( 16739 JSON.stringify(normalized), 16740 false, 16741 loc, 16742 3 16743 ); 16744}; 16745function createDOMCompilerError(code, loc) { 16746 return createCompilerError( 16747 code, 16748 loc, 16749 true ? DOMErrorMessages : void 0 16750 ); 16751} 16752var DOMErrorMessages = { 16753 [53]: `v-html is missing expression.`, 16754 [54]: `v-html will override element children.`, 16755 [55]: `v-text is missing expression.`, 16756 [56]: `v-text will override element children.`, 16757 [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, 16758 [58]: `v-model argument is not supported on plain elements.`, 16759 [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, 16760 [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, 16761 [61]: `v-show is missing expression.`, 16762 [62]: `<Transition> expects exactly one child element or component.`, 16763 [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` 16764}; 16765var transformVHtml = (dir, node, context) => { 16766 const { exp, loc } = dir; 16767 if (!exp) { 16768 context.onError( 16769 createDOMCompilerError(53, loc) 16770 ); 16771 } 16772 if (node.children.length) { 16773 context.onError( 16774 createDOMCompilerError(54, loc) 16775 ); 16776 node.children.length = 0; 16777 } 16778 return { 16779 props: [ 16780 createObjectProperty( 16781 createSimpleExpression(`innerHTML`, true, loc), 16782 exp || createSimpleExpression("", true) 16783 ) 16784 ] 16785 }; 16786}; 16787var transformVText = (dir, node, context) => { 16788 const { exp, loc } = dir; 16789 if (!exp) { 16790 context.onError( 16791 createDOMCompilerError(55, loc) 16792 ); 16793 } 16794 if (node.children.length) { 16795 context.onError( 16796 createDOMCompilerError(56, loc) 16797 ); 16798 node.children.length = 0; 16799 } 16800 return { 16801 props: [ 16802 createObjectProperty( 16803 createSimpleExpression(`textContent`, true), 16804 exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression( 16805 context.helperString(TO_DISPLAY_STRING), 16806 [exp], 16807 loc 16808 ) : createSimpleExpression("", true) 16809 ) 16810 ] 16811 }; 16812}; 16813var transformModel2 = (dir, node, context) => { 16814 const baseResult = transformModel(dir, node, context); 16815 if (!baseResult.props.length || node.tagType === 1) { 16816 return baseResult; 16817 } 16818 if (dir.arg) { 16819 context.onError( 16820 createDOMCompilerError( 16821 58, 16822 dir.arg.loc 16823 ) 16824 ); 16825 } 16826 function checkDuplicatedValue() { 16827 const value = findDir(node, "bind"); 16828 if (value && isStaticArgOf(value.arg, "value")) { 16829 context.onError( 16830 createDOMCompilerError( 16831 60, 16832 value.loc 16833 ) 16834 ); 16835 } 16836 } 16837 const { tag } = node; 16838 const isCustomElement = context.isCustomElement(tag); 16839 if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { 16840 let directiveToUse = V_MODEL_TEXT; 16841 let isInvalidType = false; 16842 if (tag === "input" || isCustomElement) { 16843 const type = findProp(node, `type`); 16844 if (type) { 16845 if (type.type === 7) { 16846 directiveToUse = V_MODEL_DYNAMIC; 16847 } else if (type.value) { 16848 switch (type.value.content) { 16849 case "radio": 16850 directiveToUse = V_MODEL_RADIO; 16851 break; 16852 case "checkbox": 16853 directiveToUse = V_MODEL_CHECKBOX; 16854 break; 16855 case "file": 16856 isInvalidType = true; 16857 context.onError( 16858 createDOMCompilerError( 16859 59, 16860 dir.loc 16861 ) 16862 ); 16863 break; 16864 default: 16865 checkDuplicatedValue(); 16866 break; 16867 } 16868 } 16869 } else if (hasDynamicKeyVBind(node)) { 16870 directiveToUse = V_MODEL_DYNAMIC; 16871 } else { 16872 checkDuplicatedValue(); 16873 } 16874 } else if (tag === "select") { 16875 directiveToUse = V_MODEL_SELECT; 16876 } else { 16877 checkDuplicatedValue(); 16878 } 16879 if (!isInvalidType) { 16880 baseResult.needRuntime = context.helper(directiveToUse); 16881 } 16882 } else { 16883 context.onError( 16884 createDOMCompilerError( 16885 57, 16886 dir.loc 16887 ) 16888 ); 16889 } 16890 baseResult.props = baseResult.props.filter( 16891 (p2) => !(p2.key.type === 4 && p2.key.content === "modelValue") 16892 ); 16893 return baseResult; 16894}; 16895var isEventOptionModifier = makeMap(`passive,once,capture`); 16896var isNonKeyModifier = makeMap( 16897 // event propagation management 16898 `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` 16899); 16900var maybeKeyModifier = makeMap("left,right"); 16901var isKeyboardEvent = makeMap( 16902 `onkeyup,onkeydown,onkeypress`, 16903 true 16904); 16905var resolveModifiers = (key, modifiers, context, loc) => { 16906 const keyModifiers = []; 16907 const nonKeyModifiers = []; 16908 const eventOptionModifiers = []; 16909 for (let i = 0; i < modifiers.length; i++) { 16910 const modifier = modifiers[i]; 16911 if (modifier === "native" && checkCompatEnabled( 16912 "COMPILER_V_ON_NATIVE", 16913 context, 16914 loc 16915 )) { 16916 eventOptionModifiers.push(modifier); 16917 } else if (isEventOptionModifier(modifier)) { 16918 eventOptionModifiers.push(modifier); 16919 } else { 16920 if (maybeKeyModifier(modifier)) { 16921 if (isStaticExp(key)) { 16922 if (isKeyboardEvent(key.content)) { 16923 keyModifiers.push(modifier); 16924 } else { 16925 nonKeyModifiers.push(modifier); 16926 } 16927 } else { 16928 keyModifiers.push(modifier); 16929 nonKeyModifiers.push(modifier); 16930 } 16931 } else { 16932 if (isNonKeyModifier(modifier)) { 16933 nonKeyModifiers.push(modifier); 16934 } else { 16935 keyModifiers.push(modifier); 16936 } 16937 } 16938 } 16939 } 16940 return { 16941 keyModifiers, 16942 nonKeyModifiers, 16943 eventOptionModifiers 16944 }; 16945}; 16946var transformClick = (key, event) => { 16947 const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick"; 16948 return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([ 16949 `(`, 16950 key, 16951 `) === "onClick" ? "${event}" : (`, 16952 key, 16953 `)` 16954 ]) : key; 16955}; 16956var transformOn2 = (dir, node, context) => { 16957 return transformOn(dir, node, context, (baseResult) => { 16958 const { modifiers } = dir; 16959 if (!modifiers.length) return baseResult; 16960 let { key, value: handlerExp } = baseResult.props[0]; 16961 const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); 16962 if (nonKeyModifiers.includes("right")) { 16963 key = transformClick(key, `onContextmenu`); 16964 } 16965 if (nonKeyModifiers.includes("middle")) { 16966 key = transformClick(key, `onMouseup`); 16967 } 16968 if (nonKeyModifiers.length) { 16969 handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ 16970 handlerExp, 16971 JSON.stringify(nonKeyModifiers) 16972 ]); 16973 } 16974 if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard 16975 (!isStaticExp(key) || isKeyboardEvent(key.content))) { 16976 handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [ 16977 handlerExp, 16978 JSON.stringify(keyModifiers) 16979 ]); 16980 } 16981 if (eventOptionModifiers.length) { 16982 const modifierPostfix = eventOptionModifiers.map(capitalize).join(""); 16983 key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); 16984 } 16985 return { 16986 props: [createObjectProperty(key, handlerExp)] 16987 }; 16988 }); 16989}; 16990var transformShow = (dir, node, context) => { 16991 const { exp, loc } = dir; 16992 if (!exp) { 16993 context.onError( 16994 createDOMCompilerError(61, loc) 16995 ); 16996 } 16997 return { 16998 props: [], 16999 needRuntime: context.helper(V_SHOW) 17000 }; 17001}; 17002var transformTransition = (node, context) => { 17003 if (node.type === 1 && node.tagType === 1) { 17004 const component = context.isBuiltInComponent(node.tag); 17005 if (component === TRANSITION2) { 17006 return () => { 17007 if (!node.children.length) { 17008 return; 17009 } 17010 if (hasMultipleChildren(node)) { 17011 context.onError( 17012 createDOMCompilerError( 17013 62, 17014 { 17015 start: node.children[0].loc.start, 17016 end: node.children[node.children.length - 1].loc.end, 17017 source: "" 17018 } 17019 ) 17020 ); 17021 } 17022 const child = node.children[0]; 17023 if (child.type === 1) { 17024 for (const p2 of child.props) { 17025 if (p2.type === 7 && p2.name === "show") { 17026 node.props.push({ 17027 type: 6, 17028 name: "persisted", 17029 nameLoc: node.loc, 17030 value: void 0, 17031 loc: node.loc 17032 }); 17033 } 17034 } 17035 } 17036 }; 17037 } 17038 } 17039}; 17040function hasMultipleChildren(node) { 17041 const children = node.children = node.children.filter( 17042 (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) 17043 ); 17044 const child = children[0]; 17045 return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); 17046} 17047var ignoreSideEffectTags = (node, context) => { 17048 if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { 17049 context.onError( 17050 createDOMCompilerError( 17051 63, 17052 node.loc 17053 ) 17054 ); 17055 context.removeNode(); 17056 } 17057}; 17058var DOMNodeTransforms = [ 17059 transformStyle, 17060 ...true ? [transformTransition] : [] 17061]; 17062var DOMDirectiveTransforms = { 17063 cloak: noopDirectiveTransform, 17064 html: transformVHtml, 17065 text: transformVText, 17066 model: transformModel2, 17067 // override compiler-core 17068 on: transformOn2, 17069 // override compiler-core 17070 show: transformShow 17071}; 17072function compile2(src, options = {}) { 17073 return baseCompile( 17074 src, 17075 extend({}, parserOptions, options, { 17076 nodeTransforms: [ 17077 // ignore <script> and <tag> 17078 // this is not put inside DOMNodeTransforms because that list is used 17079 // by compiler-ssr to generate vnode fallback branches 17080 ignoreSideEffectTags, 17081 ...DOMNodeTransforms, 17082 ...options.nodeTransforms || [] 17083 ], 17084 directiveTransforms: extend( 17085 {}, 17086 DOMDirectiveTransforms, 17087 options.directiveTransforms || {} 17088 ), 17089 transformHoist: null 17090 }) 17091 ); 17092} 17093
vendor: 5,797 bytes, lines 17094-17377
17094// node_modules/.pnpm/[email protected][email protected]/node_modules/vue/dist/vue.esm-bundler.js 17095function initDev() { 17096 { 17097 initCustomFormatter(); 17098 } 17099} 17100if (true) { 17101 initDev(); 17102} 17103var compileCache = /* @__PURE__ */ new WeakMap(); 17104function getCache(options) { 17105 let c = compileCache.get(options != null ? options : EMPTY_OBJ); 17106 if (!c) { 17107 c = /* @__PURE__ */ Object.create(null); 17108 compileCache.set(options != null ? options : EMPTY_OBJ, c); 17109 } 17110 return c; 17111} 17112function compileToFunction(template, options) { 17113 if (!isString(template)) { 17114 if (template.nodeType) { 17115 template = template.innerHTML; 17116 } else { 17117 warn2(`invalid template option: `, template); 17118 return NOOP; 17119 } 17120 } 17121 const key = template; 17122 const cache = getCache(options); 17123 const cached = cache[key]; 17124 if (cached) { 17125 return cached; 17126 } 17127 if (template[0] === "#") { 17128 const el = document.querySelector(template); 17129 if (!el) { 17130 warn2(`Template element not found or is empty: ${template}`); 17131 } 17132 template = el ? el.innerHTML : ``; 17133 } 17134 const opts = extend( 17135 { 17136 hoistStatic: true, 17137 onError: true ? onError : void 0, 17138 onWarn: true ? (e) => onError(e, true) : NOOP 17139 }, 17140 options 17141 ); 17142 if (!opts.isCustomElement && typeof customElements !== "undefined") { 17143 opts.isCustomElement = (tag) => !!customElements.get(tag); 17144 } 17145 const { code } = compile2(template, opts); 17146 function onError(err, asWarning = false) { 17147 const message = asWarning ? err.message : `Template compilation error: ${err.message}`; 17148 const codeFrame = err.loc && generateCodeFrame( 17149 template, 17150 err.loc.start.offset, 17151 err.loc.end.offset 17152 ); 17153 warn2(codeFrame ? `${message} 17154${codeFrame}` : message); 17155 } 17156 const render2 = new Function("Vue", code)(runtime_dom_esm_bundler_exports); 17157 render2._rc = true; 17158 return cache[key] = render2; 17159} 17160registerRuntimeCompiler(compileToFunction); 17161 17162export { 17163 camelize, 17164 capitalize, 17165 toHandlerKey, 17166 normalizeStyle, 17167 normalizeClass, 17168 normalizeProps, 17169 toDisplayString, 17170 EffectScope, 17171 effectScope, 17172 getCurrentScope, 17173 onScopeDispose, 17174 ReactiveEffect, 17175 effect, 17176 stop, 17177 reactive, 17178 shallowReactive, 17179 readonly, 17180 shallowReadonly, 17181 isReactive, 17182 isReadonly, 17183 isShallow, 17184 isProxy, 17185 toRaw, 17186 markRaw, 17187 isRef2 as isRef, 17188 ref, 17189 shallowRef, 17190 triggerRef, 17191 unref, 17192 toValue, 17193 proxyRefs, 17194 customRef, 17195 toRefs, 17196 toRef, 17197 TrackOpTypes, 17198 TriggerOpTypes, 17199 assertNumber, 17200 ErrorCodes, 17201 callWithErrorHandling, 17202 callWithAsyncErrorHandling, 17203 handleError, 17204 nextTick, 17205 queuePostFlushCb, 17206 pushScopeId, 17207 popScopeId, 17208 withScopeId, 17209 withCtx, 17210 withDirectives, 17211 useTransitionState, 17212 BaseTransitionPropsValidators, 17213 BaseTransition, 17214 resolveTransitionHooks, 17215 setTransitionHooks, 17216 getTransitionRawChildren, 17217 defineComponent, 17218 defineAsyncComponent, 17219 KeepAlive, 17220 onActivated, 17221 onDeactivated, 17222 onBeforeMount, 17223 onMounted, 17224 onBeforeUpdate, 17225 onUpdated, 17226 onBeforeUnmount, 17227 onUnmounted, 17228 onServerPrefetch, 17229 onRenderTriggered, 17230 onRenderTracked, 17231 onErrorCaptured, 17232 resolveComponent, 17233 resolveDynamicComponent, 17234 resolveDirective, 17235 renderList, 17236 createSlots, 17237 renderSlot, 17238 toHandlers, 17239 defineProps, 17240 defineEmits, 17241 defineExpose, 17242 defineOptions, 17243 defineSlots, 17244 defineModel, 17245 withDefaults, 17246 useSlots, 17247 useAttrs, 17248 mergeDefaults, 17249 mergeModels, 17250 createPropsRestProxy, 17251 withAsyncContext, 17252 provide, 17253 inject, 17254 hasInjectionContext, 17255 Teleport, 17256 createRenderer, 17257 createHydrationRenderer, 17258 ssrContextKey, 17259 useSSRContext, 17260 watchEffect, 17261 watchPostEffect, 17262 watchSyncEffect, 17263 watch, 17264 useModel, 17265 Suspense, 17266 Fragment, 17267 Text, 17268 Comment, 17269 Static, 17270 openBlock, 17271 setBlockTracking, 17272 createElementBlock, 17273 createBlock, 17274 isVNode, 17275 transformVNodeArgs, 17276 createBaseVNode, 17277 createVNode, 17278 guardReactiveProps, 17279 cloneVNode, 17280 createTextVNode, 17281 createStaticVNode, 17282 createCommentVNode, 17283 mergeProps, 17284 getCurrentInstance, 17285 registerRuntimeCompiler, 17286 isRuntimeOnly, 17287 computed2 as computed, 17288 h, 17289 initCustomFormatter, 17290 withMemo, 17291 isMemoSame, 17292 version, 17293 warn2 as warn, 17294 ErrorTypeStrings, 17295 devtools, 17296 setDevtoolsHook, 17297 ssrUtils, 17298 resolveFilter, 17299 compatUtils, 17300 DeprecationTypes, 17301 Transition, 17302 vShow, 17303 useCssVars, 17304 defineCustomElement, 17305 defineSSRCustomElement, 17306 VueElement, 17307 useCssModule, 17308 TransitionGroup, 17309 vModelText, 17310 vModelCheckbox, 17311 vModelRadio, 17312 vModelSelect, 17313 vModelDynamic, 17314 withModifiers, 17315 withKeys, 17316 render, 17317 hydrate, 17318 createApp, 17319 createSSRApp, 17320 initDirectivesForSSR, 17321 compileToFunction 17322}; 17323/*! Bundled license information: 17324 17325@vue/shared/dist/shared.esm-bundler.js: 17326 (** 17327 * @vue/shared v3.4.34 17328 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17329 * @license MIT 17330 **) 17331 (*! #__NO_SIDE_EFFECTS__ *) 17332 17333@vue/reactivity/dist/reactivity.esm-bundler.js: 17334 (** 17335 * @vue/reactivity v3.4.34 17336 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17337 * @license MIT 17338 **) 17339 17340@vue/runtime-core/dist/runtime-core.esm-bundler.js: 17341 (** 17342 * @vue/runtime-core v3.4.34 17343 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17344 * @license MIT 17345 **) 17346 (*! #__NO_SIDE_EFFECTS__ *) 17347 17348@vue/runtime-dom/dist/runtime-dom.esm-bundler.js: 17349 (** 17350 * @vue/runtime-dom v3.4.34 17351 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17352 * @license MIT 17353 **) 17354 (*! #__NO_SIDE_EFFECTS__ *) 17355 17356@vue/compiler-core/dist/compiler-core.esm-bundler.js: 17357 (** 17358 * @vue/compiler-core v3.4.34 17359 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17360 * @license MIT 17361 **) 17362 17363@vue/compiler-dom/dist/compiler-dom.esm-bundler.js: 17364 (** 17365 * @vue/compiler-dom v3.4.34 17366 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17367 * @license MIT 17368 **) 17369 17370vue/dist/vue.esm-bundler.js: 17371 (** 17372 * vue v3.4.34 17373 * (c) 2018-present Yuxi (Evan) You and Vue contributors 17374 * @license MIT 17375 **) 17376*/ 17377//# sourceMappingURL=chunk-HXAKAOMG.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.