mongoku 2.8.1 → 2.9.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 (398) hide show
  1. package/build/client/_app/immutable/assets/0.DTh4C4pw.css +1 -0
  2. package/build/client/_app/immutable/assets/0.DTh4C4pw.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.DTh4C4pw.css.gz +0 -0
  4. package/build/client/_app/immutable/chunks/-jLNyJzC.js +1 -0
  5. package/build/client/_app/immutable/chunks/-jLNyJzC.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/-jLNyJzC.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/B-0CauNF.js +1 -0
  8. package/build/client/_app/immutable/chunks/B-0CauNF.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/B-0CauNF.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/B-TH2U-E.js +1 -0
  11. package/build/client/_app/immutable/chunks/B-TH2U-E.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/B-TH2U-E.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/BaCQ7DA8.js +66 -0
  14. package/build/client/_app/immutable/chunks/BaCQ7DA8.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/BaCQ7DA8.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/BfsQcfVI.js +1 -0
  17. package/build/client/_app/immutable/chunks/BfsQcfVI.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/BfsQcfVI.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{Dbu5gl04.js → BnRtSpxa.js} +1 -1
  20. package/build/client/_app/immutable/chunks/BnRtSpxa.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/BnRtSpxa.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/{B_7uoCj-.js → CWVg1wU_.js} +2 -2
  23. package/build/client/_app/immutable/chunks/CWVg1wU_.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/CWVg1wU_.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/Cl89kjea.js +1 -0
  26. package/build/client/_app/immutable/chunks/Cl89kjea.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/Cl89kjea.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/CynGo-ch.js +1 -0
  29. package/build/client/_app/immutable/chunks/CynGo-ch.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CynGo-ch.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/{DZ3j8h_f.js → CzuLYUff.js} +1 -1
  32. package/build/client/_app/immutable/chunks/CzuLYUff.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/CzuLYUff.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/D1_vCvEb.js +1 -0
  35. package/build/client/_app/immutable/chunks/D1_vCvEb.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/D1_vCvEb.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/D2Q18L5i.js +1 -0
  38. package/build/client/_app/immutable/chunks/D2Q18L5i.js.br +0 -0
  39. package/build/client/_app/immutable/chunks/D2Q18L5i.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/D899Ie42.js +1 -0
  41. package/build/client/_app/immutable/chunks/D899Ie42.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/D899Ie42.js.gz +0 -0
  43. package/build/client/_app/immutable/chunks/DIjqwnsi.js +1 -0
  44. package/build/client/_app/immutable/chunks/DIjqwnsi.js.br +0 -0
  45. package/build/client/_app/immutable/chunks/DIjqwnsi.js.gz +0 -0
  46. package/build/client/_app/immutable/chunks/{CafiCU8Z.js → DaDQ7m8i.js} +9 -9
  47. package/build/client/_app/immutable/chunks/DaDQ7m8i.js.br +0 -0
  48. package/build/client/_app/immutable/chunks/DaDQ7m8i.js.gz +0 -0
  49. package/build/client/_app/immutable/chunks/{ULh2o3ji.js → DjUt71lH.js} +1 -1
  50. package/build/client/_app/immutable/chunks/DjUt71lH.js.br +0 -0
  51. package/build/client/_app/immutable/chunks/DjUt71lH.js.gz +0 -0
  52. package/build/client/_app/immutable/chunks/DkIGOVHS.js +4 -0
  53. package/build/client/_app/immutable/chunks/DkIGOVHS.js.br +0 -0
  54. package/build/client/_app/immutable/chunks/DkIGOVHS.js.gz +0 -0
  55. package/build/client/_app/immutable/chunks/Hg2DaShQ.js +1 -0
  56. package/build/client/_app/immutable/chunks/Hg2DaShQ.js.br +3 -0
  57. package/build/client/_app/immutable/chunks/Hg2DaShQ.js.gz +0 -0
  58. package/build/client/_app/immutable/chunks/KvnnxfV5.js +1 -0
  59. package/build/client/_app/immutable/chunks/KvnnxfV5.js.br +0 -0
  60. package/build/client/_app/immutable/chunks/KvnnxfV5.js.gz +0 -0
  61. package/build/client/_app/immutable/chunks/{CETiZ6GF.js → NycVVWZD.js} +1 -1
  62. package/build/client/_app/immutable/chunks/NycVVWZD.js.br +0 -0
  63. package/build/client/_app/immutable/chunks/NycVVWZD.js.gz +0 -0
  64. package/build/client/_app/immutable/chunks/{Dv9wDVNU.js → TfiCUZYY.js} +1 -1
  65. package/build/client/_app/immutable/chunks/TfiCUZYY.js.br +0 -0
  66. package/build/client/_app/immutable/chunks/TfiCUZYY.js.gz +0 -0
  67. package/build/client/_app/immutable/chunks/TxmsiDxf.js +1 -0
  68. package/build/client/_app/immutable/chunks/TxmsiDxf.js.br +0 -0
  69. package/build/client/_app/immutable/chunks/TxmsiDxf.js.gz +0 -0
  70. package/build/client/_app/immutable/chunks/ogOVEqzG.js +1 -0
  71. package/build/client/_app/immutable/chunks/ogOVEqzG.js.br +0 -0
  72. package/build/client/_app/immutable/chunks/ogOVEqzG.js.gz +0 -0
  73. package/build/client/_app/immutable/chunks/tqAjkrD5.js +1 -0
  74. package/build/client/_app/immutable/chunks/tqAjkrD5.js.br +0 -0
  75. package/build/client/_app/immutable/chunks/tqAjkrD5.js.gz +0 -0
  76. package/build/client/_app/immutable/chunks/wZ9dd4xr.js +2 -0
  77. package/build/client/_app/immutable/chunks/wZ9dd4xr.js.br +0 -0
  78. package/build/client/_app/immutable/chunks/wZ9dd4xr.js.gz +0 -0
  79. package/build/client/_app/immutable/entry/app.DKM881FC.js +2 -0
  80. package/build/client/_app/immutable/entry/app.DKM881FC.js.br +0 -0
  81. package/build/client/_app/immutable/entry/app.DKM881FC.js.gz +0 -0
  82. package/build/client/_app/immutable/entry/start.BMV36X_I.js +1 -0
  83. package/build/client/_app/immutable/entry/start.BMV36X_I.js.br +0 -0
  84. package/build/client/_app/immutable/entry/start.BMV36X_I.js.gz +0 -0
  85. package/build/client/_app/immutable/nodes/0.xAEfnyVv.js +1 -0
  86. package/build/client/_app/immutable/nodes/0.xAEfnyVv.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/0.xAEfnyVv.js.gz +0 -0
  88. package/build/client/_app/immutable/nodes/1.DJI4SFHI.js +1 -0
  89. package/build/client/_app/immutable/nodes/1.DJI4SFHI.js.br +0 -0
  90. package/build/client/_app/immutable/nodes/1.DJI4SFHI.js.gz +0 -0
  91. package/build/client/_app/immutable/nodes/10.B9mmyl9C.js +2 -0
  92. package/build/client/_app/immutable/nodes/10.B9mmyl9C.js.br +0 -0
  93. package/build/client/_app/immutable/nodes/10.B9mmyl9C.js.gz +0 -0
  94. package/build/client/_app/immutable/nodes/11.BJVYZRNF.js +6 -0
  95. package/build/client/_app/immutable/nodes/11.BJVYZRNF.js.br +0 -0
  96. package/build/client/_app/immutable/nodes/11.BJVYZRNF.js.gz +0 -0
  97. package/build/client/_app/immutable/nodes/{12.PoZV4wBT.js → 12.BIVbh2K8.js} +1 -1
  98. package/build/client/_app/immutable/nodes/12.BIVbh2K8.js.br +0 -0
  99. package/build/client/_app/immutable/nodes/12.BIVbh2K8.js.gz +0 -0
  100. package/build/client/_app/immutable/nodes/13.CuqM9sa_.js +1 -0
  101. package/build/client/_app/immutable/nodes/13.CuqM9sa_.js.br +0 -0
  102. package/build/client/_app/immutable/nodes/13.CuqM9sa_.js.gz +0 -0
  103. package/build/client/_app/immutable/nodes/14.Cku4UiID.js +65 -0
  104. package/build/client/_app/immutable/nodes/14.Cku4UiID.js.br +0 -0
  105. package/build/client/_app/immutable/nodes/14.Cku4UiID.js.gz +0 -0
  106. package/build/client/_app/immutable/nodes/15.CFozZIMA.js +1 -0
  107. package/build/client/_app/immutable/nodes/15.CFozZIMA.js.br +0 -0
  108. package/build/client/_app/immutable/nodes/15.CFozZIMA.js.gz +0 -0
  109. package/build/client/_app/immutable/nodes/{2.C6NzDBVE.js → 2.CdWjCbJf.js} +1 -1
  110. package/build/client/_app/immutable/nodes/2.CdWjCbJf.js.br +0 -0
  111. package/build/client/_app/immutable/nodes/2.CdWjCbJf.js.gz +0 -0
  112. package/build/client/_app/immutable/nodes/{3.CZJqJ4La.js → 3.BIfBaSHs.js} +1 -1
  113. package/build/client/_app/immutable/nodes/3.BIfBaSHs.js.br +1 -0
  114. package/build/client/_app/immutable/nodes/3.BIfBaSHs.js.gz +0 -0
  115. package/build/client/_app/immutable/nodes/{4.CNe3XPNo.js → 4.D_Olflem.js} +1 -1
  116. package/build/client/_app/immutable/nodes/4.D_Olflem.js.br +0 -0
  117. package/build/client/_app/immutable/nodes/4.D_Olflem.js.gz +0 -0
  118. package/build/client/_app/immutable/nodes/{5.BWhhv567.js → 5.BjQaqBuw.js} +1 -1
  119. package/build/client/_app/immutable/nodes/5.BjQaqBuw.js.br +0 -0
  120. package/build/client/_app/immutable/nodes/5.BjQaqBuw.js.gz +0 -0
  121. package/build/client/_app/immutable/nodes/{7.CTCgtWr5.js → 7.B2HL850y.js} +1 -1
  122. package/build/client/_app/immutable/nodes/7.B2HL850y.js.br +0 -0
  123. package/build/client/_app/immutable/nodes/7.B2HL850y.js.gz +0 -0
  124. package/build/client/_app/immutable/nodes/8.R4oSBMsW.js +2 -0
  125. package/build/client/_app/immutable/nodes/8.R4oSBMsW.js.br +0 -0
  126. package/build/client/_app/immutable/nodes/8.R4oSBMsW.js.gz +0 -0
  127. package/build/client/_app/immutable/nodes/{9.DgUUrJMM.js → 9.gCKAeDLD.js} +1 -1
  128. package/build/client/_app/immutable/nodes/9.gCKAeDLD.js.br +0 -0
  129. package/build/client/_app/immutable/nodes/9.gCKAeDLD.js.gz +0 -0
  130. package/build/client/_app/version.json +1 -1
  131. package/build/client/_app/version.json.br +0 -0
  132. package/build/client/_app/version.json.gz +0 -0
  133. package/build/server/chunks/0-DHpbgO4k.js +31 -0
  134. package/build/server/chunks/{0-CKG6FzOP.js.map → 0-DHpbgO4k.js.map} +1 -1
  135. package/build/server/chunks/1-qCdcNckL.js +9 -0
  136. package/build/server/chunks/1-qCdcNckL.js.map +1 -0
  137. package/build/server/chunks/{10-DhUkYynY.js → 10-DADbl5RU.js} +3 -3
  138. package/build/server/chunks/{10-DhUkYynY.js.map → 10-DADbl5RU.js.map} +1 -1
  139. package/build/server/chunks/{11-BNbY7gn2.js → 11-B5XzpQJ2.js} +5 -4
  140. package/build/server/chunks/11-B5XzpQJ2.js.map +1 -0
  141. package/build/server/chunks/{12-DBj8btwS.js → 12-DvEgVREo.js} +3 -3
  142. package/build/server/chunks/{12-DBj8btwS.js.map → 12-DvEgVREo.js.map} +1 -1
  143. package/build/server/chunks/{13-EXQa77Y1.js → 13-BhmqzR8h.js} +5 -4
  144. package/build/server/chunks/13-BhmqzR8h.js.map +1 -0
  145. package/build/server/chunks/{14-DHzR9sir.js → 14-BfgW3WwW.js} +5 -4
  146. package/build/server/chunks/14-BfgW3WwW.js.map +1 -0
  147. package/build/server/chunks/15-EvY9zrFS.js +67 -0
  148. package/build/server/chunks/15-EvY9zrFS.js.map +1 -0
  149. package/build/server/chunks/{2-BNTmkYSf.js → 2-5hqMVf4i.js} +3 -3
  150. package/build/server/chunks/{2-BNTmkYSf.js.map → 2-5hqMVf4i.js.map} +1 -1
  151. package/build/server/chunks/{3-ClKd4dXQ.js → 3-DIscxOEl.js} +3 -3
  152. package/build/server/chunks/{3-ClKd4dXQ.js.map → 3-DIscxOEl.js.map} +1 -1
  153. package/build/server/chunks/{4-BSPVNKkN.js → 4-_oEOFnHF.js} +3 -3
  154. package/build/server/chunks/{4-BSPVNKkN.js.map → 4-_oEOFnHF.js.map} +1 -1
  155. package/build/server/chunks/{5-BzxZlQk0.js → 5-qiB9L-y2.js} +3 -3
  156. package/build/server/chunks/{5-BzxZlQk0.js.map → 5-qiB9L-y2.js.map} +1 -1
  157. package/build/server/chunks/{6-Bw8JUxiD.js → 6-eXO6RVDu.js} +4 -4
  158. package/build/server/chunks/{6-Bw8JUxiD.js.map → 6-eXO6RVDu.js.map} +1 -1
  159. package/build/server/chunks/{7-QcJoMaSg.js → 7-DVs6miRk.js} +7 -7
  160. package/build/server/chunks/{7-QcJoMaSg.js.map → 7-DVs6miRk.js.map} +1 -1
  161. package/build/server/chunks/{8-UCTaZB_Z.js → 8-DsmWMnBl.js} +3 -3
  162. package/build/server/chunks/{8-UCTaZB_Z.js.map → 8-DsmWMnBl.js.map} +1 -1
  163. package/build/server/chunks/{9-C0szOSjZ.js → 9-DOuKepr0.js} +3 -3
  164. package/build/server/chunks/{9-C0szOSjZ.js.map → 9-DOuKepr0.js.map} +1 -1
  165. package/build/server/chunks/{JsonValue-CTg4aH_w.js → JsonValue-CGVfzyTL.js} +32 -32
  166. package/build/server/chunks/JsonValue-CGVfzyTL.js.map +1 -0
  167. package/build/server/chunks/{Modal-yO0qzufQ.js → Modal-D2E5OLRi.js} +9 -9
  168. package/build/server/chunks/Modal-D2E5OLRi.js.map +1 -0
  169. package/build/server/chunks/{Panel-D9GzVDDt.js → Panel-C6VWd6JD.js} +9 -9
  170. package/build/server/chunks/Panel-C6VWd6JD.js.map +1 -0
  171. package/build/server/chunks/{PrettyJson-BVgLycwy.js → PrettyJson-0NvyC3vB.js} +43 -21
  172. package/build/server/chunks/PrettyJson-0NvyC3vB.js.map +1 -0
  173. package/build/server/chunks/{Tooltip-D2BX7dwq.js → Tooltip-OVylvwfb.js} +5 -5
  174. package/build/server/chunks/Tooltip-OVylvwfb.js.map +1 -0
  175. package/build/server/chunks/{TooltipTable-91W9LxGR.js → TooltipTable-CLglfpck.js} +6 -6
  176. package/build/server/chunks/TooltipTable-CLglfpck.js.map +1 -0
  177. package/build/server/chunks/{_layout.svelte-BFxKanne.js → _layout.svelte-CLPxHDiP.js} +24 -24
  178. package/build/server/chunks/_layout.svelte-CLPxHDiP.js.map +1 -0
  179. package/build/server/chunks/{_page.svelte-CYgL8X_3.js → _page.svelte-BPcsZPKb.js} +21 -20
  180. package/build/server/chunks/_page.svelte-BPcsZPKb.js.map +1 -0
  181. package/build/server/chunks/{_page.svelte-BkyGMJtY.js → _page.svelte-BS4_Zesn.js} +27 -26
  182. package/build/server/chunks/_page.svelte-BS4_Zesn.js.map +1 -0
  183. package/build/server/chunks/{_page.svelte-Q0qOjc1K.js → _page.svelte-Bx5MBXSd.js} +23 -22
  184. package/build/server/chunks/_page.svelte-Bx5MBXSd.js.map +1 -0
  185. package/build/server/chunks/{_page.svelte-CSuE9bVi.js → _page.svelte-C3QVwl-z.js} +5 -5
  186. package/build/server/chunks/{_page.svelte-CSuE9bVi.js.map → _page.svelte-C3QVwl-z.js.map} +1 -1
  187. package/build/server/chunks/{_page.svelte-DybQp3Hh.js → _page.svelte-CM6QtCvm.js} +26 -25
  188. package/build/server/chunks/_page.svelte-CM6QtCvm.js.map +1 -0
  189. package/build/server/chunks/{_page.svelte-DEuOrgce.js → _page.svelte-Cai_1P5J.js} +58 -57
  190. package/build/server/chunks/_page.svelte-Cai_1P5J.js.map +1 -0
  191. package/build/server/chunks/_page.svelte-Cy0ShxWk.js +135 -0
  192. package/build/server/chunks/_page.svelte-Cy0ShxWk.js.map +1 -0
  193. package/build/server/chunks/{_page.svelte-BE3IXD7W.js → _page.svelte-DFg9NEZU.js} +52 -51
  194. package/build/server/chunks/_page.svelte-DFg9NEZU.js.map +1 -0
  195. package/build/server/chunks/{_page.svelte-BimaUmmG.js → _page.svelte-yY_cbSNt.js} +27 -26
  196. package/build/server/chunks/_page.svelte-yY_cbSNt.js.map +1 -0
  197. package/build/server/chunks/{_server.ts-CNiqI4C6.js → _server.ts-CEBmCzTO.js} +5 -5
  198. package/build/server/chunks/{_server.ts-CNiqI4C6.js.map → _server.ts-CEBmCzTO.js.map} +1 -1
  199. package/build/server/chunks/{_server.ts-OSPJ0dek.js → _server.ts-CoUHVeKI.js} +5 -5
  200. package/build/server/chunks/{_server.ts-OSPJ0dek.js.map → _server.ts-CoUHVeKI.js.map} +1 -1
  201. package/build/server/chunks/{_server.ts-CHqxLmE4.js → _server.ts-i-glbZtX.js} +4 -4
  202. package/build/server/chunks/{_server.ts-CHqxLmE4.js.map → _server.ts-i-glbZtX.js.map} +1 -1
  203. package/build/server/chunks/{async-lVJA8xJZ.js → async-DUoD1OpG.js} +2 -1
  204. package/build/server/chunks/async-DUoD1OpG.js.map +1 -0
  205. package/build/server/chunks/client-COtw9Xqw.js +7 -0
  206. package/build/server/chunks/{client-C7bEwskR.js.map → client-COtw9Xqw.js.map} +1 -1
  207. package/build/server/chunks/{client2-DcCKOWWC.js → client2-BIa3wTXU.js} +5 -5
  208. package/build/server/chunks/client2-BIa3wTXU.js.map +1 -0
  209. package/build/server/chunks/error.svelte-DUZ2SYyF.js +18 -0
  210. package/build/server/chunks/{error.svelte-Bk-0XnBt.js.map → error.svelte-DUZ2SYyF.js.map} +1 -1
  211. package/build/server/chunks/{hooks.server-ChbJBVwm.js → hooks.server-BiUSRqj1.js} +4 -4
  212. package/build/server/chunks/{hooks.server-ChbJBVwm.js.map → hooks.server-BiUSRqj1.js.map} +1 -1
  213. package/build/server/chunks/{index-CC9WtE-y.js → index-CtYzvcG6.js} +2 -2
  214. package/build/server/chunks/index-CtYzvcG6.js.map +1 -0
  215. package/build/server/chunks/{index-wpIsICWW.js → index-NcxaM188.js} +21 -4
  216. package/build/server/chunks/index-NcxaM188.js.map +1 -0
  217. package/build/server/chunks/{index2-DMabdSHV.js → index2-B0RgZaJY.js} +3 -3
  218. package/build/server/chunks/{index2-DMabdSHV.js.map → index2-B0RgZaJY.js.map} +1 -1
  219. package/build/server/chunks/{layout.svelte-CJcHX-Na.js → layout.svelte-PFROMnUZ.js} +2 -2
  220. package/build/server/chunks/{layout.svelte-CJcHX-Na.js.map → layout.svelte-PFROMnUZ.js.map} +1 -1
  221. package/build/server/chunks/{oauth-BbSyq_Sb.js → oauth-D6jTWKFd.js} +2 -2
  222. package/build/server/chunks/{oauth-BbSyq_Sb.js.map → oauth-D6jTWKFd.js.map} +1 -1
  223. package/build/server/chunks/{remote-xxtqbu-DU1VUIfB.js → remote-xxtqbu-CmaCzxbq.js} +8 -7
  224. package/build/server/chunks/remote-xxtqbu-CmaCzxbq.js.map +1 -0
  225. package/build/server/chunks/{url-hmE1zcJ6.js → root-otUAnOAR.js} +1771 -1355
  226. package/build/server/chunks/root-otUAnOAR.js.map +1 -0
  227. package/build/server/chunks/{routing-CYknP78v.js → routing-EDfUNu8L.js} +2 -2
  228. package/build/server/chunks/{routing-CYknP78v.js.map → routing-EDfUNu8L.js.map} +1 -1
  229. package/build/server/chunks/schema-BZonjzNJ.js +315 -0
  230. package/build/server/chunks/schema-BZonjzNJ.js.map +1 -0
  231. package/build/server/chunks/{server2-uigtM6st.js → server2-D_y4YbpC.js} +8 -3
  232. package/build/server/chunks/server2-D_y4YbpC.js.map +1 -0
  233. package/build/server/chunks/{servers.remote-ChLjCujn.js → servers.remote-W2x65uTK.js} +407 -100
  234. package/build/server/chunks/servers.remote-W2x65uTK.js.map +1 -0
  235. package/build/server/chunks/{shared-BqTYMAzZ.js → shared-DlqhoNLb.js} +321 -127
  236. package/build/server/chunks/shared-DlqhoNLb.js.map +1 -0
  237. package/build/server/chunks/state.svelte-Bj5yxNNk.js +10 -0
  238. package/build/server/chunks/state.svelte-Bj5yxNNk.js.map +1 -0
  239. package/build/server/chunks/{utils2-kjxf7BZO.js → utils-BQzn9ikS.js} +2 -3
  240. package/build/server/chunks/utils-BQzn9ikS.js.map +1 -0
  241. package/build/server/index.js +322 -117
  242. package/build/server/index.js.map +1 -1
  243. package/build/server/manifest.js +28 -20
  244. package/build/server/manifest.js.map +1 -1
  245. package/package.json +5 -2
  246. package/src/api/servers.remote.ts +60 -0
  247. package/src/lib/components/PrettyJson.svelte +33 -10
  248. package/src/lib/server/mongo.ts +1 -1
  249. package/src/lib/server/schema.ts +499 -0
  250. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/+page.ts +1 -0
  251. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/indexes/+page.ts +1 -0
  252. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/mappings/+page.ts +1 -0
  253. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/schema/+page.server.ts +25 -0
  254. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/schema/+page.svelte +429 -0
  255. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/schema/+page.ts +11 -0
  256. package/build/client/_app/immutable/assets/0.CdYhspVa.css +0 -1
  257. package/build/client/_app/immutable/assets/0.CdYhspVa.css.br +0 -0
  258. package/build/client/_app/immutable/assets/0.CdYhspVa.css.gz +0 -0
  259. package/build/client/_app/immutable/chunks/B-uukkkJ.js +0 -1
  260. package/build/client/_app/immutable/chunks/B-uukkkJ.js.br +0 -0
  261. package/build/client/_app/immutable/chunks/B-uukkkJ.js.gz +0 -0
  262. package/build/client/_app/immutable/chunks/B59nRjE7.js +0 -1
  263. package/build/client/_app/immutable/chunks/B59nRjE7.js.br +0 -2
  264. package/build/client/_app/immutable/chunks/B59nRjE7.js.gz +0 -0
  265. package/build/client/_app/immutable/chunks/B_7uoCj-.js.br +0 -0
  266. package/build/client/_app/immutable/chunks/B_7uoCj-.js.gz +0 -0
  267. package/build/client/_app/immutable/chunks/BxKxqkS7.js +0 -4
  268. package/build/client/_app/immutable/chunks/BxKxqkS7.js.br +0 -0
  269. package/build/client/_app/immutable/chunks/BxKxqkS7.js.gz +0 -0
  270. package/build/client/_app/immutable/chunks/C1s4M21f.js +0 -1
  271. package/build/client/_app/immutable/chunks/C1s4M21f.js.br +0 -0
  272. package/build/client/_app/immutable/chunks/C1s4M21f.js.gz +0 -0
  273. package/build/client/_app/immutable/chunks/C6nv_pni.js +0 -1
  274. package/build/client/_app/immutable/chunks/C6nv_pni.js.br +0 -0
  275. package/build/client/_app/immutable/chunks/C6nv_pni.js.gz +0 -0
  276. package/build/client/_app/immutable/chunks/CETiZ6GF.js.br +0 -0
  277. package/build/client/_app/immutable/chunks/CETiZ6GF.js.gz +0 -0
  278. package/build/client/_app/immutable/chunks/CX0xC2bt.js +0 -1
  279. package/build/client/_app/immutable/chunks/CX0xC2bt.js.br +0 -0
  280. package/build/client/_app/immutable/chunks/CX0xC2bt.js.gz +0 -0
  281. package/build/client/_app/immutable/chunks/CafiCU8Z.js.br +0 -0
  282. package/build/client/_app/immutable/chunks/CafiCU8Z.js.gz +0 -0
  283. package/build/client/_app/immutable/chunks/DJHYr09v.js +0 -1
  284. package/build/client/_app/immutable/chunks/DJHYr09v.js.br +0 -0
  285. package/build/client/_app/immutable/chunks/DJHYr09v.js.gz +0 -0
  286. package/build/client/_app/immutable/chunks/DZ3j8h_f.js.br +0 -0
  287. package/build/client/_app/immutable/chunks/DZ3j8h_f.js.gz +0 -0
  288. package/build/client/_app/immutable/chunks/DZxZehvI.js +0 -1
  289. package/build/client/_app/immutable/chunks/DZxZehvI.js.br +0 -0
  290. package/build/client/_app/immutable/chunks/DZxZehvI.js.gz +0 -0
  291. package/build/client/_app/immutable/chunks/DaNl6Y92.js +0 -2
  292. package/build/client/_app/immutable/chunks/DaNl6Y92.js.br +0 -0
  293. package/build/client/_app/immutable/chunks/DaNl6Y92.js.gz +0 -0
  294. package/build/client/_app/immutable/chunks/Dbu5gl04.js.br +0 -0
  295. package/build/client/_app/immutable/chunks/Dbu5gl04.js.gz +0 -0
  296. package/build/client/_app/immutable/chunks/DczwA5Ds.js +0 -1
  297. package/build/client/_app/immutable/chunks/DczwA5Ds.js.br +0 -0
  298. package/build/client/_app/immutable/chunks/DczwA5Ds.js.gz +0 -0
  299. package/build/client/_app/immutable/chunks/DjlV9yev.js +0 -1
  300. package/build/client/_app/immutable/chunks/DjlV9yev.js.br +0 -0
  301. package/build/client/_app/immutable/chunks/DjlV9yev.js.gz +0 -0
  302. package/build/client/_app/immutable/chunks/DqCgzOHl.js +0 -1
  303. package/build/client/_app/immutable/chunks/DqCgzOHl.js.br +0 -0
  304. package/build/client/_app/immutable/chunks/DqCgzOHl.js.gz +0 -0
  305. package/build/client/_app/immutable/chunks/DskkUG-R.js +0 -41
  306. package/build/client/_app/immutable/chunks/DskkUG-R.js.br +0 -0
  307. package/build/client/_app/immutable/chunks/DskkUG-R.js.gz +0 -0
  308. package/build/client/_app/immutable/chunks/Dv9wDVNU.js.br +0 -0
  309. package/build/client/_app/immutable/chunks/Dv9wDVNU.js.gz +0 -0
  310. package/build/client/_app/immutable/chunks/DwvJoC1a.js +0 -1
  311. package/build/client/_app/immutable/chunks/DwvJoC1a.js.br +0 -0
  312. package/build/client/_app/immutable/chunks/DwvJoC1a.js.gz +0 -0
  313. package/build/client/_app/immutable/chunks/ULh2o3ji.js.br +0 -0
  314. package/build/client/_app/immutable/chunks/ULh2o3ji.js.gz +0 -0
  315. package/build/client/_app/immutable/chunks/V1mdyEl2.js +0 -1
  316. package/build/client/_app/immutable/chunks/V1mdyEl2.js.br +0 -0
  317. package/build/client/_app/immutable/chunks/V1mdyEl2.js.gz +0 -0
  318. package/build/client/_app/immutable/chunks/gjWX2x82.js +0 -1
  319. package/build/client/_app/immutable/chunks/gjWX2x82.js.br +0 -0
  320. package/build/client/_app/immutable/chunks/gjWX2x82.js.gz +0 -0
  321. package/build/client/_app/immutable/chunks/y5L2Na-S.js +0 -1
  322. package/build/client/_app/immutable/chunks/y5L2Na-S.js.br +0 -0
  323. package/build/client/_app/immutable/chunks/y5L2Na-S.js.gz +0 -0
  324. package/build/client/_app/immutable/entry/app.CobTjvr8.js +0 -2
  325. package/build/client/_app/immutable/entry/app.CobTjvr8.js.br +0 -0
  326. package/build/client/_app/immutable/entry/app.CobTjvr8.js.gz +0 -0
  327. package/build/client/_app/immutable/entry/start.BD32Z2Yy.js +0 -1
  328. package/build/client/_app/immutable/entry/start.BD32Z2Yy.js.br +0 -0
  329. package/build/client/_app/immutable/entry/start.BD32Z2Yy.js.gz +0 -0
  330. package/build/client/_app/immutable/nodes/0.CTNDfBi_.js +0 -1
  331. package/build/client/_app/immutable/nodes/0.CTNDfBi_.js.br +0 -0
  332. package/build/client/_app/immutable/nodes/0.CTNDfBi_.js.gz +0 -0
  333. package/build/client/_app/immutable/nodes/1.B0G4JtnR.js +0 -1
  334. package/build/client/_app/immutable/nodes/1.B0G4JtnR.js.br +0 -0
  335. package/build/client/_app/immutable/nodes/1.B0G4JtnR.js.gz +0 -0
  336. package/build/client/_app/immutable/nodes/10.DiOFtMHY.js +0 -2
  337. package/build/client/_app/immutable/nodes/10.DiOFtMHY.js.br +0 -0
  338. package/build/client/_app/immutable/nodes/10.DiOFtMHY.js.gz +0 -0
  339. package/build/client/_app/immutable/nodes/11.CcFuKX19.js +0 -6
  340. package/build/client/_app/immutable/nodes/11.CcFuKX19.js.br +0 -0
  341. package/build/client/_app/immutable/nodes/11.CcFuKX19.js.gz +0 -0
  342. package/build/client/_app/immutable/nodes/12.PoZV4wBT.js.br +0 -0
  343. package/build/client/_app/immutable/nodes/12.PoZV4wBT.js.gz +0 -0
  344. package/build/client/_app/immutable/nodes/13.BIZ8AY9M.js +0 -1
  345. package/build/client/_app/immutable/nodes/13.BIZ8AY9M.js.br +0 -0
  346. package/build/client/_app/immutable/nodes/13.BIZ8AY9M.js.gz +0 -0
  347. package/build/client/_app/immutable/nodes/14.DfoPNHw_.js +0 -65
  348. package/build/client/_app/immutable/nodes/14.DfoPNHw_.js.br +0 -0
  349. package/build/client/_app/immutable/nodes/14.DfoPNHw_.js.gz +0 -0
  350. package/build/client/_app/immutable/nodes/2.C6NzDBVE.js.br +0 -2
  351. package/build/client/_app/immutable/nodes/2.C6NzDBVE.js.gz +0 -0
  352. package/build/client/_app/immutable/nodes/3.CZJqJ4La.js.br +0 -0
  353. package/build/client/_app/immutable/nodes/3.CZJqJ4La.js.gz +0 -0
  354. package/build/client/_app/immutable/nodes/4.CNe3XPNo.js.br +0 -0
  355. package/build/client/_app/immutable/nodes/4.CNe3XPNo.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/5.BWhhv567.js.br +0 -0
  357. package/build/client/_app/immutable/nodes/5.BWhhv567.js.gz +0 -0
  358. package/build/client/_app/immutable/nodes/7.CTCgtWr5.js.br +0 -0
  359. package/build/client/_app/immutable/nodes/7.CTCgtWr5.js.gz +0 -0
  360. package/build/client/_app/immutable/nodes/8.B9VIkjMO.js +0 -2
  361. package/build/client/_app/immutable/nodes/8.B9VIkjMO.js.br +0 -0
  362. package/build/client/_app/immutable/nodes/8.B9VIkjMO.js.gz +0 -0
  363. package/build/client/_app/immutable/nodes/9.DgUUrJMM.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/9.DgUUrJMM.js.gz +0 -0
  365. package/build/server/chunks/0-CKG6FzOP.js +0 -31
  366. package/build/server/chunks/1-BobnPu2T.js +0 -9
  367. package/build/server/chunks/1-BobnPu2T.js.map +0 -1
  368. package/build/server/chunks/11-BNbY7gn2.js.map +0 -1
  369. package/build/server/chunks/13-EXQa77Y1.js.map +0 -1
  370. package/build/server/chunks/14-DHzR9sir.js.map +0 -1
  371. package/build/server/chunks/JsonValue-CTg4aH_w.js.map +0 -1
  372. package/build/server/chunks/Modal-yO0qzufQ.js.map +0 -1
  373. package/build/server/chunks/Panel-D9GzVDDt.js.map +0 -1
  374. package/build/server/chunks/PrettyJson-BVgLycwy.js.map +0 -1
  375. package/build/server/chunks/Tooltip-D2BX7dwq.js.map +0 -1
  376. package/build/server/chunks/TooltipTable-91W9LxGR.js.map +0 -1
  377. package/build/server/chunks/_layout.svelte-BFxKanne.js.map +0 -1
  378. package/build/server/chunks/_page.svelte-BE3IXD7W.js.map +0 -1
  379. package/build/server/chunks/_page.svelte-BimaUmmG.js.map +0 -1
  380. package/build/server/chunks/_page.svelte-BkyGMJtY.js.map +0 -1
  381. package/build/server/chunks/_page.svelte-CYgL8X_3.js.map +0 -1
  382. package/build/server/chunks/_page.svelte-DEuOrgce.js.map +0 -1
  383. package/build/server/chunks/_page.svelte-DybQp3Hh.js.map +0 -1
  384. package/build/server/chunks/_page.svelte-Q0qOjc1K.js.map +0 -1
  385. package/build/server/chunks/async-lVJA8xJZ.js.map +0 -1
  386. package/build/server/chunks/client-C7bEwskR.js +0 -7
  387. package/build/server/chunks/client2-DcCKOWWC.js.map +0 -1
  388. package/build/server/chunks/error.svelte-Bk-0XnBt.js +0 -18
  389. package/build/server/chunks/index-CC9WtE-y.js.map +0 -1
  390. package/build/server/chunks/index-wpIsICWW.js.map +0 -1
  391. package/build/server/chunks/remote-xxtqbu-DU1VUIfB.js.map +0 -1
  392. package/build/server/chunks/server2-uigtM6st.js.map +0 -1
  393. package/build/server/chunks/servers.remote-ChLjCujn.js.map +0 -1
  394. package/build/server/chunks/shared-BqTYMAzZ.js.map +0 -1
  395. package/build/server/chunks/state.svelte-Dzb7Lf2r.js +0 -9
  396. package/build/server/chunks/state.svelte-Dzb7Lf2r.js.map +0 -1
  397. package/build/server/chunks/url-hmE1zcJ6.js.map +0 -1
  398. package/build/server/chunks/utils2-kjxf7BZO.js.map +0 -1
