llms-py 2.0.34__py3-none-any.whl → 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. llms/__init__.py +3 -1
  2. llms/__pycache__/__init__.cpython-312.pyc +0 -0
  3. llms/__pycache__/__init__.cpython-313.pyc +0 -0
  4. llms/__pycache__/__init__.cpython-314.pyc +0 -0
  5. llms/__pycache__/__main__.cpython-312.pyc +0 -0
  6. llms/__pycache__/__main__.cpython-314.pyc +0 -0
  7. llms/__pycache__/llms.cpython-312.pyc +0 -0
  8. llms/__pycache__/main.cpython-312.pyc +0 -0
  9. llms/__pycache__/main.cpython-313.pyc +0 -0
  10. llms/__pycache__/main.cpython-314.pyc +0 -0
  11. llms/__pycache__/plugins.cpython-314.pyc +0 -0
  12. llms/{ui/Analytics.mjs → extensions/analytics/ui/index.mjs} +154 -238
  13. llms/extensions/app/README.md +20 -0
  14. llms/extensions/app/__init__.py +530 -0
  15. llms/extensions/app/__pycache__/__init__.cpython-314.pyc +0 -0
  16. llms/extensions/app/__pycache__/db.cpython-314.pyc +0 -0
  17. llms/extensions/app/__pycache__/db_manager.cpython-314.pyc +0 -0
  18. llms/extensions/app/db.py +644 -0
  19. llms/extensions/app/db_manager.py +195 -0
  20. llms/extensions/app/requests.json +9073 -0
  21. llms/extensions/app/threads.json +15290 -0
  22. llms/{ui → extensions/app/ui}/Recents.mjs +91 -65
  23. llms/{ui/Sidebar.mjs → extensions/app/ui/index.mjs} +124 -58
  24. llms/extensions/app/ui/threadStore.mjs +411 -0
  25. llms/extensions/core_tools/CALCULATOR.md +32 -0
  26. llms/extensions/core_tools/__init__.py +598 -0
  27. llms/extensions/core_tools/__pycache__/__init__.cpython-314.pyc +0 -0
  28. llms/extensions/core_tools/ui/codemirror/addon/edit/closebrackets.js +201 -0
  29. llms/extensions/core_tools/ui/codemirror/addon/edit/closetag.js +185 -0
  30. llms/extensions/core_tools/ui/codemirror/addon/edit/continuelist.js +101 -0
  31. llms/extensions/core_tools/ui/codemirror/addon/edit/matchbrackets.js +160 -0
  32. llms/extensions/core_tools/ui/codemirror/addon/edit/matchtags.js +66 -0
  33. llms/extensions/core_tools/ui/codemirror/addon/edit/trailingspace.js +27 -0
  34. llms/extensions/core_tools/ui/codemirror/addon/selection/active-line.js +72 -0
  35. llms/extensions/core_tools/ui/codemirror/addon/selection/mark-selection.js +119 -0
  36. llms/extensions/core_tools/ui/codemirror/addon/selection/selection-pointer.js +98 -0
  37. llms/extensions/core_tools/ui/codemirror/doc/docs.css +225 -0
  38. llms/extensions/core_tools/ui/codemirror/doc/source_sans.woff +0 -0
  39. llms/extensions/core_tools/ui/codemirror/lib/codemirror.css +344 -0
  40. llms/extensions/core_tools/ui/codemirror/lib/codemirror.js +9884 -0
  41. llms/extensions/core_tools/ui/codemirror/mode/clike/clike.js +942 -0
  42. llms/extensions/core_tools/ui/codemirror/mode/javascript/index.html +118 -0
  43. llms/extensions/core_tools/ui/codemirror/mode/javascript/javascript.js +962 -0
  44. llms/extensions/core_tools/ui/codemirror/mode/javascript/typescript.html +62 -0
  45. llms/extensions/core_tools/ui/codemirror/mode/python/python.js +402 -0
  46. llms/extensions/core_tools/ui/codemirror/theme/dracula.css +40 -0
  47. llms/extensions/core_tools/ui/codemirror/theme/mocha.css +135 -0
  48. llms/extensions/core_tools/ui/index.mjs +650 -0
  49. llms/extensions/gallery/README.md +61 -0
  50. llms/extensions/gallery/__init__.py +61 -0
  51. llms/extensions/gallery/__pycache__/__init__.cpython-314.pyc +0 -0
  52. llms/extensions/gallery/__pycache__/db.cpython-314.pyc +0 -0
  53. llms/extensions/gallery/db.py +298 -0
  54. llms/extensions/gallery/ui/index.mjs +482 -0
  55. llms/extensions/katex/README.md +39 -0
  56. llms/extensions/katex/__init__.py +6 -0
  57. llms/extensions/katex/__pycache__/__init__.cpython-314.pyc +0 -0
  58. llms/extensions/katex/ui/README.md +125 -0
  59. llms/extensions/katex/ui/contrib/auto-render.js +338 -0
  60. llms/extensions/katex/ui/contrib/auto-render.min.js +1 -0
  61. llms/extensions/katex/ui/contrib/auto-render.mjs +244 -0
  62. llms/extensions/katex/ui/contrib/copy-tex.js +127 -0
  63. llms/extensions/katex/ui/contrib/copy-tex.min.js +1 -0
  64. llms/extensions/katex/ui/contrib/copy-tex.mjs +105 -0
  65. llms/extensions/katex/ui/contrib/mathtex-script-type.js +109 -0
  66. llms/extensions/katex/ui/contrib/mathtex-script-type.min.js +1 -0
  67. llms/extensions/katex/ui/contrib/mathtex-script-type.mjs +24 -0
  68. llms/extensions/katex/ui/contrib/mhchem.js +3213 -0
  69. llms/extensions/katex/ui/contrib/mhchem.min.js +1 -0
  70. llms/extensions/katex/ui/contrib/mhchem.mjs +3109 -0
  71. llms/extensions/katex/ui/contrib/render-a11y-string.js +887 -0
  72. llms/extensions/katex/ui/contrib/render-a11y-string.min.js +1 -0
  73. llms/extensions/katex/ui/contrib/render-a11y-string.mjs +800 -0
  74. llms/extensions/katex/ui/fonts/KaTeX_AMS-Regular.ttf +0 -0
  75. llms/extensions/katex/ui/fonts/KaTeX_AMS-Regular.woff +0 -0
  76. llms/extensions/katex/ui/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  77. llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  78. llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  79. llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  80. llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  81. llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  82. llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  83. llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  84. llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  85. llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  86. llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  87. llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  88. llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  89. llms/extensions/katex/ui/fonts/KaTeX_Main-Bold.ttf +0 -0
  90. llms/extensions/katex/ui/fonts/KaTeX_Main-Bold.woff +0 -0
  91. llms/extensions/katex/ui/fonts/KaTeX_Main-Bold.woff2 +0 -0
  92. llms/extensions/katex/ui/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  93. llms/extensions/katex/ui/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  94. llms/extensions/katex/ui/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  95. llms/extensions/katex/ui/fonts/KaTeX_Main-Italic.ttf +0 -0
  96. llms/extensions/katex/ui/fonts/KaTeX_Main-Italic.woff +0 -0
  97. llms/extensions/katex/ui/fonts/KaTeX_Main-Italic.woff2 +0 -0
  98. llms/extensions/katex/ui/fonts/KaTeX_Main-Regular.ttf +0 -0
  99. llms/extensions/katex/ui/fonts/KaTeX_Main-Regular.woff +0 -0
  100. llms/extensions/katex/ui/fonts/KaTeX_Main-Regular.woff2 +0 -0
  101. llms/extensions/katex/ui/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  102. llms/extensions/katex/ui/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  103. llms/extensions/katex/ui/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  104. llms/extensions/katex/ui/fonts/KaTeX_Math-Italic.ttf +0 -0
  105. llms/extensions/katex/ui/fonts/KaTeX_Math-Italic.woff +0 -0
  106. llms/extensions/katex/ui/fonts/KaTeX_Math-Italic.woff2 +0 -0
  107. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  108. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  109. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  110. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  111. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  112. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  113. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  114. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  115. llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  116. llms/extensions/katex/ui/fonts/KaTeX_Script-Regular.ttf +0 -0
  117. llms/extensions/katex/ui/fonts/KaTeX_Script-Regular.woff +0 -0
  118. llms/extensions/katex/ui/fonts/KaTeX_Script-Regular.woff2 +0 -0
  119. llms/extensions/katex/ui/fonts/KaTeX_Size1-Regular.ttf +0 -0
  120. llms/extensions/katex/ui/fonts/KaTeX_Size1-Regular.woff +0 -0
  121. llms/extensions/katex/ui/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  122. llms/extensions/katex/ui/fonts/KaTeX_Size2-Regular.ttf +0 -0
  123. llms/extensions/katex/ui/fonts/KaTeX_Size2-Regular.woff +0 -0
  124. llms/extensions/katex/ui/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  125. llms/extensions/katex/ui/fonts/KaTeX_Size3-Regular.ttf +0 -0
  126. llms/extensions/katex/ui/fonts/KaTeX_Size3-Regular.woff +0 -0
  127. llms/extensions/katex/ui/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  128. llms/extensions/katex/ui/fonts/KaTeX_Size4-Regular.ttf +0 -0
  129. llms/extensions/katex/ui/fonts/KaTeX_Size4-Regular.woff +0 -0
  130. llms/extensions/katex/ui/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  131. llms/extensions/katex/ui/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  132. llms/extensions/katex/ui/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  133. llms/extensions/katex/ui/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  134. llms/extensions/katex/ui/index.mjs +92 -0
  135. llms/extensions/katex/ui/katex-swap.css +1230 -0
  136. llms/extensions/katex/ui/katex-swap.min.css +1 -0
  137. llms/extensions/katex/ui/katex.css +1230 -0
  138. llms/extensions/katex/ui/katex.js +19080 -0
  139. llms/extensions/katex/ui/katex.min.css +1 -0
  140. llms/extensions/katex/ui/katex.min.js +1 -0
  141. llms/extensions/katex/ui/katex.min.mjs +1 -0
  142. llms/extensions/katex/ui/katex.mjs +18547 -0
  143. llms/extensions/providers/__init__.py +18 -0
  144. llms/extensions/providers/__pycache__/__init__.cpython-314.pyc +0 -0
  145. llms/extensions/providers/__pycache__/anthropic.cpython-314.pyc +0 -0
  146. llms/extensions/providers/__pycache__/chutes.cpython-314.pyc +0 -0
  147. llms/extensions/providers/__pycache__/google.cpython-314.pyc +0 -0
  148. llms/extensions/providers/__pycache__/nvidia.cpython-314.pyc +0 -0
  149. llms/extensions/providers/__pycache__/openai.cpython-314.pyc +0 -0
  150. llms/extensions/providers/__pycache__/openrouter.cpython-314.pyc +0 -0
  151. llms/extensions/providers/anthropic.py +229 -0
  152. llms/extensions/providers/chutes.py +155 -0
  153. llms/extensions/providers/google.py +378 -0
  154. llms/extensions/providers/nvidia.py +105 -0
  155. llms/extensions/providers/openai.py +156 -0
  156. llms/extensions/providers/openrouter.py +72 -0
  157. llms/extensions/system_prompts/README.md +22 -0
  158. llms/extensions/system_prompts/__init__.py +45 -0
  159. llms/extensions/system_prompts/__pycache__/__init__.cpython-314.pyc +0 -0
  160. llms/extensions/system_prompts/ui/index.mjs +280 -0
  161. llms/extensions/system_prompts/ui/prompts.json +1067 -0
  162. llms/extensions/tools/__init__.py +5 -0
  163. llms/extensions/tools/__pycache__/__init__.cpython-314.pyc +0 -0
  164. llms/extensions/tools/ui/index.mjs +204 -0
  165. llms/index.html +35 -77
  166. llms/llms.json +357 -1186
  167. llms/main.py +2847 -999
  168. llms/providers-extra.json +356 -0
  169. llms/providers.json +1 -0
  170. llms/ui/App.mjs +151 -60
  171. llms/ui/ai.mjs +132 -60
  172. llms/ui/app.css +2173 -161
  173. llms/ui/ctx.mjs +365 -0
  174. llms/ui/index.mjs +129 -0
  175. llms/ui/lib/charts.mjs +9 -13
  176. llms/ui/lib/servicestack-vue.mjs +3 -3
  177. llms/ui/lib/vue.min.mjs +10 -9
  178. llms/ui/lib/vue.mjs +1796 -1635
  179. llms/ui/markdown.mjs +18 -7
  180. llms/ui/modules/chat/ChatBody.mjs +691 -0
  181. llms/ui/{SettingsDialog.mjs → modules/chat/SettingsDialog.mjs} +9 -9
  182. llms/ui/modules/chat/index.mjs +828 -0
  183. llms/ui/modules/layout.mjs +243 -0
  184. llms/ui/modules/model-selector.mjs +851 -0
  185. llms/ui/tailwind.input.css +496 -80
  186. llms/ui/utils.mjs +161 -93
  187. {llms_py-2.0.34.dist-info → llms_py-3.0.0.dist-info}/METADATA +1 -1
  188. llms_py-3.0.0.dist-info/RECORD +202 -0
  189. llms/ui/Avatar.mjs +0 -85
  190. llms/ui/Brand.mjs +0 -52
  191. llms/ui/ChatPrompt.mjs +0 -590
  192. llms/ui/Main.mjs +0 -823
  193. llms/ui/ModelSelector.mjs +0 -78
  194. llms/ui/OAuthSignIn.mjs +0 -92
  195. llms/ui/ProviderIcon.mjs +0 -30
  196. llms/ui/ProviderStatus.mjs +0 -105
  197. llms/ui/SignIn.mjs +0 -64
  198. llms/ui/SystemPromptEditor.mjs +0 -31
  199. llms/ui/SystemPromptSelector.mjs +0 -56
  200. llms/ui/Welcome.mjs +0 -8
  201. llms/ui/threadStore.mjs +0 -563
  202. llms/ui.json +0 -1069
  203. llms_py-2.0.34.dist-info/RECORD +0 -48
  204. {llms_py-2.0.34.dist-info → llms_py-3.0.0.dist-info}/WHEEL +0 -0
  205. {llms_py-2.0.34.dist-info → llms_py-3.0.0.dist-info}/entry_points.txt +0 -0
  206. {llms_py-2.0.34.dist-info → llms_py-3.0.0.dist-info}/licenses/LICENSE +0 -0
  207. {llms_py-2.0.34.dist-info → llms_py-3.0.0.dist-info}/top_level.txt +0 -0
llms/ui/lib/vue.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.21
2
+ * vue v3.5.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1002,13 +1002,13 @@ function addSub(link) {
1002
1002
  }
1003
1003
  }
1004
1004
  const targetMap = /* @__PURE__ */ new WeakMap();
