@openpalm/ui 0.11.0-rc.2

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 (329) hide show
  1. package/README.md +129 -0
  2. package/build/.openpalm-ui-version +1 -0
  3. package/build/client/_app/immutable/assets/0.BK7X4bPu.css +1 -0
  4. package/build/client/_app/immutable/assets/0.BK7X4bPu.css.br +0 -0
  5. package/build/client/_app/immutable/assets/0.BK7X4bPu.css.gz +0 -0
  6. package/build/client/_app/immutable/assets/4.D9MwgTDo.css +1 -0
  7. package/build/client/_app/immutable/assets/4.D9MwgTDo.css.br +0 -0
  8. package/build/client/_app/immutable/assets/4.D9MwgTDo.css.gz +0 -0
  9. package/build/client/_app/immutable/assets/5.Cj0Mk9Gn.css +1 -0
  10. package/build/client/_app/immutable/assets/5.Cj0Mk9Gn.css.br +0 -0
  11. package/build/client/_app/immutable/assets/5.Cj0Mk9Gn.css.gz +0 -0
  12. package/build/client/_app/immutable/assets/6.DJenXolA.css +1 -0
  13. package/build/client/_app/immutable/assets/6.DJenXolA.css.br +0 -0
  14. package/build/client/_app/immutable/assets/6.DJenXolA.css.gz +0 -0
  15. package/build/client/_app/immutable/assets/7.BHUsSUvX.css +1 -0
  16. package/build/client/_app/immutable/assets/7.BHUsSUvX.css.br +0 -0
  17. package/build/client/_app/immutable/assets/7.BHUsSUvX.css.gz +0 -0
  18. package/build/client/_app/immutable/assets/8.DjrHy5wu.css +1 -0
  19. package/build/client/_app/immutable/assets/8.DjrHy5wu.css.br +0 -0
  20. package/build/client/_app/immutable/assets/8.DjrHy5wu.css.gz +0 -0
  21. package/build/client/_app/immutable/assets/AuthGate.BtJV-xXj.css +1 -0
  22. package/build/client/_app/immutable/assets/AuthGate.BtJV-xXj.css.br +0 -0
  23. package/build/client/_app/immutable/assets/AuthGate.BtJV-xXj.css.gz +0 -0
  24. package/build/client/_app/immutable/assets/VoiceProfileSelector.Dp7tWdKe.css +1 -0
  25. package/build/client/_app/immutable/assets/VoiceProfileSelector.Dp7tWdKe.css.br +0 -0
  26. package/build/client/_app/immutable/assets/VoiceProfileSelector.Dp7tWdKe.css.gz +0 -0
  27. package/build/client/_app/immutable/chunks/BuFlayix.js +1 -0
  28. package/build/client/_app/immutable/chunks/BuFlayix.js.br +0 -0
  29. package/build/client/_app/immutable/chunks/BuFlayix.js.gz +0 -0
  30. package/build/client/_app/immutable/chunks/BwTF6U35.js +3 -0
  31. package/build/client/_app/immutable/chunks/BwTF6U35.js.br +0 -0
  32. package/build/client/_app/immutable/chunks/BwTF6U35.js.gz +0 -0
  33. package/build/client/_app/immutable/chunks/C8qMxft1.js +1 -0
  34. package/build/client/_app/immutable/chunks/C8qMxft1.js.br +0 -0
  35. package/build/client/_app/immutable/chunks/C8qMxft1.js.gz +0 -0
  36. package/build/client/_app/immutable/chunks/Cb_i8bV9.js +1 -0
  37. package/build/client/_app/immutable/chunks/Cb_i8bV9.js.br +0 -0
  38. package/build/client/_app/immutable/chunks/Cb_i8bV9.js.gz +0 -0
  39. package/build/client/_app/immutable/chunks/CzXGhlNF.js +1 -0
  40. package/build/client/_app/immutable/chunks/CzXGhlNF.js.br +0 -0
  41. package/build/client/_app/immutable/chunks/CzXGhlNF.js.gz +0 -0
  42. package/build/client/_app/immutable/chunks/DYskO3Sk.js +5 -0
  43. package/build/client/_app/immutable/chunks/DYskO3Sk.js.br +0 -0
  44. package/build/client/_app/immutable/chunks/DYskO3Sk.js.gz +0 -0
  45. package/build/client/_app/immutable/chunks/ak2ISc8B.js +1 -0
  46. package/build/client/_app/immutable/chunks/ak2ISc8B.js.br +0 -0
  47. package/build/client/_app/immutable/chunks/ak2ISc8B.js.gz +0 -0
  48. package/build/client/_app/immutable/chunks/kNaey6uv.js +1 -0
  49. package/build/client/_app/immutable/chunks/kNaey6uv.js.br +0 -0
  50. package/build/client/_app/immutable/chunks/kNaey6uv.js.gz +0 -0
  51. package/build/client/_app/immutable/chunks/os2NZ37U.js +1 -0
  52. package/build/client/_app/immutable/chunks/os2NZ37U.js.br +1 -0
  53. package/build/client/_app/immutable/chunks/os2NZ37U.js.gz +0 -0
  54. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  55. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  56. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  57. package/build/client/_app/immutable/entry/app.C_eSlUyi.js +2 -0
  58. package/build/client/_app/immutable/entry/app.C_eSlUyi.js.br +0 -0
  59. package/build/client/_app/immutable/entry/app.C_eSlUyi.js.gz +0 -0
  60. package/build/client/_app/immutable/entry/start.BAta_Cih.js +1 -0
  61. package/build/client/_app/immutable/entry/start.BAta_Cih.js.br +0 -0
  62. package/build/client/_app/immutable/entry/start.BAta_Cih.js.gz +0 -0
  63. package/build/client/_app/immutable/nodes/0.Bi_of0So.js +1 -0
  64. package/build/client/_app/immutable/nodes/0.Bi_of0So.js.br +0 -0
  65. package/build/client/_app/immutable/nodes/0.Bi_of0So.js.gz +0 -0
  66. package/build/client/_app/immutable/nodes/1.qjZsjpWC.js +1 -0
  67. package/build/client/_app/immutable/nodes/1.qjZsjpWC.js.br +0 -0
  68. package/build/client/_app/immutable/nodes/1.qjZsjpWC.js.gz +0 -0
  69. package/build/client/_app/immutable/nodes/2.ojh8oE7F.js +1 -0
  70. package/build/client/_app/immutable/nodes/2.ojh8oE7F.js.br +0 -0
  71. package/build/client/_app/immutable/nodes/2.ojh8oE7F.js.gz +0 -0
  72. package/build/client/_app/immutable/nodes/3.DeAC3yVJ.js +1 -0
  73. package/build/client/_app/immutable/nodes/3.DeAC3yVJ.js.br +0 -0
  74. package/build/client/_app/immutable/nodes/3.DeAC3yVJ.js.gz +0 -0
  75. package/build/client/_app/immutable/nodes/4.BYtA2xx-.js +19 -0
  76. package/build/client/_app/immutable/nodes/4.BYtA2xx-.js.br +0 -0
  77. package/build/client/_app/immutable/nodes/4.BYtA2xx-.js.gz +0 -0
  78. package/build/client/_app/immutable/nodes/5.ChSoAFFd.js +4 -0
  79. package/build/client/_app/immutable/nodes/5.ChSoAFFd.js.br +0 -0
  80. package/build/client/_app/immutable/nodes/5.ChSoAFFd.js.gz +0 -0
  81. package/build/client/_app/immutable/nodes/6.BRG0vYmH.js +1 -0
  82. package/build/client/_app/immutable/nodes/6.BRG0vYmH.js.br +0 -0
  83. package/build/client/_app/immutable/nodes/6.BRG0vYmH.js.gz +0 -0
  84. package/build/client/_app/immutable/nodes/7.BVvy1f_p.js +15 -0
  85. package/build/client/_app/immutable/nodes/7.BVvy1f_p.js.br +0 -0
  86. package/build/client/_app/immutable/nodes/7.BVvy1f_p.js.gz +0 -0
  87. package/build/client/_app/immutable/nodes/8.Cb4MWMah.js +2 -0
  88. package/build/client/_app/immutable/nodes/8.Cb4MWMah.js.br +0 -0
  89. package/build/client/_app/immutable/nodes/8.Cb4MWMah.js.gz +0 -0
  90. package/build/client/_app/version.json +1 -0
  91. package/build/client/_app/version.json.br +0 -0
  92. package/build/client/_app/version.json.gz +0 -0
  93. package/build/client/banner.png +0 -0
  94. package/build/client/fu-128.png +0 -0
  95. package/build/client/fu.png +0 -0
  96. package/build/client/logo-128.png +0 -0
  97. package/build/client/logo.png +0 -0
  98. package/build/client/setup/wizard.css +1639 -0
  99. package/build/client/setup/wizard.css.br +0 -0
  100. package/build/client/setup/wizard.css.gz +0 -0
  101. package/build/client/wizard-128.png +0 -0
  102. package/build/client/wizard.png +0 -0
  103. package/build/env.js +94 -0
  104. package/build/handler.js +1494 -0
  105. package/build/index.js +345 -0
  106. package/build/server/chunks/0-Dk6RRhi2.js +9 -0
  107. package/build/server/chunks/0-Dk6RRhi2.js.map +1 -0
  108. package/build/server/chunks/1-CWcY3PRs.js +9 -0
  109. package/build/server/chunks/1-CWcY3PRs.js.map +1 -0
  110. package/build/server/chunks/2-C2y4ydWU.js +9 -0
  111. package/build/server/chunks/2-C2y4ydWU.js.map +1 -0
  112. package/build/server/chunks/3-BgeGdVvT.js +23 -0
  113. package/build/server/chunks/3-BgeGdVvT.js.map +1 -0
  114. package/build/server/chunks/4-DeAt_mYc.js +9 -0
  115. package/build/server/chunks/4-DeAt_mYc.js.map +1 -0
  116. package/build/server/chunks/5-qTXiNPEM.js +9 -0
  117. package/build/server/chunks/5-qTXiNPEM.js.map +1 -0
  118. package/build/server/chunks/6-C444Mr69.js +9 -0
  119. package/build/server/chunks/6-C444Mr69.js.map +1 -0
  120. package/build/server/chunks/7-Dg_sVly5.js +9 -0
  121. package/build/server/chunks/7-Dg_sVly5.js.map +1 -0
  122. package/build/server/chunks/8-CF5kn4AY.js +9 -0
  123. package/build/server/chunks/8-CF5kn4AY.js.map +1 -0
  124. package/build/server/chunks/AuthGate-keg7G6rX.js +707 -0
  125. package/build/server/chunks/AuthGate-keg7G6rX.js.map +1 -0
  126. package/build/server/chunks/_helpers-B_lb4-jB.js +74 -0
  127. package/build/server/chunks/_helpers-B_lb4-jB.js.map +1 -0
  128. package/build/server/chunks/_layout.svelte-B93aaRP_.js +11 -0
  129. package/build/server/chunks/_layout.svelte-B93aaRP_.js.map +1 -0
  130. package/build/server/chunks/_layout.svelte-BNWepgTx.js +58 -0
  131. package/build/server/chunks/_layout.svelte-BNWepgTx.js.map +1 -0
  132. package/build/server/chunks/_page.svelte-BP2EdQl3.js +5 -0
  133. package/build/server/chunks/_page.svelte-BP2EdQl3.js.map +1 -0
  134. package/build/server/chunks/_page.svelte-BdYSYjmj.js +67 -0
  135. package/build/server/chunks/_page.svelte-BdYSYjmj.js.map +1 -0
  136. package/build/server/chunks/_page.svelte-BiKY57wg.js +533 -0
  137. package/build/server/chunks/_page.svelte-BiKY57wg.js.map +1 -0
  138. package/build/server/chunks/_page.svelte-CtX_8pMq.js +5528 -0
  139. package/build/server/chunks/_page.svelte-CtX_8pMq.js.map +1 -0
  140. package/build/server/chunks/_page.svelte-D0gMlmzQ.js +104 -0
  141. package/build/server/chunks/_page.svelte-D0gMlmzQ.js.map +1 -0
  142. package/build/server/chunks/_page.svelte-DwMiUmq6.js +107 -0
  143. package/build/server/chunks/_page.svelte-DwMiUmq6.js.map +1 -0
  144. package/build/server/chunks/_server.ts-0FuXkx70.js +56 -0
  145. package/build/server/chunks/_server.ts-0FuXkx70.js.map +1 -0
  146. package/build/server/chunks/_server.ts-33LuQvHu.js +19 -0
  147. package/build/server/chunks/_server.ts-33LuQvHu.js.map +1 -0
  148. package/build/server/chunks/_server.ts-5Q0J3F4-.js +55 -0
  149. package/build/server/chunks/_server.ts-5Q0J3F4-.js.map +1 -0
  150. package/build/server/chunks/_server.ts-AJk0xBLJ.js +46 -0
  151. package/build/server/chunks/_server.ts-AJk0xBLJ.js.map +1 -0
  152. package/build/server/chunks/_server.ts-AQe1PIYE.js +68 -0
  153. package/build/server/chunks/_server.ts-AQe1PIYE.js.map +1 -0
  154. package/build/server/chunks/_server.ts-B0N2Nj7L.js +44 -0
  155. package/build/server/chunks/_server.ts-B0N2Nj7L.js.map +1 -0
  156. package/build/server/chunks/_server.ts-BDBJ6fxs.js +67 -0
  157. package/build/server/chunks/_server.ts-BDBJ6fxs.js.map +1 -0
  158. package/build/server/chunks/_server.ts-BEeaI665.js +79 -0
  159. package/build/server/chunks/_server.ts-BEeaI665.js.map +1 -0
  160. package/build/server/chunks/_server.ts-BM4QuGQf.js +53 -0
  161. package/build/server/chunks/_server.ts-BM4QuGQf.js.map +1 -0
  162. package/build/server/chunks/_server.ts-BSIZMZVn.js +50 -0
  163. package/build/server/chunks/_server.ts-BSIZMZVn.js.map +1 -0
  164. package/build/server/chunks/_server.ts-BV-6Mum8.js +54 -0
  165. package/build/server/chunks/_server.ts-BV-6Mum8.js.map +1 -0
  166. package/build/server/chunks/_server.ts-BdnJF23z.js +44 -0
  167. package/build/server/chunks/_server.ts-BdnJF23z.js.map +1 -0
  168. package/build/server/chunks/_server.ts-Bfy4RFhe.js +41 -0
  169. package/build/server/chunks/_server.ts-Bfy4RFhe.js.map +1 -0
  170. package/build/server/chunks/_server.ts-Bhh33s6N.js +149 -0
  171. package/build/server/chunks/_server.ts-Bhh33s6N.js.map +1 -0
  172. package/build/server/chunks/_server.ts-BiSuK8jN.js +41 -0
  173. package/build/server/chunks/_server.ts-BiSuK8jN.js.map +1 -0
  174. package/build/server/chunks/_server.ts-BjiyoKWK.js +41 -0
  175. package/build/server/chunks/_server.ts-BjiyoKWK.js.map +1 -0
  176. package/build/server/chunks/_server.ts-BnEeEd9g.js +57 -0
  177. package/build/server/chunks/_server.ts-BnEeEd9g.js.map +1 -0
  178. package/build/server/chunks/_server.ts-Bq2dkWvj.js +33 -0
  179. package/build/server/chunks/_server.ts-Bq2dkWvj.js.map +1 -0
  180. package/build/server/chunks/_server.ts-Br16AqpO.js +82 -0
  181. package/build/server/chunks/_server.ts-Br16AqpO.js.map +1 -0
  182. package/build/server/chunks/_server.ts-BsZrddQT.js +200 -0
  183. package/build/server/chunks/_server.ts-BsZrddQT.js.map +1 -0
  184. package/build/server/chunks/_server.ts-Btbzy89u.js +65 -0
  185. package/build/server/chunks/_server.ts-Btbzy89u.js.map +1 -0
  186. package/build/server/chunks/_server.ts-BudQlGOx.js +70 -0
  187. package/build/server/chunks/_server.ts-BudQlGOx.js.map +1 -0
  188. package/build/server/chunks/_server.ts-BxPYakCb.js +59 -0
  189. package/build/server/chunks/_server.ts-BxPYakCb.js.map +1 -0
  190. package/build/server/chunks/_server.ts-ByyRcwFy.js +79 -0
  191. package/build/server/chunks/_server.ts-ByyRcwFy.js.map +1 -0
  192. package/build/server/chunks/_server.ts-C7rtn3mH.js +103 -0
  193. package/build/server/chunks/_server.ts-C7rtn3mH.js.map +1 -0
  194. package/build/server/chunks/_server.ts-C88qd-ju.js +46 -0
  195. package/build/server/chunks/_server.ts-C88qd-ju.js.map +1 -0
  196. package/build/server/chunks/_server.ts-CD6LeslU.js +55 -0
  197. package/build/server/chunks/_server.ts-CD6LeslU.js.map +1 -0
  198. package/build/server/chunks/_server.ts-CDlWxA5S.js +60 -0
  199. package/build/server/chunks/_server.ts-CDlWxA5S.js.map +1 -0
  200. package/build/server/chunks/_server.ts-CGqrfNlv.js +514 -0
  201. package/build/server/chunks/_server.ts-CGqrfNlv.js.map +1 -0
  202. package/build/server/chunks/_server.ts-CGwYZUuw.js +759 -0
  203. package/build/server/chunks/_server.ts-CGwYZUuw.js.map +1 -0
  204. package/build/server/chunks/_server.ts-CHVs0yya.js +54 -0
  205. package/build/server/chunks/_server.ts-CHVs0yya.js.map +1 -0
  206. package/build/server/chunks/_server.ts-CMEY6oQe.js +121 -0
  207. package/build/server/chunks/_server.ts-CMEY6oQe.js.map +1 -0
  208. package/build/server/chunks/_server.ts-CS73tiTY.js +63 -0
  209. package/build/server/chunks/_server.ts-CS73tiTY.js.map +1 -0
  210. package/build/server/chunks/_server.ts-CWwgmo8z.js +33 -0
  211. package/build/server/chunks/_server.ts-CWwgmo8z.js.map +1 -0
  212. package/build/server/chunks/_server.ts-CXzZeGlQ.js +55 -0
  213. package/build/server/chunks/_server.ts-CXzZeGlQ.js.map +1 -0
  214. package/build/server/chunks/_server.ts-C_kseo_y.js +72 -0
  215. package/build/server/chunks/_server.ts-C_kseo_y.js.map +1 -0
  216. package/build/server/chunks/_server.ts-Cbk-UThV.js +73 -0
  217. package/build/server/chunks/_server.ts-Cbk-UThV.js.map +1 -0
  218. package/build/server/chunks/_server.ts-CboRRTK1.js +139 -0
  219. package/build/server/chunks/_server.ts-CboRRTK1.js.map +1 -0
  220. package/build/server/chunks/_server.ts-CgD8-EFl.js +52 -0
  221. package/build/server/chunks/_server.ts-CgD8-EFl.js.map +1 -0
  222. package/build/server/chunks/_server.ts-Ci-q0BiD.js +79 -0
  223. package/build/server/chunks/_server.ts-Ci-q0BiD.js.map +1 -0
  224. package/build/server/chunks/_server.ts-Cn7ahHlk.js +44 -0
  225. package/build/server/chunks/_server.ts-Cn7ahHlk.js.map +1 -0
  226. package/build/server/chunks/_server.ts-Cy36-qGT.js +60 -0
  227. package/build/server/chunks/_server.ts-Cy36-qGT.js.map +1 -0
  228. package/build/server/chunks/_server.ts-CyFZ9OZQ.js +97 -0
  229. package/build/server/chunks/_server.ts-CyFZ9OZQ.js.map +1 -0
  230. package/build/server/chunks/_server.ts-D-UAqhor.js +33 -0
  231. package/build/server/chunks/_server.ts-D-UAqhor.js.map +1 -0
  232. package/build/server/chunks/_server.ts-D1cb1hmF.js +90 -0
  233. package/build/server/chunks/_server.ts-D1cb1hmF.js.map +1 -0
  234. package/build/server/chunks/_server.ts-D33gvU5B.js +65 -0
  235. package/build/server/chunks/_server.ts-D33gvU5B.js.map +1 -0
  236. package/build/server/chunks/_server.ts-DDwiNChJ.js +88 -0
  237. package/build/server/chunks/_server.ts-DDwiNChJ.js.map +1 -0
  238. package/build/server/chunks/_server.ts-DEnxvwcJ.js +46 -0
  239. package/build/server/chunks/_server.ts-DEnxvwcJ.js.map +1 -0
  240. package/build/server/chunks/_server.ts-DHXmcRrP.js +41 -0
  241. package/build/server/chunks/_server.ts-DHXmcRrP.js.map +1 -0
  242. package/build/server/chunks/_server.ts-DQxY-pHZ.js +64 -0
  243. package/build/server/chunks/_server.ts-DQxY-pHZ.js.map +1 -0
  244. package/build/server/chunks/_server.ts-DXNJ2LJu.js +83 -0
  245. package/build/server/chunks/_server.ts-DXNJ2LJu.js.map +1 -0
  246. package/build/server/chunks/_server.ts-Dbly1Fe-.js +96 -0
  247. package/build/server/chunks/_server.ts-Dbly1Fe-.js.map +1 -0
  248. package/build/server/chunks/_server.ts-DffjWMNC.js +53 -0
  249. package/build/server/chunks/_server.ts-DffjWMNC.js.map +1 -0
  250. package/build/server/chunks/_server.ts-Di-8UJYw.js +40 -0
  251. package/build/server/chunks/_server.ts-Di-8UJYw.js.map +1 -0
  252. package/build/server/chunks/_server.ts-DsEzCr9k.js +109 -0
  253. package/build/server/chunks/_server.ts-DsEzCr9k.js.map +1 -0
  254. package/build/server/chunks/_server.ts-DwXd92Ow.js +63 -0
  255. package/build/server/chunks/_server.ts-DwXd92Ow.js.map +1 -0
  256. package/build/server/chunks/_server.ts-DwjjO7L5.js +41 -0
  257. package/build/server/chunks/_server.ts-DwjjO7L5.js.map +1 -0
  258. package/build/server/chunks/_server.ts-DyEbcQS0.js +62 -0
  259. package/build/server/chunks/_server.ts-DyEbcQS0.js.map +1 -0
  260. package/build/server/chunks/_server.ts-HxcM6xQA.js +70 -0
  261. package/build/server/chunks/_server.ts-HxcM6xQA.js.map +1 -0
  262. package/build/server/chunks/_server.ts-JItoNB1Z.js +57 -0
  263. package/build/server/chunks/_server.ts-JItoNB1Z.js.map +1 -0
  264. package/build/server/chunks/_server.ts-KpT_vKKo.js +77 -0
  265. package/build/server/chunks/_server.ts-KpT_vKKo.js.map +1 -0
  266. package/build/server/chunks/_server.ts-WbY7XmtT.js +157 -0
  267. package/build/server/chunks/_server.ts-WbY7XmtT.js.map +1 -0
  268. package/build/server/chunks/_server.ts-Yy0BWsSd.js +70 -0
  269. package/build/server/chunks/_server.ts-Yy0BWsSd.js.map +1 -0
  270. package/build/server/chunks/_server.ts-b9yNYKW6.js +49 -0
  271. package/build/server/chunks/_server.ts-b9yNYKW6.js.map +1 -0
  272. package/build/server/chunks/_server.ts-bAJXjaCc.js +42 -0
  273. package/build/server/chunks/_server.ts-bAJXjaCc.js.map +1 -0
  274. package/build/server/chunks/_server.ts-cwRl-tZ-.js +40 -0
  275. package/build/server/chunks/_server.ts-cwRl-tZ-.js.map +1 -0
  276. package/build/server/chunks/_server.ts-hMTx0DC3.js +159 -0
  277. package/build/server/chunks/_server.ts-hMTx0DC3.js.map +1 -0
  278. package/build/server/chunks/_server.ts-l_HoZ2_I.js +163 -0
  279. package/build/server/chunks/_server.ts-l_HoZ2_I.js.map +1 -0
  280. package/build/server/chunks/_server.ts-uLRX2uy0.js +107 -0
  281. package/build/server/chunks/_server.ts-uLRX2uy0.js.map +1 -0
  282. package/build/server/chunks/_server.ts-uWfb47S6.js +204 -0
  283. package/build/server/chunks/_server.ts-uWfb47S6.js.map +1 -0
  284. package/build/server/chunks/addon-helpers-Bnj3aKJ2.js +49 -0
  285. package/build/server/chunks/addon-helpers-Bnj3aKJ2.js.map +1 -0
  286. package/build/server/chunks/chunk-CLZ62Ad-.js +18 -0
  287. package/build/server/chunks/chunk-CLZ62Ad-.js.map +1 -0
  288. package/build/server/chunks/coercion-TNFJisCC.js +34 -0
  289. package/build/server/chunks/coercion-TNFJisCC.js.map +1 -0
  290. package/build/server/chunks/config-CEYPfvQh.js +121 -0
  291. package/build/server/chunks/config-CEYPfvQh.js.map +1 -0
  292. package/build/server/chunks/dev-DjANv7AF.js +4389 -0
  293. package/build/server/chunks/dev-DjANv7AF.js.map +1 -0
  294. package/build/server/chunks/docker-sGFTjRfy.js +20 -0
  295. package/build/server/chunks/docker-sGFTjRfy.js.map +1 -0
  296. package/build/server/chunks/endpoints-L7Wjvq44.js +340 -0
  297. package/build/server/chunks/endpoints-L7Wjvq44.js.map +1 -0
  298. package/build/server/chunks/environment-BnT49Gi3.js +36 -0
  299. package/build/server/chunks/environment-BnT49Gi3.js.map +1 -0
  300. package/build/server/chunks/error.svelte-PJnhZZCy.js +16 -0
  301. package/build/server/chunks/error.svelte-PJnhZZCy.js.map +1 -0
  302. package/build/server/chunks/exports-D1quPX8S.js +124 -0
  303. package/build/server/chunks/exports-D1quPX8S.js.map +1 -0
  304. package/build/server/chunks/helpers-5jd3ccud.js +226 -0
  305. package/build/server/chunks/helpers-5jd3ccud.js.map +1 -0
  306. package/build/server/chunks/hooks.server-Al9-eO5K.js +82 -0
  307. package/build/server/chunks/hooks.server-Al9-eO5K.js.map +1 -0
  308. package/build/server/chunks/http-D5xo_m60.js +31 -0
  309. package/build/server/chunks/http-D5xo_m60.js.map +1 -0
  310. package/build/server/chunks/internal-CJBOAkaQ.js +1544 -0
  311. package/build/server/chunks/internal-CJBOAkaQ.js.map +1 -0
  312. package/build/server/chunks/serial-queue-D9FEpYVv.js +22 -0
  313. package/build/server/chunks/serial-queue-D9FEpYVv.js.map +1 -0
  314. package/build/server/chunks/setup-deploy-UKTSVAC0.js +529 -0
  315. package/build/server/chunks/setup-deploy-UKTSVAC0.js.map +1 -0
  316. package/build/server/chunks/src-FpMyngcw.js +14064 -0
  317. package/build/server/chunks/src-FpMyngcw.js.map +1 -0
  318. package/build/server/chunks/state-BI-lJPhE.js +203 -0
  319. package/build/server/chunks/state-BI-lJPhE.js.map +1 -0
  320. package/build/server/chunks/utils-BSRjJDrZ.js +150 -0
  321. package/build/server/chunks/utils-BSRjJDrZ.js.map +1 -0
  322. package/build/server/chunks/voice-state.svelte-CQp8u0bn.js +437 -0
  323. package/build/server/chunks/voice-state.svelte-CQp8u0bn.js.map +1 -0
  324. package/build/server/index.js +4359 -0
  325. package/build/server/index.js.map +1 -0
  326. package/build/server/manifest.js +570 -0
  327. package/build/server/manifest.js.map +1 -0
  328. package/build/shims.js +32 -0
  329. package/package.json +61 -0
