@highstate/designer 0.19.1 → 0.20.0

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 (512) hide show
  1. package/.output/nitro.json +3 -3
  2. package/.output/public/_nuxt/57B6Rca8.js +1 -0
  3. package/.output/public/_nuxt/5X7smno1.js +1 -0
  4. package/.output/public/_nuxt/{Cp2bjttb.js → 83L43bj1.js} +1 -1
  5. package/.output/public/_nuxt/8MSfy8uY.js +1 -0
  6. package/.output/public/_nuxt/9I37tBe7.js +1 -0
  7. package/.output/public/_nuxt/Aopv2gwH.js +1 -0
  8. package/.output/public/_nuxt/B13uiJCv.js +1 -0
  9. package/.output/public/_nuxt/B7c-h3xW.js +1 -0
  10. package/.output/public/_nuxt/B8nw2aST.js +2 -0
  11. package/.output/public/_nuxt/{1DNp92w6.js → B93PlW-d.js} +1 -1
  12. package/.output/public/_nuxt/BA0jw7CM.js +1 -0
  13. package/.output/public/_nuxt/BBf5iR-q.js +1 -0
  14. package/.output/public/_nuxt/BCVaR2pQ.js +1 -0
  15. package/.output/public/_nuxt/BDAHnC4j.js +1 -0
  16. package/.output/public/_nuxt/BDa1f6PF.js +2 -0
  17. package/.output/public/_nuxt/{YB_1Ta41.js → BDs6uo3D.js} +1 -1
  18. package/.output/public/_nuxt/BEEt8Am7.js +1 -0
  19. package/.output/public/_nuxt/BE_Meo09.js +269 -0
  20. package/.output/public/_nuxt/BGHnOYBU.js +1 -0
  21. package/.output/public/_nuxt/BH7IYjvW.js +1 -0
  22. package/.output/public/_nuxt/BJDFO7_C.js +1 -0
  23. package/.output/public/_nuxt/BJK6uMxG.js +1 -0
  24. package/.output/public/_nuxt/BLF3u89x.js +1 -0
  25. package/.output/public/_nuxt/{Xi2tawMN.js → BLmx8bSh.js} +1 -1
  26. package/.output/public/_nuxt/{DlfHMoPT.js → BPQ3VLAy.js} +1 -1
  27. package/.output/public/_nuxt/BPcwi1q2.js +1 -0
  28. package/.output/public/_nuxt/{BBGuKPBd.js → BR5kRUq4.js} +1 -1
  29. package/.output/public/_nuxt/BTifaqeh.js +1 -0
  30. package/.output/public/_nuxt/BUNf2Yb8.js +1 -0
  31. package/.output/public/_nuxt/BUw7H-hv.js +1 -0
  32. package/.output/public/_nuxt/{DRprw4p4.js → BVQ-GDCI.js} +1 -1
  33. package/.output/public/_nuxt/{BbQj0Z2C.js → BYV0-3_D.js} +1 -1
  34. package/.output/public/_nuxt/BZvkOJ9d.js +1 -0
  35. package/.output/public/_nuxt/Ba13S78F.js +1 -0
  36. package/.output/public/_nuxt/BcVCzyr7.js +1 -0
  37. package/.output/public/_nuxt/BhRPY-oY.js +1 -0
  38. package/.output/public/_nuxt/{uMbE6_td.js → Bhrxn6JZ.js} +1 -1
  39. package/.output/public/_nuxt/BkNNRtnm.js +1 -0
  40. package/.output/public/_nuxt/BlfjmxyP.js +1 -0
  41. package/.output/public/_nuxt/Bmn6On1c.js +1 -0
  42. package/.output/public/_nuxt/Bo8jzlL1.js +18 -0
  43. package/.output/public/_nuxt/BpkvlDNi.js +1 -0
  44. package/.output/public/_nuxt/{BIAuTxu3.js → Br6cN0cg.js} +1 -1
  45. package/.output/public/_nuxt/{CUEJCptM.js → BrzmwbiE.js} +1 -1
  46. package/.output/public/_nuxt/{D32k8WzR.js → BtvRca6l.js} +1 -1
  47. package/.output/public/_nuxt/BuJgCY_C.js +1 -0
  48. package/.output/public/_nuxt/Bv_4Rxtq.js +1 -0
  49. package/.output/public/_nuxt/BvzEVeQv.js +1 -0
  50. package/.output/public/_nuxt/BxAss8Tj.js +1 -0
  51. package/.output/public/_nuxt/BxaP9l2T.js +1 -0
  52. package/.output/public/_nuxt/BxgE0vQu.js +1 -0
  53. package/.output/public/_nuxt/ByBNG4eo.js +1 -0
  54. package/.output/public/_nuxt/{COI20M4I.js → BzTr9Aqm.js} +1 -1
  55. package/.output/public/_nuxt/{CXu1NL6O.js → C-HG3fhB.js} +1 -1
  56. package/.output/public/_nuxt/C-sUppwS.js +1 -0
  57. package/.output/public/_nuxt/C1FLL1Qz.js +1 -0
  58. package/.output/public/_nuxt/C3Wv6jpd.js +1 -0
  59. package/.output/public/_nuxt/C47S-Tmv.js +1 -0
  60. package/.output/public/_nuxt/C4EeE6gA.js +1 -0
  61. package/.output/public/_nuxt/{C-Jbm3Hp.js → C4gqWexZ.js} +1 -1
  62. package/.output/public/_nuxt/{DTMYz4Jt.js → C5YyOfLZ.js} +1 -1
  63. package/.output/public/_nuxt/C7zT0LnQ.js +1 -0
  64. package/.output/public/_nuxt/C8lm7lgC.js +1 -0
  65. package/.output/public/_nuxt/C9dUb6Cb.js +1 -0
  66. package/.output/public/_nuxt/{DS1LvVMU.js → C9oPPf7i.js} +1 -1
  67. package/.output/public/_nuxt/{D1uDOp7C.js → CFHQjOhq.js} +1 -1
  68. package/.output/public/_nuxt/{Dtc2v4kS.js → CGscLIrv.js} +1 -1
  69. package/.output/public/_nuxt/{DKzvysjW.js → CH1njM8p.js} +1 -1
  70. package/.output/public/_nuxt/CJWmG4YP.js +12 -0
  71. package/.output/public/_nuxt/CLZrNe3w.js +1 -0
  72. package/.output/public/_nuxt/CMTm3GFP.js +1 -0
  73. package/.output/public/_nuxt/CMjwMIkn.js +1 -0
  74. package/.output/public/_nuxt/COcwbKMJ.js +1 -0
  75. package/.output/public/_nuxt/CPZSvMBB.js +1 -0
  76. package/.output/public/_nuxt/CPpO8vcZ.js +1 -0
  77. package/.output/public/_nuxt/CQ8jqdy-.js +1 -0
  78. package/.output/public/_nuxt/CV5MeYf9.js +1 -0
  79. package/.output/public/_nuxt/{CcyOm34o.js → CVdnzihN.js} +1 -1
  80. package/.output/public/_nuxt/CW8IKDeL.js +1 -0
  81. package/.output/public/_nuxt/{pkIJ47B4.js → CXZktZb0.js} +1 -1
  82. package/.output/public/_nuxt/CYsAdtH9.js +1 -0
  83. package/.output/public/_nuxt/{BUyGWigt.js → CZhp0h8q.js} +1 -1
  84. package/.output/public/_nuxt/CaJ-zn_Z.js +2 -0
  85. package/.output/public/_nuxt/CcOKGYBt.js +1 -0
  86. package/.output/public/_nuxt/{oTG82Wo1.js → CenWIFCC.js} +1 -1
  87. package/.output/public/_nuxt/ChaZkl1J.js +1 -0
  88. package/.output/public/_nuxt/CjoLj4QM.js +1 -0
  89. package/.output/public/_nuxt/{BtsDLbAf.js → Cl0AqbOI.js} +1 -1
  90. package/.output/public/_nuxt/Cm-2nZ05.js +1 -0
  91. package/.output/public/_nuxt/{DUSGQflk.js → Cm3UrAx6.js} +1 -1
  92. package/.output/public/_nuxt/{BGHREFWD.js → CmIQRyeF.js} +1 -1
  93. package/.output/public/_nuxt/{f7oK2omx.js → Cn7AkR1O.js} +1 -1
  94. package/.output/public/_nuxt/{JhPuU2gP.js → CnnebwVN.js} +1 -1
  95. package/.output/public/_nuxt/CnsnAmq5.js +1 -0
  96. package/.output/public/_nuxt/CoDkCxhg.js +1 -0
  97. package/.output/public/_nuxt/{B-hkwWGT.js → CpOuai2O.js} +1 -1
  98. package/.output/public/_nuxt/CudFwYib.js +1 -0
  99. package/.output/public/_nuxt/{BDzgwa52.js → CufHLc7y.js} +1 -1
  100. package/.output/public/_nuxt/CwoSXNpI.js +1 -0
  101. package/.output/public/_nuxt/CxEW7TG8.js +1 -0
  102. package/.output/public/_nuxt/CxLEBnE3.js +1 -0
  103. package/.output/public/_nuxt/{DNrj_gVY.js → CxbxFI8M.js} +1 -1
  104. package/.output/public/_nuxt/CzSiA7V6.js +1 -0
  105. package/.output/public/_nuxt/D-wGZMZP.js +1 -0
  106. package/.output/public/_nuxt/D27ZAKIj.js +1 -0
  107. package/.output/public/_nuxt/D2aToa54.js +1 -0
  108. package/.output/public/_nuxt/D2obegTF.js +1 -0
  109. package/.output/public/_nuxt/{NleAzG8P.js → D4_iv3hh.js} +1 -1
  110. package/.output/public/_nuxt/D53aC0YG.js +1 -0
  111. package/.output/public/_nuxt/D5z-4QVk.js +1 -0
  112. package/.output/public/_nuxt/D6fh7rEe.js +2 -0
  113. package/.output/public/_nuxt/D87Tk5Gz.js +1 -0
  114. package/.output/public/_nuxt/D8_7TLub.js +1 -0
  115. package/.output/public/_nuxt/D91rOou-.js +13 -0
  116. package/.output/public/_nuxt/DCBCRx0O.js +1 -0
  117. package/.output/public/_nuxt/DCR009rv.js +1 -0
  118. package/.output/public/_nuxt/DCinzvm1.js +1 -0
  119. package/.output/public/_nuxt/DEthMvLe.js +1 -0
  120. package/.output/public/_nuxt/DFWUc33u.js +1 -0
  121. package/.output/public/_nuxt/{5bLW0GMw.js → DGP4VlC8.js} +1 -1
  122. package/.output/public/_nuxt/{CnK8MTSM.js → DHQR4-dF.js} +1 -1
  123. package/.output/public/_nuxt/DJN0y8jO.js +1 -0
  124. package/.output/public/_nuxt/DJjDtW9f.js +1 -0
  125. package/.output/public/_nuxt/DKhcu7kD.js +1 -0
  126. package/.output/public/_nuxt/DMwsHuHA.js +1 -0
  127. package/.output/public/_nuxt/{GAB5JH5K.js → DNqd6Nek.js} +1 -1
  128. package/.output/public/_nuxt/DOMRsNpU.js +1 -0
  129. package/.output/public/_nuxt/DOPqH6_T.js +1 -0
  130. package/.output/public/_nuxt/DQHHT9y-.js +1 -0
  131. package/.output/public/_nuxt/{B5ZR69Tn.js → DQwYQDb2.js} +1 -1
  132. package/.output/public/_nuxt/DQyhUUbL.js +1 -0
  133. package/.output/public/_nuxt/DRfxs3PN.js +1 -0
  134. package/.output/public/_nuxt/{DPcUKYIF.js → DRw_LuNl.js} +1 -1
  135. package/.output/public/_nuxt/DV7GczEv.js +1 -0
  136. package/.output/public/_nuxt/DWQRqdcR.js +1 -0
  137. package/.output/public/_nuxt/DWa2aw6r.js +1 -0
  138. package/.output/public/_nuxt/DYoxhk2S.js +1 -0
  139. package/.output/public/_nuxt/DZf3V79B.js +1 -0
  140. package/.output/public/_nuxt/{BPzJO5Oe.js → DZu-aV2c.js} +1 -1
  141. package/.output/public/_nuxt/Dbwml2gB.js +1 -0
  142. package/.output/public/_nuxt/DfvKjH24.js +1 -0
  143. package/.output/public/_nuxt/{Cdx7mHEO.js → DhmSosst.js} +1 -1
  144. package/.output/public/_nuxt/DiTMzCP2.js +1 -0
  145. package/.output/public/_nuxt/{CA7CTBwS.js → Dph4kLrZ.js} +1 -1
  146. package/.output/public/_nuxt/DqQDbK_p.js +1 -0
  147. package/.output/public/_nuxt/DsS90Fp6.js +1 -0
  148. package/.output/public/_nuxt/Dspwwk_N.js +1 -0
  149. package/.output/public/_nuxt/DsumFeuD.js +1 -0
  150. package/.output/public/_nuxt/DxERyYWQ.js +1 -0
  151. package/.output/public/_nuxt/{D7ScPSBf.js → DxNHbxmM.js} +1 -1
  152. package/.output/public/_nuxt/{CLvts2aQ.js → DxSwrfjg.js} +1 -1
  153. package/.output/public/_nuxt/{DcmvOc98.js → DyMmfYiE.js} +1 -1
  154. package/.output/public/_nuxt/DzWdbJvx.js +1 -0
  155. package/.output/public/_nuxt/{COEtLSDF.js → Dzze3sRP.js} +1 -1
  156. package/.output/public/_nuxt/G13IRnB2.js +1 -0
  157. package/.output/public/_nuxt/GDxZ_Nvm.js +14 -0
  158. package/.output/public/_nuxt/GgtqCdye.js +1 -0
  159. package/.output/public/_nuxt/{DkhsQLT2.js → GsRaNv29.js} +1 -1
  160. package/.output/public/_nuxt/IF9eRakj.js +1 -0
  161. package/.output/public/_nuxt/RCBWmVHz.js +1 -0
  162. package/.output/public/_nuxt/{Cb0HU5_O.js → RNghxpo_.js} +1 -1
  163. package/.output/public/_nuxt/{SecretValueField.DcyO8gGc.css → SecretValueField.Dy80RlGP.css} +1 -1
  164. package/.output/public/_nuxt/{B8ROHVmM.js → TsXTqZ29.js} +1 -1
  165. package/.output/public/_nuxt/VCDPK7BO.js +1 -0
  166. package/.output/public/_nuxt/{CU27uY9n.js → W9tJ9s81.js} +1 -1
  167. package/.output/public/_nuxt/{CmALWFRB.js → XEA9GSJd.js} +16 -468
  168. package/.output/public/_nuxt/{DeWFVDHI.js → YqXBG_HV.js} +1 -1
  169. package/.output/public/_nuxt/ZbicA1ry.js +1 -0
  170. package/.output/public/_nuxt/_snapshotId_.ChuSNeNY.css +1 -0
  171. package/.output/public/_nuxt/builds/latest.json +1 -1
  172. package/.output/public/_nuxt/builds/meta/a1fec520-0c95-4ae0-af5e-964780fad341.json +1 -0
  173. package/.output/public/_nuxt/d-NZQb9b.js +1 -0
  174. package/.output/public/_nuxt/edge-router-BdPMCV6u.js +1 -0
  175. package/.output/public/_nuxt/{entry.dxugZJXl.css → entry.Bc0aTA0K.css} +1 -1
  176. package/.output/public/_nuxt/error-404.X7H_YhdC.css +1 -0
  177. package/.output/public/_nuxt/error-500.BOQe1fsk.css +1 -0
  178. package/.output/public/_nuxt/f3TOpYbw.js +1 -0
  179. package/.output/public/_nuxt/{DrZfEa88.js → fKv21gyL.js} +1 -1
  180. package/.output/public/_nuxt/graph-layout-B7wl80r3.js +1 -0
  181. package/.output/public/_nuxt/graph-resolver-DKNtntr2.js +180 -0
  182. package/.output/public/_nuxt/{CGqH5EJj.js → hJgmCMqR.js} +1 -1
  183. package/.output/public/_nuxt/{BoKiGodi.js → k_qm7-4y.js} +1 -1
  184. package/.output/public/_nuxt/{IvJ92aGK.js → m17aaUwq.js} +1 -1
  185. package/.output/public/_nuxt/mUFnM-_q.js +1 -0
  186. package/.output/public/_nuxt/mWjccvbQ.js +1 -0
  187. package/.output/public/_nuxt/{BXY8tDGw.js → mjskCLCv.js} +1 -1
  188. package/.output/public/_nuxt/n0RAZLbO.js +1 -0
  189. package/.output/public/_nuxt/n2N0HUVH.js +1 -0
  190. package/.output/public/_nuxt/o_m1mZtJ.js +6 -0
  191. package/.output/public/_nuxt/pxXmJ8QX.js +1 -0
  192. package/.output/public/_nuxt/{BHrmToEH.js → qdsjHGoJ.js} +1 -1
  193. package/.output/public/_nuxt/{BbcW6ACK.js → rGO070M0.js} +1 -1
  194. package/.output/public/_nuxt/rcFevLEP.js +2 -0
  195. package/.output/public/_nuxt/rgN_MdZl.js +1 -0
  196. package/.output/public/_nuxt/tsyQDnRt.js +5 -0
  197. package/.output/public/_nuxt/u5AG7uiY.js +1 -0
  198. package/.output/public/_nuxt/uYugtg8r.js +1 -0
  199. package/.output/public/_nuxt/vuetify.BzdWZaIq.css +1 -0
  200. package/.output/public/_nuxt/{BMMyXqK5.js → wDzz0qaB.js} +1 -1
  201. package/.output/public/_nuxt/xA6NntuA.js +1 -0
  202. package/.output/public/_nuxt/xdsXwj_J.js +1 -0
  203. package/.output/public/_nuxt/xp27HhqZ.js +1 -0
  204. package/.output/public/_nuxt/xrNU8mHG.js +3 -0
  205. package/.output/public/_nuxt/yaml.worker-C1Cl1y5J.js +399 -0
  206. package/.output/public/_nuxt/ziXKbM2N.js +1 -0
  207. package/.output/public/libavoid.wasm +0 -0
  208. package/.output/server/index.mjs +2213 -6830
  209. package/.output/server/index.mjs.map +1 -1
  210. package/.output/server/node_modules/@babel/parser/lib/index.js +427 -440
  211. package/.output/server/node_modules/@babel/parser/package.json +6 -6
  212. package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +4 -4
  213. package/.output/server/node_modules/@trpc/server/dist/adapters/ws.mjs +10 -10
  214. package/.output/server/node_modules/@trpc/server/dist/{utils-CLZnJdb_.mjs → codes-DagpWZLc.mjs} +66 -66
  215. package/.output/server/node_modules/@trpc/server/dist/{getErrorShape-BH60iMC2.mjs → getErrorShape-vC8mUXJD.mjs} +3 -3
  216. package/.output/server/node_modules/@trpc/server/dist/index.mjs +4 -4
  217. package/.output/server/node_modules/@trpc/server/dist/{initTRPC-CB9uBez5.mjs → initTRPC-RoZMIBeA.mjs} +4 -4
  218. package/.output/server/node_modules/@trpc/server/dist/{node-http-8dtdvMrE.mjs → node-http-DtA2iLK9.mjs} +7 -5
  219. package/.output/server/node_modules/@trpc/server/dist/{parseTRPCMessage-BlZeZ60t.mjs → parseTRPCMessage-CTow-umk.mjs} +2 -2
  220. package/.output/server/node_modules/@trpc/server/dist/{resolveResponse-DngSgha6.mjs → resolveResponse-BVDlNZwN.mjs} +45 -48
  221. package/.output/server/node_modules/@trpc/server/dist/{tracked-Blz8XOf1.mjs → tracked-Bjtgv3wJ.mjs} +11 -9
  222. package/.output/server/node_modules/@trpc/server/dist/{unstable-core-do-not-import-D89CaGtL.mjs → unstable-core-do-not-import-9NNw8uQM.mjs} +5 -3
  223. package/.output/server/node_modules/@trpc/server/dist/{ws-BR20IWki.mjs → ws-CJgZE7Hg.mjs} +60 -20
  224. package/.output/server/node_modules/@trpc/server/package.json +6 -6
  225. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +128 -106
  226. package/.output/server/node_modules/@vue/compiler-core/package.json +5 -5
  227. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +54 -54
  228. package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
  229. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +35 -33
  230. package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
  231. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +105 -42
  232. package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
  233. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +2129 -2063
  234. package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
  235. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +78 -31
  236. package/.output/server/node_modules/@vue/runtime-dom/package.json +5 -5
  237. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +6 -6
  238. package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
  239. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
  240. package/.output/server/node_modules/@vue/shared/package.json +1 -1
  241. package/.output/server/node_modules/copy-anything/dist/index.js +47 -31
  242. package/.output/server/node_modules/copy-anything/package.json +19 -72
  243. package/.output/server/node_modules/devalue/index.js +1 -0
  244. package/.output/server/node_modules/devalue/package.json +2 -2
  245. package/.output/server/node_modules/devalue/src/constants.js +1 -0
  246. package/.output/server/node_modules/devalue/src/parse.js +55 -4
  247. package/.output/server/node_modules/devalue/src/stringify.js +101 -12
  248. package/.output/server/node_modules/devalue/src/uneval.js +100 -13
  249. package/.output/server/node_modules/devalue/src/utils.js +35 -1
  250. package/.output/server/node_modules/entities/{lib/decode_codepoint.js → dist/commonjs/decode-codepoint.js} +16 -15
  251. package/.output/server/node_modules/entities/{lib → dist/commonjs}/decode.js +200 -168
  252. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  253. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  254. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  255. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  256. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  257. package/.output/server/node_modules/entities/package.json +99 -69
  258. package/.output/server/node_modules/hookable/dist/index.mjs +244 -268
  259. package/.output/server/node_modules/hookable/package.json +29 -26
  260. package/.output/server/node_modules/is-what/dist/getType.js +4 -0
  261. package/.output/server/node_modules/is-what/dist/index.js +43 -171
  262. package/.output/server/node_modules/is-what/dist/isAnyObject.js +8 -0
  263. package/.output/server/node_modules/is-what/dist/isArray.js +5 -0
  264. package/.output/server/node_modules/is-what/dist/isBigInt.js +5 -0
  265. package/.output/server/node_modules/is-what/dist/isBlob.js +5 -0
  266. package/.output/server/node_modules/is-what/dist/isBoolean.js +5 -0
  267. package/.output/server/node_modules/is-what/dist/isDate.js +5 -0
  268. package/.output/server/node_modules/is-what/dist/isEmptyArray.js +5 -0
  269. package/.output/server/node_modules/is-what/dist/isEmptyObject.js +8 -0
  270. package/.output/server/node_modules/is-what/dist/isEmptyString.js +4 -0
  271. package/.output/server/node_modules/is-what/dist/isError.js +5 -0
  272. package/.output/server/node_modules/is-what/dist/isFile.js +5 -0
  273. package/.output/server/node_modules/is-what/dist/isFullArray.js +5 -0
  274. package/.output/server/node_modules/is-what/dist/isFullObject.js +8 -0
  275. package/.output/server/node_modules/is-what/dist/isFullString.js +5 -0
  276. package/.output/server/node_modules/is-what/dist/isFunction.js +4 -0
  277. package/.output/server/node_modules/is-what/dist/isHexDecimal.js +12 -0
  278. package/.output/server/node_modules/is-what/dist/isInstanceOf.js +19 -0
  279. package/.output/server/node_modules/is-what/dist/isInteger.js +5 -0
  280. package/.output/server/node_modules/is-what/dist/isIterable.js +16 -0
  281. package/.output/server/node_modules/is-what/dist/isMap.js +5 -0
  282. package/.output/server/node_modules/is-what/dist/isNaNValue.js +5 -0
  283. package/.output/server/node_modules/is-what/dist/isNegativeInteger.js +5 -0
  284. package/.output/server/node_modules/is-what/dist/isNegativeNumber.js +5 -0
  285. package/.output/server/node_modules/is-what/dist/isNull.js +5 -0
  286. package/.output/server/node_modules/is-what/dist/isNullOrUndefined.js +5 -0
  287. package/.output/server/node_modules/is-what/dist/isNumber.js +9 -0
  288. package/.output/server/node_modules/is-what/dist/isObject.js +8 -0
  289. package/.output/server/node_modules/is-what/dist/isObjectLike.js +11 -0
  290. package/.output/server/node_modules/is-what/dist/isOneOf.js +15 -0
  291. package/.output/server/node_modules/is-what/dist/isPlainObject.js +11 -0
  292. package/.output/server/node_modules/is-what/dist/isPositiveInteger.js +5 -0
  293. package/.output/server/node_modules/is-what/dist/isPositiveNumber.js +5 -0
  294. package/.output/server/node_modules/is-what/dist/isPrimitive.js +21 -0
  295. package/.output/server/node_modules/is-what/dist/isPromise.js +5 -0
  296. package/.output/server/node_modules/is-what/dist/isRegExp.js +5 -0
  297. package/.output/server/node_modules/is-what/dist/isSet.js +5 -0
  298. package/.output/server/node_modules/is-what/dist/isString.js +5 -0
  299. package/.output/server/node_modules/is-what/dist/isSymbol.js +5 -0
  300. package/.output/server/node_modules/is-what/dist/isType.js +20 -0
  301. package/.output/server/node_modules/is-what/dist/isUndefined.js +5 -0
  302. package/.output/server/node_modules/is-what/dist/isWeakMap.js +5 -0
  303. package/.output/server/node_modules/is-what/dist/isWeakSet.js +5 -0
  304. package/.output/server/node_modules/is-what/package.json +23 -88
  305. package/.output/server/node_modules/superjson/dist/index.js +9 -6
  306. package/.output/server/node_modules/superjson/dist/pathstringifier.js +13 -2
  307. package/.output/server/node_modules/superjson/dist/plainer.js +23 -11
  308. package/.output/server/node_modules/superjson/dist/transformer.js +4 -1
  309. package/.output/server/node_modules/superjson/package.json +5 -21
  310. package/.output/server/node_modules/ufo/dist/index.mjs +16 -9
  311. package/.output/server/node_modules/ufo/package.json +15 -14
  312. package/.output/server/node_modules/unhead/dist/plugins.mjs +2 -2
  313. package/.output/server/node_modules/unhead/dist/server.mjs +4 -6
  314. package/.output/server/node_modules/unhead/dist/shared/{unhead.DH45uomy.mjs → unhead.BFfcxOoW.mjs} +3 -3
  315. package/.output/server/node_modules/unhead/dist/shared/{unhead.DZbvapt-.mjs → unhead.CbpEuj3y.mjs} +3 -2
  316. package/.output/server/node_modules/unhead/dist/shared/{unhead.Djo8ep_Y.mjs → unhead.ckV6dpEQ.mjs} +1 -1
  317. package/.output/server/node_modules/unhead/dist/shared/{unhead.BpRRHAhY.mjs → unhead.eK9_7LaY.mjs} +16 -12
  318. package/.output/server/node_modules/unhead/dist/utils.mjs +2 -2
  319. package/.output/server/node_modules/unhead/package.json +2 -2
  320. package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
  321. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
  322. package/.output/server/node_modules/vue/package.json +6 -6
  323. package/.output/server/node_modules/ws/lib/constants.js +1 -0
  324. package/.output/server/node_modules/ws/lib/websocket-server.js +5 -1
  325. package/.output/server/node_modules/ws/lib/websocket.js +13 -8
  326. package/.output/server/node_modules/ws/package.json +1 -1
  327. package/.output/server/node_modules/zod/package.json +1 -1
  328. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -1
  329. package/.output/server/node_modules/zod/v4/classic/external.js +3 -1
  330. package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
  331. package/.output/server/node_modules/zod/v4/classic/schemas.js +121 -4
  332. package/.output/server/node_modules/zod/v4/core/api.js +157 -0
  333. package/.output/server/node_modules/zod/v4/core/checks.js +8 -2
  334. package/.output/server/node_modules/zod/v4/core/core.js +20 -11
  335. package/.output/server/node_modules/zod/v4/core/index.js +2 -0
  336. package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  337. package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
  338. package/.output/server/node_modules/zod/v4/core/regexes.js +8 -2
  339. package/.output/server/node_modules/zod/v4/core/registries.js +3 -4
  340. package/.output/server/node_modules/zod/v4/core/schemas.js +204 -66
  341. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +391 -869
  342. package/.output/server/node_modules/zod/v4/core/util.js +58 -8
  343. package/.output/server/node_modules/zod/v4/core/versions.js +2 -2
  344. package/.output/server/node_modules/zod/v4/locales/ar.js +14 -24
  345. package/.output/server/node_modules/zod/v4/locales/az.js +14 -24
  346. package/.output/server/node_modules/zod/v4/locales/be.js +16 -24
  347. package/.output/server/node_modules/zod/v4/locales/bg.js +16 -24
  348. package/.output/server/node_modules/zod/v4/locales/ca.js +14 -25
  349. package/.output/server/node_modules/zod/v4/locales/cs.js +18 -42
  350. package/.output/server/node_modules/zod/v4/locales/da.js +23 -39
  351. package/.output/server/node_modules/zod/v4/locales/de.js +16 -24
  352. package/.output/server/node_modules/zod/v4/locales/en.js +16 -24
  353. package/.output/server/node_modules/zod/v4/locales/eo.js +17 -24
  354. package/.output/server/node_modules/zod/v4/locales/es.js +42 -59
  355. package/.output/server/node_modules/zod/v4/locales/fa.js +16 -24
  356. package/.output/server/node_modules/zod/v4/locales/fi.js +14 -24
  357. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +14 -24
  358. package/.output/server/node_modules/zod/v4/locales/fr.js +16 -24
  359. package/.output/server/node_modules/zod/v4/locales/he.js +175 -78
  360. package/.output/server/node_modules/zod/v4/locales/hu.js +16 -25
  361. package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
  362. package/.output/server/node_modules/zod/v4/locales/id.js +14 -24
  363. package/.output/server/node_modules/zod/v4/locales/index.js +2 -0
  364. package/.output/server/node_modules/zod/v4/locales/is.js +16 -24
  365. package/.output/server/node_modules/zod/v4/locales/it.js +16 -25
  366. package/.output/server/node_modules/zod/v4/locales/ja.js +16 -24
  367. package/.output/server/node_modules/zod/v4/locales/ka.js +19 -32
  368. package/.output/server/node_modules/zod/v4/locales/km.js +17 -24
  369. package/.output/server/node_modules/zod/v4/locales/ko.js +14 -24
  370. package/.output/server/node_modules/zod/v4/locales/lt.js +27 -54
  371. package/.output/server/node_modules/zod/v4/locales/mk.js +16 -25
  372. package/.output/server/node_modules/zod/v4/locales/ms.js +15 -24
  373. package/.output/server/node_modules/zod/v4/locales/nl.js +25 -32
  374. package/.output/server/node_modules/zod/v4/locales/no.js +16 -24
  375. package/.output/server/node_modules/zod/v4/locales/ota.js +17 -25
  376. package/.output/server/node_modules/zod/v4/locales/pl.js +16 -24
  377. package/.output/server/node_modules/zod/v4/locales/ps.js +16 -24
  378. package/.output/server/node_modules/zod/v4/locales/pt.js +16 -24
  379. package/.output/server/node_modules/zod/v4/locales/ru.js +16 -24
  380. package/.output/server/node_modules/zod/v4/locales/sl.js +16 -24
  381. package/.output/server/node_modules/zod/v4/locales/sv.js +16 -24
  382. package/.output/server/node_modules/zod/v4/locales/ta.js +17 -24
  383. package/.output/server/node_modules/zod/v4/locales/th.js +17 -24
  384. package/.output/server/node_modules/zod/v4/locales/tr.js +14 -24
  385. package/.output/server/node_modules/zod/v4/locales/uk.js +16 -25
  386. package/.output/server/node_modules/zod/v4/locales/ur.js +17 -24
  387. package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
  388. package/.output/server/node_modules/zod/v4/locales/vi.js +16 -24
  389. package/.output/server/node_modules/zod/v4/locales/yo.js +16 -24
  390. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +17 -24
  391. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +14 -24
  392. package/.output/server/package.json +22 -22
  393. package/package.json +6 -6
  394. package/.output/public/_nuxt/-oaD50UK.js +0 -1
  395. package/.output/public/_nuxt/0ekw3e2V.js +0 -1
  396. package/.output/public/_nuxt/1f5tAgHw.js +0 -1
  397. package/.output/public/_nuxt/5ggY4uig.js +0 -1
  398. package/.output/public/_nuxt/6nHXG8SA.js +0 -1
  399. package/.output/public/_nuxt/9hmcqHPO.js +0 -1
  400. package/.output/public/_nuxt/BBxmzUt6.js +0 -1
  401. package/.output/public/_nuxt/BE2KfCdU.js +0 -1
  402. package/.output/public/_nuxt/BFNM2w_f.js +0 -1
  403. package/.output/public/_nuxt/BGLu70Yq.js +0 -1
  404. package/.output/public/_nuxt/BIuj43Wh.js +0 -1
  405. package/.output/public/_nuxt/BLsOQd1H.js +0 -280
  406. package/.output/public/_nuxt/BNGfscqk.js +0 -1
  407. package/.output/public/_nuxt/BQvybpQq.js +0 -1
  408. package/.output/public/_nuxt/BU7Cl-8B.js +0 -1
  409. package/.output/public/_nuxt/BUXOnL59.js +0 -1
  410. package/.output/public/_nuxt/Bbwybh3N.js +0 -2
  411. package/.output/public/_nuxt/BczD6j-v.js +0 -1
  412. package/.output/public/_nuxt/BepWV7mh.js +0 -1
  413. package/.output/public/_nuxt/Bh0qehhp.js +0 -1
  414. package/.output/public/_nuxt/Bl2oy6fF.js +0 -1
  415. package/.output/public/_nuxt/BmDdxTjo.js +0 -1
  416. package/.output/public/_nuxt/BqeRdtD4.js +0 -2
  417. package/.output/public/_nuxt/BvAqAH-y.js +0 -1
  418. package/.output/public/_nuxt/BxZD33h1.js +0 -1
  419. package/.output/public/_nuxt/C4zpeTvm.js +0 -1
  420. package/.output/public/_nuxt/C7Pw0Ztw.js +0 -1
  421. package/.output/public/_nuxt/C8-UwF3o.js +0 -1
  422. package/.output/public/_nuxt/CCd08HS_.js +0 -1
  423. package/.output/public/_nuxt/CEYFgC8B.js +0 -1
  424. package/.output/public/_nuxt/CHadp7IV.js +0 -1
  425. package/.output/public/_nuxt/CHh-QcGE.js +0 -1
  426. package/.output/public/_nuxt/CIUZ1G5V.js +0 -1
  427. package/.output/public/_nuxt/CJ6lOLXp.js +0 -1
  428. package/.output/public/_nuxt/CN9dMhDM.js +0 -1
  429. package/.output/public/_nuxt/CQ4fj8p0.js +0 -1
  430. package/.output/public/_nuxt/CTWiQX6C.js +0 -1
  431. package/.output/public/_nuxt/CXxzV4dz.js +0 -1
  432. package/.output/public/_nuxt/CZlF05X6.js +0 -1
  433. package/.output/public/_nuxt/CatV_12G.js +0 -1
  434. package/.output/public/_nuxt/CeMkeBDb.js +0 -1
  435. package/.output/public/_nuxt/CelvVQyk.js +0 -1
  436. package/.output/public/_nuxt/CfV455SO.js +0 -1
  437. package/.output/public/_nuxt/CfeIJUat.js +0 -1
  438. package/.output/public/_nuxt/CfqrF6sE.js +0 -1
  439. package/.output/public/_nuxt/Cfs9EX91.js +0 -1
  440. package/.output/public/_nuxt/ChH_ziBE.js +0 -1
  441. package/.output/public/_nuxt/ChM1GEGa.js +0 -1
  442. package/.output/public/_nuxt/Cu8OsqJL.js +0 -1
  443. package/.output/public/_nuxt/CusJppg0.js +0 -1
  444. package/.output/public/_nuxt/Cv9koXgw.js +0 -1
  445. package/.output/public/_nuxt/CvELRi2k.js +0 -5
  446. package/.output/public/_nuxt/Cw6nGM9K.js +0 -1
  447. package/.output/public/_nuxt/CwUT5n6w.js +0 -1
  448. package/.output/public/_nuxt/D-AHKB2i.js +0 -6
  449. package/.output/public/_nuxt/D-kcn2fr.js +0 -1
  450. package/.output/public/_nuxt/D08WgyRC.js +0 -1
  451. package/.output/public/_nuxt/D1Jbgd7O.js +0 -13
  452. package/.output/public/_nuxt/D1ibY74j.js +0 -1
  453. package/.output/public/_nuxt/D22FLkUw.js +0 -1
  454. package/.output/public/_nuxt/D2CYqzqI.js +0 -1
  455. package/.output/public/_nuxt/D34EmFco.js +0 -1
  456. package/.output/public/_nuxt/D4OhWExI.js +0 -1
  457. package/.output/public/_nuxt/DDHikT5j.js +0 -1
  458. package/.output/public/_nuxt/DDTT3lYc.js +0 -1
  459. package/.output/public/_nuxt/DHLkt8Yr.js +0 -1
  460. package/.output/public/_nuxt/DHuTDtaT.js +0 -12
  461. package/.output/public/_nuxt/DKYwYmdq.js +0 -1
  462. package/.output/public/_nuxt/DMDPKkZ0.js +0 -1
  463. package/.output/public/_nuxt/DNEoBllO.js +0 -1
  464. package/.output/public/_nuxt/DRzH1pOL.js +0 -1
  465. package/.output/public/_nuxt/DSUF3NDE.js +0 -1
  466. package/.output/public/_nuxt/DTAwr92a.js +0 -1
  467. package/.output/public/_nuxt/DWmtspXK.js +0 -1
  468. package/.output/public/_nuxt/DXh9HyqW.js +0 -1
  469. package/.output/public/_nuxt/DXtl0MQI.js +0 -1
  470. package/.output/public/_nuxt/D_zCY0Xl.js +0 -1
  471. package/.output/public/_nuxt/DaZJpzOl.js +0 -1
  472. package/.output/public/_nuxt/Df68jz8_.js +0 -1
  473. package/.output/public/_nuxt/DhQfdAdO.js +0 -1
  474. package/.output/public/_nuxt/DiinP2Uv.js +0 -1
  475. package/.output/public/_nuxt/DljmTZ5-.js +0 -1
  476. package/.output/public/_nuxt/Dm4QKadl.js +0 -26
  477. package/.output/public/_nuxt/DmCK90gL.js +0 -1
  478. package/.output/public/_nuxt/Dn2_MT6a.js +0 -1
  479. package/.output/public/_nuxt/Don94nLk.js +0 -1
  480. package/.output/public/_nuxt/Dr8Zlu6v.js +0 -1
  481. package/.output/public/_nuxt/Drp5UXmf.js +0 -1
  482. package/.output/public/_nuxt/DtFoCuZo.js +0 -1
  483. package/.output/public/_nuxt/DxuitVdg.js +0 -2
  484. package/.output/public/_nuxt/DyJlTyXw.js +0 -1
  485. package/.output/public/_nuxt/Jep7L2Wt.js +0 -1
  486. package/.output/public/_nuxt/LUl67wzp.js +0 -1
  487. package/.output/public/_nuxt/M2rHlmBj.js +0 -1
  488. package/.output/public/_nuxt/N3RVRbLb.js +0 -1
  489. package/.output/public/_nuxt/NBseiqgx.js +0 -1
  490. package/.output/public/_nuxt/PoHY5YXO.js +0 -1
  491. package/.output/public/_nuxt/SdwduGaY.js +0 -1
  492. package/.output/public/_nuxt/SytC7lKg.js +0 -1
  493. package/.output/public/_nuxt/U3pqMjXV.js +0 -1
  494. package/.output/public/_nuxt/UInuXPgp.js +0 -1
  495. package/.output/public/_nuxt/YXI84j39.js +0 -2
  496. package/.output/public/_nuxt/ZZ6g6dXy.js +0 -2
  497. package/.output/public/_nuxt/builds/meta/033f259e-8ba9-4c82-8824-56febea80b7d.json +0 -1
  498. package/.output/public/_nuxt/dglhsJpM.js +0 -1
  499. package/.output/public/_nuxt/dwrHE3tM.js +0 -14
  500. package/.output/public/_nuxt/edge-router-yEORMNQw.js +0 -4
  501. package/.output/public/_nuxt/error-404.CttAF9VE.css +0 -1
  502. package/.output/public/_nuxt/error-500.DXXd6-x4.css +0 -1
  503. package/.output/public/_nuxt/ga9TZ2z5.js +0 -1
  504. package/.output/public/_nuxt/graph-layout-CFj469YF.js +0 -1
  505. package/.output/public/_nuxt/graph-resolver-eG1ZUsYn.js +0 -166
  506. package/.output/public/_nuxt/ov4D99rA.js +0 -1
  507. package/.output/public/_nuxt/qYU5Tabh.js +0 -1
  508. package/.output/public/_nuxt/qliWkHmV.js +0 -1
  509. package/.output/public/_nuxt/vuetify.BrkCt9t5.css +0 -5
  510. package/.output/public/_nuxt/yaml.worker-CQ6dFw39.js +0 -405
  511. package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +0 -9
  512. package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.22
2
+ * @vue/runtime-core v3.5.28
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -376,7 +376,143 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
376
376
  }
377
377
  }
378
378
 
379
- const TeleportEndKey = Symbol("_vte");
379
+ function provide(key, value) {
380
+ if (currentInstance) {
381
+ let provides = currentInstance.provides;
382
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
383
+ if (parentProvides === provides) {
384
+ provides = currentInstance.provides = Object.create(parentProvides);
385
+ }
386
+ provides[key] = value;
387
+ }
388
+ }
389
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
390
+ const instance = getCurrentInstance();
391
+ if (instance || currentApp) {
392
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
393
+ if (provides && key in provides) {
394
+ return provides[key];
395
+ } else if (arguments.length > 1) {
396
+ return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
397
+ } else ;
398
+ }
399
+ }
400
+ function hasInjectionContext() {
401
+ return !!(getCurrentInstance() || currentApp);
402
+ }
403
+
404
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
405
+ const useSSRContext = () => {
406
+ {
407
+ const ctx = inject(ssrContextKey);
408
+ return ctx;
409
+ }
410
+ };
411
+
412
+ function watchEffect(effect, options) {
413
+ return doWatch(effect, null, options);
414
+ }
415
+ function watchPostEffect(effect, options) {
416
+ return doWatch(
417
+ effect,
418
+ null,
419
+ { flush: "post" }
420
+ );
421
+ }
422
+ function watchSyncEffect(effect, options) {
423
+ return doWatch(
424
+ effect,
425
+ null,
426
+ { flush: "sync" }
427
+ );
428
+ }
429
+ function watch(source, cb, options) {
430
+ return doWatch(source, cb, options);
431
+ }
432
+ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
433
+ const { immediate, deep, flush, once } = options;
434
+ const baseWatchOptions = shared.extend({}, options);
435
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
436
+ let ssrCleanup;
437
+ if (isInSSRComponentSetup) {
438
+ if (flush === "sync") {
439
+ const ctx = useSSRContext();
440
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
441
+ } else if (!runsImmediately) {
442
+ const watchStopHandle = () => {
443
+ };
444
+ watchStopHandle.stop = shared.NOOP;
445
+ watchStopHandle.resume = shared.NOOP;
446
+ watchStopHandle.pause = shared.NOOP;
447
+ return watchStopHandle;
448
+ }
449
+ }
450
+ const instance = currentInstance;
451
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
452
+ let isPre = false;
453
+ if (flush === "post") {
454
+ baseWatchOptions.scheduler = (job) => {
455
+ queuePostRenderEffect(job, instance && instance.suspense);
456
+ };
457
+ } else if (flush !== "sync") {
458
+ isPre = true;
459
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
460
+ if (isFirstRun) {
461
+ job();
462
+ } else {
463
+ queueJob(job);
464
+ }
465
+ };
466
+ }
467
+ baseWatchOptions.augmentJob = (job) => {
468
+ if (cb) {
469
+ job.flags |= 4;
470
+ }
471
+ if (isPre) {
472
+ job.flags |= 2;
473
+ if (instance) {
474
+ job.id = instance.uid;
475
+ job.i = instance;
476
+ }
477
+ }
478
+ };
479
+ const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
480
+ if (isInSSRComponentSetup) {
481
+ if (ssrCleanup) {
482
+ ssrCleanup.push(watchHandle);
483
+ } else if (runsImmediately) {
484
+ watchHandle();
485
+ }
486
+ }
487
+ return watchHandle;
488
+ }
489
+ function instanceWatch(source, value, options) {
490
+ const publicThis = this.proxy;
491
+ const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
492
+ let cb;
493
+ if (shared.isFunction(value)) {
494
+ cb = value;
495
+ } else {
496
+ cb = value.handler;
497
+ options = value;
498
+ }
499
+ const reset = setCurrentInstance(this);
500
+ const res = doWatch(getter, cb.bind(publicThis), options);
501
+ reset();
502
+ return res;
503
+ }
504
+ function createPathGetter(ctx, path) {
505
+ const segments = path.split(".");
506
+ return () => {
507
+ let cur = ctx;
508
+ for (let i = 0; i < segments.length && cur; i++) {
509
+ cur = cur[segments[i]];
510
+ }
511
+ return cur;
512
+ };
513
+ }
514
+
515
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
380
516
  const isTeleport = (type) => type.__isTeleport;
381
517
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
382
518
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -614,7 +750,22 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
614
750
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
615
751
  o: { nextSibling, parentNode, querySelector, insert, createText }