1005
- const ITERATE_KEY = Symbol(
1005
+ const ITERATE_KEY = /* @__PURE__ */ Symbol(
1006
1006
  "Object iterate"
1007
1007
  );
1008
- const MAP_KEY_ITERATE_KEY = Symbol(
1008
+ const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
1009
1009
  "Map keys iterate"
1010
1010
  );
1011
- const ARRAY_ITERATE_KEY = Symbol(
1011
+ const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
1012
1012
  "Array iterate"
1013
1013
  );
1014
1014
  function track(target, type, key) {
@@ -1116,10 +1116,16 @@ function shallowReadArray(arr) {
1116
1116
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
1117
1117
  return arr;
1118
1118
  }
1119
+ function toWrapped(target, item) {
1120
+ if (isReadonly(target)) {
1121
+ return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
1122
+ }
1123
+ return toReactive(item);
1124
+ }
1119
1125
  const arrayInstrumentations = {
1120
1126
  __proto__: null,
1121
1127
  [Symbol.iterator]() {
1122
- return iterator(this, Symbol.iterator, toReactive);
1128
+ return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
1123
1129
  },
1124
1130
  concat(...args) {
1125
1131
  return reactiveReadArray(this).concat(
@@ -1128,7 +1134,7 @@ const arrayInstrumentations = {
1128
1134
  },
1129
1135
  entries() {
1130
1136
  return iterator(this, "entries", (value) => {
1131
- value[1] = toReactive(value[1]);
1137
+ value[1] = toWrapped(this, value[1]);
1132
1138
  return value;
1133
1139
  });
1134
1140
  },
@@ -1136,16 +1142,37 @@ const arrayInstrumentations = {
1136
1142
  return apply(this, "every", fn, thisArg, void 0, arguments);
1137
1143
  },
1138
1144
  filter(fn, thisArg) {
1139
- return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
1145
+ return apply(
1146
+ this,
1147
+ "filter",
1148
+ fn,
1149
+ thisArg,
1150
+ (v) => v.map((item) => toWrapped(this, item)),
1151
+ arguments
1152
+ );
1140
1153
  },
1141
1154
  find(fn, thisArg) {
1142
- return apply(this, "find", fn, thisArg, toReactive, arguments);
1155
+ return apply(
1156
+ this,
1157
+ "find",
1158
+ fn,
1159
+ thisArg,
1160
+ (item) => toWrapped(this, item),
1161
+ arguments
1162
+ );
1143
1163
  },
1144
1164
  findIndex(fn, thisArg) {
1145
1165
  return apply(this, "findIndex", fn, thisArg, void 0, arguments);
1146
1166
  },
1147
1167
  findLast(fn, thisArg) {
1148
- return apply(this, "findLast", fn, thisArg, toReactive, arguments);
1168
+ return apply(
1169
+ this,
1170
+ "findLast",
1171
+ fn,
1172
+ thisArg,
1173
+ (item) => toWrapped(this, item),
1174
+ arguments
1175
+ );
1149
1176
  },
1150
1177
  findLastIndex(fn, thisArg) {
1151
1178
  return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
@@ -1205,7 +1232,7 @@ const arrayInstrumentations = {
1205
1232
  return noTracking(this, "unshift", args);
1206
1233
  },
1207
1234
  values() {
1208
- return iterator(this, "values", toReactive);
1235
+ return iterator(this, "values", (item) => toWrapped(this, item));
1209
1236
  }
1210
1237
  };
1211
1238
  function iterator(self, method, wrapValue) {
@@ -1215,7 +1242,7 @@ function iterator(self, method, wrapValue) {
1215
1242
  iter._next = iter.next;
1216
1243
  iter.next = () => {
1217
1244
  const result = iter._next();
1218
- if (result.value) {
1245
+ if (!result.done) {
1219
1246
  result.value = wrapValue(result.value);
1220
1247
  }
1221
1248
  return result;
@@ -1236,7 +1263,7 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1236
1263
  if (arr !== self) {
1237
1264
  if (needsWrap) {
1238
1265
  wrappedFn = function(item, index) {
1239
- return fn.call(this, toReactive(item), index, self);
1266
+ return fn.call(this, toWrapped(self, item), index, self);
1240
1267
  };
1241
1268
  } else if (fn.length > 2) {
1242
1269
  wrappedFn = function(item, index) {
@@ -1253,7 +1280,7 @@ function reduce(self, method, fn, args) {
1253
1280
  if (arr !== self) {
1254
1281
  if (!isShallow(self)) {
1255
1282
  wrappedFn = function(acc, item, index) {
1256
- return fn.call(this, acc, toReactive(item), index, self);
1283
+ return fn.call(this, acc, toWrapped(self, item), index, self);
1257
1284
  };
1258
1285
  } else if (fn.length > 3) {
1259
1286
  wrappedFn = function(acc, item, index) {
@@ -1342,7 +1369,8 @@ class BaseReactiveHandler {
1342
1369
  return res;
1343
1370
  }
1344
1371
  if (isRef(res)) {
1345
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1372
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1373
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1346
1374
  }
1347
1375
  if (isObject(res)) {
1348
1376
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -1356,13 +1384,14 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1356
1384
  }
1357
1385
  set(target, key, value, receiver) {
1358
1386
  let oldValue = target[key];
1387
+ const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
1359
1388
  if (!this._isShallow) {
1360
1389
  const isOldValueReadonly = isReadonly(oldValue);
1361
1390
  if (!isShallow(value) && !isReadonly(value)) {
1362
1391
  oldValue = toRaw(oldValue);
1363
1392
  value = toRaw(value);
1364
1393
  }
1365
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1394
+ if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
1366
1395
  if (isOldValueReadonly) {
1367
1396
  {
1368
1397
  warn$2(
@@ -1377,7 +1406,7 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1377
1406
  }
1378
1407
  }
1379
1408
  }
1380
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
1409
+ const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1381
1410
  const result = Reflect.set(
1382
1411
  target,
1383
1412
  key,
@@ -1907,16 +1936,35 @@ class ObjectRefImpl {
1907
1936
  this._defaultValue = _defaultValue;
1908
1937
  this["__v_isRef"] = true;
1909
1938
  this._value = void 0;
1939
+ this._raw = toRaw(_object);
1940
+ let shallow = true;
1941
+ let obj = _object;
1942
+ if (!isArray(_object) || !isIntegerKey(String(_key))) {
1943
+ do {
1944
+ shallow = !isProxy(obj) || isShallow(obj);
1945
+ } while (shallow && (obj = obj["__v_raw"]));
1946
+ }
1947
+ this._shallow = shallow;
1910
1948
  }
1911
1949
  get value() {
1912
- const val = this._object[this._key];
1950
+ let val = this._object[this._key];
1951
+ if (this._shallow) {
1952
+ val = unref(val);
1953
+ }
1913
1954
  return this._value = val === void 0 ? this._defaultValue : val;
1914
1955
  }
1915
1956
  set value(newVal) {
1957
+ if (this._shallow && isRef(this._raw[this._key])) {
1958
+ const nestedRef = this._object[this._key];
1959
+ if (isRef(nestedRef)) {
1960
+ nestedRef.value = newVal;
1961
+ return;
1962
+ }
1963
+ }
1916
1964
  this._object[this._key] = newVal;
1917
1965
  }
1918
1966
  get dep() {
1919
- return getDepFromReactive(toRaw(this._object), this._key);
1967
+ return getDepFromReactive(this._raw, this._key);
1920
1968
  }
1921
1969
  }
1922
1970
  class GetterRefImpl {
@@ -1942,8 +1990,7 @@ function toRef(source, key, defaultValue) {
1942
1990
  }
1943
1991
  }
1944
1992
  function propertyToRef(source, key, defaultValue) {
1945
- const val = source[key];
1946
- return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1993
+ return new ObjectRefImpl(source, key, defaultValue);
1947
1994
  }
1948
1995
 
1949
1996
  class ComputedRefImpl {
@@ -2692,14 +2739,11 @@ function checkRecursiveUpdates(seen, fn) {
2692
2739
  let isHmrUpdating = false;
2693
2740
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2694
2741
  {
2695
- const g = getGlobalThis();
2696
- if (!g.__VUE_HMR_RUNTIME__) {
2697
- g.__VUE_HMR_RUNTIME__ = {
2698
- createRecord: tryWrap(createRecord),
2699
- rerender: tryWrap(rerender),
2700
- reload: tryWrap(reload)
2701
- };
2702
- }
2742
+ getGlobalThis().__VUE_HMR_RUNTIME__ = {
2743
+ createRecord: tryWrap(createRecord),
2744
+ rerender: tryWrap(rerender),
2745
+ reload: tryWrap(reload)
2746
+ };
2703
2747
  }
2704
2748
  const map = /* @__PURE__ */ new Map();
2705
2749
  function registerHMR(instance) {
@@ -3013,7 +3057,180 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3013
3057
  }
3014
3058
  }
3015
3059
 
3016
- const TeleportEndKey = Symbol("_vte");
3060
+ function provide(key, value) {
3061
+ {
3062
+ if (!currentInstance || currentInstance.isMounted) {
3063
+ warn$1(`provide() can only be used inside setup().`);
3064
+ }
3065
+ }
3066
+ if (currentInstance) {
3067
+ let provides = currentInstance.provides;
3068
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
3069
+ if (parentProvides === provides) {
3070
+ provides = currentInstance.provides = Object.create(parentProvides);
3071
+ }
3072
+ provides[key] = value;
3073
+ }
3074
+ }
3075
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3076
+ const instance = getCurrentInstance();
3077
+ if (instance || currentApp) {
3078
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
3079
+ if (provides && key in provides) {
3080
+ return provides[key];
3081
+ } else if (arguments.length > 1) {
3082
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
3083
+ } else {
3084
+ warn$1(`injection "${String(key)}" not found.`);
3085
+ }
3086
+ } else {
3087
+ warn$1(`inject() can only be used inside setup() or functional components.`);
3088
+ }
3089
+ }
3090
+ function hasInjectionContext() {
3091
+ return !!(getCurrentInstance() || currentApp);
3092
+ }
3093
+
3094
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
3095
+ const useSSRContext = () => {
3096
+ {
3097
+ const ctx = inject(ssrContextKey);
3098
+ if (!ctx) {
3099
+ warn$1(
3100
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
3101
+ );
3102
+ }
3103
+ return ctx;
3104
+ }
3105
+ };
3106
+
3107
+ function watchEffect(effect, options) {
3108
+ return doWatch(effect, null, options);
3109
+ }
3110
+ function watchPostEffect(effect, options) {
3111
+ return doWatch(
3112
+ effect,
3113
+ null,
3114
+ extend({}, options, { flush: "post" })
3115
+ );
3116
+ }
3117
+ function watchSyncEffect(effect, options) {
3118
+ return doWatch(
3119
+ effect,
3120
+ null,
3121
+ extend({}, options, { flush: "sync" })
3122
+ );
3123
+ }
3124
+ function watch(source, cb, options) {
3125
+ if (!isFunction(cb)) {
3126
+ warn$1(
3127
+ `\`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.`
3128
+ );
3129
+ }
3130
+ return doWatch(source, cb, options);
3131
+ }
3132
+ function doWatch(source, cb, options = EMPTY_OBJ) {
3133
+ const { immediate, deep, flush, once } = options;
3134
+ if (!cb) {
3135
+ if (immediate !== void 0) {
3136
+ warn$1(
3137
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
3138
+ );
3139
+ }
3140
+ if (deep !== void 0) {
3141
+ warn$1(
3142
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
3143
+ );
3144
+ }
3145
+ if (once !== void 0) {
3146
+ warn$1(
3147
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
3148
+ );
3149
+ }
3150
+ }
3151
+ const baseWatchOptions = extend({}, options);
3152
+ baseWatchOptions.onWarn = warn$1;
3153
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
3154
+ let ssrCleanup;
3155
+ if (isInSSRComponentSetup) {
3156
+ if (flush === "sync") {
3157
+ const ctx = useSSRContext();
3158
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
3159
+ } else if (!runsImmediately) {
3160
+ const watchStopHandle = () => {
3161
+ };
3162
+ watchStopHandle.stop = NOOP;
3163
+ watchStopHandle.resume = NOOP;
3164
+ watchStopHandle.pause = NOOP;
3165
+ return watchStopHandle;
3166
+ }
3167
+ }
3168
+ const instance = currentInstance;
3169
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3170
+ let isPre = false;
3171
+ if (flush === "post") {
3172
+ baseWatchOptions.scheduler = (job) => {
3173
+ queuePostRenderEffect(job, instance && instance.suspense);
3174
+ };
3175
+ } else if (flush !== "sync") {
3176
+ isPre = true;
3177
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
3178
+ if (isFirstRun) {
3179
+ job();
3180
+ } else {
3181
+ queueJob(job);
3182
+ }
3183
+ };
3184
+ }
3185
+ baseWatchOptions.augmentJob = (job) => {
3186
+ if (cb) {
3187
+ job.flags |= 4;
3188
+ }
3189
+ if (isPre) {
3190
+ job.flags |= 2;
3191
+ if (instance) {
3192
+ job.id = instance.uid;
3193
+ job.i = instance;
3194
+ }
3195
+ }
3196
+ };
3197
+ const watchHandle = watch$1(source, cb, baseWatchOptions);
3198
+ if (isInSSRComponentSetup) {
3199
+ if (ssrCleanup) {
3200
+ ssrCleanup.push(watchHandle);
3201
+ } else if (runsImmediately) {
3202
+ watchHandle();
3203
+ }
3204
+ }
3205
+ return watchHandle;
3206
+ }
3207
+ function instanceWatch(source, value, options) {
3208
+ const publicThis = this.proxy;
3209
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
3210
+ let cb;
3211
+ if (isFunction(value)) {
3212
+ cb = value;
3213
+ } else {
3214
+ cb = value.handler;
3215
+ options = value;
3216
+ }
3217
+ const reset = setCurrentInstance(this);
3218
+ const res = doWatch(getter, cb.bind(publicThis), options);
3219
+ reset();
3220
+ return res;
3221
+ }
3222
+ function createPathGetter(ctx, path) {
3223
+ const segments = path.split(".");
3224
+ return () => {
3225
+ let cur = ctx;
3226
+ for (let i = 0; i < segments.length && cur; i++) {
3227
+ cur = cur[segments[i]];
3228
+ }
3229
+ return cur;
3230
+ };
3231
+ }
3232
+
3233
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3017
3234
  const isTeleport = (type) => type.__isTeleport;
3018
3235
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
3019
3236
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -3066,9 +3283,6 @@ const TeleportImpl = {
3066
3283
  insert(mainAnchor, container, anchor);
3067
3284
  const mount = (container2, anchor2) => {
3068
3285
  if (shapeFlag & 16) {
3069
- if (parentComponent && parentComponent.isCE) {
3070
- parentComponent.ce._teleportTarget = container2;
3071
- }
3072
3286
  mountChildren(
3073
3287
  children,
3074
3288
  container2,
@@ -3090,6 +3304,9 @@ const TeleportImpl = {
3090
3304
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3091
3305
  namespace = "mathml";
3092
3306
  }
3307
+ if (parentComponent && parentComponent.isCE) {
3308
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3309
+ }
3093
3310
  if (!disabled) {
3094
3311
  mount(target, targetAnchor);
3095
3312
  updateCssVars(n2, false);
@@ -3373,8 +3590,8 @@ function prepareAnchor(target, vnode, createText, insert) {
3373
3590
  return targetAnchor;
3374
3591
  }
3375
3592
 
3376
- const leaveCbKey = Symbol("_leaveCb");
3377
- const enterCbKey$1 = Symbol("_enterCb");
3593
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
3594
+ const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
3378
3595
  function useTransitionState() {
3379
3596
  const state = {
3380
3597
  isMounted: false,
@@ -4196,14 +4413,16 @@ Server rendered element contains more child nodes than client vdom.`
4196
4413
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4197
4414
  clientText = clientText.slice(1);
4198
4415
  }
4199
- if (el.textContent !== clientText) {
4416
+ const { textContent } = el;
4417
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
4418
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
4200
4419
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4201
4420
  warn$1(
4202
4421
  `Hydration text content mismatch on`,
4203
4422
  el,
4204
4423
  `
4205
- - rendered on server: ${el.textContent}
4206
- - expected on client: ${vnode.children}`
4424
+ - rendered on server: ${textContent}
4425
+ - expected on client: ${clientText}`
4207
4426
  );
4208
4427
  logMismatchError();
4209
4428
  }
@@ -4798,7 +5017,10 @@ function defineAsyncComponent(source) {
4798
5017
  error: error.value
4799
5018
  });
4800
5019
  } else if (loadingComponent && !delayed.value) {
4801
- return createVNode(loadingComponent);
5020
+ return createInnerComp(
5021
+ loadingComponent,
5022
+ instance
5023
+ );
4802
5024
  }
4803
5025
  };
4804
5026
  }
@@ -4906,7 +5128,9 @@ const KeepAliveImpl = {
4906
5128
  }
4907
5129
  function pruneCache(filter) {
4908
5130
  cache.forEach((vnode, key) => {
4909
- const name = getComponentName(vnode.type);
5131
+ const name = getComponentName(
5132
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
5133
+ );
4910
5134
  if (name && !filter(name)) {
4911
5135
  pruneCacheEntry(key);
4912
5136
  }
@@ -5133,7 +5357,7 @@ const DIRECTIVES = "directives";
5133
5357
  function resolveComponent(name, maybeSelfReference) {
5134
5358
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
5135
5359
  }
5136
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
5360
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
5137
5361
  function resolveDynamicComponent(component) {
5138
5362
  if (isString(component)) {
5139
5363
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -5255,12 +5479,13 @@ function createSlots(slots, dynamicSlots) {
5255
5479
 
5256
5480
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5257
5481
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5482
+ const hasProps = Object.keys(props).length > 0;
5258
5483
  if (name !== "default") props.name = name;
5259
5484
  return openBlock(), createBlock(
5260
5485
  Fragment,
5261
5486
  null,
5262
5487
  [createVNode("slot", props, fallback && fallback())],
5263
- 64
5488
+ hasProps ? -2 : 64
5264
5489
  );
5265
5490
  }
5266
5491
  let slot = slots[name];
@@ -5356,7 +5581,6 @@ const PublicInstanceProxyHandlers = {
5356
5581
  if (key === "__isVue") {
5357
5582
  return true;
5358
5583
  }
5359
- let normalizedProps;
5360
5584
  if (key[0] !== "$") {
5361
5585
  const n = accessCache[key];
5362
5586
  if (n !== void 0) {
@@ -5376,11 +5600,7 @@ const PublicInstanceProxyHandlers = {
5376
5600
  } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
5377
5601
  accessCache[key] = 2 /* DATA */;
5378
5602
  return data[key];
5379
- } else if (
5380
- // only cache other properties when instance has declared (thus stable)
5381
- // props
5382
- (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
5383
- ) {
5603
+ } else if (hasOwn(props, key)) {
5384
5604
  accessCache[key] = 3 /* PROPS */;
5385
5605
  return props[key];
5386
5606
  } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
@@ -5465,10 +5685,10 @@ const PublicInstanceProxyHandlers = {
5465
5685
  return true;
5466
5686
  },
5467
5687
  has({
5468
- _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5688
+ _: { data, setupState, accessCache, ctx, appContext, props, type }
5469
5689
  }, key) {
5470
- let normalizedProps, cssModules;
5471
- return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5690
+ let cssModules;
5691
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5472
5692
  },
5473
5693
  defineProperty(target, key, descriptor) {
5474
5694
  if (descriptor.get != null) {
@@ -6301,632 +6521,1093 @@ If you want to remount the same app, move your app creation logic into a factory
6301
6521
  }
6302
6522
  let currentApp = null;
6303
6523
 
6304
- function provide(key, value) {
6305
- if (!currentInstance) {
6306
- {
6307
- warn$1(`provide() can only be used inside setup().`);
6308
- }
6309
- } else {
6310
- let provides = currentInstance.provides;
6311
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
6312
- if (parentProvides === provides) {
6313
- provides = currentInstance.provides = Object.create(parentProvides);
6314
- }
6315
- provides[key] = value;
6316
- }
6317
- }
6318
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
6319
- const instance = getCurrentInstance();
6320
- if (instance || currentApp) {
6321
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6322
- if (provides && key in provides) {
6323
- return provides[key];
6324
- } else if (arguments.length > 1) {
6325
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
6326
- } else {
6327
- warn$1(`injection "${String(key)}" not found.`);
6328
- }
6329
- } else {
6330
- warn$1(`inject() can only be used inside setup() or functional components.`);
6331
- }
6332
- }
6333
- function hasInjectionContext() {
6334
- return !!(getCurrentInstance() || currentApp);
6335
- }
6336
-
6337
- const internalObjectProto = {};
6338
- const createInternalObject = () => Object.create(internalObjectProto);
6339
- const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
6340
-
6341
- function initProps(instance, rawProps, isStateful, isSSR = false) {
6342
- const props = {};
6343
- const attrs = createInternalObject();
6344
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
6345
- setFullProps(instance, rawProps, props, attrs);
6346
- for (const key in instance.propsOptions[0]) {
6347
- if (!(key in props)) {
6348
- props[key] = void 0;
6349
- }
6524
+ function useModel(props, name, options = EMPTY_OBJ) {
6525
+ const i = getCurrentInstance();
6526
+ if (!i) {
6527
+ warn$1(`useModel() called without active instance.`);
6528
+ return ref();
6350
6529
  }
6351
- {
6352
- validateProps(rawProps || {}, props, instance);
6530
+ const camelizedName = camelize(name);
6531
+ if (!i.propsOptions[0][camelizedName]) {
6532
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
6533
+ return ref();
6353
6534
  }
6354
- if (isStateful) {
6355
- instance.props = isSSR ? props : shallowReactive(props);
6356
- } else {
6357
- if (!instance.type.props) {
6358
- instance.props = attrs;
6359
- } else {
6360
- instance.props = props;
6361
- }
6362
- }
6363
- instance.attrs = attrs;
6364
- }
6365
- function isInHmrContext(instance) {
6366
- while (instance) {
6367
- if (instance.type.__hmrId) return true;
6368
- instance = instance.parent;
6369
- }
6370
- }
6371
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
6372
- const {
6373
- props,
6374
- attrs,
6375
- vnode: { patchFlag }
6376
- } = instance;
6377
- const rawCurrentProps = toRaw(props);
6378
- const [options] = instance.propsOptions;
6379
- let hasAttrsChanged = false;
6380
- if (
6381
- // always force full diff in dev
6382
- // - #1942 if hmr is enabled with sfc component
6383
- // - vite#872 non-sfc component used by sfc component
6384
- !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
6385
- ) {
6386
- if (patchFlag & 8) {
6387
- const propsToUpdate = instance.vnode.dynamicProps;
6388
- for (let i = 0; i < propsToUpdate.length; i++) {
6389
- let key = propsToUpdate[i];
6390
- if (isEmitListener(instance.emitsOptions, key)) {
6391
- continue;
6535
+ const hyphenatedName = hyphenate(name);
6536
+ const modifiers = getModelModifiers(props, camelizedName);
6537
+ const res = customRef((track, trigger) => {
6538
+ let localValue;
6539
+ let prevSetValue = EMPTY_OBJ;
6540
+ let prevEmittedValue;
6541
+ watchSyncEffect(() => {
6542
+ const propValue = props[camelizedName];
6543
+ if (hasChanged(localValue, propValue)) {
6544
+ localValue = propValue;
6545
+ trigger();
6546
+ }
6547
+ });
6548
+ return {
6549
+ get() {
6550
+ track();
6551
+ return options.get ? options.get(localValue) : localValue;
6552
+ },
6553
+ set(value) {
6554
+ const emittedValue = options.set ? options.set(value) : value;
6555
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
6556
+ return;
6392
6557
  }
6393
- const value = rawProps[key];
6394
- if (options) {
6395
- if (hasOwn(attrs, key)) {
6396
- if (value !== attrs[key]) {
6397
- attrs[key] = value;
6398
- hasAttrsChanged = true;
6399
- }
6400
- } else {
6401
- const camelizedKey = camelize(key);
6402
- props[camelizedKey] = resolvePropValue(
6403
- options,
6404
- rawCurrentProps,
6405
- camelizedKey,
6406
- value,
6407
- instance,
6408
- false
6409
- );
6410
- }
6411
- } else {
6412
- if (value !== attrs[key]) {
6413
- attrs[key] = value;
6414
- hasAttrsChanged = true;
6415
- }
6558
+ const rawProps = i.vnode.props;
6559
+ if (!(rawProps && // check if parent has passed v-model
6560
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
6561
+ localValue = value;
6562
+ trigger();
6416
6563
  }
6564
+ i.emit(`update:${name}`, emittedValue);
6565
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
6566
+ trigger();
6567
+ }
6568
+ prevSetValue = value;
6569
+ prevEmittedValue = emittedValue;
6417
6570
  }
6418
- }
6419
- } else {
6420
- if (setFullProps(instance, rawProps, props, attrs)) {
6421
- hasAttrsChanged = true;
6422
- }
6423
- let kebabKey;
6424
- for (const key in rawCurrentProps) {
6425
- if (!rawProps || // for camelCase
6426
- !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
6427
- // and converted to camelCase (#955)
6428
- ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
6429
- if (options) {
6430
- if (rawPrevProps && // for camelCase
6431
- (rawPrevProps[key] !== void 0 || // for kebab-case
6432
- rawPrevProps[kebabKey] !== void 0)) {
6433
- props[key] = resolvePropValue(
6434
- options,
6435
- rawCurrentProps,
6436
- key,
6437
- void 0,
6438
- instance,
6439
- true
6440
- );
6441
- }
6571
+ };
6572
+ });
6573
+ res[Symbol.iterator] = () => {
6574
+ let i2 = 0;
6575
+ return {
6576
+ next() {
6577
+ if (i2 < 2) {
6578
+ return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
6442
6579
  } else {
6443
- delete props[key];
6580
+ return { done: true };
6444
6581
  }
6445
6582
  }
6446
- }
6447
- if (attrs !== rawCurrentProps) {
6448
- for (const key in attrs) {
6449
- if (!rawProps || !hasOwn(rawProps, key) && true) {
6450
- delete attrs[key];
6451
- hasAttrsChanged = true;
6583
+ };
6584
+ };
6585
+ return res;
6586
+ }
6587
+ const getModelModifiers = (props, modelName) => {
6588
+ return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
6589
+ };
6590
+
6591
+ function emit(instance, event, ...rawArgs) {
6592
+ if (instance.isUnmounted) return;
6593
+ const props = instance.vnode.props || EMPTY_OBJ;
6594
+ {
6595
+ const {
6596
+ emitsOptions,
6597
+ propsOptions: [propsOptions]
6598
+ } = instance;
6599
+ if (emitsOptions) {
6600
+ if (!(event in emitsOptions) && true) {
6601
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
6602
+ warn$1(
6603
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
6604
+ );
6605
+ }
6606
+ } else {
6607
+ const validator = emitsOptions[event];
6608
+ if (isFunction(validator)) {
6609
+ const isValid = validator(...rawArgs);
6610
+ if (!isValid) {
6611
+ warn$1(
6612
+ `Invalid event arguments: event validation failed for event "${event}".`
6613
+ );
6614
+ }
6452
6615
  }
6453
6616
  }
6454
6617
  }
6455
6618
  }
6456
- if (hasAttrsChanged) {
6457
- trigger(instance.attrs, "set", "");
6619
+ let args = rawArgs;
6620
+ const isModelListener = event.startsWith("update:");
6621
+ const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
6622
+ if (modifiers) {
6623
+ if (modifiers.trim) {
6624
+ args = rawArgs.map((a) => isString(a) ? a.trim() : a);
6625
+ }
6626
+ if (modifiers.number) {
6627
+ args = rawArgs.map(looseToNumber);
6628
+ }
6458
6629
  }
6459
6630
  {
6460
- validateProps(rawProps || {}, props, instance);
6631
+ devtoolsComponentEmit(instance, event, args);
6461
6632
  }
6462
- }
6463
- function setFullProps(instance, rawProps, props, attrs) {
6464
- const [options, needCastKeys] = instance.propsOptions;
6465
- let hasAttrsChanged = false;
6466
- let rawCastValues;
6467
- if (rawProps) {
6468
- for (let key in rawProps) {
6469
- if (isReservedProp(key)) {
6470
- continue;
6471
- }
6472
- const value = rawProps[key];
6473
- let camelKey;
6474
- if (options && hasOwn(options, camelKey = camelize(key))) {
6475
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
6476
- props[camelKey] = value;
6477
- } else {
6478
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
6479
- }
6480
- } else if (!isEmitListener(instance.emitsOptions, key)) {
6481
- if (!(key in attrs) || value !== attrs[key]) {
6482
- attrs[key] = value;
6483
- hasAttrsChanged = true;
6484
- }
6485
- }
6633
+ {
6634
+ const lowerCaseEvent = event.toLowerCase();
6635
+ if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
6636
+ warn$1(
6637
+ `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
6638
+ instance,
6639
+ instance.type
6640
+ )} 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(
6641
+ event
6642
+ )}" instead of "${event}".`
6643
+ );
6486
6644
  }
6487
6645
  }
6488
- if (needCastKeys) {
6489
- const rawCurrentProps = toRaw(props);
6490
- const castValues = rawCastValues || EMPTY_OBJ;
6491
- for (let i = 0; i < needCastKeys.length; i++) {
6492
- const key = needCastKeys[i];
6493
- props[key] = resolvePropValue(
6494
- options,
6495
- rawCurrentProps,
6496
- key,
6497
- castValues[key],
6498
- instance,
6499
- !hasOwn(castValues, key)
6500
- );
6646
+ let handlerName;
6647
+ let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
6648
+ props[handlerName = toHandlerKey(camelize(event))];
6649
+ if (!handler && isModelListener) {
6650
+ handler = props[handlerName = toHandlerKey(hyphenate(event))];
6651
+ }
6652
+ if (handler) {
6653
+ callWithAsyncErrorHandling(
6654
+ handler,
6655
+ instance,
6656
+ 6,
6657
+ args
6658
+ );
6659
+ }
6660
+ const onceHandler = props[handlerName + `Once`];
6661
+ if (onceHandler) {
6662
+ if (!instance.emitted) {
6663
+ instance.emitted = {};
6664
+ } else if (instance.emitted[handlerName]) {
6665
+ return;
6501
6666
  }
6667
+ instance.emitted[handlerName] = true;
6668
+ callWithAsyncErrorHandling(
6669
+ onceHandler,
6670
+ instance,
6671
+ 6,
6672
+ args
6673
+ );
6502
6674
  }
6503
- return hasAttrsChanged;
6504
6675
  }
6505
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
6506
- const opt = options[key];
6507
- if (opt != null) {
6508
- const hasDefault = hasOwn(opt, "default");
6509
- if (hasDefault && value === void 0) {
6510
- const defaultValue = opt.default;
6511
- if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6512
- const { propsDefaults } = instance;
6513
- if (key in propsDefaults) {
6514
- value = propsDefaults[key];
6515
- } else {
6516
- const reset = setCurrentInstance(instance);
6517
- value = propsDefaults[key] = defaultValue.call(
6518
- null,
6519
- props
6520
- );
6521
- reset();
6522
- }
6523
- } else {
6524
- value = defaultValue;
6525
- }
6526
- if (instance.ce) {
6527
- instance.ce._setProp(key, value);
6528
- }
6529
- }
6530
- if (opt[0 /* shouldCast */]) {
6531
- if (isAbsent && !hasDefault) {
6532
- value = false;
6533
- } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
6534
- value = true;
6535
- }
6536
- }
6537
- }
6538
- return value;
6539
- }
6540
- const mixinPropsCache = /* @__PURE__ */ new WeakMap();
6541
- function normalizePropsOptions(comp, appContext, asMixin = false) {
6542
- const cache = asMixin ? mixinPropsCache : appContext.propsCache;
6676
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
6677
+ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6678
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
6543
6679
  const cached = cache.get(comp);
6544
- if (cached) {
6680
+ if (cached !== void 0) {
6545
6681
  return cached;
6546
6682
  }
6547
- const raw = comp.props;
6548
- const normalized = {};
6549
- const needCastKeys = [];
6683
+ const raw = comp.emits;
6684
+ let normalized = {};
6550
6685
  let hasExtends = false;
6551
6686
  if (!isFunction(comp)) {
6552
- const extendProps = (raw2) => {
6553
- hasExtends = true;
6554
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
6555
- extend(normalized, props);
6556
- if (keys) needCastKeys.push(...keys);
6687
+ const extendEmits = (raw2) => {
6688
+ const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
6689
+ if (normalizedFromExtend) {
6690
+ hasExtends = true;
6691
+ extend(normalized, normalizedFromExtend);
6692
+ }
6557
6693
  };
6558
6694
  if (!asMixin && appContext.mixins.length) {
6559
- appContext.mixins.forEach(extendProps);
6695
+ appContext.mixins.forEach(extendEmits);
6560
6696
  }
6561
6697
  if (comp.extends) {
6562
- extendProps(comp.extends);
6698
+ extendEmits(comp.extends);
6563
6699
  }
6564
6700
  if (comp.mixins) {
6565
- comp.mixins.forEach(extendProps);
6701
+ comp.mixins.forEach(extendEmits);
6566
6702
  }
6567
6703
  }
6568
6704
  if (!raw && !hasExtends) {
6569
6705
  if (isObject(comp)) {
6570
- cache.set(comp, EMPTY_ARR);
6706
+ cache.set(comp, null);
6571
6707
  }
6572
- return EMPTY_ARR;
6708
+ return null;
6573
6709
  }
6574
6710
  if (isArray(raw)) {
6575
- for (let i = 0; i < raw.length; i++) {
6576
- if (!isString(raw[i])) {
6577
- warn$1(`props must be strings when using array syntax.`, raw[i]);
6578
- }
6579
- const normalizedKey = camelize(raw[i]);
6580
- if (validatePropName(normalizedKey)) {
6581
- normalized[normalizedKey] = EMPTY_OBJ;
6711
+ raw.forEach((key) => normalized[key] = null);
6712
+ } else {
6713
+ extend(normalized, raw);
6714
+ }
6715
+ if (isObject(comp)) {
6716
+ cache.set(comp, normalized);
6717
+ }
6718
+ return normalized;
6719
+ }
6720
+ function isEmitListener(options, key) {
6721
+ if (!options || !isOn(key)) {
6722
+ return false;
6723
+ }
6724
+ key = key.slice(2).replace(/Once$/, "");
6725
+ return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
6726
+ }
6727
+
6728
+ let accessedAttrs = false;
6729
+ function markAttrsAccessed() {
6730
+ accessedAttrs = true;
6731
+ }
6732
+ function renderComponentRoot(instance) {
6733
+ const {
6734
+ type: Component,
6735
+ vnode,
6736
+ proxy,
6737
+ withProxy,
6738
+ propsOptions: [propsOptions],
6739
+ slots,
6740
+ attrs,
6741
+ emit,
6742
+ render,
6743
+ renderCache,
6744
+ props,
6745
+ data,
6746
+ setupState,
6747
+ ctx,
6748
+ inheritAttrs
6749
+ } = instance;
6750
+ const prev = setCurrentRenderingInstance(instance);
6751
+ let result;
6752
+ let fallthroughAttrs;
6753
+ {
6754
+ accessedAttrs = false;
6755
+ }
6756
+ try {
6757
+ if (vnode.shapeFlag & 4) {
6758
+ const proxyToUse = withProxy || proxy;
6759
+ const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
6760
+ get(target, key, receiver) {
6761
+ warn$1(
6762
+ `Property '${String(
6763
+ key
6764
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
6765
+ );
6766
+ return Reflect.get(target, key, receiver);
6767
+ }
6768
+ }) : proxyToUse;
6769
+ result = normalizeVNode(
6770
+ render.call(
6771
+ thisProxy,
6772
+ proxyToUse,
6773
+ renderCache,
6774
+ true ? shallowReadonly(props) : props,
6775
+ setupState,
6776
+ data,
6777
+ ctx
6778
+ )
6779
+ );
6780
+ fallthroughAttrs = attrs;
6781
+ } else {
6782
+ const render2 = Component;
6783
+ if (attrs === props) {
6784
+ markAttrsAccessed();
6582
6785
  }
6786
+ result = normalizeVNode(
6787
+ render2.length > 1 ? render2(
6788
+ true ? shallowReadonly(props) : props,
6789
+ true ? {
6790
+ get attrs() {
6791
+ markAttrsAccessed();
6792
+ return shallowReadonly(attrs);
6793
+ },
6794
+ slots,
6795
+ emit
6796
+ } : { attrs, slots, emit }
6797
+ ) : render2(
6798
+ true ? shallowReadonly(props) : props,
6799
+ null
6800
+ )
6801
+ );
6802
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
6583
6803
  }
6584
- } else if (raw) {
6585
- if (!isObject(raw)) {
6586
- warn$1(`invalid props options`, raw);
6587
- }
6588
- for (const key in raw) {
6589
- const normalizedKey = camelize(key);
6590
- if (validatePropName(normalizedKey)) {
6591
- const opt = raw[key];
6592
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6593
- const propType = prop.type;
6594
- let shouldCast = false;
6595
- let shouldCastTrue = true;
6596
- if (isArray(propType)) {
6597
- for (let index = 0; index < propType.length; ++index) {
6598
- const type = propType[index];
6599
- const typeName = isFunction(type) && type.name;
6600
- if (typeName === "Boolean") {
6601
- shouldCast = true;
6602
- break;
6603
- } else if (typeName === "String") {
6604
- shouldCastTrue = false;
6804
+ } catch (err) {
6805
+ blockStack.length = 0;
6806
+ handleError(err, instance, 1);
6807
+ result = createVNode(Comment);
6808
+ }
6809
+ let root = result;
6810
+ let setRoot = void 0;
6811
+ if (result.patchFlag > 0 && result.patchFlag & 2048) {
6812
+ [root, setRoot] = getChildRoot(result);
6813
+ }
6814
+ if (fallthroughAttrs && inheritAttrs !== false) {
6815
+ const keys = Object.keys(fallthroughAttrs);
6816
+ const { shapeFlag } = root;
6817
+ if (keys.length) {
6818
+ if (shapeFlag & (1 | 6)) {
6819
+ if (propsOptions && keys.some(isModelListener)) {
6820
+ fallthroughAttrs = filterModelListeners(
6821
+ fallthroughAttrs,
6822
+ propsOptions
6823
+ );
6824
+ }
6825
+ root = cloneVNode(root, fallthroughAttrs, false, true);
6826
+ } else if (!accessedAttrs && root.type !== Comment) {
6827
+ const allAttrs = Object.keys(attrs);
6828
+ const eventAttrs = [];
6829
+ const extraAttrs = [];
6830
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
6831
+ const key = allAttrs[i];
6832
+ if (isOn(key)) {
6833
+ if (!isModelListener(key)) {
6834
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
6605
6835
  }
6836
+ } else {
6837
+ extraAttrs.push(key);
6606
6838
  }
6607
- } else {
6608
- shouldCast = isFunction(propType) && propType.name === "Boolean";
6609
6839
  }
6610
- prop[0 /* shouldCast */] = shouldCast;
6611
- prop[1 /* shouldCastTrue */] = shouldCastTrue;
6612
- if (shouldCast || hasOwn(prop, "default")) {
6613
- needCastKeys.push(normalizedKey);
6840
+ if (extraAttrs.length) {
6841
+ warn$1(
6842
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
6843
+ );
6844
+ }
6845
+ if (eventAttrs.length) {
6846
+ warn$1(
6847
+ `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.`
6848
+ );
6614
6849
  }
6615
6850
  }
6616
6851
  }
6617
6852
  }
6618
- const res = [normalized, needCastKeys];
6619
- if (isObject(comp)) {
6620
- cache.set(comp, res);
6853
+ if (vnode.dirs) {
6854
+ if (!isElementRoot(root)) {
6855
+ warn$1(
6856
+ `Runtime directive used on component with non-element root node. The directives will not function as intended.`
6857
+ );
6858
+ }
6859
+ root = cloneVNode(root, null, false, true);
6860
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
6621
6861
  }
6622
- return res;
6623
- }
6624
- function validatePropName(key) {
6625
- if (key[0] !== "$" && !isReservedProp(key)) {
6626
- return true;
6862
+ if (vnode.transition) {
6863
+ if (!isElementRoot(root)) {
6864
+ warn$1(
6865
+ `Component inside <Transition> renders non-element root node that cannot be animated.`
6866
+ );
6867
+ }
6868
+ setTransitionHooks(root, vnode.transition);
6869
+ }
6870
+ if (setRoot) {
6871
+ setRoot(root);
6627
6872
  } else {
6628
- warn$1(`Invalid prop name: "${key}" is a reserved property.`);
6873
+ result = root;
6629
6874
  }
6630
- return false;
6875
+ setCurrentRenderingInstance(prev);
6876
+ return result;
6631
6877
  }
6632
- function getType(ctor) {
6633
- if (ctor === null) {
6634
- return "null";
6878
+ const getChildRoot = (vnode) => {
6879
+ const rawChildren = vnode.children;
6880
+ const dynamicChildren = vnode.dynamicChildren;
6881
+ const childRoot = filterSingleRoot(rawChildren, false);
6882
+ if (!childRoot) {
6883
+ return [vnode, void 0];
6884
+ } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
6885
+ return getChildRoot(childRoot);
6635
6886
  }
6636
- if (typeof ctor === "function") {
6637
- return ctor.name || "";
6638
- } else if (typeof ctor === "object") {
6639
- const name = ctor.constructor && ctor.constructor.name;
6640
- return name || "";
6887
+ const index = rawChildren.indexOf(childRoot);
6888
+ const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
6889
+ const setRoot = (updatedRoot) => {
6890
+ rawChildren[index] = updatedRoot;
6891
+ if (dynamicChildren) {
6892
+ if (dynamicIndex > -1) {
6893
+ dynamicChildren[dynamicIndex] = updatedRoot;
6894
+ } else if (updatedRoot.patchFlag > 0) {
6895
+ vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
6896
+ }
6897
+ }
6898
+ };
6899
+ return [normalizeVNode(childRoot), setRoot];
6900
+ };
6901
+ function filterSingleRoot(children, recurse = true) {
6902
+ let singleRoot;
6903
+ for (let i = 0; i < children.length; i++) {
6904
+ const child = children[i];
6905
+ if (isVNode(child)) {
6906
+ if (child.type !== Comment || child.children === "v-if") {
6907
+ if (singleRoot) {
6908
+ return;
6909
+ } else {
6910
+ singleRoot = child;
6911
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
6912
+ return filterSingleRoot(singleRoot.children);
6913
+ }
6914
+ }
6915
+ }
6916
+ } else {
6917
+ return;
6918
+ }
6641
6919
  }
6642
- return "";
6920
+ return singleRoot;
6643
6921
  }
6644
- function validateProps(rawProps, props, instance) {
6645
- const resolvedValues = toRaw(props);
6646
- const options = instance.propsOptions[0];
6647
- const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
6648
- for (const key in options) {
6649
- let opt = options[key];
6650
- if (opt == null) continue;
6651
- validateProp(
6652
- key,
6653
- resolvedValues[key],
6654
- opt,
6655
- shallowReadonly(resolvedValues) ,
6656
- !camelizePropsKey.includes(key)
6657
- );
6922
+ const getFunctionalFallthrough = (attrs) => {
6923
+ let res;
6924
+ for (const key in attrs) {
6925
+ if (key === "class" || key === "style" || isOn(key)) {
6926
+ (res || (res = {}))[key] = attrs[key];
6927
+ }
6658
6928
  }
6659
- }
6660
- function validateProp(name, value, prop, props, isAbsent) {
6661
- const { type, required, validator, skipCheck } = prop;
6662
- if (required && isAbsent) {
6663
- warn$1('Missing required prop: "' + name + '"');
6664
- return;
6929
+ return res;
6930
+ };
6931
+ const filterModelListeners = (attrs, props) => {
6932
+ const res = {};
6933
+ for (const key in attrs) {
6934
+ if (!isModelListener(key) || !(key.slice(9) in props)) {
6935
+ res[key] = attrs[key];
6936
+ }
6665
6937
  }
6666
- if (value == null && !required) {
6667
- return;
6938
+ return res;
6939
+ };
6940
+ const isElementRoot = (vnode) => {
6941
+ return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
6942
+ };
6943
+ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
6944
+ const { props: prevProps, children: prevChildren, component } = prevVNode;
6945
+ const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
6946
+ const emits = component.emitsOptions;
6947
+ if ((prevChildren || nextChildren) && isHmrUpdating) {
6948
+ return true;
6668
6949
  }
6669
- if (type != null && type !== true && !skipCheck) {
6670
- let isValid = false;
6671
- const types = isArray(type) ? type : [type];
6672
- const expectedTypes = [];
6673
- for (let i = 0; i < types.length && !isValid; i++) {
6674
- const { valid, expectedType } = assertType(value, types[i]);
6675
- expectedTypes.push(expectedType || "");
6676
- isValid = valid;
6950
+ if (nextVNode.dirs || nextVNode.transition) {
6951
+ return true;
6952
+ }
6953
+ if (optimized && patchFlag >= 0) {
6954
+ if (patchFlag & 1024) {
6955
+ return true;
6677
6956
  }
6678
- if (!isValid) {
6679
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
6680
- return;
6957
+ if (patchFlag & 16) {
6958
+ if (!prevProps) {
6959
+ return !!nextProps;
6960
+ }
6961
+ return hasPropsChanged(prevProps, nextProps, emits);
6962
+ } else if (patchFlag & 8) {
6963
+ const dynamicProps = nextVNode.dynamicProps;
6964
+ for (let i = 0; i < dynamicProps.length; i++) {
6965
+ const key = dynamicProps[i];
6966
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
6967
+ return true;
6968
+ }
6969
+ }
6681
6970
  }
6971
+ } else {
6972
+ if (prevChildren || nextChildren) {
6973
+ if (!nextChildren || !nextChildren.$stable) {
6974
+ return true;
6975
+ }
6976
+ }
6977
+ if (prevProps === nextProps) {
6978
+ return false;
6979
+ }
6980
+ if (!prevProps) {
6981
+ return !!nextProps;
6982
+ }
6983
+ if (!nextProps) {
6984
+ return true;
6985
+ }
6986
+ return hasPropsChanged(prevProps, nextProps, emits);
6682
6987
  }
6683
- if (validator && !validator(value, props)) {
6684
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
6685
- }
6988
+ return false;
6686
6989
  }
6687
- const isSimpleType = /* @__PURE__ */ makeMap(
6688
- "String,Number,Boolean,Function,Symbol,BigInt"
6689
- );
6690
- function assertType(value, type) {
6691
- let valid;
6692
- const expectedType = getType(type);
6693
- if (expectedType === "null") {
6694
- valid = value === null;
6695
- } else if (isSimpleType(expectedType)) {
6696
- const t = typeof value;
6697
- valid = t === expectedType.toLowerCase();
6698
- if (!valid && t === "object") {
6699
- valid = value instanceof type;
6990
+ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
6991
+ const nextKeys = Object.keys(nextProps);
6992
+ if (nextKeys.length !== Object.keys(prevProps).length) {
6993
+ return true;
6994
+ }
6995
+ for (let i = 0; i < nextKeys.length; i++) {
6996
+ const key = nextKeys[i];
6997
+ if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
6998
+ return true;
6700
6999
  }
6701
- } else if (expectedType === "Object") {
6702
- valid = isObject(value);
6703
- } else if (expectedType === "Array") {
6704
- valid = isArray(value);
6705
- } else {
6706
- valid = value instanceof type;
6707
7000
  }
6708
- return {
6709
- valid,
6710
- expectedType
6711
- };
7001
+ return false;
6712
7002
  }
6713
- function getInvalidTypeMessage(name, value, expectedTypes) {
6714
- if (expectedTypes.length === 0) {
6715
- return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
7003
+ function updateHOCHostEl({ vnode, parent }, el) {
7004
+ while (parent) {
7005
+ const root = parent.subTree;
7006
+ if (root.suspense && root.suspense.activeBranch === vnode) {
7007
+ root.el = vnode.el;
7008
+ }
7009
+ if (root === vnode) {
7010
+ (vnode = parent.vnode).el = el;
7011
+ parent = parent.parent;
7012
+ } else {
7013
+ break;
7014
+ }
6716
7015
  }
6717
- let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
6718
- const expectedType = expectedTypes[0];
6719
- const receivedType = toRawType(value);
6720
- const expectedValue = styleValue(value, expectedType);
6721
- const receivedValue = styleValue(value, receivedType);
6722
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
6723
- message += ` with value ${expectedValue}`;
7016
+ }
7017
+
7018
+ const internalObjectProto = {};
7019
+ const createInternalObject = () => Object.create(internalObjectProto);
7020
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7021
+
7022
+ function initProps(instance, rawProps, isStateful, isSSR = false) {
7023
+ const props = {};
7024
+ const attrs = createInternalObject();
7025
+ instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7026
+ setFullProps(instance, rawProps, props, attrs);
7027
+ for (const key in instance.propsOptions[0]) {
7028
+ if (!(key in props)) {
7029
+ props[key] = void 0;
7030
+ }
6724
7031
  }
6725
- message += `, got ${receivedType} `;
6726
- if (isExplicable(receivedType)) {
6727
- message += `with value ${receivedValue}.`;
7032
+ {
7033
+ validateProps(rawProps || {}, props, instance);
6728
7034
  }
6729
- return message;
6730
- }
6731
- function styleValue(value, type) {
6732
- if (type === "String") {
6733
- return `"${value}"`;
6734
- } else if (type === "Number") {
6735
- return `${Number(value)}`;
7035
+ if (isStateful) {
7036
+ instance.props = isSSR ? props : shallowReactive(props);
6736
7037
  } else {
6737
- return `${value}`;
7038
+ if (!instance.type.props) {
7039
+ instance.props = attrs;
7040
+ } else {
7041
+ instance.props = props;
7042
+ }
6738
7043
  }
7044
+ instance.attrs = attrs;
6739
7045
  }
6740
- function isExplicable(type) {
6741
- const explicitTypes = ["string", "number", "boolean"];
6742
- return explicitTypes.some((elem) => type.toLowerCase() === elem);
6743
- }
6744
- function isBoolean(...args) {
6745
- return args.some((elem) => elem.toLowerCase() === "boolean");
7046
+ function isInHmrContext(instance) {
7047
+ while (instance) {
7048
+ if (instance.type.__hmrId) return true;
7049
+ instance = instance.parent;
7050
+ }
6746
7051
  }
6747
-
6748
- const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6749
- const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6750
- const normalizeSlot = (key, rawSlot, ctx) => {
6751
- if (rawSlot._n) {
6752
- return rawSlot;
6753
- }
6754
- const normalized = withCtx((...args) => {
6755
- if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
6756
- warn$1(
6757
- `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.`
6758
- );
7052
+ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7053
+ const {
7054
+ props,
7055
+ attrs,
7056
+ vnode: { patchFlag }
7057
+ } = instance;
7058
+ const rawCurrentProps = toRaw(props);
7059
+ const [options] = instance.propsOptions;
7060
+ let hasAttrsChanged = false;
7061
+ if (
7062
+ // always force full diff in dev
7063
+ // - #1942 if hmr is enabled with sfc component
7064
+ // - vite#872 non-sfc component used by sfc component
7065
+ !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
7066
+ ) {
7067
+ if (patchFlag & 8) {
7068
+ const propsToUpdate = instance.vnode.dynamicProps;
7069
+ for (let i = 0; i < propsToUpdate.length; i++) {
7070
+ let key = propsToUpdate[i];
7071
+ if (isEmitListener(instance.emitsOptions, key)) {
7072
+ continue;
7073
+ }
7074
+ const value = rawProps[key];
7075
+ if (options) {
7076
+ if (hasOwn(attrs, key)) {
7077
+ if (value !== attrs[key]) {
7078
+ attrs[key] = value;
7079
+ hasAttrsChanged = true;
7080
+ }
7081
+ } else {
7082
+ const camelizedKey = camelize(key);
7083
+ props[camelizedKey] = resolvePropValue(
7084
+ options,
7085
+ rawCurrentProps,
7086
+ camelizedKey,
7087
+ value,
7088
+ instance,
7089
+ false
7090
+ );
7091
+ }
7092
+ } else {
7093
+ if (value !== attrs[key]) {
7094
+ attrs[key] = value;
7095
+ hasAttrsChanged = true;
7096
+ }
7097
+ }
7098
+ }
6759
7099
  }
6760
- return normalizeSlotValue(rawSlot(...args));
6761
- }, ctx);
6762
- normalized._c = false;
6763
- return normalized;
6764
- };
6765
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
6766
- const ctx = rawSlots._ctx;
6767
- for (const key in rawSlots) {
6768
- if (isInternalKey(key)) continue;
6769
- const value = rawSlots[key];
6770
- if (isFunction(value)) {
6771
- slots[key] = normalizeSlot(key, value, ctx);
6772
- } else if (value != null) {
6773
- {
6774
- warn$1(
6775
- `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
6776
- );
7100
+ } else {
7101
+ if (setFullProps(instance, rawProps, props, attrs)) {
7102
+ hasAttrsChanged = true;
7103
+ }
7104
+ let kebabKey;
7105
+ for (const key in rawCurrentProps) {
7106
+ if (!rawProps || // for camelCase
7107
+ !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
7108
+ // and converted to camelCase (#955)
7109
+ ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
7110
+ if (options) {
7111
+ if (rawPrevProps && // for camelCase
7112
+ (rawPrevProps[key] !== void 0 || // for kebab-case
7113
+ rawPrevProps[kebabKey] !== void 0)) {
7114
+ props[key] = resolvePropValue(
7115
+ options,
7116
+ rawCurrentProps,
7117
+ key,
7118
+ void 0,
7119
+ instance,
7120
+ true
7121
+ );
7122
+ }
7123
+ } else {
7124
+ delete props[key];
7125
+ }
7126
+ }
7127
+ }
7128
+ if (attrs !== rawCurrentProps) {
7129
+ for (const key in attrs) {
7130
+ if (!rawProps || !hasOwn(rawProps, key) && true) {
7131
+ delete attrs[key];
7132
+ hasAttrsChanged = true;
7133
+ }
6777
7134
  }
6778
- const normalized = normalizeSlotValue(value);
6779
- slots[key] = () => normalized;
6780
7135
  }
6781
7136
  }
6782
- };
6783
- const normalizeVNodeSlots = (instance, children) => {
6784
- if (!isKeepAlive(instance.vnode) && true) {
6785
- warn$1(
6786
- `Non-function value encountered for default slot. Prefer function slots for better performance.`
6787
- );
7137
+ if (hasAttrsChanged) {
7138
+ trigger(instance.attrs, "set", "");
6788
7139
  }
6789
- const normalized = normalizeSlotValue(children);
6790
- instance.slots.default = () => normalized;
6791
- };
6792
- const assignSlots = (slots, children, optimized) => {
6793
- for (const key in children) {
6794
- if (optimized || !isInternalKey(key)) {
6795
- slots[key] = children[key];
6796
- }
7140
+ {
7141
+ validateProps(rawProps || {}, props, instance);
6797
7142
  }
6798
- };
6799
- const initSlots = (instance, children, optimized) => {
6800
- const slots = instance.slots = createInternalObject();
6801
- if (instance.vnode.shapeFlag & 32) {
6802
- const type = children._;
6803
- if (type) {
6804
- assignSlots(slots, children, optimized);
6805
- if (optimized) {
6806
- def(slots, "_", type, true);
7143
+ }
7144
+ function setFullProps(instance, rawProps, props, attrs) {
7145
+ const [options, needCastKeys] = instance.propsOptions;
7146
+ let hasAttrsChanged = false;
7147
+ let rawCastValues;
7148
+ if (rawProps) {
7149
+ for (let key in rawProps) {
7150
+ if (isReservedProp(key)) {
7151
+ continue;
7152
+ }
7153
+ const value = rawProps[key];
7154
+ let camelKey;
7155
+ if (options && hasOwn(options, camelKey = camelize(key))) {
7156
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) {
7157
+ props[camelKey] = value;
7158
+ } else {
7159
+ (rawCastValues || (rawCastValues = {}))[camelKey] = value;
7160
+ }
7161
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
7162
+ if (!(key in attrs) || value !== attrs[key]) {
7163
+ attrs[key] = value;
7164
+ hasAttrsChanged = true;
7165
+ }
6807
7166
  }
6808
- } else {
6809
- normalizeObjectSlots(children, slots);
6810
7167
  }
6811
- } else if (children) {
6812
- normalizeVNodeSlots(instance, children);
6813
7168
  }
6814
- };
6815
- const updateSlots = (instance, children, optimized) => {
6816
- const { vnode, slots } = instance;
6817
- let needDeletionCheck = true;
6818
- let deletionComparisonTarget = EMPTY_OBJ;
6819
- if (vnode.shapeFlag & 32) {
6820
- const type = children._;
6821
- if (type) {
6822
- if (isHmrUpdating) {
6823
- assignSlots(slots, children, optimized);
6824
- trigger(instance, "set", "$slots");
6825
- } else if (optimized && type === 1) {
6826
- needDeletionCheck = false;
7169
+ if (needCastKeys) {
7170
+ const rawCurrentProps = toRaw(props);
7171
+ const castValues = rawCastValues || EMPTY_OBJ;
7172
+ for (let i = 0; i < needCastKeys.length; i++) {
7173
+ const key = needCastKeys[i];
7174
+ props[key] = resolvePropValue(
7175
+ options,
7176
+ rawCurrentProps,
7177
+ key,
7178
+ castValues[key],
7179
+ instance,
7180
+ !hasOwn(castValues, key)
7181
+ );
7182
+ }
7183
+ }
7184
+ return hasAttrsChanged;
7185
+ }
7186
+ function resolvePropValue(options, props, key, value, instance, isAbsent) {
7187
+ const opt = options[key];
7188
+ if (opt != null) {
7189
+ const hasDefault = hasOwn(opt, "default");
7190
+ if (hasDefault && value === void 0) {
7191
+ const defaultValue = opt.default;
7192
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
7193
+ const { propsDefaults } = instance;
7194
+ if (key in propsDefaults) {
7195
+ value = propsDefaults[key];
7196
+ } else {
7197
+ const reset = setCurrentInstance(instance);
7198
+ value = propsDefaults[key] = defaultValue.call(
7199
+ null,
7200
+ props
7201
+ );
7202
+ reset();
7203
+ }
6827
7204
  } else {
6828
- assignSlots(slots, children, optimized);
7205
+ value = defaultValue;
7206
+ }
7207
+ if (instance.ce) {
7208
+ instance.ce._setProp(key, value);
6829
7209
  }
6830
- } else {
6831
- needDeletionCheck = !children.$stable;
6832
- normalizeObjectSlots(children, slots);
6833
7210
  }
6834
- deletionComparisonTarget = children;
6835
- } else if (children) {
6836
- normalizeVNodeSlots(instance, children);
6837
- deletionComparisonTarget = { default: 1 };
6838
- }
6839
- if (needDeletionCheck) {
6840
- for (const key in slots) {
6841
- if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
6842
- delete slots[key];
7211
+ if (opt[0 /* shouldCast */]) {
7212
+ if (isAbsent && !hasDefault) {
7213
+ value = false;
7214
+ } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
7215
+ value = true;
6843
7216
  }
6844
7217
  }
6845
7218
  }
6846
- };
6847
-
6848
- let supported;
6849
- let perf;
6850
- function startMeasure(instance, type) {
6851
- if (instance.appContext.config.performance && isSupported()) {
6852
- perf.mark(`vue-${type}-${instance.uid}`);
6853
- }
6854
- {
6855
- devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
6856
- }
7219
+ return value;
6857
7220
  }
6858
- function endMeasure(instance, type) {
6859
- if (instance.appContext.config.performance && isSupported()) {
6860
- const startTag = `vue-${type}-${instance.uid}`;
6861
- const endTag = startTag + `:end`;
6862
- const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6863
- perf.mark(endTag);
6864
- perf.measure(measureName, startTag, endTag);
6865
- perf.clearMeasures(measureName);
6866
- perf.clearMarks(startTag);
6867
- perf.clearMarks(endTag);
6868
- }
6869
- {
6870
- devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
7221
+ const mixinPropsCache = /* @__PURE__ */ new WeakMap();
7222
+ function normalizePropsOptions(comp, appContext, asMixin = false) {
7223
+ const cache = asMixin ? mixinPropsCache : appContext.propsCache;
7224
+ const cached = cache.get(comp);
7225
+ if (cached) {
7226
+ return cached;
6871
7227
  }
6872
- }
6873
- function isSupported() {
6874
- if (supported !== void 0) {
6875
- return supported;
7228
+ const raw = comp.props;
7229
+ const normalized = {};
7230
+ const needCastKeys = [];
7231
+ let hasExtends = false;
7232
+ if (!isFunction(comp)) {
7233
+ const extendProps = (raw2) => {
7234
+ hasExtends = true;
7235
+ const [props, keys] = normalizePropsOptions(raw2, appContext, true);
7236
+ extend(normalized, props);
7237
+ if (keys) needCastKeys.push(...keys);
7238
+ };
7239
+ if (!asMixin && appContext.mixins.length) {
7240
+ appContext.mixins.forEach(extendProps);
7241
+ }
7242
+ if (comp.extends) {
7243
+ extendProps(comp.extends);
7244
+ }
7245
+ if (comp.mixins) {
7246
+ comp.mixins.forEach(extendProps);
7247
+ }
6876
7248
  }
6877
- if (typeof window !== "undefined" && window.performance) {
6878
- supported = true;
6879
- perf = window.performance;
7249
+ if (!raw && !hasExtends) {
7250
+ if (isObject(comp)) {
7251
+ cache.set(comp, EMPTY_ARR);
7252
+ }
7253
+ return EMPTY_ARR;
7254
+ }
7255
+ if (isArray(raw)) {
7256
+ for (let i = 0; i < raw.length; i++) {
7257
+ if (!isString(raw[i])) {
7258
+ warn$1(`props must be strings when using array syntax.`, raw[i]);
7259
+ }
7260
+ const normalizedKey = camelize(raw[i]);
7261
+ if (validatePropName(normalizedKey)) {
7262
+ normalized[normalizedKey] = EMPTY_OBJ;
7263
+ }
7264
+ }
7265
+ } else if (raw) {
7266
+ if (!isObject(raw)) {
7267
+ warn$1(`invalid props options`, raw);
7268
+ }
7269
+ for (const key in raw) {
7270
+ const normalizedKey = camelize(key);
7271
+ if (validatePropName(normalizedKey)) {
7272
+ const opt = raw[key];
7273
+ const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
7274
+ const propType = prop.type;
7275
+ let shouldCast = false;
7276
+ let shouldCastTrue = true;
7277
+ if (isArray(propType)) {
7278
+ for (let index = 0; index < propType.length; ++index) {
7279
+ const type = propType[index];
7280
+ const typeName = isFunction(type) && type.name;
7281
+ if (typeName === "Boolean") {
7282
+ shouldCast = true;
7283
+ break;
7284
+ } else if (typeName === "String") {
7285
+ shouldCastTrue = false;
7286
+ }
7287
+ }
7288
+ } else {
7289
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
7290
+ }
7291
+ prop[0 /* shouldCast */] = shouldCast;
7292
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
7293
+ if (shouldCast || hasOwn(prop, "default")) {
7294
+ needCastKeys.push(normalizedKey);
7295
+ }
7296
+ }
7297
+ }
7298
+ }
7299
+ const res = [normalized, needCastKeys];
7300
+ if (isObject(comp)) {
7301
+ cache.set(comp, res);
7302
+ }
7303
+ return res;
7304
+ }
7305
+ function validatePropName(key) {
7306
+ if (key[0] !== "$" && !isReservedProp(key)) {
7307
+ return true;
6880
7308
  } else {
6881
- supported = false;
7309
+ warn$1(`Invalid prop name: "${key}" is a reserved property.`);
6882
7310
  }
6883
- return supported;
7311
+ return false;
6884
7312
  }
6885
-
6886
- const queuePostRenderEffect = queueEffectWithSuspense ;
6887
- function createRenderer(options) {
6888
- return baseCreateRenderer(options);
7313
+ function getType(ctor) {
7314
+ if (ctor === null) {
7315
+ return "null";
7316
+ }
7317
+ if (typeof ctor === "function") {
7318
+ return ctor.name || "";
7319
+ } else if (typeof ctor === "object") {
7320
+ const name = ctor.constructor && ctor.constructor.name;
7321
+ return name || "";
7322
+ }
7323
+ return "";
6889
7324
  }
6890
- function createHydrationRenderer(options) {
6891
- return baseCreateRenderer(options, createHydrationFunctions);
7325
+ function validateProps(rawProps, props, instance) {
7326
+ const resolvedValues = toRaw(props);
7327
+ const options = instance.propsOptions[0];
7328
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
7329
+ for (const key in options) {
7330
+ let opt = options[key];
7331
+ if (opt == null) continue;
7332
+ validateProp(
7333
+ key,
7334
+ resolvedValues[key],
7335
+ opt,
7336
+ shallowReadonly(resolvedValues) ,
7337
+ !camelizePropsKey.includes(key)
7338
+ );
7339
+ }
6892
7340
  }
6893
- function baseCreateRenderer(options, createHydrationFns) {
6894
- const target = getGlobalThis();
6895
- target.__VUE__ = true;
6896
- {
6897
- setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
7341
+ function validateProp(name, value, prop, props, isAbsent) {
7342
+ const { type, required, validator, skipCheck } = prop;
7343
+ if (required && isAbsent) {
7344
+ warn$1('Missing required prop: "' + name + '"');
7345
+ return;
6898
7346
  }
6899
- const {
6900
- insert: hostInsert,
6901
- remove: hostRemove,
6902
- patchProp: hostPatchProp,
6903
- createElement: hostCreateElement,
6904
- createText: hostCreateText,
6905
- createComment: hostCreateComment,
6906
- setText: hostSetText,
6907
- setElementText: hostSetElementText,
6908
- parentNode: hostParentNode,
6909
- nextSibling: hostNextSibling,
6910
- setScopeId: hostSetScopeId = NOOP,
6911
- insertStaticContent: hostInsertStaticContent
6912
- } = options;
6913
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6914
- if (n1 === n2) {
7347
+ if (value == null && !required) {
7348
+ return;
7349
+ }
7350
+ if (type != null && type !== true && !skipCheck) {
7351
+ let isValid = false;
7352
+ const types = isArray(type) ? type : [type];
7353
+ const expectedTypes = [];
7354
+ for (let i = 0; i < types.length && !isValid; i++) {
7355
+ const { valid, expectedType } = assertType(value, types[i]);
7356
+ expectedTypes.push(expectedType || "");
7357
+ isValid = valid;
7358
+ }
7359
+ if (!isValid) {
7360
+ warn$1(getInvalidTypeMessage(name, value, expectedTypes));
6915
7361
  return;
6916
7362
  }
6917
- if (n1 && !isSameVNodeType(n1, n2)) {
6918
- anchor = getNextHostNode(n1);
6919
- unmount(n1, parentComponent, parentSuspense, true);
6920
- n1 = null;
7363
+ }
7364
+ if (validator && !validator(value, props)) {
7365
+ warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
7366
+ }
7367
+ }
7368
+ const isSimpleType = /* @__PURE__ */ makeMap(
7369
+ "String,Number,Boolean,Function,Symbol,BigInt"
7370
+ );
7371
+ function assertType(value, type) {
7372
+ let valid;
7373
+ const expectedType = getType(type);
7374
+ if (expectedType === "null") {
7375
+ valid = value === null;
7376
+ } else if (isSimpleType(expectedType)) {
7377
+ const t = typeof value;
7378
+ valid = t === expectedType.toLowerCase();
7379
+ if (!valid && t === "object") {
7380
+ valid = value instanceof type;
6921
7381
  }
6922
- if (n2.patchFlag === -2) {
6923
- optimized = false;
6924
- n2.dynamicChildren = null;
7382
+ } else if (expectedType === "Object") {
7383
+ valid = isObject(value);
7384
+ } else if (expectedType === "Array") {
7385
+ valid = isArray(value);
7386
+ } else {
7387
+ valid = value instanceof type;
7388
+ }
7389
+ return {
7390
+ valid,
7391
+ expectedType
7392
+ };
7393
+ }
7394
+ function getInvalidTypeMessage(name, value, expectedTypes) {
7395
+ if (expectedTypes.length === 0) {
7396
+ return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
7397
+ }
7398
+ let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
7399
+ const expectedType = expectedTypes[0];
7400
+ const receivedType = toRawType(value);
7401
+ const expectedValue = styleValue(value, expectedType);
7402
+ const receivedValue = styleValue(value, receivedType);
7403
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
7404
+ message += ` with value ${expectedValue}`;
7405
+ }
7406
+ message += `, got ${receivedType} `;
7407
+ if (isExplicable(receivedType)) {
7408
+ message += `with value ${receivedValue}.`;
7409
+ }
7410
+ return message;
7411
+ }
7412
+ function styleValue(value, type) {
7413
+ if (type === "String") {
7414
+ return `"${value}"`;
7415
+ } else if (type === "Number") {
7416
+ return `${Number(value)}`;
7417
+ } else {
7418
+ return `${value}`;
7419
+ }
7420
+ }
7421
+ function isExplicable(type) {
7422
+ const explicitTypes = ["string", "number", "boolean"];
7423
+ return explicitTypes.some((elem) => type.toLowerCase() === elem);
7424
+ }
7425
+ function isBoolean(...args) {
7426
+ return args.some((elem) => elem.toLowerCase() === "boolean");
7427
+ }
7428
+
7429
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
7430
+ const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
7431
+ const normalizeSlot = (key, rawSlot, ctx) => {
7432
+ if (rawSlot._n) {
7433
+ return rawSlot;
7434
+ }
7435
+ const normalized = withCtx((...args) => {
7436
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
7437
+ warn$1(
7438
+ `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.`
7439
+ );
6925
7440
  }
6926
- const { type, ref, shapeFlag } = n2;
6927
- switch (type) {
6928
- case Text:
6929
- processText(n1, n2, container, anchor);
7441
+ return normalizeSlotValue(rawSlot(...args));
7442
+ }, ctx);
7443
+ normalized._c = false;
7444
+ return normalized;
7445
+ };
7446
+ const normalizeObjectSlots = (rawSlots, slots, instance) => {
7447
+ const ctx = rawSlots._ctx;
7448
+ for (const key in rawSlots) {
7449
+ if (isInternalKey(key)) continue;
7450
+ const value = rawSlots[key];
7451
+ if (isFunction(value)) {
7452
+ slots[key] = normalizeSlot(key, value, ctx);
7453
+ } else if (value != null) {
7454
+ {
7455
+ warn$1(
7456
+ `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
7457
+ );
7458
+ }
7459
+ const normalized = normalizeSlotValue(value);
7460
+ slots[key] = () => normalized;
7461
+ }
7462
+ }
7463
+ };
7464
+ const normalizeVNodeSlots = (instance, children) => {
7465
+ if (!isKeepAlive(instance.vnode) && true) {
7466
+ warn$1(
7467
+ `Non-function value encountered for default slot. Prefer function slots for better performance.`
7468
+ );
7469
+ }
7470
+ const normalized = normalizeSlotValue(children);
7471
+ instance.slots.default = () => normalized;
7472
+ };
7473
+ const assignSlots = (slots, children, optimized) => {
7474
+ for (const key in children) {
7475
+ if (optimized || !isInternalKey(key)) {
7476
+ slots[key] = children[key];
7477
+ }
7478
+ }
7479
+ };
7480
+ const initSlots = (instance, children, optimized) => {
7481
+ const slots = instance.slots = createInternalObject();
7482
+ if (instance.vnode.shapeFlag & 32) {
7483
+ const type = children._;
7484
+ if (type) {
7485
+ assignSlots(slots, children, optimized);
7486
+ if (optimized) {
7487
+ def(slots, "_", type, true);
7488
+ }
7489
+ } else {
7490
+ normalizeObjectSlots(children, slots);
7491
+ }
7492
+ } else if (children) {
7493
+ normalizeVNodeSlots(instance, children);
7494
+ }
7495
+ };
7496
+ const updateSlots = (instance, children, optimized) => {
7497
+ const { vnode, slots } = instance;
7498
+ let needDeletionCheck = true;
7499
+ let deletionComparisonTarget = EMPTY_OBJ;
7500
+ if (vnode.shapeFlag & 32) {
7501
+ const type = children._;
7502
+ if (type) {
7503
+ if (isHmrUpdating) {
7504
+ assignSlots(slots, children, optimized);
7505
+ trigger(instance, "set", "$slots");
7506
+ } else if (optimized && type === 1) {
7507
+ needDeletionCheck = false;
7508
+ } else {
7509
+ assignSlots(slots, children, optimized);
7510
+ }
7511
+ } else {
7512
+ needDeletionCheck = !children.$stable;
7513
+ normalizeObjectSlots(children, slots);
7514
+ }
7515
+ deletionComparisonTarget = children;
7516
+ } else if (children) {
7517
+ normalizeVNodeSlots(instance, children);
7518
+ deletionComparisonTarget = { default: 1 };
7519
+ }
7520
+ if (needDeletionCheck) {
7521
+ for (const key in slots) {
7522
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
7523
+ delete slots[key];
7524
+ }
7525
+ }
7526
+ }
7527
+ };
7528
+
7529
+ let supported;
7530
+ let perf;
7531
+ function startMeasure(instance, type) {
7532
+ if (instance.appContext.config.performance && isSupported()) {
7533
+ perf.mark(`vue-${type}-${instance.uid}`);
7534
+ }
7535
+ {
7536
+ devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
7537
+ }
7538
+ }
7539
+ function endMeasure(instance, type) {
7540
+ if (instance.appContext.config.performance && isSupported()) {
7541
+ const startTag = `vue-${type}-${instance.uid}`;
7542
+ const endTag = startTag + `:end`;
7543
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
7544
+ perf.mark(endTag);
7545
+ perf.measure(measureName, startTag, endTag);
7546
+ perf.clearMeasures(measureName);
7547
+ perf.clearMarks(startTag);
7548
+ perf.clearMarks(endTag);
7549
+ }
7550
+ {
7551
+ devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
7552
+ }
7553
+ }
7554
+ function isSupported() {
7555
+ if (supported !== void 0) {
7556
+ return supported;
7557
+ }
7558
+ if (typeof window !== "undefined" && window.performance) {
7559
+ supported = true;
7560
+ perf = window.performance;
7561
+ } else {
7562
+ supported = false;
7563
+ }
7564
+ return supported;
7565
+ }
7566
+
7567
+ const queuePostRenderEffect = queueEffectWithSuspense ;
7568
+ function createRenderer(options) {
7569
+ return baseCreateRenderer(options);
7570
+ }
7571
+ function createHydrationRenderer(options) {
7572
+ return baseCreateRenderer(options, createHydrationFunctions);
7573
+ }
7574
+ function baseCreateRenderer(options, createHydrationFns) {
7575
+ const target = getGlobalThis();
7576
+ target.__VUE__ = true;
7577
+ {
7578
+ setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
7579
+ }
7580
+ const {
7581
+ insert: hostInsert,
7582
+ remove: hostRemove,
7583
+ patchProp: hostPatchProp,
7584
+ createElement: hostCreateElement,
7585
+ createText: hostCreateText,
7586
+ createComment: hostCreateComment,
7587
+ setText: hostSetText,
7588
+ setElementText: hostSetElementText,
7589
+ parentNode: hostParentNode,
7590
+ nextSibling: hostNextSibling,
7591
+ setScopeId: hostSetScopeId = NOOP,
7592
+ insertStaticContent: hostInsertStaticContent
7593
+ } = options;
7594
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
7595
+ if (n1 === n2) {
7596
+ return;
7597
+ }
7598
+ if (n1 && !isSameVNodeType(n1, n2)) {
7599
+ anchor = getNextHostNode(n1);
7600
+ unmount(n1, parentComponent, parentSuspense, true);
7601
+ n1 = null;
7602
+ }
7603
+ if (n2.patchFlag === -2) {
7604
+ optimized = false;
7605
+ n2.dynamicChildren = null;
7606
+ }
7607
+ const { type, ref, shapeFlag } = n2;
7608
+ switch (type) {
7609
+ case Text:
7610
+ processText(n1, n2, container, anchor);
6930
7611
  break;
6931
7612
  case Comment:
6932
7613
  processCommentNode(n1, n2, container, anchor);
@@ -7022,7 +7703,15 @@ function baseCreateRenderer(options, createHydrationFns) {
7022
7703
  } else {
7023
7704
  const el = n2.el = n1.el;
7024
7705
  if (n2.children !== n1.children) {
7025
- hostSetText(el, n2.children);
7706
+ if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
7707
+ const childNodes = container.childNodes;
7708
+ const newChild = hostCreateText(n2.children);
7709
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
7710
+ hostInsert(newChild, container, oldChild);
7711
+ hostRemove(oldChild);
7712
+ } else {
7713
+ hostSetText(el, n2.children);
7714
+ }
7026
7715
  }
7027
7716
  }
7028
7717
  };
@@ -7098,15 +7787,25 @@ function baseCreateRenderer(options, createHydrationFns) {
7098
7787
  optimized
7099
7788
  );
7100
7789
  } else {
7101
- patchElement(
7102
- n1,
7103
- n2,
7104
- parentComponent,
7105
- parentSuspense,
7106
- namespace,
7107
- slotScopeIds,
7108
- optimized
7109
- );
7790
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
7791
+ try {
7792
+ if (customElement) {
7793
+ customElement._beginPatch();
7794
+ }
7795
+ patchElement(
7796
+ n1,
7797
+ n2,
7798
+ parentComponent,
7799
+ parentSuspense,
7800
+ namespace,
7801
+ slotScopeIds,
7802
+ optimized
7803
+ );
7804
+ } finally {
7805
+ if (customElement) {
7806
+ customElement._endPatch();
7807
+ }
7808
+ }
7110
7809
  }
7111
7810
  };
7112
7811
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -7398,7 +8097,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7398
8097
  } else {
7399
8098
  if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
7400
8099
  // of renderSlot() with no valid children
7401
- n1.dynamicChildren) {
8100
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
7402
8101
  patchBlockChildren(
7403
8102
  n1.dynamicChildren,
7404
8103
  dynamicChildren,
@@ -7987,8 +8686,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7987
8686
  const nextChild = c2[nextIndex];
7988
8687
  const anchorVNode = c2[nextIndex + 1];
7989
8688
  const anchor = nextIndex + 1 < l2 ? (
7990
- // #13559, fallback to el placeholder for unresolved async component
7991
- anchorVNode.el || anchorVNode.placeholder
8689
+ // #13559, #14173 fallback to el placeholder for unresolved async component
8690
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
7992
8691
  ) : parentAnchor;
7993
8692
  if (newIndexToOldIndexMap[i] === 0) {
7994
8693
  patch(
@@ -8217,813 +8916,196 @@ function baseCreateRenderer(options, createHydrationFns) {
8217
8916
  unmount(subTree, instance, parentSuspense, doRemove);
8218
8917
  }
8219
8918
  if (um) {
8220
- queuePostRenderEffect(um, parentSuspense);
8221
- }
8222
- queuePostRenderEffect(() => {
8223
- instance.isUnmounted = true;
8224
- }, parentSuspense);
8225
- {
8226
- devtoolsComponentRemoved(instance);
8227
- }
8228
- };
8229
- const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
8230
- for (let i = start; i < children.length; i++) {
8231
- unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
8232
- }
8233
- };
8234
- const getNextHostNode = (vnode) => {
8235
- if (vnode.shapeFlag & 6) {
8236
- return getNextHostNode(vnode.component.subTree);
8237
- }
8238
- if (vnode.shapeFlag & 128) {
8239
- return vnode.suspense.next();
8240
- }
8241
- const el = hostNextSibling(vnode.anchor || vnode.el);
8242
- const teleportEnd = el && el[TeleportEndKey];
8243
- return teleportEnd ? hostNextSibling(teleportEnd) : el;
8244
- };
8245
- let isFlushing = false;
8246
- const render = (vnode, container, namespace) => {
8247
- if (vnode == null) {
8248
- if (container._vnode) {
8249
- unmount(container._vnode, null, null, true);
8250
- }
8251
- } else {
8252
- patch(
8253
- container._vnode || null,
8254
- vnode,
8255
- container,
8256
- null,
8257
- null,
8258
- null,
8259
- namespace
8260
- );
8261
- }
8262
- container._vnode = vnode;
8263
- if (!isFlushing) {
8264
- isFlushing = true;
8265
- flushPreFlushCbs();
8266
- flushPostFlushCbs();
8267
- isFlushing = false;
8268
- }
8269
- };
8270
- const internals = {
8271
- p: patch,
8272
- um: unmount,
8273
- m: move,
8274
- r: remove,
8275
- mt: mountComponent,
8276
- mc: mountChildren,
8277
- pc: patchChildren,
8278
- pbc: patchBlockChildren,
8279
- n: getNextHostNode,
8280
- o: options
8281
- };
8282
- let hydrate;
8283
- let hydrateNode;
8284
- if (createHydrationFns) {
8285
- [hydrate, hydrateNode] = createHydrationFns(
8286
- internals
8287
- );
8288
- }
8289
- return {
8290
- render,
8291
- hydrate,
8292
- createApp: createAppAPI(render, hydrate)
8293
- };
8294
- }
8295
- function resolveChildrenNamespace({ type, props }, currentNamespace) {
8296
- return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8297
- }
8298
- function toggleRecurse({ effect, job }, allowed) {
8299
- if (allowed) {
8300
- effect.flags |= 32;
8301
- job.flags |= 4;
8302
- } else {
8303
- effect.flags &= -33;
8304
- job.flags &= -5;
8305
- }
8306
- }
8307
- function needTransition(parentSuspense, transition) {
8308
- return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8309
- }
8310
- function traverseStaticChildren(n1, n2, shallow = false) {
8311
- const ch1 = n1.children;
8312
- const ch2 = n2.children;
8313
- if (isArray(ch1) && isArray(ch2)) {
8314
- for (let i = 0; i < ch1.length; i++) {
8315
- const c1 = ch1[i];
8316
- let c2 = ch2[i];
8317
- if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
8318
- if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
8319
- c2 = ch2[i] = cloneIfMounted(ch2[i]);
8320
- c2.el = c1.el;
8321
- }
8322
- if (!shallow && c2.patchFlag !== -2)
8323
- traverseStaticChildren(c1, c2);
8324
- }
8325
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8326
- c2.patchFlag !== -1) {
8327
- c2.el = c1.el;
8328
- }
8329
- if (c2.type === Comment && !c2.el) {
8330
- c2.el = c1.el;
8331
- }
8332
- {
8333
- c2.el && (c2.el.__vnode = c2);
8334
- }
8335
- }
8336
- }
8337
- }
8338
- function getSequence(arr) {
8339
- const p = arr.slice();
8340
- const result = [0];
8341
- let i, j, u, v, c;
8342
- const len = arr.length;
8343
- for (i = 0; i < len; i++) {
8344
- const arrI = arr[i];
8345
- if (arrI !== 0) {
8346
- j = result[result.length - 1];
8347
- if (arr[j] < arrI) {
8348
- p[i] = j;
8349
- result.push(i);
8350
- continue;
8351
- }
8352
- u = 0;
8353
- v = result.length - 1;
8354
- while (u < v) {
8355
- c = u + v >> 1;
8356
- if (arr[result[c]] < arrI) {
8357
- u = c + 1;
8358
- } else {
8359
- v = c;
8360
- }
8361
- }
8362
- if (arrI < arr[result[u]]) {
8363
- if (u > 0) {
8364
- p[i] = result[u - 1];
8365
- }
8366
- result[u] = i;
8367
- }
8368
- }
8369
- }
8370
- u = result.length;
8371
- v = result[u - 1];
8372
- while (u-- > 0) {
8373
- result[u] = v;
8374
- v = p[v];
8375
- }
8376
- return result;
8377
- }
8378
- function locateNonHydratedAsyncRoot(instance) {
8379
- const subComponent = instance.subTree.component;
8380
- if (subComponent) {
8381
- if (subComponent.asyncDep && !subComponent.asyncResolved) {
8382
- return subComponent;
8383
- } else {
8384
- return locateNonHydratedAsyncRoot(subComponent);
8385
- }
8386
- }
8387
- }
8388
- function invalidateMount(hooks) {
8389
- if (hooks) {
8390
- for (let i = 0; i < hooks.length; i++)
8391
- hooks[i].flags |= 8;
8392
- }
8393
- }
8394
-
8395
- const ssrContextKey = Symbol.for("v-scx");
8396
- const useSSRContext = () => {
8397
- {
8398
- const ctx = inject(ssrContextKey);
8399
- if (!ctx) {
8400
- warn$1(
8401
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
8402
- );
8403
- }
8404
- return ctx;
8405
- }
8406
- };
8407
-
8408
- function watchEffect(effect, options) {
8409
- return doWatch(effect, null, options);
8410
- }
8411
- function watchPostEffect(effect, options) {
8412
- return doWatch(
8413
- effect,
8414
- null,
8415
- extend({}, options, { flush: "post" })
8416
- );
8417
- }
8418
- function watchSyncEffect(effect, options) {
8419
- return doWatch(
8420
- effect,
8421
- null,
8422
- extend({}, options, { flush: "sync" })
8423
- );
8424
- }
8425
- function watch(source, cb, options) {
8426
- if (!isFunction(cb)) {
8427
- warn$1(
8428
- `\`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.`
8429
- );
8430
- }
8431
- return doWatch(source, cb, options);
8432
- }
8433
- function doWatch(source, cb, options = EMPTY_OBJ) {
8434
- const { immediate, deep, flush, once } = options;
8435
- if (!cb) {
8436
- if (immediate !== void 0) {
8437
- warn$1(
8438
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
8439
- );
8440
- }
8441
- if (deep !== void 0) {
8442
- warn$1(
8443
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
8444
- );
8445
- }
8446
- if (once !== void 0) {
8447
- warn$1(
8448
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
8449
- );
8450
- }
8451
- }
8452
- const baseWatchOptions = extend({}, options);
8453
- baseWatchOptions.onWarn = warn$1;
8454
- const runsImmediately = cb && immediate || !cb && flush !== "post";
8455
- let ssrCleanup;
8456
- if (isInSSRComponentSetup) {
8457
- if (flush === "sync") {
8458
- const ctx = useSSRContext();
8459
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
8460
- } else if (!runsImmediately) {
8461
- const watchStopHandle = () => {
8462
- };
8463
- watchStopHandle.stop = NOOP;
8464
- watchStopHandle.resume = NOOP;
8465
- watchStopHandle.pause = NOOP;
8466
- return watchStopHandle;
8467
- }
8468
- }
8469
- const instance = currentInstance;
8470
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
8471
- let isPre = false;
8472
- if (flush === "post") {
8473
- baseWatchOptions.scheduler = (job) => {
8474
- queuePostRenderEffect(job, instance && instance.suspense);
8475
- };
8476
- } else if (flush !== "sync") {
8477
- isPre = true;
8478
- baseWatchOptions.scheduler = (job, isFirstRun) => {
8479
- if (isFirstRun) {
8480
- job();
8481
- } else {
8482
- queueJob(job);
8483
- }
8484
- };
8485
- }
8486
- baseWatchOptions.augmentJob = (job) => {
8487
- if (cb) {
8488
- job.flags |= 4;
8489
- }
8490
- if (isPre) {
8491
- job.flags |= 2;
8492
- if (instance) {
8493
- job.id = instance.uid;
8494
- job.i = instance;
8495
- }
8496
- }
8497
- };
8498
- const watchHandle = watch$1(source, cb, baseWatchOptions);
8499
- if (isInSSRComponentSetup) {
8500
- if (ssrCleanup) {
8501
- ssrCleanup.push(watchHandle);
8502
- } else if (runsImmediately) {
8503
- watchHandle();
8504
- }
8505
- }
8506
- return watchHandle;
8507
- }
8508
- function instanceWatch(source, value, options) {
8509
- const publicThis = this.proxy;
8510
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
8511
- let cb;
8512
- if (isFunction(value)) {
8513
- cb = value;
8514
- } else {
8515
- cb = value.handler;
8516
- options = value;
8517
- }
8518
- const reset = setCurrentInstance(this);
8519
- const res = doWatch(getter, cb.bind(publicThis), options);
8520
- reset();
8521
- return res;
8522
- }
8523
- function createPathGetter(ctx, path) {
8524
- const segments = path.split(".");
8525
- return () => {
8526
- let cur = ctx;
8527
- for (let i = 0; i < segments.length && cur; i++) {
8528
- cur = cur[segments[i]];
8529
- }
8530
- return cur;
8531
- };
8532
- }
8533
-
8534
- function useModel(props, name, options = EMPTY_OBJ) {
8535
- const i = getCurrentInstance();
8536
- if (!i) {
8537
- warn$1(`useModel() called without active instance.`);
8538
- return ref();
8539
- }
8540
- const camelizedName = camelize(name);
8541
- if (!i.propsOptions[0][camelizedName]) {
8542
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
8543
- return ref();
8544
- }
8545
- const hyphenatedName = hyphenate(name);
8546
- const modifiers = getModelModifiers(props, camelizedName);
8547
- const res = customRef((track, trigger) => {
8548
- let localValue;
8549
- let prevSetValue = EMPTY_OBJ;
8550
- let prevEmittedValue;
8551
- watchSyncEffect(() => {
8552
- const propValue = props[camelizedName];
8553
- if (hasChanged(localValue, propValue)) {
8554
- localValue = propValue;
8555
- trigger();
8556
- }
8557
- });
8558
- return {
8559
- get() {
8560
- track();
8561
- return options.get ? options.get(localValue) : localValue;
8562
- },
8563
- set(value) {
8564
- const emittedValue = options.set ? options.set(value) : value;
8565
- if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
8566
- return;
8567
- }
8568
- const rawProps = i.vnode.props;
8569
- if (!(rawProps && // check if parent has passed v-model
8570
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8571
- localValue = value;
8572
- trigger();
8573
- }
8574
- i.emit(`update:${name}`, emittedValue);
8575
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8576
- trigger();
8577
- }
8578
- prevSetValue = value;
8579
- prevEmittedValue = emittedValue;
8580
- }
8581
- };
8582
- });
8583
- res[Symbol.iterator] = () => {
8584
- let i2 = 0;
8585
- return {
8586
- next() {
8587
- if (i2 < 2) {
8588
- return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
8589
- } else {
8590
- return { done: true };
8591
- }
8592
- }
8593
- };
8594
- };
8595
- return res;
8596
- }
8597
- const getModelModifiers = (props, modelName) => {
8598
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
8599
- };
8600
-
8601
- function emit(instance, event, ...rawArgs) {
8602
- if (instance.isUnmounted) return;
8603
- const props = instance.vnode.props || EMPTY_OBJ;
8604
- {
8605
- const {
8606
- emitsOptions,
8607
- propsOptions: [propsOptions]
8608
- } = instance;
8609
- if (emitsOptions) {
8610
- if (!(event in emitsOptions) && true) {
8611
- if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
8612
- warn$1(
8613
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
8614
- );
8615
- }
8616
- } else {
8617
- const validator = emitsOptions[event];
8618
- if (isFunction(validator)) {
8619
- const isValid = validator(...rawArgs);
8620
- if (!isValid) {
8621
- warn$1(
8622
- `Invalid event arguments: event validation failed for event "${event}".`
8623
- );
8624
- }
8625
- }
8626
- }
8627
- }
8628
- }
8629
- let args = rawArgs;
8630
- const isModelListener = event.startsWith("update:");
8631
- const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
8632
- if (modifiers) {
8633
- if (modifiers.trim) {
8634
- args = rawArgs.map((a) => isString(a) ? a.trim() : a);
8635
- }
8636
- if (modifiers.number) {
8637
- args = rawArgs.map(looseToNumber);
8638
- }
8639
- }
8640
- {
8641
- devtoolsComponentEmit(instance, event, args);
8642
- }
8643
- {
8644
- const lowerCaseEvent = event.toLowerCase();
8645
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
8646
- warn$1(
8647
- `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
8648
- instance,
8649
- instance.type
8650
- )} 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(
8651
- event
8652
- )}" instead of "${event}".`
8653
- );
8654
- }
8655
- }
8656
- let handlerName;
8657
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
8658
- props[handlerName = toHandlerKey(camelize(event))];
8659
- if (!handler && isModelListener) {
8660
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
8661
- }
8662
- if (handler) {
8663
- callWithAsyncErrorHandling(
8664
- handler,
8665
- instance,
8666
- 6,
8667
- args
8668
- );
8669
- }
8670
- const onceHandler = props[handlerName + `Once`];
8671
- if (onceHandler) {
8672
- if (!instance.emitted) {
8673
- instance.emitted = {};
8674
- } else if (instance.emitted[handlerName]) {
8675
- return;
8676
- }
8677
- instance.emitted[handlerName] = true;
8678
- callWithAsyncErrorHandling(
8679
- onceHandler,
8680
- instance,
8681
- 6,
8682
- args
8683
- );
8684
- }
8685
- }
8686
- const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8687
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8688
- const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8689
- const cached = cache.get(comp);
8690
- if (cached !== void 0) {
8691
- return cached;
8692
- }
8693
- const raw = comp.emits;
8694
- let normalized = {};
8695
- let hasExtends = false;
8696
- if (!isFunction(comp)) {
8697
- const extendEmits = (raw2) => {
8698
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
8699
- if (normalizedFromExtend) {
8700
- hasExtends = true;
8701
- extend(normalized, normalizedFromExtend);
8702
- }
8703
- };
8704
- if (!asMixin && appContext.mixins.length) {
8705
- appContext.mixins.forEach(extendEmits);
8706
- }
8707
- if (comp.extends) {
8708
- extendEmits(comp.extends);
8709
- }
8710
- if (comp.mixins) {
8711
- comp.mixins.forEach(extendEmits);
8712
- }
8713
- }
8714
- if (!raw && !hasExtends) {
8715
- if (isObject(comp)) {
8716
- cache.set(comp, null);
8717
- }
8718
- return null;
8719
- }
8720
- if (isArray(raw)) {
8721
- raw.forEach((key) => normalized[key] = null);
8722
- } else {
8723
- extend(normalized, raw);
8724
- }
8725
- if (isObject(comp)) {
8726
- cache.set(comp, normalized);
8727
- }
8728
- return normalized;
8729
- }
8730
- function isEmitListener(options, key) {
8731
- if (!options || !isOn(key)) {
8732
- return false;
8733
- }
8734
- key = key.slice(2).replace(/Once$/, "");
8735
- return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
8736
- }
8737
-
8738
- let accessedAttrs = false;
8739
- function markAttrsAccessed() {
8740
- accessedAttrs = true;
8741
- }
8742
- function renderComponentRoot(instance) {
8743
- const {
8744
- type: Component,
8745
- vnode,
8746
- proxy,
8747
- withProxy,
8748
- propsOptions: [propsOptions],
8749
- slots,
8750
- attrs,
8751
- emit,
8752
- render,
8753
- renderCache,
8754
- props,
8755
- data,
8756
- setupState,
8757
- ctx,
8758
- inheritAttrs
8759
- } = instance;
8760
- const prev = setCurrentRenderingInstance(instance);
8761
- let result;
8762
- let fallthroughAttrs;
8763
- {
8764
- accessedAttrs = false;
8765
- }
8766
- try {
8767
- if (vnode.shapeFlag & 4) {
8768
- const proxyToUse = withProxy || proxy;
8769
- const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
8770
- get(target, key, receiver) {
8771
- warn$1(
8772
- `Property '${String(
8773
- key
8774
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
8775
- );
8776
- return Reflect.get(target, key, receiver);
8777
- }
8778
- }) : proxyToUse;
8779
- result = normalizeVNode(
8780
- render.call(
8781
- thisProxy,
8782
- proxyToUse,
8783
- renderCache,
8784
- true ? shallowReadonly(props) : props,
8785
- setupState,
8786
- data,
8787
- ctx
8788
- )
8789
- );
8790
- fallthroughAttrs = attrs;
8791
- } else {
8792
- const render2 = Component;
8793
- if (attrs === props) {
8794
- markAttrsAccessed();
8795
- }
8796
- result = normalizeVNode(
8797
- render2.length > 1 ? render2(
8798
- true ? shallowReadonly(props) : props,
8799
- true ? {
8800
- get attrs() {
8801
- markAttrsAccessed();
8802
- return shallowReadonly(attrs);
8803
- },
8804
- slots,
8805
- emit
8806
- } : { attrs, slots, emit }
8807
- ) : render2(
8808
- true ? shallowReadonly(props) : props,
8809
- null
8810
- )
8811
- );
8812
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
8813
- }
8814
- } catch (err) {
8815
- blockStack.length = 0;
8816
- handleError(err, instance, 1);
8817
- result = createVNode(Comment);
8818
- }
8819
- let root = result;
8820
- let setRoot = void 0;
8821
- if (result.patchFlag > 0 && result.patchFlag & 2048) {
8822
- [root, setRoot] = getChildRoot(result);
8823
- }
8824
- if (fallthroughAttrs && inheritAttrs !== false) {
8825
- const keys = Object.keys(fallthroughAttrs);
8826
- const { shapeFlag } = root;
8827
- if (keys.length) {
8828
- if (shapeFlag & (1 | 6)) {
8829
- if (propsOptions && keys.some(isModelListener)) {
8830
- fallthroughAttrs = filterModelListeners(
8831
- fallthroughAttrs,
8832
- propsOptions
8833
- );
8834
- }
8835
- root = cloneVNode(root, fallthroughAttrs, false, true);
8836
- } else if (!accessedAttrs && root.type !== Comment) {
8837
- const allAttrs = Object.keys(attrs);
8838
- const eventAttrs = [];
8839
- const extraAttrs = [];
8840
- for (let i = 0, l = allAttrs.length; i < l; i++) {
8841
- const key = allAttrs[i];
8842
- if (isOn(key)) {
8843
- if (!isModelListener(key)) {
8844
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
8845
- }
8846
- } else {
8847
- extraAttrs.push(key);
8848
- }
8849
- }
8850
- if (extraAttrs.length) {
8851
- warn$1(
8852
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
8853
- );
8854
- }
8855
- if (eventAttrs.length) {
8856
- warn$1(
8857
- `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.`
8858
- );
8859
- }
8860
- }
8919
+ queuePostRenderEffect(um, parentSuspense);
8861
8920
  }
8862
- }
8863
- if (vnode.dirs) {
8864
- if (!isElementRoot(root)) {
8865
- warn$1(
8866
- `Runtime directive used on component with non-element root node. The directives will not function as intended.`
8867
- );
8921
+ queuePostRenderEffect(() => {
8922
+ instance.isUnmounted = true;
8923
+ }, parentSuspense);
8924
+ {
8925
+ devtoolsComponentRemoved(instance);
8868
8926
  }
8869
- root = cloneVNode(root, null, false, true);
8870
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8871
- }
8872
- if (vnode.transition) {
8873
- if (!isElementRoot(root)) {
8874
- warn$1(
8875
- `Component inside <Transition> renders non-element root node that cannot be animated.`
8876
- );
8927
+ };
8928
+ const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
8929
+ for (let i = start; i < children.length; i++) {
8930
+ unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
8877
8931
  }
8878
- setTransitionHooks(root, vnode.transition);
8879
- }
8880
- if (setRoot) {
8881
- setRoot(root);
8882
- } else {
8883
- result = root;
8884
- }
8885
- setCurrentRenderingInstance(prev);
8886
- return result;
8887
- }
8888
- const getChildRoot = (vnode) => {
8889
- const rawChildren = vnode.children;
8890
- const dynamicChildren = vnode.dynamicChildren;
8891
- const childRoot = filterSingleRoot(rawChildren, false);
8892
- if (!childRoot) {
8893
- return [vnode, void 0];
8894
- } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
8895
- return getChildRoot(childRoot);
8896
- }
8897
- const index = rawChildren.indexOf(childRoot);
8898
- const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
8899
- const setRoot = (updatedRoot) => {
8900
- rawChildren[index] = updatedRoot;
8901
- if (dynamicChildren) {
8902
- if (dynamicIndex > -1) {
8903
- dynamicChildren[dynamicIndex] = updatedRoot;
8904
- } else if (updatedRoot.patchFlag > 0) {
8905
- vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
8906
- }
8932
+ };
8933
+ const getNextHostNode = (vnode) => {
8934
+ if (vnode.shapeFlag & 6) {
8935
+ return getNextHostNode(vnode.component.subTree);
8936
+ }
8937
+ if (vnode.shapeFlag & 128) {
8938
+ return vnode.suspense.next();
8907
8939
  }
8940
+ const el = hostNextSibling(vnode.anchor || vnode.el);
8941
+ const teleportEnd = el && el[TeleportEndKey];
8942
+ return teleportEnd ? hostNextSibling(teleportEnd) : el;
8908
8943
  };
8909
- return [normalizeVNode(childRoot), setRoot];
8910
- };
8911
- function filterSingleRoot(children, recurse = true) {
8912
- let singleRoot;
8913
- for (let i = 0; i < children.length; i++) {
8914
- const child = children[i];
8915
- if (isVNode(child)) {
8916
- if (child.type !== Comment || child.children === "v-if") {
8917
- if (singleRoot) {
8918
- return;
8919
- } else {
8920
- singleRoot = child;
8921
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
8922
- return filterSingleRoot(singleRoot.children);
8923
- }
8924
- }
8944
+ let isFlushing = false;
8945
+ const render = (vnode, container, namespace) => {
8946
+ let instance;
8947
+ if (vnode == null) {
8948
+ if (container._vnode) {
8949
+ unmount(container._vnode, null, null, true);
8950
+ instance = container._vnode.component;
8925
8951
  }
8926
8952
  } else {
8927
- return;
8928
- }
8929
- }
8930
- return singleRoot;
8931
- }
8932
- const getFunctionalFallthrough = (attrs) => {
8933
- let res;
8934
- for (const key in attrs) {
8935
- if (key === "class" || key === "style" || isOn(key)) {
8936
- (res || (res = {}))[key] = attrs[key];
8953
+ patch(
8954
+ container._vnode || null,
8955
+ vnode,
8956
+ container,
8957
+ null,
8958
+ null,
8959
+ null,
8960
+ namespace
8961
+ );
8937
8962
  }
8938
- }
8939
- return res;
8940
- };
8941
- const filterModelListeners = (attrs, props) => {
8942
- const res = {};
8943
- for (const key in attrs) {
8944
- if (!isModelListener(key) || !(key.slice(9) in props)) {
8945
- res[key] = attrs[key];
8963
+ container._vnode = vnode;
8964
+ if (!isFlushing) {
8965
+ isFlushing = true;
8966
+ flushPreFlushCbs(instance);
8967
+ flushPostFlushCbs();
8968
+ isFlushing = false;
8946
8969
  }
8970
+ };
8971
+ const internals = {
8972
+ p: patch,
8973
+ um: unmount,
8974
+ m: move,
8975
+ r: remove,
8976
+ mt: mountComponent,
8977
+ mc: mountChildren,
8978
+ pc: patchChildren,
8979
+ pbc: patchBlockChildren,
8980
+ n: getNextHostNode,
8981
+ o: options
8982
+ };
8983
+ let hydrate;
8984
+ let hydrateNode;
8985
+ if (createHydrationFns) {
8986
+ [hydrate, hydrateNode] = createHydrationFns(
8987
+ internals
8988
+ );
8947
8989
  }
8948
- return res;
8949
- };
8950
- const isElementRoot = (vnode) => {
8951
- return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
8952
- };
8953
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
8954
- const { props: prevProps, children: prevChildren, component } = prevVNode;
8955
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
8956
- const emits = component.emitsOptions;
8957
- if ((prevChildren || nextChildren) && isHmrUpdating) {
8958
- return true;
8959
- }
8960
- if (nextVNode.dirs || nextVNode.transition) {
8961
- return true;
8990
+ return {
8991
+ render,
8992
+ hydrate,
8993
+ createApp: createAppAPI(render, hydrate)
8994
+ };
8995
+ }
8996
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
8997
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8998
+ }
8999
+ function toggleRecurse({ effect, job }, allowed) {
9000
+ if (allowed) {
9001
+ effect.flags |= 32;
9002
+ job.flags |= 4;
9003
+ } else {
9004
+ effect.flags &= -33;
9005
+ job.flags &= -5;
8962
9006
  }
8963
- if (optimized && patchFlag >= 0) {
8964
- if (patchFlag & 1024) {
8965
- return true;
8966
- }
8967
- if (patchFlag & 16) {
8968
- if (!prevProps) {
8969
- return !!nextProps;
9007
+ }
9008
+ function needTransition(parentSuspense, transition) {
9009
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9010
+ }
9011
+ function traverseStaticChildren(n1, n2, shallow = false) {
9012
+ const ch1 = n1.children;
9013
+ const ch2 = n2.children;
9014
+ if (isArray(ch1) && isArray(ch2)) {
9015
+ for (let i = 0; i < ch1.length; i++) {
9016
+ const c1 = ch1[i];
9017
+ let c2 = ch2[i];
9018
+ if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
9019
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
9020
+ c2 = ch2[i] = cloneIfMounted(ch2[i]);
9021
+ c2.el = c1.el;
9022
+ }
9023
+ if (!shallow && c2.patchFlag !== -2)
9024
+ traverseStaticChildren(c1, c2);
8970
9025
  }
8971
- return hasPropsChanged(prevProps, nextProps, emits);
8972
- } else if (patchFlag & 8) {
8973
- const dynamicProps = nextVNode.dynamicProps;
8974
- for (let i = 0; i < dynamicProps.length; i++) {
8975
- const key = dynamicProps[i];
8976
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
8977
- return true;
9026
+ if (c2.type === Text) {
9027
+ if (c2.patchFlag !== -1) {
9028
+ c2.el = c1.el;
9029
+ } else {
9030
+ c2.__elIndex = i + // take fragment start anchor into account
9031
+ (n1.type === Fragment ? 1 : 0);
8978
9032
  }
8979
9033
  }
8980
- }
8981
- } else {
8982
- if (prevChildren || nextChildren) {
8983
- if (!nextChildren || !nextChildren.$stable) {
8984
- return true;
9034
+ if (c2.type === Comment && !c2.el) {
9035
+ c2.el = c1.el;
9036
+ }
9037
+ {
9038
+ c2.el && (c2.el.__vnode = c2);
8985
9039
  }
8986
9040
  }
8987
- if (prevProps === nextProps) {
8988
- return false;
8989
- }
8990
- if (!prevProps) {
8991
- return !!nextProps;
8992
- }
8993
- if (!nextProps) {
8994
- return true;
8995
- }
8996
- return hasPropsChanged(prevProps, nextProps, emits);
8997
9041
  }
8998
- return false;
8999
9042
  }
9000
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
9001
- const nextKeys = Object.keys(nextProps);
9002
- if (nextKeys.length !== Object.keys(prevProps).length) {
9003
- return true;
9004
- }
9005
- for (let i = 0; i < nextKeys.length; i++) {
9006
- const key = nextKeys[i];
9007
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
9008
- return true;
9043
+ function getSequence(arr) {
9044
+ const p = arr.slice();
9045
+ const result = [0];
9046
+ let i, j, u, v, c;
9047
+ const len = arr.length;
9048
+ for (i = 0; i < len; i++) {
9049
+ const arrI = arr[i];
9050
+ if (arrI !== 0) {
9051
+ j = result[result.length - 1];
9052
+ if (arr[j] < arrI) {
9053
+ p[i] = j;
9054
+ result.push(i);
9055
+ continue;
9056
+ }
9057
+ u = 0;
9058
+ v = result.length - 1;
9059
+ while (u < v) {
9060
+ c = u + v >> 1;
9061
+ if (arr[result[c]] < arrI) {
9062
+ u = c + 1;
9063
+ } else {
9064
+ v = c;
9065
+ }
9066
+ }
9067
+ if (arrI < arr[result[u]]) {
9068
+ if (u > 0) {
9069
+ p[i] = result[u - 1];
9070
+ }
9071
+ result[u] = i;
9072
+ }
9009
9073
  }
9010
9074
  }
9011
- return false;
9075
+ u = result.length;
9076
+ v = result[u - 1];
9077
+ while (u-- > 0) {
9078
+ result[u] = v;
9079
+ v = p[v];
9080
+ }
9081
+ return result;
9012
9082
  }
9013
- function updateHOCHostEl({ vnode, parent }, el) {
9014
- while (parent) {
9015
- const root = parent.subTree;
9016
- if (root.suspense && root.suspense.activeBranch === vnode) {
9017
- root.el = vnode.el;
9018
- }
9019
- if (root === vnode) {
9020
- (vnode = parent.vnode).el = el;
9021
- parent = parent.parent;
9083
+ function locateNonHydratedAsyncRoot(instance) {
9084
+ const subComponent = instance.subTree.component;
9085
+ if (subComponent) {
9086
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9087
+ return subComponent;
9022
9088
  } else {
9023
- break;
9089
+ return locateNonHydratedAsyncRoot(subComponent);
9024
9090
  }
9025
9091
  }
9026
9092
  }
9093
+ function invalidateMount(hooks) {
9094
+ if (hooks) {
9095
+ for (let i = 0; i < hooks.length; i++)
9096
+ hooks[i].flags |= 8;
9097
+ }
9098
+ }
9099
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
9100
+ if (anchorVnode.placeholder) {
9101
+ return anchorVnode.placeholder;
9102
+ }
9103
+ const instance = anchorVnode.component;
9104
+ if (instance) {
9105
+ return resolveAsyncComponentPlaceholder(instance.subTree);
9106
+ }
9107
+ return null;
9108
+ }
9027
9109
 
9028
9110
  const isSuspense = (type) => type.__isSuspense;
9029
9111
  let suspenseId = 0;
@@ -9348,7 +9430,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9348
9430
  pendingId,
9349
9431
  effects,
9350
9432
  parentComponent: parentComponent2,
9351
- container: container2
9433
+ container: container2,
9434
+ isInFallback
9352
9435
  } = suspense;
9353
9436
  let delayEnter = false;
9354
9437
  if (suspense.isHydrating) {
@@ -9365,6 +9448,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9365
9448
  0
9366
9449
  );
9367
9450
  queuePostFlushCb(effects);
9451
+ if (isInFallback && vnode2.ssFallback) {
9452
+ vnode2.ssFallback.el = null;
9453
+ }
9368
9454
  }
9369
9455
  };
9370
9456
  }
@@ -9373,6 +9459,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9373
9459
  anchor = next(activeBranch);
9374
9460
  }
9375
9461
  unmount(activeBranch, parentComponent2, suspense, true);
9462
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9463
+ queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
9464
+ }
9376
9465
  }
9377
9466
  if (!delayEnter) {
9378
9467
  move(pendingBranch, container2, anchor, 0);
@@ -9491,6 +9580,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9491
9580
  optimized2
9492
9581
  );
9493
9582
  if (placeholder) {
9583
+ vnode2.placeholder = null;
9494
9584
  remove(placeholder);
9495
9585
  }
9496
9586
  updateHOCHostEl(instance, vnode2.el);
@@ -9618,10 +9708,10 @@ function isVNodeSuspensible(vnode) {
9618
9708
  return suspensible != null && suspensible !== false;
9619
9709
  }
9620
9710
 
9621
- const Fragment = Symbol.for("v-fgt");
9622
- const Text = Symbol.for("v-txt");
9623
- const Comment = Symbol.for("v-cmt");
9624
- const Static = Symbol.for("v-stc");
9711
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
9712
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
9713
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
9714
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
9625
9715
  const blockStack = [];
9626
9716
  let currentBlock = null;
9627
9717
  function openBlock(disableTracking = false) {
@@ -10147,7 +10237,6 @@ function setupComponent(instance, isSSR = false, optimized = false) {
10147
10237
  return setupResult;
10148
10238
  }
10149
10239
  function setupStatefulComponent(instance, isSSR) {
10150
- var _a;
10151
10240
  const Component = instance.type;
10152
10241
  {
10153
10242
  if (Component.name) {
@@ -10207,7 +10296,7 @@ function setupStatefulComponent(instance, isSSR) {
10207
10296
  } else {
10208
10297
  instance.asyncDep = setupResult;
10209
10298
  if (!instance.suspense) {
10210
- const name = (_a = Component.name) != null ? _a : "Anonymous";
10299
+ const name = formatComponentName(instance, Component);
10211
10300
  warn$1(
10212
10301
  `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.`
10213
10302
  );
@@ -10405,7 +10494,7 @@ function formatComponentName(instance, Component, isRoot = false) {
10405
10494
  name = match[1];
10406
10495
  }
10407
10496
  }
10408
- if (!name && instance && instance.parent) {
10497
+ if (!name && instance) {
10409
10498
  const inferFromRegistry = (registry) => {
10410
10499
  for (const key in registry) {
10411
10500
  if (registry[key] === Component) {
@@ -10413,8 +10502,8 @@ function formatComponentName(instance, Component, isRoot = false) {
10413
10502
  }
10414
10503
  }
10415
10504
  };
10416
- name = inferFromRegistry(
10417
- instance.components || instance.parent.type.components
10505
+ name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
10506
+ instance.parent.type.components
10418
10507
  ) || inferFromRegistry(instance.appContext.components);
10419
10508
  }
10420
10509
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
@@ -10435,31 +10524,28 @@ const computed = (getterOrOptions, debugOptions) => {
10435
10524
  };
10436
10525
 
10437
10526
  function h(type, propsOrChildren, children) {
10438
- const doCreateVNode = (type2, props, children2) => {
10527
+ try {
10439
10528
  setBlockTracking(-1);
10440
- try {
10441
- return createVNode(type2, props, children2);
10442
- } finally {
10443
- setBlockTracking(1);
10444
- }
10445
- };
10446
- const l = arguments.length;
10447
- if (l === 2) {
10448
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10449
- if (isVNode(propsOrChildren)) {
10450
- return doCreateVNode(type, null, [propsOrChildren]);
10529
+ const l = arguments.length;
10530
+ if (l === 2) {
10531
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10532
+ if (isVNode(propsOrChildren)) {
10533
+ return createVNode(type, null, [propsOrChildren]);
10534
+ }
10535
+ return createVNode(type, propsOrChildren);
10536
+ } else {
10537
+ return createVNode(type, null, propsOrChildren);
10451
10538
  }
10452
- return doCreateVNode(type, propsOrChildren);
10453
10539
  } else {
10454
- return doCreateVNode(type, null, propsOrChildren);
10455
- }
10456
- } else {
10457
- if (l > 3) {
10458
- children = Array.prototype.slice.call(arguments, 2);
10459
- } else if (l === 3 && isVNode(children)) {
10460
- children = [children];
10540
+ if (l > 3) {
10541
+ children = Array.prototype.slice.call(arguments, 2);
10542
+ } else if (l === 3 && isVNode(children)) {
10543
+ children = [children];
10544
+ }
10545
+ return createVNode(type, propsOrChildren, children);
10461
10546
  }
10462
- return doCreateVNode(type, propsOrChildren, children);
10547
+ } finally {
10548
+ setBlockTracking(1);
10463
10549
  }
10464
10550
  }
10465
10551
 
@@ -10669,7 +10755,7 @@ function isMemoSame(cached, memo) {
10669
10755
  return true;
10670
10756
  }
10671
10757
 
10672
- const version = "3.5.21";
10758
+ const version = "3.5.26";
10673
10759
  const warn = warn$1 ;
10674
10760
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10675
10761
  const devtools = devtools$1 ;
@@ -10774,7 +10860,7 @@ const nodeOps = {
10774
10860
 
10775
10861
  const TRANSITION$1 = "transition";
10776
10862
  const ANIMATION = "animation";
10777
- const vtcKey = Symbol("_vtc");
10863
+ const vtcKey = /* @__PURE__ */ Symbol("_vtc");
10778
10864
  const DOMTransitionPropsValidators = {
10779
10865
  name: String,
10780
10866
  type: String,
@@ -10898,11 +10984,11 @@ function resolveTransitionProps(rawProps) {
10898
10984
  const resolve = () => finishLeave(el, done);
10899
10985
  addTransitionClass(el, leaveFromClass);
10900
10986
  if (!el._enterCancelled) {
10901
- forceReflow();
10987
+ forceReflow(el);
10902
10988
  addTransitionClass(el, leaveActiveClass);
10903
10989
  } else {
10904
10990
  addTransitionClass(el, leaveActiveClass);
10905
- forceReflow();
10991
+ forceReflow(el);
10906
10992
  }
10907
10993
  nextFrame(() => {
10908
10994
  if (!el._isLeaving) {
@@ -11048,8 +11134,9 @@ function toMs(s) {
11048
11134
  if (s === "auto") return 0;
11049
11135
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11050
11136
  }
11051
- function forceReflow() {
11052
- return document.body.offsetHeight;
11137
+ function forceReflow(el) {
11138
+ const targetDocument = el ? el.ownerDocument : document;
11139
+ return targetDocument.body.offsetHeight;
11053
11140
  }
11054
11141
 
11055
11142
  function patchClass(el, value, isSVG) {
@@ -11066,8 +11153,8 @@ function patchClass(el, value, isSVG) {
11066
11153
  }
11067
11154
  }
11068
11155
 
11069
- const vShowOriginalDisplay = Symbol("_vod");
11070
- const vShowHidden = Symbol("_vsh");
11156
+ const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
11157
+ const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
11071
11158
  const vShow = {
11072
11159
  // used for prop mismatch check during hydration
11073
11160
  name: "show",
@@ -11116,7 +11203,7 @@ function initVShowForSSR() {
11116
11203
  };
11117
11204
  }
11118
11205
 
11119
- const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
11206
+ const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
11120
11207
  function useCssVars(getter) {
11121
11208
  const instance = getCurrentInstance();
11122
11209
  if (!instance) {
@@ -11366,7 +11453,7 @@ function addEventListener(el, event, handler, options) {
11366
11453
  function removeEventListener(el, event, handler, options) {
11367
11454
  el.removeEventListener(event, handler, options);
11368
11455
  }
11369
- const veiKey = Symbol("_vei");
11456
+ const veiKey = /* @__PURE__ */ Symbol("_vei");
11370
11457
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11371
11458
  const invokers = el[veiKey] || (el[veiKey] = {});
11372
11459
  const existingInvoker = invokers[rawName];
@@ -11490,6 +11577,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
11490
11577
  if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
11491
11578
  return false;
11492
11579
  }
11580
+ if (key === "sandbox" && el.tagName === "IFRAME") {
11581
+ return false;
11582
+ }
11493
11583
  if (key === "form") {
11494
11584
  return false;
11495
11585
  }
@@ -11550,6 +11640,8 @@ class VueElement extends BaseClass {
11550
11640
  this._nonce = this._def.nonce;
11551
11641
  this._connected = false;
11552
11642
  this._resolved = false;
11643
+ this._patching = false;
11644
+ this._dirty = false;
11553
11645
  this._numberProps = null;
11554
11646
  this._styleChildren = /* @__PURE__ */ new WeakSet();
11555
11647
  this._ob = null;
@@ -11562,7 +11654,11 @@ class VueElement extends BaseClass {
11562
11654
  );
11563
11655
  }
11564
11656
  if (_def.shadowRoot !== false) {
11565
- this.attachShadow({ mode: "open" });
11657
+ this.attachShadow(
11658
+ extend({}, _def.shadowRootOptions, {
11659
+ mode: "open"
11660
+ })
11661
+ );
11566
11662
  this._root = this.shadowRoot;
11567
11663
  } else {
11568
11664
  this._root = this;
@@ -11622,9 +11718,18 @@ class VueElement extends BaseClass {
11622
11718
  this._app && this._app.unmount();
11623
11719
  if (this._instance) this._instance.ce = void 0;
11624
11720
  this._app = this._instance = null;
11721
+ if (this._teleportTargets) {
11722
+ this._teleportTargets.clear();
11723
+ this._teleportTargets = void 0;
11724
+ }
11625
11725
  }
11626
11726
  });
11627
11727
  }
11728
+ _processMutations(mutations) {
11729
+ for (const m of mutations) {
11730
+ this._setAttr(m.attributeName);
11731
+ }
11732
+ }
11628
11733
  /**
11629
11734
  * resolve inner component definition (handle possible async component)
11630
11735
  */
@@ -11635,11 +11740,7 @@ class VueElement extends BaseClass {
11635
11740
  for (let i = 0; i < this.attributes.length; i++) {
11636
11741
  this._setAttr(this.attributes[i].name);
11637
11742
  }
11638
- this._ob = new MutationObserver((mutations) => {
11639
- for (const m of mutations) {
11640
- this._setAttr(m.attributeName);
11641
- }
11642
- });
11743
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11643
11744
  this._ob.observe(this, { attributes: true });
11644
11745
  const resolve = (def, isAsync = false) => {
11645
11746
  this._resolved = true;
@@ -11716,7 +11817,7 @@ class VueElement extends BaseClass {
11716
11817
  return this._getProp(key);
11717
11818
  },
11718
11819
  set(val) {
11719
- this._setProp(key, val, true, true);
11820
+ this._setProp(key, val, true, !this._patching);
11720
11821
  }
11721
11822
  });
11722
11823
  }
@@ -11742,6 +11843,7 @@ class VueElement extends BaseClass {
11742
11843
  */
11743
11844
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
11744
11845
  if (val !== this._props[key]) {
11846
+ this._dirty = true;
11745
11847
  if (val === REMOVAL) {
11746
11848
  delete this._props[key];
11747
11849
  } else {
@@ -11755,7 +11857,10 @@ class VueElement extends BaseClass {
11755
11857
  }
11756
11858
  if (shouldReflect) {
11757
11859
  const ob = this._ob;
11758
- ob && ob.disconnect();
11860
+ if (ob) {
11861
+ this._processMutations(ob.takeRecords());
11862
+ ob.disconnect();
11863
+ }
11759
11864
  if (val === true) {
11760
11865
  this.setAttribute(hyphenate(key), "");
11761
11866
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11859,7 +11964,7 @@ class VueElement extends BaseClass {
11859
11964
  * Only called when shadowRoot is false
11860
11965
  */
11861
11966
  _renderSlots() {
11862
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11967
+ const outlets = this._getSlots();
11863
11968
  const scopeId = this._instance.type.__scopeId;
11864
11969
  for (let i = 0; i < outlets.length; i++) {
11865
11970
  const o = outlets[i];
@@ -11885,12 +11990,45 @@ class VueElement extends BaseClass {
11885
11990
  parent.removeChild(o);
11886
11991
  }
11887
11992
  }
11993
+ /**
11994
+ * @internal
11995
+ */
11996
+ _getSlots() {
11997
+ const roots = [this];
11998
+ if (this._teleportTargets) {
11999
+ roots.push(...this._teleportTargets);
12000
+ }
12001
+ const slots = /* @__PURE__ */ new Set();
12002
+ for (const root of roots) {
12003
+ const found = root.querySelectorAll("slot");
12004
+ for (let i = 0; i < found.length; i++) {
12005
+ slots.add(found[i]);
12006
+ }
12007
+ }
12008
+ return Array.from(slots);
12009
+ }
11888
12010
  /**
11889
12011
  * @internal
11890
12012
  */
11891
12013
  _injectChildStyle(comp) {
11892
12014
  this._applyStyles(comp.styles, comp);
11893
12015
  }
12016
+ /**
12017
+ * @internal
12018
+ */
12019
+ _beginPatch() {
12020
+ this._patching = true;
12021
+ this._dirty = false;
12022
+ }
12023
+ /**
12024
+ * @internal
12025
+ */
12026
+ _endPatch() {
12027
+ this._patching = false;
12028
+ if (this._dirty && this._instance) {
12029
+ this._update();
12030
+ }
12031
+ }
11894
12032
  /**
11895
12033
  * @internal
11896
12034
  */
@@ -11953,8 +12091,8 @@ function useCssModule(name = "$style") {
11953
12091
 
11954
12092
  const positionMap = /* @__PURE__ */ new WeakMap();
11955
12093
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11956
- const moveCbKey = Symbol("_moveCb");
11957
- const enterCbKey = Symbol("_enterCb");
12094
+ const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
12095
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
11958
12096
  const decorate = (t) => {
11959
12097
  delete t.props.mode;
11960
12098
  return t;
@@ -11986,7 +12124,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11986
12124
  prevChildren.forEach(callPendingCbs);
11987
12125
  prevChildren.forEach(recordPosition);
11988
12126
  const movedChildren = prevChildren.filter(applyTranslation);
11989
- forceReflow();
12127
+ forceReflow(instance.vnode.el);
11990
12128
  movedChildren.forEach((c) => {
11991
12129
  const el = c.el;
11992
12130
  const style = el.style;
@@ -12025,10 +12163,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12025
12163
  instance
12026
12164
  )
12027
12165
  );
12028
- positionMap.set(
12029
- child,
12030
- child.el.getBoundingClientRect()
12031
- );
12166
+ positionMap.set(child, {
12167
+ left: child.el.offsetLeft,
12168
+ top: child.el.offsetTop
12169
+ });
12032
12170
  }
12033
12171
  }
12034
12172
  }
@@ -12059,7 +12197,10 @@ function callPendingCbs(c) {
12059
12197
  }
12060
12198
  }
12061
12199
  function recordPosition(c) {
12062
- newPositionMap.set(c, c.el.getBoundingClientRect());
12200
+ newPositionMap.set(c, {
12201
+ left: c.el.offsetLeft,
12202
+ top: c.el.offsetTop
12203
+ });
12063
12204
  }
12064
12205
  function applyTranslation(c) {
12065
12206
  const oldPos = positionMap.get(c);
@@ -12104,25 +12245,23 @@ function onCompositionEnd(e) {
12104
12245
  target.dispatchEvent(new Event("input"));
12105
12246
  }
12106
12247
  }
12107
- const assignKey = Symbol("_assign");
12248
+ const assignKey = /* @__PURE__ */ Symbol("_assign");
12249
+ function castValue(value, trim, number) {
12250
+ if (trim) value = value.trim();
12251
+ if (number) value = looseToNumber(value);
12252
+ return value;
12253
+ }
12108
12254
  const vModelText = {
12109
12255
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
12110
12256
  el[assignKey] = getModelAssigner(vnode);
12111
12257
  const castToNumber = number || vnode.props && vnode.props.type === "number";
12112
12258
  addEventListener(el, lazy ? "change" : "input", (e) => {
12113
12259
  if (e.target.composing) return;
12114
- let domValue = el.value;
12115
- if (trim) {
12116
- domValue = domValue.trim();
12117
- }
12118
- if (castToNumber) {
12119
- domValue = looseToNumber(domValue);
12120
- }
12121
- el[assignKey](domValue);
12260
+ el[assignKey](castValue(el.value, trim, castToNumber));
12122
12261
  });
12123
- if (trim) {
12262
+ if (trim || castToNumber) {
12124
12263
  addEventListener(el, "change", () => {
12125
- el.value = el.value.trim();
12264
+ el.value = castValue(el.value, trim, castToNumber);
12126
12265
  });
12127
12266
  }
12128
12267
  if (!lazy) {
@@ -12632,6 +12771,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12632
12771
  mergeModels: mergeModels,
12633
12772
  mergeProps: mergeProps,
12634
12773
  nextTick: nextTick,
12774
+ nodeOps: nodeOps,
12635
12775
  normalizeClass: normalizeClass,
12636
12776
  normalizeProps: normalizeProps,
12637
12777
  normalizeStyle: normalizeStyle,
@@ -12650,6 +12790,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12650
12790
  onUpdated: onUpdated,
12651
12791
  onWatcherCleanup: onWatcherCleanup,
12652
12792
  openBlock: openBlock,
12793
+ patchProp: patchProp,
12653
12794
  popScopeId: popScopeId,
12654
12795
  provide: provide,
12655
12796
  proxyRefs: proxyRefs,
@@ -12731,81 +12872,81 @@ Make sure to use the production build (*.prod.js) when deploying for production.
12731
12872
  }
12732
12873
  }
12733
12874
 
12734
- const FRAGMENT = Symbol(`Fragment` );
12735
- const TELEPORT = Symbol(`Teleport` );
12736
- const SUSPENSE = Symbol(`Suspense` );
12737
- const KEEP_ALIVE = Symbol(`KeepAlive` );
12738
- const BASE_TRANSITION = Symbol(
12875
+ const FRAGMENT = /* @__PURE__ */ Symbol(`Fragment` );
12876
+ const TELEPORT = /* @__PURE__ */ Symbol(`Teleport` );
12877
+ const SUSPENSE = /* @__PURE__ */ Symbol(`Suspense` );
12878
+ const KEEP_ALIVE = /* @__PURE__ */ Symbol(`KeepAlive` );
12879
+ const BASE_TRANSITION = /* @__PURE__ */ Symbol(
12739
12880
  `BaseTransition`
12740
12881
  );
12741
- const OPEN_BLOCK = Symbol(`openBlock` );
12742
- const CREATE_BLOCK = Symbol(`createBlock` );
12743
- const CREATE_ELEMENT_BLOCK = Symbol(
12882
+ const OPEN_BLOCK = /* @__PURE__ */ Symbol(`openBlock` );
12883
+ const CREATE_BLOCK = /* @__PURE__ */ Symbol(`createBlock` );
12884
+ const CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(
12744
12885
  `createElementBlock`
12745
12886
  );
12746
- const CREATE_VNODE = Symbol(`createVNode` );
12747
- const CREATE_ELEMENT_VNODE = Symbol(
12887
+ const CREATE_VNODE = /* @__PURE__ */ Symbol(`createVNode` );
12888
+ const CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(
12748
12889
  `createElementVNode`
12749
12890
  );
12750
- const CREATE_COMMENT = Symbol(
12891
+ const CREATE_COMMENT = /* @__PURE__ */ Symbol(
12751
12892
  `createCommentVNode`
12752
12893
  );
12753
- const CREATE_TEXT = Symbol(
12894
+ const CREATE_TEXT = /* @__PURE__ */ Symbol(
12754
12895
  `createTextVNode`
12755
12896
  );
12756
- const CREATE_STATIC = Symbol(
12897
+ const CREATE_STATIC = /* @__PURE__ */ Symbol(
12757
12898
  `createStaticVNode`
12758
12899
  );
12759
- const RESOLVE_COMPONENT = Symbol(
12900
+ const RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(
12760
12901
  `resolveComponent`
12761
12902
  );
12762
- const RESOLVE_DYNAMIC_COMPONENT = Symbol(
12903
+ const RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(
12763
12904
  `resolveDynamicComponent`
12764
12905
  );
12765
- const RESOLVE_DIRECTIVE = Symbol(
12906
+ const RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(
12766
12907
  `resolveDirective`
12767
12908
  );
12768
- const RESOLVE_FILTER = Symbol(
12909
+ const RESOLVE_FILTER = /* @__PURE__ */ Symbol(
12769
12910
  `resolveFilter`
12770
12911
  );
12771
- const WITH_DIRECTIVES = Symbol(
12912
+ const WITH_DIRECTIVES = /* @__PURE__ */ Symbol(
12772
12913
  `withDirectives`
12773
12914
  );
12774
- const RENDER_LIST = Symbol(`renderList` );
12775
- const RENDER_SLOT = Symbol(`renderSlot` );
12776
- const CREATE_SLOTS = Symbol(`createSlots` );
12777
- const TO_DISPLAY_STRING = Symbol(
12915
+ const RENDER_LIST = /* @__PURE__ */ Symbol(`renderList` );
12916
+ const RENDER_SLOT = /* @__PURE__ */ Symbol(`renderSlot` );
12917
+ const CREATE_SLOTS = /* @__PURE__ */ Symbol(`createSlots` );
12918
+ const TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(
12778
12919
  `toDisplayString`
12779
12920
  );
12780
- const MERGE_PROPS = Symbol(`mergeProps` );
12781
- const NORMALIZE_CLASS = Symbol(
12921
+ const MERGE_PROPS = /* @__PURE__ */ Symbol(`mergeProps` );
12922
+ const NORMALIZE_CLASS = /* @__PURE__ */ Symbol(
12782
12923
  `normalizeClass`
12783
12924
  );
12784
- const NORMALIZE_STYLE = Symbol(
12925
+ const NORMALIZE_STYLE = /* @__PURE__ */ Symbol(
12785
12926
  `normalizeStyle`
12786
12927
  );
12787
- const NORMALIZE_PROPS = Symbol(
12928
+ const NORMALIZE_PROPS = /* @__PURE__ */ Symbol(
12788
12929
  `normalizeProps`
12789
12930
  );
12790
- const GUARD_REACTIVE_PROPS = Symbol(
12931
+ const GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(
12791
12932
  `guardReactiveProps`
12792
12933
  );
12793
- const TO_HANDLERS = Symbol(`toHandlers` );
12794
- const CAMELIZE = Symbol(`camelize` );
12795
- const CAPITALIZE = Symbol(`capitalize` );
12796
- const TO_HANDLER_KEY = Symbol(
12934
+ const TO_HANDLERS = /* @__PURE__ */ Symbol(`toHandlers` );
12935
+ const CAMELIZE = /* @__PURE__ */ Symbol(`camelize` );
12936
+ const CAPITALIZE = /* @__PURE__ */ Symbol(`capitalize` );
12937
+ const TO_HANDLER_KEY = /* @__PURE__ */ Symbol(
12797
12938
  `toHandlerKey`
12798
12939
  );
12799
- const SET_BLOCK_TRACKING = Symbol(
12940
+ const SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(
12800
12941
  `setBlockTracking`
12801
12942
  );
12802
- const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
12803
- const POP_SCOPE_ID = Symbol(`popScopeId` );
12804
- const WITH_CTX = Symbol(`withCtx` );
12805
- const UNREF = Symbol(`unref` );
12806
- const IS_REF = Symbol(`isRef` );
12807
- const WITH_MEMO = Symbol(`withMemo` );
12808
- const IS_MEMO_SAME = Symbol(`isMemoSame` );
12943
+ const PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(`pushScopeId` );
12944
+ const POP_SCOPE_ID = /* @__PURE__ */ Symbol(`popScopeId` );
12945
+ const WITH_CTX = /* @__PURE__ */ Symbol(`withCtx` );
12946
+ const UNREF = /* @__PURE__ */ Symbol(`unref` );
12947
+ const IS_REF = /* @__PURE__ */ Symbol(`isRef` );
12948
+ const WITH_MEMO = /* @__PURE__ */ Symbol(`withMemo` );
12949
+ const IS_MEMO_SAME = /* @__PURE__ */ Symbol(`isMemoSame` );
12809
12950
  const helperNameMap = {
12810
12951
  [FRAGMENT]: `Fragment`,
12811
12952
  [TELEPORT]: `Teleport`,
@@ -13100,14 +13241,28 @@ class Tokenizer {
13100
13241
  getPos(index) {
13101
13242
  let line = 1;
13102
13243
  let column = index + 1;
13103
- for (let i = this.newlines.length - 1; i >= 0; i--) {
13104
- const newlineIndex = this.newlines[i];
13105
- if (index > newlineIndex) {
13106
- line = i + 2;
13107
- column = index - newlineIndex;
13108
- break;
13244
+ const length = this.newlines.length;
13245
+ let j = -1;
13246
+ if (length > 100) {
13247
+ let l = -1;
13248
+ let r = length;
13249
+ while (l + 1 < r) {
13250
+ const m = l + r >>> 1;
13251
+ this.newlines[m] < index ? l = m : r = m;
13252
+ }
13253
+ j = l;
13254
+ } else {
13255
+ for (let i = length - 1; i >= 0; i--) {
13256
+ if (index > this.newlines[i]) {
13257
+ j = i;
13258
+ break;
13259
+ }
13109
13260
  }
13110
13261
  }
13262
+ if (j >= 0) {
13263
+ line = j + 2;
13264
+ column = index - this.newlines[j];
13265
+ }
13111
13266
  return {
13112
13267
  column,
13113
13268
  line,
@@ -13855,7 +14010,7 @@ const errorMessages = {
13855
14010
  [32]: `v-for has invalid expression.`,
13856
14011
  [33]: `<template v-for> key should be placed on the <template> tag.`,
13857
14012
  [34]: `v-bind is missing expression.`,
13858
- [52]: `v-bind with same-name shorthand only allows static argument.`,
14013
+ [53]: `v-bind with same-name shorthand only allows static argument.`,
13859
14014
  [35]: `v-on is missing expression.`,
13860
14015
  [36]: `Unexpected custom directive on <slot> outlet.`,
13861
14016
  [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.`,
@@ -13867,16 +14022,17 @@ const errorMessages = {
13867
14022
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
13868
14023
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
13869
14024
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
13870
- [45]: `Error parsing JavaScript expression: `,
13871
- [46]: `<KeepAlive> expects exactly one child component.`,
13872
- [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.`,
14025
+ [45]: `v-model cannot be used on a const binding because it is not writable.`,
14026
+ [46]: `Error parsing JavaScript expression: `,
14027
+ [47]: `<KeepAlive> expects exactly one child component.`,
14028
+ [52]: `@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.`,
13873
14029
  // generic errors
13874
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
13875
- [48]: `ES module mode is not supported in this build of compiler.`,
13876
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
13877
- [50]: `"scopeId" option is only supported in module mode.`,
14030
+ [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14031
+ [49]: `ES module mode is not supported in this build of compiler.`,
14032
+ [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14033
+ [51]: `"scopeId" option is only supported in module mode.`,
13878
14034
  // just to fulfill types
13879
- [53]: ``
14035
+ [54]: ``
13880
14036
  };
13881
14037
 
13882
14038
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
@@ -14114,6 +14270,20 @@ function getMemoedVNodeCall(node) {
14114
14270
  }
14115
14271
  }
14116
14272
  const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
14273
+ function isAllWhitespace(str) {
14274
+ for (let i = 0; i < str.length; i++) {
14275
+ if (!isWhitespace(str.charCodeAt(i))) {
14276
+ return false;
14277
+ }
14278
+ }
14279
+ return true;
14280
+ }
14281
+ function isWhitespaceText(node) {
14282
+ return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
14283
+ }
14284
+ function isCommentOrWhitespace(node) {
14285
+ return node.type === 3 || isWhitespaceText(node);
14286
+ }
14117
14287
 
14118
14288
  const defaultParserOptions = {
14119
14289
  parseMode: "base",
@@ -14653,14 +14823,6 @@ function condenseWhitespace(nodes) {
14653
14823
  }
14654
14824
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
14655
14825
  }
14656
- function isAllWhitespace(str) {
14657
- for (let i = 0; i < str.length; i++) {
14658
- if (!isWhitespace(str.charCodeAt(i))) {
14659
- return false;
14660
- }
14661
- }
14662
- return true;
14663
- }
14664
14826
  function hasNewlineChar(str) {
14665
14827
  for (let i = 0; i < str.length; i++) {
14666
14828
  const c = str.charCodeAt(i);
@@ -15959,7 +16121,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
15959
16121
  }
15960
16122
  context.onError(
15961
16123
  createCompilerError(
15962
- 45,
16124
+ 46,
15963
16125
  node.loc,
15964
16126
  void 0,
15965
16127
  message
@@ -16066,13 +16228,11 @@ function processIf(node, dir, context, processCodegen) {
16066
16228
  let i = siblings.indexOf(node);
16067
16229
  while (i-- >= -1) {
16068
16230
  const sibling = siblings[i];
16069
- if (sibling && sibling.type === 3) {
16070
- context.removeNode(sibling);
16071
- comments.unshift(sibling);
16072
- continue;
16073
- }
16074
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
16231
+ if (sibling && isCommentOrWhitespace(sibling)) {
16075
16232
  context.removeNode(sibling);
16233
+ if (sibling.type === 3) {
16234
+ comments.unshift(sibling);
16235
+ }
16076
16236
  continue;
16077
16237
  }
16078
16238
  if (sibling && sibling.type === 9) {
@@ -16225,80 +16385,6 @@ function getParentCondition(node) {
16225
16385
  }
16226
16386
  }
16227
16387
 
16228
- const transformBind = (dir, _node, context) => {
16229
- const { modifiers, loc } = dir;
16230
- const arg = dir.arg;
16231
- let { exp } = dir;
16232
- if (exp && exp.type === 4 && !exp.content.trim()) {
16233
- {
16234
- exp = void 0;
16235
- }
16236
- }
16237
- if (!exp) {
16238
- if (arg.type !== 4 || !arg.isStatic) {
16239
- context.onError(
16240
- createCompilerError(
16241
- 52,
16242
- arg.loc
16243
- )
16244
- );
16245
- return {
16246
- props: [
16247
- createObjectProperty(arg, createSimpleExpression("", true, loc))
16248
- ]
16249
- };
16250
- }
16251
- transformBindShorthand(dir);
16252
- exp = dir.exp;
16253
- }
16254
- if (arg.type !== 4) {
16255
- arg.children.unshift(`(`);
16256
- arg.children.push(`) || ""`);
16257
- } else if (!arg.isStatic) {
16258
- arg.content = arg.content ? `${arg.content} || ""` : `""`;
16259
- }
16260
- if (modifiers.some((mod) => mod.content === "camel")) {
16261
- if (arg.type === 4) {
16262
- if (arg.isStatic) {
16263
- arg.content = camelize(arg.content);
16264
- } else {
16265
- arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
16266
- }
16267
- } else {
16268
- arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
16269
- arg.children.push(`)`);
16270
- }
16271
- }
16272
- if (!context.inSSR) {
16273
- if (modifiers.some((mod) => mod.content === "prop")) {
16274
- injectPrefix(arg, ".");
16275
- }
16276
- if (modifiers.some((mod) => mod.content === "attr")) {
16277
- injectPrefix(arg, "^");
16278
- }
16279
- }
16280
- return {
16281
- props: [createObjectProperty(arg, exp)]
16282
- };
16283
- };
16284
- const transformBindShorthand = (dir, context) => {
16285
- const arg = dir.arg;
16286
- const propName = camelize(arg.content);
16287
- dir.exp = createSimpleExpression(propName, false, arg.loc);
16288
- };
16289
- const injectPrefix = (arg, prefix) => {
16290
- if (arg.type === 4) {
16291
- if (arg.isStatic) {
16292
- arg.content = prefix + arg.content;
16293
- } else {
16294
- arg.content = `\`${prefix}\${${arg.content}}\``;
16295
- }
16296
- } else {
16297
- arg.children.unshift(`'${prefix}' + (`);
16298
- arg.children.push(`)`);
16299
- }
16300
- };
16301
-
16302
16388
  const transformFor = createStructuralDirectiveTransform(
16303
16389
  "for",
16304
16390
  (node, dir, context) => {
@@ -16310,10 +16396,7 @@ const transformFor = createStructuralDirectiveTransform(
16310
16396
  const isTemplate = isTemplateNode(node);
16311
16397
  const memo = findDir(node, "memo");
16312
16398
  const keyProp = findProp(node, `key`, false, true);
16313
- const isDirKey = keyProp && keyProp.type === 7;
16314
- if (isDirKey && !keyProp.exp) {
16315
- transformBindShorthand(keyProp);
16316
- }
16399
+ keyProp && keyProp.type === 7;
16317
16400
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16318
16401
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
16319
16402
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
@@ -16602,7 +16685,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
16602
16685
  let prev;
16603
16686
  while (j--) {
16604
16687
  prev = children[j];
16605
- if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
16688
+ if (!isCommentOrWhitespace(prev)) {
16606
16689
  break;
16607
16690
  }
16608
16691
  }
@@ -16677,7 +16760,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
16677
16760
  } else if (implicitDefaultChildren.length && // #3766
16678
16761
  // with whitespace: 'preserve', whitespaces between slots will end up in
16679
16762
  // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
16680
- implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
16763
+ !implicitDefaultChildren.every(isWhitespaceText)) {
16681
16764
  if (hasNamedDefaultSlot) {
16682
16765
  context.onError(
16683
16766
  createCompilerError(
@@ -16750,11 +16833,6 @@ function hasForwardedSlots(children) {
16750
16833
  }
16751
16834
  return false;
16752
16835
  }
16753
- function isNonWhitespaceContent(node) {
16754
- if (node.type !== 2 && node.type !== 12)
16755
- return true;
16756
- return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
16757
- }
16758
16836
 
16759
16837
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
16760
16838
  const transformElement = (node, context) => {
@@ -16806,7 +16884,7 @@ const transformElement = (node, context) => {
16806
16884
  patchFlag |= 1024;
16807
16885
  if (node.children.length > 1) {
16808
16886
  context.onError(
16809
- createCompilerError(46, {
16887
+ createCompilerError(47, {
16810
16888
  start: node.children[0].loc.start,
16811
16889
  end: node.children[node.children.length - 1].loc.end,
16812
16890
  source: ""
@@ -17353,7 +17431,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17353
17431
  if (arg.isStatic) {
17354
17432
  let rawName = arg.content;
17355
17433
  if (rawName.startsWith("vnode")) {
17356
- context.onError(createCompilerError(51, arg.loc));
17434
+ context.onError(createCompilerError(52, arg.loc));
17357
17435
  }
17358
17436
  if (rawName.startsWith("vue:")) {
17359
17437
  rawName = `vnode-${rawName.slice(4)}`;
@@ -17423,6 +17501,58 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17423
17501
  return ret;
17424
17502
  };
17425
17503
 
17504
+ const transformBind = (dir, _node, context) => {
17505
+ const { modifiers, loc } = dir;
17506
+ const arg = dir.arg;
17507
+ let { exp } = dir;
17508
+ if (exp && exp.type === 4 && !exp.content.trim()) {
17509
+ {
17510
+ exp = void 0;
17511
+ }
17512
+ }
17513
+ if (arg.type !== 4) {
17514
+ arg.children.unshift(`(`);
17515
+ arg.children.push(`) || ""`);
17516
+ } else if (!arg.isStatic) {
17517
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
17518
+ }
17519
+ if (modifiers.some((mod) => mod.content === "camel")) {
17520
+ if (arg.type === 4) {
17521
+ if (arg.isStatic) {
17522
+ arg.content = camelize(arg.content);
17523
+ } else {
17524
+ arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
17525
+ }
17526
+ } else {
17527
+ arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
17528
+ arg.children.push(`)`);
17529
+ }
17530
+ }
17531
+ if (!context.inSSR) {
17532
+ if (modifiers.some((mod) => mod.content === "prop")) {
17533
+ injectPrefix(arg, ".");
17534
+ }
17535
+ if (modifiers.some((mod) => mod.content === "attr")) {
17536
+ injectPrefix(arg, "^");
17537
+ }
17538
+ }
17539
+ return {
17540
+ props: [createObjectProperty(arg, exp)]
17541
+ };
17542
+ };
17543
+ const injectPrefix = (arg, prefix) => {
17544
+ if (arg.type === 4) {
17545
+ if (arg.isStatic) {
17546
+ arg.content = prefix + arg.content;
17547
+ } else {
17548
+ arg.content = `\`${prefix}\${${arg.content}}\``;
17549
+ }
17550
+ } else {
17551
+ arg.children.unshift(`'${prefix}' + (`);
17552
+ arg.children.push(`)`);
17553
+ }
17554
+ };
17555
+
17426
17556
  const transformText = (node, context) => {
17427
17557
  if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
17428
17558
  return () => {
@@ -17534,6 +17664,10 @@ const transformModel$1 = (dir, node, context) => {
17534
17664
  context.onError(createCompilerError(44, exp.loc));
17535
17665
  return createTransformProps();
17536
17666
  }
17667
+ if (bindingType === "literal-const" || bindingType === "setup-const") {
17668
+ context.onError(createCompilerError(45, exp.loc));
17669
+ return createTransformProps();
17670
+ }
17537
17671
  if (!expString.trim() || !isMemberExpression(exp) && true) {
17538
17672
  context.onError(
17539
17673
  createCompilerError(42, exp.loc)
@@ -17604,9 +17738,36 @@ const transformMemo = (node, context) => {
17604
17738
  }
17605
17739
  };
17606
17740
 
17741
+ const transformVBindShorthand = (node, context) => {
17742
+ if (node.type === 1) {
17743
+ for (const prop of node.props) {
17744
+ if (prop.type === 7 && prop.name === "bind" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
17745
+ prop.exp.type === 4 && !prop.exp.content.trim()) && prop.arg) {
17746
+ const arg = prop.arg;
17747
+ if (arg.type !== 4 || !arg.isStatic) {
17748
+ context.onError(
17749
+ createCompilerError(
17750
+ 53,
17751
+ arg.loc
17752
+ )
17753
+ );
17754
+ prop.exp = createSimpleExpression("", true, arg.loc);
17755
+ } else {
17756
+ const propName = camelize(arg.content);
17757
+ if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
17758
+ propName[0] === "-") {
17759
+ prop.exp = createSimpleExpression(propName, false, arg.loc);
17760
+ }
17761
+ }
17762
+ }
17763
+ }
17764
+ }
17765
+ };
17766
+
17607
17767
  function getBaseTransformPreset(prefixIdentifiers) {
17608
17768
  return [
17609
17769
  [
17770
+ transformVBindShorthand,
17610
17771
  transformOnce,
17611
17772
  transformIf,
17612
17773
  transformMemo,
@@ -17630,17 +17791,17 @@ function baseCompile(source, options = {}) {
17630
17791
  const isModuleMode = options.mode === "module";
17631
17792
  {
17632
17793
  if (options.prefixIdentifiers === true) {
17633
- onError(createCompilerError(47));
17634
- } else if (isModuleMode) {
17635
17794
  onError(createCompilerError(48));
17795
+ } else if (isModuleMode) {
17796
+ onError(createCompilerError(49));
17636
17797
  }
17637
17798
  }
17638
17799
  const prefixIdentifiers = false;
17639
17800
  if (options.cacheHandlers) {
17640
- onError(createCompilerError(49));
17801
+ onError(createCompilerError(50));
17641
17802
  }
17642
17803
  if (options.scopeId && !isModuleMode) {
17643
- onError(createCompilerError(50));
17804
+ onError(createCompilerError(51));
17644
17805
  }
17645
17806
  const resolvedOptions = extend({}, options, {
17646
17807
  prefixIdentifiers
@@ -17668,26 +17829,26 @@ function baseCompile(source, options = {}) {
17668
17829
 
17669
17830
  const noopDirectiveTransform = () => ({ props: [] });
17670
17831
 
17671
- const V_MODEL_RADIO = Symbol(`vModelRadio` );
17672
- const V_MODEL_CHECKBOX = Symbol(
17832
+ const V_MODEL_RADIO = /* @__PURE__ */ Symbol(`vModelRadio` );
17833
+ const V_MODEL_CHECKBOX = /* @__PURE__ */ Symbol(
17673
17834
  `vModelCheckbox`
17674
17835
  );
17675
- const V_MODEL_TEXT = Symbol(`vModelText` );
17676
- const V_MODEL_SELECT = Symbol(
17836
+ const V_MODEL_TEXT = /* @__PURE__ */ Symbol(`vModelText` );
17837
+ const V_MODEL_SELECT = /* @__PURE__ */ Symbol(
17677
17838
  `vModelSelect`
17678
17839
  );
17679
- const V_MODEL_DYNAMIC = Symbol(
17840
+ const V_MODEL_DYNAMIC = /* @__PURE__ */ Symbol(
17680
17841
  `vModelDynamic`
17681
17842
  );
17682
- const V_ON_WITH_MODIFIERS = Symbol(
17843
+ const V_ON_WITH_MODIFIERS = /* @__PURE__ */ Symbol(
17683
17844
  `vOnModifiersGuard`
17684
17845
  );
17685
- const V_ON_WITH_KEYS = Symbol(
17846
+ const V_ON_WITH_KEYS = /* @__PURE__ */ Symbol(
17686
17847
  `vOnKeysGuard`
17687
17848
  );
17688
- const V_SHOW = Symbol(`vShow` );
17689
- const TRANSITION = Symbol(`Transition` );
17690
- const TRANSITION_GROUP = Symbol(
17849
+ const V_SHOW = /* @__PURE__ */ Symbol(`vShow` );
17850
+ const TRANSITION = /* @__PURE__ */ Symbol(`Transition` );
17851
+ const TRANSITION_GROUP = /* @__PURE__ */ Symbol(
17691
17852
  `TransitionGroup`
17692
17853
  );
17693
17854
  registerRuntimeHelpers({
@@ -17798,29 +17959,29 @@ function createDOMCompilerError(code, loc) {
17798
17959
  );
17799
17960
  }
17800
17961
  const DOMErrorMessages = {
17801
- [53]: `v-html is missing expression.`,
17802
- [54]: `v-html will override element children.`,
17803
- [55]: `v-text is missing expression.`,
17804
- [56]: `v-text will override element children.`,
17805
- [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
17806
- [58]: `v-model argument is not supported on plain elements.`,
17807
- [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
17808
- [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
17809
- [61]: `v-show is missing expression.`,
17810
- [62]: `<Transition> expects exactly one child element or component.`,
17811
- [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
17962
+ [54]: `v-html is missing expression.`,
17963
+ [55]: `v-html will override element children.`,
17964
+ [56]: `v-text is missing expression.`,
17965
+ [57]: `v-text will override element children.`,
17966
+ [58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
17967
+ [59]: `v-model argument is not supported on plain elements.`,
17968
+ [60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
17969
+ [61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
17970
+ [62]: `v-show is missing expression.`,
17971
+ [63]: `<Transition> expects exactly one child element or component.`,
17972
+ [64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
17812
17973
  };
17813
17974
 
17814
17975
  const transformVHtml = (dir, node, context) => {
17815
17976
  const { exp, loc } = dir;
17816
17977
  if (!exp) {
17817
17978
  context.onError(
17818
- createDOMCompilerError(53, loc)
17979
+ createDOMCompilerError(54, loc)
17819
17980
  );
17820
17981
  }
17821
17982
  if (node.children.length) {
17822
17983
  context.onError(
17823
- createDOMCompilerError(54, loc)
17984
+ createDOMCompilerError(55, loc)
17824
17985
  );
17825
17986
  node.children.length = 0;
17826
17987
  }
@@ -17838,12 +17999,12 @@ const transformVText = (dir, node, context) => {
17838
17999
  const { exp, loc } = dir;
17839
18000
  if (!exp) {
17840
18001
  context.onError(
17841
- createDOMCompilerError(55, loc)
18002
+ createDOMCompilerError(56, loc)
17842
18003
  );
17843
18004
  }
17844
18005
  if (node.children.length) {
17845
18006
  context.onError(
17846
- createDOMCompilerError(56, loc)
18007
+ createDOMCompilerError(57, loc)
17847
18008
  );
17848
18009
  node.children.length = 0;
17849
18010
  }
@@ -17869,7 +18030,7 @@ const transformModel = (dir, node, context) => {
17869
18030
  if (dir.arg) {
17870
18031
  context.onError(
17871
18032
  createDOMCompilerError(
17872
- 58,
18033
+ 59,
17873
18034
  dir.arg.loc
17874
18035
  )
17875
18036
  );
@@ -17879,7 +18040,7 @@ const transformModel = (dir, node, context) => {
17879
18040
  if (value && isStaticArgOf(value.arg, "value")) {
17880
18041
  context.onError(
17881
18042
  createDOMCompilerError(
17882
- 60,
18043
+ 61,
17883
18044
  value.loc
17884
18045
  )
17885
18046
  );
@@ -17907,7 +18068,7 @@ const transformModel = (dir, node, context) => {
17907
18068
  isInvalidType = true;
17908
18069
  context.onError(
17909
18070
  createDOMCompilerError(
17910
- 59,
18071
+ 60,
17911
18072
  dir.loc
17912
18073
  )
17913
18074
  );
@@ -17933,7 +18094,7 @@ const transformModel = (dir, node, context) => {
17933
18094
  } else {
17934
18095
  context.onError(
17935
18096
  createDOMCompilerError(
17936
- 57,
18097
+ 58,
17937
18098
  dir.loc
17938
18099
  )
17939
18100
  );
@@ -18035,7 +18196,7 @@ const transformShow = (dir, node, context) => {
18035
18196
  const { exp, loc } = dir;
18036
18197
  if (!exp) {
18037
18198
  context.onError(
18038
- createDOMCompilerError(61, loc)
18199
+ createDOMCompilerError(62, loc)
18039
18200
  );
18040
18201
  }
18041
18202
  return {
@@ -18055,7 +18216,7 @@ const transformTransition = (node, context) => {
18055
18216
  if (hasMultipleChildren(node)) {
18056
18217
  context.onError(
18057
18218
  createDOMCompilerError(
18058
- 62,
18219
+ 63,
18059
18220
  {
18060
18221
  start: node.children[0].loc.start,
18061
18222
  end: node.children[node.children.length - 1].loc.end,
@@ -18084,7 +18245,7 @@ const transformTransition = (node, context) => {
18084
18245
  };
18085
18246
  function hasMultipleChildren(node) {
18086
18247
  const children = node.children = node.children.filter(
18087
- (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
18248
+ (c) => !isCommentOrWhitespace(c)
18088
18249
  );
18089
18250
  const child = children[0];
18090
18251
  return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
@@ -18094,7 +18255,7 @@ const ignoreSideEffectTags = (node, context) => {
18094
18255
  if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
18095
18256
  context.onError(
18096
18257
  createDOMCompilerError(
18097
- 63,
18258
+ 64,
18098
18259
  node.loc
18099
18260
  )
18100
18261
  );
@@ -18366,4 +18527,4 @@ ${codeFrame}` : message);
18366
18527
  }
18367
18528
  registerRuntimeCompiler(compileToFunction);
18368
18529
 
18369
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
18530
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, nodeOps, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };