@recombine-ai/bosun 0.1.9 → 0.2.0-draft

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 (440) hide show
  1. package/bin/bosun.js +9 -8
  2. package/build/academy/academy.ts +584 -0
  3. package/build/academy/csv/index.ts +155 -0
  4. package/build/academy/data.ts +299 -0
  5. package/build/academy/emulate-agents.ts +129 -0
  6. package/build/academy/google-sheets/index.ts +187 -0
  7. package/build/academy/runPromptTests.cli.ts +99 -0
  8. package/build/academy/suite.ts +99 -0
  9. package/build/client/_app/immutable/assets/0.3Ve1RxLg.css +1 -0
  10. package/build/client/_app/immutable/assets/0.3Ve1RxLg.css.br +0 -0
  11. package/build/client/_app/immutable/assets/0.3Ve1RxLg.css.gz +0 -0
  12. package/build/client/_app/immutable/assets/3.C7pCuiHL.css +1 -0
  13. package/build/client/_app/immutable/assets/3.C7pCuiHL.css.br +0 -0
  14. package/build/client/_app/immutable/assets/3.C7pCuiHL.css.gz +0 -0
  15. package/build/client/_app/immutable/assets/4.Baezuvdj.css +1 -0
  16. package/build/client/_app/immutable/assets/4.Baezuvdj.css.br +0 -0
  17. package/build/client/_app/immutable/assets/4.Baezuvdj.css.gz +0 -0
  18. package/build/client/_app/immutable/assets/6.CebW_jOJ.css +1 -0
  19. package/build/client/_app/immutable/assets/6.CebW_jOJ.css.br +0 -0
  20. package/build/client/_app/immutable/assets/6.CebW_jOJ.css.gz +0 -0
  21. package/build/client/_app/immutable/assets/8.f3T7i0UW.css +1 -0
  22. package/build/client/_app/immutable/assets/8.f3T7i0UW.css.br +0 -0
  23. package/build/client/_app/immutable/assets/8.f3T7i0UW.css.gz +0 -0
  24. package/build/client/_app/immutable/assets/AgentSidebar.BEG0l2mN.css +1 -0
  25. package/build/client/_app/immutable/assets/AgentSidebar.BEG0l2mN.css.br +0 -0
  26. package/build/client/_app/immutable/assets/AgentSidebar.BEG0l2mN.css.gz +0 -0
  27. package/build/client/_app/immutable/assets/Link.D7uHGZ0C.css +1 -0
  28. package/build/client/_app/immutable/assets/Link.D7uHGZ0C.css.br +1 -0
  29. package/build/client/_app/immutable/assets/Link.D7uHGZ0C.css.gz +0 -0
  30. package/build/client/_app/immutable/assets/Tab.DrtF13Tg.css +1 -0
  31. package/build/client/_app/immutable/assets/Tab.DrtF13Tg.css.br +0 -0
  32. package/build/client/_app/immutable/assets/Tab.DrtF13Tg.css.gz +0 -0
  33. package/build/client/_app/immutable/chunks/B6Eu_a6G.js +8 -0
  34. package/build/client/_app/immutable/chunks/B6Eu_a6G.js.br +0 -0
  35. package/build/client/_app/immutable/chunks/B6Eu_a6G.js.gz +0 -0
  36. package/build/client/_app/immutable/chunks/B946i1vX.js +1 -0
  37. package/build/client/_app/immutable/chunks/B946i1vX.js.br +0 -0
  38. package/build/client/_app/immutable/chunks/B946i1vX.js.gz +0 -0
  39. package/build/client/_app/immutable/chunks/BDr6IUDE.js +1 -0
  40. package/build/client/_app/immutable/chunks/BDr6IUDE.js.br +0 -0
  41. package/build/client/_app/immutable/chunks/BDr6IUDE.js.gz +0 -0
  42. package/build/client/_app/immutable/chunks/BJ0PAzRz.js +1 -0
  43. package/build/client/_app/immutable/chunks/BJ0PAzRz.js.br +0 -0
  44. package/build/client/_app/immutable/chunks/BJ0PAzRz.js.gz +0 -0
  45. package/build/client/_app/immutable/chunks/BQsXEsya.js +2 -0
  46. package/build/client/_app/immutable/chunks/BQsXEsya.js.br +0 -0
  47. package/build/client/_app/immutable/chunks/BQsXEsya.js.gz +0 -0
  48. package/build/client/_app/immutable/chunks/BVH8cl8Q.js +1 -0
  49. package/build/client/_app/immutable/chunks/BVH8cl8Q.js.br +0 -0
  50. package/build/client/_app/immutable/chunks/BVH8cl8Q.js.gz +0 -0
  51. package/build/client/_app/immutable/chunks/Bckf35or.js +1 -0
  52. package/build/client/_app/immutable/chunks/Bckf35or.js.br +1 -0
  53. package/build/client/_app/immutable/chunks/Bckf35or.js.gz +0 -0
  54. package/build/client/_app/immutable/chunks/BcyK4bvI.js +1 -0
  55. package/build/client/_app/immutable/chunks/BcyK4bvI.js.br +0 -0
  56. package/build/client/_app/immutable/chunks/BcyK4bvI.js.gz +0 -0
  57. package/build/client/_app/immutable/chunks/BpsvkpCa.js +1 -0
  58. package/build/client/_app/immutable/chunks/BpsvkpCa.js.br +0 -0
  59. package/build/client/_app/immutable/chunks/BpsvkpCa.js.gz +0 -0
  60. package/build/client/_app/immutable/chunks/C7b8kjFl.js +33 -0
  61. package/build/client/_app/immutable/chunks/C7b8kjFl.js.br +0 -0
  62. package/build/client/_app/immutable/chunks/C7b8kjFl.js.gz +0 -0
  63. package/build/client/_app/immutable/chunks/{D5O98MXA.js → C9ihsQgF.js} +2 -2
  64. package/build/client/_app/immutable/chunks/C9ihsQgF.js.br +6 -0
  65. package/build/client/_app/immutable/chunks/C9ihsQgF.js.gz +0 -0
  66. package/build/client/_app/immutable/chunks/CEHtmspK.js +1 -0
  67. package/build/client/_app/immutable/chunks/CEHtmspK.js.br +0 -0
  68. package/build/client/_app/immutable/chunks/CEHtmspK.js.gz +0 -0
  69. package/build/client/_app/immutable/chunks/CHop8m-3.js +1 -0
  70. package/build/client/_app/immutable/chunks/CHop8m-3.js.br +0 -0
  71. package/build/client/_app/immutable/chunks/CHop8m-3.js.gz +0 -0
  72. package/build/client/_app/immutable/chunks/CUWa2xqt.js +1 -0
  73. package/build/client/_app/immutable/chunks/CUWa2xqt.js.br +0 -0
  74. package/build/client/_app/immutable/chunks/CUWa2xqt.js.gz +0 -0
  75. package/build/client/_app/immutable/chunks/ClfaR3Y2.js +1 -0
  76. package/build/client/_app/immutable/chunks/ClfaR3Y2.js.br +0 -0
  77. package/build/client/_app/immutable/chunks/ClfaR3Y2.js.gz +0 -0
  78. package/build/client/_app/immutable/chunks/DAgYAbDT.js +3 -0
  79. package/build/client/_app/immutable/chunks/DAgYAbDT.js.br +0 -0
  80. package/build/client/_app/immutable/chunks/DAgYAbDT.js.gz +0 -0
  81. package/build/client/_app/immutable/chunks/DBCXNg0T.js +1 -0
  82. package/build/client/_app/immutable/chunks/DBCXNg0T.js.br +0 -0
  83. package/build/client/_app/immutable/chunks/DBCXNg0T.js.gz +0 -0
  84. package/build/client/_app/immutable/chunks/DDncCuU5.js +1 -0
  85. package/build/client/_app/immutable/chunks/DDncCuU5.js.br +2 -0
  86. package/build/client/_app/immutable/chunks/DDncCuU5.js.gz +0 -0
  87. package/build/client/_app/immutable/chunks/DHQ8_yIz.js +1 -0
  88. package/build/client/_app/immutable/chunks/DHQ8_yIz.js.br +0 -0
  89. package/build/client/_app/immutable/chunks/DHQ8_yIz.js.gz +0 -0
  90. package/build/client/_app/immutable/chunks/Deb2U3a-.js +1 -0
  91. package/build/client/_app/immutable/chunks/Deb2U3a-.js.br +0 -0
  92. package/build/client/_app/immutable/chunks/Deb2U3a-.js.gz +0 -0
  93. package/build/client/_app/immutable/chunks/{B8bx6-qu.js → DgNsppMf.js} +1 -1
  94. package/build/client/_app/immutable/chunks/DgNsppMf.js.br +0 -0
  95. package/build/client/_app/immutable/chunks/DgNsppMf.js.gz +0 -0
  96. package/build/client/_app/immutable/chunks/DgSSnt2u.js +1 -0
  97. package/build/client/_app/immutable/chunks/DgSSnt2u.js.br +0 -0
  98. package/build/client/_app/immutable/chunks/DgSSnt2u.js.gz +0 -0
  99. package/build/client/_app/immutable/chunks/Dr0H-PA9.js +1 -0
  100. package/build/client/_app/immutable/chunks/Dr0H-PA9.js.br +0 -0
  101. package/build/client/_app/immutable/chunks/Dr0H-PA9.js.gz +0 -0
  102. package/build/client/_app/immutable/chunks/HA3qddzj.js +1 -0
  103. package/build/client/_app/immutable/chunks/HA3qddzj.js.br +0 -0
  104. package/build/client/_app/immutable/chunks/HA3qddzj.js.gz +0 -0
  105. package/build/client/_app/immutable/chunks/LPKWlFs0.js +1 -0
  106. package/build/client/_app/immutable/chunks/LPKWlFs0.js.br +3 -0
  107. package/build/client/_app/immutable/chunks/LPKWlFs0.js.gz +0 -0
  108. package/build/client/_app/immutable/chunks/VpPuF4LW.js +3 -0
  109. package/build/client/_app/immutable/chunks/VpPuF4LW.js.br +0 -0
  110. package/build/client/_app/immutable/chunks/VpPuF4LW.js.gz +0 -0
  111. package/build/client/_app/immutable/chunks/XyRovF4A.js +1 -0
  112. package/build/client/_app/immutable/chunks/XyRovF4A.js.br +0 -0
  113. package/build/client/_app/immutable/chunks/XyRovF4A.js.gz +0 -0
  114. package/build/client/_app/immutable/chunks/mRVZsLQ4.js +1 -0
  115. package/build/client/_app/immutable/chunks/mRVZsLQ4.js.br +2 -0
  116. package/build/client/_app/immutable/chunks/mRVZsLQ4.js.gz +0 -0
  117. package/build/client/_app/immutable/entry/app.CVDHq7dN.js +2 -0
  118. package/build/client/_app/immutable/entry/app.CVDHq7dN.js.br +0 -0
  119. package/build/client/_app/immutable/entry/app.CVDHq7dN.js.gz +0 -0
  120. package/build/client/_app/immutable/entry/start.a4wXr-rh.js +1 -0
  121. package/build/client/_app/immutable/entry/start.a4wXr-rh.js.br +2 -0
  122. package/build/client/_app/immutable/entry/start.a4wXr-rh.js.gz +0 -0
  123. package/build/client/_app/immutable/nodes/0.q5P1PqkU.js +3 -0
  124. package/build/client/_app/immutable/nodes/0.q5P1PqkU.js.br +0 -0
  125. package/build/client/_app/immutable/nodes/0.q5P1PqkU.js.gz +0 -0
  126. package/build/client/_app/immutable/nodes/1.TfmDsqd-.js +1 -0
  127. package/build/client/_app/immutable/nodes/1.TfmDsqd-.js.br +0 -0
  128. package/build/client/_app/immutable/nodes/1.TfmDsqd-.js.gz +0 -0
  129. package/build/client/_app/immutable/nodes/10.BpXsBlTN.js +1 -0
  130. package/build/client/_app/immutable/nodes/10.BpXsBlTN.js.br +0 -0
  131. package/build/client/_app/immutable/nodes/10.BpXsBlTN.js.gz +0 -0
  132. package/build/client/_app/immutable/nodes/11.Bs_5a_H1.js +1 -0
  133. package/build/client/_app/immutable/nodes/11.Bs_5a_H1.js.br +0 -0
  134. package/build/client/_app/immutable/nodes/11.Bs_5a_H1.js.gz +0 -0
  135. package/build/client/_app/immutable/nodes/2.BWtLQzzv.js +3 -0
  136. package/build/client/_app/immutable/nodes/2.BWtLQzzv.js.br +0 -0
  137. package/build/client/_app/immutable/nodes/2.BWtLQzzv.js.gz +0 -0
  138. package/build/client/_app/immutable/nodes/3.BlYIVobe.js +1 -0
  139. package/build/client/_app/immutable/nodes/3.BlYIVobe.js.br +0 -0
  140. package/build/client/_app/immutable/nodes/3.BlYIVobe.js.gz +0 -0
  141. package/build/client/_app/immutable/nodes/4.DMboagHp.js +38 -0
  142. package/build/client/_app/immutable/nodes/4.DMboagHp.js.br +0 -0
  143. package/build/client/_app/immutable/nodes/4.DMboagHp.js.gz +0 -0
  144. package/build/client/_app/immutable/nodes/5.DJDEfbU1.js +1 -0
  145. package/build/client/_app/immutable/nodes/5.DJDEfbU1.js.br +0 -0
  146. package/build/client/_app/immutable/nodes/5.DJDEfbU1.js.gz +0 -0
  147. package/build/client/_app/immutable/nodes/6.Co1n7leD.js +12 -0
  148. package/build/client/_app/immutable/nodes/6.Co1n7leD.js.br +0 -0
  149. package/build/client/_app/immutable/nodes/6.Co1n7leD.js.gz +0 -0
  150. package/build/client/_app/immutable/nodes/7.3clSez0f.js +1 -0
  151. package/build/client/_app/immutable/nodes/7.3clSez0f.js.br +0 -0
  152. package/build/client/_app/immutable/nodes/7.3clSez0f.js.gz +0 -0
  153. package/build/client/_app/immutable/nodes/8.D4xImLsM.js +1 -0
  154. package/build/client/_app/immutable/nodes/8.D4xImLsM.js.br +0 -0
  155. package/build/client/_app/immutable/nodes/8.D4xImLsM.js.gz +0 -0
  156. package/build/client/_app/immutable/nodes/9.C1KWPSTf.js +1 -0
  157. package/build/client/_app/immutable/nodes/9.C1KWPSTf.js.br +0 -0
  158. package/build/client/_app/immutable/nodes/9.C1KWPSTf.js.gz +0 -0
  159. package/build/client/_app/version.json +1 -1
  160. package/build/client/_app/version.json.br +0 -0
  161. package/build/client/_app/version.json.gz +0 -0
  162. package/build/server/chunks/0-CgyQG-Vf.js +9 -0
  163. package/build/server/chunks/0-CgyQG-Vf.js.map +1 -0
  164. package/build/server/chunks/1-DACiLfsu.js +9 -0
  165. package/build/server/chunks/{1-Cwk3hpe9.js.map → 1-DACiLfsu.js.map} +1 -1
  166. package/build/server/chunks/10-zMqY0bCj.js +9 -0
  167. package/build/server/chunks/10-zMqY0bCj.js.map +1 -0
  168. package/build/server/chunks/11-B7cPB4ip.js +9 -0
  169. package/build/server/chunks/11-B7cPB4ip.js.map +1 -0
  170. package/build/server/chunks/2-uTf78dNT.js +9 -0
  171. package/build/server/chunks/2-uTf78dNT.js.map +1 -0
  172. package/build/server/chunks/3-DOOLRXaZ.js +9 -0
  173. package/build/server/chunks/3-DOOLRXaZ.js.map +1 -0
  174. package/build/server/chunks/4-CLK_BxY0.js +9 -0
  175. package/build/server/chunks/4-CLK_BxY0.js.map +1 -0
  176. package/build/server/chunks/5-DfZ6yJrz.js +9 -0
  177. package/build/server/chunks/5-DfZ6yJrz.js.map +1 -0
  178. package/build/server/chunks/6-B2BoZUr6.js +22 -0
  179. package/build/server/chunks/6-B2BoZUr6.js.map +1 -0
  180. package/build/server/chunks/{5-p3BDfNc2.js → 7-DmgY6drC.js} +6 -6
  181. package/build/server/chunks/7-DmgY6drC.js.map +1 -0
  182. package/build/server/chunks/8-Bku8n4Ko.js +9 -0
  183. package/build/server/chunks/8-Bku8n4Ko.js.map +1 -0
  184. package/build/server/chunks/{7-C_AGqUAU.js → 9-nwlpMH7t.js} +5 -5
  185. package/build/server/chunks/9-nwlpMH7t.js.map +1 -0
  186. package/build/server/chunks/AgentSidebar-CZIBBsSh.js +141 -0
  187. package/build/server/chunks/AgentSidebar-CZIBBsSh.js.map +1 -0
  188. package/build/server/chunks/Button-OUO_MioZ.js +44 -0
  189. package/build/server/chunks/Button-OUO_MioZ.js.map +1 -0
  190. package/build/server/chunks/ContextEditor-stz14-2o.js +48 -0
  191. package/build/server/chunks/ContextEditor-stz14-2o.js.map +1 -0
  192. package/build/server/chunks/{Dropdown-B-UCol1v.js → Dropdown-BTr_XiAm.js} +2 -2
  193. package/build/server/chunks/Dropdown-BTr_XiAm.js.map +1 -0
  194. package/build/server/chunks/{Input-DLAEH36y.js → Input-B_jIG2tD.js} +2 -2
  195. package/build/server/chunks/Input-B_jIG2tD.js.map +1 -0
  196. package/build/server/chunks/{Icon-DDJ9D6Sq.js → Link-DaOJVbdB.js} +25 -42
  197. package/build/server/chunks/Link-DaOJVbdB.js.map +1 -0
  198. package/build/server/chunks/{Panel-KZDoG3_L.js → Panel-CmvYn6IC.js} +2 -2
  199. package/build/server/chunks/Panel-CmvYn6IC.js.map +1 -0
  200. package/build/server/chunks/Tab-n348Mfiq.js +84 -0
  201. package/build/server/chunks/Tab-n348Mfiq.js.map +1 -0
  202. package/build/server/chunks/_layout.svelte-CP6tz6DB.js +62 -0
  203. package/build/server/chunks/_layout.svelte-CP6tz6DB.js.map +1 -0
  204. package/build/server/chunks/{_layout.svelte-BoAJDYC1.js → _layout.svelte-CvGX8M4U.js} +68 -18
  205. package/build/server/chunks/_layout.svelte-CvGX8M4U.js.map +1 -0
  206. package/build/server/chunks/{_page.svelte-CdEfc0bc.js → _page.svelte-AHHrodUG.js} +94 -86
  207. package/build/server/chunks/_page.svelte-AHHrodUG.js.map +1 -0
  208. package/build/server/chunks/_page.svelte-Bm-iBjXM.js +80 -0
  209. package/build/server/chunks/_page.svelte-Bm-iBjXM.js.map +1 -0
  210. package/build/server/chunks/_page.svelte-D5Xqk3cI.js +52 -0
  211. package/build/server/chunks/_page.svelte-D5Xqk3cI.js.map +1 -0
  212. package/build/server/chunks/{_page.svelte-CNhxx79k.js → _page.svelte-DKBFi-JF.js} +202 -240
  213. package/build/server/chunks/_page.svelte-DKBFi-JF.js.map +1 -0
  214. package/build/server/chunks/{_page.svelte-DQUdiD4S.js → _page.svelte-DSefP5E9.js} +6 -5
  215. package/build/server/chunks/_page.svelte-DSefP5E9.js.map +1 -0
  216. package/build/server/chunks/{_page.svelte-kLLxi8vG.js → _page.svelte-Dldwxu4m.js} +28 -6
  217. package/build/server/chunks/_page.svelte-Dldwxu4m.js.map +1 -0
  218. package/build/server/chunks/{_page.svelte-Cc0DAAQW.js → _page.svelte-lU1-SHJj.js} +5 -4
  219. package/build/server/chunks/_page.svelte-lU1-SHJj.js.map +1 -0
  220. package/build/server/chunks/{_page.svelte-nsIWq28L.js → _page.svelte-vGR-ltk7.js} +7 -27
  221. package/build/server/chunks/_page.svelte-vGR-ltk7.js.map +1 -0
  222. package/build/server/chunks/{_server.ts-d0Tii8aZ.js → _server.ts-3D9tpnMZ.js} +3 -2
  223. package/build/server/chunks/_server.ts-3D9tpnMZ.js.map +1 -0
  224. package/build/server/chunks/{_server.ts-BBxm_xV1.js → _server.ts-B56wS_0L.js} +4 -1
  225. package/build/server/chunks/_server.ts-B56wS_0L.js.map +1 -0
  226. package/build/server/chunks/{_server.ts-CLKPeFqF.js → _server.ts-BCBY3OIY.js} +3 -2
  227. package/build/server/chunks/_server.ts-BCBY3OIY.js.map +1 -0
  228. package/build/server/chunks/{_server.ts-BmZBSYvJ.js → _server.ts-BCfiuZgS.js} +19 -8
  229. package/build/server/chunks/_server.ts-BCfiuZgS.js.map +1 -0
  230. package/build/server/chunks/_server.ts-BkL-sSQA.js.map +1 -1
  231. package/build/server/chunks/{_server.ts-DEHw6op6.js → _server.ts-D0C3cRDU.js} +3 -2
  232. package/build/server/chunks/_server.ts-D0C3cRDU.js.map +1 -0
  233. package/build/server/chunks/{_server.ts-BYDdbqNr.js → _server.ts-Dc989xbA.js} +3 -2
  234. package/build/server/chunks/_server.ts-Dc989xbA.js.map +1 -0
  235. package/build/server/chunks/_server.ts-Ddto8x_p.js.map +1 -1
  236. package/build/server/chunks/{_server.ts-BIcKE9RQ.js → _server.ts-I-18L-Sg.js} +3 -2
  237. package/build/server/chunks/_server.ts-I-18L-Sg.js.map +1 -0
  238. package/build/server/chunks/_server.ts-iuWHhHZx.js +629 -0
  239. package/build/server/chunks/_server.ts-iuWHhHZx.js.map +1 -0
  240. package/build/server/chunks/agents-context-C4MM7lSl.js +6 -0
  241. package/build/server/chunks/agents-context-C4MM7lSl.js.map +1 -0
  242. package/build/server/chunks/{client2-tp0-IQU0.js → client-BhnXtftB.js} +6 -29
  243. package/build/server/chunks/client-BhnXtftB.js.map +1 -0
  244. package/build/server/chunks/{index2-CVBATI2G.js → context-Dy9MY1Z0.js} +253 -965
  245. package/build/server/chunks/context-Dy9MY1Z0.js.map +1 -0
  246. package/build/server/chunks/{data-CbXDDeDB.js → data-BltJc-uF.js} +29 -89
  247. package/build/server/chunks/data-BltJc-uF.js.map +1 -0
  248. package/build/server/chunks/error.svelte-Cn6umEWY.js +14 -0
  249. package/build/server/chunks/error.svelte-Cn6umEWY.js.map +1 -0
  250. package/build/server/chunks/errors-B8liwVcD.js +17 -0
  251. package/build/server/chunks/errors-B8liwVcD.js.map +1 -0
  252. package/build/server/chunks/{events-A18hGvKp.js → events-BFcZEt66.js} +3 -9
  253. package/build/server/chunks/events-BFcZEt66.js.map +1 -0
  254. package/build/server/chunks/{index-BoStl4QO.js → index-C0ds_eUO.js} +8 -3
  255. package/build/server/chunks/index-C0ds_eUO.js.map +1 -0
  256. package/build/server/chunks/index-server-CMCI3p2Y.js +18 -0
  257. package/build/server/chunks/index-server-CMCI3p2Y.js.map +1 -0
  258. package/build/server/chunks/index2-B1rkViAM.js +860 -0
  259. package/build/server/chunks/index2-B1rkViAM.js.map +1 -0
  260. package/build/server/chunks/index3-CVYj52gl.js.map +1 -1
  261. package/build/server/chunks/index4-DSZuWW-A.js +47 -0
  262. package/build/server/chunks/index4-DSZuWW-A.js.map +1 -0
  263. package/build/server/chunks/main-DL75vM4l.js +2250 -0
  264. package/build/server/chunks/main-DL75vM4l.js.map +1 -0
  265. package/build/server/chunks/{state.svelte-Dze7OxC_.js → state.svelte-CBgyohE1.js} +2 -2
  266. package/build/server/chunks/state.svelte-CBgyohE1.js.map +1 -0
  267. package/build/server/chunks/suite-4--Gr0jF.js +60 -0
  268. package/build/server/chunks/suite-4--Gr0jF.js.map +1 -0
  269. package/build/server/chunks/ws-client-CyJORDFw.js +98 -0
  270. package/build/server/chunks/ws-client-CyJORDFw.js.map +1 -0
  271. package/build/server/index.js +167 -90
  272. package/build/server/index.js.map +1 -1
  273. package/build/server/manifest.js +83 -75
  274. package/build/server/manifest.js.map +1 -1
  275. package/package.json +3 -1
  276. package/src/ws-server/projects.ts +82 -9
  277. package/build/client/_app/immutable/assets/0.7xdY7TSX.css +0 -1
  278. package/build/client/_app/immutable/assets/0.7xdY7TSX.css.br +0 -0
  279. package/build/client/_app/immutable/assets/0.7xdY7TSX.css.gz +0 -0
  280. package/build/client/_app/immutable/assets/10.C1o6a69m.css +0 -1
  281. package/build/client/_app/immutable/assets/10.C1o6a69m.css.br +0 -1
  282. package/build/client/_app/immutable/assets/10.C1o6a69m.css.gz +0 -0
  283. package/build/client/_app/immutable/assets/4.858mUNwe.css +0 -1
  284. package/build/client/_app/immutable/assets/4.858mUNwe.css.br +0 -0
  285. package/build/client/_app/immutable/assets/4.858mUNwe.css.gz +0 -0
  286. package/build/client/_app/immutable/assets/6.CD1QZ0pt.css +0 -1
  287. package/build/client/_app/immutable/assets/6.CD1QZ0pt.css.br +0 -0
  288. package/build/client/_app/immutable/assets/6.CD1QZ0pt.css.gz +0 -0
  289. package/build/client/_app/immutable/chunks/2PVbuV1X.js +0 -1
  290. package/build/client/_app/immutable/chunks/2PVbuV1X.js.br +0 -1
  291. package/build/client/_app/immutable/chunks/2PVbuV1X.js.gz +0 -0
  292. package/build/client/_app/immutable/chunks/9OGf6H2n.js +0 -1
  293. package/build/client/_app/immutable/chunks/9OGf6H2n.js.br +0 -2
  294. package/build/client/_app/immutable/chunks/9OGf6H2n.js.gz +0 -0
  295. package/build/client/_app/immutable/chunks/B8bx6-qu.js.br +0 -1
  296. package/build/client/_app/immutable/chunks/B8bx6-qu.js.gz +0 -0
  297. package/build/client/_app/immutable/chunks/BDTuVTVZ.js +0 -1
  298. package/build/client/_app/immutable/chunks/BDTuVTVZ.js.br +0 -0
  299. package/build/client/_app/immutable/chunks/BDTuVTVZ.js.gz +0 -0
  300. package/build/client/_app/immutable/chunks/BTGV3Gq0.js +0 -8
  301. package/build/client/_app/immutable/chunks/BTGV3Gq0.js.br +0 -0
  302. package/build/client/_app/immutable/chunks/BTGV3Gq0.js.gz +0 -0
  303. package/build/client/_app/immutable/chunks/BUoURvZ_.js +0 -1
  304. package/build/client/_app/immutable/chunks/BUoURvZ_.js.br +0 -0
  305. package/build/client/_app/immutable/chunks/BUoURvZ_.js.gz +0 -0
  306. package/build/client/_app/immutable/chunks/BdOqksoz.js +0 -1
  307. package/build/client/_app/immutable/chunks/BdOqksoz.js.br +0 -0
  308. package/build/client/_app/immutable/chunks/BdOqksoz.js.gz +0 -0
  309. package/build/client/_app/immutable/chunks/Be371ezp.js +0 -2
  310. package/build/client/_app/immutable/chunks/Be371ezp.js.br +0 -0
  311. package/build/client/_app/immutable/chunks/Be371ezp.js.gz +0 -0
  312. package/build/client/_app/immutable/chunks/Bmx4ManB.js +0 -1
  313. package/build/client/_app/immutable/chunks/Bmx4ManB.js.br +0 -0
  314. package/build/client/_app/immutable/chunks/Bmx4ManB.js.gz +0 -0
  315. package/build/client/_app/immutable/chunks/C2Y9UxTx.js +0 -1
  316. package/build/client/_app/immutable/chunks/C2Y9UxTx.js.br +0 -0
  317. package/build/client/_app/immutable/chunks/C2Y9UxTx.js.gz +0 -0
  318. package/build/client/_app/immutable/chunks/C681lv5i.js +0 -3
  319. package/build/client/_app/immutable/chunks/C681lv5i.js.br +0 -0
  320. package/build/client/_app/immutable/chunks/C681lv5i.js.gz +0 -0
  321. package/build/client/_app/immutable/chunks/CYuXdPQc.js +0 -1
  322. package/build/client/_app/immutable/chunks/CYuXdPQc.js.br +0 -0
  323. package/build/client/_app/immutable/chunks/CYuXdPQc.js.gz +0 -0
  324. package/build/client/_app/immutable/chunks/CpZGG0E7.js +0 -1
  325. package/build/client/_app/immutable/chunks/CpZGG0E7.js.br +0 -0
  326. package/build/client/_app/immutable/chunks/CpZGG0E7.js.gz +0 -0
  327. package/build/client/_app/immutable/chunks/CpdYAO0i.js +0 -1
  328. package/build/client/_app/immutable/chunks/CpdYAO0i.js.br +0 -0
  329. package/build/client/_app/immutable/chunks/CpdYAO0i.js.gz +0 -0
  330. package/build/client/_app/immutable/chunks/CtpS-ZbM.js +0 -1
  331. package/build/client/_app/immutable/chunks/CtpS-ZbM.js.br +0 -0
  332. package/build/client/_app/immutable/chunks/CtpS-ZbM.js.gz +0 -0
  333. package/build/client/_app/immutable/chunks/D5O98MXA.js.br +0 -0
  334. package/build/client/_app/immutable/chunks/D5O98MXA.js.gz +0 -0
  335. package/build/client/_app/immutable/chunks/DIiF2tGe.js +0 -1
  336. package/build/client/_app/immutable/chunks/DIiF2tGe.js.br +0 -0
  337. package/build/client/_app/immutable/chunks/DIiF2tGe.js.gz +0 -0
  338. package/build/client/_app/immutable/chunks/D_4dC3JZ.js +0 -1
  339. package/build/client/_app/immutable/chunks/D_4dC3JZ.js.br +0 -0
  340. package/build/client/_app/immutable/chunks/D_4dC3JZ.js.gz +0 -0
  341. package/build/client/_app/immutable/chunks/DveC87gn.js +0 -33
  342. package/build/client/_app/immutable/chunks/DveC87gn.js.br +0 -0
  343. package/build/client/_app/immutable/chunks/DveC87gn.js.gz +0 -0
  344. package/build/client/_app/immutable/chunks/ISgeSat5.js +0 -1
  345. package/build/client/_app/immutable/chunks/ISgeSat5.js.br +0 -0
  346. package/build/client/_app/immutable/chunks/ISgeSat5.js.gz +0 -0
  347. package/build/client/_app/immutable/chunks/uzczSfVx.js +0 -3
  348. package/build/client/_app/immutable/chunks/uzczSfVx.js.br +0 -0
  349. package/build/client/_app/immutable/chunks/uzczSfVx.js.gz +0 -0
  350. package/build/client/_app/immutable/entry/app.CSVt0Fuk.js +0 -2
  351. package/build/client/_app/immutable/entry/app.CSVt0Fuk.js.br +0 -0
  352. package/build/client/_app/immutable/entry/app.CSVt0Fuk.js.gz +0 -0
  353. package/build/client/_app/immutable/entry/start.BQnEMq3G.js +0 -1
  354. package/build/client/_app/immutable/entry/start.BQnEMq3G.js.br +0 -2
  355. package/build/client/_app/immutable/entry/start.BQnEMq3G.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/0.BFGm6g4L.js +0 -1
  357. package/build/client/_app/immutable/nodes/0.BFGm6g4L.js.br +0 -0
  358. package/build/client/_app/immutable/nodes/0.BFGm6g4L.js.gz +0 -0
  359. package/build/client/_app/immutable/nodes/1.B_l4Mw8E.js +0 -1
  360. package/build/client/_app/immutable/nodes/1.B_l4Mw8E.js.br +0 -0
  361. package/build/client/_app/immutable/nodes/1.B_l4Mw8E.js.gz +0 -0
  362. package/build/client/_app/immutable/nodes/10.Bdd6Le3Q.js +0 -1
  363. package/build/client/_app/immutable/nodes/10.Bdd6Le3Q.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/10.Bdd6Le3Q.js.gz +0 -0
  365. package/build/client/_app/immutable/nodes/2.DPpr5BK7.js +0 -3
  366. package/build/client/_app/immutable/nodes/2.DPpr5BK7.js.br +0 -0
  367. package/build/client/_app/immutable/nodes/2.DPpr5BK7.js.gz +0 -0
  368. package/build/client/_app/immutable/nodes/4.BokOq116.js +0 -12
  369. package/build/client/_app/immutable/nodes/4.BokOq116.js.br +0 -0
  370. package/build/client/_app/immutable/nodes/4.BokOq116.js.gz +0 -0
  371. package/build/client/_app/immutable/nodes/5.BqyMuHwQ.js +0 -1
  372. package/build/client/_app/immutable/nodes/5.BqyMuHwQ.js.br +0 -0
  373. package/build/client/_app/immutable/nodes/5.BqyMuHwQ.js.gz +0 -0
  374. package/build/client/_app/immutable/nodes/6.7qo5WmXj.js +0 -38
  375. package/build/client/_app/immutable/nodes/6.7qo5WmXj.js.br +0 -0
  376. package/build/client/_app/immutable/nodes/6.7qo5WmXj.js.gz +0 -0
  377. package/build/client/_app/immutable/nodes/7.CvDadi99.js +0 -1
  378. package/build/client/_app/immutable/nodes/7.CvDadi99.js.br +0 -0
  379. package/build/client/_app/immutable/nodes/7.CvDadi99.js.gz +0 -0
  380. package/build/client/_app/immutable/nodes/8.CLZUC68b.js +0 -1
  381. package/build/client/_app/immutable/nodes/8.CLZUC68b.js.br +0 -0
  382. package/build/client/_app/immutable/nodes/8.CLZUC68b.js.gz +0 -0
  383. package/build/client/_app/immutable/nodes/9.BCC-2Any.js +0 -1
  384. package/build/client/_app/immutable/nodes/9.BCC-2Any.js.br +0 -0
  385. package/build/client/_app/immutable/nodes/9.BCC-2Any.js.gz +0 -0
  386. package/build/server/chunks/0-DMd6Dk79.js +0 -9
  387. package/build/server/chunks/0-DMd6Dk79.js.map +0 -1
  388. package/build/server/chunks/1-Cwk3hpe9.js +0 -9
  389. package/build/server/chunks/10-Ci_AhluU.js +0 -9
  390. package/build/server/chunks/10-Ci_AhluU.js.map +0 -1
  391. package/build/server/chunks/2-BLxdw-8l.js +0 -9
  392. package/build/server/chunks/2-BLxdw-8l.js.map +0 -1
  393. package/build/server/chunks/3-DGFu_uy6.js +0 -19
  394. package/build/server/chunks/3-DGFu_uy6.js.map +0 -1
  395. package/build/server/chunks/4-MwbWFUCO.js +0 -22
  396. package/build/server/chunks/4-MwbWFUCO.js.map +0 -1
  397. package/build/server/chunks/5-p3BDfNc2.js.map +0 -1
  398. package/build/server/chunks/6-CK3NUjnH.js +0 -9
  399. package/build/server/chunks/6-CK3NUjnH.js.map +0 -1
  400. package/build/server/chunks/7-C_AGqUAU.js.map +0 -1
  401. package/build/server/chunks/8-Dr1vf8BH.js +0 -9
  402. package/build/server/chunks/8-Dr1vf8BH.js.map +0 -1
  403. package/build/server/chunks/9-DAsQ5XZx.js +0 -9
  404. package/build/server/chunks/9-DAsQ5XZx.js.map +0 -1
  405. package/build/server/chunks/AgentDropdown-C3XtwkaV.js +0 -162
  406. package/build/server/chunks/AgentDropdown-C3XtwkaV.js.map +0 -1
  407. package/build/server/chunks/Dropdown-B-UCol1v.js.map +0 -1
  408. package/build/server/chunks/Icon-DDJ9D6Sq.js.map +0 -1
  409. package/build/server/chunks/Input-DLAEH36y.js.map +0 -1
  410. package/build/server/chunks/Panel-KZDoG3_L.js.map +0 -1
  411. package/build/server/chunks/_layout.svelte-22nlfSFq.js +0 -9
  412. package/build/server/chunks/_layout.svelte-22nlfSFq.js.map +0 -1
  413. package/build/server/chunks/_layout.svelte-BoAJDYC1.js.map +0 -1
  414. package/build/server/chunks/_page.svelte-CNhxx79k.js.map +0 -1
  415. package/build/server/chunks/_page.svelte-Cc0DAAQW.js.map +0 -1
  416. package/build/server/chunks/_page.svelte-CdEfc0bc.js.map +0 -1
  417. package/build/server/chunks/_page.svelte-DQUdiD4S.js.map +0 -1
  418. package/build/server/chunks/_page.svelte-kLLxi8vG.js.map +0 -1
  419. package/build/server/chunks/_page.svelte-nsIWq28L.js.map +0 -1
  420. package/build/server/chunks/_server.ts-BBxm_xV1.js.map +0 -1
  421. package/build/server/chunks/_server.ts-BIcKE9RQ.js.map +0 -1
  422. package/build/server/chunks/_server.ts-BYDdbqNr.js.map +0 -1
  423. package/build/server/chunks/_server.ts-BmZBSYvJ.js.map +0 -1
  424. package/build/server/chunks/_server.ts-CLKPeFqF.js.map +0 -1
  425. package/build/server/chunks/_server.ts-DEHw6op6.js.map +0 -1
  426. package/build/server/chunks/_server.ts-DTyPQO2I.js +0 -93
  427. package/build/server/chunks/_server.ts-DTyPQO2I.js.map +0 -1
  428. package/build/server/chunks/_server.ts-d0Tii8aZ.js.map +0 -1
  429. package/build/server/chunks/client-DpkplAAP.js +0 -25
  430. package/build/server/chunks/client-DpkplAAP.js.map +0 -1
  431. package/build/server/chunks/client2-tp0-IQU0.js.map +0 -1
  432. package/build/server/chunks/context-DVQH5kJk.js +0 -113
  433. package/build/server/chunks/context-DVQH5kJk.js.map +0 -1
  434. package/build/server/chunks/data-CbXDDeDB.js.map +0 -1
  435. package/build/server/chunks/error.svelte-DNcHZkvg.js +0 -29
  436. package/build/server/chunks/error.svelte-DNcHZkvg.js.map +0 -1
  437. package/build/server/chunks/events-A18hGvKp.js.map +0 -1
  438. package/build/server/chunks/index-BoStl4QO.js.map +0 -1
  439. package/build/server/chunks/index2-CVBATI2G.js.map +0 -1
  440. package/build/server/chunks/state.svelte-Dze7OxC_.js.map +0 -1