@@ -1,6 +1,77 @@
1
- import { a as async_mode_flag, t as tracing_mode_flag } from './async-lVJA8xJZ.js';
1
+ import { a as async_mode_flag, t as tracing_mode_flag } from './async-DUoD1OpG.js';
2
+
3
+ // eslint-disable-next-line n/prefer-global/process
4
+ const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
5
+
6
+ /** @import { RequestEvent } from '@sveltejs/kit' */
7
+ /** @import { RequestStore } from 'types' */
8
+ /** @import { AsyncLocalStorage } from 'node:async_hooks' */
9
+
10
+
11
+ /** @type {RequestStore | null} */
12
+ let sync_store = null;
13
+
14
+ /** @type {AsyncLocalStorage<RequestStore | null> | null} */
15
+ let als$1;
16
+
17
+ import('node:async_hooks')
18
+ .then((hooks) => (als$1 = new hooks.AsyncLocalStorage()))
19
+ .catch(() => {
20
+ // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously.
21
+ // this isn't behind `supports` because it's basically just StackBlitz (i.e.
22
+ // in-browser usage) that doesn't support it AFAICT
23
+ });
24
+
25
+ function get_request_store() {
26
+ const result = try_get_request_store();
27
+ if (!result) {
28
+ let message = 'Could not get the request store.';
29
+
30
+ if (als$1) {
31
+ message += ' This is an internal error.';
32
+ } else {
33
+ message +=
34
+ ' In environments without `AsyncLocalStorage`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an `await`.' +
35
+ ' If it was accessed synchronously then this is an internal error.';
36
+ }
37
+
38
+ throw new Error(message);
39
+ }
40
+ return result;
41
+ }
42
+
43
+ function try_get_request_store() {
44
+ return sync_store ?? als$1?.getStore() ?? null;
45
+ }
46
+
47
+ /**
48
+ * @template T
49
+ * @param {RequestStore | null} store
50
+ * @param {() => T} fn
51
+ */
52
+ function with_request_store(store, fn) {
53
+ try {
54
+ sync_store = store;
55
+ return als$1 ? als$1.run(store, fn) : fn();
56
+ } finally {
57
+ // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store`
58
+ // and handle only one request at a time in `src/runtime/server/index.js`.
59
+ if (!IN_WEBCONTAINER) {
60
+ sync_store = null;
61
+ }
62
+ }
63
+ }
2
64
 
3
65
  const DEV = false;
66
+ const UNDEFINED = -1;
67
+ const HOLE = -2;
68
+ const NAN = -3;
69
+ const POSITIVE_INFINITY = -4;
70
+ const NEGATIVE_INFINITY = -5;
71
+ const NEGATIVE_ZERO = -6;
72
+ const SPARSE = -7;
73
+ const MAX_ARRAY_LEN = 2 ** 32 - 1;
74
+ const MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
4
75
  const escaped = {
5
76
  "<": "\\u003C",
6
77
  "\\": "\\\\",
@@ -28,11 +99,9 @@ class DevalueError extends Error {
28
99
  }
29
100
  }
30
101
  function is_primitive(thing) {
31
- return Object(thing) !== thing;
102
+ return thing === null || typeof thing !== "object" && typeof thing !== "function";
32
103
  }