@@ -0,0 +1,4389 @@
1
+ //#region ../../node_modules/.bun/devalue@5.8.1/node_modules/devalue/src/constants.js
2
+ var MAX_ARRAY_LEN = 2 ** 32 - 1;
3
+ var MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
4
+ //#endregion
5
+ //#region ../../node_modules/.bun/devalue@5.8.1/node_modules/devalue/src/utils.js
6
+ /** @type {Record<string, string>} */
7
+ var escaped = {
8
+ "<": "\\u003C",
9
+ "\\": "\\\\",
10
+ "\b": "\\b",
11
+ "\f": "\\f",
12
+ "\n": "\\n",
13
+ "\r": "\\r",
14
+ " ": "\\t",
15
+ "\u2028": "\\u2028",
16
+ "\u2029": "\\u2029"
17
+ };
18
+ var DevalueError = class extends Error {
19
+ /**
20
+ * @param {string} message
21
+ * @param {string[]} keys
22
+ * @param {any} [value] - The value that failed to be serialized
23
+ * @param {any} [root] - The root value being serialized
24
+ */
25
+ constructor(message, keys, value, root) {
26
+ super(message);
27
+ this.name = "DevalueError";
28
+ this.path = keys.join("");
29
+ this.value = value;
30
+ this.root = root;
31
+ }
32
+ };
33
+ /** @param {any} thing */
34
+ function is_primitive(thing) {
35
+ return thing === null || typeof thing !== "object" && typeof thing !== "function";
36
+ }
37
+ var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
38
+ /** @param {any} thing */
39
+ function is_plain_object(thing) {
40
+ const proto = Object.getPrototypeOf(thing);
41
+ return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
42
+ }
43
+ /** @param {any} thing */
44
+ function get_type(thing) {
45
+ return Object.prototype.toString.call(thing).slice(8, -1);
46
+ }
47
+ /** @param {string} char */
48
+ function get_escaped_char(char) {
49
+ switch (char) {
50
+ case "\"": return "\\\"";
51
+ case "<": return "\\u003C";
52
+ case "\\": return "\\\\";
53
+ case "\n": return "\\n";
54
+ case "\r": return "\\r";
55
+ case " ": return "\\t";
56
+ case "\b": return "\\b";
57
+ case "\f": return "\\f";
58
+ case "\u2028": return "\\u2028";
59
+ case "\u2029": return "\\u2029";
60
+ default: return char < " " ? `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
61
+ }
62
+ }
63
+ /** @param {string} str */
64
+ function stringify_string(str) {
65
+ let result = "";
66
+ let last_pos = 0;
67
+ const len = str.length;
68
+ for (let i = 0; i < len; i += 1) {
69
+ const char = str[i];
70
+ const replacement = get_escaped_char(char);
71
+ if (replacement) {
72
+ result += str.slice(last_pos, i) + replacement;
73
+ last_pos = i + 1;
74
+ }
75
+ }
76
+ return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
77
+ }
78
+ /** @param {Record<string | symbol, any>} object */
79
+ function enumerable_symbols(object) {
80
+ return Object.getOwnPropertySymbols(object).filter((symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable);
81
+ }
82
+ var is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
83
+ /** @param {string} key */
84
+ function stringify_key(key) {
85
+ return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
86
+ }
87
+ /** @param {number} n */
88
+ function is_valid_array_index(n) {
89
+ if (!Number.isInteger(n)) return false;
90
+ if (n < 0) return false;
91
+ if (n > MAX_ARRAY_INDEX) return false;
92
+ return true;
93
+ }
94
+ /** @param {number} n */
95
+ function is_valid_array_len(n) {
96
+ if (!Number.isInteger(n)) return false;
97
+ if (n < 0) return false;
98
+ if (n > MAX_ARRAY_LEN) return false;
99
+ return true;
100
+ }
101
+ /** @param {string} s */
102
+ function is_valid_array_index_string(s) {
103
+ if (s.length === 0) return false;
104
+ if (s.length > 1 && s.charCodeAt(0) === 48) return false;
105
+ for (let i = 0; i < s.length; i++) {
106
+ const c = s.charCodeAt(i);
107
+ if (c < 48 || c > 57) return false;
108
+ }
109
+ return is_valid_array_index(+s);
110
+ }
111
+ /**
112
+ * Finds the populated indices of an array.
113
+ * @param {unknown[]} array
114
+ */
115
+ function valid_array_indices(array) {
116
+ const keys = Object.keys(array);
117
+ for (var i = keys.length - 1; i >= 0; i--) if (is_valid_array_index_string(keys[i])) break;
118
+ keys.length = i + 1;
119
+ return keys;
120
+ }
121
+ //#endregion
122
+ //#region ../../node_modules/.bun/devalue@5.8.1/node_modules/devalue/src/uneval.js
123
+ var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
124
+ var unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
125
+ var 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)$/;
126
+ /**
127
+ * Turn a value into the JavaScript that creates an equivalent value
128
+ * @param {any} value
129
+ * @param {(value: any, uneval: (value: any) => string) => string | void} [replacer]
130
+ */
131
+ function uneval(value, replacer) {
132
+ const counts = /* @__PURE__ */ new Map();
133
+ /** @type {string[]} */
134
+ const keys = [];
135
+ const custom = /* @__PURE__ */ new Map();
136
+ /** @param {any} thing */
137
+ function walk(thing) {
138
+ if (!is_primitive(thing)) {
139
+ if (counts.has(thing)) {
140
+ counts.set(thing, counts.get(thing) + 1);
141
+ return;
142
+ }
143
+ counts.set(thing, 1);
144
+ if (replacer) {
145
+ const str = replacer(thing, (value) => uneval(value, replacer));
146
+ if (typeof str === "string") {
147
+ custom.set(thing, str);
148
+ return;
149
+ }
150
+ }
151
+ if (typeof thing === "function") throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
152
+ switch (get_type(thing)) {
153
+ case "Number":
154
+ case "BigInt":
155
+ case "String":
156
+ case "Boolean":
157
+ case "Date":
158
+ case "RegExp":
159
+ case "URL":
160
+ case "URLSearchParams": return;
161
+ case "Array":
162
+ /** @type {any[]} */ thing.forEach((value, i) => {
163
+ keys.push(`[${i}]`);
164
+ walk(value);
165
+ keys.pop();
166
+ });
167
+ break;
168
+ case "Set":
169
+ Array.from(thing).forEach(walk);
170
+ break;
171
+ case "Map":
172
+ for (const [key, value] of thing) {
173
+ keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`);
174
+ walk(value);
175
+ keys.pop();
176
+ }
177
+ break;
178
+ case "Int8Array":
179
+ case "Uint8Array":
180
+ case "Uint8ClampedArray":
181
+ case "Int16Array":
182
+ case "Uint16Array":
183
+ case "Float16Array":
184
+ case "Int32Array":
185
+ case "Uint32Array":
186
+ case "Float32Array":
187
+ case "Float64Array":
188
+ case "BigInt64Array":
189
+ case "BigUint64Array":
190
+ case "DataView":
191
+ walk(thing.buffer);
192
+ return;
193
+ case "ArrayBuffer": return;
194
+ case "Temporal.Duration":
195
+ case "Temporal.Instant":
196
+ case "Temporal.PlainDate":
197
+ case "Temporal.PlainTime":
198
+ case "Temporal.PlainDateTime":
199
+ case "Temporal.PlainMonthDay":
200
+ case "Temporal.PlainYearMonth":
201
+ case "Temporal.ZonedDateTime": return;
202
+ default:
203
+ if (!is_plain_object(thing)) throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
204
+ if (enumerable_symbols(thing).length > 0) throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
205
+ for (const key of Object.keys(thing)) {
206
+ if (key === "__proto__") throw new DevalueError(`Cannot stringify objects with __proto__ keys`, keys, thing, value);
207
+ keys.push(stringify_key(key));
208
+ walk(thing[key]);
209
+ keys.pop();
210
+ }
211
+ }
212
+ } else if (typeof thing === "symbol") throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
213
+ }
214
+ walk(value);
215
+ const names = /* @__PURE__ */ new Map();
216
+ Array.from(counts).filter((entry) => entry[1] > 1).sort((a, b) => b[1] - a[1]).forEach((entry, i) => {
217
+ names.set(entry[0], get_name(i));
218
+ });
219
+ /**
220
+ * @param {any} thing
221
+ * @returns {string}
222
+ */
223
+ function stringify(thing) {
224
+ if (names.has(thing)) return names.get(thing);
225
+ if (is_primitive(thing)) return stringify_primitive(thing);
226
+ if (custom.has(thing)) return custom.get(thing);
227
+ const type = get_type(thing);
228
+ switch (type) {
229
+ case "Number":
230
+ case "String":
231
+ case "Boolean":
232
+ case "BigInt": return `Object(${stringify(thing.valueOf())})`;
233
+ case "RegExp":
234
+ const { source, flags } = thing;
235
+ return flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
236
+ case "Date": return `new Date(${thing.getTime()})`;
237
+ case "URL": return `new URL(${stringify_string(thing.toString())})`;
238
+ case "URLSearchParams": return `new URLSearchParams(${stringify_string(thing.toString())})`;
239
+ case "Array": {
240
+ let has_holes = false;
241
+ let result = "[";
242
+ for (let i = 0; i < thing.length; i += 1) {
243
+ if (i > 0) result += ",";
244
+ if (Object.hasOwn(thing, i)) result += stringify(thing[i]);
245
+ else if (!has_holes) {
246
+ const populated_keys = valid_array_indices(thing);
247
+ const population = populated_keys.length;
248
+ const d = String(thing.length).length;
249
+ if (thing.length + 2 > 25 + d + population * (d + 2)) {
250
+ const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(",");
251
+ return `Object.assign(Array(${thing.length}),{${entries}})`;
252
+ }
253
+ has_holes = true;
254
+ i -= 1;
255
+ }
256
+ }
257
+ const tail = thing.length === 0 || thing.length - 1 in thing ? "" : ",";
258
+ return result + tail + "]";
259
+ }
260
+ case "Set":
261
+ case "Map": return `new ${type}([${Array.from(thing).map(stringify).join(",")}])`;
262
+ case "Int8Array":
263
+ case "Uint8Array":
264
+ case "Uint8ClampedArray":
265
+ case "Int16Array":
266
+ case "Uint16Array":
267
+ case "Float16Array":
268
+ case "Int32Array":
269
+ case "Uint32Array":
270
+ case "Float32Array":
271
+ case "Float64Array":
272
+ case "BigInt64Array":
273
+ case "BigUint64Array": {
274
+ let str = `new ${type}`;
275
+ if (!names.has(thing.buffer)) {
276
+ const array = new thing.constructor(thing.buffer);
277
+ str += `([${array}])`;
278
+ } else str += `(${stringify(thing.buffer)})`;
279
+ if (thing.byteLength !== thing.buffer.byteLength) {
280
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
281
+ const end = start + thing.length;
282
+ str += `.subarray(${start},${end})`;
283
+ }
284
+ return str;
285
+ }
286
+ case "DataView": {
287
+ let str = `new DataView`;
288
+ if (!names.has(thing.buffer)) str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
289
+ else str += `(${stringify(thing.buffer)}`;
290
+ if (thing.byteLength !== thing.buffer.byteLength) str += `,${thing.startOffset},${thing.byteLength}`;
291
+ return str + ")";
292
+ }
293
+ case "ArrayBuffer": return `new Uint8Array([${new Uint8Array(thing).toString()}]).buffer`;
294
+ case "Temporal.Duration":
295
+ case "Temporal.Instant":
296
+ case "Temporal.PlainDate":
297
+ case "Temporal.PlainTime":
298
+ case "Temporal.PlainDateTime":
299
+ case "Temporal.PlainMonthDay":
300
+ case "Temporal.PlainYearMonth":
301
+ case "Temporal.ZonedDateTime": return `${type}.from(${stringify_string(thing.toString())})`;
302
+ default:
303
+ const keys = Object.keys(thing);
304
+ const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(",");
305
+ if (Object.getPrototypeOf(thing) === null) return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
306
+ return `{${obj}}`;
307
+ }
308
+ }
309
+ const str = stringify(value);
310
+ if (names.size) {
311
+ /** @type {string[]} */
312
+ const params = [];
313
+ /** @type {string[]} */
314
+ const statements = [];
315
+ /** @type {string[]} */
316
+ const values = [];
317
+ names.forEach((name, thing) => {
318
+ params.push(name);
319
+ if (custom.has(thing)) {
320
+ values.push(custom.get(thing));
321
+ return;
322
+ }
323
+ if (is_primitive(thing)) {
324
+ values.push(stringify_primitive(thing));
325
+ return;
326
+ }
327
+ const type = get_type(thing);
328
+ switch (type) {
329
+ case "Number":
330
+ case "String":
331
+ case "Boolean":
332
+ case "BigInt":
333
+ values.push(`Object(${stringify(thing.valueOf())})`);
334
+ break;
335
+ case "RegExp":
336
+ const { source, flags } = thing;
337
+ const regexp = flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
338
+ values.push(regexp);
339
+ break;
340
+ case "Date":
341
+ values.push(`new Date(${thing.getTime()})`);
342
+ break;
343
+ case "URL":
344
+ values.push(`new URL(${stringify_string(thing.toString())})`);
345
+ break;
346
+ case "URLSearchParams":
347
+ values.push(`new URLSearchParams(${stringify_string(thing.toString())})`);
348
+ break;
349
+ case "Array":
350
+ values.push(`Array(${thing.length})`);
351
+ /** @type {any[]} */ thing.forEach((v, i) => {
352
+ statements.push(`${name}[${i}]=${stringify(v)}`);
353
+ });
354
+ break;
355
+ case "Set":
356
+ values.push(`new Set`);
357
+ statements.push(`${name}.${Array.from(thing).map((v) => `add(${stringify(v)})`).join(".")}`);
358
+ break;
359
+ case "Map":
360
+ values.push(`new Map`);
361
+ statements.push(`${name}.${Array.from(thing).map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`).join(".")}`);
362
+ break;
363
+ case "Int8Array":
364
+ case "Uint8Array":
365
+ case "Uint8ClampedArray":
366
+ case "Int16Array":
367
+ case "Uint16Array":
368
+ case "Float16Array":
369
+ case "Int32Array":
370
+ case "Uint32Array":
371
+ case "Float32Array":
372
+ case "Float64Array":
373
+ case "BigInt64Array":
374
+ case "BigUint64Array": {
375
+ let str = `new ${type}`;
376
+ if (!names.has(thing.buffer)) {
377
+ const array = new thing.constructor(thing.buffer);
378
+ str += `([${array}])`;
379
+ } else str += `(${stringify(thing.buffer)})`;
380
+ if (thing.byteLength !== thing.buffer.byteLength) {
381
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
382
+ const end = start + thing.length;
383
+ str += `.subarray(${start},${end})`;
384
+ }
385
+ values.push(`{}`);
386
+ statements.push(`${name}=${str}`);
387
+ break;
388
+ }
389
+ case "DataView": {
390
+ let str = `new DataView`;
391
+ if (!names.has(thing.buffer)) str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
392
+ else str += `(${stringify(thing.buffer)}`;
393
+ if (thing.byteLength !== thing.buffer.byteLength) str += `,${thing.byteOffset},${thing.byteLength}`;
394
+ str += ")";
395
+ values.push(`{}`);
396
+ statements.push(`${name}=${str}`);
397
+ break;
398
+ }
399
+ case "ArrayBuffer":
400
+ values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
401
+ break;
402
+ default:
403
+ values.push(Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}");
404
+ Object.keys(thing).forEach((key) => {
405
+ statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
406
+ });
407
+ }
408
+ });
409
+ statements.push(`return ${str}`);
410
+ return `(function(${params.join(",")}){${statements.join(";")}}(${values.join(",")}))`;
411
+ } else return str;
412
+ }
413
+ /** @param {number} num */
414
+ function get_name(num) {
415
+ let name = "";
416
+ do {
417
+ name = chars[num % 54] + name;
418
+ num = ~~(num / 54) - 1;
419
+ } while (num >= 0);
420
+ return reserved.test(name) ? `${name}0` : name;
421
+ }
422
+ /** @param {string} c */
423
+ function escape_unsafe_char(c) {
424
+ return escaped[c] || c;
425
+ }
426
+ /** @param {string} str */
427
+ function escape_unsafe_chars(str) {
428
+ return str.replace(unsafe_chars, escape_unsafe_char);
429
+ }
430
+ /** @param {string} key */
431
+ function safe_key(key) {
432
+ return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
433
+ }
434
+ /** @param {string} key */
435
+ function safe_prop(key) {
436
+ return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? `.${key}` : `[${escape_unsafe_chars(JSON.stringify(key))}]`;
437
+ }
438
+ /** @param {any} thing */
439
+ function stringify_primitive(thing) {
440
+ const type = typeof thing;
441
+ if (type === "string") return stringify_string(thing);
442
+ if (thing === void 0) return "void 0";
443
+ if (thing === 0 && 1 / thing < 0) return "-0";
444
+ const str = String(thing);
445
+ if (type === "number") return str.replace(/^(-)?0\./, "$1.");
446
+ if (type === "bigint") return thing + "n";
447
+ return str;
448
+ }
449
+ //#endregion
450
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/shared/errors.js
451
+ /**
452
+ * Cannot use `%name%(...)` unless the `experimental.async` compiler option is `true`
453
+ * @param {string} name
454
+ * @returns {never}
455
+ */
456
+ function experimental_async_required(name) {
457
+ throw new Error(`https://svelte.dev/e/experimental_async_required`);
458
+ }
459
+ /**
460
+ * `%name%(...)` can only be used during component initialisation
461
+ * @param {string} name
462
+ * @returns {never}
463
+ */
464
+ function lifecycle_outside_component(name) {
465
+ throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
466
+ }
467
+ /**
468
+ * Context was not set in a parent component
469
+ * @returns {never}
470
+ */
471
+ function missing_context() {
472
+ throw new Error(`https://svelte.dev/e/missing_context`);
473
+ }
474
+ /**
475
+ * Encountered asynchronous work while rendering synchronously.
476
+ * @returns {never}
477
+ */
478
+ function await_invalid() {
479
+ const error = /* @__PURE__ */ new Error(`await_invalid\nEncountered asynchronous work while rendering synchronously.\nhttps://svelte.dev/e/await_invalid`);
480
+ error.name = "Svelte error";
481
+ throw error;
482
+ }
483
+ /**
484
+ * Failed to serialize `hydratable` data for key `%key%`.
485
+ *
486
+ * `hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises.
487
+ *
488
+ * Cause:
489
+ * %stack%
490
+ * @param {string} key
491
+ * @param {string} stack
492
+ * @returns {never}
493
+ */
494
+ function hydratable_serialization_failed(key, stack) {
495
+ const error = /* @__PURE__ */ new Error(`hydratable_serialization_failed\nFailed to serialize \`hydratable\` data for key \`${key}\`.
496
+
497
+ \`hydratable\` can serialize anything [\`uneval\` from \`devalue\`](https://npmjs.com/package/uneval) can, plus Promises.
498
+
499
+ Cause:
500
+ ${stack}\nhttps://svelte.dev/e/hydratable_serialization_failed`);
501
+ error.name = "Svelte error";
502
+ throw error;
503
+ }
504
+ /**
505
+ * `csp.nonce` was set while `csp.hash` was `true`. These options cannot be used simultaneously.
506
+ * @returns {never}
507
+ */
508
+ function invalid_csp() {
509
+ const error = /* @__PURE__ */ new Error(`invalid_csp\n\`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.\nhttps://svelte.dev/e/invalid_csp`);
510
+ error.name = "Svelte error";
511
+ throw error;
512
+ }
513
+ /**
514
+ * The `idPrefix` option cannot include `--`.
515
+ * @returns {never}
516
+ */
517
+ function invalid_id_prefix() {
518
+ const error = /* @__PURE__ */ new Error(`invalid_id_prefix\nThe \`idPrefix\` option cannot include \`--\`.\nhttps://svelte.dev/e/invalid_id_prefix`);
519
+ error.name = "Svelte error";
520
+ throw error;
521
+ }
522
+ /**
523
+ * `%name%(...)` is not available on the server
524
+ * @param {string} name
525
+ * @returns {never}
526
+ */
527
+ function lifecycle_function_unavailable(name) {
528
+ const error = /* @__PURE__ */ new Error(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server\nhttps://svelte.dev/e/lifecycle_function_unavailable`);
529
+ error.name = "Svelte error";
530
+ throw error;
531
+ }
532
+ /**
533
+ * Could not resolve `render` context.
534
+ * @returns {never}
535
+ */
536
+ function server_context_required() {
537
+ const error = /* @__PURE__ */ new Error(`server_context_required\nCould not resolve \`render\` context.\nhttps://svelte.dev/e/server_context_required`);
538
+ error.name = "Svelte error";
539
+ throw error;
540
+ }
541
+ //#endregion
542
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/context.js
543
+ /** @import { SSRContext } from '#server' */
544
+ /** @type {SSRContext | null} */
545
+ var ssr_context = null;
546
+ /** @param {SSRContext | null} v */
547
+ function set_ssr_context(v) {
548
+ ssr_context = v;
549
+ }
550
+ /**
551
+ * @template T
552
+ * @returns {[() => T, (context: T) => T]}
553
+ * @since 5.40.0
554
+ */
555
+ function createContext() {
556
+ const key = {};
557
+ return [() => {
558
+ if (!hasContext(key)) missing_context();
559
+ return getContext(key);
560
+ }, (context) => setContext(key, context)];
561
+ }
562
+ /**
563
+ * @template T
564
+ * @param {any} key
565
+ * @returns {T}
566
+ */
567
+ function getContext(key) {
568
+ return get_or_init_context_map().get(key);
569
+ }
570
+ /**
571
+ * @template T
572
+ * @param {any} key
573
+ * @param {T} context
574
+ * @returns {T}
575
+ */
576
+ function setContext(key, context) {
577
+ get_or_init_context_map().set(key, context);
578
+ return context;
579
+ }
580
+ /**
581
+ * @param {any} key
582
+ * @returns {boolean}
583
+ */
584
+ function hasContext(key) {
585
+ return get_or_init_context_map().has(key);
586
+ }
587
+ /** @returns {Map<any, any>} */
588
+ function getAllContexts() {
589
+ return get_or_init_context_map();
590
+ }
591
+ /**
592
+ * @param {string} name
593
+ * @returns {Map<unknown, unknown>}
594
+ */
595
+ function get_or_init_context_map(name) {
596
+ if (ssr_context === null) lifecycle_outside_component();
597
+ return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
598
+ }
599
+ /**
600
+ * @param {Function} [fn]
601
+ */
602
+ function push$1(fn) {
603
+ ssr_context = {
604
+ p: ssr_context,
605
+ c: null,
606
+ r: null
607
+ };
608
+ }
609
+ function pop$1() {
610
+ ssr_context = ssr_context.p;
611
+ }
612
+ /**
613
+ * @param {SSRContext} ssr_context
614
+ * @returns {Map<unknown, unknown> | null}
615
+ */
616
+ function get_parent_context(ssr_context) {
617
+ let parent = ssr_context.p;
618
+ while (parent !== null) {
619
+ const context_map = parent.c;
620
+ if (context_map !== null) return context_map;
621
+ parent = parent.p;
622
+ }
623
+ return null;
624
+ }
625
+ //#endregion
626
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/shared/utils.js
627
+ var is_array = Array.isArray;
628
+ var index_of = Array.prototype.indexOf;
629
+ var includes = Array.prototype.includes;
630
+ var array_from = Array.from;
631
+ var define_property = Object.defineProperty;
632
+ var get_descriptor = Object.getOwnPropertyDescriptor;
633
+ var object_prototype = Object.prototype;
634
+ var array_prototype = Array.prototype;
635
+ var get_prototype_of = Object.getPrototypeOf;
636
+ var is_extensible = Object.isExtensible;
637
+ var has_own_property = Object.prototype.hasOwnProperty;
638
+ var noop = () => {};
639
+ /** @param {Function} fn */
640
+ function run(fn) {
641
+ return fn();
642
+ }
643
+ /** @param {Array<() => void>} arr */
644
+ function run_all(arr) {
645
+ for (var i = 0; i < arr.length; i++) arr[i]();
646
+ }
647
+ /**
648
+ * TODO replace with Promise.withResolvers once supported widely enough
649
+ * @template [T=void]
650
+ */
651
+ function deferred() {
652
+ /** @type {(value: T) => void} */
653
+ var resolve;
654
+ /** @type {(reason: any) => void} */
655
+ var reject;
656
+ return {
657
+ promise: new Promise((res, rej) => {
658
+ resolve = res;
659
+ reject = rej;
660
+ }),
661
+ resolve,
662
+ reject
663
+ };
664
+ }
665
+ var CLEAN = 1024;
666
+ var DIRTY = 2048;
667
+ var MAYBE_DIRTY = 4096;
668
+ var INERT = 8192;
669
+ var DESTROYED = 16384;
670
+ /** Set once a reaction has run for the first time */
671
+ var REACTION_RAN = 32768;
672
+ /** Effect is in the process of getting destroyed. Can be observed in child teardown functions */
673
+ var DESTROYING = 1 << 25;
674
+ /**
675
+ * 'Transparent' effects do not create a transition boundary.
676
+ * This is on a block effect 99% of the time but may also be on a branch effect if its parent block effect was pruned
677
+ */
678
+ var EFFECT_TRANSPARENT = 65536;
679
+ var EFFECT_PRESERVED = 1 << 19;
680
+ var USER_EFFECT = 1 << 20;
681
+ /**
682
+ * Tells that we marked this derived and its reactions as visited during the "mark as (maybe) dirty"-phase.
683
+ * Will be lifted during execution of the derived and during checking its dirty state (both are necessary
684
+ * because a derived might be checked but not executed). This is a pure performance optimization flag and
685
+ * should not be used for any other purpose!
686
+ */
687
+ var WAS_MARKED = 65536;
688
+ var REACTION_IS_UPDATING = 1 << 21;
689
+ var ERROR_VALUE = 1 << 23;
690
+ var STATE_SYMBOL = Symbol("$state");
691
+ var LEGACY_PROPS = Symbol("legacy props");
692
+ var ATTRIBUTES_CACHE = Symbol("attributes");
693
+ var CLASS_CACHE = Symbol("class");
694
+ var STYLE_CACHE = Symbol("style");
695
+ var TEXT_CACHE = Symbol("text");
696
+ /** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
697
+ var STALE_REACTION = new class StaleReactionError extends Error {
698
+ name = "StaleReactionError";
699
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
700
+ }();
701
+ //#endregion
702
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/abort-signal.js
703
+ /** @type {AbortController | null} */
704
+ var controller = null;
705
+ function abort() {
706
+ controller?.abort(STALE_REACTION);
707
+ controller = null;
708
+ }
709
+ function getAbortSignal() {
710
+ return (controller ??= new AbortController()).signal;
711
+ }
712
+ /** @returns {RenderContext} */
713
+ function get_render_context() {
714
+ const store = als?.getStore();
715
+ server_context_required();
716
+ return store;
717
+ }
718
+ /** @type {AsyncLocalStorage<RenderContext | null> | null} */
719
+ var als = null;
720
+ //#endregion
721
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/constants.js
722
+ var HYDRATION_ERROR = {};
723
+ var UNINITIALIZED = Symbol("uninitialized");
724
+ /**
725
+ * A `hydratable` value with key `%key%` was created, but at least part of it was not used during the render.
726
+ *
727
+ * The `hydratable` was initialized in:
728
+ * %stack%
729
+ * @param {string} key
730
+ * @param {string} stack
731
+ */
732
+ function unresolved_hydratable(key, stack) {
733
+ console.warn(`https://svelte.dev/e/unresolved_hydratable`);
734
+ }
735
+ //#endregion
736
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/hydration.js
737
+ var BLOCK_OPEN = `<!--[-->`;
738
+ var BLOCK_CLOSE = `<!--]-->`;
739
+ var EMPTY_COMMENT = `<!---->`;
740
+ //#endregion
741
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/escaping.js
742
+ var ATTR_REGEX = /[&"<]/g;
743
+ var CONTENT_REGEX = /[&<]/g;
744
+ /**
745
+ * @template V
746
+ * @param {V} value
747
+ * @param {boolean} [is_attr]
748
+ */
749
+ function escape_html(value, is_attr) {
750
+ const str = String(value ?? "");
751
+ const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
752
+ pattern.lastIndex = 0;
753
+ let escaped = "";
754
+ let last = 0;
755
+ while (pattern.test(str)) {
756
+ const i = pattern.lastIndex - 1;
757
+ const ch = str[i];
758
+ escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === "\"" ? "&quot;" : "&lt;");
759
+ last = i + 1;
760
+ }
761
+ return escaped + str.substring(last);
762
+ }
763
+ //#endregion
764
+ //#region ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
765
+ function r(e) {
766
+ var t, f, n = "";
767
+ if ("string" == typeof e || "number" == typeof e) n += e;
768
+ else if ("object" == typeof e) if (Array.isArray(e)) {
769
+ var o = e.length;
770
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
771
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
772
+ return n;
773
+ }
774
+ function clsx$1() {
775
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
776
+ return n;
777
+ }
778
+ //#endregion
779
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/shared/attributes.js
780
+ /**
781
+ * `<div translate={false}>` should be rendered as `<div translate="no">` and _not_
782
+ * `<div translate="false">`, which is equivalent to `<div translate="yes">`. There
783
+ * may be other odd cases that need to be added to this list in future
784
+ * @type {Record<string, Map<any, string>>}
785
+ */
786
+ var replacements = { translate: new Map([[true, "yes"], [false, "no"]]) };
787
+ /**
788
+ * @template V
789
+ * @param {string} name
790
+ * @param {V} value
791
+ * @param {boolean} [is_boolean]
792
+ * @returns {string}
793
+ */
794
+ function attr(name, value, is_boolean = false) {
795
+ if (name === "hidden" && value !== "until-found") is_boolean = true;
796
+ if (value == null || !value && is_boolean) return "";
797
+ const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
798
+ return ` ${name}${is_boolean ? `=""` : `="${escape_html(normalized, true)}"`}`;
799
+ }
800
+ /**
801
+ * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.
802
+ * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)
803
+ * @param {any} value
804
+ */
805
+ function clsx(value) {
806
+ if (typeof value === "object") return clsx$1(value);
807
+ else return value ?? "";
808
+ }
809
+ var whitespace = [..." \n\r\f\xA0\v"];
810
+ /**
811
+ * @param {any} value
812
+ * @param {string | null} [hash]
813
+ * @param {Record<string, boolean>} [directives]
814
+ * @returns {string | null}
815
+ */
816
+ function to_class(value, hash, directives) {
817
+ var classname = value == null ? "" : "" + value;
818
+ if (hash) classname = classname ? classname + " " + hash : hash;
819
+ if (directives) {
820
+ for (var key of Object.keys(directives)) if (directives[key]) classname = classname ? classname + " " + key : key;
821
+ else if (classname.length) {
822
+ var len = key.length;
823
+ var a = 0;
824
+ while ((a = classname.indexOf(key, a)) >= 0) {
825
+ var b = a + len;
826
+ if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
827
+ else a = b;
828
+ }
829
+ }
830
+ }
831
+ return classname === "" ? null : classname;
832
+ }
833
+ /**
834
+ *
835
+ * @param {Record<string,any>} styles
836
+ * @param {boolean} important
837
+ */
838
+ function append_styles(styles, important = false) {
839
+ var separator = important ? " !important;" : ";";
840
+ var css = "";
841
+ for (var key of Object.keys(styles)) {
842
+ var value = styles[key];
843
+ if (value != null && value !== "") css += " " + key + ": " + value + separator;
844
+ }
845
+ return css;
846
+ }
847
+ /**
848
+ * @param {string} name
849
+ * @returns {string}
850
+ */
851
+ function to_css_name(name) {
852
+ if (name[0] !== "-" || name[1] !== "-") return name.toLowerCase();
853
+ return name;
854
+ }
855
+ /**
856
+ * @param {any} value
857
+ * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [styles]
858
+ * @returns {string | null}
859
+ */
860
+ function to_style(value, styles) {
861
+ if (styles) {
862
+ var new_style = "";
863
+ /** @type {Record<string,any> | undefined} */
864
+ var normal_styles;
865
+ /** @type {Record<string,any> | undefined} */
866
+ var important_styles;
867
+ if (Array.isArray(styles)) {
868
+ normal_styles = styles[0];
869
+ important_styles = styles[1];
870
+ } else normal_styles = styles;
871
+ if (value) {
872
+ value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
873
+ /** @type {boolean | '"' | "'"} */
874
+ var in_str = false;
875
+ var in_apo = 0;
876
+ var in_comment = false;
877
+ var reserved_names = [];
878
+ if (normal_styles) reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
879
+ if (important_styles) reserved_names.push(...Object.keys(important_styles).map(to_css_name));
880
+ var start_index = 0;
881
+ var name_index = -1;
882
+ const len = value.length;
883
+ for (var i = 0; i < len; i++) {
884
+ var c = value[i];
885
+ if (in_comment) {
886
+ if (c === "/" && value[i - 1] === "*") in_comment = false;
887
+ } else if (in_str) {
888
+ if (in_str === c) in_str = false;
889
+ } else if (c === "/" && value[i + 1] === "*") in_comment = true;
890
+ else if (c === "\"" || c === "'") in_str = c;
891
+ else if (c === "(") in_apo++;
892
+ else if (c === ")") in_apo--;
893
+ if (!in_comment && in_str === false && in_apo === 0) {
894
+ if (c === ":" && name_index === -1) name_index = i;
895
+ else if (c === ";" || i === len - 1) {
896
+ if (name_index !== -1) {
897
+ var name = to_css_name(value.substring(start_index, name_index).trim());
898
+ if (!reserved_names.includes(name)) {
899
+ if (c !== ";") i++;
900
+ var property = value.substring(start_index, i).trim();
901
+ new_style += " " + property + ";";
902
+ }
903
+ }
904
+ start_index = i + 1;
905
+ name_index = -1;
906
+ }
907
+ }
908
+ }
909
+ }
910
+ if (normal_styles) new_style += append_styles(normal_styles);
911
+ if (important_styles) new_style += append_styles(important_styles, true);
912
+ new_style = new_style.trim();
913
+ return new_style === "" ? null : new_style;
914
+ }
915
+ return value == null ? null : String(value);
916
+ }
917
+ /**
918
+ * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
919
+ * @returns {never}
920
+ */
921
+ function effect_update_depth_exceeded() {
922
+ throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
923
+ }
924
+ /**
925
+ * Failed to hydrate the application
926
+ * @returns {never}
927
+ */
928
+ function hydration_failed() {
929
+ throw new Error(`https://svelte.dev/e/hydration_failed`);
930
+ }
931
+ /**
932
+ * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
933
+ * @returns {never}
934
+ */
935
+ function state_descriptors_fixed() {
936
+ throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
937
+ }
938
+ /**
939
+ * Cannot set prototype of `$state` object
940
+ * @returns {never}
941
+ */
942
+ function state_prototype_fixed() {
943
+ throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
944
+ }
945
+ /**
946
+ * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
947
+ * @returns {never}
948
+ */
949
+ function state_unsafe_mutation() {
950
+ throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
951
+ }
952
+ /**
953
+ * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
954
+ * @returns {never}
955
+ */
956
+ function svelte_boundary_reset_onerror() {
957
+ throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
958
+ }
959
+ /**
960
+ * Reading a derived belonging to a now-destroyed effect may result in stale values
961
+ */
962
+ function derived_inert() {
963
+ console.warn(`https://svelte.dev/e/derived_inert`);
964
+ }
965
+ /**
966
+ * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%
967
+ * @param {string | undefined | null} [location]
968
+ */
969
+ function hydration_mismatch(location) {
970
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
971
+ }
972
+ /**
973
+ * A `<svelte:boundary>` `reset` function only resets the boundary the first time it is called
974
+ */
975
+ function svelte_boundary_reset_noop() {
976
+ console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
977
+ }
978
+ //#endregion
979
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/dom/hydration.js
980
+ /** @import { TemplateNode } from '#client' */
981
+ /**
982
+ * Use this variable to guard everything related to hydration code so it can be treeshaken out
983
+ * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.
984
+ */
985
+ var hydrating = false;
986
+ /** @param {boolean} value */
987
+ function set_hydrating(value) {
988
+ hydrating = value;
989
+ }
990
+ /**
991
+ * The node that is currently being hydrated. This starts out as the first node inside the opening
992
+ * <!--[--> comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.
993
+ * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the
994
+ * time we leave the block it is the closing comment, which serves as the block's anchor.
995
+ * @type {TemplateNode}
996
+ */
997
+ var hydrate_node;
998
+ /** @param {TemplateNode | null} node */
999
+ function set_hydrate_node(node) {
1000
+ if (node === null) {
1001
+ hydration_mismatch();
1002
+ throw HYDRATION_ERROR;
1003
+ }
1004
+ return hydrate_node = node;
1005
+ }
1006
+ function hydrate_next() {
1007
+ return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node));
1008
+ }
1009
+ function next(count = 1) {
1010
+ if (hydrating) {
1011
+ var i = count;
1012
+ var node = hydrate_node;
1013
+ while (i--) node = /* @__PURE__ */ get_next_sibling(node);
1014
+ hydrate_node = node;
1015
+ }
1016
+ }
1017
+ /**
1018
+ * Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment
1019
+ * @param {boolean} remove
1020
+ */
1021
+ function skip_nodes(remove = true) {
1022
+ var depth = 0;
1023
+ var node = hydrate_node;
1024
+ while (true) {
1025
+ if (node.nodeType === 8) {
1026
+ var data = node.data;
1027
+ if (data === "]") {
1028
+ if (depth === 0) return node;
1029
+ depth -= 1;
1030
+ } else if (data === "[" || data === "[!" || data[0] === "[" && !isNaN(Number(data.slice(1)))) depth += 1;
1031
+ }
1032
+ var next = /* @__PURE__ */ get_next_sibling(node);
1033
+ if (remove) node.remove();
1034
+ node = next;
1035
+ }
1036
+ }
1037
+ //#endregion
1038
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/reactivity/equality.js
1039
+ /** @import { Equals } from '#client' */
1040
+ /** @type {Equals} */
1041
+ function equals(value) {
1042
+ return value === this.v;
1043
+ }
1044
+ /**
1045
+ * @param {unknown} a
1046
+ * @param {unknown} b
1047
+ * @returns {boolean}
1048
+ */
1049
+ function safe_not_equal(a, b) {
1050
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
1051
+ }
1052
+ /** @type {Equals} */
1053
+ function safe_equals(value) {
1054
+ return !safe_not_equal(value, this.v);
1055
+ }
1056
+ //#endregion
1057
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/context.js
1058
+ /** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
1059
+ /** @type {ComponentContext | null} */
1060
+ var component_context = null;
1061
+ /** @param {ComponentContext | null} context */
1062
+ function set_component_context(context) {
1063
+ component_context = context;
1064
+ }
1065
+ /**
1066
+ * @param {Record<string, unknown>} props
1067
+ * @param {any} runes
1068
+ * @param {Function} [fn]
1069
+ * @returns {void}
1070
+ */
1071
+ function push(props, runes = false, fn) {
1072
+ component_context = {
1073
+ p: component_context,
1074
+ i: false,
1075
+ c: null,
1076
+ e: null,
1077
+ s: props,
1078
+ x: null,
1079
+ r: active_effect,
1080
+ l: null
1081
+ };
1082
+ }
1083
+ /**
1084
+ * @template {Record<string, any>} T
1085
+ * @param {T} [component]
1086
+ * @returns {T}
1087
+ */
1088
+ function pop(component) {
1089
+ var context = component_context;
1090
+ var effects = context.e;
1091
+ if (effects !== null) {
1092
+ context.e = null;
1093
+ for (var fn of effects) create_user_effect(fn);
1094
+ }
1095
+ context.i = true;
1096
+ component_context = context.p;
1097
+ return {};
1098
+ }
1099
+ /** @returns {boolean} */
1100
+ function is_runes() {
1101
+ return true;
1102
+ }
1103
+ //#endregion
1104
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/dom/task.js
1105
+ /** @type {Array<() => void>} */
1106
+ var micro_tasks = [];
1107
+ function run_micro_tasks() {
1108
+ var tasks = micro_tasks;
1109
+ micro_tasks = [];
1110
+ run_all(tasks);
1111
+ }
1112
+ /**
1113
+ * @param {() => void} fn
1114
+ */
1115
+ function queue_micro_task(fn) {
1116
+ if (micro_tasks.length === 0 && !is_flushing_sync) {
1117
+ var tasks = micro_tasks;
1118
+ queueMicrotask(() => {
1119
+ if (tasks === micro_tasks) run_micro_tasks();
1120
+ });
1121
+ }
1122
+ micro_tasks.push(fn);
1123
+ }
1124
+ /**
1125
+ * Synchronously run any queued tasks.
1126
+ */
1127
+ function flush_tasks() {
1128
+ while (micro_tasks.length > 0) run_micro_tasks();
1129
+ }
1130
+ /**
1131
+ * @param {unknown} error
1132
+ */
1133
+ function handle_error(error) {
1134
+ var effect = active_effect;
1135
+ if (effect === null) {
1136
+ /** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
1137
+ return error;
1138
+ }
1139
+ if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
1140
+ invoke_error_boundary(error, effect);
1141
+ }
1142
+ /**
1143
+ * @param {unknown} error
1144
+ * @param {Effect | null} effect
1145
+ */
1146
+ function invoke_error_boundary(error, effect) {
1147
+ while (effect !== null) {
1148
+ if ((effect.f & 128) !== 0) {
1149
+ if ((effect.f & 32768) === 0) throw error;
1150
+ try {
1151
+ /** @type {Boundary} */ effect.b.error(error);
1152
+ return;
1153
+ } catch (e) {
1154
+ error = e;
1155
+ }
1156
+ }
1157
+ effect = effect.parent;
1158
+ }
1159
+ throw error;
1160
+ }
1161
+ //#endregion
1162
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/reactivity/status.js
1163
+ /** @import { Derived, Signal } from '#client' */
1164
+ var STATUS_MASK = -7169;
1165
+ /**
1166
+ * @param {Signal} signal
1167
+ * @param {number} status
1168
+ */
1169
+ function set_signal_status(signal, status) {
1170
+ signal.f = signal.f & STATUS_MASK | status;
1171
+ }
1172
+ /**
1173
+ * Set a derived's status to CLEAN or MAYBE_DIRTY based on its connection state.
1174
+ * @param {Derived} derived
1175
+ */
1176
+ function update_derived_status(derived) {
1177
+ if ((derived.f & 512) !== 0 || derived.deps === null) set_signal_status(derived, CLEAN);
1178
+ else set_signal_status(derived, MAYBE_DIRTY);
1179
+ }
1180
+ //#endregion
1181
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/reactivity/utils.js
1182
+ /** @import { Derived, Effect, Value } from '#client' */
1183
+ /**
1184
+ * @param {Value[] | null} deps
1185
+ */
1186
+ function clear_marked(deps) {
1187
+ if (deps === null) return;
1188
+ for (const dep of deps) {
1189
+ if ((dep.f & 2) === 0 || (dep.f & 65536) === 0) continue;
1190
+ dep.f ^= WAS_MARKED;
1191
+ clear_marked(
1192
+ /** @type {Derived} */
1193
+ dep.deps
1194
+ );
1195
+ }
1196
+ }
1197
+ /**
1198
+ * @param {Effect} effect
1199
+ * @param {Set<Effect>} dirty_effects
1200
+ * @param {Set<Effect>} maybe_dirty_effects
1201
+ */
1202
+ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
1203
+ if ((effect.f & 2048) !== 0) dirty_effects.add(effect);
1204
+ else if ((effect.f & 4096) !== 0) maybe_dirty_effects.add(effect);
1205
+ clear_marked(effect.deps);
1206
+ set_signal_status(effect, CLEAN);
1207
+ }
1208
+ //#endregion
1209
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/store/shared/index.js
1210
+ /** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from '../public.js' */
1211
+ /** @import { Stores, StoresValues, SubscribeInvalidateTuple } from '../private.js' */
1212
+ /**
1213
+ * @type {Array<SubscribeInvalidateTuple<any> | any>}
1214
+ */
1215
+ var subscriber_queue = [];
1216
+ /**
1217
+ * Creates a `Readable` store that allows reading by subscription.
1218
+ *
1219
+ * @template T
1220
+ * @param {T} [value] initial value
1221
+ * @param {StartStopNotifier<T>} [start]
1222
+ * @returns {Readable<T>}
1223
+ */
1224
+ function readable(value, start) {
1225
+ return { subscribe: writable(value, start).subscribe };
1226
+ }
1227
+ /**
1228
+ * Create a `Writable` store that allows both updating and reading by subscription.
1229
+ *
1230
+ * @template T
1231
+ * @param {T} [value] initial value
1232
+ * @param {StartStopNotifier<T>} [start]
1233
+ * @returns {Writable<T>}
1234
+ */
1235
+ function writable(value, start = noop) {
1236
+ /** @type {Unsubscriber | null} */
1237
+ let stop = null;
1238
+ /** @type {Set<SubscribeInvalidateTuple<T>>} */
1239
+ const subscribers = /* @__PURE__ */ new Set();
1240
+ /**
1241
+ * @param {T} new_value
1242
+ * @returns {void}
1243
+ */
1244
+ function set(new_value) {
1245
+ if (safe_not_equal(value, new_value)) {
1246
+ value = new_value;
1247
+ if (stop) {
1248
+ const run_queue = !subscriber_queue.length;
1249
+ for (const subscriber of subscribers) {
1250
+ subscriber[1]();
1251
+ subscriber_queue.push(subscriber, value);
1252
+ }
1253
+ if (run_queue) {
1254
+ for (let i = 0; i < subscriber_queue.length; i += 2) subscriber_queue[i][0](subscriber_queue[i + 1]);
1255
+ subscriber_queue.length = 0;
1256
+ }
1257
+ }
1258
+ }
1259
+ }
1260
+ /**
1261
+ * @param {Updater<T>} fn
1262
+ * @returns {void}
1263
+ */
1264
+ function update(fn) {
1265
+ set(fn(value));
1266
+ }
1267
+ /**
1268
+ * @param {Subscriber<T>} run
1269
+ * @param {() => void} [invalidate]
1270
+ * @returns {Unsubscriber}
1271
+ */
1272
+ function subscribe(run, invalidate = noop) {
1273
+ /** @type {SubscribeInvalidateTuple<T>} */
1274
+ const subscriber = [run, invalidate];
1275
+ subscribers.add(subscriber);
1276
+ if (subscribers.size === 1) stop = start(set, update) || noop;
1277
+ run(value);
1278
+ return () => {
1279
+ subscribers.delete(subscriber);
1280
+ if (subscribers.size === 0 && stop) {
1281
+ stop();
1282
+ stop = null;
1283
+ }
1284
+ };
1285
+ }
1286
+ return {
1287
+ set,
1288
+ update,
1289
+ subscribe
1290
+ };
1291
+ }
1292
+ //#endregion
1293
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/reactivity/batch.js
1294
+ /** @import { Fork } from 'svelte' */
1295
+ /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
1296
+ /** @type {Batch | null} */
1297
+ var first_batch = null;
1298
+ /** @type {Batch | null} */
1299
+ var last_batch = null;
1300
+ /** @type {Batch | null} */
1301
+ var current_batch = null;
1302
+ /**
1303
+ * This is needed to avoid overwriting inputs
1304
+ * @type {Batch | null}
1305
+ */
1306
+ var previous_batch = null;
1307
+ /**
1308
+ * When time travelling (i.e. working in one batch, while other batches
1309
+ * still have ongoing work), we ignore the real values of affected
1310
+ * signals in favour of their values within the batch
1311
+ * @type {Map<Value, any> | null}
1312
+ */
1313
+ var batch_values = null;
1314
+ /** @type {Effect | null} */
1315
+ var last_scheduled_effect = null;
1316
+ var is_flushing_sync = false;
1317
+ var is_processing = false;
1318
+ /**
1319
+ * During traversal, this is an array. Newly created effects are (if not immediately
1320
+ * executed) pushed to this array, rather than going through the scheduling
1321
+ * rigamarole that would cause another turn of the flush loop.
1322
+ * @type {Effect[] | null}
1323
+ */
1324
+ var collected_effects = null;
1325
+ /**
1326
+ * An array of effects that are marked during traversal as a result of a `set`
1327
+ * (not `internal_set`) call. These will be added to the next batch and
1328
+ * trigger another `batch.process()`
1329
+ * @type {Effect[] | null}
1330
+ * @deprecated when we get rid of legacy mode and stores, we can get rid of this
1331
+ */
1332
+ var legacy_updates = null;
1333
+ var flush_count = 0;
1334
+ var uid = 1;
1335
+ var Batch = class Batch {
1336
+ id = uid++;
1337
+ /** True as soon as `#process` was called */
1338
+ #started = false;
1339
+ linked = true;
1340
+ /** @type {Batch | null} */
1341
+ #prev = null;
1342
+ /** @type {Batch | null} */
1343
+ #next = null;
1344
+ /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
1345
+ async_deriveds = /* @__PURE__ */ new Map();
1346
+ /**
1347
+ * The current values of any signals that are updated in this batch.
1348
+ * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
1349
+ * They keys of this map are identical to `this.#previous`
1350
+ * @type {Map<Value, [any, boolean]>}
1351
+ */
1352
+ current = /* @__PURE__ */ new Map();
1353
+ /**
1354
+ * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
1355
+ * They keys of this map are identical to `this.#current`
1356
+ * @type {Map<Value, any>}
1357
+ */
1358
+ previous = /* @__PURE__ */ new Map();
1359
+ /**
1360
+ * Async effects which this batch doesn't take into account anymore when calculating blockers,
1361
+ * as it has a value for it already.
1362
+ * @type {Set<Effect>}
1363
+ */
1364
+ unblocked = /* @__PURE__ */ new Set();
1365
+ /**
1366
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
1367
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
1368
+ * @type {Set<(batch: Batch) => void>}
1369
+ */
1370
+ #commit_callbacks = /* @__PURE__ */ new Set();
1371
+ /**
1372
+ * If a fork is discarded, we need to destroy any effects that are no longer needed
1373
+ * @type {Set<(batch: Batch) => void>}
1374
+ */
1375
+ #discard_callbacks = /* @__PURE__ */ new Set();
1376
+ /**
1377
+ * Callbacks that should run only when a fork is committed.
1378
+ * @type {Set<(batch: Batch) => void>}
1379
+ */
1380
+ #fork_commit_callbacks = /* @__PURE__ */ new Set();
1381
+ /**
1382
+ * The number of async effects that are currently in flight
1383
+ */
1384
+ #pending = 0;
1385
+ /**
1386
+ * Async effects that are currently in flight, _not_ inside a pending boundary
1387
+ * @type {Map<Effect, number>}
1388
+ */
1389
+ #blocking_pending = /* @__PURE__ */ new Map();
1390
+ /**
1391
+ * A deferred that resolves when the batch is committed, used with `settled()`
1392
+ * TODO replace with Promise.withResolvers once supported widely enough
1393
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
1394
+ */
1395
+ #deferred = null;
1396
+ /**
1397
+ * The root effects that need to be flushed
1398
+ * @type {Effect[]}
1399
+ */
1400
+ #roots = [];
1401
+ /**
1402
+ * Effects created while this batch was active.
1403
+ * @type {Effect[]}
1404
+ */
1405
+ #new_effects = [];
1406
+ /**
1407
+ * Deferred effects (which run after async work has completed) that are DIRTY
1408
+ * @type {Set<Effect>}
1409
+ */
1410
+ #dirty_effects = /* @__PURE__ */ new Set();
1411
+ /**
1412
+ * Deferred effects that are MAYBE_DIRTY
1413
+ * @type {Set<Effect>}
1414
+ */
1415
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
1416
+ /**
1417
+ * A map of branches that still exist, but will be destroyed when this batch
1418
+ * is committed — we skip over these during `process`.
1419
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
1420
+ * so they can be rescheduled if the branch survives.
1421
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
1422
+ */
1423
+ #skipped_branches = /* @__PURE__ */ new Map();
1424
+ /**
1425
+ * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing
1426
+ * @type {Set<Effect>}
1427
+ */
1428
+ #unskipped_branches = /* @__PURE__ */ new Set();
1429
+ is_fork = false;
1430
+ #decrement_queued = false;
1431
+ #is_deferred() {
1432
+ if (this.is_fork) return true;
1433
+ for (const effect of this.#blocking_pending.keys()) {
1434
+ var e = effect;
1435
+ var skipped = false;
1436
+ while (e.parent !== null) {
1437
+ if (this.#skipped_branches.has(e)) {
1438
+ skipped = true;
1439
+ break;
1440
+ }
1441
+ e = e.parent;
1442
+ }
1443
+ if (!skipped) return true;
1444
+ }
1445
+ return false;
1446
+ }
1447
+ /**
1448
+ * Add an effect to the #skipped_branches map and reset its children
1449
+ * @param {Effect} effect
1450
+ */
1451
+ skip_effect(effect) {
1452
+ if (!this.#skipped_branches.has(effect)) this.#skipped_branches.set(effect, {
1453
+ d: [],
1454
+ m: []
1455
+ });
1456
+ this.#unskipped_branches.delete(effect);
1457
+ }
1458
+ /**
1459
+ * Remove an effect from the #skipped_branches map and reschedule
1460
+ * any tracked dirty/maybe_dirty child effects
1461
+ * @param {Effect} effect
1462
+ * @param {(e: Effect) => void} callback
1463
+ */
1464
+ unskip_effect(effect, callback = (e) => this.schedule(e)) {
1465
+ var tracked = this.#skipped_branches.get(effect);
1466
+ if (tracked) {
1467
+ this.#skipped_branches.delete(effect);
1468
+ for (var e of tracked.d) {
1469
+ set_signal_status(e, DIRTY);
1470
+ callback(e);
1471
+ }
1472
+ for (e of tracked.m) {
1473
+ set_signal_status(e, MAYBE_DIRTY);
1474
+ callback(e);
1475
+ }
1476
+ }
1477
+ this.#unskipped_branches.add(effect);
1478
+ }
1479
+ #process() {
1480
+ this.#started = true;
1481
+ if (flush_count++ > 1e3) {
1482
+ this.#unlink();
1483
+ infinite_loop_guard();
1484
+ }
1485
+ if (!this.#is_deferred()) {
1486
+ for (const e of this.#dirty_effects) {
1487
+ this.#maybe_dirty_effects.delete(e);
1488
+ set_signal_status(e, DIRTY);
1489
+ this.schedule(e);
1490
+ }
1491
+ for (const e of this.#maybe_dirty_effects) {
1492
+ set_signal_status(e, MAYBE_DIRTY);
1493
+ this.schedule(e);
1494
+ }
1495
+ }
1496
+ const roots = this.#roots;
1497
+ this.#roots = [];
1498
+ this.apply();
1499
+ /** @type {Effect[]} */
1500
+ var effects = collected_effects = [];
1501
+ /** @type {Effect[]} */
1502
+ var render_effects = [];
1503
+ /**
1504
+ * @type {Effect[]}
1505
+ * @deprecated when we get rid of legacy mode and stores, we can get rid of this
1506
+ */
1507
+ var updates = legacy_updates = [];
1508
+ for (const root of roots) try {
1509
+ this.#traverse(root, effects, render_effects);
1510
+ } catch (e) {
1511
+ reset_all(root);
1512
+ throw e;
1513
+ }
1514
+ current_batch = null;
1515
+ if (updates.length > 0) {
1516
+ var batch = Batch.ensure();
1517
+ for (const e of updates) batch.schedule(e);
1518
+ }
1519
+ collected_effects = null;
1520
+ legacy_updates = null;
1521
+ if (this.#is_deferred()) {
1522
+ this.#defer_effects(render_effects);
1523
+ this.#defer_effects(effects);
1524
+ for (const [e, t] of this.#skipped_branches) reset_branch(e, t);
1525
+ if (updates.length > 0)
1526
+ /** @type {Batch} */ current_batch.#process();
1527
+ return;
1528
+ }
1529
+ const earlier_batch = this.#find_earlier_batch();
1530
+ if (earlier_batch) {
1531
+ earlier_batch.#merge(this);
1532
+ return;
1533
+ }
1534
+ this.#dirty_effects.clear();
1535
+ this.#maybe_dirty_effects.clear();
1536
+ for (const fn of this.#commit_callbacks) fn(this);
1537
+ this.#commit_callbacks.clear();
1538
+ previous_batch = this;
1539
+ flush_queued_effects(render_effects);
1540
+ flush_queued_effects(effects);
1541
+ previous_batch = null;
1542
+ this.#deferred?.resolve();
1543
+ var next_batch = current_batch;
1544
+ if (this.linked && this.#pending === 0) this.#unlink();
1545
+ if (this.#roots.length > 0) {
1546
+ if (next_batch === null) {
1547
+ next_batch = this;
1548
+ this.#link();
1549
+ }
1550
+ const batch = next_batch;
1551
+ batch.#roots.push(...this.#roots.filter((r) => !batch.#roots.includes(r)));
1552
+ }
1553
+ if (next_batch !== null) next_batch.#process();
1554
+ }
1555
+ /**
1556
+ * Traverse the effect tree, executing effects or stashing
1557
+ * them for later execution as appropriate
1558
+ * @param {Effect} root
1559
+ * @param {Effect[]} effects
1560
+ * @param {Effect[]} render_effects
1561
+ */
1562
+ #traverse(root, effects, render_effects) {
1563
+ root.f ^= CLEAN;
1564
+ var effect = root.first;
1565
+ while (effect !== null) {
1566
+ var flags = effect.f;
1567
+ var is_branch = (flags & 96) !== 0;
1568
+ if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || this.#skipped_branches.has(effect)) && effect.fn !== null) {
1569
+ if (is_branch) effect.f ^= CLEAN;
1570
+ else if ((flags & 4) !== 0) effects.push(effect);
1571
+ else if (is_dirty(effect)) {
1572
+ if ((flags & 16) !== 0) this.#maybe_dirty_effects.add(effect);
1573
+ update_effect(effect);
1574
+ }
1575
+ var child = effect.first;
1576
+ if (child !== null) {
1577
+ effect = child;
1578
+ continue;
1579
+ }
1580
+ }
1581
+ while (effect !== null) {
1582
+ var next = effect.next;
1583
+ if (next !== null) {
1584
+ effect = next;
1585
+ break;
1586
+ }
1587
+ effect = effect.parent;
1588
+ }
1589
+ }
1590
+ }
1591
+ #find_earlier_batch() {
1592
+ var batch = this.#prev;
1593
+ while (batch !== null) {
1594
+ if (!batch.is_fork) {
1595
+ for (const [value, [, is_derived]] of this.current) if (batch.current.has(value) && !is_derived) return batch;
1596
+ }
1597
+ batch = batch.#prev;
1598
+ }
1599
+ return null;
1600
+ }
1601
+ /**
1602
+ * @param {Batch} batch
1603
+ */
1604
+ #merge(batch) {
1605
+ for (const [source, value] of batch.current) {
1606
+ if (!this.previous.has(source) && batch.previous.has(source)) this.previous.set(source, batch.previous.get(source));
1607
+ this.current.set(source, value);
1608
+ }
1609
+ for (const [effect, deferred] of batch.async_deriveds) {
1610
+ const d = this.async_deriveds.get(effect);
1611
+ if (d) deferred.promise.then(d.resolve);
1612
+ }
1613
+ /**
1614
+ * mark all effects that depend on `batch.current`, except the
1615
+ * async effects that we just resolved (TODO unless they depend
1616
+ * on values in this batch that are NOT in the later batch?).
1617
+ * Through this we also will populate the correct #skipped_branches,
1618
+ * oncommit callbacks etc, so we don't need to merge them separately.
1619
+ * @param {Value} value
1620
+ */
1621
+ const mark = (value) => {
1622
+ var reactions = value.reactions;
1623
+ if (reactions === null) return;
1624
+ for (const reaction of reactions) {
1625
+ var flags = reaction.f;
1626
+ if ((flags & 2) !== 0) mark(reaction);
1627
+ else {
1628
+ var effect = reaction;
1629
+ if (flags & 4194320 && !this.async_deriveds.has(effect)) {
1630
+ this.#maybe_dirty_effects.delete(effect);
1631
+ set_signal_status(effect, DIRTY);
1632
+ this.schedule(effect);
1633
+ }
1634
+ }
1635
+ }
1636
+ };
1637
+ for (const source of this.current.keys()) mark(source);
1638
+ this.oncommit(() => batch.discard());
1639
+ batch.#unlink();
1640
+ current_batch = this;
1641
+ this.#process();
1642
+ }
1643
+ /**
1644
+ * @param {Effect[]} effects
1645
+ */
1646
+ #defer_effects(effects) {
1647
+ for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
1648
+ }
1649
+ /**
1650
+ * Associate a change to a given source with the current
1651
+ * batch, noting its previous and current values
1652
+ * @param {Value} source
1653
+ * @param {any} value
1654
+ * @param {boolean} [is_derived]
1655
+ */
1656
+ capture(source, value, is_derived = false) {
1657
+ if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
1658
+ if ((source.f & 8388608) === 0) {
1659
+ this.current.set(source, [value, is_derived]);
1660
+ batch_values?.set(source, value);
1661
+ }
1662
+ if (!this.is_fork) source.v = value;
1663
+ }
1664
+ activate() {
1665
+ current_batch = this;
1666
+ }
1667
+ deactivate() {
1668
+ current_batch = null;
1669
+ batch_values = null;
1670
+ }
1671
+ flush() {
1672
+ try {
1673
+ is_processing = true;
1674
+ current_batch = this;
1675
+ this.#process();
1676
+ } finally {
1677
+ flush_count = 0;
1678
+ last_scheduled_effect = null;
1679
+ collected_effects = null;
1680
+ legacy_updates = null;
1681
+ is_processing = false;
1682
+ current_batch = null;
1683
+ batch_values = null;
1684
+ old_values.clear();
1685
+ }
1686
+ }
1687
+ discard() {
1688
+ for (const fn of this.#discard_callbacks) fn(this);
1689
+ this.#discard_callbacks.clear();
1690
+ this.#fork_commit_callbacks.clear();
1691
+ this.#unlink();
1692
+ }
1693
+ /**
1694
+ * @param {Effect} effect
1695
+ */
1696
+ register_created_effect(effect) {
1697
+ this.#new_effects.push(effect);
1698
+ }
1699
+ #commit() {
1700
+ this.#unlink();
1701
+ for (let batch = first_batch; batch !== null; batch = batch.#next) {
1702
+ var is_earlier = batch.id < this.id;
1703
+ /** @type {Source[]} */
1704
+ var sources = [];
1705
+ for (const [source, [value, is_derived]] of this.current) {
1706
+ if (batch.current.has(source)) {
1707
+ var batch_value = batch.current.get(source)[0];
1708
+ if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]);
1709
+ else continue;
1710
+ }
1711
+ sources.push(source);
1712
+ }
1713
+ if (is_earlier) for (const [effect, deferred] of this.async_deriveds) {
1714
+ const d = batch.async_deriveds.get(effect);
1715
+ if (d) deferred.promise.then(d.resolve);
1716
+ }
1717
+ if (!batch.#started) continue;
1718
+ var others = [...batch.current.keys()].filter((s) => !this.current.has(s));
1719
+ if (others.length === 0) {
1720
+ if (is_earlier) batch.discard();
1721
+ } else if (sources.length > 0) {
1722
+ if (is_earlier) for (const unskipped of this.#unskipped_branches) batch.unskip_effect(unskipped, (e) => {
1723
+ if ((e.f & 4194320) !== 0) batch.schedule(e);
1724
+ else batch.#defer_effects([e]);
1725
+ });
1726
+ batch.activate();
1727
+ /** @type {Set<Value>} */
1728
+ var marked = /* @__PURE__ */ new Set();
1729
+ /** @type {Map<Reaction, boolean>} */
1730
+ var checked = /* @__PURE__ */ new Map();
1731
+ for (var source of sources) mark_effects(source, others, marked, checked);
1732
+ checked = /* @__PURE__ */ new Map();
1733
+ var current_unequal = [...batch.current.keys()].filter((c) => this.current.has(c) ? this.current.get(c)[0] !== c.v : true);
1734
+ if (current_unequal.length > 0) {
1735
+ for (const effect of this.#new_effects) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
1736
+ set_signal_status(effect, DIRTY);
1737
+ batch.schedule(effect);
1738
+ } else batch.#dirty_effects.add(effect);
1739
+ }
1740
+ if (batch.#roots.length > 0 && !batch.#decrement_queued) {
1741
+ batch.apply();
1742
+ for (var root of batch.#roots) batch.#traverse(root, [], []);
1743
+ batch.#roots = [];
1744
+ }
1745
+ batch.deactivate();
1746
+ }
1747
+ }
1748
+ }
1749
+ /**
1750
+ * @param {boolean} blocking
1751
+ * @param {Effect} effect
1752
+ */
1753
+ increment(blocking, effect) {
1754
+ this.#pending += 1;
1755
+ if (blocking) {
1756
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1757
+ this.#blocking_pending.set(effect, blocking_pending_count + 1);
1758
+ }
1759
+ }
1760
+ /**
1761
+ * @param {boolean} blocking
1762
+ * @param {Effect} effect
1763
+ */
1764
+ decrement(blocking, effect) {
1765
+ this.#pending -= 1;
1766
+ if (blocking) {
1767
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1768
+ if (blocking_pending_count === 1) this.#blocking_pending.delete(effect);
1769
+ else this.#blocking_pending.set(effect, blocking_pending_count - 1);
1770
+ }
1771
+ if (this.#decrement_queued) return;
1772
+ this.#decrement_queued = true;
1773
+ queue_micro_task(() => {
1774
+ this.#decrement_queued = false;
1775
+ if (this.linked) this.flush();
1776
+ });
1777
+ }
1778
+ /**
1779
+ * @param {Set<Effect>} dirty_effects
1780
+ * @param {Set<Effect>} maybe_dirty_effects
1781
+ */
1782
+ transfer_effects(dirty_effects, maybe_dirty_effects) {
1783
+ for (const e of dirty_effects) this.#dirty_effects.add(e);
1784
+ for (const e of maybe_dirty_effects) this.#maybe_dirty_effects.add(e);
1785
+ dirty_effects.clear();
1786
+ maybe_dirty_effects.clear();
1787
+ }
1788
+ /** @param {(batch: Batch) => void} fn */
1789
+ oncommit(fn) {
1790
+ this.#commit_callbacks.add(fn);
1791
+ }
1792
+ /** @param {(batch: Batch) => void} fn */
1793
+ ondiscard(fn) {
1794
+ this.#discard_callbacks.add(fn);
1795
+ }
1796
+ /** @param {(batch: Batch) => void} fn */
1797
+ on_fork_commit(fn) {
1798
+ this.#fork_commit_callbacks.add(fn);
1799
+ }
1800
+ run_fork_commit_callbacks() {
1801
+ for (const fn of this.#fork_commit_callbacks) fn(this);
1802
+ this.#fork_commit_callbacks.clear();
1803
+ }
1804
+ settled() {
1805
+ return (this.#deferred ??= deferred()).promise;
1806
+ }
1807
+ static ensure() {
1808
+ if (current_batch === null) {
1809
+ const batch = current_batch = new Batch();
1810
+ batch.#link();
1811
+ if (!is_processing && !is_flushing_sync) queue_micro_task(() => {
1812
+ if (!batch.#started) batch.flush();
1813
+ });
1814
+ }
1815
+ return current_batch;
1816
+ }
1817
+ apply() {
1818
+ {
1819
+ batch_values = null;
1820
+ return;
1821
+ }
1822
+ }
1823
+ /**
1824
+ *
1825
+ * @param {Effect} effect
1826
+ */
1827
+ schedule(effect) {
1828
+ last_scheduled_effect = effect;
1829
+ if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) {
1830
+ effect.b.defer_effect(effect);
1831
+ return;
1832
+ }
1833
+ var e = effect;
1834
+ while (e.parent !== null) {
1835
+ e = e.parent;
1836
+ var flags = e.f;
1837
+ if (collected_effects !== null && e === active_effect) {
1838
+ if ((active_reaction === null || (active_reaction.f & 2) === 0) && true) return;
1839
+ }
1840
+ if ((flags & 96) !== 0) {
1841
+ if ((flags & 1024) === 0) return;
1842
+ e.f ^= CLEAN;
1843
+ }
1844
+ }
1845
+ this.#roots.push(e);
1846
+ }
1847
+ #link() {
1848
+ if (last_batch === null) first_batch = last_batch = this;
1849
+ else {
1850
+ last_batch.#next = this;
1851
+ this.#prev = last_batch;
1852
+ }
1853
+ last_batch = this;
1854
+ }
1855
+ #unlink() {
1856
+ var prev = this.#prev;
1857
+ var next = this.#next;
1858
+ if (prev === null) first_batch = next;
1859
+ else prev.#next = next;
1860
+ if (next === null) last_batch = prev;
1861
+ else next.#prev = prev;
1862
+ this.linked = false;
1863
+ }
1864
+ };
1865
+ /**
1866
+ * Synchronously flush any pending updates.
1867
+ * Returns void if no callback is provided, otherwise returns the result of calling the callback.
1868
+ * @template [T=void]
1869
+ * @param {(() => T) | undefined} [fn]
1870
+ * @returns {T}
1871
+ */
1872
+ function flushSync(fn) {
1873
+ var was_flushing_sync = is_flushing_sync;
1874
+ is_flushing_sync = true;
1875
+ try {
1876
+ var result;
1877
+ if (fn) ;
1878
+ while (true) {
1879
+ flush_tasks();
1880
+ if (current_batch === null) return result;
1881
+ current_batch.flush();
1882
+ }
1883
+ } finally {
1884
+ is_flushing_sync = was_flushing_sync;
1885
+ }
1886
+ }
1887
+ function infinite_loop_guard() {
1888
+ try {
1889
+ effect_update_depth_exceeded();
1890
+ } catch (error) {
1891
+ invoke_error_boundary(error, last_scheduled_effect);
1892
+ }
1893
+ }
1894
+ /** @type {Set<Effect> | null} */
1895
+ var eager_block_effects = null;
1896
+ /**
1897
+ * @param {Array<Effect>} effects
1898
+ * @returns {void}
1899
+ */
1900
+ function flush_queued_effects(effects) {
1901
+ var length = effects.length;
1902
+ if (length === 0) return;
1903
+ var i = 0;
1904
+ while (i < length) {
1905
+ var effect = effects[i++];
1906
+ if ((effect.f & 24576) === 0 && is_dirty(effect)) {
1907
+ eager_block_effects = /* @__PURE__ */ new Set();
1908
+ update_effect(effect);
1909
+ if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect);
1910
+ if (eager_block_effects?.size > 0) {
1911
+ old_values.clear();
1912
+ for (const e of eager_block_effects) {
1913
+ if ((e.f & 24576) !== 0) continue;
1914
+ /** @type {Effect[]} */
1915
+ const ordered_effects = [e];
1916
+ let ancestor = e.parent;
1917
+ while (ancestor !== null) {
1918
+ if (eager_block_effects.has(ancestor)) {
1919
+ eager_block_effects.delete(ancestor);
1920
+ ordered_effects.push(ancestor);
1921
+ }
1922
+ ancestor = ancestor.parent;
1923
+ }
1924
+ for (let j = ordered_effects.length - 1; j >= 0; j--) {
1925
+ const e = ordered_effects[j];
1926
+ if ((e.f & 24576) !== 0) continue;
1927
+ update_effect(e);
1928
+ }
1929
+ }
1930
+ eager_block_effects.clear();
1931
+ }
1932
+ }
1933
+ }
1934
+ eager_block_effects = null;
1935
+ }
1936
+ /**
1937
+ * This is similar to `mark_reactions`, but it only marks async/block effects
1938
+ * depending on `value` and at least one of the other `sources`, so that
1939
+ * these effects can re-run after another batch has been committed
1940
+ * @param {Value} value
1941
+ * @param {Source[]} sources
1942
+ * @param {Set<Value>} marked
1943
+ * @param {Map<Reaction, boolean>} checked
1944
+ */
1945
+ function mark_effects(value, sources, marked, checked) {
1946
+ if (marked.has(value)) return;
1947
+ marked.add(value);
1948
+ if (value.reactions !== null) for (const reaction of value.reactions) {
1949
+ const flags = reaction.f;
1950
+ if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked);
1951
+ else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) {
1952
+ set_signal_status(reaction, DIRTY);
1953
+ schedule_effect(reaction);
1954
+ }
1955
+ }
1956
+ }
1957
+ /**
1958
+ * @param {Reaction} reaction
1959
+ * @param {Source[]} sources
1960
+ * @param {Map<Reaction, boolean>} checked
1961
+ */
1962
+ function depends_on(reaction, sources, checked) {
1963
+ const depends = checked.get(reaction);
1964
+ if (depends !== void 0) return depends;
1965
+ if (reaction.deps !== null) for (const dep of reaction.deps) {
1966
+ if (includes.call(sources, dep)) return true;
1967
+ if ((dep.f & 2) !== 0 && depends_on(dep, sources, checked)) {
1968
+ checked.set(dep, true);
1969
+ return true;
1970
+ }
1971
+ }
1972
+ checked.set(reaction, false);
1973
+ return false;
1974
+ }
1975
+ /**
1976
+ * @param {Effect} effect
1977
+ * @returns {void}
1978
+ */
1979
+ function schedule_effect(effect) {
1980
+ /** @type {Batch} */ current_batch.schedule(effect);
1981
+ }
1982
+ /**
1983
+ * Mark all the effects inside a skipped branch CLEAN, so that
1984
+ * they can be correctly rescheduled later. Tracks dirty and maybe_dirty
1985
+ * effects so they can be rescheduled if the branch survives.
1986
+ * @param {Effect} effect
1987
+ * @param {{ d: Effect[], m: Effect[] }} tracked
1988
+ */
1989
+ function reset_branch(effect, tracked) {
1990
+ if ((effect.f & 32) !== 0 && (effect.f & 1024) !== 0) return;
1991
+ if ((effect.f & 2048) !== 0) tracked.d.push(effect);
1992
+ else if ((effect.f & 4096) !== 0) tracked.m.push(effect);
1993
+ set_signal_status(effect, CLEAN);
1994
+ var e = effect.first;
1995
+ while (e !== null) {
1996
+ reset_branch(e, tracked);
1997
+ e = e.next;
1998
+ }
1999
+ }
2000
+ /**
2001
+ * Mark an entire effect tree clean following an error
2002
+ * @param {Effect} effect
2003
+ */
2004
+ function reset_all(effect) {
2005
+ set_signal_status(effect, CLEAN);
2006
+ var e = effect.first;
2007
+ while (e !== null) {
2008
+ reset_all(e);
2009
+ e = e.next;
2010
+ }
2011
+ }
2012
+ //#endregion
2013
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/reactivity/create-subscriber.js
2014
+ /**
2015
+ * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
2016
+ * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
2017
+ *
2018
+ * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
2019
+ * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
2020
+ *
2021
+ * If `start` returns a cleanup function, it will be called when the effect is destroyed.
2022
+ *
2023
+ * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
2024
+ * are active, and the returned teardown function will only be called when all effects are destroyed.
2025
+ *
2026
+ * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
2027
+ *
2028
+ * ```js
2029
+ * import { createSubscriber } from 'svelte/reactivity';
2030
+ * import { on } from 'svelte/events';
2031
+ *
2032
+ * export class MediaQuery {
2033
+ * #query;
2034
+ * #subscribe;
2035
+ *
2036
+ * constructor(query) {
2037
+ * this.#query = window.matchMedia(`(${query})`);
2038
+ *
2039
+ * this.#subscribe = createSubscriber((update) => {
2040
+ * // when the `change` event occurs, re-run any effects that read `this.current`
2041
+ * const off = on(this.#query, 'change', update);
2042
+ *
2043
+ * // stop listening when all the effects are destroyed
2044
+ * return () => off();
2045
+ * });
2046
+ * }
2047
+ *
2048
+ * get current() {
2049
+ * // This makes the getter reactive, if read in an effect
2050
+ * this.#subscribe();
2051
+ *
2052
+ * // Return the current state of the query, whether or not we're in an effect
2053
+ * return this.#query.matches;
2054
+ * }
2055
+ * }
2056
+ * ```
2057
+ * @param {(update: () => void) => (() => void) | void} start
2058
+ * @since 5.7.0
2059
+ */
2060
+ function createSubscriber(start) {
2061
+ let subscribers = 0;
2062
+ let version = source(0);
2063
+ /** @type {(() => void) | void} */
2064
+ let stop;
2065
+ return () => {
2066
+ if (effect_tracking()) {
2067
+ get(version);
2068
+ render_effect(() => {
2069
+ if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
2070
+ subscribers += 1;
2071
+ return () => {
2072
+ queue_micro_task(() => {
2073
+ subscribers -= 1;
2074
+ if (subscribers === 0) {
2075
+ stop?.();
2076
+ stop = void 0;
2077
+ increment(version);
2078
+ }
2079
+ });
2080
+ };
2081
+ });
2082
+ }
2083
+ };
2084
+ }
2085
+ //#endregion
2086
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
2087
+ /** @import { Effect, Source, TemplateNode, } from '#client' */
2088
+ /**
2089
+ * @typedef {{
2090
+ * onerror?: ((error: unknown, reset: () => void) => void) | null;
2091
+ * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
2092
+ * pending?: ((anchor: Node) => void) | null;
2093
+ * }} BoundaryProps
2094
+ */
2095
+ var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
2096
+ /**
2097
+ * @param {TemplateNode} node
2098
+ * @param {BoundaryProps} props
2099
+ * @param {((anchor: Node) => void)} children
2100
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
2101
+ * @returns {void}
2102
+ */
2103
+ function boundary(node, props, children, transform_error) {
2104
+ new Boundary(node, props, children, transform_error);
2105
+ }
2106
+ var Boundary = class {
2107
+ /** @type {Boundary | null} */
2108
+ parent;
2109
+ is_pending = false;
2110
+ /**
2111
+ * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
2112
+ * Inherited from parent boundary, or defaults to identity.
2113
+ * @type {(error: unknown) => unknown}
2114
+ */
2115
+ transform_error;
2116
+ /** @type {TemplateNode} */
2117
+ #anchor;
2118
+ /** @type {TemplateNode | null} */
2119
+ #hydrate_open = hydrating ? hydrate_node : null;
2120
+ /** @type {BoundaryProps} */
2121
+ #props;
2122
+ /** @type {((anchor: Node) => void)} */
2123
+ #children;
2124
+ /** @type {Effect} */
2125
+ #effect;
2126
+ /** @type {Effect | null} */
2127
+ #main_effect = null;
2128
+ /** @type {Effect | null} */
2129
+ #pending_effect = null;
2130
+ /** @type {Effect | null} */
2131
+ #failed_effect = null;
2132
+ /** @type {DocumentFragment | null} */
2133
+ #offscreen_fragment = null;
2134
+ #local_pending_count = 0;
2135
+ #pending_count = 0;
2136
+ #pending_count_update_queued = false;
2137
+ /** @type {Set<Effect>} */
2138
+ #dirty_effects = /* @__PURE__ */ new Set();
2139
+ /** @type {Set<Effect>} */
2140
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
2141
+ /**
2142
+ * A source containing the number of pending async deriveds/expressions.
2143
+ * Only created if `$effect.pending()` is used inside the boundary,
2144
+ * otherwise updating the source results in needless `Batch.ensure()`
2145
+ * calls followed by no-op flushes
2146
+ * @type {Source<number> | null}
2147
+ */
2148
+ #effect_pending = null;
2149
+ #effect_pending_subscriber = createSubscriber(() => {
2150
+ this.#effect_pending = source(this.#local_pending_count);
2151
+ return () => {
2152
+ this.#effect_pending = null;
2153
+ };
2154
+ });
2155
+ /**
2156
+ * @param {TemplateNode} node
2157
+ * @param {BoundaryProps} props
2158
+ * @param {((anchor: Node) => void)} children
2159
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
2160
+ */
2161
+ constructor(node, props, children, transform_error) {
2162
+ this.#anchor = node;
2163
+ this.#props = props;
2164
+ this.#children = (anchor) => {
2165
+ var effect = active_effect;
2166
+ effect.b = this;
2167
+ effect.f |= 128;
2168
+ children(anchor);
2169
+ };
2170
+ this.parent = active_effect.b;
2171
+ this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
2172
+ this.#effect = block(() => {
2173
+ if (hydrating) {
2174
+ const comment = this.#hydrate_open;
2175
+ hydrate_next();
2176
+ const server_rendered_pending = comment.data === "[!";
2177
+ if (comment.data.startsWith("[?")) {
2178
+ const serialized_error = JSON.parse(comment.data.slice(2));
2179
+ this.#hydrate_failed_content(serialized_error);
2180
+ } else if (server_rendered_pending) this.#hydrate_pending_content();
2181
+ else this.#hydrate_resolved_content();
2182
+ } else this.#render();
2183
+ }, flags);
2184
+ if (hydrating) this.#anchor = hydrate_node;
2185
+ }
2186
+ #hydrate_resolved_content() {
2187
+ try {
2188
+ this.#main_effect = branch(() => this.#children(this.#anchor));
2189
+ } catch (error) {
2190
+ this.error(error);
2191
+ }
2192
+ }
2193
+ /**
2194
+ * @param {unknown} error The deserialized error from the server's hydration comment
2195
+ */
2196
+ #hydrate_failed_content(error) {
2197
+ const failed = this.#props.failed;
2198
+ if (!failed) return;
2199
+ this.#failed_effect = branch(() => {
2200
+ failed(this.#anchor, () => error, () => () => {});
2201
+ });
2202
+ }
2203
+ #hydrate_pending_content() {
2204
+ const pending = this.#props.pending;
2205
+ if (!pending) return;
2206
+ this.is_pending = true;
2207
+ this.#pending_effect = branch(() => pending(this.#anchor));
2208
+ queue_micro_task(() => {
2209
+ var fragment = this.#offscreen_fragment = document.createDocumentFragment();
2210
+ var anchor = create_text();
2211
+ fragment.append(anchor);
2212
+ this.#main_effect = this.#run(() => {
2213
+ return branch(() => this.#children(anchor));
2214
+ });
2215
+ if (this.#pending_count === 0) {
2216
+ this.#anchor.before(fragment);
2217
+ this.#offscreen_fragment = null;
2218
+ pause_effect(this.#pending_effect, () => {
2219
+ this.#pending_effect = null;
2220
+ });
2221
+ this.#resolve(current_batch);
2222
+ }
2223
+ });
2224
+ }
2225
+ #render() {
2226
+ try {
2227
+ this.is_pending = this.has_pending_snippet();
2228
+ this.#pending_count = 0;
2229
+ this.#local_pending_count = 0;
2230
+ this.#main_effect = branch(() => {
2231
+ this.#children(this.#anchor);
2232
+ });
2233
+ if (this.#pending_count > 0) {
2234
+ var fragment = this.#offscreen_fragment = document.createDocumentFragment();
2235
+ move_effect(this.#main_effect, fragment);
2236
+ const pending = this.#props.pending;
2237
+ this.#pending_effect = branch(() => pending(this.#anchor));
2238
+ } else this.#resolve(current_batch);
2239
+ } catch (error) {
2240
+ this.error(error);
2241
+ }
2242
+ }
2243
+ /**
2244
+ * @param {Batch} batch
2245
+ */
2246
+ #resolve(batch) {
2247
+ this.is_pending = false;
2248
+ batch.transfer_effects(this.#dirty_effects, this.#maybe_dirty_effects);
2249
+ }
2250
+ /**
2251
+ * Defer an effect inside a pending boundary until the boundary resolves
2252
+ * @param {Effect} effect
2253
+ */
2254
+ defer_effect(effect) {
2255
+ defer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects);
2256
+ }
2257
+ /**
2258
+ * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
2259
+ * @returns {boolean}
2260
+ */
2261
+ is_rendered() {
2262
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
2263
+ }
2264
+ has_pending_snippet() {
2265
+ return !!this.#props.pending;
2266
+ }
2267
+ /**
2268
+ * @template T
2269
+ * @param {() => T} fn
2270
+ */
2271
+ #run(fn) {
2272
+ var previous_effect = active_effect;
2273
+ var previous_reaction = active_reaction;
2274
+ var previous_ctx = component_context;
2275
+ set_active_effect(this.#effect);
2276
+ set_active_reaction(this.#effect);
2277
+ set_component_context(this.#effect.ctx);
2278
+ try {
2279
+ Batch.ensure();
2280
+ return fn();
2281
+ } catch (e) {
2282
+ handle_error(e);
2283
+ return null;
2284
+ } finally {
2285
+ set_active_effect(previous_effect);
2286
+ set_active_reaction(previous_reaction);
2287
+ set_component_context(previous_ctx);
2288
+ }
2289
+ }
2290
+ /**
2291
+ * Updates the pending count associated with the currently visible pending snippet,
2292
+ * if any, such that we can replace the snippet with content once work is done
2293
+ * @param {1 | -1} d
2294
+ * @param {Batch} batch
2295
+ */
2296
+ #update_pending_count(d, batch) {
2297
+ if (!this.has_pending_snippet()) {
2298
+ if (this.parent) this.parent.#update_pending_count(d, batch);
2299
+ return;
2300
+ }
2301
+ this.#pending_count += d;
2302
+ if (this.#pending_count === 0) {
2303
+ this.#resolve(batch);
2304
+ if (this.#pending_effect) pause_effect(this.#pending_effect, () => {
2305
+ this.#pending_effect = null;
2306
+ });
2307
+ if (this.#offscreen_fragment) {
2308
+ this.#anchor.before(this.#offscreen_fragment);
2309
+ this.#offscreen_fragment = null;
2310
+ }
2311
+ }
2312
+ }
2313
+ /**
2314
+ * Update the source that powers `$effect.pending()` inside this boundary,
2315
+ * and controls when the current `pending` snippet (if any) is removed.
2316
+ * Do not call from inside the class
2317
+ * @param {1 | -1} d
2318
+ * @param {Batch} batch
2319
+ */
2320
+ update_pending_count(d, batch) {
2321
+ this.#update_pending_count(d, batch);
2322
+ this.#local_pending_count += d;
2323
+ if (!this.#effect_pending || this.#pending_count_update_queued) return;
2324
+ this.#pending_count_update_queued = true;
2325
+ queue_micro_task(() => {
2326
+ this.#pending_count_update_queued = false;
2327
+ if (this.#effect_pending) internal_set(this.#effect_pending, this.#local_pending_count);
2328
+ });
2329
+ }
2330
+ get_effect_pending() {
2331
+ this.#effect_pending_subscriber();
2332
+ return get(this.#effect_pending);
2333
+ }
2334
+ /** @param {unknown} error */
2335
+ error(error) {
2336
+ if (!this.#props.onerror && !this.#props.failed) throw error;
2337
+ if (current_batch?.is_fork) {
2338
+ if (this.#main_effect) current_batch.skip_effect(this.#main_effect);
2339
+ if (this.#pending_effect) current_batch.skip_effect(this.#pending_effect);
2340
+ if (this.#failed_effect) current_batch.skip_effect(this.#failed_effect);
2341
+ current_batch.on_fork_commit(() => {
2342
+ this.#handle_error(error);
2343
+ });
2344
+ } else this.#handle_error(error);
2345
+ }
2346
+ /**
2347
+ * @param {unknown} error
2348
+ */
2349
+ #handle_error(error) {
2350
+ if (this.#main_effect) {
2351
+ destroy_effect(this.#main_effect);
2352
+ this.#main_effect = null;
2353
+ }
2354
+ if (this.#pending_effect) {
2355
+ destroy_effect(this.#pending_effect);
2356
+ this.#pending_effect = null;
2357
+ }
2358
+ if (this.#failed_effect) {
2359
+ destroy_effect(this.#failed_effect);
2360
+ this.#failed_effect = null;
2361
+ }
2362
+ if (hydrating) {
2363
+ set_hydrate_node(this.#hydrate_open);
2364
+ next();
2365
+ set_hydrate_node(skip_nodes());
2366
+ }
2367
+ var onerror = this.#props.onerror;
2368
+ let failed = this.#props.failed;
2369
+ var did_reset = false;
2370
+ var calling_on_error = false;
2371
+ const reset = () => {
2372
+ if (did_reset) {
2373
+ svelte_boundary_reset_noop();
2374
+ return;
2375
+ }
2376
+ did_reset = true;
2377
+ if (calling_on_error) svelte_boundary_reset_onerror();
2378
+ if (this.#failed_effect !== null) pause_effect(this.#failed_effect, () => {
2379
+ this.#failed_effect = null;
2380
+ });
2381
+ this.#run(() => {
2382
+ this.#render();
2383
+ });
2384
+ };
2385
+ /** @param {unknown} transformed_error */
2386
+ const handle_error_result = (transformed_error) => {
2387
+ try {
2388
+ calling_on_error = true;
2389
+ onerror?.(transformed_error, reset);
2390
+ calling_on_error = false;
2391
+ } catch (error) {
2392
+ invoke_error_boundary(error, this.#effect && this.#effect.parent);
2393
+ }
2394
+ if (failed) this.#failed_effect = this.#run(() => {
2395
+ try {
2396
+ return branch(() => {
2397
+ var effect = active_effect;
2398
+ effect.b = this;
2399
+ effect.f |= 128;
2400
+ failed(this.#anchor, () => transformed_error, () => reset);
2401
+ });
2402
+ } catch (error) {
2403
+ invoke_error_boundary(error, this.#effect.parent);
2404
+ return null;
2405
+ }
2406
+ });
2407
+ };
2408
+ queue_micro_task(() => {
2409
+ /** @type {unknown} */
2410
+ var result;
2411
+ try {
2412
+ result = this.transform_error(error);
2413
+ } catch (e) {
2414
+ invoke_error_boundary(e, this.#effect && this.#effect.parent);
2415
+ return;
2416
+ }
2417
+ if (result !== null && typeof result === "object" && typeof result.then === "function")
2418
+ /** @type {any} */ result.then(
2419
+ handle_error_result,
2420
+ /** @param {unknown} e */
2421
+ (e) => invoke_error_boundary(e, this.#effect && this.#effect.parent)
2422
+ );
2423
+ else handle_error_result(result);
2424
+ });
2425
+ }
2426
+ };
2427
+ /**
2428
+ * @param {Derived} derived
2429
+ * @returns {void}
2430
+ */
2431
+ function destroy_derived_effects(derived) {
2432
+ var effects = derived.effects;
2433
+ if (effects !== null) {
2434
+ derived.effects = null;
2435
+ for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
2436
+ }
2437
+ }
2438
+ /**
2439
+ * @template T
2440
+ * @param {Derived} derived
2441
+ * @returns {T}
2442
+ */
2443
+ function execute_derived(derived) {
2444
+ var value;
2445
+ var prev_active_effect = active_effect;
2446
+ var parent = derived.parent;
2447
+ if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
2448
+ derived_inert();
2449
+ return derived.v;
2450
+ }
2451
+ set_active_effect(parent);
2452
+ try {
2453
+ derived.f &= ~WAS_MARKED;
2454
+ destroy_derived_effects(derived);
2455
+ value = update_reaction(derived);
2456
+ } finally {
2457
+ set_active_effect(prev_active_effect);
2458
+ }
2459
+ return value;
2460
+ }
2461
+ /**
2462
+ * @param {Derived} derived
2463
+ * @returns {void}
2464
+ */
2465
+ function update_derived(derived) {
2466
+ var value = execute_derived(derived);
2467
+ if (!derived.equals(value)) {
2468
+ derived.wv = increment_write_version();
2469
+ if (!current_batch?.is_fork || derived.deps === null) {
2470
+ if (current_batch !== null) {
2471
+ current_batch.capture(derived, value, true);
2472
+ previous_batch?.capture(derived, value, true);
2473
+ } else derived.v = value;
2474
+ if (derived.deps === null) {
2475
+ set_signal_status(derived, CLEAN);
2476
+ return;
2477
+ }
2478
+ }
2479
+ }
2480
+ if (is_destroying_effect) return;
2481
+ if (batch_values !== null) {
2482
+ if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
2483
+ } else update_derived_status(derived);
2484
+ }
2485
+ /**
2486
+ * @param {Derived} derived
2487
+ */
2488
+ function freeze_derived_effects(derived) {
2489
+ if (derived.effects === null) return;
2490
+ for (const e of derived.effects) if (e.teardown || e.ac) {
2491
+ e.teardown?.();
2492
+ e.ac?.abort(STALE_REACTION);
2493
+ if (e.fn !== null) e.teardown = noop;
2494
+ e.ac = null;
2495
+ remove_reactions(e, 0);
2496
+ destroy_effect_children(e);
2497
+ }
2498
+ }
2499
+ /**
2500
+ * @param {Derived} derived
2501
+ */
2502
+ function unfreeze_derived_effects(derived) {
2503
+ if (derived.effects === null) return;
2504
+ for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
2505
+ }
2506
+ //#endregion
2507
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/reactivity/sources.js
2508
+ /** @import { Derived, Effect, Source, Value } from '#client' */
2509
+ /** @type {Set<Effect>} */
2510
+ var eager_effects = /* @__PURE__ */ new Set();
2511
+ /** @type {Map<Source, any>} */
2512
+ var old_values = /* @__PURE__ */ new Map();
2513
+ var eager_effects_deferred = false;
2514
+ /**
2515
+ * @template V
2516
+ * @param {V} v
2517
+ * @param {Error | null} [stack]
2518
+ * @returns {Source<V>}
2519
+ */
2520
+ function source(v, stack) {
2521
+ return {
2522
+ f: 0,
2523
+ v,
2524
+ reactions: null,
2525
+ equals,
2526
+ rv: 0,
2527
+ wv: 0
2528
+ };
2529
+ }
2530
+ /**
2531
+ * @template V
2532
+ * @param {V} v
2533
+ * @param {Error | null} [stack]
2534
+ */
2535
+ /* @__NO_SIDE_EFFECTS__ */
2536
+ function state(v, stack) {
2537
+ const s = source(v);
2538
+ push_reaction_value(s);
2539
+ return s;
2540
+ }
2541
+ /**
2542
+ * @template V
2543
+ * @param {V} initial_value
2544
+ * @param {boolean} [immutable]
2545
+ * @returns {Source<V>}
2546
+ */
2547
+ /* @__NO_SIDE_EFFECTS__ */
2548
+ function mutable_source(initial_value, immutable = false, trackable = true) {
2549
+ const s = source(initial_value);
2550
+ if (!immutable) s.equals = safe_equals;
2551
+ return s;
2552
+ }
2553
+ /**
2554
+ * @template V
2555
+ * @param {Source<V>} source
2556
+ * @param {V} value
2557
+ * @param {boolean} [should_proxy]
2558
+ * @returns {V}
2559
+ */
2560
+ function set(source, value, should_proxy = false) {
2561
+ if (active_reaction !== null && (!untracking || (active_reaction.f & 131072) !== 0) && is_runes() && (active_reaction.f & 4325394) !== 0 && (current_sources === null || !includes.call(current_sources, source))) state_unsafe_mutation();
2562
+ return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates);
2563
+ }
2564
+ /**
2565
+ * @template V
2566
+ * @param {Source<V>} source
2567
+ * @param {V} value
2568
+ * @param {Effect[] | null} [updated_during_traversal]
2569
+ * @returns {V}
2570
+ */
2571
+ function internal_set(source, value, updated_during_traversal = null) {
2572
+ if (!source.equals(value)) {
2573
+ old_values.set(source, is_destroying_effect ? value : source.v);
2574
+ var batch = Batch.ensure();
2575
+ batch.capture(source, value);
2576
+ if ((source.f & 2) !== 0) {
2577
+ const derived = source;
2578
+ if ((source.f & 2048) !== 0) execute_derived(derived);
2579
+ if (batch_values === null) update_derived_status(derived);
2580
+ }
2581
+ source.wv = increment_write_version();
2582
+ mark_reactions(source, DIRTY, updated_during_traversal);
2583
+ if (active_effect !== null && (active_effect.f & 1024) !== 0 && (active_effect.f & 96) === 0) if (untracked_writes === null) set_untracked_writes([source]);
2584
+ else untracked_writes.push(source);
2585
+ if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) flush_eager_effects();
2586
+ }
2587
+ return value;
2588
+ }
2589
+ function flush_eager_effects() {
2590
+ eager_effects_deferred = false;
2591
+ for (const effect of eager_effects) {
2592
+ if ((effect.f & 1024) !== 0) set_signal_status(effect, MAYBE_DIRTY);
2593
+ let dirty;
2594
+ try {
2595
+ dirty = is_dirty(effect);
2596
+ } catch {
2597
+ dirty = true;
2598
+ }
2599
+ if (dirty) update_effect(effect);
2600
+ }
2601
+ eager_effects.clear();
2602
+ }
2603
+ /**
2604
+ * Silently (without using `get`) increment a source
2605
+ * @param {Source<number>} source
2606
+ */
2607
+ function increment(source) {
2608
+ set(source, source.v + 1);
2609
+ }
2610
+ /**
2611
+ * @param {Value} signal
2612
+ * @param {number} status should be DIRTY or MAYBE_DIRTY
2613
+ * @param {Effect[] | null} updated_during_traversal
2614
+ * @returns {void}
2615
+ */
2616
+ function mark_reactions(signal, status, updated_during_traversal) {
2617
+ var reactions = signal.reactions;
2618
+ if (reactions === null) return;
2619
+ var length = reactions.length;
2620
+ for (var i = 0; i < length; i++) {
2621
+ var reaction = reactions[i];
2622
+ var flags = reaction.f;
2623
+ var not_dirty = (flags & DIRTY) === 0;
2624
+ if (not_dirty) set_signal_status(reaction, status);
2625
+ if ((flags & 131072) !== 0) eager_effects.add(reaction);
2626
+ else if ((flags & 2) !== 0) {
2627
+ var derived = reaction;
2628
+ batch_values?.delete(derived);
2629
+ if ((flags & 65536) === 0) {
2630
+ if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
2631
+ mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
2632
+ }
2633
+ } else if (not_dirty) {
2634
+ var effect = reaction;
2635
+ if ((flags & 16) !== 0 && eager_block_effects !== null) eager_block_effects.add(effect);
2636
+ if (updated_during_traversal !== null) updated_during_traversal.push(effect);
2637
+ else schedule_effect(effect);
2638
+ }
2639
+ }
2640
+ }
2641
+ /**
2642
+ * @template T
2643
+ * @param {T} value
2644
+ * @returns {T}
2645
+ */
2646
+ function proxy(value) {
2647
+ if (typeof value !== "object" || value === null || STATE_SYMBOL in value) return value;
2648
+ const prototype = get_prototype_of(value);
2649
+ if (prototype !== object_prototype && prototype !== array_prototype) return value;
2650
+ /** @type {Map<any, Source<any>>} */
2651
+ var sources = /* @__PURE__ */ new Map();
2652
+ var is_proxied_array = is_array(value);
2653
+ var version = /* @__PURE__ */ state(0);
2654
+ var parent_version = update_version;
2655
+ /**
2656
+ * Executes the proxy in the context of the reaction it was originally created in, if any
2657
+ * @template T
2658
+ * @param {() => T} fn
2659
+ */
2660
+ var with_parent = (fn) => {
2661
+ if (update_version === parent_version) return fn();
2662
+ var reaction = active_reaction;
2663
+ var version = update_version;
2664
+ set_active_reaction(null);
2665
+ set_update_version(parent_version);
2666
+ var result = fn();
2667
+ set_active_reaction(reaction);
2668
+ set_update_version(version);
2669
+ return result;
2670
+ };
2671
+ if (is_proxied_array) sources.set("length", /* @__PURE__ */ state(
2672
+ /** @type {any[]} */
2673
+ value.length));
2674
+ return new Proxy(value, {
2675
+ defineProperty(_, prop, descriptor) {
2676
+ if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) state_descriptors_fixed();
2677
+ var s = sources.get(prop);
2678
+ if (s === void 0) with_parent(() => {
2679
+ var s = /* @__PURE__ */ state(descriptor.value);
2680
+ sources.set(prop, s);
2681
+ return s;
2682
+ });
2683
+ else set(s, descriptor.value, true);
2684
+ return true;
2685
+ },
2686
+ deleteProperty(target, prop) {
2687
+ var s = sources.get(prop);
2688
+ if (s === void 0) {
2689
+ if (prop in target) {
2690
+ const s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
2691
+ sources.set(prop, s);
2692
+ increment(version);
2693
+ }
2694
+ } else {
2695
+ set(s, UNINITIALIZED);
2696
+ increment(version);
2697
+ }
2698
+ return true;
2699
+ },
2700
+ get(target, prop, receiver) {
2701
+ if (prop === STATE_SYMBOL) return value;
2702
+ var s = sources.get(prop);
2703
+ var exists = prop in target;
2704
+ if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
2705
+ s = with_parent(() => {
2706
+ return /* @__PURE__ */ state(proxy(exists ? target[prop] : UNINITIALIZED));
2707
+ });
2708
+ sources.set(prop, s);
2709
+ }
2710
+ if (s !== void 0) {
2711
+ var v = get(s);
2712
+ return v === UNINITIALIZED ? void 0 : v;
2713
+ }
2714
+ return Reflect.get(target, prop, receiver);
2715
+ },
2716
+ getOwnPropertyDescriptor(target, prop) {
2717
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
2718
+ if (descriptor && "value" in descriptor) {
2719
+ var s = sources.get(prop);
2720
+ if (s) descriptor.value = get(s);
2721
+ } else if (descriptor === void 0) {
2722
+ var source = sources.get(prop);
2723
+ var value = source?.v;
2724
+ if (source !== void 0 && value !== UNINITIALIZED) return {
2725
+ enumerable: true,
2726
+ configurable: true,
2727
+ value,
2728
+ writable: true
2729
+ };
2730
+ }
2731
+ return descriptor;
2732
+ },
2733
+ has(target, prop) {
2734
+ if (prop === STATE_SYMBOL) return true;
2735
+ var s = sources.get(prop);
2736
+ var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
2737
+ if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
2738
+ if (s === void 0) {
2739
+ s = with_parent(() => {
2740
+ return /* @__PURE__ */ state(has ? proxy(target[prop]) : UNINITIALIZED);
2741
+ });
2742
+ sources.set(prop, s);
2743
+ }
2744
+ if (get(s) === UNINITIALIZED) return false;
2745
+ }
2746
+ return has;
2747
+ },
2748
+ set(target, prop, value, receiver) {
2749
+ var s = sources.get(prop);
2750
+ var has = prop in target;
2751
+ if (is_proxied_array && prop === "length") for (var i = value; i < s.v; i += 1) {
2752
+ var other_s = sources.get(i + "");
2753
+ if (other_s !== void 0) set(other_s, UNINITIALIZED);
2754
+ else if (i in target) {
2755
+ other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
2756
+ sources.set(i + "", other_s);
2757
+ }
2758
+ }
2759
+ if (s === void 0) {
2760
+ if (!has || get_descriptor(target, prop)?.writable) {
2761
+ s = with_parent(() => /* @__PURE__ */ state(void 0));
2762
+ set(s, proxy(value));
2763
+ sources.set(prop, s);
2764
+ }
2765
+ } else {
2766
+ has = s.v !== UNINITIALIZED;
2767
+ var p = with_parent(() => proxy(value));
2768
+ set(s, p);
2769
+ }
2770
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
2771
+ if (descriptor?.set) descriptor.set.call(receiver, value);
2772
+ if (!has) {
2773
+ if (is_proxied_array && typeof prop === "string") {
2774
+ var ls = sources.get("length");
2775
+ var n = Number(prop);
2776
+ if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1);
2777
+ }
2778
+ increment(version);
2779
+ }
2780
+ return true;
2781
+ },
2782
+ ownKeys(target) {
2783
+ get(version);
2784
+ var own_keys = Reflect.ownKeys(target).filter((key) => {
2785
+ var source = sources.get(key);
2786
+ return source === void 0 || source.v !== UNINITIALIZED;
2787
+ });
2788
+ for (var [key, source] of sources) if (source.v !== UNINITIALIZED && !(key in target)) own_keys.push(key);
2789
+ return own_keys;
2790
+ },
2791
+ setPrototypeOf() {
2792
+ state_prototype_fixed();
2793
+ }
2794
+ });
2795
+ }
2796
+ //#endregion
2797
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/dom/operations.js
2798
+ /** @type {Window} */
2799
+ var $window;
2800
+ /** @type {() => Node | null} */
2801
+ var first_child_getter;
2802
+ /** @type {() => Node | null} */
2803
+ var next_sibling_getter;
2804
+ /**
2805
+ * Initialize these lazily to avoid issues when using the runtime in a server context
2806
+ * where these globals are not available while avoiding a separate server entry point
2807
+ */
2808
+ function init_operations() {
2809
+ if ($window !== void 0) return;
2810
+ $window = window;
2811
+ var element_prototype = Element.prototype;
2812
+ var node_prototype = Node.prototype;
2813
+ var text_prototype = Text.prototype;
2814
+ first_child_getter = get_descriptor(node_prototype, "firstChild").get;
2815
+ next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
2816
+ if (is_extensible(element_prototype)) {
2817
+ /** @type {any} */ element_prototype[CLASS_CACHE] = void 0;
2818
+ /** @type {any} */ element_prototype[ATTRIBUTES_CACHE] = null;
2819
+ /** @type {any} */ element_prototype[STYLE_CACHE] = void 0;
2820
+ element_prototype.__e = void 0;
2821
+ }
2822
+ if (is_extensible(text_prototype))
2823
+ /** @type {any} */ text_prototype[TEXT_CACHE] = void 0;
2824
+ }
2825
+ /**
2826
+ * @param {string} value
2827
+ * @returns {Text}
2828
+ */
2829
+ function create_text(value = "") {
2830
+ return document.createTextNode(value);
2831
+ }
2832
+ /**
2833
+ * @template {Node} N
2834
+ * @param {N} node
2835
+ */
2836
+ /* @__NO_SIDE_EFFECTS__ */
2837
+ function get_first_child(node) {
2838
+ return first_child_getter.call(node);
2839
+ }
2840
+ /**
2841
+ * @template {Node} N
2842
+ * @param {N} node
2843
+ */
2844
+ /* @__NO_SIDE_EFFECTS__ */
2845
+ function get_next_sibling(node) {
2846
+ return next_sibling_getter.call(node);
2847
+ }
2848
+ /**
2849
+ * @template {Node} N
2850
+ * @param {N} node
2851
+ * @returns {void}
2852
+ */
2853
+ function clear_text_content(node) {
2854
+ node.textContent = "";
2855
+ }
2856
+ //#endregion
2857
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
2858
+ /**
2859
+ * @template T
2860
+ * @param {() => T} fn
2861
+ */
2862
+ function without_reactive_context(fn) {
2863
+ var previous_reaction = active_reaction;
2864
+ var previous_effect = active_effect;
2865
+ set_active_reaction(null);
2866
+ set_active_effect(null);
2867
+ try {
2868
+ return fn();
2869
+ } finally {
2870
+ set_active_reaction(previous_reaction);
2871
+ set_active_effect(previous_effect);
2872
+ }
2873
+ }
2874
+ //#endregion
2875
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/reactivity/effects.js
2876
+ /** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
2877
+ /**
2878
+ * @param {Effect} effect
2879
+ * @param {Effect} parent_effect
2880
+ */
2881
+ function push_effect(effect, parent_effect) {
2882
+ var parent_last = parent_effect.last;
2883
+ if (parent_last === null) parent_effect.last = parent_effect.first = effect;
2884
+ else {
2885
+ parent_last.next = effect;
2886
+ effect.prev = parent_last;
2887
+ parent_effect.last = effect;
2888
+ }
2889
+ }
2890
+ /**
2891
+ * @param {number} type
2892
+ * @param {null | (() => void | (() => void))} fn
2893
+ * @returns {Effect}
2894
+ */
2895
+ function create_effect(type, fn) {
2896
+ var parent = active_effect;
2897
+ if (parent !== null && (parent.f & 8192) !== 0) type |= INERT;
2898
+ /** @type {Effect} */
2899
+ var effect = {
2900
+ ctx: component_context,
2901
+ deps: null,
2902
+ nodes: null,
2903
+ f: type | DIRTY | 512,
2904
+ first: null,
2905
+ fn,
2906
+ last: null,
2907
+ next: null,
2908
+ parent,
2909
+ b: parent && parent.b,
2910
+ prev: null,
2911
+ teardown: null,
2912
+ wv: 0,
2913
+ ac: null
2914
+ };
2915
+ current_batch?.register_created_effect(effect);
2916
+ /** @type {Effect | null} */
2917
+ var e = effect;
2918
+ if ((type & 4) !== 0) if (collected_effects !== null) collected_effects.push(effect);
2919
+ else Batch.ensure().schedule(effect);
2920
+ else if (fn !== null) {
2921
+ try {
2922
+ update_effect(effect);
2923
+ } catch (e) {
2924
+ destroy_effect(effect);
2925
+ throw e;
2926
+ }
2927
+ if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & 524288) === 0) {
2928
+ e = e.first;
2929
+ if ((type & 16) !== 0 && (type & 65536) !== 0 && e !== null) e.f |= EFFECT_TRANSPARENT;
2930
+ }
2931
+ }
2932
+ if (e !== null) {
2933
+ e.parent = parent;
2934
+ if (parent !== null) push_effect(e, parent);
2935
+ if (active_reaction !== null && (active_reaction.f & 2) !== 0 && (type & 64) === 0) {
2936
+ var derived = active_reaction;
2937
+ (derived.effects ??= []).push(e);
2938
+ }
2939
+ }
2940
+ return effect;
2941
+ }
2942
+ /**
2943
+ * Internal representation of `$effect.tracking()`
2944
+ * @returns {boolean}
2945
+ */
2946
+ function effect_tracking() {
2947
+ return active_reaction !== null && !untracking;
2948
+ }
2949
+ /**
2950
+ * @param {() => void | (() => void)} fn
2951
+ */
2952
+ function create_user_effect(fn) {
2953
+ return create_effect(4 | USER_EFFECT, fn);
2954
+ }
2955
+ /**
2956
+ * An effect root whose children can transition out
2957
+ * @param {() => void} fn
2958
+ * @returns {(options?: { outro?: boolean }) => Promise<void>}
2959
+ */
2960
+ function component_root(fn) {
2961
+ Batch.ensure();
2962
+ const effect = create_effect(64 | EFFECT_PRESERVED, fn);
2963
+ return (options = {}) => {
2964
+ return new Promise((fulfil) => {
2965
+ if (options.outro) pause_effect(effect, () => {
2966
+ destroy_effect(effect);
2967
+ fulfil(void 0);
2968
+ });
2969
+ else {
2970
+ destroy_effect(effect);
2971
+ fulfil(void 0);
2972
+ }
2973
+ });
2974
+ };
2975
+ }
2976
+ /**
2977
+ * @param {() => void | (() => void)} fn
2978
+ * @returns {Effect}
2979
+ */
2980
+ function render_effect(fn, flags = 0) {
2981
+ return create_effect(8 | flags, fn);
2982
+ }
2983
+ /**
2984
+ * @param {(() => void)} fn
2985
+ * @param {number} flags
2986
+ */
2987
+ function block(fn, flags = 0) {
2988
+ return create_effect(16 | flags, fn);
2989
+ }
2990
+ /**
2991
+ * @param {(() => void)} fn
2992
+ */
2993
+ function branch(fn) {
2994
+ return create_effect(32 | EFFECT_PRESERVED, fn);
2995
+ }
2996
+ /**
2997
+ * @param {Effect} effect
2998
+ */
2999
+ function execute_effect_teardown(effect) {
3000
+ var teardown = effect.teardown;
3001
+ if (teardown !== null) {
3002
+ const previously_destroying_effect = is_destroying_effect;
3003
+ const previous_reaction = active_reaction;
3004
+ set_is_destroying_effect(true);
3005
+ set_active_reaction(null);
3006
+ try {
3007
+ teardown.call(null);
3008
+ } finally {
3009
+ set_is_destroying_effect(previously_destroying_effect);
3010
+ set_active_reaction(previous_reaction);
3011
+ }
3012
+ }
3013
+ }
3014
+ /**
3015
+ * @param {Effect} signal
3016
+ * @param {boolean} remove_dom
3017
+ * @returns {void}
3018
+ */
3019
+ function destroy_effect_children(signal, remove_dom = false) {
3020
+ var effect = signal.first;
3021
+ signal.first = signal.last = null;
3022
+ while (effect !== null) {
3023
+ const controller = effect.ac;
3024
+ if (controller !== null) without_reactive_context(() => {
3025
+ controller.abort(STALE_REACTION);
3026
+ });
3027
+ var next = effect.next;
3028
+ if ((effect.f & 64) !== 0) effect.parent = null;
3029
+ else destroy_effect(effect, remove_dom);
3030
+ effect = next;
3031
+ }
3032
+ }
3033
+ /**
3034
+ * @param {Effect} signal
3035
+ * @returns {void}
3036
+ */
3037
+ function destroy_block_effect_children(signal) {
3038
+ var effect = signal.first;
3039
+ while (effect !== null) {
3040
+ var next = effect.next;
3041
+ if ((effect.f & 32) === 0) destroy_effect(effect);
3042
+ effect = next;
3043
+ }
3044
+ }
3045
+ /**
3046
+ * @param {Effect} effect
3047
+ * @param {boolean} [remove_dom]
3048
+ * @returns {void}
3049
+ */
3050
+ function destroy_effect(effect, remove_dom = true) {
3051
+ var removed = false;
3052
+ if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
3053
+ remove_effect_dom(effect.nodes.start, effect.nodes.end);
3054
+ removed = true;
3055
+ }
3056
+ set_signal_status(effect, DESTROYING);
3057
+ destroy_effect_children(effect, remove_dom && !removed);
3058
+ remove_reactions(effect, 0);
3059
+ var transitions = effect.nodes && effect.nodes.t;
3060
+ if (transitions !== null) for (const transition of transitions) transition.stop();
3061
+ execute_effect_teardown(effect);
3062
+ effect.f ^= DESTROYING;
3063
+ effect.f |= DESTROYED;
3064
+ var parent = effect.parent;
3065
+ if (parent !== null && parent.first !== null) unlink_effect(effect);
3066
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
3067
+ }
3068
+ /**
3069
+ *
3070
+ * @param {TemplateNode | null} node
3071
+ * @param {TemplateNode} end
3072
+ */
3073
+ function remove_effect_dom(node, end) {
3074
+ while (node !== null) {
3075
+ /** @type {TemplateNode | null} */
3076
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
3077
+ node.remove();
3078
+ node = next;
3079
+ }
3080
+ }
3081
+ /**
3082
+ * Detach an effect from the effect tree, freeing up memory and
3083
+ * reducing the amount of work that happens on subsequent traversals
3084
+ * @param {Effect} effect
3085
+ */
3086
+ function unlink_effect(effect) {
3087
+ var parent = effect.parent;
3088
+ var prev = effect.prev;
3089
+ var next = effect.next;
3090
+ if (prev !== null) prev.next = next;
3091
+ if (next !== null) next.prev = prev;
3092
+ if (parent !== null) {
3093
+ if (parent.first === effect) parent.first = next;
3094
+ if (parent.last === effect) parent.last = prev;
3095
+ }
3096
+ }
3097
+ /**
3098
+ * When a block effect is removed, we don't immediately destroy it or yank it
3099
+ * out of the DOM, because it might have transitions. Instead, we 'pause' it.
3100
+ * It stays around (in memory, and in the DOM) until outro transitions have
3101
+ * completed, and if the state change is reversed then we _resume_ it.
3102
+ * A paused effect does not update, and the DOM subtree becomes inert.
3103
+ * @param {Effect} effect
3104
+ * @param {() => void} [callback]
3105
+ * @param {boolean} [destroy]
3106
+ */
3107
+ function pause_effect(effect, callback, destroy = true) {
3108
+ /** @type {TransitionManager[]} */
3109
+ var transitions = [];
3110
+ pause_children(effect, transitions, true);
3111
+ var fn = () => {
3112
+ if (destroy) destroy_effect(effect);
3113
+ if (callback) callback();
3114
+ };
3115
+ var remaining = transitions.length;
3116
+ if (remaining > 0) {
3117
+ var check = () => --remaining || fn();
3118
+ for (var transition of transitions) transition.out(check);
3119
+ } else fn();
3120
+ }
3121
+ /**
3122
+ * @param {Effect} effect
3123
+ * @param {TransitionManager[]} transitions
3124
+ * @param {boolean} local
3125
+ */
3126
+ function pause_children(effect, transitions, local) {
3127
+ if ((effect.f & 8192) !== 0) return;
3128
+ effect.f ^= INERT;
3129
+ var t = effect.nodes && effect.nodes.t;
3130
+ if (t !== null) {
3131
+ for (const transition of t) if (transition.is_global || local) transitions.push(transition);
3132
+ }
3133
+ var child = effect.first;
3134
+ while (child !== null) {
3135
+ var sibling = child.next;
3136
+ if ((child.f & 64) === 0) {
3137
+ var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
3138
+ pause_children(child, transitions, transparent ? local : false);
3139
+ }
3140
+ child = sibling;
3141
+ }
3142
+ }
3143
+ /**
3144
+ * @param {Effect} effect
3145
+ * @param {DocumentFragment} fragment
3146
+ */
3147
+ function move_effect(effect, fragment) {
3148
+ if (!effect.nodes) return;
3149
+ /** @type {TemplateNode | null} */
3150
+ var node = effect.nodes.start;
3151
+ var end = effect.nodes.end;
3152
+ while (node !== null) {
3153
+ /** @type {TemplateNode | null} */
3154
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
3155
+ fragment.append(node);
3156
+ node = next;
3157
+ }
3158
+ }
3159
+ //#endregion
3160
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/client/runtime.js
3161
+ /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
3162
+ var is_updating_effect = false;
3163
+ var is_destroying_effect = false;
3164
+ /** @param {boolean} value */
3165
+ function set_is_destroying_effect(value) {
3166
+ is_destroying_effect = value;
3167
+ }
3168
+ /** @type {null | Reaction} */
3169
+ var active_reaction = null;
3170
+ var untracking = false;
3171
+ /** @param {null | Reaction} reaction */
3172
+ function set_active_reaction(reaction) {
3173
+ active_reaction = reaction;
3174
+ }
3175
+ /** @type {null | Effect} */
3176
+ var active_effect = null;
3177
+ /** @param {null | Effect} effect */
3178
+ function set_active_effect(effect) {
3179
+ active_effect = effect;
3180
+ }
3181
+ /**
3182
+ * When sources are created within a reaction, reading and writing
3183
+ * them within that reaction should not cause a re-run
3184
+ * @type {null | Source[]}
3185
+ */
3186
+ var current_sources = null;
3187
+ /** @param {Value} value */
3188
+ function push_reaction_value(value) {
3189
+ if (active_reaction !== null && (true)) if (current_sources === null) current_sources = [value];
3190
+ else current_sources.push(value);
3191
+ }
3192
+ /**
3193
+ * The dependencies of the reaction that is currently being executed. In many cases,
3194
+ * the dependencies are unchanged between runs, and so this will be `null` unless
3195
+ * and until a new dependency is accessed — we track this via `skipped_deps`
3196
+ * @type {null | Value[]}
3197
+ */
3198
+ var new_deps = null;
3199
+ var skipped_deps = 0;
3200
+ /**
3201
+ * Tracks writes that the effect it's executed in doesn't listen to yet,
3202
+ * so that the dependency can be added to the effect later on if it then reads it
3203
+ * @type {null | Source[]}
3204
+ */
3205
+ var untracked_writes = null;
3206
+ /** @param {null | Source[]} value */
3207
+ function set_untracked_writes(value) {
3208
+ untracked_writes = value;
3209
+ }
3210
+ /**
3211
+ * @type {number} Used by sources and deriveds for handling updates.
3212
+ * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
3213
+ **/
3214
+ var write_version = 1;
3215
+ /** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */
3216
+ var read_version = 0;
3217
+ var update_version = read_version;
3218
+ /** @param {number} value */
3219
+ function set_update_version(value) {
3220
+ update_version = value;
3221
+ }
3222
+ function increment_write_version() {
3223
+ return ++write_version;
3224
+ }
3225
+ /**
3226
+ * Determines whether a derived or effect is dirty.
3227
+ * If it is MAYBE_DIRTY, will set the status to CLEAN
3228
+ * @param {Reaction} reaction
3229
+ * @returns {boolean}
3230
+ */
3231
+ function is_dirty(reaction) {
3232
+ var flags = reaction.f;
3233
+ if ((flags & 2048) !== 0) return true;
3234
+ if (flags & 2) reaction.f &= ~WAS_MARKED;
3235
+ if ((flags & 4096) !== 0) {
3236
+ var dependencies = reaction.deps;
3237
+ var length = dependencies.length;
3238
+ for (var i = 0; i < length; i++) {
3239
+ var dependency = dependencies[i];
3240
+ if (is_dirty(dependency)) update_derived(dependency);
3241
+ if (dependency.wv > reaction.wv) return true;
3242
+ }
3243
+ if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN);
3244
+ }
3245
+ return false;
3246
+ }
3247
+ /**
3248
+ * @param {Value} signal
3249
+ * @param {Effect} effect
3250
+ * @param {boolean} [root]
3251
+ */
3252
+ function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
3253
+ var reactions = signal.reactions;
3254
+ if (reactions === null) return;
3255
+ if (current_sources !== null && includes.call(current_sources, signal)) return;
3256
+ for (var i = 0; i < reactions.length; i++) {
3257
+ var reaction = reactions[i];
3258
+ if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
3259
+ else if (effect === reaction) {
3260
+ if (root) set_signal_status(reaction, DIRTY);
3261
+ else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY);
3262
+ schedule_effect(reaction);
3263
+ }
3264
+ }
3265
+ }
3266
+ /** @param {Reaction} reaction */
3267
+ function update_reaction(reaction) {
3268
+ var previous_deps = new_deps;
3269
+ var previous_skipped_deps = skipped_deps;
3270
+ var previous_untracked_writes = untracked_writes;
3271
+ var previous_reaction = active_reaction;
3272
+ var previous_sources = current_sources;
3273
+ var previous_component_context = component_context;
3274
+ var previous_untracking = untracking;
3275
+ var previous_update_version = update_version;
3276
+ var flags = reaction.f;
3277
+ new_deps = null;
3278
+ skipped_deps = 0;
3279
+ untracked_writes = null;
3280
+ active_reaction = (flags & 96) === 0 ? reaction : null;
3281
+ current_sources = null;
3282
+ set_component_context(reaction.ctx);
3283
+ untracking = false;
3284
+ update_version = ++read_version;
3285
+ if (reaction.ac !== null) {
3286
+ without_reactive_context(() => {
3287
+ /** @type {AbortController} */ reaction.ac.abort(STALE_REACTION);
3288
+ });
3289
+ reaction.ac = null;
3290
+ }
3291
+ try {
3292
+ reaction.f |= REACTION_IS_UPDATING;
3293
+ var fn = reaction.fn;
3294
+ var result = fn();
3295
+ reaction.f |= REACTION_RAN;
3296
+ var deps = reaction.deps;
3297
+ var is_fork = current_batch?.is_fork;
3298
+ if (new_deps !== null) {
3299
+ var i;
3300
+ if (!is_fork) remove_reactions(reaction, skipped_deps);
3301
+ if (deps !== null && skipped_deps > 0) {
3302
+ deps.length = skipped_deps + new_deps.length;
3303
+ for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
3304
+ } else reaction.deps = deps = new_deps;
3305
+ if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) (deps[i].reactions ??= []).push(reaction);
3306
+ } else if (!is_fork && deps !== null && skipped_deps < deps.length) {
3307
+ remove_reactions(reaction, skipped_deps);
3308
+ deps.length = skipped_deps;
3309
+ }
3310
+ if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
3311
+ if (previous_reaction !== null && previous_reaction !== reaction) {
3312
+ read_version++;
3313
+ if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
3314
+ if (previous_deps !== null) for (const dep of previous_deps) dep.rv = read_version;
3315
+ if (untracked_writes !== null) if (previous_untracked_writes === null) previous_untracked_writes = untracked_writes;
3316
+ else previous_untracked_writes.push(...untracked_writes);
3317
+ }
3318
+ if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
3319
+ return result;
3320
+ } catch (error) {
3321
+ return handle_error(error);
3322
+ } finally {
3323
+ reaction.f ^= REACTION_IS_UPDATING;
3324
+ new_deps = previous_deps;
3325
+ skipped_deps = previous_skipped_deps;
3326
+ untracked_writes = previous_untracked_writes;
3327
+ active_reaction = previous_reaction;
3328
+ current_sources = previous_sources;
3329
+ set_component_context(previous_component_context);
3330
+ untracking = previous_untracking;
3331
+ update_version = previous_update_version;
3332
+ }
3333
+ }
3334
+ /**
3335
+ * @template V
3336
+ * @param {Reaction} signal
3337
+ * @param {Value<V>} dependency
3338
+ * @returns {void}
3339
+ */
3340
+ function remove_reaction(signal, dependency) {
3341
+ let reactions = dependency.reactions;
3342
+ if (reactions !== null) {
3343
+ var index = index_of.call(reactions, signal);
3344
+ if (index !== -1) {
3345
+ var new_length = reactions.length - 1;
3346
+ if (new_length === 0) reactions = dependency.reactions = null;
3347
+ else {
3348
+ reactions[index] = reactions[new_length];
3349
+ reactions.pop();
3350
+ }
3351
+ }
3352
+ }
3353
+ if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
3354
+ var derived = dependency;
3355
+ if ((derived.f & 512) !== 0) {
3356
+ derived.f ^= 512;
3357
+ derived.f &= ~WAS_MARKED;
3358
+ }
3359
+ if (derived.v !== UNINITIALIZED) update_derived_status(derived);
3360
+ freeze_derived_effects(derived);
3361
+ remove_reactions(derived, 0);
3362
+ }
3363
+ }
3364
+ /**
3365
+ * @param {Reaction} signal
3366
+ * @param {number} start_index
3367
+ * @returns {void}
3368
+ */
3369
+ function remove_reactions(signal, start_index) {
3370
+ var dependencies = signal.deps;
3371
+ if (dependencies === null) return;
3372
+ for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
3373
+ }
3374
+ /**
3375
+ * @param {Effect} effect
3376
+ * @returns {void}
3377
+ */
3378
+ function update_effect(effect) {
3379
+ var flags = effect.f;
3380
+ if ((flags & 16384) !== 0) return;
3381
+ set_signal_status(effect, CLEAN);
3382
+ var previous_effect = active_effect;
3383
+ var was_updating_effect = is_updating_effect;
3384
+ active_effect = effect;
3385
+ is_updating_effect = true;
3386
+ try {
3387
+ if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
3388
+ else destroy_effect_children(effect);
3389
+ execute_effect_teardown(effect);
3390
+ var teardown = update_reaction(effect);
3391
+ effect.teardown = typeof teardown === "function" ? teardown : null;
3392
+ effect.wv = write_version;
3393
+ } finally {
3394
+ is_updating_effect = was_updating_effect;
3395
+ active_effect = previous_effect;
3396
+ }
3397
+ }
3398
+ /**
3399
+ * @template V
3400
+ * @param {Value<V>} signal
3401
+ * @returns {V}
3402
+ */
3403
+ function get(signal) {
3404
+ var is_derived = (signal.f & 2) !== 0;
3405
+ if (active_reaction !== null && !untracking) {
3406
+ if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !includes.call(current_sources, signal))) {
3407
+ var deps = active_reaction.deps;
3408
+ if ((active_reaction.f & 2097152) !== 0) {
3409
+ if (signal.rv < read_version) {
3410
+ signal.rv = read_version;
3411
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++;
3412
+ else if (new_deps === null) new_deps = [signal];
3413
+ else new_deps.push(signal);
3414
+ }
3415
+ } else {
3416
+ active_reaction.deps ??= [];
3417
+ if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
3418
+ var reactions = signal.reactions;
3419
+ if (reactions === null) signal.reactions = [active_reaction];
3420
+ else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
3421
+ }
3422
+ }
3423
+ }
3424
+ if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal);
3425
+ if (is_derived) {
3426
+ var derived = signal;
3427
+ if (is_destroying_effect) {
3428
+ var value = derived.v;
3429
+ if ((derived.f & 1024) === 0 && derived.reactions !== null || depends_on_old_values(derived)) value = execute_derived(derived);
3430
+ old_values.set(derived, value);
3431
+ return value;
3432
+ }
3433
+ var should_connect = (derived.f & 512) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & 512) !== 0);
3434
+ var is_new = (derived.f & REACTION_RAN) === 0;
3435
+ if (is_dirty(derived)) {
3436
+ if (should_connect) derived.f |= 512;
3437
+ update_derived(derived);
3438
+ }
3439
+ if (should_connect && !is_new) {
3440
+ unfreeze_derived_effects(derived);
3441
+ reconnect(derived);
3442
+ }
3443
+ }
3444
+ if (batch_values?.has(signal)) return batch_values.get(signal);
3445
+ if ((signal.f & 8388608) !== 0) throw signal.v;
3446
+ return signal.v;
3447
+ }
3448
+ /**
3449
+ * (Re)connect a disconnected derived, so that it is notified
3450
+ * of changes in `mark_reactions`
3451
+ * @param {Derived} derived
3452
+ */
3453
+ function reconnect(derived) {
3454
+ derived.f |= 512;
3455
+ if (derived.deps === null) return;
3456
+ for (const dep of derived.deps) {
3457
+ (dep.reactions ??= []).push(derived);
3458
+ if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) {
3459
+ unfreeze_derived_effects(dep);
3460
+ reconnect(dep);
3461
+ }
3462
+ }
3463
+ }
3464
+ /** @param {Derived} derived */
3465
+ function depends_on_old_values(derived) {
3466
+ if (derived.v === UNINITIALIZED) return true;
3467
+ if (derived.deps === null) return false;
3468
+ for (const dep of derived.deps) {
3469
+ if (old_values.has(dep)) return true;
3470
+ if ((dep.f & 2) !== 0 && depends_on_old_values(dep)) return true;
3471
+ }
3472
+ return false;
3473
+ }
3474
+ /**
3475
+ * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
3476
+ * any state read inside `fn` will not be treated as a dependency.
3477
+ *
3478
+ * ```ts
3479
+ * $effect(() => {
3480
+ * // this will run when `data` changes, but not when `time` changes
3481
+ * save(data, {
3482
+ * timestamp: untrack(() => time)
3483
+ * });
3484
+ * });
3485
+ * ```
3486
+ * @template T
3487
+ * @param {() => T} fn
3488
+ * @returns {T}
3489
+ */
3490
+ function untrack(fn) {
3491
+ var previous_untracking = untracking;
3492
+ try {
3493
+ untracking = true;
3494
+ return fn();
3495
+ } finally {
3496
+ untracking = previous_untracking;
3497
+ }
3498
+ }
3499
+ /**
3500
+ * Attributes that are boolean, i.e. they are present or not present.
3501
+ */
3502
+ var DOM_BOOLEAN_ATTRIBUTES = [
3503
+ "allowfullscreen",
3504
+ "async",
3505
+ "autofocus",
3506
+ "autoplay",
3507
+ "checked",
3508
+ "controls",
3509
+ "default",
3510
+ "disabled",
3511
+ "formnovalidate",
3512
+ "indeterminate",
3513
+ "inert",
3514
+ "ismap",
3515
+ "loop",
3516
+ "multiple",
3517
+ "muted",
3518
+ "nomodule",
3519
+ "novalidate",
3520
+ "open",
3521
+ "playsinline",
3522
+ "readonly",
3523
+ "required",
3524
+ "reversed",
3525
+ "seamless",
3526
+ "selected",
3527
+ "webkitdirectory",
3528
+ "defer",
3529
+ "disablepictureinpicture",
3530
+ "disableremoteplayback"
3531
+ ];
3532
+ /**
3533
+ * Returns `true` if `name` is a boolean attribute
3534
+ * @param {string} name
3535
+ */
3536
+ function is_boolean_attribute(name) {
3537
+ return DOM_BOOLEAN_ATTRIBUTES.includes(name);
3538
+ }
3539
+ /**
3540
+ * Subset of delegated events which should be passive by default.
3541
+ * These two are already passive via browser defaults on window, document and body.
3542
+ * But since
3543
+ * - we're delegating them
3544
+ * - they happen often
3545
+ * - they apply to mobile which is generally less performant
3546
+ * we're marking them as passive by default for other elements, too.
3547
+ */
3548
+ var PASSIVE_EVENTS = ["touchstart", "touchmove"];
3549
+ /**
3550
+ * Returns `true` if `name` is a passive event
3551
+ * @param {string} name
3552
+ */
3553
+ function is_passive_event(name) {
3554
+ return PASSIVE_EVENTS.includes(name);
3555
+ }
3556
+ //#endregion
3557
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/blocks/html.js
3558
+ /**
3559
+ * @param {string} value
3560
+ */
3561
+ function html(value) {
3562
+ return "<!---->" + String(value ?? "") + "<!---->";
3563
+ }
3564
+ //#endregion
3565
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/index.js
3566
+ var 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;
3567
+ /**
3568
+ * Only available on the server and when compiling with the `server` option.
3569
+ * 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.
3570
+ * @template {Record<string, any>} Props
3571
+ * @param {Component<Props> | ComponentType<SvelteComponent<Props>>} component
3572
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} [options]
3573
+ * @returns {RenderOutput}
3574
+ */
3575
+ function render(component, options = {}) {
3576
+ if (options.csp?.hash && options.csp.nonce) invalid_csp();
3577
+ return Renderer.render(component, options);
3578
+ }
3579
+ /**
3580
+ * @param {string} hash
3581
+ * @param {Renderer} renderer
3582
+ * @param {(renderer: Renderer) => Promise<void> | void} fn
3583
+ * @returns {void}
3584
+ */
3585
+ function head(hash, renderer, fn) {
3586
+ renderer.head((renderer) => {
3587
+ renderer.push(`<!--${hash}-->`);
3588
+ renderer.child(fn);
3589
+ renderer.push(EMPTY_COMMENT);
3590
+ });
3591
+ }
3592
+ /**
3593
+ * @param {Record<string, unknown>} attrs
3594
+ * @param {string} [css_hash]
3595
+ * @param {Record<string, boolean>} [classes]
3596
+ * @param {Record<string, string>} [styles]
3597
+ * @param {number} [flags]
3598
+ * @returns {string}
3599
+ */
3600
+ function attributes(attrs, css_hash, classes, styles, flags = 0) {
3601
+ if (styles) attrs.style = to_style(attrs.style, styles);
3602
+ if (attrs.class) attrs.class = clsx(attrs.class);
3603
+ if (css_hash || classes) attrs.class = to_class(attrs.class, css_hash, classes);
3604
+ let attr_str = "";
3605
+ let name;
3606
+ const is_html = (flags & 1) === 0;
3607
+ const lowercase = (flags & 2) === 0;
3608
+ const is_input = (flags & 4) !== 0;
3609
+ for (name of Object.keys(attrs)) {
3610
+ if (typeof attrs[name] === "function") continue;
3611
+ if (name[0] === "$" && name[1] === "$") continue;
3612
+ if (name === "" || INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
3613
+ var value = attrs[name];
3614
+ var lower = name.toLowerCase();
3615
+ if (lowercase) name = lower;
3616
+ if (lower.length > 2 && lower.startsWith("on")) continue;
3617
+ if (is_input) {
3618
+ if (name === "defaultvalue" || name === "defaultchecked") {
3619
+ name = name === "defaultvalue" ? "value" : "checked";
3620
+ if (attrs[name]) continue;
3621
+ }
3622
+ }
3623
+ attr_str += attr(name, value, is_html && is_boolean_attribute(name));
3624
+ }
3625
+ return attr_str;
3626
+ }
3627
+ /**
3628
+ * @param {unknown} value
3629
+ * @returns {string}
3630
+ */
3631
+ function stringify(value) {
3632
+ return typeof value === "string" ? value : value == null ? "" : value + "";
3633
+ }
3634
+ /**
3635
+ * @param {any} value
3636
+ * @param {string | undefined} [hash]
3637
+ * @param {Record<string, boolean>} [directives]
3638
+ */
3639
+ function attr_class(value, hash, directives) {
3640
+ var result = to_class(value, hash, directives);
3641
+ return result ? ` class="${escape_html(result, true)}"` : "";
3642
+ }
3643
+ /**
3644
+ * @param {Renderer} renderer
3645
+ * @param {Record<string, any>} $$props
3646
+ * @param {string} name
3647
+ * @param {Record<string, unknown>} slot_props
3648
+ * @param {null | (() => void)} fallback_fn
3649
+ * @returns {void}
3650
+ */
3651
+ function slot(renderer, $$props, name, slot_props, fallback_fn) {
3652
+ var slot_fn = $$props.$$slots?.[name];
3653
+ if (slot_fn === true) slot_fn = $$props["children" ];
3654
+ if (slot_fn !== void 0) slot_fn(renderer, slot_props);
3655
+ }
3656
+ /** @param {any} array_like_or_iterator */
3657
+ function ensure_array_like(array_like_or_iterator) {
3658
+ if (array_like_or_iterator) return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
3659
+ return [];
3660
+ }
3661
+ /**
3662
+ * @template V
3663
+ * @param {() => V} get_value
3664
+ */
3665
+ function once(get_value) {
3666
+ let value = UNINITIALIZED;
3667
+ return () => {
3668
+ if (value === UNINITIALIZED) value = get_value();
3669
+ return value;
3670
+ };
3671
+ }
3672
+ /**
3673
+ * @template T
3674
+ * @param {()=>T} fn
3675
+ * @returns {(new_value?: T) => (T | void)}
3676
+ */
3677
+ function derived(fn) {
3678
+ const get_value = ssr_context === null ? fn : once(fn);
3679
+ /** @type {T | undefined} */
3680
+ let updated_value;
3681
+ return function(new_value) {
3682
+ if (arguments.length === 0) return updated_value ?? get_value();
3683
+ updated_value = new_value;
3684
+ return updated_value;
3685
+ };
3686
+ }
3687
+ //#endregion
3688
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/crypto.js
3689
+ var text_encoder;
3690
+ var crypto;
3691
+ /** @param {string} module_name */
3692
+ var obfuscated_import = (module_name) => import(
3693
+ /* @vite-ignore */
3694
+ module_name
3695
+ );
3696
+ /** @param {string} data */
3697
+ async function sha256(data) {
3698
+ text_encoder ??= new TextEncoder();
3699
+ crypto ??= globalThis.crypto?.subtle?.digest ? globalThis.crypto : (await obfuscated_import("node:crypto")).webcrypto;
3700
+ return base64_encode(await crypto.subtle.digest("SHA-256", text_encoder.encode(data)));
3701
+ }
3702
+ /**
3703
+ * @param {Uint8Array} bytes
3704
+ * @returns {string}
3705
+ */
3706
+ function base64_encode(bytes) {
3707
+ if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64");
3708
+ let binary = "";
3709
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
3710
+ return btoa(binary);
3711
+ }
3712
+ //#endregion
3713
+ //#region ../../node_modules/.bun/svelte@5.55.9+b050a890ad81aed8/node_modules/svelte/src/internal/server/renderer.js
3714
+ /** @import { Component } from 'svelte' */
3715
+ /** @import { Csp, HydratableContext, RenderOutput, SSRContext, SyncRenderOutput, Sha256Source } from './types.js' */
3716
+ /** @import { MaybePromise } from '#shared' */
3717
+ /** @typedef {'head' | 'body'} RendererType */
3718
+ /** @typedef {{ [key in RendererType]: string }} AccumulatedContent */
3719
+ /**
3720
+ * @typedef {string | Renderer} RendererItem
3721
+ */
3722
+ /**
3723
+ * Renderers are basically a tree of `string | Renderer`s, where each `Renderer` in the tree represents
3724
+ * work that may or may not have completed. A renderer can be {@link collect}ed to aggregate the
3725
+ * content from itself and all of its children, but this will throw if any of the children are
3726
+ * performing asynchronous work. To asynchronously collect a renderer, just `await` it.
3727
+ *
3728
+ * The `string` values within a renderer are always associated with the {@link type} of that renderer. To switch types,
3729
+ * call {@link child} with a different `type` argument.
3730
+ */
3731
+ var Renderer = class Renderer {
3732
+ /**
3733
+ * The contents of the renderer.
3734
+ * @type {RendererItem[]}
3735
+ */
3736
+ #out = [];
3737
+ /**
3738
+ * Any `onDestroy` callbacks registered during execution of this renderer.
3739
+ * @type {(() => void)[] | undefined}
3740
+ */
3741
+ #on_destroy = void 0;
3742
+ /**
3743
+ * Whether this renderer is a component body.
3744
+ * @type {boolean}
3745
+ */
3746
+ #is_component_body = false;
3747
+ /**
3748
+ * If set, this renderer is an error boundary. When async collection
3749
+ * of the children fails, the failed snippet is rendered instead.
3750
+ * @type {{
3751
+ * failed: (renderer: Renderer, error: unknown, reset: () => void) => void;
3752
+ * transformError: (error: unknown) => unknown;
3753
+ * context: SSRContext | null;
3754
+ * } | null}
3755
+ */
3756
+ #boundary = null;
3757
+ /**
3758
+ * The type of string content that this renderer is accumulating.
3759
+ * @type {RendererType}
3760
+ */
3761
+ type;
3762
+ /** @type {Renderer | undefined} */
3763
+ #parent;
3764
+ /**
3765
+ * Asynchronous work associated with this renderer
3766
+ * @type {Promise<void> | undefined}
3767
+ */
3768
+ promise = void 0;
3769
+ /**
3770
+ * State which is associated with the content tree as a whole.
3771
+ * It will be re-exposed, uncopied, on all children.
3772
+ * @type {SSRState}
3773
+ * @readonly
3774
+ */
3775
+ global;
3776
+ /**
3777
+ * State that is local to the branch it is declared in.
3778
+ * It will be shallow-copied to all children.
3779
+ *
3780
+ * @type {{ select_value: string | undefined }}
3781
+ */
3782
+ local;
3783
+ /**
3784
+ * @param {SSRState} global
3785
+ * @param {Renderer | undefined} [parent]
3786
+ */
3787
+ constructor(global, parent) {
3788
+ this.#parent = parent;
3789
+ this.global = global;
3790
+ this.local = parent ? { ...parent.local } : { select_value: void 0 };
3791
+ this.type = parent ? parent.type : "body";
3792
+ }
3793
+ /**
3794
+ * @param {(renderer: Renderer) => void} fn
3795
+ */
3796
+ head(fn) {
3797
+ const head = new Renderer(this.global, this);
3798
+ head.type = "head";
3799
+ this.#out.push(head);
3800
+ head.child(fn);
3801
+ }
3802
+ /**
3803
+ * @param {Array<Promise<void>>} blockers
3804
+ * @param {(renderer: Renderer) => void} fn
3805
+ */
3806
+ async_block(blockers, fn) {
3807
+ this.#out.push(BLOCK_OPEN);
3808
+ this.async(blockers, fn);
3809
+ this.#out.push(BLOCK_CLOSE);
3810
+ }
3811
+ /**
3812
+ * @param {Array<Promise<void>>} blockers
3813
+ * @param {(renderer: Renderer) => void} fn
3814
+ */
3815
+ async(blockers, fn) {
3816
+ let callback = fn;
3817
+ if (blockers.length > 0) {
3818
+ const context = ssr_context;
3819
+ callback = (renderer) => {
3820
+ return Promise.all(blockers).then(() => {
3821
+ const previous_context = ssr_context;
3822
+ try {
3823
+ set_ssr_context(context);
3824
+ return fn(renderer);
3825
+ } finally {
3826
+ set_ssr_context(previous_context);
3827
+ }
3828
+ });
3829
+ };
3830
+ }
3831
+ this.child(callback);
3832
+ }
3833
+ /**
3834
+ * @param {Array<() => void>} thunks
3835
+ */
3836
+ run(thunks) {
3837
+ const context = ssr_context;
3838
+ let promise = Promise.resolve(thunks[0]());
3839
+ const promises = [promise];
3840
+ for (const fn of thunks.slice(1)) {
3841
+ promise = promise.then(() => {
3842
+ const previous_context = ssr_context;
3843
+ set_ssr_context(context);
3844
+ try {
3845
+ return fn();
3846
+ } finally {
3847
+ set_ssr_context(previous_context);
3848
+ }
3849
+ });
3850
+ promises.push(promise);
3851
+ }
3852
+ promise.catch(noop);
3853
+ this.promise = promise;
3854
+ return promises;
3855
+ }
3856
+ /**
3857
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
3858
+ */
3859
+ child_block(fn) {
3860
+ this.#out.push(BLOCK_OPEN);
3861
+ this.child(fn);
3862
+ this.#out.push(BLOCK_CLOSE);
3863
+ }
3864
+ /**
3865
+ * Create a child renderer. The child renderer inherits the state from the parent,
3866
+ * but has its own content.
3867
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
3868
+ */
3869
+ child(fn) {
3870
+ const child = new Renderer(this.global, this);
3871
+ this.#out.push(child);
3872
+ const parent = ssr_context;
3873
+ set_ssr_context({
3874
+ ...ssr_context,
3875
+ p: parent,
3876
+ c: null,
3877
+ r: child
3878
+ });
3879
+ const result = fn(child);
3880
+ set_ssr_context(parent);
3881
+ if (result instanceof Promise) {
3882
+ result.catch(noop);
3883
+ result.finally(() => set_ssr_context(null)).catch(noop);
3884
+ if (child.global.mode === "sync") await_invalid();
3885
+ child.promise = result;
3886
+ }
3887
+ return child;
3888
+ }
3889
+ /**
3890
+ * Render children inside an error boundary. If the children throw and the API-level
3891
+ * `transformError` transform handles the error (doesn't re-throw), the `failed` snippet is
3892
+ * rendered instead. Otherwise the error propagates.
3893
+ *
3894
+ * @param {{ failed?: (renderer: Renderer, error: unknown, reset: () => void) => void }} props
3895
+ * @param {(renderer: Renderer) => MaybePromise<void>} children_fn
3896
+ */
3897
+ boundary(props, children_fn) {
3898
+ const child = new Renderer(this.global, this);
3899
+ this.#out.push(child);
3900
+ const parent_context = ssr_context;
3901
+ if (props.failed) child.#boundary = {
3902
+ failed: props.failed,
3903
+ transformError: this.global.transformError,
3904
+ context: parent_context
3905
+ };
3906
+ set_ssr_context({
3907
+ ...ssr_context,
3908
+ p: parent_context,
3909
+ c: null,
3910
+ r: child
3911
+ });
3912
+ try {
3913
+ const result = children_fn(child);
3914
+ set_ssr_context(parent_context);
3915
+ if (result instanceof Promise) {
3916
+ if (child.global.mode === "sync") await_invalid();
3917
+ result.catch(noop);
3918
+ child.promise = result;
3919
+ }
3920
+ } catch (error) {
3921
+ set_ssr_context(parent_context);
3922
+ const failed_snippet = props.failed;
3923
+ if (!failed_snippet) throw error;
3924
+ const result = this.global.transformError(error);
3925
+ child.#out.length = 0;
3926
+ child.#boundary = null;
3927
+ if (result instanceof Promise) {
3928
+ if (this.global.mode === "sync") await_invalid();
3929
+ child.promise = result.then((transformed) => {
3930
+ set_ssr_context(parent_context);
3931
+ child.#out.push(Renderer.#serialize_failed_boundary(transformed));
3932
+ failed_snippet(child, transformed, noop);
3933
+ child.#out.push(BLOCK_CLOSE);
3934
+ });
3935
+ child.promise.catch(noop);
3936
+ } else {
3937
+ child.#out.push(Renderer.#serialize_failed_boundary(result));
3938
+ failed_snippet(child, result, noop);
3939
+ child.#out.push(BLOCK_CLOSE);
3940
+ }
3941
+ }
3942
+ }
3943
+ /**
3944
+ * Create a component renderer. The component renderer inherits the state from the parent,
3945
+ * but has its own content. It is treated as an ordering boundary for ondestroy callbacks.
3946
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
3947
+ * @param {Function} [component_fn]
3948
+ * @returns {void}
3949
+ */
3950
+ component(fn, component_fn) {
3951
+ push$1();
3952
+ const child = this.child(fn);
3953
+ child.#is_component_body = true;
3954
+ pop$1();
3955
+ }
3956
+ /**
3957
+ * @param {Record<string, any>} attrs
3958
+ * @param {(renderer: Renderer) => void} fn
3959
+ * @param {string | undefined} [css_hash]
3960
+ * @param {Record<string, boolean> | undefined} [classes]
3961
+ * @param {Record<string, string> | undefined} [styles]
3962
+ * @param {number | undefined} [flags]
3963
+ * @param {boolean | undefined} [is_rich]
3964
+ * @returns {void}
3965
+ */
3966
+ select(attrs, fn, css_hash, classes, styles, flags, is_rich) {
3967
+ const { value, ...select_attrs } = attrs;
3968
+ this.push(`<select${attributes(select_attrs, css_hash, classes, styles, flags)}>`);
3969
+ this.child((renderer) => {
3970
+ renderer.local.select_value = value;
3971
+ fn(renderer);
3972
+ });
3973
+ this.push(`${is_rich ? "<!>" : ""}</select>`);
3974
+ }
3975
+ /**
3976
+ * @param {Record<string, any>} attrs
3977
+ * @param {string | number | boolean | ((renderer: Renderer) => void)} body
3978
+ * @param {string | undefined} [css_hash]
3979
+ * @param {Record<string, boolean> | undefined} [classes]
3980
+ * @param {Record<string, string> | undefined} [styles]
3981
+ * @param {number | undefined} [flags]
3982
+ * @param {boolean | undefined} [is_rich]
3983
+ */
3984
+ option(attrs, body, css_hash, classes, styles, flags, is_rich) {
3985
+ this.#out.push(`<option${attributes(attrs, css_hash, classes, styles, flags)}`);
3986
+ /**
3987
+ * @param {Renderer} renderer
3988
+ * @param {any} value
3989
+ * @param {{ head?: string, body: any }} content
3990
+ */
3991
+ const close = (renderer, value, { head, body }) => {
3992
+ if (has_own_property.call(attrs, "value")) value = attrs.value;
3993
+ if (value === this.local.select_value) renderer.#out.push(" selected=\"\"");
3994
+ renderer.#out.push(`>${body}${is_rich ? "<!>" : ""}</option>`);
3995
+ if (head) renderer.head((child) => child.push(head));
3996
+ };
3997
+ if (typeof body === "function") this.child((renderer) => {
3998
+ const r = new Renderer(this.global, this);
3999
+ body(r);
4000
+ if (this.global.mode === "async") return r.#collect_content_async().then((content) => {
4001
+ close(renderer, content.body.replaceAll("<!---->", ""), content);
4002
+ });
4003
+ else {
4004
+ const content = r.#collect_content();
4005
+ close(renderer, content.body.replaceAll("<!---->", ""), content);
4006
+ }
4007
+ });
4008
+ else close(this, body, { body: escape_html(body) });
4009
+ }
4010
+ /**
4011
+ * @param {(renderer: Renderer) => void} fn
4012
+ */
4013
+ title(fn) {
4014
+ const path = this.get_path();
4015
+ /** @param {string} head */
4016
+ const close = (head) => {
4017
+ this.global.set_title(head, path);
4018
+ };
4019
+ this.child((renderer) => {
4020
+ const r = new Renderer(renderer.global, renderer);
4021
+ fn(r);
4022
+ if (renderer.global.mode === "async") return r.#collect_content_async().then((content) => {
4023
+ close(content.head);
4024
+ });
4025
+ else close(r.#collect_content().head);
4026
+ });
4027
+ }
4028
+ /**
4029
+ * @param {string | (() => Promise<string>)} content
4030
+ */
4031
+ push(content) {
4032
+ if (typeof content === "function") this.child(async (renderer) => renderer.push(await content()));
4033
+ else this.#out.push(content);
4034
+ }
4035
+ /**
4036
+ * @param {() => void} fn
4037
+ */
4038
+ on_destroy(fn) {
4039
+ (this.#on_destroy ??= []).push(fn);
4040
+ }
4041
+ /**
4042
+ * @returns {number[]}
4043
+ */
4044
+ get_path() {
4045
+ return this.#parent ? [...this.#parent.get_path(), this.#parent.#out.indexOf(this)] : [];
4046
+ }
4047
+ /**
4048
+ * @deprecated this is needed for legacy component bindings
4049
+ */
4050
+ copy() {
4051
+ const copy = new Renderer(this.global, this.#parent);
4052
+ copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item);
4053
+ copy.promise = this.promise;
4054
+ return copy;
4055
+ }
4056
+ /**
4057
+ * @param {Renderer} other
4058
+ * @deprecated this is needed for legacy component bindings
4059
+ */
4060
+ subsume(other) {
4061
+ if (this.global.mode !== other.global.mode) throw new Error("invariant: A renderer cannot switch modes. If you're seeing this, there's a compiler bug. File an issue!");
4062
+ this.local = other.local;
4063
+ this.#out = other.#out.map((item, i) => {
4064
+ const current = this.#out[i];
4065
+ if (current instanceof Renderer && item instanceof Renderer) {
4066
+ current.subsume(item);
4067
+ return current;
4068
+ }
4069
+ return item;
4070
+ });
4071
+ this.promise = other.promise;
4072
+ this.type = other.type;
4073
+ }
4074
+ get length() {
4075
+ return this.#out.length;
4076
+ }
4077
+ /**
4078
+ * Creates the hydration comment that marks the start of a failed boundary.
4079
+ * The error is JSON-serialized and embedded inside an HTML comment for the client
4080
+ * to parse during hydration. The JSON is escaped to prevent `-->` or `<!--` sequences
4081
+ * from breaking out of the comment (XSS). Uses unicode escapes which `JSON.parse()`
4082
+ * handles transparently.
4083
+ * @param {unknown} error
4084
+ * @returns {string}
4085
+ */
4086
+ static #serialize_failed_boundary(error) {
4087
+ return `<!--[?${JSON.stringify(error).replace(/>/g, "\\u003e").replace(/</g, "\\u003c")}-->`;
4088
+ }
4089
+ /**
4090
+ * Only available on the server and when compiling with the `server` option.
4091
+ * 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.
4092
+ * @template {Record<string, any>} Props
4093
+ * @param {Component<Props>} component
4094
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} [options]
4095
+ * @returns {RenderOutput}
4096
+ */
4097
+ static render(component, options = {}) {
4098
+ /** @type {AccumulatedContent | undefined} */
4099
+ let sync;
4100
+ const result = {};
4101
+ Object.defineProperties(result, {
4102
+ html: { get: () => {
4103
+ return (sync ??= Renderer.#render(component, options)).body;
4104
+ } },
4105
+ head: { get: () => {
4106
+ return (sync ??= Renderer.#render(component, options)).head;
4107
+ } },
4108
+ body: { get: () => {
4109
+ return (sync ??= Renderer.#render(component, options)).body;
4110
+ } },
4111
+ hashes: { value: { script: "" } },
4112
+ then: { value: (onfulfilled, onrejected) => {
4113
+ {
4114
+ const result = sync ??= Renderer.#render(component, options);
4115
+ const user_result = onfulfilled({
4116
+ head: result.head,
4117
+ body: result.body,
4118
+ html: result.body,
4119
+ hashes: { script: [] }
4120
+ });
4121
+ return Promise.resolve(user_result);
4122
+ }
4123
+ } }
4124
+ });
4125
+ return result;
4126
+ }
4127
+ /**
4128
+ * Collect all of the `onDestroy` callbacks registered during rendering. In an async context, this is only safe to call
4129
+ * after awaiting `collect_async`.
4130
+ *
4131
+ * Child renderers are "porous" and don't affect execution order, but component body renderers
4132
+ * create ordering boundaries. Within a renderer, callbacks run in order until hitting a component boundary.
4133
+ * @returns {Iterable<() => void>}
4134
+ */
4135
+ *#collect_on_destroy() {
4136
+ for (const component of this.#traverse_components()) yield* component.#collect_ondestroy();
4137
+ }
4138
+ /**
4139
+ * Performs a depth-first search of renderers, yielding the deepest components first, then additional components as we backtrack up the tree.
4140
+ * @returns {Iterable<Renderer>}
4141
+ */
4142
+ *#traverse_components() {
4143
+ for (const child of this.#out) if (typeof child !== "string") yield* child.#traverse_components();
4144
+ if (this.#is_component_body) yield this;
4145
+ }
4146
+ /**
4147
+ * @returns {Iterable<() => void>}
4148
+ */
4149
+ *#collect_ondestroy() {
4150
+ if (this.#on_destroy) for (const fn of this.#on_destroy) yield fn;
4151
+ for (const child of this.#out) if (child instanceof Renderer && !child.#is_component_body) yield* child.#collect_ondestroy();
4152
+ }
4153
+ /**
4154
+ * Render a component. Throws if any of the children are performing asynchronous work.
4155
+ *
4156
+ * @template {Record<string, any>} Props
4157
+ * @param {Component<Props>} component
4158
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
4159
+ * @returns {AccumulatedContent}
4160
+ */
4161
+ static #render(component, options) {
4162
+ var previous_context = ssr_context;
4163
+ try {
4164
+ const renderer = Renderer.#open_render("sync", component, options);
4165
+ const content = renderer.#collect_content();
4166
+ return Renderer.#close_render(content, renderer);
4167
+ } finally {
4168
+ abort();
4169
+ set_ssr_context(previous_context);
4170
+ }
4171
+ }
4172
+ /**
4173
+ * Render a component.
4174
+ *
4175
+ * @template {Record<string, any>} Props
4176
+ * @param {Component<Props>} component
4177
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} options
4178
+ * @returns {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>}
4179
+ */
4180
+ static async #render_async(component, options) {
4181
+ const previous_context = ssr_context;
4182
+ try {
4183
+ const renderer = Renderer.#open_render("async", component, options);
4184
+ const content = await renderer.#collect_content_async();
4185
+ const hydratables = await renderer.#collect_hydratables();
4186
+ if (hydratables !== null) content.head = hydratables + content.head;
4187
+ return Renderer.#close_render(content, renderer);
4188
+ } finally {
4189
+ set_ssr_context(previous_context);
4190
+ abort();
4191
+ }
4192
+ }
4193
+ /**
4194
+ * Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string.
4195
+ * @param {AccumulatedContent} content
4196
+ * @returns {AccumulatedContent}
4197
+ */
4198
+ #collect_content(content = {
4199
+ head: "",
4200
+ body: ""
4201
+ }) {
4202
+ for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
4203
+ else if (item instanceof Renderer) item.#collect_content(content);
4204
+ return content;
4205
+ }
4206
+ /**
4207
+ * Collect all of the code from the `out` array and return it as a string.
4208
+ * @param {AccumulatedContent} content
4209
+ * @returns {Promise<AccumulatedContent>}
4210
+ */
4211
+ async #collect_content_async(content = {
4212
+ head: "",
4213
+ body: ""
4214
+ }) {
4215
+ await this.promise;
4216
+ for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
4217
+ else if (item instanceof Renderer) if (item.#boundary) {
4218
+ /** @type {AccumulatedContent} */
4219
+ const boundary_content = {
4220
+ head: "",
4221
+ body: ""
4222
+ };
4223
+ try {
4224
+ await item.#collect_content_async(boundary_content);
4225
+ content.head += boundary_content.head;
4226
+ content.body += boundary_content.body;
4227
+ } catch (error) {
4228
+ const { context, failed, transformError } = item.#boundary;
4229
+ set_ssr_context(context);
4230
+ let promise = transformError(error);
4231
+ set_ssr_context(null);
4232
+ let transformed = await promise;
4233
+ set_ssr_context(context);
4234
+ const failed_renderer = new Renderer(item.global, item);
4235
+ failed_renderer.type = item.type;
4236
+ failed_renderer.#out.push(Renderer.#serialize_failed_boundary(transformed));
4237
+ failed(failed_renderer, transformed, noop);
4238
+ failed_renderer.#out.push(BLOCK_CLOSE);
4239
+ await failed_renderer.#collect_content_async(content);
4240
+ }
4241
+ } else await item.#collect_content_async(content);
4242
+ return content;
4243
+ }
4244
+ async #collect_hydratables() {
4245
+ const ctx = get_render_context().hydratable;
4246
+ for (const [_, key] of ctx.unresolved_promises) unresolved_hydratable(key, ctx.lookup.get(key)?.stack ?? "<missing stack trace>");
4247
+ for (const comparison of ctx.comparisons) await comparison;
4248
+ return await this.#hydratable_block(ctx);
4249
+ }
4250
+ /**
4251
+ * @template {Record<string, any>} Props
4252
+ * @param {'sync' | 'async'} mode
4253
+ * @param {import('svelte').Component<Props>} component
4254
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} options
4255
+ * @returns {Renderer}
4256
+ */
4257
+ static #open_render(mode, component, options) {
4258
+ if (options.idPrefix?.includes("--")) invalid_id_prefix();
4259
+ var previous_context = ssr_context;
4260
+ try {
4261
+ const renderer = new Renderer(new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "", options.csp, options.transformError));
4262
+ set_ssr_context({
4263
+ p: null,
4264
+ c: options.context ?? null,
4265
+ r: renderer
4266
+ });
4267
+ renderer.push(BLOCK_OPEN);
4268
+ component(renderer, options.props ?? {});
4269
+ renderer.push(BLOCK_CLOSE);
4270
+ return renderer;
4271
+ } finally {
4272
+ set_ssr_context(previous_context);
4273
+ }
4274
+ }
4275
+ /**
4276
+ * @param {AccumulatedContent} content
4277
+ * @param {Renderer} renderer
4278
+ * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}
4279
+ */
4280
+ static #close_render(content, renderer) {
4281
+ for (const cleanup of renderer.#collect_on_destroy()) cleanup();
4282
+ let head = content.head + renderer.global.get_title();
4283
+ let body = content.body;
4284
+ for (const { hash, code } of renderer.global.css) head += `<style id="${hash}">${code}</style>`;
4285
+ return {
4286
+ head,
4287
+ body,
4288
+ hashes: { script: renderer.global.csp.script_hashes }
4289
+ };
4290
+ }
4291
+ /**
4292
+ * @param {HydratableContext} ctx
4293
+ */
4294
+ async #hydratable_block(ctx) {
4295
+ if (ctx.lookup.size === 0) return null;
4296
+ let entries = [];
4297
+ let has_promises = false;
4298
+ for (const [k, v] of ctx.lookup) {
4299
+ if (v.promises) {
4300
+ has_promises = true;
4301
+ for (const p of v.promises) await p;
4302
+ }
4303
+ entries.push(`[${uneval(k)},${v.serialized}]`);
4304
+ }
4305
+ let prelude = `const h = (window.__svelte ??= {}).h ??= new Map();`;
4306
+ if (has_promises) prelude = `const r = (v) => Promise.resolve(v);
4307
+ ${prelude}`;
4308
+ const body = `
4309
+ {
4310
+ ${prelude}
4311
+
4312
+ for (const [k, v] of [
4313
+ ${entries.join(",\n ")}
4314
+ ]) {
4315
+ h.set(k, v);
4316
+ }
4317
+ }
4318
+ `;
4319
+ let csp_attr = "";
4320
+ if (this.global.csp.nonce) csp_attr = ` nonce="${this.global.csp.nonce}"`;
4321
+ else if (this.global.csp.hash) {
4322
+ const hash = await sha256(body);
4323
+ this.global.csp.script_hashes.push(`sha256-${hash}`);
4324
+ }
4325
+ return `\n\t\t<script${csp_attr}>${body}<\/script>`;
4326
+ }
4327
+ };
4328
+ var SSRState = class {
4329
+ /** @readonly @type {Csp & { script_hashes: Sha256Source[] }} */
4330
+ csp;
4331
+ /** @readonly @type {'sync' | 'async'} */
4332
+ mode;
4333
+ /** @readonly @type {() => string} */
4334
+ uid;
4335
+ /** @readonly @type {Set<{ hash: string; code: string }>} */
4336
+ css = /* @__PURE__ */ new Set();
4337
+ /**
4338
+ * `transformError` passed to `render`. Called when an error boundary catches an error.
4339
+ * Throws by default if unset in `render`.
4340
+ * @type {(error: unknown) => unknown}
4341
+ */
4342
+ transformError;
4343
+ /** @type {{ path: number[], value: string }} */
4344
+ #title = {
4345
+ path: [],
4346
+ value: ""
4347
+ };
4348
+ /**
4349
+ * @param {'sync' | 'async'} mode
4350
+ * @param {string} id_prefix
4351
+ * @param {Csp} csp
4352
+ * @param {((error: unknown) => unknown) | undefined} [transformError]
4353
+ */
4354
+ constructor(mode, id_prefix = "", csp = { hash: false }, transformError) {
4355
+ this.mode = mode;
4356
+ this.csp = {
4357
+ ...csp,
4358
+ script_hashes: []
4359
+ };
4360
+ this.transformError = transformError ?? ((error) => {
4361
+ throw error;
4362
+ });
4363
+ let uid = 1;
4364
+ this.uid = () => `${id_prefix}s${uid++}`;
4365
+ }
4366
+ get_title() {
4367
+ return this.#title.value;
4368
+ }
4369
+ /**
4370
+ * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
4371
+ * from earlier than or equal to the current value.
4372
+ * @param {string} value
4373
+ * @param {number[]} path
4374
+ */
4375
+ set_title(value, path) {
4376
+ const current = this.#title.path;
4377
+ let i = 0;
4378
+ let l = Math.min(path.length, current.length);
4379
+ while (i < l && path[i] === current[i]) i += 1;
4380
+ if (path[i] === void 0) return;
4381
+ if (current[i] === void 0 || path[i] > current[i]) {
4382
+ this.#title.path = path;
4383
+ this.#title.value = value;
4384
+ }
4385
+ }
4386
+ };
4387
+
4388
+ export { setContext as $, hasContext as A, head as B, html as C, DevalueError as D, hydratable_serialization_failed as E, hydrate_node as F, hydrating as G, HYDRATION_ERROR as H, hydration_failed as I, hydration_mismatch as J, init_operations as K, LEGACY_PROPS as L, MAX_ARRAY_INDEX as M, is_passive_event as N, is_plain_object as O, is_primitive as P, is_valid_array_index as Q, is_valid_array_len as R, lifecycle_function_unavailable as S, mutable_source as T, noop as U, pop as V, push as W, readable as X, render as Y, run as Z, set as _, active_effect as a, set_active_effect as a0, set_active_reaction as a1, set_hydrate_node as a2, set_hydrating as a3, slot as a4, ssr_context as a5, stringify as a6, stringify_key as a7, stringify_string as a8, uneval as a9, valid_array_indices as aa, writable as ab, active_reaction as b, array_from as c, attr as d, attr_class as e, boundary as f, clear_text_content as g, component_context as h, component_root as i, createContext as j, create_text as k, define_property as l, derived as m, ensure_array_like as n, enumerable_symbols as o, escape_html as p, experimental_async_required as q, flushSync as r, get as s, getAbortSignal as t, getAllContexts as u, getContext as v, get_first_child as w, get_next_sibling as x, get_render_context as y, get_type as z };
4389
+ //# sourceMappingURL=dev-DjANv7AF.js.map