@@ -1,9 +1,48 @@
1
- import { k as set_ssr_context, j as ssr_context, p as push$1, l as pop$1, m as safe_equals, o as object_prototype, q as array_prototype, r as get_descriptor, t as is_extensible, u as equals, v as get_prototype_of, i as is_array, w as deferred, x as run_all, e as escape_html, d as define_property, y as index_of, n as noop } from './context-DVQH5kJk.js';
2
-
3
- const DEV = false;
4
-
5
- function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx$1(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
1
+ const BROWSER = false;
6
2
 
3
+ var is_array = Array.isArray;
4
+ var index_of = Array.prototype.indexOf;
5
+ var array_from = Array.from;
6
+ var define_property = Object.defineProperty;
7
+ var get_descriptor = Object.getOwnPropertyDescriptor;
8
+ var object_prototype = Object.prototype;
9
+ var array_prototype = Array.prototype;
10
+ var get_prototype_of = Object.getPrototypeOf;
11
+ var is_extensible = Object.isExtensible;
12
+ const noop = () => {
13
+ };
14
+ function run_all(arr) {
15
+ for (var i = 0; i < arr.length; i++) {
16
+ arr[i]();
17
+ }
18
+ }
19
+ function deferred() {
20
+ var resolve;
21
+ var reject;
22
+ var promise = new Promise((res, rej) => {
23
+ resolve = res;
24
+ reject = rej;
25
+ });
26
+ return { promise, resolve, reject };
27
+ }
28
+ function fallback(value, fallback2, lazy = false) {
29
+ return value === void 0 ? lazy ? (
30
+ /** @type {() => V} */
31
+ fallback2()
32
+ ) : (
33
+ /** @type {V} */
34
+ fallback2
35
+ ) : value;
36
+ }
37
+ function equals(value) {
38
+ return value === this.v;
39
+ }
40
+ function safe_not_equal(a, b) {
41
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
42
+ }
43
+ function safe_equals(value) {
44
+ return !safe_not_equal(value, this.v);
45
+ }
7
46
  const DERIVED = 1 << 1;
8
47
  const EFFECT = 1 << 2;
9
48
  const RENDER_EFFECT = 1 << 3;
@@ -11,6 +50,7 @@ const BLOCK_EFFECT = 1 << 4;
11
50
  const BRANCH_EFFECT = 1 << 5;
12
51
  const ROOT_EFFECT = 1 << 6;
13
52
  const BOUNDARY_EFFECT = 1 << 7;
53
+ const CONNECTED = 1 << 9;
14
54
  const CLEAN = 1 << 10;
15
55
  const DIRTY = 1 << 11;
16
56
  const MAYBE_DIRTY = 1 << 12;
@@ -18,12 +58,10 @@ const INERT = 1 << 13;
18
58
  const DESTROYED = 1 << 14;
19
59
  const EFFECT_RAN = 1 << 15;
20
60
  const EFFECT_TRANSPARENT = 1 << 16;
21
- const INSPECT_EFFECT = 1 << 17;
61
+ const EAGER_EFFECT = 1 << 17;
22
62
  const HEAD_EFFECT = 1 << 18;
23
63
  const EFFECT_PRESERVED = 1 << 19;
24
64
  const USER_EFFECT = 1 << 20;
25
- const UNOWNED = 1 << 8;
26
- const DISCONNECTED = 1 << 9;
27
65
  const WAS_MARKED = 1 << 15;
28
66
  const REACTION_IS_UPDATING = 1 << 21;
29
67
  const ASYNC = 1 << 22;
@@ -35,6 +73,11 @@ const STALE_REACTION = new class StaleReactionError extends Error {
35
73
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
36
74
  }();
37
75
  const COMMENT_NODE = 8;
76
+ function lifecycle_outside_component(name) {
77
+ {
78
+ throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
79
+ }
80
+ }
38
81
  function effect_update_depth_exceeded() {
39
82
  {
40
83
  throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
@@ -78,9 +121,10 @@ let component_context = null;
78
121
  function set_component_context(context) {
79
122
  component_context = context;
80
123
  }
81
- function push(props, runes = false, fn) {
124
+ function push$1(props, runes = false, fn) {
82
125
  component_context = {
83
126
  p: component_context,
127
+ i: false,
84
128
  c: null,
85
129
  e: null,
86
130
  s: props,
@@ -88,7 +132,7 @@ function push(props, runes = false, fn) {
88
132
  l: null
89
133
  };
90
134
  }
91
- function pop(component) {
135
+ function pop$1(component) {
92
136
  var context = (
93
137
  /** @type {ComponentContext} */
94
138
  component_context
@@ -100,6 +144,7 @@ function pop(component) {
100
144
  create_user_effect(fn);
101
145
  }
102
146
  }
147
+ context.i = true;
103
148
  component_context = context.p;
104
149
  return (
105
150
  /** @type {T} */
@@ -129,7 +174,6 @@ function flush_tasks() {
129
174
  run_micro_tasks();
130
175
  }
131
176
  }
132
- const adjustments = /* @__PURE__ */ new WeakMap();
133
177
  function handle_error(error) {
134
178
  var effect = active_effect;
135
179
  if (effect === null) {
@@ -138,9 +182,6 @@ function handle_error(error) {
138
182
  }
139
183
  if ((effect.f & EFFECT_RAN) === 0) {
140
184
  if ((effect.f & BOUNDARY_EFFECT) === 0) {
141
- if (!effect.parent && error instanceof Error) {
142
- apply_adjustments(error);
143
- }
144
185
  throw error;
145
186
  }
146
187
  effect.b.error(error);
@@ -160,26 +201,11 @@ function invoke_error_boundary(error, effect) {
160
201
  }
161
202
  effect = effect.parent;
162
203
  }
163
- if (error instanceof Error) {
164
- apply_adjustments(error);
165
- }
166
204
  throw error;
167
205
  }
168
- function apply_adjustments(error) {
169
- const adjusted = adjustments.get(error);
170
- if (adjusted) {
171
- define_property(error, "message", {
172
- value: adjusted.message
173
- });
174
- define_property(error, "stack", {
175
- value: adjusted.stack
176
- });
177
- }
178
- }
179
206
  const batches = /* @__PURE__ */ new Set();
180
207
  let current_batch = null;
181
208
  let batch_values = null;
182
- let effect_pending_updates = /* @__PURE__ */ new Set();
183
209
  let queued_root_effects = [];
184
210
  let last_scheduled_effect = null;
185
211
  let is_flushing = false;
@@ -197,13 +223,18 @@ class Batch {
197
223
  * They keys of this map are identical to `this.#current`
198
224
  * @type {Map<Source, any>}
199
225
  */
200
- #previous = /* @__PURE__ */ new Map();
226
+ previous = /* @__PURE__ */ new Map();
201
227
  /**
202
228
  * When the batch is committed (and the DOM is updated), we need to remove old branches
203
229
  * and append new ones by calling the functions added inside (if/each/key/etc) blocks
204
230
  * @type {Set<() => void>}
205
231
  */
206
- #callbacks = /* @__PURE__ */ new Set();
232
+ #commit_callbacks = /* @__PURE__ */ new Set();
233
+ /**
234
+ * If a fork is discarded, we need to destroy any effects that are no longer needed
235
+ * @type {Set<(batch: Batch) => void>}
236
+ */
237
+ #discard_callbacks = /* @__PURE__ */ new Set();
207
238
  /**
208
239
  * The number of async effects that are currently in flight
209
240
  */
@@ -234,6 +265,7 @@ class Batch {
234
265
  * @type {Set<Effect>}
235
266
  */
236
267
  skipped_effects = /* @__PURE__ */ new Set();
268
+ is_fork = false;
237
269
  /**
238
270
  *
239
271
  * @param {Effect[]} root_effects
@@ -251,8 +283,10 @@ class Batch {
251
283
  for (const root of root_effects) {
252
284
  this.#traverse_effect_tree(root, target);
253
285
  }
254
- this.#resolve();
255
- if (this.#blocking_pending > 0) {
286
+ if (!this.is_fork) {
287
+ this.#resolve();
288
+ }
289
+ if (this.#blocking_pending > 0 || this.is_fork) {
256
290
  this.#defer_effects(target.effects);
257
291
  this.#defer_effects(target.render_effects);
258
292
  this.#defer_effects(target.block_effects);
@@ -260,6 +294,7 @@ class Batch {
260
294
  current_batch = null;
261
295
  flush_queued_effects(target.render_effects);
262
296
  flush_queued_effects(target.effects);
297
+ this.#deferred?.resolve();
263
298
  }
264
299
  batch_values = null;
265
300
  }
@@ -333,42 +368,42 @@ class Batch {
333
368
  * @param {any} value
334
369
  */
335
370
  capture(source2, value) {
336
- if (!this.#previous.has(source2)) {
337
- this.#previous.set(source2, value);
371
+ if (!this.previous.has(source2)) {
372
+ this.previous.set(source2, value);
373
+ }
374
+ if ((source2.f & ERROR_VALUE) === 0) {
375
+ this.current.set(source2, source2.v);
376
+ batch_values?.set(source2, source2.v);
338
377
  }
339
- this.current.set(source2, source2.v);
340
- batch_values?.set(source2, source2.v);
341
378
  }
342
379
  activate() {
343
380
  current_batch = this;
381
+ this.apply();
344
382
  }
345
383
  deactivate() {
346
384
  current_batch = null;
347
385
  batch_values = null;
348
386
  }
349
387
  flush() {
388
+ this.activate();
350
389
  if (queued_root_effects.length > 0) {
351
- this.activate();
352
390
  flush_effects();
353
391
  if (current_batch !== null && current_batch !== this) {
354
392
  return;
355
393
  }
356
- } else {
357
- this.#resolve();
394
+ } else if (this.#pending === 0) {
395
+ this.process([]);
358
396
  }
359
397
  this.deactivate();
360
- for (const update of effect_pending_updates) {
361
- effect_pending_updates.delete(update);
362
- update();
363
- if (current_batch !== null) {
364
- break;
365
- }
366
- }
398
+ }
399
+ discard() {
400
+ for (const fn of this.#discard_callbacks) fn(this);
401
+ this.#discard_callbacks.clear();
367
402
  }
368
403
  #resolve() {
369
404
  if (this.#blocking_pending === 0) {
370
- for (const fn of this.#callbacks) fn();
371
- this.#callbacks.clear();
405
+ for (const fn of this.#commit_callbacks) fn();
406
+ this.#commit_callbacks.clear();
372
407
  }
373
408
  if (this.#pending === 0) {
374
409
  this.#commit();
@@ -376,7 +411,7 @@ class Batch {
376
411
  }
377
412
  #commit() {
378
413
  if (batches.size > 1) {
379
- this.#previous.clear();
414
+ this.previous.clear();
380
415
  var previous_batch_values = batch_values;
381
416
  var is_earlier = true;
382
417
  var dummy_target = {
@@ -428,7 +463,6 @@ class Batch {
428
463
  }
429
464
  this.committed = true;
430
465
  batches.delete(this);
431
- this.#deferred?.resolve();
432
466
  }
433
467
  /**
434
468
  *
@@ -445,6 +479,9 @@ class Batch {
445
479
  decrement(blocking) {
446
480
  this.#pending -= 1;
447
481
  if (blocking) this.#blocking_pending -= 1;
482
+ this.revive();
483
+ }
484
+ revive() {
448
485
  for (const e of this.#dirty_effects) {
449
486
  set_signal_status(e, DIRTY);
450
487
  schedule_effect(e);
@@ -458,8 +495,12 @@ class Batch {
458
495
  this.flush();
459
496
  }
460
497
  /** @param {() => void} fn */
461
- add_callback(fn) {
462
- this.#callbacks.add(fn);
498
+ oncommit(fn) {
499
+ this.#commit_callbacks.add(fn);
500
+ }
501
+ /** @param {(batch: Batch) => void} fn */
502
+ ondiscard(fn) {
503
+ this.#discard_callbacks.add(fn);
463
504
  }
464
505
  settled() {
465
506
  return (this.#deferred ??= deferred()).promise;
@@ -521,7 +562,7 @@ function flush_effects() {
521
562
  var batch = Batch.ensure();
522
563
  if (flush_count++ > 1e3) {
523
564
  var updates, entry;
524
- if (DEV) ;
565
+ if (BROWSER) ;
525
566
  infinite_loop_guard();
526
567
  }
527
568
  batch.process(queued_root_effects);
@@ -638,7 +679,7 @@ function schedule_effect(signal) {
638
679
  while (effect.parent !== null) {
639
680
  effect = effect.parent;
640
681
  var flags = effect.f;
641
- if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) {
682
+ if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0 && (flags & HEAD_EFFECT) === 0) {
642
683
  return;
643
684
  }
644
685
  if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
@@ -648,10 +689,10 @@ function schedule_effect(signal) {
648
689
  }
649
690
  queued_root_effects.push(effect);
650
691
  }
651
- function destroy_derived_effects(derived2) {
652
- var effects = derived2.effects;
692
+ function destroy_derived_effects(derived) {
693
+ var effects = derived.effects;
653
694
  if (effects !== null) {
654
- derived2.effects = null;
695
+ derived.effects = null;
655
696
  for (var i = 0; i < effects.length; i += 1) {
656
697
  destroy_effect(
657
698
  /** @type {Effect} */
@@ -660,8 +701,8 @@ function destroy_derived_effects(derived2) {
660
701
  }
661
702
  }
662
703
  }
663
- function get_derived_parent_effect(derived2) {
664
- var parent = derived2.parent;
704
+ function get_derived_parent_effect(derived) {
705
+ var parent = derived.parent;
665
706
  while (parent !== null) {
666
707
  if ((parent.f & DERIVED) === 0) {
667
708
  return (
@@ -673,38 +714,42 @@ function get_derived_parent_effect(derived2) {
673
714
  }
674
715
  return null;
675
716
  }
676
- function execute_derived(derived2) {
717
+ function execute_derived(derived) {
677
718
  var value;
678
719
  var prev_active_effect = active_effect;
679
- set_active_effect(get_derived_parent_effect(derived2));
720
+ set_active_effect(get_derived_parent_effect(derived));
680
721
  {
681
722
  try {
682
- derived2.f &= ~WAS_MARKED;
683
- destroy_derived_effects(derived2);
684
- value = update_reaction(derived2);
723
+ derived.f &= ~WAS_MARKED;
724
+ destroy_derived_effects(derived);
725
+ value = update_reaction(derived);
685
726
  } finally {
686
727
  set_active_effect(prev_active_effect);
687
728
  }
688
729
  }
689
730
  return value;
690
731
  }
691
- function update_derived(derived2) {
692
- var value = execute_derived(derived2);
693
- if (!derived2.equals(value)) {
694
- derived2.v = value;
695
- derived2.wv = increment_write_version();
732
+ function update_derived(derived) {
733
+ var value = execute_derived(derived);
734
+ if (!derived.equals(value)) {
735
+ derived.v = value;
736
+ derived.wv = increment_write_version();
696
737
  }
697
738
  if (is_destroying_effect) {
698
739
  return;
699
740
  }
700
741
  if (batch_values !== null) {
701
- batch_values.set(derived2, derived2.v);
742
+ if (effect_tracking()) {
743
+ batch_values.set(derived, derived.v);
744
+ }
702
745
  } else {
703
- var status = (skip_reaction || (derived2.f & UNOWNED) !== 0) && derived2.deps !== null ? MAYBE_DIRTY : CLEAN;
704
- set_signal_status(derived2, status);
746
+ var status = (derived.f & CONNECTED) === 0 ? MAYBE_DIRTY : CLEAN;
747
+ set_signal_status(derived, status);
705
748
  }
706
749
  }
750
+ let eager_effects = /* @__PURE__ */ new Set();
707
751
  const old_values = /* @__PURE__ */ new Map();
752
+ let eager_effects_deferred = false;
708
753
  function source(v, stack) {
709
754
  var signal = {
710
755
  f: 0,
@@ -734,7 +779,7 @@ function mutable_source(initial_value, immutable = false, trackable = true) {
734
779
  function set(source2, value, should_proxy = false) {
735
780
  if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
736
781
  // to ensure we error if state is set inside an inspect effect
737
- (!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 && !current_sources?.includes(source2)) {
782
+ (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && !current_sources?.includes(source2)) {
738
783
  state_unsafe_mutation();
739
784
  }
740
785
  let new_value = should_proxy ? proxy(value) : value;
@@ -758,7 +803,7 @@ function internal_set(source2, value) {
758
803
  source2
759
804
  );
760
805
  }
761
- set_signal_status(source2, (source2.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY);
806
+ set_signal_status(source2, (source2.f & CONNECTED) !== 0 ? CLEAN : MAYBE_DIRTY);
762
807
  }
763
808
  source2.wv = increment_write_version();
764
809
  mark_reactions(source2, DIRTY);
@@ -769,9 +814,25 @@ function internal_set(source2, value) {
769
814
  untracked_writes.push(source2);
770
815
  }
771
816
  }
817
+ if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
818
+ flush_eager_effects();
819
+ }
772
820
  }
773
821
  return value;
774
822
  }
823
+ function flush_eager_effects() {
824
+ eager_effects_deferred = false;
825
+ const inspects = Array.from(eager_effects);
826
+ for (const effect of inspects) {
827
+ if ((effect.f & CLEAN) !== 0) {
828
+ set_signal_status(effect, MAYBE_DIRTY);
829
+ }
830
+ if (is_dirty(effect)) {
831
+ update_effect(effect);
832
+ }
833
+ }
834
+ eager_effects.clear();
835
+ }
775
836
  function increment(source2) {
776
837
  set(source2, source2.v + 1);
777
838
  }
@@ -787,13 +848,16 @@ function mark_reactions(signal, status) {
787
848
  set_signal_status(reaction, status);
788
849
  }
789
850
  if ((flags & DERIVED) !== 0) {
851
+ var derived = (
852
+ /** @type {Derived} */
853
+ reaction
854
+ );
855
+ batch_values?.delete(derived);
790
856
  if ((flags & WAS_MARKED) === 0) {
791
- reaction.f |= WAS_MARKED;
792
- mark_reactions(
793
- /** @type {Derived} */
794
- reaction,
795
- MAYBE_DIRTY
796
- );
857
+ if (flags & CONNECTED) {
858
+ reaction.f |= WAS_MARKED;
859
+ }
860
+ mark_reactions(derived, MAYBE_DIRTY);
797
861
  }
798
862
  } else if (not_dirty) {
799
863
  if ((flags & BLOCK_EFFECT) !== 0) {
@@ -1071,7 +1135,7 @@ function create_effect(type, fn, sync, push2 = true) {
1071
1135
  deps: null,
1072
1136
  nodes_start: null,
1073
1137
  nodes_end: null,
1074
- f: type | DIRTY,
1138
+ f: type | DIRTY | CONNECTED,
1075
1139
  first: null,
1076
1140
  fn,
1077
1141
  last: null,
@@ -1110,11 +1174,11 @@ function create_effect(type, fn, sync, push2 = true) {
1110
1174
  push_effect(e, parent);
1111
1175
  }
1112
1176
  if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
1113
- var derived2 = (
1177
+ var derived = (
1114
1178
  /** @type {Derived} */
1115
1179
  active_reaction
1116
1180
  );
1117
- (derived2.effects ??= []).push(e);
1181
+ (derived.effects ??= []).push(e);
1118
1182
  }
1119
1183
  }
1120
1184
  }
@@ -1172,10 +1236,10 @@ function destroy_effect_children(signal, remove_dom = false) {
1172
1236
  var effect = signal.first;
1173
1237
  signal.first = signal.last = null;
1174
1238
  while (effect !== null) {
1175
- const controller2 = effect.ac;
1176
- if (controller2 !== null) {
1239
+ const controller = effect.ac;
1240
+ if (controller !== null) {
1177
1241
  without_reactive_context(() => {
1178
- controller2.abort(STALE_REACTION);
1242
+ controller.abort(STALE_REACTION);
1179
1243
  });
1180
1244
  }
1181
1245
  var next = effect.next;
@@ -1335,7 +1399,6 @@ let update_version = read_version;
1335
1399
  function set_update_version(value) {
1336
1400
  update_version = value;
1337
1401
  }
1338
- let skip_reaction = false;
1339
1402
  function increment_write_version() {
1340
1403
  return ++write_version;
1341
1404
  }
@@ -1344,39 +1407,15 @@ function is_dirty(reaction) {
1344
1407
  if ((flags & DIRTY) !== 0) {
1345
1408
  return true;
1346
1409
  }
1410
+ if (flags & DERIVED) {
1411
+ reaction.f &= ~WAS_MARKED;
1412
+ }
1347
1413
  if ((flags & MAYBE_DIRTY) !== 0) {
1348
1414
  var dependencies = reaction.deps;
1349
- var is_unowned = (flags & UNOWNED) !== 0;
1350
- if (flags & DERIVED) {
1351
- reaction.f &= ~WAS_MARKED;
1352
- }
1353
1415
  if (dependencies !== null) {
1354
- var i;
1355
- var dependency;
1356
- var is_disconnected = (flags & DISCONNECTED) !== 0;
1357
- var is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;
1358
1416
  var length = dependencies.length;
1359
- if ((is_disconnected || is_unowned_connected) && (active_effect === null || (active_effect.f & DESTROYED) === 0)) {
1360
- var derived2 = (
1361
- /** @type {Derived} */
1362
- reaction
1363
- );
1364
- var parent = derived2.parent;
1365
- for (i = 0; i < length; i++) {
1366
- dependency = dependencies[i];
1367
- if (is_disconnected || !dependency?.reactions?.includes(derived2)) {
1368
- (dependency.reactions ??= []).push(derived2);
1369
- }
1370
- }
1371
- if (is_disconnected) {
1372
- derived2.f ^= DISCONNECTED;
1373
- }
1374
- if (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) {
1375
- derived2.f ^= UNOWNED;
1376
- }
1377
- }
1378
- for (i = 0; i < length; i++) {
1379
- dependency = dependencies[i];
1417
+ for (var i = 0; i < length; i++) {
1418
+ var dependency = dependencies[i];
1380
1419
  if (is_dirty(
1381
1420
  /** @type {Derived} */
1382
1421
  dependency
@@ -1391,7 +1430,9 @@ function is_dirty(reaction) {
1391
1430
  }
1392
1431
  }
1393
1432
  }
1394
- if (!is_unowned || active_effect !== null && !skip_reaction) {
1433
+ if ((flags & CONNECTED) !== 0 && // During time traveling we don't want to reset the status so that
1434
+ // traversal of the graph in the other batches still happens
1435
+ batch_values === null) {
1395
1436
  set_signal_status(reaction, CLEAN);
1396
1437
  }
1397
1438
  }
@@ -1430,7 +1471,6 @@ function update_reaction(reaction) {
1430
1471
  var previous_skipped_deps = skipped_deps;
1431
1472
  var previous_untracked_writes = untracked_writes;
1432
1473
  var previous_reaction = active_reaction;
1433
- var previous_skip_reaction = skip_reaction;
1434
1474
  var previous_sources = current_sources;
1435
1475
  var previous_component_context = component_context;
1436
1476
  var previous_untracking = untracking;
@@ -1440,7 +1480,6 @@ function update_reaction(reaction) {
1440
1480
  null;
1441
1481
  skipped_deps = 0;
1442
1482
  untracked_writes = null;
1443
- skip_reaction = (flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);
1444
1483
  active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
1445
1484
  current_sources = null;
1446
1485
  set_component_context(reaction.ctx);
@@ -1471,9 +1510,7 @@ function update_reaction(reaction) {
1471
1510
  } else {
1472
1511
  reaction.deps = deps = new_deps;
1473
1512
  }
1474
- if (!skip_reaction || // Deriveds that already have reactions can cleanup, so we still add them as reactions
1475
- (flags & DERIVED) !== 0 && /** @type {import('#client').Derived} */
1476
- reaction.reactions !== null) {
1513
+ if (is_updating_effect && effect_tracking() && (reaction.f & CONNECTED) !== 0) {
1477
1514
  for (i = skipped_deps; i < deps.length; i++) {
1478
1515
  (deps[i].reactions ??= []).push(reaction);
1479
1516
  }
@@ -1515,7 +1552,6 @@ function update_reaction(reaction) {
1515
1552
  skipped_deps = previous_skipped_deps;
1516
1553
  untracked_writes = previous_untracked_writes;
1517
1554
  active_reaction = previous_reaction;
1518
- skip_reaction = previous_skip_reaction;
1519
1555
  current_sources = previous_sources;
1520
1556
  set_component_context(previous_component_context);
1521
1557
  untracking = previous_untracking;
@@ -1541,8 +1577,9 @@ function remove_reaction(signal, dependency) {
1541
1577
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1542
1578
  (new_deps === null || !new_deps.includes(dependency))) {
1543
1579
  set_signal_status(dependency, MAYBE_DIRTY);
1544
- if ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) {
1545
- dependency.f ^= DISCONNECTED;
1580
+ if ((dependency.f & CONNECTED) !== 0) {
1581
+ dependency.f ^= CONNECTED;
1582
+ dependency.f &= ~WAS_MARKED;
1546
1583
  }
1547
1584
  destroy_derived_effects(
1548
1585
  /** @type {Derived} **/
@@ -1583,7 +1620,7 @@ function update_effect(effect) {
1583
1620
  effect.teardown = typeof teardown === "function" ? teardown : null;
1584
1621
  effect.wv = write_version;
1585
1622
  var dep;
1586
- if (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
1623
+ if (BROWSER && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
1587
1624
  } finally {
1588
1625
  is_updating_effect = was_updating_effect;
1589
1626
  active_effect = previous_effect;
@@ -1603,7 +1640,7 @@ function get(signal) {
1603
1640
  skipped_deps++;
1604
1641
  } else if (new_deps === null) {
1605
1642
  new_deps = [signal];
1606
- } else if (!skip_reaction || !new_deps.includes(signal)) {
1643
+ } else if (!new_deps.includes(signal)) {
1607
1644
  new_deps.push(signal);
1608
1645
  }
1609
1646
  }
@@ -1617,43 +1654,36 @@ function get(signal) {
1617
1654
  }
1618
1655
  }
1619
1656
  }
1620
- } else if (is_derived && /** @type {Derived} */
1621
- signal.deps === null && /** @type {Derived} */
1622
- signal.effects === null) {
1623
- var derived2 = (
1624
- /** @type {Derived} */
1625
- signal
1626
- );
1627
- var parent = derived2.parent;
1628
- if (parent !== null && (parent.f & UNOWNED) === 0) {
1629
- derived2.f ^= UNOWNED;
1630
- }
1631
1657
  }
1632
1658
  if (is_destroying_effect) {
1633
1659
  if (old_values.has(signal)) {
1634
1660
  return old_values.get(signal);
1635
1661
  }
1636
1662
  if (is_derived) {
1637
- derived2 = /** @type {Derived} */
1638
- signal;
1639
- var value = derived2.v;
1640
- if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) {
1641
- value = execute_derived(derived2);
1663
+ var derived = (
1664
+ /** @type {Derived} */
1665
+ signal
1666
+ );
1667
+ var value = derived.v;
1668
+ if ((derived.f & CLEAN) === 0 && derived.reactions !== null || depends_on_old_values(derived)) {
1669
+ value = execute_derived(derived);
1642
1670
  }
1643
- old_values.set(derived2, value);
1671
+ old_values.set(derived, value);
1644
1672
  return value;
1645
1673
  }
1646
1674
  } else if (is_derived) {
1647
- derived2 = /** @type {Derived} */
1675
+ derived = /** @type {Derived} */
1648
1676
  signal;
1649
- if (batch_values?.has(derived2)) {
1650
- return batch_values.get(derived2);
1677
+ if (batch_values?.has(derived)) {
1678
+ return batch_values.get(derived);
1651
1679
  }
1652
- if (is_dirty(derived2)) {
1653
- update_derived(derived2);
1680
+ if (is_dirty(derived)) {
1681
+ update_derived(derived);
1654
1682
  }
1655
- }
1656
- if (batch_values?.has(signal)) {
1683
+ if (is_updating_effect && effect_tracking() && (derived.f & CONNECTED) === 0) {
1684
+ reconnect(derived);
1685
+ }
1686
+ } else if (batch_values?.has(signal)) {
1657
1687
  return batch_values.get(signal);
1658
1688
  }
1659
1689
  if ((signal.f & ERROR_VALUE) !== 0) {
@@ -1661,10 +1691,23 @@ function get(signal) {
1661
1691
  }
1662
1692
  return signal.v;
1663
1693
  }
1664
- function depends_on_old_values(derived2) {
1665
- if (derived2.v === UNINITIALIZED) return true;
1666
- if (derived2.deps === null) return false;
1667
- for (const dep of derived2.deps) {
1694
+ function reconnect(derived) {
1695
+ if (derived.deps === null) return;
1696
+ derived.f ^= CONNECTED;
1697
+ for (const dep of derived.deps) {
1698
+ (dep.reactions ??= []).push(derived);
1699
+ if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
1700
+ reconnect(
1701
+ /** @type {Derived} */
1702
+ dep
1703
+ );
1704
+ }
1705
+ }
1706
+ }
1707
+ function depends_on_old_values(derived) {
1708
+ if (derived.v === UNINITIALIZED) return true;
1709
+ if (derived.deps === null) return false;
1710
+ for (const dep of derived.deps) {
1668
1711
  if (old_values.has(dep)) {
1669
1712
  return true;
1670
1713
  }
@@ -1690,183 +1733,21 @@ const STATUS_MASK = -7169;
1690
1733
  function set_signal_status(signal, status) {
1691
1734
  signal.f = signal.f & STATUS_MASK | status;
1692
1735
  }
1693
- const DOM_BOOLEAN_ATTRIBUTES = [
1694
- "allowfullscreen",
1695
- "async",
1696
- "autofocus",
1697
- "autoplay",
1698
- "checked",
1699
- "controls",
1700
- "default",
1701
- "disabled",
1702
- "formnovalidate",
1703
- "indeterminate",
1704
- "inert",
1705
- "ismap",
1706
- "loop",
1707
- "multiple",
1708
- "muted",
1709
- "nomodule",
1710
- "novalidate",
1711
- "open",
1712
- "playsinline",
1713
- "readonly",
1714
- "required",
1715
- "reversed",
1716
- "seamless",
1717
- "selected",
1718
- "webkitdirectory",
1719
- "defer",
1720
- "disablepictureinpicture",
1721
- "disableremoteplayback"
1722
- ];
1723
- function is_boolean_attribute(name) {
1724
- return DOM_BOOLEAN_ATTRIBUTES.includes(name);
1725
- }
1726
- const PASSIVE_EVENTS = ["touchstart", "touchmove"];
1727
- function is_passive_event(name) {
1728
- return PASSIVE_EVENTS.includes(name);
1729
- }
1730
- const replacements = {
1731
- translate: /* @__PURE__ */ new Map([
1732
- [true, "yes"],
1733
- [false, "no"]
1734
- ])
1735
- };
1736
- function attr(name, value, is_boolean = false) {
1737
- if (name === "hidden" && value !== "until-found") {
1738
- is_boolean = true;
1739
- }
1740
- if (value == null || !value && is_boolean) return "";
1741
- const normalized = name in replacements && replacements[name].get(value) || value;
1742
- const assignment = is_boolean ? "" : `="${escape_html(normalized, true)}"`;
1743
- return ` ${name}${assignment}`;
1744
- }
1745
- function clsx(value) {
1746
- if (typeof value === "object") {
1747
- return clsx$1(value);
1748
- } else {
1749
- return value ?? "";
1750
- }
1751
- }
1752
- const whitespace = [..." \n\r\f \v\uFEFF"];
1753
- function to_class(value, hash, directives) {
1754
- var classname = value == null ? "" : "" + value;
1755
- if (hash) {
1756
- classname = classname ? classname + " " + hash : hash;
1757
- }
1758
- if (directives) {
1759
- for (var key in directives) {
1760
- if (directives[key]) {
1761
- classname = classname ? classname + " " + key : key;
1762
- } else if (classname.length) {
1763
- var len = key.length;
1764
- var a = 0;
1765
- while ((a = classname.indexOf(key, a)) >= 0) {
1766
- var b = a + len;
1767
- if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) {
1768
- classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
1769
- } else {
1770
- a = b;
1771
- }
1772
- }
1773
- }
1774
- }
1775
- }
1776
- return classname === "" ? null : classname;
1777
- }
1778
- function append_styles(styles, important = false) {
1779
- var separator = important ? " !important;" : ";";
1780
- var css = "";
1781
- for (var key in styles) {
1782
- var value = styles[key];
1783
- if (value != null && value !== "") {
1784
- css += " " + key + ": " + value + separator;
1785
- }
1786
- }
1787
- return css;
1788
- }
1789
- function to_css_name(name) {
1790
- if (name[0] !== "-" || name[1] !== "-") {
1791
- return name.toLowerCase();
1792
- }
1793
- return name;
1794
- }
1795
- function to_style(value, styles) {
1796
- if (styles) {
1797
- var new_style = "";
1798
- var normal_styles;
1799
- var important_styles;
1800
- if (Array.isArray(styles)) {
1801
- normal_styles = styles[0];
1802
- important_styles = styles[1];
1803
- } else {
1804
- normal_styles = styles;
1805
- }
1806
- if (value) {
1807
- value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
1808
- var in_str = false;
1809
- var in_apo = 0;
1810
- var in_comment = false;
1811
- var reserved_names = [];
1812
- if (normal_styles) {
1813
- reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
1814
- }
1815
- if (important_styles) {
1816
- reserved_names.push(...Object.keys(important_styles).map(to_css_name));
1817
- }
1818
- var start_index = 0;
1819
- var name_index = -1;
1820
- const len = value.length;
1821
- for (var i = 0; i < len; i++) {
1822
- var c = value[i];
1823
- if (in_comment) {
1824
- if (c === "/" && value[i - 1] === "*") {
1825
- in_comment = false;
1826
- }
1827
- } else if (in_str) {
1828
- if (in_str === c) {
1829
- in_str = false;
1830
- }
1831
- } else if (c === "/" && value[i + 1] === "*") {
1832
- in_comment = true;
1833
- } else if (c === '"' || c === "'") {
1834
- in_str = c;
1835
- } else if (c === "(") {
1836
- in_apo++;
1837
- } else if (c === ")") {
1838
- in_apo--;
1839
- }
1840
- if (!in_comment && in_str === false && in_apo === 0) {
1841
- if (c === ":" && name_index === -1) {
1842
- name_index = i;
1843
- } else if (c === ";" || i === len - 1) {
1844
- if (name_index !== -1) {
1845
- var name = to_css_name(value.substring(start_index, name_index).trim());
1846
- if (!reserved_names.includes(name)) {
1847
- if (c !== ";") {
1848
- i++;
1849
- }
1850
- var property = value.substring(start_index, i).trim();
1851
- new_style += " " + property + ";";
1852
- }
1853
- }
1854
- start_index = i + 1;
1855
- name_index = -1;
1856
- }
1857
- }
1858
- }
1859
- }
1860
- if (normal_styles) {
1861
- new_style += append_styles(normal_styles);
1862
- }
1863
- if (important_styles) {
1864
- new_style += append_styles(important_styles, true);
1865
- }
1866
- new_style = new_style.trim();
1867
- return new_style === "" ? null : new_style;
1868
- }
1869
- return value == null ? null : String(value);
1736
+ const ATTR_REGEX = /[&"<]/g;
1737
+ const CONTENT_REGEX = /[&<]/g;
1738
+ function escape_html(value, is_attr) {
1739
+ const str = String(value ?? "");
1740
+ const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
1741
+ pattern.lastIndex = 0;
1742
+ let escaped = "";
1743
+ let last = 0;
1744
+ while (pattern.test(str)) {
1745
+ const i = pattern.lastIndex - 1;
1746
+ const ch = str[i];
1747
+ escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
1748
+ last = i + 1;
1749
+ }
1750
+ return escaped + str.substring(last);
1870
1751
  }
1871
1752
  function subscribe_to_store(store, run, invalidate) {
1872
1753
  if (store == null) {
@@ -1882,649 +1763,56 @@ function subscribe_to_store(store, run, invalidate) {
1882
1763
  );
1883
1764
  return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
1884
1765
  }
1885
- const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
1886
- const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
1887
- let controller = null;
1888
- function abort() {
1889
- controller?.abort(STALE_REACTION);
1890
- controller = null;
1891
- }
1892
- function await_invalid() {
1893
- const error = new Error(`await_invalid
1894
- Encountered asynchronous work while rendering synchronously.
1895
- https://svelte.dev/e/await_invalid`);
1896
- error.name = "Svelte error";
1897
- throw error;
1766
+ var ssr_context = null;
1767
+ function set_ssr_context(v) {
1768
+ ssr_context = v;
1898
1769
  }
1899
- function lifecycle_function_unavailable(name) {
1900
- const error = new Error(`lifecycle_function_unavailable
1901
- \`${name}(...)\` is not available on the server
1902
- https://svelte.dev/e/lifecycle_function_unavailable`);
1903
- error.name = "Svelte error";
1904
- throw error;
1770
+ function createContext() {
1771
+ const key = {};
1772
+ return [() => getContext(key), (context) => setContext(key, context)];
1905
1773
  }
1906
- class Renderer {
1907
- /**
1908
- * The contents of the renderer.
1909
- * @type {RendererItem[]}
1910
- */
1911
- #out = [];
1912
- /**
1913
- * Any `onDestroy` callbacks registered during execution of this renderer.
1914
- * @type {(() => void)[] | undefined}
1915
- */
1916
- #on_destroy = void 0;
1917
- /**
1918
- * Whether this renderer is a component body.
1919
- * @type {boolean}
1920
- */
1921
- #is_component_body = false;
1922
- /**
1923
- * The type of string content that this renderer is accumulating.
1924
- * @type {RendererType}
1925
- */
1926
- type;
1927
- /** @type {Renderer | undefined} */
1928
- #parent;
1929
- /**
1930
- * Asynchronous work associated with this renderer
1931
- * @type {Promise<void> | undefined}
1932
- */
1933
- promise = void 0;
1934
- /**
1935
- * State which is associated with the content tree as a whole.
1936
- * It will be re-exposed, uncopied, on all children.
1937
- * @type {SSRState}
1938
- * @readonly
1939
- */
1940
- global;
1941
- /**
1942
- * State that is local to the branch it is declared in.
1943
- * It will be shallow-copied to all children.
1944
- *
1945
- * @type {{ select_value: string | undefined }}
1946
- */
1947
- local;
1948
- /**
1949
- * @param {SSRState} global
1950
- * @param {Renderer | undefined} [parent]
1951
- */
1952
- constructor(global, parent) {
1953
- this.#parent = parent;
1954
- this.global = global;
1955
- this.local = parent ? { ...parent.local } : { select_value: void 0 };
1956
- this.type = parent ? parent.type : "body";
1957
- }
1958
- /**
1959
- * @param {(renderer: Renderer) => void} fn
1960
- */
1961
- head(fn) {
1962
- const head2 = new Renderer(this.global, this);
1963
- head2.type = "head";
1964
- this.#out.push(head2);
1965
- head2.child(fn);
1966
- }
1967
- /**
1968
- * @param {(renderer: Renderer) => void} fn
1969
- */
1970
- async(fn) {
1971
- this.#out.push(BLOCK_OPEN);
1972
- this.child(fn);
1973
- this.#out.push(BLOCK_CLOSE);
1974
- }
1975
- /**
1976
- * Create a child renderer. The child renderer inherits the state from the parent,
1977
- * but has its own content.
1978
- * @param {(renderer: Renderer) => MaybePromise<void>} fn
1979
- */
1980
- child(fn) {
1981
- const child = new Renderer(this.global, this);
1982
- this.#out.push(child);
1983
- const parent = ssr_context;
1984
- set_ssr_context({
1985
- ...ssr_context,
1986
- p: parent,
1987
- c: null,
1988
- r: child
1989
- });
1990
- const result = fn(child);
1991
- set_ssr_context(parent);
1992
- if (result instanceof Promise) {
1993
- if (child.global.mode === "sync") {
1994
- await_invalid();
1995
- }
1996
- result.catch(() => {
1997
- });
1998
- child.promise = result;
1999
- }
2000
- return child;
2001
- }
2002
- /**
2003
- * Create a component renderer. The component renderer inherits the state from the parent,
2004
- * but has its own content. It is treated as an ordering boundary for ondestroy callbacks.
2005
- * @param {(renderer: Renderer) => MaybePromise<void>} fn
2006
- * @param {Function} [component_fn]
2007
- * @returns {void}
2008
- */
2009
- component(fn, component_fn) {
2010
- push$1();
2011
- const child = this.child(fn);
2012
- child.#is_component_body = true;
2013
- pop$1();
2014
- }
2015
- /**
2016
- * @param {Record<string, any>} attrs
2017
- * @param {(renderer: Renderer) => void} fn
2018
- * @param {string | undefined} [css_hash]
2019
- * @param {Record<string, boolean> | undefined} [classes]
2020
- * @param {Record<string, string> | undefined} [styles]
2021
- * @param {number | undefined} [flags]
2022
- * @returns {void}
2023
- */
2024
- select(attrs, fn, css_hash, classes, styles, flags) {
2025
- const { value, ...select_attrs } = attrs;
2026
- this.push(`<select${attributes(select_attrs, css_hash, classes, styles, flags)}>`);
2027
- this.child((renderer) => {
2028
- renderer.local.select_value = value;
2029
- fn(renderer);
2030
- });
2031
- this.push("</select>");
2032
- }
2033
- /**
2034
- * @param {Record<string, any>} attrs
2035
- * @param {string | number | boolean | ((renderer: Renderer) => void)} body
2036
- * @param {string | undefined} [css_hash]
2037
- * @param {Record<string, boolean> | undefined} [classes]
2038
- * @param {Record<string, string> | undefined} [styles]
2039
- * @param {number | undefined} [flags]
2040
- */
2041
- option(attrs, body, css_hash, classes, styles, flags) {
2042
- this.#out.push(`<option${attributes(attrs, css_hash, classes, styles, flags)}`);
2043
- const close = (renderer, value, { head: head2, body: body2 }) => {
2044
- if ("value" in attrs) {
2045
- value = attrs.value;
2046
- }
2047
- if (value === this.local.select_value) {
2048
- renderer.#out.push(" selected");
2049
- }
2050
- renderer.#out.push(`>${body2}</option>`);
2051
- if (head2) {
2052
- renderer.head((child) => child.push(head2));
2053
- }
2054
- };
2055
- if (typeof body === "function") {
2056
- this.child((renderer) => {
2057
- const r = new Renderer(this.global, this);
2058
- body(r);
2059
- if (this.global.mode === "async") {
2060
- return r.#collect_content_async().then((content) => {
2061
- close(renderer, content.body.replaceAll("<!---->", ""), content);
2062
- });
2063
- } else {
2064
- const content = r.#collect_content();
2065
- close(renderer, content.body.replaceAll("<!---->", ""), content);
2066
- }
2067
- });
2068
- } else {
2069
- close(this, body, { body });
2070
- }
2071
- }
2072
- /**
2073
- * @param {(renderer: Renderer) => void} fn
2074
- */
2075
- title(fn) {
2076
- const path = this.get_path();
2077
- const close = (head2) => {
2078
- this.global.set_title(head2, path);
2079
- };
2080
- this.child((renderer) => {
2081
- const r = new Renderer(renderer.global, renderer);
2082
- fn(r);
2083
- if (renderer.global.mode === "async") {
2084
- return r.#collect_content_async().then((content) => {
2085
- close(content.head);
2086
- });
2087
- } else {
2088
- const content = r.#collect_content();
2089
- close(content.head);
2090
- }
2091
- });
2092
- }
2093
- /**
2094
- * @param {string | (() => Promise<string>)} content
2095
- */
2096
- push(content) {
2097
- if (typeof content === "function") {
2098
- this.child(async (renderer) => renderer.push(await content()));
2099
- } else {
2100
- this.#out.push(content);
2101
- }
2102
- }
2103
- /**
2104
- * @param {() => void} fn
2105
- */
2106
- on_destroy(fn) {
2107
- (this.#on_destroy ??= []).push(fn);
2108
- }
2109
- /**
2110
- * @returns {number[]}
2111
- */
2112
- get_path() {
2113
- return this.#parent ? [...this.#parent.get_path(), this.#parent.#out.indexOf(this)] : [];
2114
- }
2115
- /**
2116
- * @deprecated this is needed for legacy component bindings
2117
- */
2118
- copy() {
2119
- const copy = new Renderer(this.global, this.#parent);
2120
- copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item);
2121
- copy.promise = this.promise;
2122
- return copy;
2123
- }
2124
- /**
2125
- * @param {Renderer} other
2126
- * @deprecated this is needed for legacy component bindings
2127
- */
2128
- subsume(other) {
2129
- if (this.global.mode !== other.global.mode) {
2130
- throw new Error(
2131
- "invariant: A renderer cannot switch modes. If you're seeing this, there's a compiler bug. File an issue!"
2132
- );
2133
- }
2134
- this.local = other.local;
2135
- this.#out = other.#out.map((item) => {
2136
- if (item instanceof Renderer) {
2137
- item.subsume(item);
2138
- }
2139
- return item;
2140
- });
2141
- this.promise = other.promise;
2142
- this.type = other.type;
2143
- }
2144
- get length() {
2145
- return this.#out.length;
2146
- }
2147
- /**
2148
- * Only available on the server and when compiling with the `server` option.
2149
- * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
2150
- * @template {Record<string, any>} Props
2151
- * @param {Component<Props>} component
2152
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} [options]
2153
- * @returns {RenderOutput}
2154
- */
2155
- static render(component, options = {}) {
2156
- let sync;
2157
- const result = (
2158
- /** @type {RenderOutput} */
2159
- {}
2160
- );
2161
- Object.defineProperties(result, {
2162
- html: {
2163
- get: () => {
2164
- return (sync ??= Renderer.#render(component, options)).body;
2165
- }
2166
- },
2167
- head: {
2168
- get: () => {
2169
- return (sync ??= Renderer.#render(component, options)).head;
2170
- }
2171
- },
2172
- body: {
2173
- get: () => {
2174
- return (sync ??= Renderer.#render(component, options)).body;
2175
- }
2176
- },
2177
- then: {
2178
- value: (
2179
- /**
2180
- * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
2181
- *
2182
- * @template TResult1
2183
- * @template [TResult2=never]
2184
- * @param { (value: SyncRenderOutput) => TResult1 } onfulfilled
2185
- * @param { (reason: unknown) => TResult2 } onrejected
2186
- */
2187
- (onfulfilled, onrejected) => {
2188
- {
2189
- const result2 = sync ??= Renderer.#render(component, options);
2190
- const user_result = onfulfilled({
2191
- head: result2.head,
2192
- body: result2.body,
2193
- html: result2.body
2194
- });
2195
- return Promise.resolve(user_result);
2196
- }
2197
- }
2198
- )
2199
- }
2200
- });
2201
- return result;
2202
- }
2203
- /**
2204
- * Collect all of the `onDestroy` callbacks regsitered during rendering. In an async context, this is only safe to call
2205
- * after awaiting `collect_async`.
2206
- *
2207
- * Child renderers are "porous" and don't affect execution order, but component body renderers
2208
- * create ordering boundaries. Within a renderer, callbacks run in order until hitting a component boundary.
2209
- * @returns {Iterable<() => void>}
2210
- */
2211
- *#collect_on_destroy() {
2212
- for (const component of this.#traverse_components()) {
2213
- yield* component.#collect_ondestroy();
2214
- }
2215
- }
2216
- /**
2217
- * Performs a depth-first search of renderers, yielding the deepest components first, then additional components as we backtrack up the tree.
2218
- * @returns {Iterable<Renderer>}
2219
- */
2220
- *#traverse_components() {
2221
- for (const child of this.#out) {
2222
- if (typeof child !== "string") {
2223
- yield* child.#traverse_components();
2224
- }
2225
- }
2226
- if (this.#is_component_body) {
2227
- yield this;
2228
- }
2229
- }
2230
- /**
2231
- * @returns {Iterable<() => void>}
2232
- */
2233
- *#collect_ondestroy() {
2234
- if (this.#on_destroy) {
2235
- for (const fn of this.#on_destroy) {
2236
- yield fn;
2237
- }
2238
- }
2239
- for (const child of this.#out) {
2240
- if (child instanceof Renderer && !child.#is_component_body) {
2241
- yield* child.#collect_ondestroy();
2242
- }
2243
- }
2244
- }
2245
- /**
2246
- * Render a component. Throws if any of the children are performing asynchronous work.
2247
- *
2248
- * @template {Record<string, any>} Props
2249
- * @param {Component<Props>} component
2250
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
2251
- * @returns {AccumulatedContent}
2252
- */
2253
- static #render(component, options) {
2254
- var previous_context = ssr_context;
2255
- try {
2256
- const renderer = Renderer.#open_render("sync", component, options);
2257
- const content = renderer.#collect_content();
2258
- return Renderer.#close_render(content, renderer);
2259
- } finally {
2260
- abort();
2261
- set_ssr_context(previous_context);
2262
- }
2263
- }
2264
- /**
2265
- * Render a component.
2266
- *
2267
- * @template {Record<string, any>} Props
2268
- * @param {Component<Props>} component
2269
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
2270
- * @returns {Promise<AccumulatedContent>}
2271
- */
2272
- static async #render_async(component, options) {
2273
- var previous_context = ssr_context;
2274
- try {
2275
- const renderer = Renderer.#open_render("async", component, options);
2276
- const content = await renderer.#collect_content_async();
2277
- return Renderer.#close_render(content, renderer);
2278
- } finally {
2279
- abort();
2280
- set_ssr_context(previous_context);
2281
- }
2282
- }
2283
- /**
2284
- * Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string.
2285
- * @param {AccumulatedContent} content
2286
- * @returns {AccumulatedContent}
2287
- */
2288
- #collect_content(content = { head: "", body: "" }) {
2289
- for (const item of this.#out) {
2290
- if (typeof item === "string") {
2291
- content[this.type] += item;
2292
- } else if (item instanceof Renderer) {
2293
- item.#collect_content(content);
2294
- }
2295
- }
2296
- return content;
2297
- }
2298
- /**
2299
- * Collect all of the code from the `out` array and return it as a string.
2300
- * @param {AccumulatedContent} content
2301
- * @returns {Promise<AccumulatedContent>}
2302
- */
2303
- async #collect_content_async(content = { head: "", body: "" }) {
2304
- await this.promise;
2305
- for (const item of this.#out) {
2306
- if (typeof item === "string") {
2307
- content[this.type] += item;
2308
- } else if (item instanceof Renderer) {
2309
- await item.#collect_content_async(content);
2310
- }
2311
- }
2312
- return content;
2313
- }
2314
- /**
2315
- * @template {Record<string, any>} Props
2316
- * @param {'sync' | 'async'} mode
2317
- * @param {import('svelte').Component<Props>} component
2318
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
2319
- * @returns {Renderer}
2320
- */
2321
- static #open_render(mode, component, options) {
2322
- const renderer = new Renderer(
2323
- new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "")
2324
- );
2325
- renderer.push(BLOCK_OPEN);
2326
- if (options.context) {
2327
- push$1();
2328
- ssr_context.c = options.context;
2329
- ssr_context.r = renderer;
2330
- }
2331
- component(renderer, options.props ?? {});
2332
- if (options.context) {
2333
- pop$1();
2334
- }
2335
- renderer.push(BLOCK_CLOSE);
2336
- return renderer;
2337
- }
2338
- /**
2339
- * @param {AccumulatedContent} content
2340
- * @param {Renderer} renderer
2341
- */
2342
- static #close_render(content, renderer) {
2343
- for (const cleanup of renderer.#collect_on_destroy()) {
2344
- cleanup();
2345
- }
2346
- let head2 = content.head + renderer.global.get_title();
2347
- let body = content.body;
2348
- for (const { hash, code } of renderer.global.css) {
2349
- head2 += `<style id="${hash}">${code}</style>`;
2350
- }
2351
- return {
2352
- head: head2,
2353
- body
2354
- };
2355
- }
2356
- }
2357
- class SSRState {
2358
- /** @readonly @type {'sync' | 'async'} */
2359
- mode;
2360
- /** @readonly @type {() => string} */
2361
- uid;
2362
- /** @readonly @type {Set<{ hash: string; code: string }>} */
2363
- css = /* @__PURE__ */ new Set();
2364
- /** @type {{ path: number[], value: string }} */
2365
- #title = { path: [], value: "" };
2366
- /**
2367
- * @param {'sync' | 'async'} mode
2368
- * @param {string} [id_prefix]
2369
- */
2370
- constructor(mode, id_prefix = "") {
2371
- this.mode = mode;
2372
- let uid = 1;
2373
- this.uid = () => `${id_prefix}s${uid++}`;
2374
- }
2375
- get_title() {
2376
- return this.#title.value;
2377
- }
2378
- /**
2379
- * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
2380
- * from earlier than or equal to the current value.
2381
- * @param {string} value
2382
- * @param {number[]} path
2383
- */
2384
- set_title(value, path) {
2385
- const current = this.#title.path;
2386
- let i = 0;
2387
- let l = Math.min(path.length, current.length);
2388
- while (i < l && path[i] === current[i]) i += 1;
2389
- if (path[i] === void 0) return;
2390
- if (current[i] === void 0 || path[i] > current[i]) {
2391
- this.#title.path = path;
2392
- this.#title.value = value;
2393
- }
2394
- }
2395
- }
2396
- 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;
2397
- function render(component, options = {}) {
2398
- return Renderer.render(
2399
- /** @type {Component<Props>} */
2400
- component,
2401
- options
1774
+ function getContext(key) {
1775
+ const context_map = get_or_init_context_map();
1776
+ const result = (
1777
+ /** @type {T} */
1778
+ context_map.get(key)
2402
1779
  );
1780
+ return result;
2403
1781
  }
2404
- function head(renderer, fn) {
2405
- renderer.head((renderer2) => {
2406
- renderer2.push(BLOCK_OPEN);
2407
- renderer2.child(fn);
2408
- renderer2.push(BLOCK_CLOSE);
2409
- });
2410
- }
2411
- function attributes(attrs, css_hash, classes, styles, flags = 0) {
2412
- if (styles) {
2413
- attrs.style = to_style(attrs.style, styles);
2414
- }
2415
- if (attrs.class) {
2416
- attrs.class = clsx(attrs.class);
2417
- }
2418
- if (css_hash || classes) {
2419
- attrs.class = to_class(attrs.class, css_hash, classes);
2420
- }
2421
- let attr_str = "";
2422
- let name;
2423
- const is_html = (flags & ELEMENT_IS_NAMESPACED) === 0;
2424
- const lowercase = (flags & ELEMENT_PRESERVE_ATTRIBUTE_CASE) === 0;
2425
- const is_input = (flags & ELEMENT_IS_INPUT) !== 0;
2426
- for (name in attrs) {
2427
- if (typeof attrs[name] === "function") continue;
2428
- if (name[0] === "$" && name[1] === "$") continue;
2429
- if (INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
2430
- var value = attrs[name];
2431
- if (lowercase) {
2432
- name = name.toLowerCase();
2433
- }
2434
- if (is_input) {
2435
- if (name === "defaultvalue" || name === "defaultchecked") {
2436
- name = name === "defaultvalue" ? "value" : "checked";
2437
- if (attrs[name]) continue;
2438
- }
2439
- }
2440
- attr_str += attr(name, value, is_html && is_boolean_attribute(name));
2441
- }
2442
- return attr_str;
2443
- }
2444
- function spread_props(props) {
2445
- const merged_props = {};
2446
- let key;
2447
- for (let i = 0; i < props.length; i++) {
2448
- const obj = props[i];
2449
- for (key in obj) {
2450
- const desc = Object.getOwnPropertyDescriptor(obj, key);
2451
- if (desc) {
2452
- Object.defineProperty(merged_props, key, desc);
2453
- } else {
2454
- merged_props[key] = obj[key];
2455
- }
2456
- }
2457
- }
2458
- return merged_props;
1782
+ function setContext(key, context) {
1783
+ get_or_init_context_map().set(key, context);
1784
+ return context;
2459
1785
  }
2460
- function stringify(value) {
2461
- return typeof value === "string" ? value : value == null ? "" : value + "";
1786
+ function hasContext(key) {
1787
+ return get_or_init_context_map().has(key);
2462
1788
  }
2463
- function attr_class(value, hash, directives) {
2464
- var result = to_class(value, hash, directives);
2465
- return result ? ` class="${escape_html(result, true)}"` : "";
1789
+ function getAllContexts() {
1790
+ return get_or_init_context_map();
2466
1791
  }
2467
- function attr_style(value, directives) {
2468
- var result = to_style(value, directives);
2469
- return result ? ` style="${escape_html(result, true)}"` : "";
2470
- }
2471
- function store_get(store_values, store_name, store) {
2472
- if (store_name in store_values && store_values[store_name][0] === store) {
2473
- return store_values[store_name][2];
1792
+ function get_or_init_context_map(name) {
1793
+ if (ssr_context === null) {
1794
+ lifecycle_outside_component();
2474
1795
  }
2475
- store_values[store_name]?.[1]();
2476
- store_values[store_name] = [store, null, void 0];
2477
- const unsub = subscribe_to_store(
2478
- store,
2479
- /** @param {any} v */
2480
- (v) => store_values[store_name][2] = v
2481
- );
2482
- store_values[store_name][1] = unsub;
2483
- return store_values[store_name][2];
1796
+ return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
2484
1797
  }
2485
- function unsubscribe_stores(store_values) {
2486
- for (const store_name in store_values) {
2487
- store_values[store_name][1]();
2488
- }
1798
+ function push(fn) {
1799
+ ssr_context = { p: ssr_context, c: null, r: null };
2489
1800
  }
2490
- function bind_props(props_parent, props_now) {
2491
- for (const key in props_now) {
2492
- const initial_value = props_parent[key];
2493
- const value = props_now[key];
2494
- if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) {
2495
- props_parent[key] = value;
2496
- }
2497
- }
1801
+ function pop() {
1802
+ ssr_context = /** @type {SSRContext} */
1803
+ ssr_context.p;
2498
1804
  }
2499
- function ensure_array_like(array_like_or_iterator) {
2500
- if (array_like_or_iterator) {
2501
- return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
2502
- }
2503
- return [];
2504
- }
2505
- function once(get_value) {
2506
- let value = (
2507
- /** @type {V} */
2508
- UNINITIALIZED
2509
- );
2510
- return () => {
2511
- if (value === UNINITIALIZED) {
2512
- value = get_value();
2513
- }
2514
- return value;
2515
- };
2516
- }
2517
- function derived(fn) {
2518
- const get_value = once(fn);
2519
- let updated_value;
2520
- return function(new_value) {
2521
- if (arguments.length === 0) {
2522
- return updated_value ?? get_value();
1805
+ function get_parent_context(ssr_context2) {
1806
+ let parent = ssr_context2.p;
1807
+ while (parent !== null) {
1808
+ const context_map = parent.c;
1809
+ if (context_map !== null) {
1810
+ return context_map;
2523
1811
  }
2524
- updated_value = new_value;
2525
- return updated_value;
2526
- };
1812
+ parent = parent.p;
1813
+ }
1814
+ return null;
2527
1815
  }
2528
1816
 
2529
- export { unsubscribe_stores as $, effect_pending_updates as A, Batch as B, COMMENT_NODE as C, destroy_effect as D, invoke_error_boundary as E, queue_micro_task as F, svelte_boundary_reset_onerror as G, HYDRATION_START as H, effect_tracking as I, source as J, render_effect as K, LEGACY_PROPS as L, HYDRATION_END as M, HYDRATION_START_ELSE as N, untrack as O, increment as P, push as Q, pop as R, EFFECT_TRANSPARENT as S, EFFECT_PRESERVED as T, BOUNDARY_EFFECT as U, DEV as V, head as W, ensure_array_like as X, attr_class as Y, attr as Z, store_get as _, get_first_child as a, bind_props as a0, derived as a1, stringify as a2, attr_style as a3, attributes as a4, spread_props as a5, clsx$1 as a6, without_reactive_context as a7, lifecycle_function_unavailable as a8, clsx as a9, get_next_sibling as b, HYDRATION_ERROR as c, clear_text_content as d, component_root as e, flushSync as f, get as g, hydration_failed as h, init_operations as i, is_passive_event as j, create_text as k, internal_set as l, mutable_source as m, active_effect as n, block as o, branch as p, pause_effect as q, render as r, set as s, set_active_effect as t, set_active_reaction as u, set_component_context as v, handle_error as w, active_reaction as x, component_context as y, move_effect as z };
2530
- //# sourceMappingURL=index2-CVBATI2G.js.map
1817
+ export { without_reactive_context as $, internal_set as A, Batch as B, COMMENT_NODE as C, destroy_effect as D, invoke_error_boundary as E, queue_micro_task as F, svelte_boundary_reset_onerror as G, HYDRATION_START as H, effect_tracking as I, source as J, render_effect as K, LEGACY_PROPS as L, HYDRATION_END as M, HYDRATION_START_ELSE as N, untrack as O, increment as P, push$1 as Q, pop$1 as R, EFFECT_TRANSPARENT as S, EFFECT_PRESERVED as T, BOUNDARY_EFFECT as U, BROWSER as V, escape_html as W, fallback as X, hasContext as Y, getContext as Z, getAllContexts as _, get_first_child as a, ssr_context as a0, createContext as a1, noop as a2, safe_not_equal as a3, subscribe_to_store as a4, set_ssr_context as a5, push as a6, pop as a7, STALE_REACTION as a8, ELEMENT_PRESERVE_ATTRIBUTE_CASE as a9, ELEMENT_IS_INPUT as aa, ELEMENT_IS_NAMESPACED as ab, UNINITIALIZED as ac, get_next_sibling as b, HYDRATION_ERROR as c, define_property as d, clear_text_content as e, flushSync as f, get as g, hydration_failed as h, init_operations as i, array_from as j, component_root as k, create_text as l, mutable_source as m, setContext as n, active_effect as o, block as p, branch as q, pause_effect as r, set as s, set_active_effect as t, set_active_reaction as u, set_component_context as v, handle_error as w, active_reaction as x, component_context as y, move_effect as z };
1818
+ //# sourceMappingURL=context-Dy9MY1Z0.js.map