33
- const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(
34
- Object.prototype
35
- ).sort().join("\0");
104
+ const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
36
105
  function is_plain_object(thing) {
37
106
  const proto = Object.getPrototypeOf(thing);
38
107
  return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
@@ -89,91 +158,37 @@ const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
89
158
  function stringify_key(key) {
90
159
  return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
91
160
  }
92
- function is_valid_array_index(s) {
161
+ function is_valid_array_index(n) {
162
+ if (!Number.isInteger(n)) return false;
163
+ if (n < 0) return false;
164
+ if (n > MAX_ARRAY_INDEX) return false;
165
+ return true;
166
+ }
167
+ function is_valid_array_len(n) {
168
+ if (!Number.isInteger(n)) return false;
169
+ if (n < 0) return false;
170
+ if (n > MAX_ARRAY_LEN) return false;
171
+ return true;
172
+ }
173
+ function is_valid_array_index_string(s) {
93
174
  if (s.length === 0) return false;
94
175
  if (s.length > 1 && s.charCodeAt(0) === 48) return false;
95
176
  for (let i = 0; i < s.length; i++) {
96
177
  const c = s.charCodeAt(i);
97
178
  if (c < 48 || c > 57) return false;
98
179
  }
99
- const n = +s;
100
- if (n >= 2 ** 32 - 1) return false;
101
- if (n < 0) return false;
102
- return true;
180
+ return is_valid_array_index(+s);
103
181
  }
104
182
  function valid_array_indices(array) {
105
183
  const keys = Object.keys(array);
106
184
  for (var i = keys.length - 1; i >= 0; i--) {
107
- if (is_valid_array_index(keys[i])) {
185
+ if (is_valid_array_index_string(keys[i])) {
108
186
  break;
109
187
  }
110
188
  }
111
189
  keys.length = i + 1;
112
190
  return keys;
113
191
  }
114
-
115
- // eslint-disable-next-line n/prefer-global/process
116
- const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
117
-
118
- /** @import { RequestEvent } from '@sveltejs/kit' */
119
- /** @import { RequestStore } from 'types' */
120
- /** @import { AsyncLocalStorage } from 'node:async_hooks' */
121
-
122
-
123
- /** @type {RequestStore | null} */
124
- let sync_store = null;
125
-
126
- /** @type {AsyncLocalStorage<RequestStore | null> | null} */
127
- let als$1;
128
-
129
- import('node:async_hooks')
130
- .then((hooks) => (als$1 = new hooks.AsyncLocalStorage()))
131
- .catch(() => {
132
- // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously.
133
- // this isn't behind `supports` because it's basically just StackBlitz (i.e.
134
- // in-browser usage) that doesn't support it AFAICT
135
- });
136
-
137
- function get_request_store() {
138
- const result = try_get_request_store();
139
- if (!result) {
140
- let message = 'Could not get the request store.';
141
-
142
- if (als$1) {
143
- message += ' This is an internal error.';
144
- } else {
145
- message +=
146
- ' In environments without `AsyncLocalStorage`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an `await`.' +
147
- ' If it was accessed synchronously then this is an internal error.';
148
- }
149
-
150
- throw new Error(message);
151
- }
152
- return result;
153
- }
154
-
155
- function try_get_request_store() {
156
- return sync_store ?? als$1?.getStore() ?? null;
157
- }
158
-
159
- /**
160
- * @template T
161
- * @param {RequestStore | null} store
162
- * @param {() => T} fn
163
- */
164
- function with_request_store(store, fn) {
165
- try {
166
- sync_store = store;
167
- return als$1 ? als$1.run(store, fn) : fn();
168
- } finally {
169
- // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store`
170
- // and handle only one request at a time in `src/runtime/server/index.js`.
171
- if (!IN_WEBCONTAINER) {
172
- sync_store = null;
173
- }
174
- }
175
- }
176
-
177
192
  const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
178
193
  const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
179
194
  const reserved = /^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
@@ -221,9 +236,7 @@ function uneval(value, replacer) {
221
236
  break;
222
237
  case "Map":
223
238
  for (const [key, value2] of thing) {
224
- keys.push(
225
- `.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`
226
- );
239
+ keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`);
227
240
  walk(value2);
228
241
  keys.pop();
229
242
  }
@@ -233,12 +246,14 @@ function uneval(value, replacer) {
233
246
  case "Uint8ClampedArray":
234
247
  case "Int16Array":
235
248
  case "Uint16Array":
249
+ case "Float16Array":
236
250
  case "Int32Array":
237
251
  case "Uint32Array":
238
252
  case "Float32Array":
239
253
  case "Float64Array":
240
254
  case "BigInt64Array":
241
255
  case "BigUint64Array":
256
+ case "DataView":
242
257
  walk(thing.buffer);
243
258
  return;
244
259
  case "ArrayBuffer":
@@ -254,20 +269,10 @@ function uneval(value, replacer) {
254
269
  return;
255
270
  default:
256
271
  if (!is_plain_object(thing)) {
257
- throw new DevalueError(
258
- `Cannot stringify arbitrary non-POJOs`,
259
- keys,
260
- thing,
261
- value
262
- );
272
+ throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
263
273
  }
264
274
  if (enumerable_symbols(thing).length > 0) {
265
- throw new DevalueError(
266
- `Cannot stringify POJOs with symbolic keys`,
267
- keys,
268
- thing,
269
- value
270
- );
275
+ throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
271
276
  }
272
277
  for (const key of Object.keys(thing)) {
273
278
  if (key === "__proto__") {
@@ -283,6 +288,8 @@ function uneval(value, replacer) {
283
288
  keys.pop();
284
289
  }
285
290
  }
291
+ } else if (typeof thing === "symbol") {
292
+ throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
286
293
  }
287
294
  }
288
295
  walk(value);
@@ -290,7 +297,7 @@ function uneval(value, replacer) {
290
297
  Array.from(counts).filter((entry) => entry[1] > 1).sort((a, b) => b[1] - a[1]).forEach((entry, i) => {
291
298
  names.set(entry[0], get_name(i));
292
299
  });
293
- function stringify2(thing) {
300
+ function stringify(thing) {
294
301
  if (names.has(thing)) {
295
302
  return names.get(thing);
296
303
  }
@@ -305,9 +312,11 @@ function uneval(value, replacer) {
305
312
  case "Number":
306
313
  case "String":
307
314
  case "Boolean":
308
- return `Object(${stringify2(thing.valueOf())})`;
315
+ case "BigInt":
316
+ return `Object(${stringify(thing.valueOf())})`;
309
317
  case "RegExp":
310
- return `new RegExp(${stringify_string(thing.source)}, "${thing.flags}")`;
318
+ const { source, flags } = thing;
319
+ return flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
311
320
  case "Date":
312
321
  return `new Date(${thing.getTime()})`;
313
322
  case "URL":
@@ -320,7 +329,7 @@ function uneval(value, replacer) {
320
329
  for (let i = 0; i < thing.length; i += 1) {
321
330
  if (i > 0) result += ",";
322
331
  if (Object.hasOwn(thing, i)) {
323
- result += stringify2(thing[i]);
332
+ result += stringify(thing[i]);
324
333
  } else if (!has_holes) {
325
334
  const populated_keys = valid_array_indices(
326
335
  /** @type {any[]} */
@@ -331,7 +340,7 @@ function uneval(value, replacer) {
331
340
  const hole_cost = thing.length + 2;
332
341
  const sparse_cost = 25 + d + population * (d + 2);
333
342
  if (hole_cost > sparse_cost) {
334
- const entries = populated_keys.map((k) => `${k}:${stringify2(thing[k])}`).join(",");
343
+ const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(",");
335
344
  return `Object.assign(Array(${thing.length}),{${entries}})`;
336
345
  }
337
346
  has_holes = true;
@@ -343,12 +352,13 @@ function uneval(value, replacer) {
343
352
  }
344
353
  case "Set":
345
354
  case "Map":
346
- return `new ${type}([${Array.from(thing).map(stringify2).join(",")}])`;
355
+ return `new ${type}([${Array.from(thing).map(stringify).join(",")}])`;
347
356
  case "Int8Array":
348
357
  case "Uint8Array":
349
358
  case "Uint8ClampedArray":
350
359
  case "Int16Array":
351
360
  case "Uint16Array":
361
+ case "Float16Array":
352
362
  case "Int32Array":
353
363
  case "Uint32Array":
354
364
  case "Float32Array":
@@ -356,20 +366,31 @@ function uneval(value, replacer) {
356
366
  case "BigInt64Array":
357
367
  case "BigUint64Array": {
358
368
  let str2 = `new ${type}`;
359
- if (counts.get(thing.buffer) === 1) {
369
+ if (!names.has(thing.buffer)) {
360
370
  const array = new thing.constructor(thing.buffer);
361
371
  str2 += `([${array}])`;
362
372
  } else {
363
- str2 += `([${stringify2(thing.buffer)}])`;
373
+ str2 += `(${stringify(thing.buffer)})`;
364
374
  }
365
- const a = thing.byteOffset;
366
- const b = a + thing.byteLength;
367
- if (a > 0 || b !== thing.buffer.byteLength) {
368
- const m = +/(\d+)/.exec(type)[1] / 8;
369
- str2 += `.subarray(${a / m},${b / m})`;
375
+ if (thing.byteLength !== thing.buffer.byteLength) {
376
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
377
+ const end = start + thing.length;
378
+ str2 += `.subarray(${start},${end})`;
370
379
  }
371
380
  return str2;
372
381
  }
382
+ case "DataView": {
383
+ let str2 = `new DataView`;
384
+ if (!names.has(thing.buffer)) {
385
+ str2 += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
386
+ } else {
387
+ str2 += `(${stringify(thing.buffer)}`;
388
+ }
389
+ if (thing.byteLength !== thing.buffer.byteLength) {
390
+ str2 += `,${thing.startOffset},${thing.byteLength}`;
391
+ }
392
+ return str2 + ")";
393
+ }
373
394
  case "ArrayBuffer": {
374
395
  const ui8 = new Uint8Array(thing);
375
396
  return `new Uint8Array([${ui8.toString()}]).buffer`;
@@ -385,7 +406,7 @@ function uneval(value, replacer) {
385
406
  return `${type}.from(${stringify_string(thing.toString())})`;
386
407
  default:
387
408
  const keys2 = Object.keys(thing);
388
- const obj = keys2.map((key) => `${safe_key(key)}:${stringify2(thing[key])}`).join(",");
409
+ const obj = keys2.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(",");
389
410
  const proto = Object.getPrototypeOf(thing);
390
411
  if (proto === null) {
391
412
  return keys2.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
@@ -393,7 +414,7 @@ function uneval(value, replacer) {
393
414
  return `{${obj}}`;
394
415
  }
395
416
  }
396
- const str = stringify2(value);
417
+ const str = stringify(value);
397
418
  if (names.size) {
398
419
  const params = [];
399
420
  const statements = [];
@@ -416,52 +437,96 @@ function uneval(value, replacer) {
416
437
  case "Number":
417
438
  case "String":
418
439
  case "Boolean":
419
- values.push(`Object(${stringify2(thing.valueOf())})`);
440
+ case "BigInt":
441
+ values.push(`Object(${stringify(thing.valueOf())})`);
420
442
  break;
421
443
  case "RegExp":
422
- values.push(thing.toString());
444
+ const { source, flags } = thing;
445
+ const regexp = flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
446
+ values.push(regexp);
423
447
  break;
424
448
  case "Date":
425
449
  values.push(`new Date(${thing.getTime()})`);
426
450
  break;
451
+ case "URL":
452
+ values.push(`new URL(${stringify_string(thing.toString())})`);
453
+ break;
454
+ case "URLSearchParams":
455
+ values.push(`new URLSearchParams(${stringify_string(thing.toString())})`);
456
+ break;
427
457
  case "Array":
428
458
  values.push(`Array(${thing.length})`);
429
459
  thing.forEach((v, i) => {
430
- statements.push(`${name}[${i}]=${stringify2(v)}`);
460
+ statements.push(`${name}[${i}]=${stringify(v)}`);
431
461
  });
432
462
  break;
433
463
  case "Set":
434
464
  values.push(`new Set`);
435
465
  statements.push(
436
- `${name}.${Array.from(thing).map((v) => `add(${stringify2(v)})`).join(".")}`
466
+ `${name}.${Array.from(thing).map((v) => `add(${stringify(v)})`).join(".")}`
437
467
  );
438
468
  break;
439
469
  case "Map":
440
470
  values.push(`new Map`);
441
471
  statements.push(
442
- `${name}.${Array.from(thing).map(([k, v]) => `set(${stringify2(k)}, ${stringify2(v)})`).join(".")}`
472
+ `${name}.${Array.from(thing).map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`).join(".")}`
443
473
  );
444
474
  break;
475
+ case "Int8Array":
476
+ case "Uint8Array":
477
+ case "Uint8ClampedArray":
478
+ case "Int16Array":
479
+ case "Uint16Array":
480
+ case "Float16Array":
481
+ case "Int32Array":
482
+ case "Uint32Array":
483
+ case "Float32Array":
484
+ case "Float64Array":
485
+ case "BigInt64Array":
486
+ case "BigUint64Array": {
487
+ let str2 = `new ${type}`;
488
+ if (!names.has(thing.buffer)) {
489
+ const array = new thing.constructor(thing.buffer);
490
+ str2 += `([${array}])`;
491
+ } else {
492
+ str2 += `(${stringify(thing.buffer)})`;
493
+ }
494
+ if (thing.byteLength !== thing.buffer.byteLength) {
495
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
496
+ const end = start + thing.length;
497
+ str2 += `.subarray(${start},${end})`;
498
+ }
499
+ values.push(`{}`);
500
+ statements.push(`${name}=${str2}`);
501
+ break;
502
+ }
503
+ case "DataView": {
504
+ let str2 = `new DataView`;
505
+ if (!names.has(thing.buffer)) {
506
+ str2 += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
507
+ } else {
508
+ str2 += `(${stringify(thing.buffer)}`;
509
+ }
510
+ if (thing.byteLength !== thing.buffer.byteLength) {
511
+ str2 += `,${thing.byteOffset},${thing.byteLength}`;
512
+ }
513
+ str2 += ")";
514
+ values.push(`{}`);
515
+ statements.push(`${name}=${str2}`);
516
+ break;
517
+ }
445
518
  case "ArrayBuffer":
446
- values.push(
447
- `new Uint8Array([${new Uint8Array(thing).join(",")}]).buffer`
448
- );
519
+ values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
449
520
  break;
450
521
  default:
451
- values.push(
452
- Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}"
453
- );
522
+ values.push(Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}");
454
523
  Object.keys(thing).forEach((key) => {
455
- statements.push(
456
- `${name}${safe_prop(key)}=${stringify2(thing[key])}`
457
- );
524
+ statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
458
525
  });
459
526
  }
460
527
  });
461
528
  statements.push(`return ${str}`);
462
- return `(function(${params.join(",")}){${statements.join(
463
- ";"
464
- )}}(${values.join(",")}))`;
529
+ return `(function(${params.join(",")}){${statements.join(";")}}(${values.join(",")}))`;
465
530
  } else {
466
531
  return str;
467
532
  }
@@ -487,14 +552,79 @@ function safe_prop(key) {
487
552
  return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? `.${key}` : `[${escape_unsafe_chars(JSON.stringify(key))}]`;
488
553
  }
489
554
  function stringify_primitive(thing) {
490
- if (typeof thing === "string") return stringify_string(thing);
555
+ const type = typeof thing;
556
+ if (type === "string") return stringify_string(thing);
491
557
  if (thing === void 0) return "void 0";
492
558
  if (thing === 0 && 1 / thing < 0) return "-0";
493
559
  const str = String(thing);
494
- if (typeof thing === "number") return str.replace(/^(-)?0\./, "$1.");
495
- if (typeof thing === "bigint") return thing + "n";
560
+ if (type === "number") return str.replace(/^(-)?0\./, "$1.");
561
+ if (type === "bigint") return thing + "n";
496
562
  return str;
497
563
  }
564
+ function experimental_async_required(name) {
565
+ {
566
+ throw new Error(`https://svelte.dev/e/experimental_async_required`);
567
+ }
568
+ }
569
+ function lifecycle_outside_component(name) {
570
+ {
571
+ throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
572
+ }
573
+ }
574
+ function async_local_storage_unavailable() {
575
+ const error = new Error(`async_local_storage_unavailable
576
+ The node API \`AsyncLocalStorage\` is not available, but is required to use async server rendering.
577
+ https://svelte.dev/e/async_local_storage_unavailable`);
578
+ error.name = "Svelte error";
579
+ throw error;
580
+ }
581
+ function await_invalid() {
582
+ const error = new Error(`await_invalid
583
+ Encountered asynchronous work while rendering synchronously.
584
+ https://svelte.dev/e/await_invalid`);
585
+ error.name = "Svelte error";
586
+ throw error;
587
+ }
588
+ function html_deprecated() {
589
+ const error = new Error(`html_deprecated
590
+ The \`html\` property of server render results has been deprecated. Use \`body\` instead.
591
+ https://svelte.dev/e/html_deprecated`);
592
+ error.name = "Svelte error";
593
+ throw error;
594
+ }
595
+ function hydratable_serialization_failed(key, stack) {
596
+ const error = new Error(`hydratable_serialization_failed
597
+ Failed to serialize \`hydratable\` data for key \`${key}\`.
598
+
599
+ \`hydratable\` can serialize anything [\`uneval\` from \`devalue\`](https://npmjs.com/package/uneval) can, plus Promises.
600
+
601
+ Cause:
602
+ ${stack}
603
+ https://svelte.dev/e/hydratable_serialization_failed`);
604
+ error.name = "Svelte error";
605
+ throw error;
606
+ }
607
+ function invalid_csp() {
608
+ const error = new Error(`invalid_csp
609
+ \`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.
610
+ https://svelte.dev/e/invalid_csp`);
611
+ error.name = "Svelte error";
612
+ throw error;
613
+ }
614
+ function invalid_id_prefix() {
615
+ const error = new Error(`invalid_id_prefix
616
+ The \`idPrefix\` option cannot include \`--\`.
617
+ https://svelte.dev/e/invalid_id_prefix`);
618
+ error.name = "Svelte error";
619
+ throw error;
620
+ }
621
+ function server_context_required() {
622
+ const error = new Error(`server_context_required
623
+ Could not resolve \`render\` context.
624
+ https://svelte.dev/e/server_context_required`);
625
+ error.name = "Svelte error";
626
+ throw error;
627
+ }
498
628
  var is_array = Array.isArray;
499
629
  var index_of = Array.prototype.indexOf;
500
630
  var includes = Array.prototype.includes;
@@ -525,14 +655,187 @@ function deferred() {
525
655
  });
526
656
  return { promise, resolve, reject };
527
657
  }
