@agent-profile/web 0.3.4 → 0.4.0

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