616
752
  }, hydrateChildren) {
617
- function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
753
+ function hydrateAnchor(target2, targetNode) {
754
+ let targetAnchor = targetNode;
755
+ while (targetAnchor) {
756
+ if (targetAnchor && targetAnchor.nodeType === 8) {
757
+ if (targetAnchor.data === "teleport start anchor") {
758
+ vnode.targetStart = targetAnchor;
759
+ } else if (targetAnchor.data === "teleport anchor") {
760
+ vnode.targetAnchor = targetAnchor;
761
+ target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
762
+ break;
763
+ }
764
+ }
765
+ targetAnchor = nextSibling(targetAnchor);
766
+ }
767
+ }
768
+ function hydrateDisabledTeleport(node2, vnode2) {
618
769
  vnode2.anchor = hydrateChildren(
619
770
  nextSibling(node2),
620
771
  vnode2,
@@ -624,8 +775,6 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
624
775
  slotScopeIds,
625
776
  optimized
626
777
  );
627
- vnode2.targetStart = targetStart;
628
- vnode2.targetAnchor = targetAnchor;
629
778
  }
630
779
  const target = vnode.target = resolveTarget(
631
780
  vnode.props,
@@ -636,27 +785,22 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
636
785
  const targetNode = target._lpa || target.firstChild;
637
786
  if (vnode.shapeFlag & 16) {
638
787
  if (disabled) {
639
- hydrateDisabledTeleport(
640
- node,
641
- vnode,
642
- targetNode,
643
- targetNode && nextSibling(targetNode)
644
- );
788
+ hydrateDisabledTeleport(node, vnode);
789
+ hydrateAnchor(target, targetNode);
790
+ if (!vnode.targetAnchor) {
791
+ prepareAnchor(
792
+ target,
793
+ vnode,
794
+ createText,
795
+ insert,
796
+ // if target is the same as the main view, insert anchors before current node
797
+ // to avoid hydrating mismatch
798
+ parentNode(node) === target ? node : null
799
+ );
800
+ }
645
801
  } else {
646
802
  vnode.anchor = nextSibling(node);
647
- let targetAnchor = targetNode;
648
- while (targetAnchor) {
649
- if (targetAnchor && targetAnchor.nodeType === 8) {
650
- if (targetAnchor.data === "teleport start anchor") {
651
- vnode.targetStart = targetAnchor;
652
- } else if (targetAnchor.data === "teleport anchor") {
653
- vnode.targetAnchor = targetAnchor;
654
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
655
- break;
656
- }
657
- }
658
- targetAnchor = nextSibling(targetAnchor);
659
- }
803
+ hydrateAnchor(target, targetNode);
660
804
  if (!vnode.targetAnchor) {
661
805
  prepareAnchor(target, vnode, createText, insert);
662
806
  }
@@ -674,7 +818,9 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
674
818
  updateCssVars(vnode, disabled);
675
819
  } else if (disabled) {
676
820
  if (vnode.shapeFlag & 16) {
677
- hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
821
+ hydrateDisabledTeleport(node, vnode);
822
+ vnode.targetStart = node;
823
+ vnode.targetAnchor = nextSibling(node);
678
824
  }
679
825
  }
680
826
  return vnode.anchor && nextSibling(vnode.anchor);
@@ -698,19 +844,19 @@ function updateCssVars(vnode, isDisabled) {
698
844
  ctx.ut();
699
845
  }
700
846
  }
701
- function prepareAnchor(target, vnode, createText, insert) {
847
+ function prepareAnchor(target, vnode, createText, insert, anchor = null) {
702
848
  const targetStart = vnode.targetStart = createText("");
703
849
  const targetAnchor = vnode.targetAnchor = createText("");
704
850
  targetStart[TeleportEndKey] = targetAnchor;
705
851
  if (target) {
706
- insert(targetStart, target);
707
- insert(targetAnchor, target);
852
+ insert(targetStart, target, anchor);
853
+ insert(targetAnchor, target, anchor);
708
854
  }
709
855
  return targetAnchor;
710
856
  }
711
857
 
712
- const leaveCbKey = Symbol("_leaveCb");
713
- const enterCbKey = Symbol("_enterCb");
858
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
859
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
714
860
  function useTransitionState() {
715
861
  const state = {
716
862
  isMounted: false,
@@ -929,7 +1075,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
929
1075
  }
930
1076
  }
931
1077
  let called = false;
932
- const done = el[enterCbKey] = (cancelled) => {
1078
+ el[enterCbKey] = (cancelled) => {
933
1079
  if (called) return;
934
1080
  called = true;
935
1081
  if (cancelled) {
@@ -942,6 +1088,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
942
1088
  }
943
1089
  el[enterCbKey] = void 0;
944
1090
  };
1091
+ const done = el[enterCbKey].bind(null, false);
945
1092
  if (hook) {
946
1093
  callAsyncHook(hook, [el, done]);
947
1094
  } else {
@@ -961,7 +1108,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
961
1108
  }
962
1109
  callHook(onBeforeLeave, [el]);
963
1110
  let called = false;
964
- const done = el[leaveCbKey] = (cancelled) => {
1111
+ el[leaveCbKey] = (cancelled) => {
965
1112
  if (called) return;
966
1113
  called = true;
967
1114
  remove();
@@ -975,6 +1122,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
975
1122
  delete leavingVNodesCache[key2];
976
1123
  }
977
1124
  };
1125
+ const done = el[leaveCbKey].bind(null, false);
978
1126
  leavingVNodesCache[key2] = vnode;
979
1127
  if (onLeave) {
980
1128
  callAsyncHook(onLeave, [el, done]);
@@ -1093,6 +1241,10 @@ function useTemplateRef(key) {
1093
1241
  const ret = r;
1094
1242
  return ret;
1095
1243
  }
1244
+ function isTemplateRefKey(refs, key) {
1245
+ let desc;
1246
+ return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
1247
+ }
1096
1248
 
1097
1249
  const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
1098
1250
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
@@ -1122,8 +1274,17 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1122
1274
  const setupState = owner.setupState;
1123
1275
  const rawSetupState = reactivity.toRaw(setupState);
1124
1276
  const canSetSetupRef = setupState === shared.EMPTY_OBJ ? shared.NO : (key) => {
1277
+ if (isTemplateRefKey(refs, key)) {
1278
+ return false;
1279
+ }
1125
1280
  return shared.hasOwn(rawSetupState, key);
1126
1281
  };
1282
+ const canSetRef = (ref2, key) => {
1283
+ if (key && isTemplateRefKey(refs, key)) {
1284
+ return false;
1285
+ }
1286
+ return true;
1287
+ };
1127
1288
  if (oldRef != null && oldRef !== ref) {
1128
1289
  invalidatePendingSetRef(oldRawRef);
1129
1290
  if (shared.isString(oldRef)) {
@@ -1132,10 +1293,10 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1132
1293
  setupState[oldRef] = null;
1133
1294
  }
1134
1295
  } else if (reactivity.isRef(oldRef)) {
1135
- {
1296
+ const oldRawRefAtom = oldRawRef;
1297
+ if (canSetRef(oldRef, oldRawRefAtom.k)) {
1136
1298
  oldRef.value = null;
1137
1299
  }
1138
- const oldRawRefAtom = oldRawRef;
1139
1300
  if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
1140
1301
  }
1141
1302
  }
@@ -1147,7 +1308,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1147
1308
  if (_isString || _isRef) {
1148
1309
  const doSet = () => {
1149
1310
  if (rawRef.f) {
1150
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value ;
1311
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef() || !rawRef.k ? ref.value : refs[rawRef.k];
1151
1312
  if (isUnmount) {
1152
1313
  shared.isArray(existing) && shared.remove(existing, refValue);
1153
1314
  } else {
@@ -1159,7 +1320,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1159
1320
  }
1160
1321
  } else {
1161
1322
  const newVal = [refValue];
1162
- {
1323
+ if (canSetRef(ref, rawRef.k)) {
1163
1324
  ref.value = newVal;
1164
1325
  }
1165
1326
  if (rawRef.k) refs[rawRef.k] = newVal;
@@ -1174,7 +1335,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1174
1335
  setupState[ref] = value;
1175
1336
  }
1176
1337
  } else if (_isRef) {
1177
- {
1338
+ if (canSetRef(ref, rawRef.k)) {
1178
1339
  ref.value = value;
1179
1340
  }
1180
1341
  if (rawRef.k) refs[rawRef.k] = value;
@@ -1456,7 +1617,9 @@ function createHydrationFunctions(rendererInternals) {
1456
1617
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
1457
1618
  clientText = clientText.slice(1);
1458
1619
  }
1459
- if (el.textContent !== clientText) {
1620
+ const { textContent } = el;
1621
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
1622
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
1460
1623
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
1461
1624
  logMismatchError();
1462
1625
  }
@@ -1468,7 +1631,7 @@ function createHydrationFunctions(rendererInternals) {
1468
1631
  const isCustomElement = el.tagName.includes("-");
1469
1632
  for (const key in props) {
1470
1633
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
1471
- key[0] === "." || isCustomElement) {
1634
+ key[0] === "." || isCustomElement && !shared.isReservedProp(key)) {
1472
1635
  patchProp(el, key, null, props[key], void 0, parentComponent);
1473
1636
  }
1474
1637
  }
@@ -1902,7 +2065,10 @@ function defineAsyncComponent(source) {
1902
2065
  error: error.value
1903
2066
  });
1904
2067
  } else if (loadingComponent && !delayed.value) {
1905
- return createVNode(loadingComponent);
2068
+ return createInnerComp(
2069
+ loadingComponent,
2070
+ instance
2071
+ );
1906
2072
  }
1907
2073
  };
1908
2074
  }
@@ -1998,7 +2164,9 @@ const KeepAliveImpl = {
1998
2164
  }
1999
2165
  function pruneCache(filter) {
2000
2166
  cache.forEach((vnode, key) => {
2001
- const name = getComponentName(vnode.type);
2167
+ const name = getComponentName(
2168
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
2169
+ );
2002
2170
  if (name && !filter(name)) {
2003
2171
  pruneCacheEntry(key);
2004
2172
  }
@@ -2217,7 +2385,7 @@ const DIRECTIVES = "directives";
2217
2385
  function resolveComponent(name, maybeSelfReference) {
2218
2386
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2219
2387
  }
2220
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2388
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
2221
2389
  function resolveDynamicComponent(component) {
2222
2390
  if (shared.isString(component)) {
2223
2391
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -2415,7 +2583,6 @@ const PublicInstanceProxyHandlers = {
2415
2583
  return true;
2416
2584
  }
2417
2585
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
2418
- let normalizedProps;
2419
2586
  if (key[0] !== "$") {
2420
2587
  const n = accessCache[key];
2421
2588
  if (n !== void 0) {
@@ -2435,11 +2602,7 @@ const PublicInstanceProxyHandlers = {
2435
2602
  } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
2436
2603
  accessCache[key] = 2 /* DATA */;
2437
2604
  return data[key];
2438
- } else if (
2439
- // only cache other properties when instance has declared (thus stable)
2440
- // props
2441
- (normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
2442
- ) {
2605
+ } else if (shared.hasOwn(props, key)) {
2443
2606
  accessCache[key] = 3 /* PROPS */;
2444
2607
  return props[key];
2445
2608
  } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
@@ -2494,10 +2657,10 @@ const PublicInstanceProxyHandlers = {
2494
2657
  return true;
2495
2658
  },
2496
2659
  has({
2497
- _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
2660
+ _: { data, setupState, accessCache, ctx, appContext, props, type }
2498
2661
  }, key) {
2499
- let normalizedProps, cssModules;
2500
- return !!(accessCache[key] || data !== shared.EMPTY_OBJ && key[0] !== "$" && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
2662
+ let cssModules;
2663
+ return !!(accessCache[key] || data !== shared.EMPTY_OBJ && key[0] !== "$" && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || shared.hasOwn(props, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
2501
2664
  },
2502
2665
  defineProperty(target, key, descriptor) {
2503
2666
  if (descriptor.get != null) {
@@ -3075,1210 +3238,1041 @@ function createAppAPI(render, hydrate) {
3075
3238
  }
3076
3239
  let currentApp = null;
3077
3240
 
3078
- function provide(key, value) {
3079
- if (!currentInstance) ; else {
3080
- let provides = currentInstance.provides;
3081
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
3082
- if (parentProvides === provides) {
3083
- provides = currentInstance.provides = Object.create(parentProvides);
3241
+ function useModel(props, name, options = shared.EMPTY_OBJ) {
3242
+ const i = getCurrentInstance();
3243
+ const camelizedName = shared.camelize(name);
3244
+ const hyphenatedName = shared.hyphenate(name);
3245
+ const modifiers = getModelModifiers(props, camelizedName);
3246
+ const res = reactivity.customRef((track, trigger) => {
3247
+ let localValue;
3248
+ let prevSetValue = shared.EMPTY_OBJ;
3249
+ let prevEmittedValue;
3250
+ watchSyncEffect(() => {
3251
+ const propValue = props[camelizedName];
3252
+ if (shared.hasChanged(localValue, propValue)) {
3253
+ localValue = propValue;
3254
+ trigger();
3255
+ }
3256
+ });
3257
+ return {
3258
+ get() {
3259
+ track();
3260
+ return options.get ? options.get(localValue) : localValue;
3261
+ },
3262
+ set(value) {
3263
+ const emittedValue = options.set ? options.set(value) : value;
3264
+ if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
3265
+ return;
3266
+ }
3267
+ const rawProps = i.vnode.props;
3268
+ if (!(rawProps && // check if parent has passed v-model
3269
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
3270
+ localValue = value;
3271
+ trigger();
3272
+ }
3273
+ i.emit(`update:${name}`, emittedValue);
3274
+ if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
3275
+ trigger();
3276
+ }
3277
+ prevSetValue = value;
3278
+ prevEmittedValue = emittedValue;
3279
+ }
3280
+ };
3281
+ });
3282
+ res[Symbol.iterator] = () => {
3283
+ let i2 = 0;
3284
+ return {
3285
+ next() {
3286
+ if (i2 < 2) {
3287
+ return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false };
3288
+ } else {
3289
+ return { done: true };
3290
+ }
3291
+ }
3292
+ };
3293
+ };
3294
+ return res;
3295
+ }
3296
+ const getModelModifiers = (props, modelName) => {
3297
+ return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`];
3298
+ };
3299
+
3300
+ function emit(instance, event, ...rawArgs) {
3301
+ if (instance.isUnmounted) return;
3302
+ const props = instance.vnode.props || shared.EMPTY_OBJ;
3303
+ let args = rawArgs;
3304
+ const isModelListener = event.startsWith("update:");
3305
+ const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
3306
+ if (modifiers) {
3307
+ if (modifiers.trim) {
3308
+ args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
3309
+ }
3310
+ if (modifiers.number) {
3311
+ args = rawArgs.map(shared.looseToNumber);
3084
3312
  }
3085
- provides[key] = value;
3086
3313
  }
3087
- }
3088
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
3089
- const instance = getCurrentInstance();
3090
- if (instance || currentApp) {
3091
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
3092
- if (provides && key in provides) {
3093
- return provides[key];
3094
- } else if (arguments.length > 1) {
3095
- return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
3096
- } else ;
3314
+ let handlerName;
3315
+ let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
3316
+ props[handlerName = shared.toHandlerKey(shared.camelize(event))];
3317
+ if (!handler && isModelListener) {
3318
+ handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
3097
3319
  }
3098
- }
3099
- function hasInjectionContext() {
3100
- return !!(getCurrentInstance() || currentApp);
3101
- }
3102
-
3103
- const internalObjectProto = {};
3104
- const createInternalObject = () => Object.create(internalObjectProto);
3105
- const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
3106
-
3107
- function initProps(instance, rawProps, isStateful, isSSR = false) {
3108
- const props = {};
3109
- const attrs = createInternalObject();
3110
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
3111
- setFullProps(instance, rawProps, props, attrs);
3112
- for (const key in instance.propsOptions[0]) {
3113
- if (!(key in props)) {
3114
- props[key] = void 0;
3115
- }
3116
- }
3117
- if (isStateful) {
3118
- instance.props = isSSR ? props : reactivity.shallowReactive(props);
3119
- } else {
3120
- if (!instance.type.props) {
3121
- instance.props = attrs;
3122
- } else {
3123
- instance.props = props;
3124
- }
3125
- }
3126
- instance.attrs = attrs;
3127
- }
3128
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
3129
- const {
3130
- props,
3131
- attrs,
3132
- vnode: { patchFlag }
3133
- } = instance;
3134
- const rawCurrentProps = reactivity.toRaw(props);
3135
- const [options] = instance.propsOptions;
3136
- let hasAttrsChanged = false;
3137
- if (
3138
- // always force full diff in dev
3139
- // - #1942 if hmr is enabled with sfc component
3140
- // - vite#872 non-sfc component used by sfc component
3141
- (optimized || patchFlag > 0) && !(patchFlag & 16)
3142
- ) {
3143
- if (patchFlag & 8) {
3144
- const propsToUpdate = instance.vnode.dynamicProps;
3145
- for (let i = 0; i < propsToUpdate.length; i++) {
3146
- let key = propsToUpdate[i];
3147
- if (isEmitListener(instance.emitsOptions, key)) {
3148
- continue;
3149
- }
3150
- const value = rawProps[key];
3151
- if (options) {
3152
- if (shared.hasOwn(attrs, key)) {
3153
- if (value !== attrs[key]) {
3154
- attrs[key] = value;
3155
- hasAttrsChanged = true;
3156
- }
3157
- } else {
3158
- const camelizedKey = shared.camelize(key);
3159
- props[camelizedKey] = resolvePropValue(
3160
- options,
3161
- rawCurrentProps,
3162
- camelizedKey,
3163
- value,
3164
- instance,
3165
- false
3166
- );
3167
- }
3168
- } else {
3169
- if (value !== attrs[key]) {
3170
- attrs[key] = value;
3171
- hasAttrsChanged = true;
3172
- }
3173
- }
3174
- }
3175
- }
3176
- } else {
3177
- if (setFullProps(instance, rawProps, props, attrs)) {
3178
- hasAttrsChanged = true;
3179
- }
3180
- let kebabKey;
3181
- for (const key in rawCurrentProps) {
3182
- if (!rawProps || // for camelCase
3183
- !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
3184
- // and converted to camelCase (#955)
3185
- ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
3186
- if (options) {
3187
- if (rawPrevProps && // for camelCase
3188
- (rawPrevProps[key] !== void 0 || // for kebab-case
3189
- rawPrevProps[kebabKey] !== void 0)) {
3190
- props[key] = resolvePropValue(
3191
- options,
3192
- rawCurrentProps,
3193
- key,
3194
- void 0,
3195
- instance,
3196
- true
3197
- );
3198
- }
3199
- } else {
3200
- delete props[key];
3201
- }
3202
- }
3203
- }
3204
- if (attrs !== rawCurrentProps) {
3205
- for (const key in attrs) {
3206
- if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
3207
- delete attrs[key];
3208
- hasAttrsChanged = true;
3209
- }
3210
- }
3211
- }
3212
- }
3213
- if (hasAttrsChanged) {
3214
- reactivity.trigger(instance.attrs, "set", "");
3215
- }
3216
- }
3217
- function setFullProps(instance, rawProps, props, attrs) {
3218
- const [options, needCastKeys] = instance.propsOptions;
3219
- let hasAttrsChanged = false;
3220
- let rawCastValues;
3221
- if (rawProps) {
3222
- for (let key in rawProps) {
3223
- if (shared.isReservedProp(key)) {
3224
- continue;
3225
- }
3226
- const value = rawProps[key];
3227
- let camelKey;
3228
- if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
3229
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
3230
- props[camelKey] = value;
3231
- } else {
3232
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3233
- }
3234
- } else if (!isEmitListener(instance.emitsOptions, key)) {
3235
- if (!(key in attrs) || value !== attrs[key]) {
3236
- attrs[key] = value;
3237
- hasAttrsChanged = true;
3238
- }
3239
- }
3240
- }
3241
- }
3242
- if (needCastKeys) {
3243
- const rawCurrentProps = reactivity.toRaw(props);
3244
- const castValues = rawCastValues || shared.EMPTY_OBJ;
3245
- for (let i = 0; i < needCastKeys.length; i++) {
3246
- const key = needCastKeys[i];
3247
- props[key] = resolvePropValue(
3248
- options,
3249
- rawCurrentProps,
3250
- key,
3251
- castValues[key],
3252
- instance,
3253
- !shared.hasOwn(castValues, key)
3254
- );
3255
- }
3320
+ if (handler) {
3321
+ callWithAsyncErrorHandling(
3322
+ handler,
3323
+ instance,
3324
+ 6,
3325
+ args
3326
+ );
3256
3327
  }
3257
- return hasAttrsChanged;
3258
- }
3259
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
3260
- const opt = options[key];
3261
- if (opt != null) {
3262
- const hasDefault = shared.hasOwn(opt, "default");
3263
- if (hasDefault && value === void 0) {
3264
- const defaultValue = opt.default;
3265
- if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
3266
- const { propsDefaults } = instance;
3267
- if (key in propsDefaults) {
3268
- value = propsDefaults[key];
3269
- } else {
3270
- const reset = setCurrentInstance(instance);
3271
- value = propsDefaults[key] = defaultValue.call(
3272
- null,
3273
- props
3274
- );
3275
- reset();
3276
- }
3277
- } else {
3278
- value = defaultValue;
3279
- }
3280
- if (instance.ce) {
3281
- instance.ce._setProp(key, value);
3282
- }
3283
- }
3284
- if (opt[0 /* shouldCast */]) {
3285
- if (isAbsent && !hasDefault) {
3286
- value = false;
3287
- } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
3288
- value = true;
3289
- }
3328
+ const onceHandler = props[handlerName + `Once`];
3329
+ if (onceHandler) {
3330
+ if (!instance.emitted) {
3331
+ instance.emitted = {};
3332
+ } else if (instance.emitted[handlerName]) {
3333
+ return;
3290
3334
  }
3335
+ instance.emitted[handlerName] = true;
3336
+ callWithAsyncErrorHandling(
3337
+ onceHandler,
3338
+ instance,
3339
+ 6,
3340
+ args
3341
+ );
3291
3342
  }
3292
- return value;
3293
3343
  }
3294
- const mixinPropsCache = /* @__PURE__ */ new WeakMap();
3295
- function normalizePropsOptions(comp, appContext, asMixin = false) {
3296
- const cache = asMixin ? mixinPropsCache : appContext.propsCache;
3344
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
3345
+ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
3346
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
3297
3347
  const cached = cache.get(comp);
3298
- if (cached) {
3348
+ if (cached !== void 0) {
3299
3349
  return cached;
3300
3350
  }
3301
- const raw = comp.props;
3302
- const normalized = {};
3303
- const needCastKeys = [];
3351
+ const raw = comp.emits;
3352
+ let normalized = {};
3304
3353
  let hasExtends = false;
3305
3354
  if (!shared.isFunction(comp)) {
3306
- const extendProps = (raw2) => {
3307
- hasExtends = true;
3308
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
3309
- shared.extend(normalized, props);
3310
- if (keys) needCastKeys.push(...keys);
3355
+ const extendEmits = (raw2) => {
3356
+ const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
3357
+ if (normalizedFromExtend) {
3358
+ hasExtends = true;
3359
+ shared.extend(normalized, normalizedFromExtend);
3360
+ }
3311
3361
  };
3312
3362
  if (!asMixin && appContext.mixins.length) {
3313
- appContext.mixins.forEach(extendProps);
3363
+ appContext.mixins.forEach(extendEmits);
3314
3364
  }
3315
3365
  if (comp.extends) {
3316
- extendProps(comp.extends);
3366
+ extendEmits(comp.extends);
3317
3367
  }
3318
3368
  if (comp.mixins) {
3319
- comp.mixins.forEach(extendProps);
3369
+ comp.mixins.forEach(extendEmits);
3320
3370
  }
3321
3371
  }
3322
3372
  if (!raw && !hasExtends) {
3323
3373
  if (shared.isObject(comp)) {
3324
- cache.set(comp, shared.EMPTY_ARR);
3374
+ cache.set(comp, null);
3325
3375
  }
3326
- return shared.EMPTY_ARR;
3376
+ return null;
3327
3377
  }
3328
3378
  if (shared.isArray(raw)) {
3329
- for (let i = 0; i < raw.length; i++) {
3330
- const normalizedKey = shared.camelize(raw[i]);
3331
- if (validatePropName(normalizedKey)) {
3332
- normalized[normalizedKey] = shared.EMPTY_OBJ;
3333
- }
3334
- }
3335
- } else if (raw) {
3336
- for (const key in raw) {
3337
- const normalizedKey = shared.camelize(key);
3338
- if (validatePropName(normalizedKey)) {
3339
- const opt = raw[key];
3340
- const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
3341
- const propType = prop.type;
3342
- let shouldCast = false;
3343
- let shouldCastTrue = true;
3344
- if (shared.isArray(propType)) {
3345
- for (let index = 0; index < propType.length; ++index) {
3346
- const type = propType[index];
3347
- const typeName = shared.isFunction(type) && type.name;
3348
- if (typeName === "Boolean") {
3349
- shouldCast = true;
3350
- break;
3351
- } else if (typeName === "String") {
3352
- shouldCastTrue = false;
3353
- }
3354
- }
3355
- } else {
3356
- shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
3357
- }
3358
- prop[0 /* shouldCast */] = shouldCast;
3359
- prop[1 /* shouldCastTrue */] = shouldCastTrue;
3360
- if (shouldCast || shared.hasOwn(prop, "default")) {
3361
- needCastKeys.push(normalizedKey);
3362
- }
3363
- }
3364
- }
3379
+ raw.forEach((key) => normalized[key] = null);
3380
+ } else {
3381
+ shared.extend(normalized, raw);
3365
3382
  }
3366
- const res = [normalized, needCastKeys];
3367
3383
  if (shared.isObject(comp)) {
3368
- cache.set(comp, res);
3384
+ cache.set(comp, normalized);
3369
3385
  }
3370
- return res;
3386
+ return normalized;
3371
3387
  }
3372
- function validatePropName(key) {
3373
- if (key[0] !== "$" && !shared.isReservedProp(key)) {
3374
- return true;
3388
+ function isEmitListener(options, key) {
3389
+ if (!options || !shared.isOn(key)) {
3390
+ return false;
3375
3391
  }
3376
- return false;
3392
+ key = key.slice(2).replace(/Once$/, "");
3393
+ return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
3377
3394
  }
3378
3395
 
3379
- const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
3380
- const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
3381
- const normalizeSlot = (key, rawSlot, ctx) => {
3382
- if (rawSlot._n) {
3383
- return rawSlot;
3384
- }
3385
- const normalized = withCtx((...args) => {
3386
- if (false) ;
3387
- return normalizeSlotValue(rawSlot(...args));
3388
- }, ctx);
3389
- normalized._c = false;
3390
- return normalized;
3391
- };
3392
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
3393
- const ctx = rawSlots._ctx;
3394
- for (const key in rawSlots) {
3395
- if (isInternalKey(key)) continue;
3396
- const value = rawSlots[key];
3397
- if (shared.isFunction(value)) {
3398
- slots[key] = normalizeSlot(key, value, ctx);
3399
- } else if (value != null) {
3400
- const normalized = normalizeSlotValue(value);
3401
- slots[key] = () => normalized;
3396
+ function markAttrsAccessed() {
3397
+ }
3398
+ function renderComponentRoot(instance) {
3399
+ const {
3400
+ type: Component,
3401
+ vnode,
3402
+ proxy,
3403
+ withProxy,
3404
+ propsOptions: [propsOptions],
3405
+ slots,
3406
+ attrs,
3407
+ emit,
3408
+ render,
3409
+ renderCache,
3410
+ props,
3411
+ data,
3412
+ setupState,
3413
+ ctx,
3414
+ inheritAttrs
3415
+ } = instance;
3416
+ const prev = setCurrentRenderingInstance(instance);
3417
+ let result;
3418
+ let fallthroughAttrs;
3419
+ try {
3420
+ if (vnode.shapeFlag & 4) {
3421
+ const proxyToUse = withProxy || proxy;
3422
+ const thisProxy = false ? new Proxy(proxyToUse, {
3423
+ get(target, key, receiver) {
3424
+ warn(
3425
+ `Property '${String(
3426
+ key
3427
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
3428
+ );
3429
+ return Reflect.get(target, key, receiver);
3430
+ }
3431
+ }) : proxyToUse;
3432
+ result = normalizeVNode(
3433
+ render.call(
3434
+ thisProxy,
3435
+ proxyToUse,
3436
+ renderCache,
3437
+ false ? shallowReadonly(props) : props,
3438
+ setupState,
3439
+ data,
3440
+ ctx
3441
+ )
3442
+ );
3443
+ fallthroughAttrs = attrs;
3444
+ } else {
3445
+ const render2 = Component;
3446
+ if (false) ;
3447
+ result = normalizeVNode(
3448
+ render2.length > 1 ? render2(
3449
+ false ? shallowReadonly(props) : props,
3450
+ false ? {
3451
+ get attrs() {
3452
+ markAttrsAccessed();
3453
+ return shallowReadonly(attrs);
3454
+ },
3455
+ slots,
3456
+ emit
3457
+ } : { attrs, slots, emit }
3458
+ ) : render2(
3459
+ false ? shallowReadonly(props) : props,
3460
+ null
3461
+ )
3462
+ );
3463
+ fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
3402
3464
  }
3465
+ } catch (err) {
3466
+ blockStack.length = 0;
3467
+ handleError(err, instance, 1);
3468
+ result = createVNode(Comment);
3403
3469
  }
3404
- };
3405
- const normalizeVNodeSlots = (instance, children) => {
3406
- const normalized = normalizeSlotValue(children);
3407
- instance.slots.default = () => normalized;
3408
- };
3409
- const assignSlots = (slots, children, optimized) => {
3410
- for (const key in children) {
3411
- if (optimized || !isInternalKey(key)) {
3412
- slots[key] = children[key];
3470
+ let root = result;
3471
+ if (fallthroughAttrs && inheritAttrs !== false) {
3472
+ const keys = Object.keys(fallthroughAttrs);
3473
+ const { shapeFlag } = root;
3474
+ if (keys.length) {
3475
+ if (shapeFlag & (1 | 6)) {
3476
+ if (propsOptions && keys.some(shared.isModelListener)) {
3477
+ fallthroughAttrs = filterModelListeners(
3478
+ fallthroughAttrs,
3479
+ propsOptions
3480
+ );
3481
+ }
3482
+ root = cloneVNode(root, fallthroughAttrs, false, true);
3483
+ }
3413
3484
  }
3414
3485
  }
3415
- };
3416
- const initSlots = (instance, children, optimized) => {
3417
- const slots = instance.slots = createInternalObject();
3418
- if (instance.vnode.shapeFlag & 32) {
3419
- const type = children._;
3420
- if (type) {
3421
- assignSlots(slots, children, optimized);
3422
- if (optimized) {
3423
- shared.def(slots, "_", type, true);
3486
+ if (vnode.dirs) {
3487
+ root = cloneVNode(root, null, false, true);
3488
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3489
+ }
3490
+ if (vnode.transition) {
3491
+ setTransitionHooks(root, vnode.transition);
3492
+ }
3493
+ {
3494
+ result = root;
3495
+ }
3496
+ setCurrentRenderingInstance(prev);
3497
+ return result;
3498
+ }
3499
+ function filterSingleRoot(children, recurse = true) {
3500
+ let singleRoot;
3501
+ for (let i = 0; i < children.length; i++) {
3502
+ const child = children[i];
3503
+ if (isVNode(child)) {
3504
+ if (child.type !== Comment || child.children === "v-if") {
3505
+ if (singleRoot) {
3506
+ return;
3507
+ } else {
3508
+ singleRoot = child;
3509
+ }
3424
3510
  }
3425
3511
  } else {
3426
- normalizeObjectSlots(children, slots);
3512
+ return;
3427
3513
  }
3428
- } else if (children) {
3429
- normalizeVNodeSlots(instance, children);
3430
3514
  }
3431
- };
3432
- const updateSlots = (instance, children, optimized) => {
3433
- const { vnode, slots } = instance;
3434
- let needDeletionCheck = true;
3435
- let deletionComparisonTarget = shared.EMPTY_OBJ;
3436
- if (vnode.shapeFlag & 32) {
3437
- const type = children._;
3438
- if (type) {
3439
- if (optimized && type === 1) {
3440
- needDeletionCheck = false;
3441
- } else {
3442
- assignSlots(slots, children, optimized);
3443
- }
3444
- } else {
3445
- needDeletionCheck = !children.$stable;
3446
- normalizeObjectSlots(children, slots);
3515
+ return singleRoot;
3516
+ }
3517
+ const getFunctionalFallthrough = (attrs) => {
3518
+ let res;
3519
+ for (const key in attrs) {
3520
+ if (key === "class" || key === "style" || shared.isOn(key)) {
3521
+ (res || (res = {}))[key] = attrs[key];
3447
3522
  }
3448
- deletionComparisonTarget = children;
3449
- } else if (children) {
3450
- normalizeVNodeSlots(instance, children);
3451
- deletionComparisonTarget = { default: 1 };
3452
3523
  }
3453
- if (needDeletionCheck) {
3454
- for (const key in slots) {
3455
- if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
3456
- delete slots[key];
3457
- }
3524
+ return res;
3525
+ };
3526
+ const filterModelListeners = (attrs, props) => {
3527
+ const res = {};
3528
+ for (const key in attrs) {
3529
+ if (!shared.isModelListener(key) || !(key.slice(9) in props)) {
3530
+ res[key] = attrs[key];
3458
3531
  }
3459
3532
  }
3533
+ return res;
3460
3534
  };
3461
-
3462
- const queuePostRenderEffect = queueEffectWithSuspense ;
3463
- function createRenderer(options) {
3464
- return baseCreateRenderer(options);
3465
- }
3466
- function createHydrationRenderer(options) {
3467
- return baseCreateRenderer(options, createHydrationFunctions);
3468
- }
3469
- function baseCreateRenderer(options, createHydrationFns) {
3470
- const target = shared.getGlobalThis();
3471
- target.__VUE__ = true;
3472
- const {
3473
- insert: hostInsert,
3474
- remove: hostRemove,
3475
- patchProp: hostPatchProp,
3476
- createElement: hostCreateElement,
3477
- createText: hostCreateText,
3478
- createComment: hostCreateComment,
3479
- setText: hostSetText,
3480
- setElementText: hostSetElementText,
3481
- parentNode: hostParentNode,
3482
- nextSibling: hostNextSibling,
3483
- setScopeId: hostSetScopeId = shared.NOOP,
3484
- insertStaticContent: hostInsertStaticContent
3485
- } = options;
3486
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
3487
- if (n1 === n2) {
3488
- return;
3535
+ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
3536
+ const { props: prevProps, children: prevChildren, component } = prevVNode;
3537
+ const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
3538
+ const emits = component.emitsOptions;
3539
+ if (nextVNode.dirs || nextVNode.transition) {
3540
+ return true;
3541
+ }
3542
+ if (optimized && patchFlag >= 0) {
3543
+ if (patchFlag & 1024) {
3544
+ return true;
3489
3545
  }
3490
- if (n1 && !isSameVNodeType(n1, n2)) {
3491
- anchor = getNextHostNode(n1);
3492
- unmount(n1, parentComponent, parentSuspense, true);
3493
- n1 = null;
3546
+ if (patchFlag & 16) {
3547
+ if (!prevProps) {
3548
+ return !!nextProps;
3549
+ }
3550
+ return hasPropsChanged(prevProps, nextProps, emits);
3551
+ } else if (patchFlag & 8) {
3552
+ const dynamicProps = nextVNode.dynamicProps;
3553
+ for (let i = 0; i < dynamicProps.length; i++) {
3554
+ const key = dynamicProps[i];
3555
+ if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) {
3556
+ return true;
3557
+ }
3558
+ }
3494
3559
  }
3495
- if (n2.patchFlag === -2) {
3496
- optimized = false;
3497
- n2.dynamicChildren = null;
3560
+ } else {
3561
+ if (prevChildren || nextChildren) {
3562
+ if (!nextChildren || !nextChildren.$stable) {
3563
+ return true;
3564
+ }
3498
3565
  }
3499
- const { type, ref, shapeFlag } = n2;
3500
- switch (type) {
3501
- case Text:
3502
- processText(n1, n2, container, anchor);
3503
- break;
3504
- case Comment:
3505
- processCommentNode(n1, n2, container, anchor);
3506
- break;
3507
- case Static:
3508
- if (n1 == null) {
3509
- mountStaticNode(n2, container, anchor, namespace);
3510
- }
3511
- break;
3512
- case Fragment:
3513
- processFragment(
3514
- n1,
3515
- n2,
3516
- container,
3517
- anchor,
3518
- parentComponent,
3519
- parentSuspense,
3520
- namespace,
3521
- slotScopeIds,
3522
- optimized
3523
- );
3524
- break;
3525
- default:
3526
- if (shapeFlag & 1) {
3527
- processElement(
3528
- n1,
3529
- n2,
3530
- container,
3531
- anchor,
3532
- parentComponent,
3533
- parentSuspense,
3534
- namespace,
3535
- slotScopeIds,
3536
- optimized
3537
- );
3538
- } else if (shapeFlag & 6) {
3539
- processComponent(
3540
- n1,
3541
- n2,
3542
- container,
3543
- anchor,
3544
- parentComponent,
3545
- parentSuspense,
3546
- namespace,
3547
- slotScopeIds,
3548
- optimized
3549
- );
3550
- } else if (shapeFlag & 64) {
3551
- type.process(
3552
- n1,
3553
- n2,
3554
- container,
3555
- anchor,
3556
- parentComponent,
3557
- parentSuspense,
3558
- namespace,
3559
- slotScopeIds,
3560
- optimized,
3561
- internals
3562
- );
3563
- } else if (shapeFlag & 128) {
3564
- type.process(
3565
- n1,
3566
- n2,
3567
- container,
3568
- anchor,
3569
- parentComponent,
3570
- parentSuspense,
3571
- namespace,
3572
- slotScopeIds,
3573
- optimized,
3574
- internals
3575
- );
3576
- } else ;
3566
+ if (prevProps === nextProps) {
3567
+ return false;
3577
3568
  }
3578
- if (ref != null && parentComponent) {
3579
- setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
3580
- } else if (ref == null && n1 && n1.ref != null) {
3581
- setRef(n1.ref, null, parentSuspense, n1, true);
3569
+ if (!prevProps) {
3570
+ return !!nextProps;
3582
3571
  }
3583
- };
3584
- const processText = (n1, n2, container, anchor) => {
3585
- if (n1 == null) {
3586
- hostInsert(
3587
- n2.el = hostCreateText(n2.children),
3588
- container,
3589
- anchor
3590
- );
3591
- } else {
3592
- const el = n2.el = n1.el;
3593
- if (n2.children !== n1.children) {
3594
- hostSetText(el, n2.children);
3595
- }
3572
+ if (!nextProps) {
3573
+ return true;
3596
3574
  }
3597
- };
3598
- const processCommentNode = (n1, n2, container, anchor) => {
3599
- if (n1 == null) {
3600
- hostInsert(
3601
- n2.el = hostCreateComment(n2.children || ""),
3602
- container,
3603
- anchor
3604
- );
3605
- } else {
3606
- n2.el = n1.el;
3575
+ return hasPropsChanged(prevProps, nextProps, emits);
3576
+ }
3577
+ return false;
3578
+ }
3579
+ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3580
+ const nextKeys = Object.keys(nextProps);
3581
+ if (nextKeys.length !== Object.keys(prevProps).length) {
3582
+ return true;
3583
+ }
3584
+ for (let i = 0; i < nextKeys.length; i++) {
3585
+ const key = nextKeys[i];
3586
+ if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
3587
+ return true;
3607
3588
  }
3608
- };
3609
- const mountStaticNode = (n2, container, anchor, namespace) => {
3610
- [n2.el, n2.anchor] = hostInsertStaticContent(
3611
- n2.children,
3612
- container,
3613
- anchor,
3614
- namespace,
3615
- n2.el,
3616
- n2.anchor
3617
- );
3618
- };
3619
- const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
3620
- let next;
3621
- while (el && el !== anchor) {
3622
- next = hostNextSibling(el);
3623
- hostInsert(el, container, nextSibling);
3624
- el = next;
3589
+ }
3590
+ return false;
3591
+ }
3592
+ function hasPropValueChanged(nextProps, prevProps, key) {
3593
+ const nextProp = nextProps[key];
3594
+ const prevProp = prevProps[key];
3595
+ if (key === "style" && shared.isObject(nextProp) && shared.isObject(prevProp)) {
3596
+ return !shared.looseEqual(nextProp, prevProp);
3597
+ }
3598
+ return nextProp !== prevProp;
3599
+ }
3600
+ function updateHOCHostEl({ vnode, parent }, el) {
3601
+ while (parent) {
3602
+ const root = parent.subTree;
3603
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3604
+ root.el = vnode.el;
3625
3605
  }
3626
- hostInsert(anchor, container, nextSibling);
3627
- };
3628
- const removeStaticNode = ({ el, anchor }) => {
3629
- let next;
3630
- while (el && el !== anchor) {
3631
- next = hostNextSibling(el);
3632
- hostRemove(el);
3633
- el = next;
3606
+ if (root === vnode) {
3607
+ (vnode = parent.vnode).el = el;
3608
+ parent = parent.parent;
3609
+ } else {
3610
+ break;
3634
3611
  }
3635
- hostRemove(anchor);
3636
- };
3637
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3638
- if (n2.type === "svg") {
3639
- namespace = "svg";
3640
- } else if (n2.type === "math") {
3641
- namespace = "mathml";
3612
+ }
3613
+ }
3614
+
3615
+ const internalObjectProto = {};
3616
+ const createInternalObject = () => Object.create(internalObjectProto);
3617
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
3618
+
3619
+ function initProps(instance, rawProps, isStateful, isSSR = false) {
3620
+ const props = {};
3621
+ const attrs = createInternalObject();
3622
+ instance.propsDefaults = /* @__PURE__ */ Object.create(null);
3623
+ setFullProps(instance, rawProps, props, attrs);
3624
+ for (const key in instance.propsOptions[0]) {
3625
+ if (!(key in props)) {
3626
+ props[key] = void 0;
3642
3627
  }
3643
- if (n1 == null) {
3644
- mountElement(
3645
- n2,
3646
- container,
3647
- anchor,
3648
- parentComponent,
3649
- parentSuspense,
3650
- namespace,
3651
- slotScopeIds,
3652
- optimized
3653
- );
3628
+ }
3629
+ if (isStateful) {
3630
+ instance.props = isSSR ? props : reactivity.shallowReactive(props);
3631
+ } else {
3632
+ if (!instance.type.props) {
3633
+ instance.props = attrs;
3654
3634
  } else {
3655
- patchElement(
3656
- n1,
3657
- n2,
3658
- parentComponent,
3659
- parentSuspense,
3660
- namespace,
3661
- slotScopeIds,
3662
- optimized
3663
- );
3635
+ instance.props = props;
3664
3636
  }
3665
- };
3666
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3667
- let el;
3668
- let vnodeHook;
3669
- const { props, shapeFlag, transition, dirs } = vnode;
3670
- el = vnode.el = hostCreateElement(
3671
- vnode.type,
3672
- namespace,
3673
- props && props.is,
3674
- props
3675
- );
3676
- if (shapeFlag & 8) {
3677
- hostSetElementText(el, vnode.children);
3678
- } else if (shapeFlag & 16) {
3679
- mountChildren(
3680
- vnode.children,
3681
- el,
3682
- null,
3683
- parentComponent,
3684
- parentSuspense,
3685
- resolveChildrenNamespace(vnode, namespace),
3686
- slotScopeIds,
3687
- optimized
3688
- );
3689
- }
3690
- if (dirs) {
3691
- invokeDirectiveHook(vnode, null, parentComponent, "created");
3692
- }
3693
- setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
3694
- if (props) {
3695
- for (const key in props) {
3696
- if (key !== "value" && !shared.isReservedProp(key)) {
3697
- hostPatchProp(el, key, null, props[key], namespace, parentComponent);
3637
+ }
3638
+ instance.attrs = attrs;
3639
+ }
3640
+ function updateProps(instance, rawProps, rawPrevProps, optimized) {
3641
+ const {
3642
+ props,
3643
+ attrs,
3644
+ vnode: { patchFlag }
3645
+ } = instance;
3646
+ const rawCurrentProps = reactivity.toRaw(props);
3647
+ const [options] = instance.propsOptions;
3648
+ let hasAttrsChanged = false;
3649
+ if (
3650
+ // always force full diff in dev
3651
+ // - #1942 if hmr is enabled with sfc component
3652
+ // - vite#872 non-sfc component used by sfc component
3653
+ (optimized || patchFlag > 0) && !(patchFlag & 16)
3654
+ ) {
3655
+ if (patchFlag & 8) {
3656
+ const propsToUpdate = instance.vnode.dynamicProps;
3657
+ for (let i = 0; i < propsToUpdate.length; i++) {
3658
+ let key = propsToUpdate[i];
3659
+ if (isEmitListener(instance.emitsOptions, key)) {
3660
+ continue;
3661
+ }
3662
+ const value = rawProps[key];
3663
+ if (options) {
3664
+ if (shared.hasOwn(attrs, key)) {
3665
+ if (value !== attrs[key]) {
3666
+ attrs[key] = value;
3667
+ hasAttrsChanged = true;
3668
+ }
3669
+ } else {
3670
+ const camelizedKey = shared.camelize(key);
3671
+ props[camelizedKey] = resolvePropValue(
3672
+ options,
3673
+ rawCurrentProps,
3674
+ camelizedKey,
3675
+ value,
3676
+ instance,
3677
+ false
3678
+ );
3679
+ }
3680
+ } else {
3681
+ if (value !== attrs[key]) {
3682
+ attrs[key] = value;
3683
+ hasAttrsChanged = true;
3684
+ }
3698
3685
  }
3699
3686
  }
3700
- if ("value" in props) {
3701
- hostPatchProp(el, "value", null, props.value, namespace);
3702
- }
3703
- if (vnodeHook = props.onVnodeBeforeMount) {
3704
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
3705
- }
3706
- }
3707
- if (dirs) {
3708
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
3709
3687
  }
3710
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
3711
- if (needCallTransitionHooks) {
3712
- transition.beforeEnter(el);
3713
- }
3714
- hostInsert(el, container, anchor);
3715
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
3716
- queuePostRenderEffect(() => {
3717
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
3718
- needCallTransitionHooks && transition.enter(el);
3719
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
3720
- }, parentSuspense);
3688
+ } else {
3689
+ if (setFullProps(instance, rawProps, props, attrs)) {
3690
+ hasAttrsChanged = true;
3721
3691
  }
3722
- };
3723
- const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
3724
- if (scopeId) {
3725
- hostSetScopeId(el, scopeId);
3692
+ let kebabKey;
3693
+ for (const key in rawCurrentProps) {
3694
+ if (!rawProps || // for camelCase
3695
+ !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
3696
+ // and converted to camelCase (#955)
3697
+ ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
3698
+ if (options) {
3699
+ if (rawPrevProps && // for camelCase
3700
+ (rawPrevProps[key] !== void 0 || // for kebab-case
3701
+ rawPrevProps[kebabKey] !== void 0)) {
3702
+ props[key] = resolvePropValue(
3703
+ options,
3704
+ rawCurrentProps,
3705
+ key,
3706
+ void 0,
3707
+ instance,
3708
+ true
3709
+ );
3710
+ }
3711
+ } else {
3712
+ delete props[key];
3713
+ }
3714
+ }
3726
3715
  }
3727
- if (slotScopeIds) {
3728
- for (let i = 0; i < slotScopeIds.length; i++) {
3729
- hostSetScopeId(el, slotScopeIds[i]);
3716
+ if (attrs !== rawCurrentProps) {
3717
+ for (const key in attrs) {
3718
+ if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
3719
+ delete attrs[key];
3720
+ hasAttrsChanged = true;
3721
+ }
3730
3722
  }
3731
3723
  }
3732
- if (parentComponent) {
3733
- let subTree = parentComponent.subTree;
3734
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
3735
- const parentVNode = parentComponent.vnode;
3736
- setScopeId(
3737
- el,
3738
- parentVNode,
3739
- parentVNode.scopeId,
3740
- parentVNode.slotScopeIds,
3741
- parentComponent.parent
3742
- );
3724
+ }
3725
+ if (hasAttrsChanged) {
3726
+ reactivity.trigger(instance.attrs, "set", "");
3727
+ }
3728
+ }
3729
+ function setFullProps(instance, rawProps, props, attrs) {
3730
+ const [options, needCastKeys] = instance.propsOptions;
3731
+ let hasAttrsChanged = false;
3732
+ let rawCastValues;
3733
+ if (rawProps) {
3734
+ for (let key in rawProps) {
3735
+ if (shared.isReservedProp(key)) {
3736
+ continue;
3737
+ }
3738
+ const value = rawProps[key];
3739
+ let camelKey;
3740
+ if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
3741
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) {
3742
+ props[camelKey] = value;
3743
+ } else {
3744
+ (rawCastValues || (rawCastValues = {}))[camelKey] = value;
3745
+ }
3746
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
3747
+ if (!(key in attrs) || value !== attrs[key]) {
3748
+ attrs[key] = value;
3749
+ hasAttrsChanged = true;
3750
+ }
3743
3751
  }
3744
3752
  }
3745
- };
3746
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
3747
- for (let i = start; i < children.length; i++) {
3748
- const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
3749
- patch(
3750
- null,
3751
- child,
3752
- container,
3753
- anchor,
3754
- parentComponent,
3755
- parentSuspense,
3756
- namespace,
3757
- slotScopeIds,
3758
- optimized
3753
+ }
3754
+ if (needCastKeys) {
3755
+ const rawCurrentProps = reactivity.toRaw(props);
3756
+ const castValues = rawCastValues || shared.EMPTY_OBJ;
3757
+ for (let i = 0; i < needCastKeys.length; i++) {
3758
+ const key = needCastKeys[i];
3759
+ props[key] = resolvePropValue(
3760
+ options,
3761
+ rawCurrentProps,
3762
+ key,
3763
+ castValues[key],
3764
+ instance,
3765
+ !shared.hasOwn(castValues, key)
3759
3766
  );
3760
3767
  }
3761
- };
3762
- const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3763
- const el = n2.el = n1.el;
3764
- let { patchFlag, dynamicChildren, dirs } = n2;
3765
- patchFlag |= n1.patchFlag & 16;
3766
- const oldProps = n1.props || shared.EMPTY_OBJ;
3767
- const newProps = n2.props || shared.EMPTY_OBJ;
3768
- let vnodeHook;
3769
- parentComponent && toggleRecurse(parentComponent, false);
3770
- if (vnodeHook = newProps.onVnodeBeforeUpdate) {
3771
- invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
3772
- }
3773
- if (dirs) {
3774
- invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
3768
+ }
3769
+ return hasAttrsChanged;
3770
+ }
3771
+ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3772
+ const opt = options[key];
3773
+ if (opt != null) {
3774
+ const hasDefault = shared.hasOwn(opt, "default");
3775
+ if (hasDefault && value === void 0) {
3776
+ const defaultValue = opt.default;
3777
+ if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
3778
+ const { propsDefaults } = instance;
3779
+ if (key in propsDefaults) {
3780
+ value = propsDefaults[key];
3781
+ } else {
3782
+ const reset = setCurrentInstance(instance);
3783
+ value = propsDefaults[key] = defaultValue.call(
3784
+ null,
3785
+ props
3786
+ );
3787
+ reset();
3788
+ }
3789
+ } else {
3790
+ value = defaultValue;
3791
+ }
3792
+ if (instance.ce) {
3793
+ instance.ce._setProp(key, value);
3794
+ }
3775
3795
  }
3776
- parentComponent && toggleRecurse(parentComponent, true);
3777
- if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
3778
- hostSetElementText(el, "");
3796
+ if (opt[0 /* shouldCast */]) {
3797
+ if (isAbsent && !hasDefault) {
3798
+ value = false;
3799
+ } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
3800
+ value = true;
3801
+ }
3779
3802
  }
3780
- if (dynamicChildren) {
3781
- patchBlockChildren(
3782
- n1.dynamicChildren,
3783
- dynamicChildren,
3784
- el,
3785
- parentComponent,
3786
- parentSuspense,
3787
- resolveChildrenNamespace(n2, namespace),
3788
- slotScopeIds
3789
- );
3790
- } else if (!optimized) {
3791
- patchChildren(
3792
- n1,
3793
- n2,
3794
- el,
3795
- null,
3796
- parentComponent,
3797
- parentSuspense,
3798
- resolveChildrenNamespace(n2, namespace),
3799
- slotScopeIds,
3800
- false
3801
- );
3803
+ }
3804
+ return value;
3805
+ }
3806
+ const mixinPropsCache = /* @__PURE__ */ new WeakMap();
3807
+ function normalizePropsOptions(comp, appContext, asMixin = false) {
3808
+ const cache = asMixin ? mixinPropsCache : appContext.propsCache;
3809
+ const cached = cache.get(comp);
3810
+ if (cached) {
3811
+ return cached;
3812
+ }
3813
+ const raw = comp.props;
3814
+ const normalized = {};
3815
+ const needCastKeys = [];
3816
+ let hasExtends = false;
3817
+ if (!shared.isFunction(comp)) {
3818
+ const extendProps = (raw2) => {
3819
+ hasExtends = true;
3820
+ const [props, keys] = normalizePropsOptions(raw2, appContext, true);
3821
+ shared.extend(normalized, props);
3822
+ if (keys) needCastKeys.push(...keys);
3823
+ };
3824
+ if (!asMixin && appContext.mixins.length) {
3825
+ appContext.mixins.forEach(extendProps);
3802
3826
  }
3803
- if (patchFlag > 0) {
3804
- if (patchFlag & 16) {
3805
- patchProps(el, oldProps, newProps, parentComponent, namespace);
3806
- } else {
3807
- if (patchFlag & 2) {
3808
- if (oldProps.class !== newProps.class) {
3809
- hostPatchProp(el, "class", null, newProps.class, namespace);
3810
- }
3811
- }
3812
- if (patchFlag & 4) {
3813
- hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
3814
- }
3815
- if (patchFlag & 8) {
3816
- const propsToUpdate = n2.dynamicProps;
3817
- for (let i = 0; i < propsToUpdate.length; i++) {
3818
- const key = propsToUpdate[i];
3819
- const prev = oldProps[key];
3820
- const next = newProps[key];
3821
- if (next !== prev || key === "value") {
3822
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
3827
+ if (comp.extends) {
3828
+ extendProps(comp.extends);
3829
+ }
3830
+ if (comp.mixins) {
3831
+ comp.mixins.forEach(extendProps);
3832
+ }
3833
+ }
3834
+ if (!raw && !hasExtends) {
3835
+ if (shared.isObject(comp)) {
3836
+ cache.set(comp, shared.EMPTY_ARR);
3837
+ }
3838
+ return shared.EMPTY_ARR;
3839
+ }
3840
+ if (shared.isArray(raw)) {
3841
+ for (let i = 0; i < raw.length; i++) {
3842
+ const normalizedKey = shared.camelize(raw[i]);
3843
+ if (validatePropName(normalizedKey)) {
3844
+ normalized[normalizedKey] = shared.EMPTY_OBJ;
3845
+ }
3846
+ }
3847
+ } else if (raw) {
3848
+ for (const key in raw) {
3849
+ const normalizedKey = shared.camelize(key);
3850
+ if (validatePropName(normalizedKey)) {
3851
+ const opt = raw[key];
3852
+ const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
3853
+ const propType = prop.type;
3854
+ let shouldCast = false;
3855
+ let shouldCastTrue = true;
3856
+ if (shared.isArray(propType)) {
3857
+ for (let index = 0; index < propType.length; ++index) {
3858
+ const type = propType[index];
3859
+ const typeName = shared.isFunction(type) && type.name;
3860
+ if (typeName === "Boolean") {
3861
+ shouldCast = true;
3862
+ break;
3863
+ } else if (typeName === "String") {
3864
+ shouldCastTrue = false;
3823
3865
  }
3824
3866
  }
3867
+ } else {
3868
+ shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
3825
3869
  }
3826
- }
3827
- if (patchFlag & 1) {
3828
- if (n1.children !== n2.children) {
3829
- hostSetElementText(el, n2.children);
3870
+ prop[0 /* shouldCast */] = shouldCast;
3871
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
3872
+ if (shouldCast || shared.hasOwn(prop, "default")) {
3873
+ needCastKeys.push(normalizedKey);
3830
3874
  }
3831
3875
  }
3832
- } else if (!optimized && dynamicChildren == null) {
3833
- patchProps(el, oldProps, newProps, parentComponent, namespace);
3834
3876
  }
3835
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
3836
- queuePostRenderEffect(() => {
3837
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
3838
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
3839
- }, parentSuspense);
3877
+ }
3878
+ const res = [normalized, needCastKeys];
3879
+ if (shared.isObject(comp)) {
3880
+ cache.set(comp, res);
3881
+ }
3882
+ return res;
3883
+ }
3884
+ function validatePropName(key) {
3885
+ if (key[0] !== "$" && !shared.isReservedProp(key)) {
3886
+ return true;
3887
+ }
3888
+ return false;
3889
+ }
3890
+
3891
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
3892
+ const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
3893
+ const normalizeSlot = (key, rawSlot, ctx) => {
3894
+ if (rawSlot._n) {
3895
+ return rawSlot;
3896
+ }
3897
+ const normalized = withCtx((...args) => {
3898
+ if (false) ;
3899
+ return normalizeSlotValue(rawSlot(...args));
3900
+ }, ctx);
3901
+ normalized._c = false;
3902
+ return normalized;
3903
+ };
3904
+ const normalizeObjectSlots = (rawSlots, slots, instance) => {
3905
+ const ctx = rawSlots._ctx;
3906
+ for (const key in rawSlots) {
3907
+ if (isInternalKey(key)) continue;
3908
+ const value = rawSlots[key];
3909
+ if (shared.isFunction(value)) {
3910
+ slots[key] = normalizeSlot(key, value, ctx);
3911
+ } else if (value != null) {
3912
+ const normalized = normalizeSlotValue(value);
3913
+ slots[key] = () => normalized;
3840
3914
  }
3841
- };
3842
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
3843
- for (let i = 0; i < newChildren.length; i++) {
3844
- const oldVNode = oldChildren[i];
3845
- const newVNode = newChildren[i];
3846
- const container = (
3847
- // oldVNode may be an errored async setup() component inside Suspense
3848
- // which will not have a mounted element
3849
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
3850
- // of the Fragment itself so it can move its children.
3851
- (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
3852
- // which also requires the correct parent container
3853
- !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
3854
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
3855
- // In other cases, the parent container is not actually used so we
3856
- // just pass the block element here to avoid a DOM parentNode call.
3857
- fallbackContainer
3858
- )
3859
- );
3860
- patch(
3861
- oldVNode,
3862
- newVNode,
3863
- container,
3864
- null,
3865
- parentComponent,
3866
- parentSuspense,
3867
- namespace,
3868
- slotScopeIds,
3869
- true
3870
- );
3915
+ }
3916
+ };
3917
+ const normalizeVNodeSlots = (instance, children) => {
3918
+ const normalized = normalizeSlotValue(children);
3919
+ instance.slots.default = () => normalized;
3920
+ };
3921
+ const assignSlots = (slots, children, optimized) => {
3922
+ for (const key in children) {
3923
+ if (optimized || !isInternalKey(key)) {
3924
+ slots[key] = children[key];
3871
3925
  }
3872
- };
3873
- const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
3874
- if (oldProps !== newProps) {
3875
- if (oldProps !== shared.EMPTY_OBJ) {
3876
- for (const key in oldProps) {
3877
- if (!shared.isReservedProp(key) && !(key in newProps)) {
3878
- hostPatchProp(
3879
- el,
3880
- key,
3881
- oldProps[key],
3882
- null,
3883
- namespace,
3884
- parentComponent
3885
- );
3886
- }
3887
- }
3888
- }
3889
- for (const key in newProps) {
3890
- if (shared.isReservedProp(key)) continue;
3891
- const next = newProps[key];
3892
- const prev = oldProps[key];
3893
- if (next !== prev && key !== "value") {
3894
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
3895
- }
3926
+ }
3927
+ };
3928
+ const initSlots = (instance, children, optimized) => {
3929
+ const slots = instance.slots = createInternalObject();
3930
+ if (instance.vnode.shapeFlag & 32) {
3931
+ const type = children._;
3932
+ if (type) {
3933
+ assignSlots(slots, children, optimized);
3934
+ if (optimized) {
3935
+ shared.def(slots, "_", type, true);
3896
3936
  }
3897
- if ("value" in newProps) {
3898
- hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
3937
+ } else {
3938
+ normalizeObjectSlots(children, slots);
3939
+ }
3940
+ } else if (children) {
3941
+ normalizeVNodeSlots(instance, children);
3942
+ }
3943
+ };
3944
+ const updateSlots = (instance, children, optimized) => {
3945
+ const { vnode, slots } = instance;
3946
+ let needDeletionCheck = true;
3947
+ let deletionComparisonTarget = shared.EMPTY_OBJ;
3948
+ if (vnode.shapeFlag & 32) {
3949
+ const type = children._;
3950
+ if (type) {
3951
+ if (optimized && type === 1) {
3952
+ needDeletionCheck = false;
3953
+ } else {
3954
+ assignSlots(slots, children, optimized);
3899
3955
  }
3956
+ } else {
3957
+ needDeletionCheck = !children.$stable;
3958
+ normalizeObjectSlots(children, slots);
3900
3959
  }
3901
- };
3902
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3903
- const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
3904
- const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
3905
- let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
3906
- if (fragmentSlotScopeIds) {
3907
- slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
3960
+ deletionComparisonTarget = children;
3961
+ } else if (children) {
3962
+ normalizeVNodeSlots(instance, children);
3963
+ deletionComparisonTarget = { default: 1 };
3964
+ }
3965
+ if (needDeletionCheck) {
3966
+ for (const key in slots) {
3967
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
3968
+ delete slots[key];
3969
+ }
3908
3970
  }
3909
- if (n1 == null) {
3910
- hostInsert(fragmentStartAnchor, container, anchor);
3911
- hostInsert(fragmentEndAnchor, container, anchor);
3912
- mountChildren(
3913
- // #10007
3914
- // such fragment like `<></>` will be compiled into
3915
- // a fragment which doesn't have a children.
3916
- // In this case fallback to an empty array
3917
- n2.children || [],
3918
- container,
3919
- fragmentEndAnchor,
3920
- parentComponent,
3921
- parentSuspense,
3922
- namespace,
3923
- slotScopeIds,
3924
- optimized
3925
- );
3926
- } else {
3927
- if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
3928
- // of renderSlot() with no valid children
3929
- n1.dynamicChildren) {
3930
- patchBlockChildren(
3931
- n1.dynamicChildren,
3932
- dynamicChildren,
3933
- container,
3934
- parentComponent,
3935
- parentSuspense,
3936
- namespace,
3937
- slotScopeIds
3938
- );
3939
- if (
3940
- // #2080 if the stable fragment has a key, it's a <template v-for> that may
3941
- // get moved around. Make sure all root level vnodes inherit el.
3942
- // #2134 or if it's a component root, it may also get moved around
3943
- // as the component is being moved.
3944
- n2.key != null || parentComponent && n2 === parentComponent.subTree
3945
- ) {
3946
- traverseStaticChildren(
3947
- n1,
3948
- n2,
3949
- true
3950
- /* shallow */
3951
- );
3971
+ }
3972
+ };
3973
+
3974
+ const queuePostRenderEffect = queueEffectWithSuspense ;
3975
+ function createRenderer(options) {
3976
+ return baseCreateRenderer(options);
3977
+ }
3978
+ function createHydrationRenderer(options) {
3979
+ return baseCreateRenderer(options, createHydrationFunctions);
3980
+ }
3981
+ function baseCreateRenderer(options, createHydrationFns) {
3982
+ const target = shared.getGlobalThis();
3983
+ target.__VUE__ = true;
3984
+ const {
3985
+ insert: hostInsert,
3986
+ remove: hostRemove,
3987
+ patchProp: hostPatchProp,
3988
+ createElement: hostCreateElement,
3989
+ createText: hostCreateText,
3990
+ createComment: hostCreateComment,
3991
+ setText: hostSetText,
3992
+ setElementText: hostSetElementText,
3993
+ parentNode: hostParentNode,
3994
+ nextSibling: hostNextSibling,
3995
+ setScopeId: hostSetScopeId = shared.NOOP,
3996
+ insertStaticContent: hostInsertStaticContent
3997
+ } = options;
3998
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
3999
+ if (n1 === n2) {
4000
+ return;
4001
+ }
4002
+ if (n1 && !isSameVNodeType(n1, n2)) {
4003
+ anchor = getNextHostNode(n1);
4004
+ unmount(n1, parentComponent, parentSuspense, true);
4005
+ n1 = null;
4006
+ }
4007
+ if (n2.patchFlag === -2) {
4008
+ optimized = false;
4009
+ n2.dynamicChildren = null;
4010
+ }
4011
+ const { type, ref, shapeFlag } = n2;
4012
+ switch (type) {
4013
+ case Text:
4014
+ processText(n1, n2, container, anchor);
4015
+ break;
4016
+ case Comment:
4017
+ processCommentNode(n1, n2, container, anchor);
4018
+ break;
4019
+ case Static:
4020
+ if (n1 == null) {
4021
+ mountStaticNode(n2, container, anchor, namespace);
3952
4022
  }
3953
- } else {
3954
- patchChildren(
4023
+ break;
4024
+ case Fragment:
4025
+ processFragment(
3955
4026
  n1,
3956
4027
  n2,
3957
4028
  container,
3958
- fragmentEndAnchor,
4029
+ anchor,
3959
4030
  parentComponent,
3960
4031
  parentSuspense,
3961
4032
  namespace,
3962
4033
  slotScopeIds,
3963
4034
  optimized
3964
4035
  );
3965
- }
4036
+ break;
4037
+ default:
4038
+ if (shapeFlag & 1) {
4039
+ processElement(
4040
+ n1,
4041
+ n2,
4042
+ container,
4043
+ anchor,
4044
+ parentComponent,
4045
+ parentSuspense,
4046
+ namespace,
4047
+ slotScopeIds,
4048
+ optimized
4049
+ );
4050
+ } else if (shapeFlag & 6) {
4051
+ processComponent(
4052
+ n1,
4053
+ n2,
4054
+ container,
4055
+ anchor,
4056
+ parentComponent,
4057
+ parentSuspense,
4058
+ namespace,
4059
+ slotScopeIds,
4060
+ optimized
4061
+ );
4062
+ } else if (shapeFlag & 64) {
4063
+ type.process(
4064
+ n1,
4065
+ n2,
4066
+ container,
4067
+ anchor,
4068
+ parentComponent,
4069
+ parentSuspense,
4070
+ namespace,
4071
+ slotScopeIds,
4072
+ optimized,
4073
+ internals
4074
+ );
4075
+ } else if (shapeFlag & 128) {
4076
+ type.process(
4077
+ n1,
4078
+ n2,
4079
+ container,
4080
+ anchor,
4081
+ parentComponent,
4082
+ parentSuspense,
4083
+ namespace,
4084
+ slotScopeIds,
4085
+ optimized,
4086
+ internals
4087
+ );
4088
+ } else ;
4089
+ }
4090
+ if (ref != null && parentComponent) {
4091
+ setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
4092
+ } else if (ref == null && n1 && n1.ref != null) {
4093
+ setRef(n1.ref, null, parentSuspense, n1, true);
3966
4094
  }
3967
4095
  };
3968
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
3969
- n2.slotScopeIds = slotScopeIds;
4096
+ const processText = (n1, n2, container, anchor) => {
3970
4097
  if (n1 == null) {
3971
- if (n2.shapeFlag & 512) {
3972
- parentComponent.ctx.activate(
3973
- n2,
3974
- container,
3975
- anchor,
3976
- namespace,
3977
- optimized
3978
- );
3979
- } else {
3980
- mountComponent(
3981
- n2,
3982
- container,
3983
- anchor,
3984
- parentComponent,
3985
- parentSuspense,
3986
- namespace,
3987
- optimized
3988
- );
3989
- }
4098
+ hostInsert(
4099
+ n2.el = hostCreateText(n2.children),
4100
+ container,
4101
+ anchor
4102
+ );
3990
4103
  } else {
3991
- updateComponent(n1, n2, optimized);
4104
+ const el = n2.el = n1.el;
4105
+ if (n2.children !== n1.children) {
4106
+ hostSetText(el, n2.children);
4107
+ }
3992
4108
  }
3993
4109
  };
3994
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
3995
- const instance = (initialVNode.component = createComponentInstance(
3996
- initialVNode,
3997
- parentComponent,
3998
- parentSuspense
3999
- ));
4000
- if (isKeepAlive(initialVNode)) {
4001
- instance.ctx.renderer = internals;
4002
- }
4003
- {
4004
- setupComponent(instance, false, optimized);
4005
- }
4006
- if (instance.asyncDep) {
4007
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
4008
- if (!initialVNode.el) {
4009
- const placeholder = instance.subTree = createVNode(Comment);
4010
- processCommentNode(null, placeholder, container, anchor);
4011
- initialVNode.placeholder = placeholder.el;
4012
- }
4013
- } else {
4014
- setupRenderEffect(
4015
- instance,
4016
- initialVNode,
4110
+ const processCommentNode = (n1, n2, container, anchor) => {
4111
+ if (n1 == null) {
4112
+ hostInsert(
4113
+ n2.el = hostCreateComment(n2.children || ""),
4017
4114
  container,
4018
- anchor,
4019
- parentSuspense,
4020
- namespace,
4021
- optimized
4115
+ anchor
4022
4116
  );
4023
- }
4024
- };
4025
- const updateComponent = (n1, n2, optimized) => {
4026
- const instance = n2.component = n1.component;
4027
- if (shouldUpdateComponent(n1, n2, optimized)) {
4028
- if (instance.asyncDep && !instance.asyncResolved) {
4029
- updateComponentPreRender(instance, n2, optimized);
4030
- return;
4031
- } else {
4032
- instance.next = n2;
4033
- instance.update();
4034
- }
4035
4117
  } else {
4036
4118
  n2.el = n1.el;
4037
- instance.vnode = n2;
4038
4119
  }
4039
4120
  };
4040
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
4041
- const componentUpdateFn = () => {
4042
- if (!instance.isMounted) {
4043
- let vnodeHook;
4044
- const { el, props } = initialVNode;
4045
- const { bm, m, parent, root, type } = instance;
4046
- const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
4047
- toggleRecurse(instance, false);
4048
- if (bm) {
4049
- shared.invokeArrayFns(bm);
4050
- }
4051
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
4052
- invokeVNodeHook(vnodeHook, parent, initialVNode);
4053
- }
4054
- toggleRecurse(instance, true);
4055
- if (el && hydrateNode) {
4056
- const hydrateSubTree = () => {
4057
- instance.subTree = renderComponentRoot(instance);
4058
- hydrateNode(
4059
- el,
4060
- instance.subTree,
4061
- instance,
4062
- parentSuspense,
4063
- null
4064
- );
4065
- };
4066
- if (isAsyncWrapperVNode && type.__asyncHydrate) {
4067
- type.__asyncHydrate(
4068
- el,
4069
- instance,
4070
- hydrateSubTree
4071
- );
4072
- } else {
4073
- hydrateSubTree();
4074
- }
4075
- } else {
4076
- if (root.ce && // @ts-expect-error _def is private
4077
- root.ce._def.shadowRoot !== false) {
4078
- root.ce._injectChildStyle(type);
4079
- }
4080
- const subTree = instance.subTree = renderComponentRoot(instance);
4081
- patch(
4082
- null,
4083
- subTree,
4084
- container,
4085
- anchor,
4086
- instance,
4087
- parentSuspense,
4088
- namespace
4089
- );
4090
- initialVNode.el = subTree.el;
4091
- }
4092
- if (m) {
4093
- queuePostRenderEffect(m, parentSuspense);
4094
- }
4095
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
4096
- const scopedInitialVNode = initialVNode;
4097
- queuePostRenderEffect(
4098
- () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
4099
- parentSuspense
4100
- );
4101
- }
4102
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
4103
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
4104
- }
4105
- instance.isMounted = true;
4106
- initialVNode = container = anchor = null;
4107
- } else {
4108
- let { next, bu, u, parent, vnode } = instance;
4109
- {
4110
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
4111
- if (nonHydratedAsyncRoot) {
4112
- if (next) {
4113
- next.el = vnode.el;
4114
- updateComponentPreRender(instance, next, optimized);
4115
- }
4116
- nonHydratedAsyncRoot.asyncDep.then(() => {
4117
- if (!instance.isUnmounted) {
4118
- componentUpdateFn();
4119
- }
4120
- });
4121
- return;
4122
- }
4123
- }
4124
- let originNext = next;
4125
- let vnodeHook;
4126
- toggleRecurse(instance, false);
4127
- if (next) {
4128
- next.el = vnode.el;
4129
- updateComponentPreRender(instance, next, optimized);
4130
- } else {
4131
- next = vnode;
4132
- }
4133
- if (bu) {
4134
- shared.invokeArrayFns(bu);
4135
- }
4136
- if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
4137
- invokeVNodeHook(vnodeHook, parent, next, vnode);
4138
- }
4139
- toggleRecurse(instance, true);
4140
- const nextTree = renderComponentRoot(instance);
4141
- const prevTree = instance.subTree;
4142
- instance.subTree = nextTree;
4143
- patch(
4144
- prevTree,
4145
- nextTree,
4146
- // parent may have changed if it's in a teleport
4147
- hostParentNode(prevTree.el),
4148
- // anchor may have changed if it's in a fragment
4149
- getNextHostNode(prevTree),
4150
- instance,
4151
- parentSuspense,
4152
- namespace
4153
- );
4154
- next.el = nextTree.el;
4155
- if (originNext === null) {
4156
- updateHOCHostEl(instance, nextTree.el);
4157
- }
4158
- if (u) {
4159
- queuePostRenderEffect(u, parentSuspense);
4160
- }
4161
- if (vnodeHook = next.props && next.props.onVnodeUpdated) {
4162
- queuePostRenderEffect(
4163
- () => invokeVNodeHook(vnodeHook, parent, next, vnode),
4164
- parentSuspense
4165
- );
4166
- }
4167
- }
4168
- };
4169
- instance.scope.on();
4170
- const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
4171
- instance.scope.off();
4172
- const update = instance.update = effect.run.bind(effect);
4173
- const job = instance.job = effect.runIfDirty.bind(effect);
4174
- job.i = instance;
4175
- job.id = instance.uid;
4176
- effect.scheduler = () => queueJob(job);
4177
- toggleRecurse(instance, true);
4178
- update();
4121
+ const mountStaticNode = (n2, container, anchor, namespace) => {
4122
+ [n2.el, n2.anchor] = hostInsertStaticContent(
4123
+ n2.children,
4124
+ container,
4125
+ anchor,
4126
+ namespace,
4127
+ n2.el,
4128
+ n2.anchor
4129
+ );
4179
4130
  };
4180
- const updateComponentPreRender = (instance, nextVNode, optimized) => {
4181
- nextVNode.component = instance;
4182
- const prevProps = instance.vnode.props;
4183
- instance.vnode = nextVNode;
4184
- instance.next = null;
4185
- updateProps(instance, nextVNode.props, prevProps, optimized);
4186
- updateSlots(instance, nextVNode.children, optimized);
4187
- reactivity.pauseTracking();
4188
- flushPreFlushCbs(instance);
4189
- reactivity.resetTracking();
4131
+ const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
4132
+ let next;
4133
+ while (el && el !== anchor) {
4134
+ next = hostNextSibling(el);
4135
+ hostInsert(el, container, nextSibling);
4136
+ el = next;
4137
+ }
4138
+ hostInsert(anchor, container, nextSibling);
4190
4139
  };
4191
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
4192
- const c1 = n1 && n1.children;
4193
- const prevShapeFlag = n1 ? n1.shapeFlag : 0;
4194
- const c2 = n2.children;
4195
- const { patchFlag, shapeFlag } = n2;
4196
- if (patchFlag > 0) {
4197
- if (patchFlag & 128) {
4198
- patchKeyedChildren(
4199
- c1,
4200
- c2,
4201
- container,
4202
- anchor,
4203
- parentComponent,
4204
- parentSuspense,
4205
- namespace,
4206
- slotScopeIds,
4207
- optimized
4208
- );
4209
- return;
4210
- } else if (patchFlag & 256) {
4211
- patchUnkeyedChildren(
4212
- c1,
4213
- c2,
4214
- container,
4215
- anchor,
4140
+ const removeStaticNode = ({ el, anchor }) => {
4141
+ let next;
4142
+ while (el && el !== anchor) {
4143
+ next = hostNextSibling(el);
4144
+ hostRemove(el);
4145
+ el = next;
4146
+ }
4147
+ hostRemove(anchor);
4148
+ };
4149
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4150
+ if (n2.type === "svg") {
4151
+ namespace = "svg";
4152
+ } else if (n2.type === "math") {
4153
+ namespace = "mathml";
4154
+ }
4155
+ if (n1 == null) {
4156
+ mountElement(
4157
+ n2,
4158
+ container,
4159
+ anchor,
4160
+ parentComponent,
4161
+ parentSuspense,
4162
+ namespace,
4163
+ slotScopeIds,
4164
+ optimized
4165
+ );
4166
+ } else {
4167
+ const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
4168
+ try {
4169
+ if (customElement) {
4170
+ customElement._beginPatch();
4171
+ }
4172
+ patchElement(
4173
+ n1,
4174
+ n2,
4216
4175
  parentComponent,
4217
4176
  parentSuspense,
4218
4177
  namespace,
4219
4178
  slotScopeIds,
4220
4179
  optimized
4221
4180
  );
4222
- return;
4181
+ } finally {
4182
+ if (customElement) {
4183
+ customElement._endPatch();
4184
+ }
4223
4185
  }
4224
4186
  }
4187
+ };
4188
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4189
+ let el;
4190
+ let vnodeHook;
4191
+ const { props, shapeFlag, transition, dirs } = vnode;
4192
+ el = vnode.el = hostCreateElement(
4193
+ vnode.type,
4194
+ namespace,
4195
+ props && props.is,
4196
+ props
4197
+ );
4225
4198
  if (shapeFlag & 8) {
4226
- if (prevShapeFlag & 16) {
4227
- unmountChildren(c1, parentComponent, parentSuspense);
4199
+ hostSetElementText(el, vnode.children);
4200
+ } else if (shapeFlag & 16) {
4201
+ mountChildren(
4202
+ vnode.children,
4203
+ el,
4204
+ null,
4205
+ parentComponent,
4206
+ parentSuspense,
4207
+ resolveChildrenNamespace(vnode, namespace),
4208
+ slotScopeIds,
4209
+ optimized
4210
+ );
4211
+ }
4212
+ if (dirs) {
4213
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
4214
+ }
4215
+ setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
4216
+ if (props) {
4217
+ for (const key in props) {
4218
+ if (key !== "value" && !shared.isReservedProp(key)) {
4219
+ hostPatchProp(el, key, null, props[key], namespace, parentComponent);
4220
+ }
4228
4221
  }
4229
- if (c2 !== c1) {
4230
- hostSetElementText(container, c2);
4222
+ if ("value" in props) {
4223
+ hostPatchProp(el, "value", null, props.value, namespace);
4231
4224
  }
4232
- } else {
4233
- if (prevShapeFlag & 16) {
4234
- if (shapeFlag & 16) {
4235
- patchKeyedChildren(
4236
- c1,
4237
- c2,
4238
- container,
4239
- anchor,
4240
- parentComponent,
4241
- parentSuspense,
4242
- namespace,
4243
- slotScopeIds,
4244
- optimized
4245
- );
4246
- } else {
4247
- unmountChildren(c1, parentComponent, parentSuspense, true);
4248
- }
4249
- } else {
4250
- if (prevShapeFlag & 8) {
4251
- hostSetElementText(container, "");
4252
- }
4253
- if (shapeFlag & 16) {
4254
- mountChildren(
4255
- c2,
4256
- container,
4257
- anchor,
4258
- parentComponent,
4259
- parentSuspense,
4260
- namespace,
4261
- slotScopeIds,
4262
- optimized
4263
- );
4264
- }
4225
+ if (vnodeHook = props.onVnodeBeforeMount) {
4226
+ invokeVNodeHook(vnodeHook, parentComponent, vnode);
4265
4227
  }
4266
4228
  }
4229
+ if (dirs) {
4230
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4231
+ }
4232
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
4233
+ if (needCallTransitionHooks) {
4234
+ transition.beforeEnter(el);
4235
+ }
4236
+ hostInsert(el, container, anchor);
4237
+ if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
4238
+ queuePostRenderEffect(() => {
4239
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4240
+ needCallTransitionHooks && transition.enter(el);
4241
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4242
+ }, parentSuspense);
4243
+ }
4267
4244
  };
4268
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4269
- c1 = c1 || shared.EMPTY_ARR;
4270
- c2 = c2 || shared.EMPTY_ARR;
4271
- const oldLength = c1.length;
4272
- const newLength = c2.length;
4273
- const commonLength = Math.min(oldLength, newLength);
4274
- let i;
4275
- for (i = 0; i < commonLength; i++) {
4276
- const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
4245
+ const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
4246
+ if (scopeId) {
4247
+ hostSetScopeId(el, scopeId);
4248
+ }
4249
+ if (slotScopeIds) {
4250
+ for (let i = 0; i < slotScopeIds.length; i++) {
4251
+ hostSetScopeId(el, slotScopeIds[i]);
4252
+ }
4253
+ }
4254
+ if (parentComponent) {
4255
+ let subTree = parentComponent.subTree;
4256
+ if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
4257
+ const parentVNode = parentComponent.vnode;
4258
+ setScopeId(
4259
+ el,
4260
+ parentVNode,
4261
+ parentVNode.scopeId,
4262
+ parentVNode.slotScopeIds,
4263
+ parentComponent.parent
4264
+ );
4265
+ }
4266
+ }
4267
+ };
4268
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
4269
+ for (let i = start; i < children.length; i++) {
4270
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
4277
4271
  patch(
4278
- c1[i],
4279
- nextChild,
4280
- container,
4281
4272
  null,
4273
+ child,
4274
+ container,
4275
+ anchor,
4282
4276
  parentComponent,
4283
4277
  parentSuspense,
4284
4278
  namespace,
@@ -4286,1027 +4280,1091 @@ function baseCreateRenderer(options, createHydrationFns) {
4286
4280
  optimized
4287
4281
  );
4288
4282
  }
4289
- if (oldLength > newLength) {
4290
- unmountChildren(
4291
- c1,
4283
+ };
4284
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4285
+ const el = n2.el = n1.el;
4286
+ let { patchFlag, dynamicChildren, dirs } = n2;
4287
+ patchFlag |= n1.patchFlag & 16;
4288
+ const oldProps = n1.props || shared.EMPTY_OBJ;
4289
+ const newProps = n2.props || shared.EMPTY_OBJ;
4290
+ let vnodeHook;
4291
+ parentComponent && toggleRecurse(parentComponent, false);
4292
+ if (vnodeHook = newProps.onVnodeBeforeUpdate) {
4293
+ invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4294
+ }
4295
+ if (dirs) {
4296
+ invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4297
+ }
4298
+ parentComponent && toggleRecurse(parentComponent, true);
4299
+ if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
4300
+ hostSetElementText(el, "");
4301
+ }
4302
+ if (dynamicChildren) {
4303
+ patchBlockChildren(
4304
+ n1.dynamicChildren,
4305
+ dynamicChildren,
4306
+ el,
4292
4307
  parentComponent,
4293
4308
  parentSuspense,
4294
- true,
4295
- false,
4296
- commonLength
4309
+ resolveChildrenNamespace(n2, namespace),
4310
+ slotScopeIds
4297
4311
  );
4298
- } else {
4299
- mountChildren(
4300
- c2,
4301
- container,
4302
- anchor,
4312
+ } else if (!optimized) {
4313
+ patchChildren(
4314
+ n1,
4315
+ n2,
4316
+ el,
4317
+ null,
4303
4318
  parentComponent,
4304
4319
  parentSuspense,
4305
- namespace,
4320
+ resolveChildrenNamespace(n2, namespace),
4306
4321
  slotScopeIds,
4307
- optimized,
4308
- commonLength
4322
+ false
4309
4323
  );
4310
4324
  }
4311
- };
4312
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4313
- let i = 0;
4314
- const l2 = c2.length;
4315
- let e1 = c1.length - 1;
4316
- let e2 = l2 - 1;
4317
- while (i <= e1 && i <= e2) {
4318
- const n1 = c1[i];
4319
- const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
4320
- if (isSameVNodeType(n1, n2)) {
4321
- patch(
4322
- n1,
4323
- n2,
4324
- container,
4325
- null,
4326
- parentComponent,
4327
- parentSuspense,
4328
- namespace,
4329
- slotScopeIds,
4330
- optimized
4331
- );
4332
- } else {
4333
- break;
4334
- }
4335
- i++;
4336
- }
4337
- while (i <= e1 && i <= e2) {
4338
- const n1 = c1[e1];
4339
- const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
4340
- if (isSameVNodeType(n1, n2)) {
4341
- patch(
4342
- n1,
4343
- n2,
4344
- container,
4345
- null,
4346
- parentComponent,
4347
- parentSuspense,
4348
- namespace,
4349
- slotScopeIds,
4350
- optimized
4351
- );
4325
+ if (patchFlag > 0) {
4326
+ if (patchFlag & 16) {
4327
+ patchProps(el, oldProps, newProps, parentComponent, namespace);
4352
4328
  } else {
4353
- break;
4354
- }
4355
- e1--;
4356
- e2--;
4357
- }
4358
- if (i > e1) {
4359
- if (i <= e2) {
4360
- const nextPos = e2 + 1;
4361
- const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
4362
- while (i <= e2) {
4363
- patch(
4364
- null,
4365
- c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
4366
- container,
4367
- anchor,
4368
- parentComponent,
4369
- parentSuspense,
4370
- namespace,
4371
- slotScopeIds,
4372
- optimized
4373
- );
4374
- i++;
4375
- }
4376
- }
4377
- } else if (i > e2) {
4378
- while (i <= e1) {
4379
- unmount(c1[i], parentComponent, parentSuspense, true);
4380
- i++;
4381
- }
4382
- } else {
4383
- const s1 = i;
4384
- const s2 = i;
4385
- const keyToNewIndexMap = /* @__PURE__ */ new Map();
4386
- for (i = s2; i <= e2; i++) {
4387
- const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
4388
- if (nextChild.key != null) {
4389
- keyToNewIndexMap.set(nextChild.key, i);
4329
+ if (patchFlag & 2) {
4330
+ if (oldProps.class !== newProps.class) {
4331
+ hostPatchProp(el, "class", null, newProps.class, namespace);
4332
+ }
4390
4333
  }
4391
- }
4392
- let j;
4393
- let patched = 0;
4394
- const toBePatched = e2 - s2 + 1;
4395
- let moved = false;
4396
- let maxNewIndexSoFar = 0;
4397
- const newIndexToOldIndexMap = new Array(toBePatched);
4398
- for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
4399
- for (i = s1; i <= e1; i++) {
4400
- const prevChild = c1[i];
4401
- if (patched >= toBePatched) {
4402
- unmount(prevChild, parentComponent, parentSuspense, true);
4403
- continue;
4334
+ if (patchFlag & 4) {
4335
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
4404
4336
  }
4405
- let newIndex;
4406
- if (prevChild.key != null) {
4407
- newIndex = keyToNewIndexMap.get(prevChild.key);
4408
- } else {
4409
- for (j = s2; j <= e2; j++) {
4410
- if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
4411
- newIndex = j;
4412
- break;
4337
+ if (patchFlag & 8) {
4338
+ const propsToUpdate = n2.dynamicProps;
4339
+ for (let i = 0; i < propsToUpdate.length; i++) {
4340
+ const key = propsToUpdate[i];
4341
+ const prev = oldProps[key];
4342
+ const next = newProps[key];
4343
+ if (next !== prev || key === "value") {
4344
+ hostPatchProp(el, key, prev, next, namespace, parentComponent);
4413
4345
  }
4414
4346
  }
4415
4347
  }
4416
- if (newIndex === void 0) {
4417
- unmount(prevChild, parentComponent, parentSuspense, true);
4418
- } else {
4419
- newIndexToOldIndexMap[newIndex - s2] = i + 1;
4420
- if (newIndex >= maxNewIndexSoFar) {
4421
- maxNewIndexSoFar = newIndex;
4422
- } else {
4423
- moved = true;
4424
- }
4425
- patch(
4426
- prevChild,
4427
- c2[newIndex],
4428
- container,
4429
- null,
4430
- parentComponent,
4431
- parentSuspense,
4432
- namespace,
4433
- slotScopeIds,
4434
- optimized
4435
- );
4436
- patched++;
4437
- }
4438
4348
  }
4439
- const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
4440
- j = increasingNewIndexSequence.length - 1;
4441
- for (i = toBePatched - 1; i >= 0; i--) {
4442
- const nextIndex = s2 + i;
4443
- const nextChild = c2[nextIndex];
4444
- const anchorVNode = c2[nextIndex + 1];
4445
- const anchor = nextIndex + 1 < l2 ? (
4446
- // #13559, fallback to el placeholder for unresolved async component
4447
- anchorVNode.el || anchorVNode.placeholder
4448
- ) : parentAnchor;
4449
- if (newIndexToOldIndexMap[i] === 0) {
4450
- patch(
4451
- null,
4452
- nextChild,
4453
- container,
4454
- anchor,
4455
- parentComponent,
4456
- parentSuspense,
4457
- namespace,
4458
- slotScopeIds,
4459
- optimized
4460
- );
4461
- } else if (moved) {
4462
- if (j < 0 || i !== increasingNewIndexSequence[j]) {
4463
- move(nextChild, container, anchor, 2);
4464
- } else {
4465
- j--;
4466
- }
4349
+ if (patchFlag & 1) {
4350
+ if (n1.children !== n2.children) {
4351
+ hostSetElementText(el, n2.children);
4467
4352
  }
4468
4353
  }
4354
+ } else if (!optimized && dynamicChildren == null) {
4355
+ patchProps(el, oldProps, newProps, parentComponent, namespace);
4469
4356
  }
4470
- };
4471
- const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
4472
- const { el, type, transition, children, shapeFlag } = vnode;
4473
- if (shapeFlag & 6) {
4474
- move(vnode.component.subTree, container, anchor, moveType);
4475
- return;
4476
- }
4477
- if (shapeFlag & 128) {
4478
- vnode.suspense.move(container, anchor, moveType);
4479
- return;
4480
- }
4481
- if (shapeFlag & 64) {
4482
- type.move(vnode, container, anchor, internals);
4483
- return;
4484
- }
4485
- if (type === Fragment) {
4486
- hostInsert(el, container, anchor);
4487
- for (let i = 0; i < children.length; i++) {
4488
- move(children[i], container, anchor, moveType);
4489
- }
4490
- hostInsert(vnode.anchor, container, anchor);
4491
- return;
4357
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
4358
+ queuePostRenderEffect(() => {
4359
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4360
+ dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4361
+ }, parentSuspense);
4492
4362
  }
4493
- if (type === Static) {
4494
- moveStaticNode(vnode, container, anchor);
4495
- return;
4363
+ };
4364
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
4365
+ for (let i = 0; i < newChildren.length; i++) {
4366
+ const oldVNode = oldChildren[i];
4367
+ const newVNode = newChildren[i];
4368
+ const container = (
4369
+ // oldVNode may be an errored async setup() component inside Suspense
4370
+ // which will not have a mounted element
4371
+ oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
4372
+ // of the Fragment itself so it can move its children.
4373
+ (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
4374
+ // which also requires the correct parent container
4375
+ !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
4376
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
4377
+ // In other cases, the parent container is not actually used so we
4378
+ // just pass the block element here to avoid a DOM parentNode call.
4379
+ fallbackContainer
4380
+ )
4381
+ );
4382
+ patch(
4383
+ oldVNode,
4384
+ newVNode,
4385
+ container,
4386
+ null,
4387
+ parentComponent,
4388
+ parentSuspense,
4389
+ namespace,
4390
+ slotScopeIds,
4391
+ true
4392
+ );
4496
4393
  }
4497
- const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
4498
- if (needTransition2) {
4499
- if (moveType === 0) {
4500
- transition.beforeEnter(el);
4501
- hostInsert(el, container, anchor);
4502
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
4503
- } else {
4504
- const { leave, delayLeave, afterLeave } = transition;
4505
- const remove2 = () => {
4506
- if (vnode.ctx.isUnmounted) {
4507
- hostRemove(el);
4508
- } else {
4509
- hostInsert(el, container, anchor);
4510
- }
4511
- };
4512
- const performLeave = () => {
4513
- if (el._isLeaving) {
4514
- el[leaveCbKey](
4515
- true
4516
- /* cancelled */
4394
+ };
4395
+ const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
4396
+ if (oldProps !== newProps) {
4397
+ if (oldProps !== shared.EMPTY_OBJ) {
4398
+ for (const key in oldProps) {
4399
+ if (!shared.isReservedProp(key) && !(key in newProps)) {
4400
+ hostPatchProp(
4401
+ el,
4402
+ key,
4403
+ oldProps[key],
4404
+ null,
4405
+ namespace,
4406
+ parentComponent
4517
4407
  );
4518
4408
  }
4519
- leave(el, () => {
4520
- remove2();
4521
- afterLeave && afterLeave();
4522
- });
4523
- };
4524
- if (delayLeave) {
4525
- delayLeave(el, remove2, performLeave);
4526
- } else {
4527
- performLeave();
4528
4409
  }
4529
4410
  }
4530
- } else {
4531
- hostInsert(el, container, anchor);
4411
+ for (const key in newProps) {
4412
+ if (shared.isReservedProp(key)) continue;
4413
+ const next = newProps[key];
4414
+ const prev = oldProps[key];
4415
+ if (next !== prev && key !== "value") {
4416
+ hostPatchProp(el, key, prev, next, namespace, parentComponent);
4417
+ }
4418
+ }
4419
+ if ("value" in newProps) {
4420
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
4421
+ }
4532
4422
  }
4533
4423
  };
4534
- const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
4535
- const {
4536
- type,
4537
- props,
4538
- ref,
4539
- children,
4540
- dynamicChildren,
4541
- shapeFlag,
4542
- patchFlag,
4543
- dirs,
4544
- cacheIndex
4545
- } = vnode;
4546
- if (patchFlag === -2) {
4547
- optimized = false;
4548
- }
4549
- if (ref != null) {
4550
- reactivity.pauseTracking();
4551
- setRef(ref, null, parentSuspense, vnode, true);
4552
- reactivity.resetTracking();
4553
- }
4554
- if (cacheIndex != null) {
4555
- parentComponent.renderCache[cacheIndex] = void 0;
4556
- }
4557
- if (shapeFlag & 256) {
4558
- parentComponent.ctx.deactivate(vnode);
4559
- return;
4560
- }
4561
- const shouldInvokeDirs = shapeFlag & 1 && dirs;
4562
- const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
4563
- let vnodeHook;
4564
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
4565
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
4424
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4425
+ const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
4426
+ const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
4427
+ let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
4428
+ if (fragmentSlotScopeIds) {
4429
+ slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
4566
4430
  }
4567
- if (shapeFlag & 6) {
4568
- unmountComponent(vnode.component, parentSuspense, doRemove);
4431
+ if (n1 == null) {
4432
+ hostInsert(fragmentStartAnchor, container, anchor);
4433
+ hostInsert(fragmentEndAnchor, container, anchor);
4434
+ mountChildren(
4435
+ // #10007
4436
+ // such fragment like `<></>` will be compiled into
4437
+ // a fragment which doesn't have a children.
4438
+ // In this case fallback to an empty array
4439
+ n2.children || [],
4440
+ container,
4441
+ fragmentEndAnchor,
4442
+ parentComponent,
4443
+ parentSuspense,
4444
+ namespace,
4445
+ slotScopeIds,
4446
+ optimized
4447
+ );
4569
4448
  } else {
4570
- if (shapeFlag & 128) {
4571
- vnode.suspense.unmount(parentSuspense, doRemove);
4572
- return;
4573
- }
4574
- if (shouldInvokeDirs) {
4575
- invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4576
- }
4577
- if (shapeFlag & 64) {
4578
- vnode.type.remove(
4579
- vnode,
4580
- parentComponent,
4581
- parentSuspense,
4582
- internals,
4583
- doRemove
4584
- );
4585
- } else if (dynamicChildren && // #5154
4586
- // when v-once is used inside a block, setBlockTracking(-1) marks the
4587
- // parent block with hasOnce: true
4588
- // so that it doesn't take the fast path during unmount - otherwise
4589
- // components nested in v-once are never unmounted.
4590
- !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
4591
- (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
4592
- unmountChildren(
4449
+ if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
4450
+ // of renderSlot() with no valid children
4451
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
4452
+ patchBlockChildren(
4453
+ n1.dynamicChildren,
4593
4454
  dynamicChildren,
4455
+ container,
4594
4456
  parentComponent,
4595
4457
  parentSuspense,
4596
- false,
4597
- true
4458
+ namespace,
4459
+ slotScopeIds
4460
+ );
4461
+ if (
4462
+ // #2080 if the stable fragment has a key, it's a <template v-for> that may
4463
+ // get moved around. Make sure all root level vnodes inherit el.
4464
+ // #2134 or if it's a component root, it may also get moved around
4465
+ // as the component is being moved.
4466
+ n2.key != null || parentComponent && n2 === parentComponent.subTree
4467
+ ) {
4468
+ traverseStaticChildren(
4469
+ n1,
4470
+ n2,
4471
+ true
4472
+ /* shallow */
4473
+ );
4474
+ }
4475
+ } else {
4476
+ patchChildren(
4477
+ n1,
4478
+ n2,
4479
+ container,
4480
+ fragmentEndAnchor,
4481
+ parentComponent,
4482
+ parentSuspense,
4483
+ namespace,
4484
+ slotScopeIds,
4485
+ optimized
4598
4486
  );
4599
- } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
4600
- unmountChildren(children, parentComponent, parentSuspense);
4601
- }
4602
- if (doRemove) {
4603
- remove(vnode);
4604
- }
4605
- }
4606
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
4607
- queuePostRenderEffect(() => {
4608
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4609
- shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
4610
- }, parentSuspense);
4611
- }
4612
- };
4613
- const remove = (vnode) => {
4614
- const { type, el, anchor, transition } = vnode;
4615
- if (type === Fragment) {
4616
- {
4617
- removeFragment(el, anchor);
4618
4487
  }
4619
- return;
4620
4488
  }
4621
- if (type === Static) {
4622
- removeStaticNode(vnode);
4623
- return;
4624
- }
4625
- const performRemove = () => {
4626
- hostRemove(el);
4627
- if (transition && !transition.persisted && transition.afterLeave) {
4628
- transition.afterLeave();
4629
- }
4630
- };
4631
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
4632
- const { leave, delayLeave } = transition;
4633
- const performLeave = () => leave(el, performRemove);
4634
- if (delayLeave) {
4635
- delayLeave(vnode.el, performRemove, performLeave);
4489
+ };
4490
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4491
+ n2.slotScopeIds = slotScopeIds;
4492
+ if (n1 == null) {
4493
+ if (n2.shapeFlag & 512) {
4494
+ parentComponent.ctx.activate(
4495
+ n2,
4496
+ container,
4497
+ anchor,
4498
+ namespace,
4499
+ optimized
4500
+ );
4636
4501
  } else {
4637
- performLeave();
4502
+ mountComponent(
4503
+ n2,
4504
+ container,
4505
+ anchor,
4506
+ parentComponent,
4507
+ parentSuspense,
4508
+ namespace,
4509
+ optimized
4510
+ );
4638
4511
  }
4639
4512
  } else {
4640
- performRemove();
4641
- }
4642
- };
4643
- const removeFragment = (cur, end) => {
4644
- let next;
4645
- while (cur !== end) {
4646
- next = hostNextSibling(cur);
4647
- hostRemove(cur);
4648
- cur = next;
4649
- }
4650
- hostRemove(end);
4651
- };
4652
- const unmountComponent = (instance, parentSuspense, doRemove) => {
4653
- const { bum, scope, job, subTree, um, m, a } = instance;
4654
- invalidateMount(m);
4655
- invalidateMount(a);
4656
- if (bum) {
4657
- shared.invokeArrayFns(bum);
4658
- }
4659
- scope.stop();
4660
- if (job) {
4661
- job.flags |= 8;
4662
- unmount(subTree, instance, parentSuspense, doRemove);
4663
- }
4664
- if (um) {
4665
- queuePostRenderEffect(um, parentSuspense);
4666
- }
4667
- queuePostRenderEffect(() => {
4668
- instance.isUnmounted = true;
4669
- }, parentSuspense);
4670
- };
4671
- const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
4672
- for (let i = start; i < children.length; i++) {
4673
- unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
4513
+ updateComponent(n1, n2, optimized);
4674
4514
  }
4675
4515
  };
4676
- const getNextHostNode = (vnode) => {
4677
- if (vnode.shapeFlag & 6) {
4678
- return getNextHostNode(vnode.component.subTree);
4516
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
4517
+ const instance = (initialVNode.component = createComponentInstance(
4518
+ initialVNode,
4519
+ parentComponent,
4520
+ parentSuspense
4521
+ ));
4522
+ if (isKeepAlive(initialVNode)) {
4523
+ instance.ctx.renderer = internals;
4679
4524
  }
4680
- if (vnode.shapeFlag & 128) {
4681
- return vnode.suspense.next();
4525
+ {
4526
+ setupComponent(instance, false, optimized);
4682
4527
  }
4683
- const el = hostNextSibling(vnode.anchor || vnode.el);
4684
- const teleportEnd = el && el[TeleportEndKey];
4685
- return teleportEnd ? hostNextSibling(teleportEnd) : el;
4686
- };
4687
- let isFlushing = false;
4688
- const render = (vnode, container, namespace) => {
4689
- if (vnode == null) {
4690
- if (container._vnode) {
4691
- unmount(container._vnode, null, null, true);
4528
+ if (instance.asyncDep) {
4529
+ parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
4530
+ if (!initialVNode.el) {
4531
+ const placeholder = instance.subTree = createVNode(Comment);
4532
+ processCommentNode(null, placeholder, container, anchor);
4533
+ initialVNode.placeholder = placeholder.el;
4692
4534
  }
4693
4535
  } else {
4694
- patch(
4695
- container._vnode || null,
4696
- vnode,
4536
+ setupRenderEffect(
4537
+ instance,
4538
+ initialVNode,
4697
4539
  container,
4698
- null,
4699
- null,
4700
- null,
4701
- namespace
4540
+ anchor,
4541
+ parentSuspense,
4542
+ namespace,
4543
+ optimized
4702
4544
  );
4703
4545
  }
4704
- container._vnode = vnode;
4705
- if (!isFlushing) {
4706
- isFlushing = true;
4707
- flushPreFlushCbs();
4708
- flushPostFlushCbs();
4709
- isFlushing = false;
4710
- }
4711
- };
4712
- const internals = {
4713
- p: patch,
4714
- um: unmount,
4715
- m: move,
4716
- r: remove,
4717
- mt: mountComponent,
4718
- mc: mountChildren,
4719
- pc: patchChildren,
4720
- pbc: patchBlockChildren,
4721
- n: getNextHostNode,
4722
- o: options
4723
- };
4724
- let hydrate;
4725
- let hydrateNode;
4726
- if (createHydrationFns) {
4727
- [hydrate, hydrateNode] = createHydrationFns(
4728
- internals
4729
- );
4730
- }
4731
- return {
4732
- render,
4733
- hydrate,
4734
- createApp: createAppAPI(render, hydrate)
4735
4546
  };
4736
- }
4737
- function resolveChildrenNamespace({ type, props }, currentNamespace) {
4738
- return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
4739
- }
4740
- function toggleRecurse({ effect, job }, allowed) {
4741
- if (allowed) {
4742
- effect.flags |= 32;
4743
- job.flags |= 4;
4744
- } else {
4745
- effect.flags &= -33;
4746
- job.flags &= -5;
4747
- }
4748
- }
4749
- function needTransition(parentSuspense, transition) {
4750
- return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
4751
- }
4752
- function traverseStaticChildren(n1, n2, shallow = false) {
4753
- const ch1 = n1.children;
4754
- const ch2 = n2.children;
4755
- if (shared.isArray(ch1) && shared.isArray(ch2)) {
4756
- for (let i = 0; i < ch1.length; i++) {
4757
- const c1 = ch1[i];
4758
- let c2 = ch2[i];
4759
- if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
4760
- if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
4761
- c2 = ch2[i] = cloneIfMounted(ch2[i]);
4762
- c2.el = c1.el;
4763
- }
4764
- if (!shallow && c2.patchFlag !== -2)
4765
- traverseStaticChildren(c1, c2);
4766
- }
4767
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
4768
- c2.patchFlag !== -1) {
4769
- c2.el = c1.el;
4770
- }
4771
- if (c2.type === Comment && !c2.el) {
4772
- c2.el = c1.el;
4547
+ const updateComponent = (n1, n2, optimized) => {
4548
+ const instance = n2.component = n1.component;
4549
+ if (shouldUpdateComponent(n1, n2, optimized)) {
4550
+ if (instance.asyncDep && !instance.asyncResolved) {
4551
+ updateComponentPreRender(instance, n2, optimized);
4552
+ return;
4553
+ } else {
4554
+ instance.next = n2;
4555
+ instance.update();
4773
4556
  }
4557
+ } else {
4558
+ n2.el = n1.el;
4559
+ instance.vnode = n2;
4774
4560
  }
4775
- }
4776
- }
4777
- function getSequence(arr) {
4778
- const p = arr.slice();
4779
- const result = [0];
4780
- let i, j, u, v, c;
4781
- const len = arr.length;
4782
- for (i = 0; i < len; i++) {
4783
- const arrI = arr[i];
4784
- if (arrI !== 0) {
4785
- j = result[result.length - 1];
4786
- if (arr[j] < arrI) {
4787
- p[i] = j;
4788
- result.push(i);
4789
- continue;
4790
- }
4791
- u = 0;
4792
- v = result.length - 1;
4793
- while (u < v) {
4794
- c = u + v >> 1;
4795
- if (arr[result[c]] < arrI) {
4796
- u = c + 1;
4797
- } else {
4798
- v = c;
4561
+ };
4562
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
4563
+ const componentUpdateFn = () => {
4564
+ if (!instance.isMounted) {
4565
+ let vnodeHook;
4566
+ const { el, props } = initialVNode;
4567
+ const { bm, m, parent, root, type } = instance;
4568
+ const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
4569
+ toggleRecurse(instance, false);
4570
+ if (bm) {
4571
+ shared.invokeArrayFns(bm);
4572
+ }
4573
+ if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
4574
+ invokeVNodeHook(vnodeHook, parent, initialVNode);
4575
+ }
4576
+ toggleRecurse(instance, true);
4577
+ if (el && hydrateNode) {
4578
+ const hydrateSubTree = () => {
4579
+ instance.subTree = renderComponentRoot(instance);
4580
+ hydrateNode(
4581
+ el,
4582
+ instance.subTree,
4583
+ instance,
4584
+ parentSuspense,
4585
+ null
4586
+ );
4587
+ };
4588
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
4589
+ type.__asyncHydrate(
4590
+ el,
4591
+ instance,
4592
+ hydrateSubTree
4593
+ );
4594
+ } else {
4595
+ hydrateSubTree();
4596
+ }
4597
+ } else {
4598
+ if (root.ce && root.ce._hasShadowRoot()) {
4599
+ root.ce._injectChildStyle(type);
4600
+ }
4601
+ const subTree = instance.subTree = renderComponentRoot(instance);
4602
+ patch(
4603
+ null,
4604
+ subTree,
4605
+ container,
4606
+ anchor,
4607
+ instance,
4608
+ parentSuspense,
4609
+ namespace
4610
+ );
4611
+ initialVNode.el = subTree.el;
4612
+ }
4613
+ if (m) {
4614
+ queuePostRenderEffect(m, parentSuspense);
4615
+ }
4616
+ if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
4617
+ const scopedInitialVNode = initialVNode;
4618
+ queuePostRenderEffect(
4619
+ () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
4620
+ parentSuspense
4621
+ );
4622
+ }
4623
+ if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
4624
+ instance.a && queuePostRenderEffect(instance.a, parentSuspense);
4625
+ }
4626
+ instance.isMounted = true;
4627
+ initialVNode = container = anchor = null;
4628
+ } else {
4629
+ let { next, bu, u, parent, vnode } = instance;
4630
+ {
4631
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
4632
+ if (nonHydratedAsyncRoot) {
4633
+ if (next) {
4634
+ next.el = vnode.el;
4635
+ updateComponentPreRender(instance, next, optimized);
4636
+ }
4637
+ nonHydratedAsyncRoot.asyncDep.then(() => {
4638
+ queuePostRenderEffect(() => {
4639
+ if (!instance.isUnmounted) update();
4640
+ }, parentSuspense);
4641
+ });
4642
+ return;
4643
+ }
4644
+ }
4645
+ let originNext = next;
4646
+ let vnodeHook;
4647
+ toggleRecurse(instance, false);
4648
+ if (next) {
4649
+ next.el = vnode.el;
4650
+ updateComponentPreRender(instance, next, optimized);
4651
+ } else {
4652
+ next = vnode;
4653
+ }
4654
+ if (bu) {
4655
+ shared.invokeArrayFns(bu);
4656
+ }
4657
+ if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
4658
+ invokeVNodeHook(vnodeHook, parent, next, vnode);
4659
+ }
4660
+ toggleRecurse(instance, true);
4661
+ const nextTree = renderComponentRoot(instance);
4662
+ const prevTree = instance.subTree;
4663
+ instance.subTree = nextTree;
4664
+ patch(
4665
+ prevTree,
4666
+ nextTree,
4667
+ // parent may have changed if it's in a teleport
4668
+ hostParentNode(prevTree.el),
4669
+ // anchor may have changed if it's in a fragment
4670
+ getNextHostNode(prevTree),
4671
+ instance,
4672
+ parentSuspense,
4673
+ namespace
4674
+ );
4675
+ next.el = nextTree.el;
4676
+ if (originNext === null) {
4677
+ updateHOCHostEl(instance, nextTree.el);
4678
+ }
4679
+ if (u) {
4680
+ queuePostRenderEffect(u, parentSuspense);
4681
+ }
4682
+ if (vnodeHook = next.props && next.props.onVnodeUpdated) {
4683
+ queuePostRenderEffect(
4684
+ () => invokeVNodeHook(vnodeHook, parent, next, vnode),
4685
+ parentSuspense
4686
+ );
4687
+ }
4688
+ }
4689
+ };
4690
+ instance.scope.on();
4691
+ const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
4692
+ instance.scope.off();
4693
+ const update = instance.update = effect.run.bind(effect);
4694
+ const job = instance.job = effect.runIfDirty.bind(effect);
4695
+ job.i = instance;
4696
+ job.id = instance.uid;
4697
+ effect.scheduler = () => queueJob(job);
4698
+ toggleRecurse(instance, true);
4699
+ update();
4700
+ };
4701
+ const updateComponentPreRender = (instance, nextVNode, optimized) => {
4702
+ nextVNode.component = instance;
4703
+ const prevProps = instance.vnode.props;
4704
+ instance.vnode = nextVNode;
4705
+ instance.next = null;
4706
+ updateProps(instance, nextVNode.props, prevProps, optimized);
4707
+ updateSlots(instance, nextVNode.children, optimized);
4708
+ reactivity.pauseTracking();
4709
+ flushPreFlushCbs(instance);
4710
+ reactivity.resetTracking();
4711
+ };
4712
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
4713
+ const c1 = n1 && n1.children;
4714
+ const prevShapeFlag = n1 ? n1.shapeFlag : 0;
4715
+ const c2 = n2.children;
4716
+ const { patchFlag, shapeFlag } = n2;
4717
+ if (patchFlag > 0) {
4718
+ if (patchFlag & 128) {
4719
+ patchKeyedChildren(
4720
+ c1,
4721
+ c2,
4722
+ container,
4723
+ anchor,
4724
+ parentComponent,
4725
+ parentSuspense,
4726
+ namespace,
4727
+ slotScopeIds,
4728
+ optimized
4729
+ );
4730
+ return;
4731
+ } else if (patchFlag & 256) {
4732
+ patchUnkeyedChildren(
4733
+ c1,
4734
+ c2,
4735
+ container,
4736
+ anchor,
4737
+ parentComponent,
4738
+ parentSuspense,
4739
+ namespace,
4740
+ slotScopeIds,
4741
+ optimized
4742
+ );
4743
+ return;
4744
+ }
4745
+ }
4746
+ if (shapeFlag & 8) {
4747
+ if (prevShapeFlag & 16) {
4748
+ unmountChildren(c1, parentComponent, parentSuspense);
4749
+ }
4750
+ if (c2 !== c1) {
4751
+ hostSetElementText(container, c2);
4752
+ }
4753
+ } else {
4754
+ if (prevShapeFlag & 16) {
4755
+ if (shapeFlag & 16) {
4756
+ patchKeyedChildren(
4757
+ c1,
4758
+ c2,
4759
+ container,
4760
+ anchor,
4761
+ parentComponent,
4762
+ parentSuspense,
4763
+ namespace,
4764
+ slotScopeIds,
4765
+ optimized
4766
+ );
4767
+ } else {
4768
+ unmountChildren(c1, parentComponent, parentSuspense, true);
4799
4769
  }
4770
+ } else {
4771
+ if (prevShapeFlag & 8) {
4772
+ hostSetElementText(container, "");
4773
+ }
4774
+ if (shapeFlag & 16) {
4775
+ mountChildren(
4776
+ c2,
4777
+ container,
4778
+ anchor,
4779
+ parentComponent,
4780
+ parentSuspense,
4781
+ namespace,
4782
+ slotScopeIds,
4783
+ optimized
4784
+ );
4785
+ }
4786
+ }
4787
+ }
4788
+ };
4789
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4790
+ c1 = c1 || shared.EMPTY_ARR;
4791
+ c2 = c2 || shared.EMPTY_ARR;
4792
+ const oldLength = c1.length;
4793
+ const newLength = c2.length;
4794
+ const commonLength = Math.min(oldLength, newLength);
4795
+ let i;
4796
+ for (i = 0; i < commonLength; i++) {
4797
+ const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
4798
+ patch(
4799
+ c1[i],
4800
+ nextChild,
4801
+ container,
4802
+ null,
4803
+ parentComponent,
4804
+ parentSuspense,
4805
+ namespace,
4806
+ slotScopeIds,
4807
+ optimized
4808
+ );
4809
+ }
4810
+ if (oldLength > newLength) {
4811
+ unmountChildren(
4812
+ c1,
4813
+ parentComponent,
4814
+ parentSuspense,
4815
+ true,
4816
+ false,
4817
+ commonLength
4818
+ );
4819
+ } else {
4820
+ mountChildren(
4821
+ c2,
4822
+ container,
4823
+ anchor,
4824
+ parentComponent,
4825
+ parentSuspense,
4826
+ namespace,
4827
+ slotScopeIds,
4828
+ optimized,
4829
+ commonLength
4830
+ );
4831
+ }
4832
+ };
4833
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4834
+ let i = 0;
4835
+ const l2 = c2.length;
4836
+ let e1 = c1.length - 1;
4837
+ let e2 = l2 - 1;
4838
+ while (i <= e1 && i <= e2) {
4839
+ const n1 = c1[i];
4840
+ const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
4841
+ if (isSameVNodeType(n1, n2)) {
4842
+ patch(
4843
+ n1,
4844
+ n2,
4845
+ container,
4846
+ null,
4847
+ parentComponent,
4848
+ parentSuspense,
4849
+ namespace,
4850
+ slotScopeIds,
4851
+ optimized
4852
+ );
4853
+ } else {
4854
+ break;
4855
+ }
4856
+ i++;
4857
+ }
4858
+ while (i <= e1 && i <= e2) {
4859
+ const n1 = c1[e1];
4860
+ const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
4861
+ if (isSameVNodeType(n1, n2)) {
4862
+ patch(
4863
+ n1,
4864
+ n2,
4865
+ container,
4866
+ null,
4867
+ parentComponent,
4868
+ parentSuspense,
4869
+ namespace,
4870
+ slotScopeIds,
4871
+ optimized
4872
+ );
4873
+ } else {
4874
+ break;
4875
+ }
4876
+ e1--;
4877
+ e2--;
4878
+ }
4879
+ if (i > e1) {
4880
+ if (i <= e2) {
4881
+ const nextPos = e2 + 1;
4882
+ const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
4883
+ while (i <= e2) {
4884
+ patch(
4885
+ null,
4886
+ c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
4887
+ container,
4888
+ anchor,
4889
+ parentComponent,
4890
+ parentSuspense,
4891
+ namespace,
4892
+ slotScopeIds,
4893
+ optimized
4894
+ );
4895
+ i++;
4896
+ }
4897
+ }
4898
+ } else if (i > e2) {
4899
+ while (i <= e1) {
4900
+ unmount(c1[i], parentComponent, parentSuspense, true);
4901
+ i++;
4902
+ }
4903
+ } else {
4904
+ const s1 = i;
4905
+ const s2 = i;
4906
+ const keyToNewIndexMap = /* @__PURE__ */ new Map();
4907
+ for (i = s2; i <= e2; i++) {
4908
+ const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
4909
+ if (nextChild.key != null) {
4910
+ keyToNewIndexMap.set(nextChild.key, i);
4911
+ }
4912
+ }
4913
+ let j;
4914
+ let patched = 0;
4915
+ const toBePatched = e2 - s2 + 1;
4916
+ let moved = false;
4917
+ let maxNewIndexSoFar = 0;
4918
+ const newIndexToOldIndexMap = new Array(toBePatched);
4919
+ for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
4920
+ for (i = s1; i <= e1; i++) {
4921
+ const prevChild = c1[i];
4922
+ if (patched >= toBePatched) {
4923
+ unmount(prevChild, parentComponent, parentSuspense, true);
4924
+ continue;
4925
+ }
4926
+ let newIndex;
4927
+ if (prevChild.key != null) {
4928
+ newIndex = keyToNewIndexMap.get(prevChild.key);
4929
+ } else {
4930
+ for (j = s2; j <= e2; j++) {
4931
+ if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
4932
+ newIndex = j;
4933
+ break;
4934
+ }
4935
+ }
4936
+ }
4937
+ if (newIndex === void 0) {
4938
+ unmount(prevChild, parentComponent, parentSuspense, true);
4939
+ } else {
4940
+ newIndexToOldIndexMap[newIndex - s2] = i + 1;
4941
+ if (newIndex >= maxNewIndexSoFar) {
4942
+ maxNewIndexSoFar = newIndex;
4943
+ } else {
4944
+ moved = true;
4945
+ }
4946
+ patch(
4947
+ prevChild,
4948
+ c2[newIndex],
4949
+ container,
4950
+ null,
4951
+ parentComponent,
4952
+ parentSuspense,
4953
+ namespace,
4954
+ slotScopeIds,
4955
+ optimized
4956
+ );
4957
+ patched++;
4958
+ }
4959
+ }
4960
+ const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
4961
+ j = increasingNewIndexSequence.length - 1;
4962
+ for (i = toBePatched - 1; i >= 0; i--) {
4963
+ const nextIndex = s2 + i;
4964
+ const nextChild = c2[nextIndex];
4965
+ const anchorVNode = c2[nextIndex + 1];
4966
+ const anchor = nextIndex + 1 < l2 ? (
4967
+ // #13559, #14173 fallback to el placeholder for unresolved async component
4968
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
4969
+ ) : parentAnchor;
4970
+ if (newIndexToOldIndexMap[i] === 0) {
4971
+ patch(
4972
+ null,
4973
+ nextChild,
4974
+ container,
4975
+ anchor,
4976
+ parentComponent,
4977
+ parentSuspense,
4978
+ namespace,
4979
+ slotScopeIds,
4980
+ optimized
4981
+ );
4982
+ } else if (moved) {
4983
+ if (j < 0 || i !== increasingNewIndexSequence[j]) {
4984
+ move(nextChild, container, anchor, 2);
4985
+ } else {
4986
+ j--;
4987
+ }
4988
+ }
4989
+ }
4990
+ }
4991
+ };
4992
+ const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
4993
+ const { el, type, transition, children, shapeFlag } = vnode;
4994
+ if (shapeFlag & 6) {
4995
+ move(vnode.component.subTree, container, anchor, moveType);
4996
+ return;
4997
+ }
4998
+ if (shapeFlag & 128) {
4999
+ vnode.suspense.move(container, anchor, moveType);
5000
+ return;
5001
+ }
5002
+ if (shapeFlag & 64) {
5003
+ type.move(vnode, container, anchor, internals);
5004
+ return;
5005
+ }
5006
+ if (type === Fragment) {
5007
+ hostInsert(el, container, anchor);
5008
+ for (let i = 0; i < children.length; i++) {
5009
+ move(children[i], container, anchor, moveType);
4800
5010
  }
4801
- if (arrI < arr[result[u]]) {
4802
- if (u > 0) {
4803
- p[i] = result[u - 1];
5011
+ hostInsert(vnode.anchor, container, anchor);
5012
+ return;
5013
+ }
5014
+ if (type === Static) {
5015
+ moveStaticNode(vnode, container, anchor);
5016
+ return;
5017
+ }
5018
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
5019
+ if (needTransition2) {
5020
+ if (moveType === 0) {
5021
+ transition.beforeEnter(el);
5022
+ hostInsert(el, container, anchor);
5023
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
5024
+ } else {
5025
+ const { leave, delayLeave, afterLeave } = transition;
5026
+ const remove2 = () => {
5027
+ if (vnode.ctx.isUnmounted) {
5028
+ hostRemove(el);
5029
+ } else {
5030
+ hostInsert(el, container, anchor);
5031
+ }
5032
+ };
5033
+ const performLeave = () => {
5034
+ if (el._isLeaving) {
5035
+ el[leaveCbKey](
5036
+ true
5037
+ /* cancelled */
5038
+ );
5039
+ }
5040
+ leave(el, () => {
5041
+ remove2();
5042
+ afterLeave && afterLeave();
5043
+ });
5044
+ };
5045
+ if (delayLeave) {
5046
+ delayLeave(el, remove2, performLeave);
5047
+ } else {
5048
+ performLeave();
4804
5049
  }
4805
- result[u] = i;
4806
5050
  }
4807
- }
4808
- }
4809
- u = result.length;
4810
- v = result[u - 1];
4811
- while (u-- > 0) {
4812
- result[u] = v;
4813
- v = p[v];
4814
- }
4815
- return result;
4816
- }
4817
- function locateNonHydratedAsyncRoot(instance) {
4818
- const subComponent = instance.subTree.component;
4819
- if (subComponent) {
4820
- if (subComponent.asyncDep && !subComponent.asyncResolved) {
4821
- return subComponent;
4822
5051
  } else {
4823
- return locateNonHydratedAsyncRoot(subComponent);
5052
+ hostInsert(el, container, anchor);
4824
5053
  }
4825
- }
4826
- }
4827
- function invalidateMount(hooks) {
4828
- if (hooks) {
4829
- for (let i = 0; i < hooks.length; i++)
4830
- hooks[i].flags |= 8;
4831
- }
4832
- }
4833
-
4834
- const ssrContextKey = Symbol.for("v-scx");
4835
- const useSSRContext = () => {
4836
- {
4837
- const ctx = inject(ssrContextKey);
4838
- return ctx;
4839
- }
4840
- };
4841
-
4842
- function watchEffect(effect, options) {
4843
- return doWatch(effect, null, options);
4844
- }
4845
- function watchPostEffect(effect, options) {
4846
- return doWatch(
4847
- effect,
4848
- null,
4849
- { flush: "post" }
4850
- );
4851
- }
4852
- function watchSyncEffect(effect, options) {
4853
- return doWatch(
4854
- effect,
4855
- null,
4856
- { flush: "sync" }
4857
- );
4858
- }
4859
- function watch(source, cb, options) {
4860
- return doWatch(source, cb, options);
4861
- }
4862
- function doWatch(source, cb, options = shared.EMPTY_OBJ) {
4863
- const { immediate, deep, flush, once } = options;
4864
- const baseWatchOptions = shared.extend({}, options);
4865
- const runsImmediately = cb && immediate || !cb && flush !== "post";
4866
- let ssrCleanup;
4867
- if (isInSSRComponentSetup) {
4868
- if (flush === "sync") {
4869
- const ctx = useSSRContext();
4870
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4871
- } else if (!runsImmediately) {
4872
- const watchStopHandle = () => {
4873
- };
4874
- watchStopHandle.stop = shared.NOOP;
4875
- watchStopHandle.resume = shared.NOOP;
4876
- watchStopHandle.pause = shared.NOOP;
4877
- return watchStopHandle;
5054
+ };
5055
+ const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
5056
+ const {
5057
+ type,
5058
+ props,
5059
+ ref,
5060
+ children,
5061
+ dynamicChildren,
5062
+ shapeFlag,
5063
+ patchFlag,
5064
+ dirs,
5065
+ cacheIndex
5066
+ } = vnode;
5067
+ if (patchFlag === -2) {
5068
+ optimized = false;
4878
5069
  }
4879
- }
4880
- const instance = currentInstance;
4881
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
4882
- let isPre = false;
4883
- if (flush === "post") {
4884
- baseWatchOptions.scheduler = (job) => {
4885
- queuePostRenderEffect(job, instance && instance.suspense);
4886
- };
4887
- } else if (flush !== "sync") {
4888
- isPre = true;
4889
- baseWatchOptions.scheduler = (job, isFirstRun) => {
4890
- if (isFirstRun) {
4891
- job();
4892
- } else {
4893
- queueJob(job);
4894
- }
4895
- };
4896
- }
4897
- baseWatchOptions.augmentJob = (job) => {
4898
- if (cb) {
4899
- job.flags |= 4;
5070
+ if (ref != null) {
5071
+ reactivity.pauseTracking();
5072
+ setRef(ref, null, parentSuspense, vnode, true);
5073
+ reactivity.resetTracking();
4900
5074
  }
4901
- if (isPre) {
4902
- job.flags |= 2;
4903
- if (instance) {
4904
- job.id = instance.uid;
4905
- job.i = instance;
4906
- }
5075
+ if (cacheIndex != null) {
5076
+ parentComponent.renderCache[cacheIndex] = void 0;
4907
5077
  }
4908
- };
4909
- const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
4910
- if (isInSSRComponentSetup) {
4911
- if (ssrCleanup) {
4912
- ssrCleanup.push(watchHandle);
4913
- } else if (runsImmediately) {
4914
- watchHandle();
5078
+ if (shapeFlag & 256) {
5079
+ parentComponent.ctx.deactivate(vnode);
5080
+ return;
4915
5081
  }
4916
- }
4917
- return watchHandle;
4918
- }
4919
- function instanceWatch(source, value, options) {
4920
- const publicThis = this.proxy;
4921
- const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
4922
- let cb;
4923
- if (shared.isFunction(value)) {
4924
- cb = value;
4925
- } else {
4926
- cb = value.handler;
4927
- options = value;
4928
- }
4929
- const reset = setCurrentInstance(this);
4930
- const res = doWatch(getter, cb.bind(publicThis), options);
4931
- reset();
4932
- return res;
4933
- }
4934
- function createPathGetter(ctx, path) {
4935
- const segments = path.split(".");
4936
- return () => {
4937
- let cur = ctx;
4938
- for (let i = 0; i < segments.length && cur; i++) {
4939
- cur = cur[segments[i]];
5082
+ const shouldInvokeDirs = shapeFlag & 1 && dirs;
5083
+ const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
5084
+ let vnodeHook;
5085
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
5086
+ invokeVNodeHook(vnodeHook, parentComponent, vnode);
4940
5087
  }
4941
- return cur;
4942
- };
4943
- }
4944
-
4945
- function useModel(props, name, options = shared.EMPTY_OBJ) {
4946
- const i = getCurrentInstance();
4947
- const camelizedName = shared.camelize(name);
4948
- const hyphenatedName = shared.hyphenate(name);
4949
- const modifiers = getModelModifiers(props, camelizedName);
4950
- const res = reactivity.customRef((track, trigger) => {
4951
- let localValue;
4952
- let prevSetValue = shared.EMPTY_OBJ;
4953
- let prevEmittedValue;
4954
- watchSyncEffect(() => {
4955
- const propValue = props[camelizedName];
4956
- if (shared.hasChanged(localValue, propValue)) {
4957
- localValue = propValue;
4958
- trigger();
5088
+ if (shapeFlag & 6) {
5089
+ unmountComponent(vnode.component, parentSuspense, doRemove);
5090
+ } else {
5091
+ if (shapeFlag & 128) {
5092
+ vnode.suspense.unmount(parentSuspense, doRemove);
5093
+ return;
4959
5094
  }
4960
- });
4961
- return {
4962
- get() {
4963
- track();
4964
- return options.get ? options.get(localValue) : localValue;
4965
- },
4966
- set(value) {
4967
- const emittedValue = options.set ? options.set(value) : value;
4968
- if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
4969
- return;
4970
- }
4971
- const rawProps = i.vnode.props;
4972
- if (!(rawProps && // check if parent has passed v-model
4973
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
4974
- localValue = value;
4975
- trigger();
4976
- }
4977
- i.emit(`update:${name}`, emittedValue);
4978
- if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
4979
- trigger();
4980
- }
4981
- prevSetValue = value;
4982
- prevEmittedValue = emittedValue;
5095
+ if (shouldInvokeDirs) {
5096
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
5097
+ }
5098
+ if (shapeFlag & 64) {
5099
+ vnode.type.remove(
5100
+ vnode,
5101
+ parentComponent,
5102
+ parentSuspense,
5103
+ internals,
5104
+ doRemove
5105
+ );
5106
+ } else if (dynamicChildren && // #5154
5107
+ // when v-once is used inside a block, setBlockTracking(-1) marks the
5108
+ // parent block with hasOnce: true
5109
+ // so that it doesn't take the fast path during unmount - otherwise
5110
+ // components nested in v-once are never unmounted.
5111
+ !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
5112
+ (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
5113
+ unmountChildren(
5114
+ dynamicChildren,
5115
+ parentComponent,
5116
+ parentSuspense,
5117
+ false,
5118
+ true
5119
+ );
5120
+ } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
5121
+ unmountChildren(children, parentComponent, parentSuspense);
4983
5122
  }
4984
- };
4985
- });
4986
- res[Symbol.iterator] = () => {
4987
- let i2 = 0;
4988
- return {
4989
- next() {
4990
- if (i2 < 2) {
4991
- return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false };
4992
- } else {
4993
- return { done: true };
4994
- }
5123
+ if (doRemove) {
5124
+ remove(vnode);
4995
5125
  }
4996
- };
4997
- };
4998
- return res;
4999
- }
5000
- const getModelModifiers = (props, modelName) => {
5001
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`];
5002
- };
5003
-
5004
- function emit(instance, event, ...rawArgs) {
5005
- if (instance.isUnmounted) return;
5006
- const props = instance.vnode.props || shared.EMPTY_OBJ;
5007
- let args = rawArgs;
5008
- const isModelListener = event.startsWith("update:");
5009
- const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
5010
- if (modifiers) {
5011
- if (modifiers.trim) {
5012
- args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
5013
5126
  }
5014
- if (modifiers.number) {
5015
- args = rawArgs.map(shared.looseToNumber);
5127
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
5128
+ queuePostRenderEffect(() => {
5129
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5130
+ shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
5131
+ }, parentSuspense);
5016
5132
  }
5017
- }
5018
- let handlerName;
5019
- let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
5020
- props[handlerName = shared.toHandlerKey(shared.camelize(event))];
5021
- if (!handler && isModelListener) {
5022
- handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
5023
- }
5024
- if (handler) {
5025
- callWithAsyncErrorHandling(
5026
- handler,
5027
- instance,
5028
- 6,
5029
- args
5030
- );
5031
- }
5032
- const onceHandler = props[handlerName + `Once`];
5033
- if (onceHandler) {
5034
- if (!instance.emitted) {
5035
- instance.emitted = {};
5036
- } else if (instance.emitted[handlerName]) {
5133
+ };
5134
+ const remove = (vnode) => {
5135
+ const { type, el, anchor, transition } = vnode;
5136
+ if (type === Fragment) {
5137
+ {
5138
+ removeFragment(el, anchor);
5139
+ }
5037
5140
  return;
5038
5141
  }
5039
- instance.emitted[handlerName] = true;
5040
- callWithAsyncErrorHandling(
5041
- onceHandler,
5042
- instance,
5043
- 6,
5044
- args
5045
- );
5046
- }
5047
- }
5048
- const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
5049
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
5050
- const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
5051
- const cached = cache.get(comp);
5052
- if (cached !== void 0) {
5053
- return cached;
5054
- }
5055
- const raw = comp.emits;
5056
- let normalized = {};
5057
- let hasExtends = false;
5058
- if (!shared.isFunction(comp)) {
5059
- const extendEmits = (raw2) => {
5060
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
5061
- if (normalizedFromExtend) {
5062
- hasExtends = true;
5063
- shared.extend(normalized, normalizedFromExtend);
5142
+ if (type === Static) {
5143
+ removeStaticNode(vnode);
5144
+ return;
5145
+ }
5146
+ const performRemove = () => {
5147
+ hostRemove(el);
5148
+ if (transition && !transition.persisted && transition.afterLeave) {
5149
+ transition.afterLeave();
5064
5150
  }
5065
5151
  };
5066
- if (!asMixin && appContext.mixins.length) {
5067
- appContext.mixins.forEach(extendEmits);
5152
+ if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
5153
+ const { leave, delayLeave } = transition;
5154
+ const performLeave = () => leave(el, performRemove);
5155
+ if (delayLeave) {
5156
+ delayLeave(vnode.el, performRemove, performLeave);
5157
+ } else {
5158
+ performLeave();
5159
+ }
5160
+ } else {
5161
+ performRemove();
5068
5162
  }
5069
- if (comp.extends) {
5070
- extendEmits(comp.extends);
5163
+ };
5164
+ const removeFragment = (cur, end) => {
5165
+ let next;
5166
+ while (cur !== end) {
5167
+ next = hostNextSibling(cur);
5168
+ hostRemove(cur);
5169
+ cur = next;
5071
5170
  }
5072
- if (comp.mixins) {
5073
- comp.mixins.forEach(extendEmits);
5171
+ hostRemove(end);
5172
+ };
5173
+ const unmountComponent = (instance, parentSuspense, doRemove) => {
5174
+ const { bum, scope, job, subTree, um, m, a } = instance;
5175
+ invalidateMount(m);
5176
+ invalidateMount(a);
5177
+ if (bum) {
5178
+ shared.invokeArrayFns(bum);
5074
5179
  }
5075
- }
5076
- if (!raw && !hasExtends) {
5077
- if (shared.isObject(comp)) {
5078
- cache.set(comp, null);
5180
+ scope.stop();
5181
+ if (job) {
5182
+ job.flags |= 8;
5183
+ unmount(subTree, instance, parentSuspense, doRemove);
5079
5184
  }
5080
- return null;
5081
- }
5082
- if (shared.isArray(raw)) {
5083
- raw.forEach((key) => normalized[key] = null);
5084
- } else {
5085
- shared.extend(normalized, raw);
5086
- }
5087
- if (shared.isObject(comp)) {
5088
- cache.set(comp, normalized);
5089
- }
5090
- return normalized;
5091
- }
5092
- function isEmitListener(options, key) {
5093
- if (!options || !shared.isOn(key)) {
5094
- return false;
5095
- }
5096
- key = key.slice(2).replace(/Once$/, "");
5097
- return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
5098
- }
5099
-
5100
- function markAttrsAccessed() {
5101
- }
5102
- function renderComponentRoot(instance) {
5103
- const {
5104
- type: Component,
5105
- vnode,
5106
- proxy,
5107
- withProxy,
5108
- propsOptions: [propsOptions],
5109
- slots,
5110
- attrs,
5111
- emit,
5112
- render,
5113
- renderCache,
5114
- props,
5115
- data,
5116
- setupState,
5117
- ctx,
5118
- inheritAttrs
5119
- } = instance;
5120
- const prev = setCurrentRenderingInstance(instance);
5121
- let result;
5122
- let fallthroughAttrs;
5123
- try {
5124
- if (vnode.shapeFlag & 4) {
5125
- const proxyToUse = withProxy || proxy;
5126
- const thisProxy = false ? new Proxy(proxyToUse, {
5127
- get(target, key, receiver) {
5128
- warn(
5129
- `Property '${String(
5130
- key
5131
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
5132
- );
5133
- return Reflect.get(target, key, receiver);
5134
- }
5135
- }) : proxyToUse;
5136
- result = normalizeVNode(
5137
- render.call(
5138
- thisProxy,
5139
- proxyToUse,
5140
- renderCache,
5141
- false ? shallowReadonly(props) : props,
5142
- setupState,
5143
- data,
5144
- ctx
5145
- )
5146
- );
5147
- fallthroughAttrs = attrs;
5148
- } else {
5149
- const render2 = Component;
5150
- if (false) ;
5151
- result = normalizeVNode(
5152
- render2.length > 1 ? render2(
5153
- false ? shallowReadonly(props) : props,
5154
- false ? {
5155
- get attrs() {
5156
- markAttrsAccessed();
5157
- return shallowReadonly(attrs);
5158
- },
5159
- slots,
5160
- emit
5161
- } : { attrs, slots, emit }
5162
- ) : render2(
5163
- false ? shallowReadonly(props) : props,
5164
- null
5165
- )
5166
- );
5167
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
5185
+ if (um) {
5186
+ queuePostRenderEffect(um, parentSuspense);
5187
+ }
5188
+ queuePostRenderEffect(() => {
5189
+ instance.isUnmounted = true;
5190
+ }, parentSuspense);
5191
+ };
5192
+ const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
5193
+ for (let i = start; i < children.length; i++) {
5194
+ unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
5195
+ }
5196
+ };
5197
+ const getNextHostNode = (vnode) => {
5198
+ if (vnode.shapeFlag & 6) {
5199
+ return getNextHostNode(vnode.component.subTree);
5168
5200
  }
5169
- } catch (err) {
5170
- blockStack.length = 0;
5171
- handleError(err, instance, 1);
5172
- result = createVNode(Comment);
5173
- }
5174
- let root = result;
5175
- if (fallthroughAttrs && inheritAttrs !== false) {
5176
- const keys = Object.keys(fallthroughAttrs);
5177
- const { shapeFlag } = root;
5178
- if (keys.length) {
5179
- if (shapeFlag & (1 | 6)) {
5180
- if (propsOptions && keys.some(shared.isModelListener)) {
5181
- fallthroughAttrs = filterModelListeners(
5182
- fallthroughAttrs,
5183
- propsOptions
5184
- );
5185
- }
5186
- root = cloneVNode(root, fallthroughAttrs, false, true);
5201
+ if (vnode.shapeFlag & 128) {
5202
+ return vnode.suspense.next();
5203
+ }
5204
+ const el = hostNextSibling(vnode.anchor || vnode.el);
5205
+ const teleportEnd = el && el[TeleportEndKey];
5206
+ return teleportEnd ? hostNextSibling(teleportEnd) : el;
5207
+ };
5208
+ let isFlushing = false;
5209
+ const render = (vnode, container, namespace) => {
5210
+ let instance;
5211
+ if (vnode == null) {
5212
+ if (container._vnode) {
5213
+ unmount(container._vnode, null, null, true);
5214
+ instance = container._vnode.component;
5187
5215
  }
5216
+ } else {
5217
+ patch(
5218
+ container._vnode || null,
5219
+ vnode,
5220
+ container,
5221
+ null,
5222
+ null,
5223
+ null,
5224
+ namespace
5225
+ );
5188
5226
  }
5227
+ container._vnode = vnode;
5228
+ if (!isFlushing) {
5229
+ isFlushing = true;
5230
+ flushPreFlushCbs(instance);
5231
+ flushPostFlushCbs();
5232
+ isFlushing = false;
5233
+ }
5234
+ };
5235
+ const internals = {
5236
+ p: patch,
5237
+ um: unmount,
5238
+ m: move,
5239
+ r: remove,
5240
+ mt: mountComponent,
5241
+ mc: mountChildren,
5242
+ pc: patchChildren,
5243
+ pbc: patchBlockChildren,
5244
+ n: getNextHostNode,
5245
+ o: options
5246
+ };
5247
+ let hydrate;
5248
+ let hydrateNode;
5249
+ if (createHydrationFns) {
5250
+ [hydrate, hydrateNode] = createHydrationFns(
5251
+ internals
5252
+ );
5189
5253
  }
5190
- if (vnode.dirs) {
5191
- root = cloneVNode(root, null, false, true);
5192
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
5193
- }
5194
- if (vnode.transition) {
5195
- setTransitionHooks(root, vnode.transition);
5196
- }
5197
- {
5198
- result = root;
5254
+ return {
5255
+ render,
5256
+ hydrate,
5257
+ createApp: createAppAPI(render, hydrate)
5258
+ };
5259
+ }
5260
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
5261
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
5262
+ }
5263
+ function toggleRecurse({ effect, job }, allowed) {
5264
+ if (allowed) {
5265
+ effect.flags |= 32;
5266
+ job.flags |= 4;
5267
+ } else {
5268
+ effect.flags &= -33;
5269
+ job.flags &= -5;
5199
5270
  }
5200
- setCurrentRenderingInstance(prev);
5201
- return result;
5202
5271
  }
5203
- function filterSingleRoot(children, recurse = true) {
5204
- let singleRoot;
5205
- for (let i = 0; i < children.length; i++) {
5206
- const child = children[i];
5207
- if (isVNode(child)) {
5208
- if (child.type !== Comment || child.children === "v-if") {
5209
- if (singleRoot) {
5210
- return;
5211
- } else {
5212
- singleRoot = child;
5272
+ function needTransition(parentSuspense, transition) {
5273
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
5274
+ }
5275
+ function traverseStaticChildren(n1, n2, shallow = false) {
5276
+ const ch1 = n1.children;
5277
+ const ch2 = n2.children;
5278
+ if (shared.isArray(ch1) && shared.isArray(ch2)) {
5279
+ for (let i = 0; i < ch1.length; i++) {
5280
+ const c1 = ch1[i];
5281
+ let c2 = ch2[i];
5282
+ if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
5283
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
5284
+ c2 = ch2[i] = cloneIfMounted(ch2[i]);
5285
+ c2.el = c1.el;
5286
+ }
5287
+ if (!shallow && c2.patchFlag !== -2)
5288
+ traverseStaticChildren(c1, c2);
5289
+ }
5290
+ if (c2.type === Text) {
5291
+ if (c2.patchFlag === -1) {
5292
+ c2 = ch2[i] = cloneIfMounted(c2);
5213
5293
  }
5294
+ c2.el = c1.el;
5295
+ }
5296
+ if (c2.type === Comment && !c2.el) {
5297
+ c2.el = c1.el;
5214
5298
  }
5215
- } else {
5216
- return;
5217
5299
  }
5218
5300
  }
5219
- return singleRoot;
5220
5301
  }
5221
- const getFunctionalFallthrough = (attrs) => {
5222
- let res;
5223
- for (const key in attrs) {
5224
- if (key === "class" || key === "style" || shared.isOn(key)) {
5225
- (res || (res = {}))[key] = attrs[key];
5226
- }
5227
- }
5228
- return res;
5229
- };
5230
- const filterModelListeners = (attrs, props) => {
5231
- const res = {};
5232
- for (const key in attrs) {
5233
- if (!shared.isModelListener(key) || !(key.slice(9) in props)) {
5234
- res[key] = attrs[key];
5235
- }
5236
- }
5237
- return res;
5238
- };
5239
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
5240
- const { props: prevProps, children: prevChildren, component } = prevVNode;
5241
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
5242
- const emits = component.emitsOptions;
5243
- if (nextVNode.dirs || nextVNode.transition) {
5244
- return true;
5245
- }
5246
- if (optimized && patchFlag >= 0) {
5247
- if (patchFlag & 1024) {
5248
- return true;
5249
- }
5250
- if (patchFlag & 16) {
5251
- if (!prevProps) {
5252
- return !!nextProps;
5302
+ function getSequence(arr) {
5303
+ const p = arr.slice();
5304
+ const result = [0];
5305
+ let i, j, u, v, c;
5306
+ const len = arr.length;
5307
+ for (i = 0; i < len; i++) {
5308
+ const arrI = arr[i];
5309
+ if (arrI !== 0) {
5310
+ j = result[result.length - 1];
5311
+ if (arr[j] < arrI) {
5312
+ p[i] = j;
5313
+ result.push(i);
5314
+ continue;
5253
5315
  }
5254
- return hasPropsChanged(prevProps, nextProps, emits);
5255
- } else if (patchFlag & 8) {
5256
- const dynamicProps = nextVNode.dynamicProps;
5257
- for (let i = 0; i < dynamicProps.length; i++) {
5258
- const key = dynamicProps[i];
5259
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
5260
- return true;
5316
+ u = 0;
5317
+ v = result.length - 1;
5318
+ while (u < v) {
5319
+ c = u + v >> 1;
5320
+ if (arr[result[c]] < arrI) {
5321
+ u = c + 1;
5322
+ } else {
5323
+ v = c;
5261
5324
  }
5262
5325
  }
5263
- }
5264
- } else {
5265
- if (prevChildren || nextChildren) {
5266
- if (!nextChildren || !nextChildren.$stable) {
5267
- return true;
5326
+ if (arrI < arr[result[u]]) {
5327
+ if (u > 0) {
5328
+ p[i] = result[u - 1];
5329
+ }
5330
+ result[u] = i;
5268
5331
  }
5269
5332
  }
5270
- if (prevProps === nextProps) {
5271
- return false;
5272
- }
5273
- if (!prevProps) {
5274
- return !!nextProps;
5275
- }
5276
- if (!nextProps) {
5277
- return true;
5278
- }
5279
- return hasPropsChanged(prevProps, nextProps, emits);
5280
- }
5281
- return false;
5282
- }
5283
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
5284
- const nextKeys = Object.keys(nextProps);
5285
- if (nextKeys.length !== Object.keys(prevProps).length) {
5286
- return true;
5287
5333
  }
5288
- for (let i = 0; i < nextKeys.length; i++) {
5289
- const key = nextKeys[i];
5290
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
5291
- return true;
5292
- }
5334
+ u = result.length;
5335
+ v = result[u - 1];
5336
+ while (u-- > 0) {
5337
+ result[u] = v;
5338
+ v = p[v];
5293
5339
  }
5294
- return false;
5340
+ return result;
5295
5341
  }
5296
- function updateHOCHostEl({ vnode, parent }, el) {
5297
- while (parent) {
5298
- const root = parent.subTree;
5299
- if (root.suspense && root.suspense.activeBranch === vnode) {
5300
- root.el = vnode.el;
5301
- }
5302
- if (root === vnode) {
5303
- (vnode = parent.vnode).el = el;
5304
- parent = parent.parent;
5342
+ function locateNonHydratedAsyncRoot(instance) {
5343
+ const subComponent = instance.subTree.component;
5344
+ if (subComponent) {
5345
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
5346
+ return subComponent;
5305
5347
  } else {
5306
- break;
5348
+ return locateNonHydratedAsyncRoot(subComponent);
5307
5349
  }
5308
5350
  }
5309
5351
  }
5352
+ function invalidateMount(hooks) {
5353
+ if (hooks) {
5354
+ for (let i = 0; i < hooks.length; i++)
5355
+ hooks[i].flags |= 8;
5356
+ }
5357
+ }
5358
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
5359
+ if (anchorVnode.placeholder) {
5360
+ return anchorVnode.placeholder;
5361
+ }
5362
+ const instance = anchorVnode.component;
5363
+ if (instance) {
5364
+ return resolveAsyncComponentPlaceholder(instance.subTree);
5365
+ }
5366
+ return null;
5367
+ }
5310
5368
 
5311
5369
  const isSuspense = (type) => type.__isSuspense;
5312
5370
  let suspenseId = 0;
@@ -5609,7 +5667,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5609
5667
  pendingId,
5610
5668
  effects,
5611
5669
  parentComponent: parentComponent2,
5612
- container: container2
5670
+ container: container2,
5671
+ isInFallback
5613
5672
  } = suspense;
5614
5673
  let delayEnter = false;
5615
5674
  if (suspense.isHydrating) {
@@ -5626,6 +5685,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5626
5685
  0
5627
5686
  );
5628
5687
  queuePostFlushCb(effects);
5688
+ if (isInFallback && vnode2.ssFallback) {
5689
+ vnode2.ssFallback.el = null;
5690
+ }
5629
5691
  }
5630
5692
  };
5631
5693
  }
@@ -5634,6 +5696,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5634
5696
  anchor = next(activeBranch);
5635
5697
  }
5636
5698
  unmount(activeBranch, parentComponent2, suspense, true);
5699
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
5700
+ queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
5701
+ }
5637
5702
  }
5638
5703
  if (!delayEnter) {
5639
5704
  move(pendingBranch, container2, anchor, 0);
@@ -5749,6 +5814,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5749
5814
  optimized2
5750
5815
  );
5751
5816
  if (placeholder) {
5817
+ vnode2.placeholder = null;
5752
5818
  remove(placeholder);
5753
5819
  }
5754
5820
  updateHOCHostEl(instance, vnode2.el);
@@ -5870,10 +5936,10 @@ function isVNodeSuspensible(vnode) {
5870
5936
  return suspensible != null && suspensible !== false;
5871
5937
  }
5872
5938
 
5873
- const Fragment = Symbol.for("v-fgt");
5874
- const Text = Symbol.for("v-txt");
5875
- const Comment = Symbol.for("v-cmt");
5876
- const Static = Symbol.for("v-stc");
5939
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
5940
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
5941
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
5942
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
5877
5943
  const blockStack = [];
5878
5944
  let currentBlock = null;
5879
5945
  function openBlock(disableTracking = false) {
@@ -6562,7 +6628,7 @@ function isMemoSame(cached, memo) {
6562
6628
  return true;
6563
6629
  }
6564
6630
 
6565
- const version = "3.5.22";
6631
+ const version = "3.5.28";
6566
6632
  const warn$1 = shared.NOOP;
6567
6633
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6568
6634
  const devtools = void 0;