528
- function equals(value) {
529
- return value === this.v;
658
+ let current_render = null;
659
+ let context = null;
660
+ function get_render_context() {
661
+ const store = context ?? als?.getStore();
662
+ if (!store) {
663
+ server_context_required();
664
+ }
665
+ return store;
530
666
  }
531
- function safe_not_equal(a, b) {
532
- return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
667
+ async function with_render_context(fn) {
668
+ context = {
669
+ hydratable: {
670
+ lookup: /* @__PURE__ */ new Map(),
671
+ comparisons: [],
672
+ unresolved_promises: /* @__PURE__ */ new Map()
673
+ }
674
+ };
675
+ if (in_webcontainer()) {
676
+ const { promise, resolve } = deferred();
677
+ const previous_render = current_render;
678
+ current_render = promise;
679
+ await previous_render;
680
+ return fn().finally(resolve);
681
+ }
682
+ try {
683
+ if (als === null) {
684
+ async_local_storage_unavailable();
685
+ }
686
+ return als.run(context, fn);
687
+ } finally {
688
+ context = null;
689
+ }
533
690
  }
534
- function safe_equals(value) {
535
- return !safe_not_equal(value, this.v);
691
+ let als = null;
692
+ let als_import = null;
693
+ function init_render_context() {
694
+ als_import ??= import('node:async_hooks').then((hooks) => {
695
+ als = new hooks.AsyncLocalStorage();
696
+ }).then(noop, noop);
697
+ return als_import;
698
+ }
699
+ function in_webcontainer() {
700
+ return !!globalThis.process?.versions?.webcontainer;
701
+ }
702
+
703
+ const internal = new URL("sveltekit-internal://");
704
+ function resolve(base, path) {
705
+ if (path[0] === "/" && path[1] === "/") return path;
706
+ let url = new URL(base, internal);
707
+ url = new URL(path, url);
708
+ return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;
709
+ }
710
+ function normalize_path(path, trailing_slash) {
711
+ if (path === "/" || trailing_slash === "ignore") return path;
712
+ if (trailing_slash === "never") {
713
+ return path.endsWith("/") ? path.slice(0, -1) : path;
714
+ } else if (trailing_slash === "always" && !path.endsWith("/")) {
715
+ return path + "/";
716
+ }
717
+ return path;
718
+ }
719
+ function decode_pathname(pathname) {
720
+ return pathname.split("%25").map(decodeURI).join("%25");
721
+ }
722
+ function decode_params(params) {
723
+ for (const key in params) {
724
+ params[key] = decodeURIComponent(params[key]);
725
+ }
726
+ return params;
727
+ }
728
+ function make_trackable(url, callback, search_params_callback, allow_hash = false) {
729
+ const tracked = new URL(url);
730
+ Object.defineProperty(tracked, "searchParams", {
731
+ value: new Proxy(tracked.searchParams, {
732
+ get(obj, key) {
733
+ if (key === "get" || key === "getAll" || key === "has") {
734
+ return (param, ...rest) => {
735
+ search_params_callback(param);
736
+ return obj[key](param, ...rest);
737
+ };
738
+ }
739
+ callback();
740
+ const value = Reflect.get(obj, key);
741
+ return typeof value === "function" ? value.bind(obj) : value;
742
+ }
743
+ }),
744
+ enumerable: true,
745
+ configurable: true
746
+ });
747
+ const tracked_url_properties = ["href", "pathname", "search", "toString", "toJSON"];
748
+ if (allow_hash) tracked_url_properties.push("hash");
749
+ for (const property of tracked_url_properties) {
750
+ Object.defineProperty(tracked, property, {
751
+ get() {
752
+ callback();
753
+ return url[property];
754
+ },
755
+ enumerable: true,
756
+ configurable: true
757
+ });
758
+ }
759
+ {
760
+ tracked[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => {
761
+ return inspect(url, opts);
762
+ };
763
+ tracked.searchParams[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => {
764
+ return inspect(url.searchParams, opts);
765
+ };
766
+ }
767
+ if (!allow_hash) {
768
+ disable_hash(tracked);
769
+ }
770
+ return tracked;
771
+ }
772
+ function disable_hash(url) {
773
+ allow_nodejs_console_log(url);
774
+ Object.defineProperty(url, "hash", {
775
+ get() {
776
+ throw new Error(
777
+ "Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead"
778
+ );
779
+ }
780
+ });
781
+ }
782
+ function disable_search(url) {
783
+ allow_nodejs_console_log(url);
784
+ for (const property of ["search", "searchParams"]) {
785
+ Object.defineProperty(url, property, {
786
+ get() {
787
+ throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);
788
+ }
789
+ });
790
+ }
791
+ }
792
+ function allow_nodejs_console_log(url) {
793
+ {
794
+ url[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => {
795
+ return inspect(new URL(url), opts);
796
+ };
797
+ }
798
+ }
799
+
800
+ var ssr_context = null;
801
+ function set_ssr_context(v) {
802
+ ssr_context = v;
803
+ }
804
+ function getContext(key) {
805
+ const context_map = get_or_init_context_map();
806
+ const result = (
807
+ /** @type {T} */
808
+ context_map.get(key)
809
+ );
810
+ return result;
811
+ }
812
+ function setContext(key, context) {
813
+ get_or_init_context_map().set(key, context);
814
+ return context;
815
+ }
816
+ function get_or_init_context_map(name) {
817
+ if (ssr_context === null) {
818
+ lifecycle_outside_component();
819
+ }
820
+ return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
821
+ }
822
+ function push$1(fn) {
823
+ ssr_context = { p: ssr_context, c: null, r: null };
824
+ }
825
+ function pop$1() {
826
+ ssr_context = /** @type {SSRContext} */
827
+ ssr_context.p;
828
+ }
829
+ function get_parent_context(ssr_context2) {
830
+ let parent = ssr_context2.p;
831
+ while (parent !== null) {
832
+ const context_map = parent.c;
833
+ if (context_map !== null) {
834
+ return context_map;
835
+ }
836
+ parent = parent.p;
837
+ }
838
+ return null;
536
839
  }
537
840
  const DERIVED = 1 << 1;
538
841
  const EFFECT = 1 << 2;
@@ -549,6 +852,7 @@ const MAYBE_DIRTY = 1 << 12;
549
852
  const INERT = 1 << 13;
550
853
  const DESTROYED = 1 << 14;
551
854
  const REACTION_RAN = 1 << 15;
855
+ const DESTROYING = 1 << 25;
552
856
  const EFFECT_TRANSPARENT = 1 << 16;
553
857
  const EAGER_EFFECT = 1 << 17;
554
858
  const HEAD_EFFECT = 1 << 18;
@@ -560,45 +864,19 @@ const ASYNC = 1 << 22;
560
864
  const ERROR_VALUE = 1 << 23;
561
865
  const STATE_SYMBOL = /* @__PURE__ */ Symbol("$state");
562
866
  const LEGACY_PROPS = /* @__PURE__ */ Symbol("legacy props");
867
+ const ATTRIBUTES_CACHE = /* @__PURE__ */ Symbol("attributes");
868
+ const CLASS_CACHE = /* @__PURE__ */ Symbol("class");
869
+ const STYLE_CACHE = /* @__PURE__ */ Symbol("style");
870
+ const TEXT_CACHE = /* @__PURE__ */ Symbol("text");
563
871
  const STALE_REACTION = new class StaleReactionError extends Error {
564
872
  name = "StaleReactionError";
565
873
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
566
874
  }();
567
875
  const COMMENT_NODE = 8;
568
- function lifecycle_outside_component(name) {
569
- {
570
- throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
571
- }
572
- }
573
- function effect_update_depth_exceeded() {
574
- {
575
- throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
576
- }
577
- }
578
- function hydration_failed() {
579
- {
580
- throw new Error(`https://svelte.dev/e/hydration_failed`);
581
- }
582
- }
583
- function state_descriptors_fixed() {
584
- {
585
- throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
586
- }
587
- }
588
- function state_prototype_fixed() {
589
- {
590
- throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
591
- }
592
- }
593
- function state_unsafe_mutation() {
594
- {
595
- throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
596
- }
597
- }
598
- function svelte_boundary_reset_onerror() {
599
- {
600
- throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
601
- }
876
+ let controller = null;
877
+ function abort() {
878
+ controller?.abort(STALE_REACTION);
879
+ controller = null;
602
880
  }
603
881
  const HYDRATION_START = "[";
604
882
  const HYDRATION_START_ELSE = "[!";
@@ -609,47 +887,261 @@ const ELEMENT_IS_NAMESPACED = 1;
609
887
  const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
610
888
  const ELEMENT_IS_INPUT = 1 << 2;
611
889
  const UNINITIALIZED = /* @__PURE__ */ Symbol();
612
- function hydration_mismatch(location) {
890
+ function unresolved_hydratable(key, stack) {
613
891
  {
614
- console.warn(`https://svelte.dev/e/hydration_mismatch`);
892
+ console.warn(`https://svelte.dev/e/unresolved_hydratable`);
615
893
  }
616
894
  }
617
- function svelte_boundary_reset_noop() {
618
- {
619
- console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
895
+ const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
896
+ const BLOCK_OPEN_ELSE = `<!--${HYDRATION_START_ELSE}-->`;
897
+ const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
898
+ const EMPTY_COMMENT = `<!---->`;
899
+ const ATTR_REGEX = /[&"<]/g;
900
+ const CONTENT_REGEX = /[&<]/g;
901
+ function escape_html(value, is_attr) {
902
+ const str = String(value ?? "");
903
+ const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
904
+ pattern.lastIndex = 0;
905
+ let escaped = "";
906
+ let last = 0;
907
+ while (pattern.test(str)) {
908
+ const i = pattern.lastIndex - 1;
909
+ const ch = str[i];
910
+ escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
911
+ last = i + 1;
620
912
  }
913
+ return escaped + str.substring(last);
621
914
  }
622
- let hydrating = false;
623
- function set_hydrating(value) {
624
- hydrating = value;
915
+ function r(e) {
916
+ var t, f, n = "";
917
+ if ("string" == typeof e || "number" == typeof e) n += e;
918
+ else if ("object" == typeof e) if (Array.isArray(e)) {
919
+ var o = e.length;
920
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
921
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
922
+ return n;
625
923
  }
626
- let hydrate_node;
627
- function set_hydrate_node(node) {
628
- if (node === null) {
629
- hydration_mismatch();
630
- throw HYDRATION_ERROR;
631
- }
632
- return hydrate_node = node;
924
+ function clsx$1() {
925
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
926
+ return n;
633
927
  }
634
- function hydrate_next() {
635
- return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node));
928
+ const replacements = {
929
+ translate: /* @__PURE__ */ new Map([
930
+ [true, "yes"],
931
+ [false, "no"]
932
+ ])
933
+ };
934
+ function attr(name, value, is_boolean = false) {
935
+ if (name === "hidden" && value !== "until-found") {
936
+ is_boolean = true;
937
+ }
938
+ if (value == null || !value && is_boolean) return "";
939
+ const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
940
+ const assignment = is_boolean ? `=""` : `="${escape_html(normalized, true)}"`;
941
+ return ` ${name}${assignment}`;
636
942
  }
637
- function next(count = 1) {
638
- if (hydrating) {
639
- var i = count;
640
- var node = hydrate_node;
641
- while (i--) {
642
- node = /** @type {TemplateNode} */
643
- /* @__PURE__ */ get_next_sibling(node);
644
- }
645
- hydrate_node = node;
943
+ function clsx(value) {
944
+ if (typeof value === "object") {
945
+ return clsx$1(value);
946
+ } else {
947
+ return value ?? "";
646
948
  }
647
949
  }
648
- function skip_nodes(remove = true) {
649
- var depth = 0;
650
- var node = hydrate_node;
651
- while (true) {
652
- if (node.nodeType === COMMENT_NODE) {
950
+ const whitespace = [..." \n\r\f \v\uFEFF"];
951
+ function to_class(value, hash, directives) {
952
+ var classname = value == null ? "" : "" + value;
953
+ if (hash) {
954
+ classname = classname ? classname + " " + hash : hash;
955
+ }
956
+ if (directives) {
957
+ for (var key of Object.keys(directives)) {
958
+ if (directives[key]) {
959
+ classname = classname ? classname + " " + key : key;
960
+ } else if (classname.length) {
961
+ var len = key.length;
962
+ var a = 0;
963
+ while ((a = classname.indexOf(key, a)) >= 0) {
964
+ var b = a + len;
965
+ if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) {
966
+ classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
967
+ } else {
968
+ a = b;
969
+ }
970
+ }
971
+ }
972
+ }
973
+ }
974
+ return classname === "" ? null : classname;
975
+ }
976
+ function append_styles(styles, important = false) {
977
+ var separator = important ? " !important;" : ";";
978
+ var css = "";
979
+ for (var key of Object.keys(styles)) {
980
+ var value = styles[key];
981
+ if (value != null && value !== "") {
982
+ css += " " + key + ": " + value + separator;
983
+ }
984
+ }
985
+ return css;
986
+ }
987
+ function to_css_name(name) {
988
+ if (name[0] !== "-" || name[1] !== "-") {
989
+ return name.toLowerCase();
990
+ }
991
+ return name;
992
+ }
993
+ function to_style(value, styles) {
994
+ if (styles) {
995
+ var new_style = "";
996
+ var normal_styles;
997
+ var important_styles;
998
+ if (Array.isArray(styles)) {
999
+ normal_styles = styles[0];
1000
+ important_styles = styles[1];
1001
+ } else {
1002
+ normal_styles = styles;
1003
+ }
1004
+ if (value) {
1005
+ value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
1006
+ var in_str = false;
1007
+ var in_apo = 0;
1008
+ var in_comment = false;
1009
+ var reserved_names = [];
1010
+ if (normal_styles) {
1011
+ reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
1012
+ }
1013
+ if (important_styles) {
1014
+ reserved_names.push(...Object.keys(important_styles).map(to_css_name));
1015
+ }
1016
+ var start_index = 0;
1017
+ var name_index = -1;
1018
+ const len = value.length;
1019
+ for (var i = 0; i < len; i++) {
1020
+ var c = value[i];
1021
+ if (in_comment) {
1022
+ if (c === "/" && value[i - 1] === "*") {
1023
+ in_comment = false;
1024
+ }
1025
+ } else if (in_str) {
1026
+ if (in_str === c) {
1027
+ in_str = false;
1028
+ }
1029
+ } else if (c === "/" && value[i + 1] === "*") {
1030
+ in_comment = true;
1031
+ } else if (c === '"' || c === "'") {
1032
+ in_str = c;
1033
+ } else if (c === "(") {
1034
+ in_apo++;
1035
+ } else if (c === ")") {
1036
+ in_apo--;
1037
+ }
1038
+ if (!in_comment && in_str === false && in_apo === 0) {
1039
+ if (c === ":" && name_index === -1) {
1040
+ name_index = i;
1041
+ } else if (c === ";" || i === len - 1) {
1042
+ if (name_index !== -1) {
1043
+ var name = to_css_name(value.substring(start_index, name_index).trim());
1044
+ if (!reserved_names.includes(name)) {
1045
+ if (c !== ";") {
1046
+ i++;
1047
+ }
1048
+ var property = value.substring(start_index, i).trim();
1049
+ new_style += " " + property + ";";
1050
+ }
1051
+ }
1052
+ start_index = i + 1;
1053
+ name_index = -1;
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+ if (normal_styles) {
1059
+ new_style += append_styles(normal_styles);
1060
+ }
1061
+ if (important_styles) {
1062
+ new_style += append_styles(important_styles, true);
1063
+ }
1064
+ new_style = new_style.trim();
1065
+ return new_style === "" ? null : new_style;
1066
+ }
1067
+ return value == null ? null : String(value);
1068
+ }
1069
+ function effect_update_depth_exceeded() {
1070
+ {
1071
+ throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
1072
+ }
1073
+ }
1074
+ function hydration_failed() {
1075
+ {
1076
+ throw new Error(`https://svelte.dev/e/hydration_failed`);
1077
+ }
1078
+ }
1079
+ function state_descriptors_fixed() {
1080
+ {
1081
+ throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
1082
+ }
1083
+ }
1084
+ function state_prototype_fixed() {
1085
+ {
1086
+ throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
1087
+ }
1088
+ }
1089
+ function state_unsafe_mutation() {
1090
+ {
1091
+ throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
1092
+ }
1093
+ }
1094
+ function svelte_boundary_reset_onerror() {
1095
+ {
1096
+ throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
1097
+ }
1098
+ }
1099
+ function derived_inert() {
1100
+ {
1101
+ console.warn(`https://svelte.dev/e/derived_inert`);
1102
+ }
1103
+ }
1104
+ function hydration_mismatch(location) {
1105
+ {
1106
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
1107
+ }
1108
+ }
1109
+ function svelte_boundary_reset_noop() {
1110
+ {
1111
+ console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
1112
+ }
1113
+ }
1114
+ let hydrating = false;
1115
+ function set_hydrating(value) {
1116
+ hydrating = value;
1117
+ }
1118
+ let hydrate_node;
1119
+ function set_hydrate_node(node) {
1120
+ if (node === null) {
1121
+ hydration_mismatch();
1122
+ throw HYDRATION_ERROR;
1123
+ }
1124
+ return hydrate_node = node;
1125
+ }
1126
+ function hydrate_next() {
1127
+ return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node));
1128
+ }
1129
+ function next(count = 1) {
1130
+ if (hydrating) {
1131
+ var i = count;
1132
+ var node = hydrate_node;
1133
+ while (i--) {
1134
+ node = /** @type {TemplateNode} */
1135
+ /* @__PURE__ */ get_next_sibling(node);
1136
+ }
1137
+ hydrate_node = node;
1138
+ }
1139
+ }
1140
+ function skip_nodes(remove = true) {
1141
+ var depth = 0;
1142
+ var node = hydrate_node;
1143
+ while (true) {
1144
+ if (node.nodeType === COMMENT_NODE) {
653
1145
  var data = (
654
1146
  /** @type {Comment} */
655
1147
  node.data
@@ -670,11 +1162,20 @@ function skip_nodes(remove = true) {
670
1162
  node = next2;
671
1163
  }
672
1164
  }
1165
+ function equals(value) {
1166
+ return value === this.v;
1167
+ }
1168
+ function safe_not_equal(a, b) {
1169
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
1170
+ }
1171
+ function safe_equals(value) {
1172
+ return !safe_not_equal(value, this.v);
1173
+ }
673
1174
  let component_context = null;
674
- function set_component_context(context2) {
675
- component_context = context2;
1175
+ function set_component_context(context) {
1176
+ component_context = context;
676
1177
  }
677
- function push$1(props, runes = false, fn) {
1178
+ function push(props, runes = false, fn) {
678
1179
  component_context = {
679
1180
  p: component_context,
680
1181
  i: false,
@@ -682,23 +1183,27 @@ function push$1(props, runes = false, fn) {
682
1183
  e: null,
683
1184
  s: props,
684
1185
  x: null,
1186
+ r: (
1187
+ /** @type {Effect} */
1188
+ active_effect
1189
+ ),
685
1190
  l: null
686
1191
  };
687
1192
  }
688
- function pop$1(component) {
689
- var context2 = (
1193
+ function pop(component) {
1194
+ var context = (
690
1195
  /** @type {ComponentContext} */
691
1196
  component_context
692
1197
  );
693
- var effects = context2.e;
1198
+ var effects = context.e;
694
1199
  if (effects !== null) {
695
- context2.e = null;
1200
+ context.e = null;
696
1201
  for (var fn of effects) {
697
1202
  create_user_effect(fn);
698
1203
  }
699
1204
  }
700
- context2.i = true;
701
- component_context = context2.p;
1205
+ context.i = true;
1206
+ component_context = context.p;
702
1207
  return (
703
1208
  /** @type {T} */
704
1209
  {}
@@ -788,30 +1293,52 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
788
1293
  clear_marked(effect.deps);
789
1294
  set_signal_status(effect, CLEAN);
790
1295
  }
791
- const batches = /* @__PURE__ */ new Set();
1296
+ let first_batch = null;
1297
+ let last_batch = null;
792
1298
  let current_batch = null;
1299
+ let previous_batch = null;
793
1300
  let batch_values = null;
794
- let queued_root_effects = [];
795
1301
  let last_scheduled_effect = null;
796
- let is_flushing = false;
797
1302
  let is_flushing_sync = false;
1303
+ let is_processing = false;
1304
+ let collected_effects = null;
1305
+ let legacy_updates = null;
1306
+ var flush_count = 0;
1307
+ let uid = 1;
798
1308
  class Batch {
1309
+ id = uid++;
1310
+ /** True as soon as `#process` was called */
1311
+ #started = false;
1312
+ linked = true;
1313
+ /** @type {Batch | null} */
1314
+ #prev = null;
1315
+ /** @type {Batch | null} */
1316
+ #next = null;
1317
+ /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
1318
+ async_deriveds = /* @__PURE__ */ new Map();
799
1319
  /**
800
- * The current values of any sources that are updated in this batch
1320
+ * The current values of any signals that are updated in this batch.
1321
+ * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
801
1322
  * They keys of this map are identical to `this.#previous`
802
- * @type {Map<Source, any>}
1323
+ * @type {Map<Value, [any, boolean]>}
803
1324
  */
804
1325
  current = /* @__PURE__ */ new Map();
805
1326
  /**
806
- * The values of any sources that are updated in this batch _before_ those updates took place.
1327
+ * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
807
1328
  * They keys of this map are identical to `this.#current`
808
- * @type {Map<Source, any>}
1329
+ * @type {Map<Value, any>}
809
1330
  */
810
1331
  previous = /* @__PURE__ */ new Map();
1332
+ /**
1333
+ * Async effects which this batch doesn't take into account anymore when calculating blockers,
1334
+ * as it has a value for it already.
1335
+ * @type {Set<Effect>}
1336
+ */
1337
+ unblocked = /* @__PURE__ */ new Set();
811
1338
  /**
812
1339
  * When the batch is committed (and the DOM is updated), we need to remove old branches
813
1340
  * and append new ones by calling the functions added inside (if/each/key/etc) blocks
814
- * @type {Set<() => void>}
1341
+ * @type {Set<(batch: Batch) => void>}
815
1342
  */
816
1343
  #commit_callbacks = /* @__PURE__ */ new Set();
817
1344
  /**
@@ -819,20 +1346,36 @@ class Batch {
819
1346
  * @type {Set<(batch: Batch) => void>}
820
1347
  */
821
1348
  #discard_callbacks = /* @__PURE__ */ new Set();
1349
+ /**
1350
+ * Callbacks that should run only when a fork is committed.
1351
+ * @type {Set<(batch: Batch) => void>}
1352
+ */
1353
+ #fork_commit_callbacks = /* @__PURE__ */ new Set();
822
1354
  /**
823
1355
  * The number of async effects that are currently in flight
824
1356
  */
825
1357
  #pending = 0;
826
1358
  /**
827
- * The number of async effects that are currently in flight, _not_ inside a pending boundary
1359
+ * Async effects that are currently in flight, _not_ inside a pending boundary
1360
+ * @type {Map<Effect, number>}
828
1361
  */
829
- #blocking_pending = 0;
1362
+ #blocking_pending = /* @__PURE__ */ new Map();
830
1363
  /**
831
1364
  * A deferred that resolves when the batch is committed, used with `settled()`
832
1365
  * TODO replace with Promise.withResolvers once supported widely enough
833
1366
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
834
1367
  */
835
1368
  #deferred = null;
1369
+ /**
1370
+ * The root effects that need to be flushed
1371
+ * @type {Effect[]}
1372
+ */
1373
+ #roots = [];
1374
+ /**
1375
+ * Effects created while this batch was active.
1376
+ * @type {Effect[]}
1377
+ */
1378
+ #new_effects = [];
836
1379
  /**
837
1380
  * Deferred effects (which run after async work has completed) that are DIRTY
838
1381
  * @type {Set<Effect>}
@@ -851,10 +1394,30 @@ class Batch {
851
1394
  * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
852
1395
  */
853
1396
  #skipped_branches = /* @__PURE__ */ new Map();
1397
+ /**
1398
+ * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing
1399
+ * @type {Set<Effect>}
1400
+ */
1401
+ #unskipped_branches = /* @__PURE__ */ new Set();
854
1402
  is_fork = false;
855
1403
  #decrement_queued = false;
856
1404
  #is_deferred() {
857
- return this.is_fork || this.#blocking_pending > 0;
1405
+ if (this.is_fork) return true;
1406
+ for (const effect of this.#blocking_pending.keys()) {
1407
+ var e = effect;
1408
+ var skipped = false;
1409
+ while (e.parent !== null) {
1410
+ if (this.#skipped_branches.has(e)) {
1411
+ skipped = true;
1412
+ break;
1413
+ }
1414
+ e = e.parent;
1415
+ }
1416
+ if (!skipped) {
1417
+ return true;
1418
+ }
1419
+ }
1420
+ return false;
858
1421
  }
859
1422
  /**
860
1423
  * Add an effect to the #skipped_branches map and reset its children
@@ -864,58 +1427,118 @@ class Batch {
864
1427
  if (!this.#skipped_branches.has(effect)) {
865
1428
  this.#skipped_branches.set(effect, { d: [], m: [] });
866
1429
  }
1430
+ this.#unskipped_branches.delete(effect);
867
1431
  }
868
1432
  /**
869
1433
  * Remove an effect from the #skipped_branches map and reschedule
870
1434
  * any tracked dirty/maybe_dirty child effects
871
1435
  * @param {Effect} effect
1436
+ * @param {(e: Effect) => void} callback
872
1437
  */
873
- unskip_effect(effect) {
1438
+ unskip_effect(effect, callback = (e) => this.schedule(e)) {
874
1439
  var tracked = this.#skipped_branches.get(effect);
875
1440
  if (tracked) {
876
1441
  this.#skipped_branches.delete(effect);
877
1442
  for (var e of tracked.d) {
878
1443
  set_signal_status(e, DIRTY);
879
- schedule_effect(e);
1444
+ callback(e);
880
1445
  }
881
1446
  for (e of tracked.m) {
882
1447
  set_signal_status(e, MAYBE_DIRTY);
883
- schedule_effect(e);
1448
+ callback(e);
884
1449
  }
885
1450
  }
1451
+ this.#unskipped_branches.add(effect);
886
1452
  }
887
- /**
888
- *
889
- * @param {Effect[]} root_effects
890
- */
891
- process(root_effects) {
892
- queued_root_effects = [];
1453
+ #process() {
1454
+ this.#started = true;
1455
+ if (flush_count++ > 1e3) {
1456
+ this.#unlink();
1457
+ infinite_loop_guard();
1458
+ }
1459
+ if (!this.#is_deferred()) {
1460
+ for (const e of this.#dirty_effects) {
1461
+ this.#maybe_dirty_effects.delete(e);
1462
+ set_signal_status(e, DIRTY);
1463
+ this.schedule(e);
1464
+ }
1465
+ for (const e of this.#maybe_dirty_effects) {
1466
+ set_signal_status(e, MAYBE_DIRTY);
1467
+ this.schedule(e);
1468
+ }
1469
+ }
1470
+ const roots = this.#roots;
1471
+ this.#roots = [];
893
1472
  this.apply();
894
- var effects = [];
1473
+ var effects = collected_effects = [];
895
1474
  var render_effects = [];
896
- for (const root2 of root_effects) {
897
- this.#traverse_effect_tree(root2, effects, render_effects);
1475
+ var updates = legacy_updates = [];
1476
+ for (const root2 of roots) {
1477
+ try {
1478
+ this.#traverse(root2, effects, render_effects);
1479
+ } catch (e) {
1480
+ reset_all(root2);
1481
+ throw e;
1482
+ }
1483
+ }
1484
+ current_batch = null;
1485
+ if (updates.length > 0) {
1486
+ var batch = Batch.ensure();
1487
+ for (const e of updates) {
1488
+ batch.schedule(e);
1489
+ }
898
1490
  }
1491
+ collected_effects = null;
1492
+ legacy_updates = null;
899
1493
  if (this.#is_deferred()) {
900
1494
  this.#defer_effects(render_effects);
901
1495
  this.#defer_effects(effects);
902
1496
  for (const [e, t] of this.#skipped_branches) {
903
1497
  reset_branch(e, t);
904
1498
  }
905
- } else {
906
- for (const fn of this.#commit_callbacks) fn();
907
- this.#commit_callbacks.clear();
908
- if (this.#pending === 0) {
909
- this.#commit();
1499
+ if (updates.length > 0) {
1500
+ /** @type {unknown} */
1501
+ current_batch.#process();
910
1502
  }
911
- current_batch = null;
912
- flush_queued_effects(render_effects);
913
- flush_queued_effects(effects);
914
- this.#dirty_effects.clear();
915
- this.#maybe_dirty_effects.clear();
916
- this.#deferred?.resolve();
1503
+ return;
1504
+ }
1505
+ const earlier_batch = this.#find_earlier_batch();
1506
+ if (earlier_batch) {
1507
+ earlier_batch.#merge(this);
1508
+ return;
1509
+ }
1510
+ this.#dirty_effects.clear();
1511
+ this.#maybe_dirty_effects.clear();
1512
+ for (const fn of this.#commit_callbacks) fn(this);
1513
+ this.#commit_callbacks.clear();
1514
+ previous_batch = this;
1515
+ flush_queued_effects(render_effects);
1516
+ flush_queued_effects(effects);
1517
+ previous_batch = null;
1518
+ this.#deferred?.resolve();
1519
+ var next_batch = (
1520
+ /** @type {Batch | null} */
1521
+ /** @type {unknown} */
1522
+ current_batch
1523
+ );
1524
+ if (this.linked && this.#pending === 0) {
1525
+ this.#unlink();
1526
+ }
1527
+ if (async_mode_flag && !this.linked) {
1528
+ this.#commit();
1529
+ current_batch = next_batch;
1530
+ }
1531
+ if (this.#roots.length > 0) {
1532
+ if (next_batch === null) {
1533
+ next_batch = this;
1534
+ this.#link();
1535
+ }
1536
+ const batch2 = next_batch;
1537
+ batch2.#roots.push(...this.#roots.filter((r2) => !batch2.#roots.includes(r2)));
1538
+ }
1539
+ if (next_batch !== null) {
1540
+ next_batch.#process();
917
1541
  }
918
- batch_values = null;
919
1542
  }
920
1543
  /**
921
1544
  * Traverse the effect tree, executing effects or stashing
@@ -924,7 +1547,7 @@ class Batch {
924
1547
  * @param {Effect[]} effects
925
1548
  * @param {Effect[]} render_effects
926
1549
  */
927
- #traverse_effect_tree(root2, effects, render_effects) {
1550
+ #traverse(root2, effects, render_effects) {
928
1551
  root2.f ^= CLEAN;
929
1552
  var effect = root2.first;
930
1553
  while (effect !== null) {
@@ -959,10 +1582,69 @@ class Batch {
959
1582
  }
960
1583
  }
961
1584
  }
962
- /**
963
- * @param {Effect[]} effects
964
- */
965
- #defer_effects(effects) {
1585
+ #find_earlier_batch() {
1586
+ var batch = this.#prev;
1587
+ while (batch !== null) {
1588
+ if (!batch.is_fork) {
1589
+ for (const [value, [, is_derived]] of this.current) {
1590
+ if (batch.current.has(value) && !is_derived) {
1591
+ return batch;
1592
+ }
1593
+ }
1594
+ }
1595
+ batch = batch.#prev;
1596
+ }
1597
+ return null;
1598
+ }
1599
+ /**
1600
+ * @param {Batch} batch
1601
+ */
1602
+ #merge(batch) {
1603
+ for (const [source2, value] of batch.current) {
1604
+ if (!this.previous.has(source2) && batch.previous.has(source2)) {
1605
+ this.previous.set(source2, batch.previous.get(source2));
1606
+ }
1607
+ this.current.set(source2, value);
1608
+ }
1609
+ for (const [effect, deferred2] of batch.async_deriveds) {
1610
+ const d = this.async_deriveds.get(effect);
1611
+ if (d) deferred2.promise.then(d.resolve);
1612
+ }
1613
+ const mark = (value) => {
1614
+ var reactions = value.reactions;
1615
+ if (reactions === null) return;
1616
+ for (const reaction of reactions) {
1617
+ var flags2 = reaction.f;
1618
+ if ((flags2 & DERIVED) !== 0) {
1619
+ mark(
1620
+ /** @type {Derived} */
1621
+ reaction
1622
+ );
1623
+ } else {
1624
+ var effect = (
1625
+ /** @type {Effect} */
1626
+ reaction
1627
+ );
1628
+ if (flags2 & (ASYNC | BLOCK_EFFECT) && !this.async_deriveds.has(effect)) {
1629
+ this.#maybe_dirty_effects.delete(effect);
1630
+ set_signal_status(effect, DIRTY);
1631
+ this.schedule(effect);
1632
+ }
1633
+ }
1634
+ }
1635
+ };
1636
+ for (const source2 of this.current.keys()) {
1637
+ mark(source2);
1638
+ }
1639
+ this.oncommit(() => batch.discard());
1640
+ batch.#unlink();
1641
+ current_batch = this;
1642
+ this.#process();
1643
+ }
1644
+ /**
1645
+ * @param {Effect[]} effects
1646
+ */
1647
+ #defer_effects(effects) {
966
1648
  for (var i = 0; i < effects.length; i += 1) {
967
1649
  defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
968
1650
  }
@@ -970,132 +1652,186 @@ class Batch {
970
1652
  /**
971
1653
  * Associate a change to a given source with the current
972
1654
  * batch, noting its previous and current values
973
- * @param {Source} source
1655
+ * @param {Value} source
974
1656
  * @param {any} value
1657
+ * @param {boolean} [is_derived]
975
1658
  */
976
- capture(source2, value) {
977
- if (value !== UNINITIALIZED && !this.previous.has(source2)) {
978
- this.previous.set(source2, value);
1659
+ capture(source2, value, is_derived = false) {
1660
+ if (source2.v !== UNINITIALIZED && !this.previous.has(source2)) {
1661
+ this.previous.set(source2, source2.v);
979
1662
  }
980
1663
  if ((source2.f & ERROR_VALUE) === 0) {
981
- this.current.set(source2, source2.v);
982
- batch_values?.set(source2, source2.v);
1664
+ this.current.set(source2, [value, is_derived]);
1665
+ batch_values?.set(source2, value);
1666
+ }
1667
+ if (!this.is_fork) {
1668
+ source2.v = value;
983
1669
  }
984
1670
  }
985
1671
  activate() {
986
1672
  current_batch = this;
987
- this.apply();
988
1673
  }
989
1674
  deactivate() {
990
- if (current_batch !== this) return;
991
1675
  current_batch = null;
992
1676
  batch_values = null;
993
1677
  }
994
1678
  flush() {
995
- this.activate();
996
- if (queued_root_effects.length > 0) {
997
- flush_effects();
998
- if (current_batch !== null && current_batch !== this) {
999
- return;
1000
- }
1001
- } else if (this.#pending === 0) {
1002
- this.process([]);
1679
+ try {
1680
+ if (DEV) ;
1681
+ is_processing = true;
1682
+ current_batch = this;
1683
+ this.#process();
1684
+ } finally {
1685
+ flush_count = 0;
1686
+ last_scheduled_effect = null;
1687
+ collected_effects = null;
1688
+ legacy_updates = null;
1689
+ is_processing = false;
1690
+ current_batch = null;
1691
+ batch_values = null;
1692
+ old_values.clear();
1003
1693
  }
1004
- this.deactivate();
1005
1694
  }
1006
1695
  discard() {
1007
1696
  for (const fn of this.#discard_callbacks) fn(this);
1008
1697
  this.#discard_callbacks.clear();
1698
+ this.#fork_commit_callbacks.clear();
1699
+ this.#unlink();
1700
+ }
1701
+ /**
1702
+ * @param {Effect} effect
1703
+ */
1704
+ register_created_effect(effect) {
1705
+ this.#new_effects.push(effect);
1009
1706
  }
1010
1707
  #commit() {
1011
- if (batches.size > 1) {
1012
- this.previous.clear();
1013
- var previous_batch_values = batch_values;
1014
- var is_earlier = true;
1015
- for (const batch of batches) {
1016
- if (batch === this) {
1017
- is_earlier = false;
1018
- continue;
1019
- }
1020
- const sources = [];
1021
- for (const [source2, value] of this.current) {
1022
- if (batch.current.has(source2)) {
1023
- if (is_earlier && value !== batch.current.get(source2)) {
1024
- batch.current.set(source2, value);
1025
- } else {
1026
- continue;
1027
- }
1708
+ this.#unlink();
1709
+ for (let batch = first_batch; batch !== null; batch = batch.#next) {
1710
+ var is_earlier = batch.id < this.id;
1711
+ var sources = [];
1712
+ for (const [source3, [value, is_derived]] of this.current) {
1713
+ if (batch.current.has(source3)) {
1714
+ var batch_value = (
1715
+ /** @type {[any, boolean]} */
1716
+ batch.current.get(source3)[0]
1717
+ );
1718
+ if (is_earlier && value !== batch_value) {
1719
+ batch.current.set(source3, [value, is_derived]);
1720
+ } else {
1721
+ continue;
1028
1722
  }
1029
- sources.push(source2);
1030
1723
  }
1031
- if (sources.length === 0) {
1032
- continue;
1724
+ sources.push(source3);
1725
+ }
1726
+ if (is_earlier) {
1727
+ for (const [effect, deferred2] of this.async_deriveds) {
1728
+ const d = batch.async_deriveds.get(effect);
1729
+ if (d) deferred2.promise.then(d.resolve);
1730
+ }
1731
+ }
1732
+ if (!batch.#started) continue;
1733
+ var others = [...batch.current.keys()].filter((s) => !this.current.has(s));
1734
+ if (others.length === 0) {
1735
+ if (is_earlier) {
1736
+ batch.discard();
1033
1737
  }
1034
- const others = [...batch.current.keys()].filter((s) => !this.current.has(s));
1035
- if (others.length > 0) {
1036
- var prev_queued_root_effects = queued_root_effects;
1037
- queued_root_effects = [];
1038
- const marked = /* @__PURE__ */ new Set();
1039
- const checked = /* @__PURE__ */ new Map();
1040
- for (const source2 of sources) {
1041
- mark_effects(source2, others, marked, checked);
1738
+ } else if (sources.length > 0) {
1739
+ if (is_earlier) {
1740
+ for (const unskipped of this.#unskipped_branches) {
1741
+ batch.unskip_effect(unskipped, (e) => {
1742
+ if ((e.f & (BLOCK_EFFECT | ASYNC)) !== 0) {
1743
+ batch.schedule(e);
1744
+ } else {
1745
+ batch.#defer_effects([e]);
1746
+ }
1747
+ });
1042
1748
  }
1043
- if (queued_root_effects.length > 0) {
1044
- current_batch = batch;
1045
- batch.apply();
1046
- for (const root2 of queued_root_effects) {
1047
- batch.#traverse_effect_tree(root2, [], []);
1749
+ }
1750
+ batch.activate();
1751
+ var marked = /* @__PURE__ */ new Set();
1752
+ var checked = /* @__PURE__ */ new Map();
1753
+ for (var source2 of sources) {
1754
+ mark_effects(source2, others, marked, checked);
1755
+ }
1756
+ checked = /* @__PURE__ */ new Map();
1757
+ var current_unequal = [...batch.current.keys()].filter(
1758
+ (c) => this.current.has(c) ? (
1759
+ /** @type {[any, boolean]} */
1760
+ this.current.get(c)[0] !== c.v
1761
+ ) : true
1762
+ );
1763
+ if (current_unequal.length > 0) {
1764
+ for (const effect of this.#new_effects) {
1765
+ if ((effect.f & (DESTROYED | INERT | EAGER_EFFECT)) === 0 && depends_on(effect, current_unequal, checked)) {
1766
+ if ((effect.f & (ASYNC | BLOCK_EFFECT)) !== 0) {
1767
+ set_signal_status(effect, DIRTY);
1768
+ batch.schedule(effect);
1769
+ } else {
1770
+ batch.#dirty_effects.add(effect);
1771
+ }
1048
1772
  }
1049
- batch.deactivate();
1050
1773
  }
1051
- queued_root_effects = prev_queued_root_effects;
1052
1774
  }
1775
+ if (batch.#roots.length > 0) {
1776
+ batch.apply();
1777
+ for (var root2 of batch.#roots) {
1778
+ batch.#traverse(root2, [], []);
1779
+ }
1780
+ batch.#roots = [];
1781
+ }
1782
+ batch.deactivate();
1053
1783
  }
1054
- current_batch = null;
1055
- batch_values = previous_batch_values;
1056
1784
  }
1057
- this.#skipped_branches.clear();
1058
- batches.delete(this);
1059
1785
  }
1060
1786
  /**
1061
- *
1062
1787
  * @param {boolean} blocking
1788
+ * @param {Effect} effect
1063
1789
  */
1064
- increment(blocking) {
1790
+ increment(blocking, effect) {
1065
1791
  this.#pending += 1;
1066
- if (blocking) this.#blocking_pending += 1;
1792
+ if (blocking) {
1793
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1794
+ this.#blocking_pending.set(effect, blocking_pending_count + 1);
1795
+ }
1067
1796
  }
1068
1797
  /**
1069
- *
1070
1798
  * @param {boolean} blocking
1799
+ * @param {Effect} effect
1071
1800
  */
1072
- decrement(blocking) {
1801
+ decrement(blocking, effect) {
1073
1802
  this.#pending -= 1;
1074
- if (blocking) this.#blocking_pending -= 1;
1803
+ if (blocking) {
1804
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1805
+ if (blocking_pending_count === 1) {
1806
+ this.#blocking_pending.delete(effect);
1807
+ } else {
1808
+ this.#blocking_pending.set(effect, blocking_pending_count - 1);
1809
+ }
1810
+ }
1075
1811
  if (this.#decrement_queued) return;
1076
1812
  this.#decrement_queued = true;
1077
1813
  queue_micro_task(() => {
1078
1814
  this.#decrement_queued = false;
1079
- if (!this.#is_deferred()) {
1080
- this.revive();
1081
- } else if (queued_root_effects.length > 0) {
1815
+ if (this.linked) {
1082
1816
  this.flush();
1083
1817
  }
1084
1818
  });
1085
1819
  }
1086
- revive() {
1087
- for (const e of this.#dirty_effects) {
1088
- this.#maybe_dirty_effects.delete(e);
1089
- set_signal_status(e, DIRTY);
1090
- schedule_effect(e);
1820
+ /**
1821
+ * @param {Set<Effect>} dirty_effects
1822
+ * @param {Set<Effect>} maybe_dirty_effects
1823
+ */
1824
+ transfer_effects(dirty_effects, maybe_dirty_effects) {
1825
+ for (const e of dirty_effects) {
1826
+ this.#dirty_effects.add(e);
1091
1827
  }
1092
- for (const e of this.#maybe_dirty_effects) {
1093
- set_signal_status(e, MAYBE_DIRTY);
1094
- schedule_effect(e);
1828
+ for (const e of maybe_dirty_effects) {
1829
+ this.#maybe_dirty_effects.add(e);
1095
1830
  }
1096
- this.flush();
1831
+ dirty_effects.clear();
1832
+ maybe_dirty_effects.clear();
1097
1833
  }
1098
- /** @param {() => void} fn */
1834
+ /** @param {(batch: Batch) => void} fn */
1099
1835
  oncommit(fn) {
1100
1836
  this.#commit_callbacks.add(fn);
1101
1837
  }
@@ -1103,35 +1839,113 @@ class Batch {
1103
1839
  ondiscard(fn) {
1104
1840
  this.#discard_callbacks.add(fn);
1105
1841
  }
1842
+ /** @param {(batch: Batch) => void} fn */
1843
+ on_fork_commit(fn) {
1844
+ this.#fork_commit_callbacks.add(fn);
1845
+ }
1846
+ run_fork_commit_callbacks() {
1847
+ for (const fn of this.#fork_commit_callbacks) fn(this);
1848
+ this.#fork_commit_callbacks.clear();
1849
+ }
1106
1850
  settled() {
1107
1851
  return (this.#deferred ??= deferred()).promise;
1108
1852
  }
1109
1853
  static ensure() {
1110
1854
  if (current_batch === null) {
1111
1855
  const batch = current_batch = new Batch();
1112
- batches.add(current_batch);
1113
- if (!is_flushing_sync) {
1856
+ batch.#link();
1857
+ if (!is_processing && !is_flushing_sync) {
1114
1858
  queue_micro_task(() => {
1115
- if (current_batch !== batch) {
1116
- return;
1859
+ if (!batch.#started) {
1860
+ batch.flush();
1117
1861
  }
1118
- batch.flush();
1119
1862
  });
1120
1863
  }
1121
1864
  }
1122
1865
  return current_batch;
1123
1866
  }
1124
1867
  apply() {
1125
- if (!async_mode_flag || !this.is_fork && batches.size === 1) return;
1126
- batch_values = new Map(this.current);
1127
- for (const batch of batches) {
1128
- if (batch === this) continue;
1129
- for (const [source2, previous] of batch.previous) {
1130
- if (!batch_values.has(source2)) {
1131
- batch_values.set(source2, previous);
1868
+ if (!async_mode_flag || !this.is_fork && this.#prev === null && this.#next === null) {
1869
+ batch_values = null;
1870
+ return;
1871
+ }
1872
+ batch_values = /* @__PURE__ */ new Map();
1873
+ for (const [source2, [value]] of this.current) {
1874
+ batch_values.set(source2, value);
1875
+ }
1876
+ for (let batch = first_batch; batch !== null; batch = batch.#next) {
1877
+ if (batch === this || batch.is_fork) continue;
1878
+ var intersects = false;
1879
+ if (batch.id < this.id) {
1880
+ for (const [source2, [, is_derived]] of batch.current) {
1881
+ if (is_derived) continue;
1882
+ if (this.current.has(source2)) {
1883
+ intersects = true;
1884
+ break;
1885
+ }
1886
+ }
1887
+ }
1888
+ if (!intersects) {
1889
+ for (const [source2, previous] of batch.previous) {
1890
+ if (!batch_values.has(source2)) {
1891
+ batch_values.set(source2, previous);
1892
+ }
1893
+ }
1894
+ }
1895
+ }
1896
+ }
1897
+ /**
1898
+ *
1899
+ * @param {Effect} effect
1900
+ */
1901
+ schedule(effect) {
1902
+ last_scheduled_effect = effect;
1903
+ if (effect.b?.is_pending && (effect.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 && (effect.f & REACTION_RAN) === 0) {
1904
+ effect.b.defer_effect(effect);
1905
+ return;
1906
+ }
1907
+ var e = effect;
1908
+ while (e.parent !== null) {
1909
+ e = e.parent;
1910
+ var flags2 = e.f;
1911
+ if (collected_effects !== null && e === active_effect) {
1912
+ if (async_mode_flag) return;
1913
+ if ((active_reaction === null || (active_reaction.f & DERIVED) === 0) && true) {
1914
+ return;
1915
+ }
1916
+ }
1917
+ if ((flags2 & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
1918
+ if ((flags2 & CLEAN) === 0) {
1919
+ return;
1132
1920
  }
1921
+ e.f ^= CLEAN;
1133
1922
  }
1134
1923
  }
1924
+ this.#roots.push(e);
1925
+ }
1926
+ #link() {
1927
+ if (last_batch === null) {
1928
+ first_batch = last_batch = this;
1929
+ } else {
1930
+ last_batch.#next = this;
1931
+ this.#prev = last_batch;
1932
+ }
1933
+ last_batch = this;
1934
+ }
1935
+ #unlink() {
1936
+ var prev = this.#prev;
1937
+ var next2 = this.#next;
1938
+ if (prev === null) {
1939
+ first_batch = next2;
1940
+ } else {
1941
+ prev.#next = next2;
1942
+ }
1943
+ if (next2 === null) {
1944
+ last_batch = prev;
1945
+ } else {
1946
+ next2.#prev = prev;
1947
+ }
1948
+ this.linked = false;
1135
1949
  }
1136
1950
  }
1137
1951
  function flushSync(fn) {
@@ -1142,43 +1956,18 @@ function flushSync(fn) {
1142
1956
  if (fn) ;
1143
1957
  while (true) {
1144
1958
  flush_tasks();
1145
- if (queued_root_effects.length === 0) {
1146
- current_batch?.flush();
1147
- if (queued_root_effects.length === 0) {
1148
- last_scheduled_effect = null;
1149
- return (
1150
- /** @type {T} */
1151
- result
1152
- );
1153
- }
1959
+ if (current_batch === null) {
1960
+ return (
1961
+ /** @type {T} */
1962
+ result
1963
+ );
1154
1964
  }
1155
- flush_effects();
1965
+ current_batch.flush();
1156
1966
  }
1157
1967
  } finally {
1158
1968
  is_flushing_sync = was_flushing_sync;
1159
1969
  }
1160
1970
  }
1161
- function flush_effects() {
1162
- is_flushing = true;
1163
- try {
1164
- var flush_count = 0;
1165
- while (queued_root_effects.length > 0) {
1166
- var batch = Batch.ensure();
1167
- if (flush_count++ > 1e3) {
1168
- var updates, entry;
1169
- if (DEV) ;
1170
- infinite_loop_guard();
1171
- }
1172
- batch.process(queued_root_effects);
1173
- old_values.clear();
1174
- if (DEV) ;
1175
- }
1176
- } finally {
1177
- queued_root_effects = [];
1178
- is_flushing = false;
1179
- last_scheduled_effect = null;
1180
- }
1181
- }
1182
1971
  function infinite_loop_guard() {
1183
1972
  try {
1184
1973
  effect_update_depth_exceeded();
@@ -1274,27 +2063,8 @@ function depends_on(reaction, sources, checked) {
1274
2063
  checked.set(reaction, false);
1275
2064
  return false;
1276
2065
  }
1277
- function schedule_effect(signal) {
1278
- var effect = last_scheduled_effect = signal;
1279
- var boundary2 = effect.b;
1280
- if (boundary2?.is_pending && (signal.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 && (signal.f & REACTION_RAN) === 0) {
1281
- boundary2.defer_effect(signal);
1282
- return;
1283
- }
1284
- while (effect.parent !== null) {
1285
- effect = effect.parent;
1286
- var flags2 = effect.f;
1287
- if (is_flushing && effect === active_effect && (flags2 & BLOCK_EFFECT) !== 0 && (flags2 & HEAD_EFFECT) === 0 && (flags2 & REACTION_RAN) !== 0) {
1288
- return;
1289
- }
1290
- if ((flags2 & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
1291
- if ((flags2 & CLEAN) === 0) {
1292
- return;
1293
- }
1294
- effect.f ^= CLEAN;
1295
- }
1296
- }
1297
- queued_root_effects.push(effect);
2066
+ function schedule_effect(effect) {
2067
+ current_batch.schedule(effect);
1298
2068
  }
1299
2069
  function reset_branch(effect, tracked) {
1300
2070
  if ((effect.f & BRANCH_EFFECT) !== 0 && (effect.f & CLEAN) !== 0) {
@@ -1312,6 +2082,14 @@ function reset_branch(effect, tracked) {
1312
2082
  e = e.next;
1313
2083
  }
1314
2084
  }
2085
+ function reset_all(effect) {
2086
+ set_signal_status(effect, CLEAN);
2087
+ var e = effect.first;
2088
+ while (e !== null) {
2089
+ reset_all(e);
2090
+ e = e.next;
2091
+ }
2092
+ }
1315
2093
  function createSubscriber(start) {
1316
2094
  let subscribers = 0;
1317
2095
  let version = source(0);
@@ -1469,7 +2247,6 @@ class Boundary {
1469
2247
  var anchor = create_text();
1470
2248
  fragment.append(anchor);
1471
2249
  this.#main_effect = this.#run(() => {
1472
- Batch.ensure();
1473
2250
  return branch(() => this.#children(anchor));
1474
2251
  });
1475
2252
  if (this.#pending_count === 0) {
@@ -1482,7 +2259,10 @@ class Boundary {
1482
2259
  this.#pending_effect = null;
1483
2260
  }
1484
2261
  );
1485
- this.#resolve();
2262
+ this.#resolve(
2263
+ /** @type {Batch} */
2264
+ current_batch
2265
+ );
1486
2266
  }
1487
2267
  });
1488
2268
  }
@@ -1503,24 +2283,21 @@ class Boundary {
1503
2283
  );
1504
2284
  this.#pending_effect = branch(() => pending(this.#anchor));
1505
2285
  } else {
1506
- this.#resolve();
2286
+ this.#resolve(
2287
+ /** @type {Batch} */
2288
+ current_batch
2289
+ );
1507
2290
  }
1508
2291
  } catch (error) {
1509
2292
  this.error(error);
1510
2293
  }
1511
2294
  }
1512
- #resolve() {
2295
+ /**
2296
+ * @param {Batch} batch
2297
+ */
2298
+ #resolve(batch) {
1513
2299
  this.is_pending = false;
1514
- for (const e of this.#dirty_effects) {
1515
- set_signal_status(e, DIRTY);
1516
- schedule_effect(e);
1517
- }
1518
- for (const e of this.#maybe_dirty_effects) {
1519
- set_signal_status(e, MAYBE_DIRTY);
1520
- schedule_effect(e);
1521
- }
1522
- this.#dirty_effects.clear();
1523
- this.#maybe_dirty_effects.clear();
2300
+ batch.transfer_effects(this.#dirty_effects, this.#maybe_dirty_effects);
1524
2301
  }
1525
2302
  /**
1526
2303
  * Defer an effect inside a pending boundary until the boundary resolves
@@ -1551,6 +2328,7 @@ class Boundary {
1551
2328
  set_active_reaction(this.#effect);
1552
2329
  set_component_context(this.#effect.ctx);
1553
2330
  try {
2331
+ Batch.ensure();
1554
2332
  return fn();
1555
2333
  } catch (e) {
1556
2334
  handle_error(e);
@@ -1565,17 +2343,18 @@ class Boundary {
1565
2343
  * Updates the pending count associated with the currently visible pending snippet,
1566
2344
  * if any, such that we can replace the snippet with content once work is done
1567
2345
  * @param {1 | -1} d
2346
+ * @param {Batch} batch
1568
2347
  */
1569
- #update_pending_count(d) {
2348
+ #update_pending_count(d, batch) {
1570
2349
  if (!this.has_pending_snippet()) {
1571
2350
  if (this.parent) {
1572
- this.parent.#update_pending_count(d);
2351
+ this.parent.#update_pending_count(d, batch);
1573
2352
  }
1574
2353
  return;
1575
2354
  }
1576
2355
  this.#pending_count += d;
1577
2356
  if (this.#pending_count === 0) {
1578
- this.#resolve();
2357
+ this.#resolve(batch);
1579
2358
  if (this.#pending_effect) {
1580
2359
  pause_effect(this.#pending_effect, () => {
1581
2360
  this.#pending_effect = null;
@@ -1592,9 +2371,10 @@ class Boundary {
1592
2371
  * and controls when the current `pending` snippet (if any) is removed.
1593
2372
  * Do not call from inside the class
1594
2373
  * @param {1 | -1} d
2374
+ * @param {Batch} batch
1595
2375
  */
1596
- update_pending_count(d) {
1597
- this.#update_pending_count(d);
2376
+ update_pending_count(d, batch) {
2377
+ this.#update_pending_count(d, batch);
1598
2378
  this.#local_pending_count += d;
1599
2379
  if (!this.#effect_pending || this.#pending_count_update_queued) return;
1600
2380
  this.#pending_count_update_queued = true;
@@ -1614,11 +2394,24 @@ class Boundary {
1614
2394
  }
1615
2395
  /** @param {unknown} error */
1616
2396
  error(error) {
1617
- var onerror = this.#props.onerror;
1618
- let failed = this.#props.failed;
1619
- if (!onerror && !failed) {
2397
+ if (!this.#props.onerror && !this.#props.failed) {
1620
2398
  throw error;
1621
2399
  }
2400
+ if (current_batch?.is_fork) {
2401
+ if (this.#main_effect) current_batch.skip_effect(this.#main_effect);
2402
+ if (this.#pending_effect) current_batch.skip_effect(this.#pending_effect);
2403
+ if (this.#failed_effect) current_batch.skip_effect(this.#failed_effect);
2404
+ current_batch.on_fork_commit(() => {
2405
+ this.#handle_error(error);
2406
+ });
2407
+ } else {
2408
+ this.#handle_error(error);
2409
+ }
2410
+ }
2411
+ /**
2412
+ * @param {unknown} error
2413
+ */
2414
+ #handle_error(error) {
1622
2415
  if (this.#main_effect) {
1623
2416
  destroy_effect(this.#main_effect);
1624
2417
  this.#main_effect = null;
@@ -1639,6 +2432,8 @@ class Boundary {
1639
2432
  next();
1640
2433
  set_hydrate_node(skip_nodes());
1641
2434
  }
2435
+ var onerror = this.#props.onerror;
2436
+ let failed = this.#props.failed;
1642
2437
  var did_reset = false;
1643
2438
  var calling_on_error = false;
1644
2439
  const reset = () => {
@@ -1656,7 +2451,6 @@ class Boundary {
1656
2451
  });
1657
2452
  }
1658
2453
  this.#run(() => {
1659
- Batch.ensure();
1660
2454
  this.#render();
1661
2455
  });
1662
2456
  };
@@ -1670,7 +2464,6 @@ class Boundary {
1670
2464
  }
1671
2465
  if (failed) {
1672
2466
  this.#failed_effect = this.#run(() => {
1673
- Batch.ensure();
1674
2467
  try {
1675
2468
  return branch(() => {
1676
2469
  var effect = (
@@ -1729,23 +2522,15 @@ function destroy_derived_effects(derived2) {
1729
2522
  }
1730
2523
  }
1731
2524
  }
1732
- function get_derived_parent_effect(derived2) {
1733
- var parent = derived2.parent;
1734
- while (parent !== null) {
1735
- if ((parent.f & DERIVED) === 0) {
1736
- return (parent.f & DESTROYED) === 0 ? (
1737
- /** @type {Effect} */
1738
- parent
1739
- ) : null;
1740
- }
1741
- parent = parent.parent;
1742
- }
1743
- return null;
1744
- }
1745
2525
  function execute_derived(derived2) {
1746
2526
  var value;
1747
2527
  var prev_active_effect = active_effect;
1748
- set_active_effect(get_derived_parent_effect(derived2));
2528
+ var parent = derived2.parent;
2529
+ if (!is_destroying_effect && parent !== null && (parent.f & (DESTROYED | INERT)) !== 0) {
2530
+ derived_inert();
2531
+ return derived2.v;
2532
+ }
2533
+ set_active_effect(parent);
1749
2534
  {
1750
2535
  try {
1751
2536
  derived2.f &= ~WAS_MARKED;
@@ -1762,7 +2547,12 @@ function update_derived(derived2) {
1762
2547
  if (!derived2.equals(value)) {
1763
2548
  derived2.wv = increment_write_version();
1764
2549
  if (!current_batch?.is_fork || derived2.deps === null) {
1765
- derived2.v = value;
2550
+ if (current_batch !== null) {
2551
+ current_batch.capture(derived2, value, true);
2552
+ previous_batch?.capture(derived2, value, true);
2553
+ } else {
2554
+ derived2.v = value;
2555
+ }
1766
2556
  if (derived2.deps === null) {
1767
2557
  set_signal_status(derived2, CLEAN);
1768
2558
  return;
@@ -1837,19 +2627,13 @@ function set(source2, value, should_proxy = false) {
1837
2627
  state_unsafe_mutation();
1838
2628
  }
1839
2629
  let new_value = should_proxy ? proxy(value) : value;
1840
- return internal_set(source2, new_value);
2630
+ return internal_set(source2, new_value, legacy_updates);
1841
2631
  }
1842
- function internal_set(source2, value) {
2632
+ function internal_set(source2, value, updated_during_traversal = null) {
1843
2633
  if (!source2.equals(value)) {
1844
- var old_value = source2.v;
1845
- if (is_destroying_effect) {
1846
- old_values.set(source2, value);
1847
- } else {
1848
- old_values.set(source2, old_value);
1849
- }
1850
- source2.v = value;
2634
+ old_values.set(source2, is_destroying_effect ? value : source2.v);
1851
2635
  var batch = Batch.ensure();
1852
- batch.capture(source2, old_value);
2636
+ batch.capture(source2, value);
1853
2637
  if ((source2.f & DERIVED) !== 0) {
1854
2638
  const derived2 = (
1855
2639
  /** @type {Derived} */
@@ -1858,10 +2642,12 @@ function internal_set(source2, value) {
1858
2642
  if ((source2.f & DIRTY) !== 0) {
1859
2643
  execute_derived(derived2);
1860
2644
  }
1861
- update_derived_status(derived2);
2645
+ if (batch_values === null) {
2646
+ update_derived_status(derived2);
2647
+ }
1862
2648
  }
1863
2649
  source2.wv = increment_write_version();
1864
- mark_reactions(source2, DIRTY);
2650
+ mark_reactions(source2, DIRTY, updated_during_traversal);
1865
2651
  if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
1866
2652
  if (untracked_writes === null) {
1867
2653
  set_untracked_writes([source2]);
@@ -1881,7 +2667,13 @@ function flush_eager_effects() {
1881
2667
  if ((effect.f & CLEAN) !== 0) {
1882
2668
  set_signal_status(effect, MAYBE_DIRTY);
1883
2669
  }
1884
- if (is_dirty(effect)) {
2670
+ let dirty;
2671
+ try {
2672
+ dirty = is_dirty(effect);
2673
+ } catch {
2674
+ dirty = true;
2675
+ }
2676
+ if (dirty) {
1885
2677
  update_effect(effect);
1886
2678
  }
1887
2679
  }
@@ -1890,7 +2682,7 @@ function flush_eager_effects() {
1890
2682
  function increment(source2) {
1891
2683
  set(source2, source2.v + 1);
1892
2684
  }
1893
- function mark_reactions(signal, status) {
2685
+ function mark_reactions(signal, status, updated_during_traversal) {
1894
2686
  var reactions = signal.reactions;
1895
2687
  if (reactions === null) return;
1896
2688
  var length = reactions.length;
@@ -1901,29 +2693,36 @@ function mark_reactions(signal, status) {
1901
2693
  if (not_dirty) {
1902
2694
  set_signal_status(reaction, status);
1903
2695
  }
1904
- if ((flags2 & DERIVED) !== 0) {
2696
+ if ((flags2 & EAGER_EFFECT) !== 0) {
2697
+ eager_effects.add(
2698
+ /** @type {Effect} */
2699
+ reaction
2700
+ );
2701
+ } else if ((flags2 & DERIVED) !== 0) {
1905
2702
  var derived2 = (
1906
2703
  /** @type {Derived} */
1907
2704
  reaction
1908
2705
  );
1909
2706
  batch_values?.delete(derived2);
1910
2707
  if ((flags2 & WAS_MARKED) === 0) {
1911
- if (flags2 & CONNECTED) {
2708
+ if (flags2 & CONNECTED && (active_effect === null || (active_effect.f & REACTION_IS_UPDATING) === 0)) {
1912
2709
  reaction.f |= WAS_MARKED;
1913
2710
  }
1914
- mark_reactions(derived2, MAYBE_DIRTY);
2711
+ mark_reactions(derived2, MAYBE_DIRTY, updated_during_traversal);
1915
2712
  }
1916
2713
  } else if (not_dirty) {
1917
- if ((flags2 & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
1918
- eager_block_effects.add(
1919
- /** @type {Effect} */
1920
- reaction
1921
- );
1922
- }
1923
- schedule_effect(
2714
+ var effect = (
1924
2715
  /** @type {Effect} */
1925
2716
  reaction
1926
2717
  );
2718
+ if ((flags2 & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
2719
+ eager_block_effects.add(effect);
2720
+ }
2721
+ if (updated_during_traversal !== null) {
2722
+ updated_during_traversal.push(effect);
2723
+ } else {
2724
+ schedule_effect(effect);
2725
+ }
1927
2726
  }
1928
2727
  }
1929
2728
  }
@@ -2131,14 +2930,13 @@ function init_operations() {
2131
2930
  first_child_getter = get_descriptor(node_prototype, "firstChild").get;
2132
2931
  next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
2133
2932
  if (is_extensible(element_prototype)) {
2134
- element_prototype.__click = void 0;
2135
- element_prototype.__className = void 0;
2136
- element_prototype.__attributes = null;
2137
- element_prototype.__style = void 0;
2933
+ element_prototype[CLASS_CACHE] = void 0;
2934
+ element_prototype[ATTRIBUTES_CACHE] = null;
2935
+ element_prototype[STYLE_CACHE] = void 0;
2138
2936
  element_prototype.__e = void 0;
2139
2937
  }
2140
2938
  if (is_extensible(text_prototype)) {
2141
- text_prototype.__t = void 0;
2939
+ text_prototype[TEXT_CACHE] = void 0;
2142
2940
  }
2143
2941
  }
2144
2942
  function create_text(value = "") {
@@ -2183,7 +2981,7 @@ function push_effect(effect, parent_effect) {
2183
2981
  parent_effect.last = effect;
2184
2982
  }
2185
2983
  }
2186
- function create_effect(type, fn, sync) {
2984
+ function create_effect(type, fn) {
2187
2985
  var parent = active_effect;
2188
2986
  if (parent !== null && (parent.f & INERT) !== 0) {
2189
2987
  type |= INERT;
@@ -2204,22 +3002,27 @@ function create_effect(type, fn, sync) {
2204
3002
  wv: 0,
2205
3003
  ac: null
2206
3004
  };
2207
- if (sync) {
3005
+ current_batch?.register_created_effect(effect);
3006
+ var e = effect;
3007
+ if ((type & EFFECT) !== 0) {
3008
+ if (collected_effects !== null) {
3009
+ collected_effects.push(effect);
3010
+ } else {
3011
+ Batch.ensure().schedule(effect);
3012
+ }
3013
+ } else if (fn !== null) {
2208
3014
  try {
2209
3015
  update_effect(effect);
2210
3016
  } catch (e2) {
2211
3017
  destroy_effect(effect);
2212
3018
  throw e2;
2213
3019
  }
2214
- } else if (fn !== null) {
2215
- schedule_effect(effect);
2216
- }
2217
- var e = effect;
2218
- if (sync && e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && // either `null`, or a singular child
2219
- (e.f & EFFECT_PRESERVED) === 0) {
2220
- e = e.first;
2221
- if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
2222
- e.f |= EFFECT_TRANSPARENT;
3020
+ if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && // either `null`, or a singular child
3021
+ (e.f & EFFECT_PRESERVED) === 0) {
3022
+ e = e.first;
3023
+ if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
3024
+ e.f |= EFFECT_TRANSPARENT;
3025
+ }
2223
3026
  }
2224
3027
  }
2225
3028
  if (e !== null) {
@@ -2241,11 +3044,11 @@ function effect_tracking() {
2241
3044
  return active_reaction !== null && !untracking;
2242
3045
  }
2243
3046
  function create_user_effect(fn) {
2244
- return create_effect(EFFECT | USER_EFFECT, fn, false);
3047
+ return create_effect(EFFECT | USER_EFFECT, fn);
2245
3048
  }
2246
3049
  function component_root(fn) {
2247
3050
  Batch.ensure();
2248
- const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);
3051
+ const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);
2249
3052
  return (options = {}) => {
2250
3053
  return new Promise((fulfil) => {
2251
3054
  if (options.outro) {
@@ -2261,14 +3064,14 @@ function component_root(fn) {
2261
3064
  };
2262
3065
  }
2263
3066
  function render_effect(fn, flags2 = 0) {
2264
- return create_effect(RENDER_EFFECT | flags2, fn, true);
3067
+ return create_effect(RENDER_EFFECT | flags2, fn);
2265
3068
  }
2266
3069
  function block(fn, flags2 = 0) {
2267
- var effect = create_effect(BLOCK_EFFECT | flags2, fn, true);
3070
+ var effect = create_effect(BLOCK_EFFECT | flags2, fn);
2268
3071
  return effect;
2269
3072
  }
2270
3073
  function branch(fn) {
2271
- return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);
3074
+ return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn);
2272
3075
  }
2273
3076
  function execute_effect_teardown(effect) {
2274
3077
  var teardown = effect.teardown;
@@ -2324,9 +3127,9 @@ function destroy_effect(effect, remove_dom = true) {
2324
3127
  );
2325
3128
  removed = true;
2326
3129
  }
3130
+ set_signal_status(effect, DESTROYING);
2327
3131
  destroy_effect_children(effect, remove_dom && !removed);
2328
3132
  remove_reactions(effect, 0);
2329
- set_signal_status(effect, DESTROYED);
2330
3133
  var transitions = effect.nodes && effect.nodes.t;
2331
3134
  if (transitions !== null) {
2332
3135
  for (const transition of transitions) {
@@ -2334,11 +3137,13 @@ function destroy_effect(effect, remove_dom = true) {
2334
3137
  }
2335
3138
  }
2336
3139
  execute_effect_teardown(effect);
3140
+ effect.f ^= DESTROYING;
3141
+ effect.f |= DESTROYED;
2337
3142
  var parent = effect.parent;
2338
3143
  if (parent !== null && parent.first !== null) {
2339
3144
  unlink_effect(effect);
2340
3145
  }
2341
- effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = null;
3146
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
2342
3147
  }
2343
3148
  function remove_effect_dom(node, end) {
2344
3149
  while (node !== null) {
@@ -2389,11 +3194,13 @@ function pause_children(effect, transitions, local) {
2389
3194
  var child = effect.first;
2390
3195
  while (child !== null) {
2391
3196
  var sibling = child.next;
2392
- var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || // If this is a branch effect without a block effect parent,
2393
- // it means the parent block effect was pruned. In that case,
2394
- // transparency information was transferred to the branch effect.
2395
- (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
2396
- pause_children(child, transitions, transparent ? local : false);
3197
+ if ((child.f & ROOT_EFFECT) === 0) {
3198
+ var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || // If this is a branch effect without a block effect parent,
3199
+ // it means the parent block effect was pruned. In that case,
3200
+ // transparency information was transferred to the branch effect.
3201
+ (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
3202
+ pause_children(child, transitions, transparent ? local : false);
3203
+ }
2397
3204
  child = sibling;
2398
3205
  }
2399
3206
  }
@@ -2643,7 +3450,9 @@ function remove_reaction(signal, dependency) {
2643
3450
  derived2.f ^= CONNECTED;
2644
3451
  derived2.f &= ~WAS_MARKED;
2645
3452
  }
2646
- update_derived_status(derived2);
3453
+ if (derived2.v !== UNINITIALIZED) {
3454
+ update_derived_status(derived2);
3455
+ }
2647
3456
  freeze_derived_effects(derived2);
2648
3457
  remove_reactions(derived2, 0);
2649
3458
  }
@@ -2827,664 +3636,117 @@ const PASSIVE_EVENTS = ["touchstart", "touchmove"];
2827
3636
  function is_passive_event(name) {
2828
3637
  return PASSIVE_EVENTS.includes(name);
2829
3638
  }
2830
- const event_symbol = /* @__PURE__ */ Symbol("events");
2831
- const all_registered_events = /* @__PURE__ */ new Set();
2832
- const root_event_handles = /* @__PURE__ */ new Set();
2833
- let last_propagated_event = null;
2834
- function handle_event_propagation(event) {
2835
- var handler_element = this;
2836
- var owner_document = (
2837
- /** @type {Node} */
2838
- handler_element.ownerDocument
2839
- );
2840
- var event_name = event.type;
2841
- var path = event.composedPath?.() || [];
2842
- var current_target = (
2843
- /** @type {null | Element} */
2844
- path[0] || event.target
2845
- );
2846
- last_propagated_event = event;
2847
- var path_idx = 0;
2848
- var handled_at = last_propagated_event === event && event[event_symbol];
2849
- if (handled_at) {
2850
- var at_idx = path.indexOf(handled_at);
2851
- if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
2852
- window)) {
2853
- event[event_symbol] = handler_element;
2854
- return;
2855
- }
2856
- var handler_idx = path.indexOf(handler_element);
2857
- if (handler_idx === -1) {
2858
- return;
2859
- }
2860
- if (at_idx <= handler_idx) {
2861
- path_idx = at_idx;
2862
- }
3639
+ const INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
3640
+ function render(component, options = {}) {
3641
+ if (options.csp?.hash && options.csp.nonce) {
3642
+ invalid_csp();
2863
3643
  }
2864
- current_target = /** @type {Element} */
2865
- path[path_idx] || event.target;
2866
- if (current_target === handler_element) return;
2867
- define_property(event, "currentTarget", {
2868
- configurable: true,
2869
- get() {
2870
- return current_target || owner_document;
2871
- }
3644
+ return Renderer.render(
3645
+ /** @type {Component<Props>} */
3646
+ component,
3647
+ options
3648
+ );
3649
+ }
3650
+ function head(hash, renderer, fn) {
3651
+ renderer.head((renderer2) => {
3652
+ renderer2.push(`<!--${hash}-->`);
3653
+ renderer2.child(fn);
3654
+ renderer2.push(EMPTY_COMMENT);
2872
3655
  });
2873
- var previous_reaction = active_reaction;
2874
- var previous_effect = active_effect;
2875
- set_active_reaction(null);
2876
- set_active_effect(null);
2877
- try {
2878
- var throw_error;
2879
- var other_errors = [];
2880
- while (current_target !== null) {
2881
- var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
2882
- current_target.host || null;
2883
- try {
2884
- var delegated = current_target[event_symbol]?.[event_name];
2885
- if (delegated != null && (!/** @type {any} */
2886
- current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
2887
- // -> the target could not have been disabled because it emits the event in the first place
2888
- event.target === current_target)) {
2889
- delegated.call(current_target, event);
2890
- }
2891
- } catch (error) {
2892
- if (throw_error) {
2893
- other_errors.push(error);
2894
- } else {
2895
- throw_error = error;
2896
- }
2897
- }
2898
- if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
2899
- break;
2900
- }
2901
- current_target = parent_element;
2902
- }
2903
- if (throw_error) {
2904
- for (let error of other_errors) {
2905
- queueMicrotask(() => {
2906
- throw error;
2907
- });
2908
- }
2909
- throw throw_error;
2910
- }
2911
- } finally {
2912
- event[event_symbol] = handler_element;
2913
- delete event.currentTarget;
2914
- set_active_reaction(previous_reaction);
2915
- set_active_effect(previous_effect);
2916
- }
2917
- }
2918
- function assign_nodes(start, end) {
2919
- var effect = (
2920
- /** @type {Effect} */
2921
- active_effect
2922
- );
2923
- if (effect.nodes === null) {
2924
- effect.nodes = { start, end, a: null, t: null };
2925
- }
2926
- }
2927
- function mount(component, options) {
2928
- return _mount(component, options);
2929
- }
2930
- function hydrate(component, options) {
2931
- init_operations();
2932
- options.intro = options.intro ?? false;
2933
- const target = options.target;
2934
- const was_hydrating = hydrating;
2935
- const previous_hydrate_node = hydrate_node;
2936
- try {
2937
- var anchor = /* @__PURE__ */ get_first_child(target);
2938
- while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
2939
- anchor.data !== HYDRATION_START)) {
2940
- anchor = /* @__PURE__ */ get_next_sibling(anchor);
2941
- }
2942
- if (!anchor) {
2943
- throw HYDRATION_ERROR;
2944
- }
2945
- set_hydrating(true);
2946
- set_hydrate_node(
2947
- /** @type {Comment} */
2948
- anchor
2949
- );
2950
- const instance = _mount(component, { ...options, anchor });
2951
- set_hydrating(false);
2952
- return (
2953
- /** @type {Exports} */
2954
- instance
2955
- );
2956
- } catch (error) {
2957
- if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
2958
- throw error;
2959
- }
2960
- if (error !== HYDRATION_ERROR) {
2961
- console.warn("Failed to hydrate: ", error);
2962
- }
2963
- if (options.recover === false) {
2964
- hydration_failed();
2965
- }
2966
- init_operations();
2967
- clear_text_content(target);
2968
- set_hydrating(false);
2969
- return mount(component, options);
2970
- } finally {
2971
- set_hydrating(was_hydrating);
2972
- set_hydrate_node(previous_hydrate_node);
2973
- }
2974
- }
2975
- const listeners = /* @__PURE__ */ new Map();
2976
- function _mount(Component, { target, anchor, props = {}, events, context: context2, intro = true, transformError }) {
2977
- init_operations();
2978
- var component = void 0;
2979
- var unmount2 = component_root(() => {
2980
- var anchor_node = anchor ?? target.appendChild(create_text());
2981
- boundary(
2982
- /** @type {TemplateNode} */
2983
- anchor_node,
2984
- {
2985
- pending: () => {
2986
- }
2987
- },
2988
- (anchor_node2) => {
2989
- push$1({});
2990
- var ctx = (
2991
- /** @type {ComponentContext} */
2992
- component_context
2993
- );
2994
- if (context2) ctx.c = context2;
2995
- if (events) {
2996
- props.$$events = events;
2997
- }
2998
- if (hydrating) {
2999
- assign_nodes(
3000
- /** @type {TemplateNode} */
3001
- anchor_node2,
3002
- null
3003
- );
3004
- }
3005
- component = Component(anchor_node2, props) || {};
3006
- if (hydrating) {
3007
- active_effect.nodes.end = hydrate_node;
3008
- if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
3009
- hydrate_node.data !== HYDRATION_END) {
3010
- hydration_mismatch();
3011
- throw HYDRATION_ERROR;
3012
- }
3013
- }
3014
- pop$1();
3015
- },
3016
- transformError
3017
- );
3018
- var registered_events = /* @__PURE__ */ new Set();
3019
- var event_handle = (events2) => {
3020
- for (var i = 0; i < events2.length; i++) {
3021
- var event_name = events2[i];
3022
- if (registered_events.has(event_name)) continue;
3023
- registered_events.add(event_name);
3024
- var passive = is_passive_event(event_name);
3025
- for (const node of [target, document]) {
3026
- var counts = listeners.get(node);
3027
- if (counts === void 0) {
3028
- counts = /* @__PURE__ */ new Map();
3029
- listeners.set(node, counts);
3030
- }
3031
- var count = counts.get(event_name);
3032
- if (count === void 0) {
3033
- node.addEventListener(event_name, handle_event_propagation, { passive });
3034
- counts.set(event_name, 1);
3035
- } else {
3036
- counts.set(event_name, count + 1);
3037
- }
3038
- }
3039
- }
3040
- };
3041
- event_handle(array_from(all_registered_events));
3042
- root_event_handles.add(event_handle);
3043
- return () => {
3044
- for (var event_name of registered_events) {
3045
- for (const node of [target, document]) {
3046
- var counts = (
3047
- /** @type {Map<string, number>} */
3048
- listeners.get(node)
3049
- );
3050
- var count = (
3051
- /** @type {number} */
3052
- counts.get(event_name)
3053
- );
3054
- if (--count == 0) {
3055
- node.removeEventListener(event_name, handle_event_propagation);
3056
- counts.delete(event_name);
3057
- if (counts.size === 0) {
3058
- listeners.delete(node);
3059
- }
3060
- } else {
3061
- counts.set(event_name, count);
3062
- }
3063
- }
3064
- }
3065
- root_event_handles.delete(event_handle);
3066
- if (anchor_node !== anchor) {
3067
- anchor_node.parentNode?.removeChild(anchor_node);
3068
- }
3069
- };
3070
- });
3071
- mounted_components.set(component, unmount2);
3072
- return component;
3073
- }
3074
- let mounted_components = /* @__PURE__ */ new WeakMap();
3075
- function unmount(component, options) {
3076
- const fn = mounted_components.get(component);
3077
- if (fn) {
3078
- mounted_components.delete(component);
3079
- return fn(options);
3080
- }
3081
- return Promise.resolve();
3082
- }
3083
- const ATTR_REGEX = /[&"<]/g;
3084
- const CONTENT_REGEX = /[&<]/g;
3085
- function escape_html(value, is_attr) {
3086
- const str = String(value ?? "");
3087
- const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
3088
- pattern.lastIndex = 0;
3089
- let escaped2 = "";
3090
- let last = 0;
3091
- while (pattern.test(str)) {
3092
- const i = pattern.lastIndex - 1;
3093
- const ch = str[i];
3094
- escaped2 += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
3095
- last = i + 1;
3096
- }
3097
- return escaped2 + str.substring(last);
3098
- }
3099
- function r(e) {
3100
- var t, f, n = "";
3101
- if ("string" == typeof e || "number" == typeof e) n += e;
3102
- else if ("object" == typeof e) if (Array.isArray(e)) {
3103
- var o = e.length;
3104
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
3105
- } else for (f in e) e[f] && (n && (n += " "), n += f);
3106
- return n;
3107
- }
3108
- function clsx$1() {
3109
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
3110
- return n;
3111
- }
3112
- const replacements = {
3113
- translate: /* @__PURE__ */ new Map([
3114
- [true, "yes"],
3115
- [false, "no"]
3116
- ])
3117
- };
3118
- function attr(name, value, is_boolean = false) {
3119
- if (name === "hidden" && value !== "until-found") {
3120
- is_boolean = true;
3121
- }
3122
- if (value == null || !value && is_boolean) return "";
3123
- const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
3124
- const assignment = is_boolean ? `=""` : `="${escape_html(normalized, true)}"`;
3125
- return ` ${name}${assignment}`;
3126
- }
3127
- function clsx(value) {
3128
- if (typeof value === "object") {
3129
- return clsx$1(value);
3130
- } else {
3131
- return value ?? "";
3132
- }
3133
- }
3134
- const whitespace = [..." \n\r\f \v\uFEFF"];
3135
- function to_class(value, hash, directives) {
3136
- var classname = value == null ? "" : "" + value;
3137
- if (hash) {
3138
- classname = classname ? classname + " " + hash : hash;
3139
- }
3140
- if (directives) {
3141
- for (var key of Object.keys(directives)) {
3142
- if (directives[key]) {
3143
- classname = classname ? classname + " " + key : key;
3144
- } else if (classname.length) {
3145
- var len = key.length;
3146
- var a = 0;
3147
- while ((a = classname.indexOf(key, a)) >= 0) {
3148
- var b = a + len;
3149
- if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) {
3150
- classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
3151
- } else {
3152
- a = b;
3153
- }
3154
- }
3155
- }
3156
- }
3157
- }
3158
- return classname === "" ? null : classname;
3159
- }
3160
- function append_styles(styles, important = false) {
3161
- var separator = important ? " !important;" : ";";
3162
- var css = "";
3163
- for (var key of Object.keys(styles)) {
3164
- var value = styles[key];
3165
- if (value != null && value !== "") {
3166
- css += " " + key + ": " + value + separator;
3167
- }
3168
- }
3169
- return css;
3170
- }
3171
- function to_css_name(name) {
3172
- if (name[0] !== "-" || name[1] !== "-") {
3173
- return name.toLowerCase();
3174
- }
3175
- return name;
3176
- }
3177
- function to_style(value, styles) {
3178
- if (styles) {
3179
- var new_style = "";
3180
- var normal_styles;
3181
- var important_styles;
3182
- if (Array.isArray(styles)) {
3183
- normal_styles = styles[0];
3184
- important_styles = styles[1];
3185
- } else {
3186
- normal_styles = styles;
3187
- }
3188
- if (value) {
3189
- value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
3190
- var in_str = false;
3191
- var in_apo = 0;
3192
- var in_comment = false;
3193
- var reserved_names = [];
3194
- if (normal_styles) {
3195
- reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
3196
- }
3197
- if (important_styles) {
3198
- reserved_names.push(...Object.keys(important_styles).map(to_css_name));
3199
- }
3200
- var start_index = 0;
3201
- var name_index = -1;
3202
- const len = value.length;
3203
- for (var i = 0; i < len; i++) {
3204
- var c = value[i];
3205
- if (in_comment) {
3206
- if (c === "/" && value[i - 1] === "*") {
3207
- in_comment = false;
3208
- }
3209
- } else if (in_str) {
3210
- if (in_str === c) {
3211
- in_str = false;
3212
- }
3213
- } else if (c === "/" && value[i + 1] === "*") {
3214
- in_comment = true;
3215
- } else if (c === '"' || c === "'") {
3216
- in_str = c;
3217
- } else if (c === "(") {
3218
- in_apo++;
3219
- } else if (c === ")") {
3220
- in_apo--;
3221
- }
3222
- if (!in_comment && in_str === false && in_apo === 0) {
3223
- if (c === ":" && name_index === -1) {
3224
- name_index = i;
3225
- } else if (c === ";" || i === len - 1) {
3226
- if (name_index !== -1) {
3227
- var name = to_css_name(value.substring(start_index, name_index).trim());
3228
- if (!reserved_names.includes(name)) {
3229
- if (c !== ";") {
3230
- i++;
3231
- }
3232
- var property = value.substring(start_index, i).trim();
3233
- new_style += " " + property + ";";
3234
- }
3235
- }
3236
- start_index = i + 1;
3237
- name_index = -1;
3238
- }
3239
- }
3240
- }
3241
- }
3242
- if (normal_styles) {
3243
- new_style += append_styles(normal_styles);
3244
- }
3245
- if (important_styles) {
3246
- new_style += append_styles(important_styles, true);
3247
- }
3248
- new_style = new_style.trim();
3249
- return new_style === "" ? null : new_style;
3250
- }
3251
- return value == null ? null : String(value);
3252
- }
3253
- function asClassComponent$1(component) {
3254
- return class extends Svelte4Component {
3255
- /** @param {any} options */
3256
- constructor(options) {
3257
- super({
3258
- component,
3259
- ...options
3260
- });
3261
- }
3262
- };
3263
- }
3264
- class Svelte4Component {
3265
- /** @type {any} */
3266
- #events;
3267
- /** @type {Record<string, any>} */
3268
- #instance;
3269
- /**
3270
- * @param {ComponentConstructorOptions & {
3271
- * component: any;
3272
- * }} options
3273
- */
3274
- constructor(options) {
3275
- var sources = /* @__PURE__ */ new Map();
3276
- var add_source = (key, value) => {
3277
- var s = /* @__PURE__ */ mutable_source(value, false, false);
3278
- sources.set(key, s);
3279
- return s;
3280
- };
3281
- const props = new Proxy(
3282
- { ...options.props || {}, $$events: {} },
3283
- {
3284
- get(target, prop) {
3285
- return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
3286
- },
3287
- has(target, prop) {
3288
- if (prop === LEGACY_PROPS) return true;
3289
- get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
3290
- return Reflect.has(target, prop);
3291
- },
3292
- set(target, prop, value) {
3293
- set(sources.get(prop) ?? add_source(prop, value), value);
3294
- return Reflect.set(target, prop, value);
3295
- }
3296
- }
3297
- );
3298
- this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
3299
- target: options.target,
3300
- anchor: options.anchor,
3301
- props,
3302
- context: options.context,
3303
- intro: options.intro ?? false,
3304
- recover: options.recover,
3305
- transformError: options.transformError
3306
- });
3307
- if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {
3308
- flushSync();
3309
- }
3310
- this.#events = props.$$events;
3311
- for (const key of Object.keys(this.#instance)) {
3312
- if (key === "$set" || key === "$destroy" || key === "$on") continue;
3313
- define_property(this, key, {
3314
- get() {
3315
- return this.#instance[key];
3316
- },
3317
- /** @param {any} value */
3318
- set(value) {
3319
- this.#instance[key] = value;
3320
- },
3321
- enumerable: true
3322
- });
3323
- }
3324
- this.#instance.$set = /** @param {Record<string, any>} next */
3325
- (next2) => {
3326
- Object.assign(props, next2);
3327
- };
3328
- this.#instance.$destroy = () => {
3329
- unmount(this.#instance);
3330
- };
3656
+ }
3657
+ function attributes(attrs, css_hash, classes, styles, flags2 = 0) {
3658
+ if (styles) {
3659
+ attrs.style = to_style(attrs.style, styles);
3331
3660
  }
3332
- /** @param {Record<string, any>} props */
3333
- $set(props) {
3334
- this.#instance.$set(props);
3661
+ if (attrs.class) {
3662
+ attrs.class = clsx(attrs.class);
3335
3663
  }
3336
- /**
3337
- * @param {string} event
3338
- * @param {(...args: any[]) => any} callback
3339
- * @returns {any}
3340
- */
3341
- $on(event, callback) {
3342
- this.#events[event] = this.#events[event] || [];
3343
- const cb = (...args) => callback.call(this, ...args);
3344
- this.#events[event].push(cb);
3345
- return () => {
3346
- this.#events[event] = this.#events[event].filter(
3347
- /** @param {any} fn */
3348
- (fn) => fn !== cb
3349
- );
3350
- };
3664
+ if (css_hash || classes) {
3665
+ attrs.class = to_class(attrs.class, css_hash, classes);
3351
3666
  }
3352
- $destroy() {
3353
- this.#instance.$destroy();
3667
+ let attr_str = "";
3668
+ let name;
3669
+ const is_html = (flags2 & ELEMENT_IS_NAMESPACED) === 0;
3670
+ const lowercase = (flags2 & ELEMENT_PRESERVE_ATTRIBUTE_CASE) === 0;
3671
+ const is_input = (flags2 & ELEMENT_IS_INPUT) !== 0;
3672
+ for (name of Object.keys(attrs)) {
3673
+ if (typeof attrs[name] === "function") continue;
3674
+ if (name[0] === "$" && name[1] === "$") continue;
3675
+ if (name === "" || INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
3676
+ var value = attrs[name];
3677
+ var lower = name.toLowerCase();
3678
+ if (lowercase) name = lower;
3679
+ if (lower.length > 2 && lower.startsWith("on")) continue;
3680
+ if (is_input) {
3681
+ if (name === "defaultvalue" || name === "defaultchecked") {
3682
+ name = name === "defaultvalue" ? "value" : "checked";
3683
+ if (attrs[name]) continue;
3684
+ }
3685
+ }
3686
+ attr_str += attr(name, value, is_html && is_boolean_attribute(name));
3354
3687
  }
3688
+ return attr_str;
3355
3689
  }
3356
- const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
3357
- const BLOCK_OPEN_ELSE = `<!--${HYDRATION_START_ELSE}-->`;
3358
- const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
3359
- const EMPTY_COMMENT = `<!---->`;
3360
- let controller = null;
3361
- function abort() {
3362
- controller?.abort(STALE_REACTION);
3363
- controller = null;
3364
- }
3365
- function async_local_storage_unavailable() {
3366
- const error = new Error(`async_local_storage_unavailable
3367
- The node API \`AsyncLocalStorage\` is not available, but is required to use async server rendering.
3368
- https://svelte.dev/e/async_local_storage_unavailable`);
3369
- error.name = "Svelte error";
3370
- throw error;
3371
- }
3372
- function await_invalid() {
3373
- const error = new Error(`await_invalid
3374
- Encountered asynchronous work while rendering synchronously.
3375
- https://svelte.dev/e/await_invalid`);
3376
- error.name = "Svelte error";
3377
- throw error;
3378
- }
3379
- function html_deprecated() {
3380
- const error = new Error(`html_deprecated
3381
- The \`html\` property of server render results has been deprecated. Use \`body\` instead.
3382
- https://svelte.dev/e/html_deprecated`);
3383
- error.name = "Svelte error";
3384
- throw error;
3385
- }
3386
- function invalid_csp() {
3387
- const error = new Error(`invalid_csp
3388
- \`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.
3389
- https://svelte.dev/e/invalid_csp`);
3390
- error.name = "Svelte error";
3391
- throw error;
3392
- }
3393
- function server_context_required() {
3394
- const error = new Error(`server_context_required
3395
- Could not resolve \`render\` context.
3396
- https://svelte.dev/e/server_context_required`);
3397
- error.name = "Svelte error";
3398
- throw error;
3399
- }
3400
- var ssr_context = null;
3401
- function set_ssr_context(v) {
3402
- ssr_context = v;
3403
- }
3404
- function getContext(key) {
3405
- const context_map = get_or_init_context_map();
3406
- const result = (
3407
- /** @type {T} */
3408
- context_map.get(key)
3409
- );
3410
- return result;
3411
- }
3412
- function setContext(key, context2) {
3413
- get_or_init_context_map().set(key, context2);
3414
- return context2;
3415
- }
3416
- function get_or_init_context_map(name) {
3417
- if (ssr_context === null) {
3418
- lifecycle_outside_component();
3419
- }
3420
- return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
3690
+ function stringify(value) {
3691
+ return typeof value === "string" ? value : value == null ? "" : value + "";
3421
3692
  }
3422
- function push(fn) {
3423
- ssr_context = { p: ssr_context, c: null, r: null };
3693
+ function attr_class(value, hash, directives) {
3694
+ var result = to_class(value, hash, directives);
3695
+ return result ? ` class="${escape_html(result, true)}"` : "";
3424
3696
  }
3425
- function pop() {
3426
- ssr_context = /** @type {SSRContext} */
3427
- ssr_context.p;
3697
+ function attr_style(value, directives) {
3698
+ var result = to_style(value, directives);
3699
+ return result ? ` style="${escape_html(result, true)}"` : "";
3428
3700
  }
3429
- function get_parent_context(ssr_context2) {
3430
- let parent = ssr_context2.p;
3431
- while (parent !== null) {
3432
- const context_map = parent.c;
3433
- if (context_map !== null) {
3434
- return context_map;
3701
+ function bind_props(props_parent, props_now) {
3702
+ for (const key of Object.keys(props_now)) {
3703
+ const initial_value = props_parent[key];
3704
+ const value = props_now[key];
3705
+ if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) {
3706
+ props_parent[key] = value;
3435
3707
  }
3436
- parent = parent.p;
3437
3708
  }
3438
- return null;
3439
3709
  }
3440
- function unresolved_hydratable(key, stack) {
3441
- {
3442
- console.warn(`https://svelte.dev/e/unresolved_hydratable`);
3710
+ function await_block(renderer, promise, pending_fn, then_fn) {
3711
+ if (is_promise(promise)) {
3712
+ renderer.push(BLOCK_OPEN);
3713
+ promise.then(null, noop);
3714
+ if (pending_fn !== null) {
3715
+ pending_fn();
3716
+ }
3717
+ } else if (then_fn !== null) {
3718
+ renderer.push(BLOCK_OPEN_ELSE);
3719
+ then_fn(promise);
3443
3720
  }
3444
3721
  }
3445
- let current_render = null;
3446
- let context = null;
3447
- function get_render_context() {
3448
- const store = context ?? als?.getStore();
3449
- if (!store) {
3450
- server_context_required();
3722
+ function ensure_array_like(array_like_or_iterator) {
3723
+ if (array_like_or_iterator) {
3724
+ return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
3451
3725
  }
3452
- return store;
3726
+ return [];
3453
3727
  }
3454
- async function with_render_context(fn) {
3455
- context = {
3456
- hydratable: {
3457
- lookup: /* @__PURE__ */ new Map(),
3458
- comparisons: [],
3459
- unresolved_promises: /* @__PURE__ */ new Map()
3728
+ function once(get_value) {
3729
+ let value = (
3730
+ /** @type {V} */
3731
+ UNINITIALIZED
3732
+ );
3733
+ return () => {
3734
+ if (value === UNINITIALIZED) {
3735
+ value = get_value();
3460
3736
  }
3737
+ return value;
3461
3738
  };
3462
- if (in_webcontainer()) {
3463
- const { promise, resolve } = deferred();
3464
- const previous_render = current_render;
3465
- current_render = promise;
3466
- await previous_render;
3467
- return fn().finally(resolve);
3468
- }
3469
- try {
3470
- if (als === null) {
3471
- async_local_storage_unavailable();
3472
- }
3473
- return als.run(context, fn);
3474
- } finally {
3475
- context = null;
3476
- }
3477
- }
3478
- let als = null;
3479
- let als_import = null;
3480
- function init_render_context() {
3481
- als_import ??= import('node:async_hooks').then((hooks) => {
3482
- als = new hooks.AsyncLocalStorage();
3483
- }).then(noop, noop);
3484
- return als_import;
3485
3739
  }
3486
- function in_webcontainer() {
3487
- return !!globalThis.process?.versions?.webcontainer;
3740
+ function derived(fn) {
3741
+ const get_value = ssr_context === null ? fn : once(fn);
3742
+ let updated_value;
3743
+ return function(new_value) {
3744
+ if (arguments.length === 0) {
3745
+ return updated_value ?? get_value();
3746
+ }
3747
+ updated_value = new_value;
3748
+ return updated_value;
3749
+ };
3488
3750
  }
3489
3751
  let text_encoder;
3490
3752
  let crypto;
@@ -3599,12 +3861,12 @@ class Renderer {
3599
3861
  async(blockers, fn) {
3600
3862
  let callback = fn;
3601
3863
  if (blockers.length > 0) {
3602
- const context2 = ssr_context;
3864
+ const context = ssr_context;
3603
3865
  callback = (renderer) => {
3604
3866
  return Promise.all(blockers).then(() => {
3605
3867
  const previous_context = ssr_context;
3606
3868
  try {
3607
- set_ssr_context(context2);
3869
+ set_ssr_context(context);
3608
3870
  return fn(renderer);
3609
3871
  } finally {
3610
3872
  set_ssr_context(previous_context);
@@ -3618,13 +3880,13 @@ class Renderer {
3618
3880
  * @param {Array<() => void>} thunks
3619
3881
  */
3620
3882
  run(thunks) {
3621
- const context2 = ssr_context;
3883
+ const context = ssr_context;
3622
3884
  let promise = Promise.resolve(thunks[0]());
3623
3885
  const promises = [promise];
3624
3886
  for (const fn of thunks.slice(1)) {
3625
3887
  promise = promise.then(() => {
3626
3888
  const previous_context = ssr_context;
3627
- set_ssr_context(context2);
3889
+ set_ssr_context(context);
3628
3890
  try {
3629
3891
  return fn();
3630
3892
  } finally {
@@ -3741,10 +4003,10 @@ class Renderer {
3741
4003
  * @returns {void}
3742
4004
  */
3743
4005
  component(fn, component_fn) {
3744
- push();
4006
+ push$1();
3745
4007
  const child = this.child(fn);
3746
4008
  child.#is_component_body = true;
3747
- pop();
4009
+ pop$1();
3748
4010
  }
3749
4011
  /**
3750
4012
  * @param {Record<string, any>} attrs
@@ -3868,9 +4130,11 @@ class Renderer {
3868
4130
  );
3869
4131
  }
3870
4132
  this.local = other.local;
3871
- this.#out = other.#out.map((item) => {
3872
- if (item instanceof Renderer) {
3873
- item.subsume(item);
4133
+ this.#out = other.#out.map((item, i) => {
4134
+ const current = this.#out[i];
4135
+ if (current instanceof Renderer && item instanceof Renderer) {
4136
+ current.subsume(item);
4137
+ return current;
3874
4138
  }
3875
4139
  return item;
3876
4140
  });
@@ -3891,8 +4155,8 @@ class Renderer {
3891
4155
  */
3892
4156
  static #serialize_failed_boundary(error) {
3893
4157
  var json = JSON.stringify(error);
3894
- var escaped2 = json.replace(/>/g, "\\u003e").replace(/</g, "\\u003c");
3895
- return `<!--${HYDRATION_START_FAILED}${escaped2}-->`;
4158
+ var escaped = json.replace(/>/g, "\\u003e").replace(/</g, "\\u003c");
4159
+ return `<!--${HYDRATION_START_FAILED}${escaped}-->`;
3896
4160
  }
3897
4161
  /**
3898
4162
  * Only available on the server and when compiling with the `server` option.
@@ -4089,9 +4353,12 @@ class Renderer {
4089
4353
  content.head += boundary_content.head;
4090
4354
  content.body += boundary_content.body;
4091
4355
  } catch (error) {
4092
- const { context: context2, failed, transformError } = item.#boundary;
4093
- set_ssr_context(context2);
4094
- let transformed = await transformError(error);
4356
+ const { context, failed, transformError } = item.#boundary;
4357
+ set_ssr_context(context);
4358
+ let promise = transformError(error);
4359
+ set_ssr_context(null);
4360
+ let transformed = await promise;
4361
+ set_ssr_context(context);
4095
4362
  const failed_renderer = new Renderer(item.global, item);
4096
4363
  failed_renderer.type = item.type;
4097
4364
  failed_renderer.#out.push(Renderer.#serialize_failed_boundary(transformed));
@@ -4124,6 +4391,9 @@ class Renderer {
4124
4391
  * @returns {Renderer}
4125
4392
  */
4126
4393
  static #open_render(mode, component, options) {
4394
+ if (options.idPrefix?.includes("--")) {
4395
+ invalid_id_prefix();
4396
+ }
4127
4397
  var previous_context = ssr_context;
4128
4398
  try {
4129
4399
  const renderer = new Renderer(
@@ -4134,8 +4404,8 @@ class Renderer {
4134
4404
  options.transformError
4135
4405
  )
4136
4406
  );
4137
- const context2 = { p: null, c: options.context ?? null, r: renderer };
4138
- set_ssr_context(context2);
4407
+ const context = { p: null, c: options.context ?? null, r: renderer };
4408
+ set_ssr_context(context);
4139
4409
  renderer.push(BLOCK_OPEN);
4140
4410
  component(renderer, options.props ?? {});
4141
4411
  renderer.push(BLOCK_CLOSE);
@@ -4238,147 +4508,390 @@ class SSRState {
4238
4508
  this.transformError = transformError ?? ((error) => {
4239
4509
  throw error;
4240
4510
  });
4241
- let uid = 1;
4242
- this.uid = () => `${id_prefix}s${uid++}`;
4511
+ let uid2 = 1;
4512
+ this.uid = () => `${id_prefix}s${uid2++}`;
4243
4513
  }
4244
4514
  get_title() {
4245
- return this.#title.value;
4246
- }
4247
- /**
4248
- * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
4249
- * from earlier than or equal to the current value.
4250
- * @param {string} value
4251
- * @param {number[]} path
4252
- */
4253
- set_title(value, path) {
4254
- const current = this.#title.path;
4255
- let i = 0;
4256
- let l = Math.min(path.length, current.length);
4257
- while (i < l && path[i] === current[i]) i += 1;
4258
- if (path[i] === void 0) return;
4259
- if (current[i] === void 0 || path[i] > current[i]) {
4260
- this.#title.path = path;
4261
- this.#title.value = value;
4262
- }
4263
- }
4264
- }
4265
- const INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
4266
- function render(component, options = {}) {
4267
- if (options.csp?.hash && options.csp.nonce) {
4268
- invalid_csp();
4269
- }
4270
- return Renderer.render(
4271
- /** @type {Component<Props>} */
4272
- component,
4273
- options
4274
- );
4275
- }
4276
- function head(hash, renderer, fn) {
4277
- renderer.head((renderer2) => {
4278
- renderer2.push(`<!--${hash}-->`);
4279
- renderer2.child(fn);
4280
- renderer2.push(EMPTY_COMMENT);
4281
- });
4282
- }
4283
- function attributes(attrs, css_hash, classes, styles, flags2 = 0) {
4284
- if (styles) {
4285
- attrs.style = to_style(attrs.style, styles);
4515
+ return this.#title.value;
4286
4516
  }
4287
- if (attrs.class) {
4288
- attrs.class = clsx(attrs.class);
4517
+ /**
4518
+ * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
4519
+ * from earlier than or equal to the current value.
4520
+ * @param {string} value
4521
+ * @param {number[]} path
4522
+ */
4523
+ set_title(value, path) {
4524
+ const current = this.#title.path;
4525
+ let i = 0;
4526
+ let l = Math.min(path.length, current.length);
4527
+ while (i < l && path[i] === current[i]) i += 1;
4528
+ if (path[i] === void 0) return;
4529
+ if (current[i] === void 0 || path[i] > current[i]) {
4530
+ this.#title.path = path;
4531
+ this.#title.value = value;
4532
+ }
4289
4533
  }
4290
- if (css_hash || classes) {
4291
- attrs.class = to_class(attrs.class, css_hash, classes);
4534
+ }
4535
+ const event_symbol = /* @__PURE__ */ Symbol("events");
4536
+ const all_registered_events = /* @__PURE__ */ new Set();
4537
+ const root_event_handles = /* @__PURE__ */ new Set();
4538
+ let last_propagated_event = null;
4539
+ function handle_event_propagation(event) {
4540
+ var handler_element = this;
4541
+ var owner_document = (
4542
+ /** @type {Node} */
4543
+ handler_element.ownerDocument
4544
+ );
4545
+ var event_name = event.type;
4546
+ var path = event.composedPath?.() || [];
4547
+ var current_target = (
4548
+ /** @type {null | Element} */
4549
+ path[0] || event.target
4550
+ );
4551
+ last_propagated_event = event;
4552
+ var path_idx = 0;
4553
+ var handled_at = last_propagated_event === event && event[event_symbol];
4554
+ if (handled_at) {
4555
+ var at_idx = path.indexOf(handled_at);
4556
+ if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
4557
+ window)) {
4558
+ event[event_symbol] = handler_element;
4559
+ return;
4560
+ }
4561
+ var handler_idx = path.indexOf(handler_element);
4562
+ if (handler_idx === -1) {
4563
+ return;
4564
+ }
4565
+ if (at_idx <= handler_idx) {
4566
+ path_idx = at_idx;
4567
+ }
4292
4568
  }
4293
- let attr_str = "";
4294
- let name;
4295
- const is_html = (flags2 & ELEMENT_IS_NAMESPACED) === 0;
4296
- const lowercase = (flags2 & ELEMENT_PRESERVE_ATTRIBUTE_CASE) === 0;
4297
- const is_input = (flags2 & ELEMENT_IS_INPUT) !== 0;
4298
- for (name of Object.keys(attrs)) {
4299
- if (typeof attrs[name] === "function") continue;
4300
- if (name[0] === "$" && name[1] === "$") continue;
4301
- if (INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
4302
- var value = attrs[name];
4303
- if (lowercase) {
4304
- name = name.toLowerCase();
4569
+ current_target = /** @type {Element} */
4570
+ path[path_idx] || event.target;
4571
+ if (current_target === handler_element) return;
4572
+ define_property(event, "currentTarget", {
4573
+ configurable: true,
4574
+ get() {
4575
+ return current_target || owner_document;
4305
4576
  }
4306
- if (name.length > 2 && name.startsWith("on")) continue;
4307
- if (is_input) {
4308
- if (name === "defaultvalue" || name === "defaultchecked") {
4309
- name = name === "defaultvalue" ? "value" : "checked";
4310
- if (attrs[name]) continue;
4577
+ });
4578
+ var previous_reaction = active_reaction;
4579
+ var previous_effect = active_effect;
4580
+ set_active_reaction(null);
4581
+ set_active_effect(null);
4582
+ try {
4583
+ var throw_error;
4584
+ var other_errors = [];
4585
+ while (current_target !== null) {
4586
+ var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
4587
+ current_target.host || null;
4588
+ try {
4589
+ var delegated = current_target[event_symbol]?.[event_name];
4590
+ if (delegated != null && (!/** @type {any} */
4591
+ current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
4592
+ // -> the target could not have been disabled because it emits the event in the first place
4593
+ event.target === current_target)) {
4594
+ delegated.call(current_target, event);
4595
+ }
4596
+ } catch (error) {
4597
+ if (throw_error) {
4598
+ other_errors.push(error);
4599
+ } else {
4600
+ throw_error = error;
4601
+ }
4311
4602
  }
4603
+ if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
4604
+ break;
4605
+ }
4606
+ current_target = parent_element;
4312
4607
  }
4313
- attr_str += attr(name, value, is_html && is_boolean_attribute(name));
4608
+ if (throw_error) {
4609
+ for (let error of other_errors) {
4610
+ queueMicrotask(() => {
4611
+ throw error;
4612
+ });
4613
+ }
4614
+ throw throw_error;
4615
+ }
4616
+ } finally {
4617
+ event[event_symbol] = handler_element;
4618
+ delete event.currentTarget;
4619
+ set_active_reaction(previous_reaction);
4620
+ set_active_effect(previous_effect);
4314
4621
  }
4315
- return attr_str;
4316
- }
4317
- function stringify(value) {
4318
- return typeof value === "string" ? value : value == null ? "" : value + "";
4319
4622
  }
4320
- function attr_class(value, hash, directives) {
4321
- var result = to_class(value, hash, directives);
4322
- return result ? ` class="${escape_html(result, true)}"` : "";
4623
+ function assign_nodes(start, end) {
4624
+ var effect = (
4625
+ /** @type {Effect} */
4626
+ active_effect
4627
+ );
4628
+ if (effect.nodes === null) {
4629
+ effect.nodes = { start, end, a: null, t: null };
4630
+ }
4323
4631
  }
4324
- function attr_style(value, directives) {
4325
- var result = to_style(value, directives);
4326
- return result ? ` style="${escape_html(result, true)}"` : "";
4632
+ function mount(component, options) {
4633
+ return _mount(component, options);
4327
4634
  }
4328
- function bind_props(props_parent, props_now) {
4329
- for (const key of Object.keys(props_now)) {
4330
- const initial_value = props_parent[key];
4331
- const value = props_now[key];
4332
- if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) {
4333
- props_parent[key] = value;
4635
+ function hydrate(component, options) {
4636
+ init_operations();
4637
+ options.intro = options.intro ?? false;
4638
+ const target = options.target;
4639
+ const was_hydrating = hydrating;
4640
+ const previous_hydrate_node = hydrate_node;
4641
+ try {
4642
+ var anchor = /* @__PURE__ */ get_first_child(target);
4643
+ while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
4644
+ anchor.data !== HYDRATION_START)) {
4645
+ anchor = /* @__PURE__ */ get_next_sibling(anchor);
4334
4646
  }
4335
- }
4336
- }
4337
- function await_block(renderer, promise, pending_fn, then_fn) {
4338
- if (is_promise(promise)) {
4339
- renderer.push(BLOCK_OPEN);
4340
- promise.then(null, noop);
4341
- if (pending_fn !== null) {
4342
- pending_fn();
4647
+ if (!anchor) {
4648
+ throw HYDRATION_ERROR;
4343
4649
  }
4344
- } else if (then_fn !== null) {
4345
- renderer.push(BLOCK_OPEN_ELSE);
4346
- then_fn(promise);
4650
+ set_hydrating(true);
4651
+ set_hydrate_node(
4652
+ /** @type {Comment} */
4653
+ anchor
4654
+ );
4655
+ const instance = _mount(component, { ...options, anchor });
4656
+ set_hydrating(false);
4657
+ return (
4658
+ /** @type {Exports} */
4659
+ instance
4660
+ );
4661
+ } catch (error) {
4662
+ if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
4663
+ throw error;
4664
+ }
4665
+ if (error !== HYDRATION_ERROR) {
4666
+ console.warn("Failed to hydrate: ", error);
4667
+ }
4668
+ if (options.recover === false) {
4669
+ hydration_failed();
4670
+ }
4671
+ init_operations();
4672
+ clear_text_content(target);
4673
+ set_hydrating(false);
4674
+ return mount(component, options);
4675
+ } finally {
4676
+ set_hydrating(was_hydrating);
4677
+ set_hydrate_node(previous_hydrate_node);
4347
4678
  }
4348
4679
  }
4349
- function ensure_array_like(array_like_or_iterator) {
4350
- if (array_like_or_iterator) {
4351
- return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
4680
+ const listeners = /* @__PURE__ */ new Map();
4681
+ function _mount(Component, { target, anchor, props = {}, events, context, intro = true, transformError }) {
4682
+ init_operations();
4683
+ var component = void 0;
4684
+ var unmount2 = component_root(() => {
4685
+ var anchor_node = anchor ?? target.appendChild(create_text());
4686
+ boundary(
4687
+ /** @type {TemplateNode} */
4688
+ anchor_node,
4689
+ {
4690
+ pending: () => {
4691
+ }
4692
+ },
4693
+ (anchor_node2) => {
4694
+ push({});
4695
+ var ctx = (
4696
+ /** @type {ComponentContext} */
4697
+ component_context
4698
+ );
4699
+ if (context) ctx.c = context;
4700
+ if (events) {
4701
+ props.$$events = events;
4702
+ }
4703
+ if (hydrating) {
4704
+ assign_nodes(
4705
+ /** @type {TemplateNode} */
4706
+ anchor_node2,
4707
+ null
4708
+ );
4709
+ }
4710
+ component = Component(anchor_node2, props) || {};
4711
+ if (hydrating) {
4712
+ active_effect.nodes.end = hydrate_node;
4713
+ if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
4714
+ hydrate_node.data !== HYDRATION_END) {
4715
+ hydration_mismatch();
4716
+ throw HYDRATION_ERROR;
4717
+ }
4718
+ }
4719
+ pop();
4720
+ },
4721
+ transformError
4722
+ );
4723
+ var registered_events = /* @__PURE__ */ new Set();
4724
+ var event_handle = (events2) => {
4725
+ for (var i = 0; i < events2.length; i++) {
4726
+ var event_name = events2[i];
4727
+ if (registered_events.has(event_name)) continue;
4728
+ registered_events.add(event_name);
4729
+ var passive = is_passive_event(event_name);
4730
+ for (const node of [target, document]) {
4731
+ var counts = listeners.get(node);
4732
+ if (counts === void 0) {
4733
+ counts = /* @__PURE__ */ new Map();
4734
+ listeners.set(node, counts);
4735
+ }
4736
+ var count = counts.get(event_name);
4737
+ if (count === void 0) {
4738
+ node.addEventListener(event_name, handle_event_propagation, { passive });
4739
+ counts.set(event_name, 1);
4740
+ } else {
4741
+ counts.set(event_name, count + 1);
4742
+ }
4743
+ }
4744
+ }
4745
+ };
4746
+ event_handle(array_from(all_registered_events));
4747
+ root_event_handles.add(event_handle);
4748
+ return () => {
4749
+ for (var event_name of registered_events) {
4750
+ for (const node of [target, document]) {
4751
+ var counts = (
4752
+ /** @type {Map<string, number>} */
4753
+ listeners.get(node)
4754
+ );
4755
+ var count = (
4756
+ /** @type {number} */
4757
+ counts.get(event_name)
4758
+ );
4759
+ if (--count == 0) {
4760
+ node.removeEventListener(event_name, handle_event_propagation);
4761
+ counts.delete(event_name);
4762
+ if (counts.size === 0) {
4763
+ listeners.delete(node);
4764
+ }
4765
+ } else {
4766
+ counts.set(event_name, count);
4767
+ }
4768
+ }
4769
+ }
4770
+ root_event_handles.delete(event_handle);
4771
+ if (anchor_node !== anchor) {
4772
+ anchor_node.parentNode?.removeChild(anchor_node);
4773
+ }
4774
+ };
4775
+ });
4776
+ mounted_components.set(component, unmount2);
4777
+ return component;
4778
+ }
4779
+ let mounted_components = /* @__PURE__ */ new WeakMap();
4780
+ function unmount(component, options) {
4781
+ const fn = mounted_components.get(component);
4782
+ if (fn) {
4783
+ mounted_components.delete(component);
4784
+ return fn(options);
4352
4785
  }
4353
- return [];
4786
+ return Promise.resolve();
4354
4787
  }
4355
- function once(get_value) {
4356
- let value = (
4357
- /** @type {V} */
4358
- UNINITIALIZED
4359
- );
4360
- return () => {
4361
- if (value === UNINITIALIZED) {
4362
- value = get_value();
4788
+ function asClassComponent$1(component) {
4789
+ return class extends Svelte4Component {
4790
+ /** @param {any} options */
4791
+ constructor(options) {
4792
+ super({
4793
+ component,
4794
+ ...options
4795
+ });
4363
4796
  }
4364
- return value;
4365
4797
  };
4366
4798
  }
4367
- function derived(fn) {
4368
- const get_value = ssr_context === null ? fn : once(fn);
4369
- let updated_value;
4370
- return function(new_value) {
4371
- if (arguments.length === 0) {
4372
- return updated_value ?? get_value();
4799
+ class Svelte4Component {
4800
+ /** @type {any} */
4801
+ #events;
4802
+ /** @type {Record<string, any>} */
4803
+ #instance;
4804
+ /**
4805
+ * @param {ComponentConstructorOptions & {
4806
+ * component: any;
4807
+ * }} options
4808
+ */
4809
+ constructor(options) {
4810
+ var sources = /* @__PURE__ */ new Map();
4811
+ var add_source = (key, value) => {
4812
+ var s = /* @__PURE__ */ mutable_source(value, false, false);
4813
+ sources.set(key, s);
4814
+ return s;
4815
+ };
4816
+ const props = new Proxy(
4817
+ { ...options.props || {}, $$events: {} },
4818
+ {
4819
+ get(target, prop) {
4820
+ return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
4821
+ },
4822
+ has(target, prop) {
4823
+ if (prop === LEGACY_PROPS) return true;
4824
+ get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
4825
+ return Reflect.has(target, prop);
4826
+ },
4827
+ set(target, prop, value) {
4828
+ set(sources.get(prop) ?? add_source(prop, value), value);
4829
+ return Reflect.set(target, prop, value);
4830
+ }
4831
+ }
4832
+ );
4833
+ this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
4834
+ target: options.target,
4835
+ anchor: options.anchor,
4836
+ props,
4837
+ context: options.context,
4838
+ intro: options.intro ?? false,
4839
+ recover: options.recover,
4840
+ transformError: options.transformError
4841
+ });
4842
+ if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {
4843
+ flushSync();
4373
4844
  }
4374
- updated_value = new_value;
4375
- return updated_value;
4376
- };
4845
+ this.#events = props.$$events;
4846
+ for (const key of Object.keys(this.#instance)) {
4847
+ if (key === "$set" || key === "$destroy" || key === "$on") continue;
4848
+ define_property(this, key, {
4849
+ get() {
4850
+ return this.#instance[key];
4851
+ },
4852
+ /** @param {any} value */
4853
+ set(value) {
4854
+ this.#instance[key] = value;
4855
+ },
4856
+ enumerable: true
4857
+ });
4858
+ }
4859
+ this.#instance.$set = /** @param {Record<string, any>} next */
4860
+ (next2) => {
4861
+ Object.assign(props, next2);
4862
+ };
4863
+ this.#instance.$destroy = () => {
4864
+ unmount(this.#instance);
4865
+ };
4866
+ }
4867
+ /** @param {Record<string, any>} props */
4868
+ $set(props) {
4869
+ this.#instance.$set(props);
4870
+ }
4871
+ /**
4872
+ * @param {string} event
4873
+ * @param {(...args: any[]) => any} callback
4874
+ * @returns {any}
4875
+ */
4876
+ $on(event, callback) {
4877
+ this.#events[event] = this.#events[event] || [];
4878
+ const cb = (...args) => callback.call(this, ...args);
4879
+ this.#events[event].push(cb);
4880
+ return () => {
4881
+ this.#events[event] = this.#events[event].filter(
4882
+ /** @param {any} fn */
4883
+ (fn) => fn !== cb
4884
+ );
4885
+ };
4886
+ }
4887
+ $destroy() {
4888
+ this.#instance.$destroy();
4889
+ }
4377
4890
  }
4378
4891
  function asClassComponent(component) {
4379
4892
  const component_constructor = asClassComponent$1(component);
4380
- const _render = (props, { context: context2, csp, transformError } = {}) => {
4381
- const result = render(component, { props, context: context2, csp, transformError });
4893
+ const _render = (props, { context, csp, transformError } = {}) => {
4894
+ const result = render(component, { props, context, csp, transformError });
4382
4895
  const munged = Object.defineProperties(
4383
4896
  /** @type {LegacyRenderResult & PromiseLike<LegacyRenderResult>} */
4384
4897
  {},
@@ -4450,7 +4963,7 @@ function Root($$renderer, $$props) {
4450
4963
  }
4451
4964
  const Pyramid_5 = derived(() => constructors[5]);
4452
4965
  if (constructors[1]) {
4453
- $$renderer2.push("<!--[-->");
4966
+ $$renderer2.push("<!--[0-->");
4454
4967
  const Pyramid_0 = constructors[0];
4455
4968
  if (Pyramid_0) {
4456
4969
  $$renderer2.push("<!--[-->");
@@ -4460,7 +4973,7 @@ function Root($$renderer, $$props) {
4460
4973
  params: page.params,
4461
4974
  children: ($$renderer3) => {
4462
4975
  if (constructors[2]) {
4463
- $$renderer3.push("<!--[-->");
4976
+ $$renderer3.push("<!--[0-->");
4464
4977
  const Pyramid_1 = constructors[1];
4465
4978
  if (Pyramid_1) {
4466
4979
  $$renderer3.push("<!--[-->");
@@ -4470,7 +4983,7 @@ function Root($$renderer, $$props) {
4470
4983
  params: page.params,
4471
4984
  children: ($$renderer4) => {
4472
4985
  if (constructors[3]) {
4473
- $$renderer4.push("<!--[-->");
4986
+ $$renderer4.push("<!--[0-->");
4474
4987
  const Pyramid_2 = constructors[2];
4475
4988
  if (Pyramid_2) {
4476
4989
  $$renderer4.push("<!--[-->");
@@ -4480,7 +4993,7 @@ function Root($$renderer, $$props) {
4480
4993
  params: page.params,
4481
4994
  children: ($$renderer5) => {
4482
4995
  if (constructors[4]) {
4483
- $$renderer5.push("<!--[-->");
4996
+ $$renderer5.push("<!--[0-->");
4484
4997
  const Pyramid_3 = constructors[3];
4485
4998
  if (Pyramid_3) {
4486
4999
  $$renderer5.push("<!--[-->");
@@ -4490,7 +5003,7 @@ function Root($$renderer, $$props) {
4490
5003
  params: page.params,
4491
5004
  children: ($$renderer6) => {
4492
5005
  if (constructors[5]) {
4493
- $$renderer6.push("<!--[-->");
5006
+ $$renderer6.push("<!--[0-->");
4494
5007
  const Pyramid_4 = constructors[4];
4495
5008
  if (Pyramid_4) {
4496
5009
  $$renderer6.push("<!--[-->");
@@ -4516,7 +5029,7 @@ function Root($$renderer, $$props) {
4516
5029
  $$renderer6.push("<!--]-->");
4517
5030
  }
4518
5031
  } else {
4519
- $$renderer6.push("<!--[!-->");
5032
+ $$renderer6.push("<!--[-1-->");
4520
5033
  const Pyramid_4 = constructors[4];
4521
5034
  if (Pyramid_4) {
4522
5035
  $$renderer6.push("<!--[-->");
@@ -4537,7 +5050,7 @@ function Root($$renderer, $$props) {
4537
5050
  $$renderer5.push("<!--]-->");
4538
5051
  }
4539
5052
  } else {
4540
- $$renderer5.push("<!--[!-->");
5053
+ $$renderer5.push("<!--[-1-->");
4541
5054
  const Pyramid_3 = constructors[3];
4542
5055
  if (Pyramid_3) {
4543
5056
  $$renderer5.push("<!--[-->");
@@ -4558,7 +5071,7 @@ function Root($$renderer, $$props) {
4558
5071
  $$renderer4.push("<!--]-->");
4559
5072
  }
4560
5073
  } else {
4561
- $$renderer4.push("<!--[!-->");
5074
+ $$renderer4.push("<!--[-1-->");
4562
5075
  const Pyramid_2 = constructors[2];
4563
5076
  if (Pyramid_2) {
4564
5077
  $$renderer4.push("<!--[-->");
@@ -4579,7 +5092,7 @@ function Root($$renderer, $$props) {
4579
5092
  $$renderer3.push("<!--]-->");
4580
5093
  }
4581
5094
  } else {
4582
- $$renderer3.push("<!--[!-->");
5095
+ $$renderer3.push("<!--[-1-->");
4583
5096
  const Pyramid_1 = constructors[1];
4584
5097
  if (Pyramid_1) {
4585
5098
  $$renderer3.push("<!--[-->");
@@ -4600,7 +5113,7 @@ function Root($$renderer, $$props) {
4600
5113
  $$renderer2.push("<!--]-->");
4601
5114
  }
4602
5115
  } else {
4603
- $$renderer2.push("<!--[!-->");
5116
+ $$renderer2.push("<!--[-1-->");
4604
5117
  const Pyramid_0 = constructors[0];
4605
5118
  if (Pyramid_0) {
4606
5119
  $$renderer2.push("<!--[-->");
@@ -4613,109 +5126,12 @@ function Root($$renderer, $$props) {
4613
5126
  }
4614
5127
  $$renderer2.push(`<!--]--> `);
4615
5128
  {
4616
- $$renderer2.push("<!--[!-->");
5129
+ $$renderer2.push("<!--[-1-->");
4617
5130
  }
4618
5131
  $$renderer2.push(`<!--]-->`);
4619
5132
  });
4620
5133
  }
4621
5134
  const root = asClassComponent(Root);
4622
5135
 
4623
- const internal = new URL("sveltekit-internal://");
4624
- function resolve(base, path) {
4625
- if (path[0] === "/" && path[1] === "/") return path;
4626
- let url = new URL(base, internal);
4627
- url = new URL(path, url);
4628
- return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;
4629
- }
4630
- function normalize_path(path, trailing_slash) {
4631
- if (path === "/" || trailing_slash === "ignore") return path;
4632
- if (trailing_slash === "never") {
4633
- return path.endsWith("/") ? path.slice(0, -1) : path;
4634
- } else if (trailing_slash === "always" && !path.endsWith("/")) {
4635
- return path + "/";
4636
- }
4637
- return path;
4638
- }
4639
- function decode_pathname(pathname) {
4640
- return pathname.split("%25").map(decodeURI).join("%25");
4641
- }
4642
- function decode_params(params) {
4643
- for (const key in params) {
4644
- params[key] = decodeURIComponent(params[key]);
4645
- }
4646
- return params;
4647
- }
4648
- function make_trackable(url, callback, search_params_callback, allow_hash = false) {
4649
- const tracked = new URL(url);
4650
- Object.defineProperty(tracked, "searchParams", {
4651
- value: new Proxy(tracked.searchParams, {
4652
- get(obj, key) {
4653
- if (key === "get" || key === "getAll" || key === "has") {
4654
- return (param, ...rest) => {
4655
- search_params_callback(param);
4656
- return obj[key](param, ...rest);
4657
- };
4658
- }
4659
- callback();
4660
- const value = Reflect.get(obj, key);
4661
- return typeof value === "function" ? value.bind(obj) : value;
4662
- }
4663
- }),
4664
- enumerable: true,
4665
- configurable: true
4666
- });
4667
- const tracked_url_properties = ["href", "pathname", "search", "toString", "toJSON"];
4668
- if (allow_hash) tracked_url_properties.push("hash");
4669
- for (const property of tracked_url_properties) {
4670
- Object.defineProperty(tracked, property, {
4671
- get() {
4672
- callback();
4673
- return url[property];
4674
- },
4675
- enumerable: true,
4676
- configurable: true
4677
- });
4678
- }
4679
- {
4680
- tracked[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
4681
- return inspect(url, opts);
4682
- };
4683
- tracked.searchParams[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
4684
- return inspect(url.searchParams, opts);
4685
- };
4686
- }
4687
- if (!allow_hash) {
4688
- disable_hash(tracked);
4689
- }
4690
- return tracked;
4691
- }
4692
- function disable_hash(url) {
4693
- allow_nodejs_console_log(url);
4694
- Object.defineProperty(url, "hash", {
4695
- get() {
4696
- throw new Error(
4697
- "Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead"
4698
- );
4699
- }
4700
- });
4701
- }
4702
- function disable_search(url) {
4703
- allow_nodejs_console_log(url);
4704
- for (const property of ["search", "searchParams"]) {
4705
- Object.defineProperty(url, property, {
4706
- get() {
4707
- throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);
4708
- }
4709
- });
4710
- }
4711
- }
4712
- function allow_nodejs_console_log(url) {
4713
- {
4714
- url[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
4715
- return inspect(new URL(url), opts);
4716
- };
4717
- }
4718
- }
4719
-
4720
- export { DEV as A, normalize_path as B, disable_search as C, DevalueError as D, uneval as E, resolve as F, make_trackable as G, get_request_store as H, attr as a, ensure_array_like as b, attr_class as c, derived as d, escape_html as e, clsx as f, getContext as g, head as h, await_block as i, bind_props as j, attr_style as k, is_primitive as l, get_type as m, is_plain_object as n, enumerable_symbols as o, stringify_key as p, stringify_string as q, noop as r, stringify as s, safe_not_equal as t, decode_params as u, valid_array_indices as v, with_request_store as w, try_get_request_store as x, root as y, decode_pathname as z };
4721
- //# sourceMappingURL=url-hmE1zcJ6.js.map
5136
+ export { uneval as A, hydratable_serialization_failed as B, noop as C, DevalueError as D, safe_not_equal as E, decode_params as F, try_get_request_store as G, HOLE as H, root as I, decode_pathname as J, DEV as K, normalize_path as L, MAX_ARRAY_INDEX as M, NAN as N, disable_search as O, POSITIVE_INFINITY as P, resolve as Q, make_trackable as R, SPARSE as S, get_request_store as T, UNDEFINED as U, attr as a, ensure_array_like as b, attr_class as c, derived as d, escape_html as e, clsx as f, getContext as g, head as h, await_block as i, bind_props as j, attr_style as k, NEGATIVE_INFINITY as l, NEGATIVE_ZERO as m, is_valid_array_len as n, is_valid_array_index as o, is_primitive as p, get_type as q, is_plain_object as r, stringify as s, enumerable_symbols as t, stringify_key as u, stringify_string as v, with_request_store as w, valid_array_indices as x, experimental_async_required as y, get_render_context as z };
5137
+ //# sourceMappingURL=root-otUAnOAR.js.map