@svgrid/enterprise 2.4.0 → 2.5.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 (161) hide show
  1. package/dist/cdn/svgrid-enterprise.svelte-external.js +5917 -5545
  2. package/dist/designer/assets/{index-okIcRP9P.js → index-qL7ir9C7.js} +3 -3
  3. package/dist/designer/assets/{src-CIla2aVG.js → src-96d31O63.js} +259 -228
  4. package/dist/designer/assets/{src-BvsJ00AO.css → src-D-O2F805.css} +1 -1
  5. package/dist/designer/index.html +3 -3
  6. package/dist/node/studio.js +681 -84
  7. package/package.json +3 -3
  8. package/src/SvGridEditPanel.dom.test.ts +174 -0
  9. package/src/SvGridEditPanel.svelte +209 -46
  10. package/src/edit-panel.test.ts +145 -36
  11. package/src/edit-panel.ts +167 -16
  12. package/src/expressions/evaluate.ts +1 -1
  13. package/src/expressions/parse.ts +3 -3
  14. package/src/index.ts +8 -0
  15. package/src/license-core.ts +77 -5
  16. package/src/license-expiry.test.ts +91 -0
  17. package/src/license.ts +31 -2
  18. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +1 -0
  19. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +178 -0
  20. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-ZrPsKxob.js +3875 -0
  21. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-ZrPsKxob.js.map +1 -0
  22. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-ACqvWGE2.js +21 -0
  23. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-ACqvWGE2.js.map +1 -0
  24. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-D3w5jt92.js +1938 -0
  25. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-D3w5jt92.js.map +1 -0
  26. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-CC2V3H0y.js +205 -0
  27. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-CC2V3H0y.js.map +1 -0
  28. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-BXP37tAa.js +18 -0
  29. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-BXP37tAa.js.map +1 -0
  30. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-DwubnU5b.js +264 -0
  31. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-DwubnU5b.js.map +1 -0
  32. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-hD7f6PUz.js +697 -0
  33. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-hD7f6PUz.js.map +1 -0
  34. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +3 -0
  35. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +134 -0
  36. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +1 -0
  37. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +55 -0
  38. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +1 -0
  39. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +2 -0
  40. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +46843 -0
  41. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +1 -0
  42. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +237 -0
  43. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +1 -0
  44. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +2 -0
  45. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +4 -0
  46. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +1 -0
  47. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +7 -0
  48. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +4 -0
  49. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +1 -0
  50. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +5 -0
  51. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +1 -0
  52. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +5 -0
  53. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +1 -0
  54. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +5 -0
  55. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +1 -0
  56. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +6 -0
  57. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +83 -0
  58. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +1 -0
  59. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +559 -0
  60. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +1 -0
  61. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +24 -0
  62. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +1 -0
  63. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +122 -0
  64. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +1 -0
  65. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +2 -0
  66. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +89 -0
  67. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +1 -0
  68. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +241 -0
  69. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +1 -0
  70. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DBx1SCN6.js +4938 -0
  71. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DBx1SCN6.js.map +1 -0
  72. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-gjfpSTFS.js +495 -0
  73. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-gjfpSTFS.js.map +1 -0
  74. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-DKoOKg8S.js +190 -0
  75. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-DKoOKg8S.js.map +1 -0
  76. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-C0MiR7eR.js +8 -0
  77. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-C0MiR7eR.js.map +1 -0
  78. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-B6Y7P0Q-.js +138 -0
  79. package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-B6Y7P0Q-.js.map +1 -0
  80. package/src/schema.ts +63 -0
  81. package/src/studio/emit-project.test.ts +191 -0
  82. package/src/studio/emit-project.ts +237 -27
  83. package/src/studio/emit-schema.ts +4 -1
  84. package/src/studio/index.ts +2 -0
  85. package/src/studio/init-flow.test.ts +150 -0
  86. package/src/studio/init-flow.ts +169 -22
  87. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +1 -0
  88. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +178 -0
  89. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +3875 -0
  90. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +1 -0
  91. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +21 -0
  92. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +1 -0
  93. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +1938 -0
  94. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +1 -0
  95. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +205 -0
  96. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +1 -0
  97. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +18 -0
  98. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +1 -0
  99. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +264 -0
  100. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +1 -0
  101. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +697 -0
  102. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +1 -0
  103. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +3 -0
  104. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +134 -0
  105. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +1 -0
  106. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +55 -0
  107. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +1 -0
  108. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +2 -0
  109. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +46843 -0
  110. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +1 -0
  111. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +237 -0
  112. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +1 -0
  113. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +2 -0
  114. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +4 -0
  115. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +1 -0
  116. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +7 -0
  117. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +4 -0
  118. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +1 -0
  119. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +5 -0
  120. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +1 -0
  121. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +5 -0
  122. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +1 -0
  123. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +5 -0
  124. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +1 -0
  125. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +6 -0
  126. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +83 -0
  127. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +1 -0
  128. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +559 -0
  129. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +1 -0
  130. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +24 -0
  131. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +1 -0
  132. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +122 -0
  133. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +1 -0
  134. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +2 -0
  135. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +89 -0
  136. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +1 -0
  137. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +241 -0
  138. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +1 -0
  139. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +4938 -0
  140. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +1 -0
  141. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +495 -0
  142. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +1 -0
  143. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +190 -0
  144. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +1 -0
  145. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +8 -0
  146. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +1 -0
  147. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +138 -0
  148. package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +1 -0
  149. package/src/studio/project.test.ts +30 -0
  150. package/src/studio/project.ts +72 -8
  151. package/src/studio/samples/crm.ts +11 -2
  152. package/src/studio/samples/insurance.ts +10 -4
  153. package/src/studio/samples/samples.test.ts +36 -0
  154. package/src/studio/samples/shared.ts +14 -0
  155. package/src/studio/samples/support.ts +12 -5
  156. package/src/studio/screen-suites.test.ts +43 -0
  157. package/src/studio/screen-suites.ts +5 -2
  158. package/src/studio/user-error.ts +31 -0
  159. package/src/upgrade-prompt.ts +23 -10
  160. package/src/version.test.ts +17 -0
  161. package/src/version.ts +13 -0
@@ -0,0 +1,1938 @@
1
+ import { $n as STALE_REACTION, Cr as lifecycle_outside_component, Rn as get_stack, Sr as invalid_snippet_arguments, dr as has_own_property, hr as noop, ir as deferred, mr as is_promise, t as subscribe_to_store, wr as missing_context } from "./utils-BbWyXNk1.js";
2
+ import { t as async_mode_flag } from "./flags-X7D4vfrZ.js";
3
+ import { l as UNINITIALIZED, n as FILENAME } from "./constants-B9vgIdCd.js";
4
+ import { i as EMPTY_COMMENT, n as BLOCK_OPEN, o as is_tag_valid_with_ancestor, r as BLOCK_OPEN_ELSE, s as is_tag_valid_with_parent, t as BLOCK_CLOSE } from "./hydration-oyUje5i1.js";
5
+ import { _ as is_void, a as is_boolean_attribute, b as escape_html, f as is_raw_text_element, i as hash, t as REGEX_VALID_TAG_NAME } from "./utils-DI_fC7vt.js";
6
+ import { a as attr, c as to_style, o as clsx, r as validate_store, s as to_class } from "./validate-Dyr3lQv9.js";
7
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/errors.js
8
+ /**
9
+ * The node API `AsyncLocalStorage` is not available, but is required to use async server rendering.
10
+ * @returns {never}
11
+ */
12
+ function async_local_storage_unavailable() {
13
+ const error = /* @__PURE__ */ new Error(`async_local_storage_unavailable\nThe node API \`AsyncLocalStorage\` is not available, but is required to use async server rendering.\nhttps://svelte.dev/e/async_local_storage_unavailable`);
14
+ error.name = "Svelte error";
15
+ throw error;
16
+ }
17
+ /**
18
+ * Encountered asynchronous work while rendering synchronously.
19
+ * @returns {never}
20
+ */
21
+ function await_invalid() {
22
+ const error = /* @__PURE__ */ new Error(`await_invalid\nEncountered asynchronous work while rendering synchronously.\nhttps://svelte.dev/e/await_invalid`);
23
+ error.name = "Svelte error";
24
+ throw error;
25
+ }
26
+ /**
27
+ * `<svelte:element this="%tag%">` is not a valid element name — the element will not be rendered
28
+ * @param {string} tag
29
+ * @returns {never}
30
+ */
31
+ function dynamic_element_invalid_tag(tag) {
32
+ const error = /* @__PURE__ */ new Error(`dynamic_element_invalid_tag\n\`<svelte:element this="${tag}">\` is not a valid element name — the element will not be rendered\nhttps://svelte.dev/e/dynamic_element_invalid_tag`);
33
+ error.name = "Svelte error";
34
+ throw error;
35
+ }
36
+ /**
37
+ * The `html` property of server render results has been deprecated. Use `body` instead.
38
+ * @returns {never}
39
+ */
40
+ function html_deprecated() {
41
+ const error = /* @__PURE__ */ new Error(`html_deprecated\nThe \`html\` property of server render results has been deprecated. Use \`body\` instead.\nhttps://svelte.dev/e/html_deprecated`);
42
+ error.name = "Svelte error";
43
+ throw error;
44
+ }
45
+ /**
46
+ * Attempted to set `hydratable` with key `%key%` twice with different values.
47
+ *
48
+ * %stack%
49
+ * @param {string} key
50
+ * @param {string} stack
51
+ * @returns {never}
52
+ */
53
+ function hydratable_clobbering(key, stack) {
54
+ const error = /* @__PURE__ */ new Error(`hydratable_clobbering\nAttempted to set \`hydratable\` with key \`${key}\` twice with different values.
55
+
56
+ ${stack}\nhttps://svelte.dev/e/hydratable_clobbering`);
57
+ error.name = "Svelte error";
58
+ throw error;
59
+ }
60
+ /**
61
+ * Failed to serialize `hydratable` data for key `%key%`.
62
+ *
63
+ * `hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises.
64
+ *
65
+ * Cause:
66
+ * %stack%
67
+ * @param {string} key
68
+ * @param {string} stack
69
+ * @returns {never}
70
+ */
71
+ function hydratable_serialization_failed(key, stack) {
72
+ const error = /* @__PURE__ */ new Error(`hydratable_serialization_failed\nFailed to serialize \`hydratable\` data for key \`${key}\`.
73
+
74
+ \`hydratable\` can serialize anything [\`uneval\` from \`devalue\`](https://npmjs.com/package/uneval) can, plus Promises.
75
+
76
+ Cause:
77
+ ${stack}\nhttps://svelte.dev/e/hydratable_serialization_failed`);
78
+ error.name = "Svelte error";
79
+ throw error;
80
+ }
81
+ /**
82
+ * `csp.nonce` was set while `csp.hash` was `true`. These options cannot be used simultaneously.
83
+ * @returns {never}
84
+ */
85
+ function invalid_csp() {
86
+ 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`);
87
+ error.name = "Svelte error";
88
+ throw error;
89
+ }
90
+ /**
91
+ * The `idPrefix` option cannot include `--`.
92
+ * @returns {never}
93
+ */
94
+ function invalid_id_prefix() {
95
+ const error = /* @__PURE__ */ new Error(`invalid_id_prefix\nThe \`idPrefix\` option cannot include \`--\`.\nhttps://svelte.dev/e/invalid_id_prefix`);
96
+ error.name = "Svelte error";
97
+ throw error;
98
+ }
99
+ /**
100
+ * `%name%(...)` is not available on the server
101
+ * @param {string} name
102
+ * @returns {never}
103
+ */
104
+ function lifecycle_function_unavailable(name) {
105
+ const error = /* @__PURE__ */ new Error(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server\nhttps://svelte.dev/e/lifecycle_function_unavailable`);
106
+ error.name = "Svelte error";
107
+ throw error;
108
+ }
109
+ /**
110
+ * Could not resolve `render` context.
111
+ * @returns {never}
112
+ */
113
+ function server_context_required() {
114
+ const error = /* @__PURE__ */ new Error(`server_context_required\nCould not resolve \`render\` context.\nhttps://svelte.dev/e/server_context_required`);
115
+ error.name = "Svelte error";
116
+ throw error;
117
+ }
118
+ //#endregion
119
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/context.js
120
+ /** @import { SSRContext } from '#server' */
121
+ /** @type {SSRContext | null} */
122
+ var ssr_context = null;
123
+ /** @param {SSRContext | null} v */
124
+ function set_ssr_context(v) {
125
+ ssr_context = v;
126
+ }
127
+ /**
128
+ * @template T
129
+ * @returns {[() => T, (context: T) => T]}
130
+ * @since 5.40.0
131
+ */
132
+ function createContext() {
133
+ const key = {};
134
+ return [() => {
135
+ if (!hasContext(key)) missing_context();
136
+ return getContext(key);
137
+ }, (context) => setContext(key, context)];
138
+ }
139
+ /**
140
+ * @template T
141
+ * @param {any} key
142
+ * @returns {T}
143
+ */
144
+ function getContext(key) {
145
+ return get_or_init_context_map("getContext").get(key);
146
+ }
147
+ /**
148
+ * @template T
149
+ * @param {any} key
150
+ * @param {T} context
151
+ * @returns {T}
152
+ */
153
+ function setContext(key, context) {
154
+ get_or_init_context_map("setContext").set(key, context);
155
+ return context;
156
+ }
157
+ /**
158
+ * @param {any} key
159
+ * @returns {boolean}
160
+ */
161
+ function hasContext(key) {
162
+ return get_or_init_context_map("hasContext").has(key);
163
+ }
164
+ /** @returns {Map<any, any>} */
165
+ function getAllContexts() {
166
+ return get_or_init_context_map("getAllContexts");
167
+ }
168
+ /**
169
+ * @param {string} name
170
+ * @returns {Map<unknown, unknown>}
171
+ */
172
+ function get_or_init_context_map(name) {
173
+ if (ssr_context === null) lifecycle_outside_component(name);
174
+ return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
175
+ }
176
+ /**
177
+ * @param {Function} [fn]
178
+ */
179
+ function push(fn) {
180
+ ssr_context = {
181
+ p: ssr_context,
182
+ c: null,
183
+ r: null
184
+ };
185
+ ssr_context.function = fn;
186
+ ssr_context.element = ssr_context.p?.element;
187
+ }
188
+ function pop() {
189
+ ssr_context = ssr_context.p;
190
+ }
191
+ /**
192
+ * @param {SSRContext} ssr_context
193
+ * @returns {Map<unknown, unknown> | null}
194
+ */
195
+ function get_parent_context(ssr_context) {
196
+ let parent = ssr_context.p;
197
+ while (parent !== null) {
198
+ const context_map = parent.c;
199
+ if (context_map !== null) return context_map;
200
+ parent = parent.p;
201
+ }
202
+ return null;
203
+ }
204
+ /**
205
+ * Wraps an `await` expression in such a way that the component context that was
206
+ * active before the expression evaluated can be reapplied afterwards —
207
+ * `await a + b()` becomes `(await $.save(a))() + b()`, meaning `b()` will have access
208
+ * to the context of its component.
209
+ * @template T
210
+ * @param {Promise<T>} promise
211
+ * @returns {Promise<() => T>}
212
+ */
213
+ async function save(promise) {
214
+ var previous_context = ssr_context;
215
+ var value = await promise;
216
+ return () => {
217
+ ssr_context = previous_context;
218
+ return value;
219
+ };
220
+ }
221
+ //#endregion
222
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/abort-signal.js
223
+ /** @type {AbortController | null} */
224
+ var controller = null;
225
+ function abort() {
226
+ controller?.abort(STALE_REACTION);
227
+ controller = null;
228
+ }
229
+ function getAbortSignal() {
230
+ return (controller ??= new AbortController()).signal;
231
+ }
232
+ //#endregion
233
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/render-context.js
234
+ /** @import { AsyncLocalStorage } from 'node:async_hooks' */
235
+ /** @import { RenderContext } from '#server' */
236
+ /** @type {Promise<void> | null} */
237
+ var current_render = null;
238
+ /** @type {RenderContext | null} */
239
+ var context = null;
240
+ /** @returns {RenderContext} */
241
+ function get_render_context() {
242
+ const store = context ?? als?.getStore();
243
+ if (!store) server_context_required();
244
+ return store;
245
+ }
246
+ /**
247
+ * @template T
248
+ * @param {() => Promise<T>} fn
249
+ * @returns {Promise<T>}
250
+ */
251
+ async function with_render_context(fn) {
252
+ context = { hydratable: {
253
+ lookup: /* @__PURE__ */ new Map(),
254
+ comparisons: [],
255
+ unresolved_promises: /* @__PURE__ */ new Map()
256
+ } };
257
+ if (in_webcontainer()) {
258
+ const { promise, resolve } = deferred();
259
+ const previous_render = current_render;
260
+ current_render = promise;
261
+ await previous_render;
262
+ return fn().finally(resolve);
263
+ }
264
+ try {
265
+ if (als === null) async_local_storage_unavailable();
266
+ return als.run(context, fn);
267
+ } finally {
268
+ context = null;
269
+ }
270
+ }
271
+ /** @type {AsyncLocalStorage<RenderContext | null> | null} */
272
+ var als = null;
273
+ /** @type {Promise<void> | null} */
274
+ var als_import = null;
275
+ /**
276
+ *
277
+ * @returns {Promise<void>}
278
+ */
279
+ function init_render_context() {
280
+ als_import ??= import("node:async_hooks").then((hooks) => {
281
+ als = new hooks.AsyncLocalStorage();
282
+ }).then(noop, noop);
283
+ return als_import;
284
+ }
285
+ function in_webcontainer() {
286
+ return !!globalThis.process?.versions?.webcontainer;
287
+ }
288
+ var MAX_ARRAY_INDEX = 2 ** 32 - 1 - 1;
289
+ //#endregion
290
+ //#region ../../../../node_modules/.pnpm/devalue@5.8.1/node_modules/devalue/src/utils.js
291
+ /** @type {Record<string, string>} */
292
+ var escaped = {
293
+ "<": "\\u003C",
294
+ "\\": "\\\\",
295
+ "\b": "\\b",
296
+ "\f": "\\f",
297
+ "\n": "\\n",
298
+ "\r": "\\r",
299
+ " ": "\\t",
300
+ "\u2028": "\\u2028",
301
+ "\u2029": "\\u2029"
302
+ };
303
+ var DevalueError = class extends Error {
304
+ /**
305
+ * @param {string} message
306
+ * @param {string[]} keys
307
+ * @param {any} [value] - The value that failed to be serialized
308
+ * @param {any} [root] - The root value being serialized
309
+ */
310
+ constructor(message, keys, value, root) {
311
+ super(message);
312
+ this.name = "DevalueError";
313
+ this.path = keys.join("");
314
+ this.value = value;
315
+ this.root = root;
316
+ }
317
+ };
318
+ /** @param {any} thing */
319
+ function is_primitive(thing) {
320
+ return thing === null || typeof thing !== "object" && typeof thing !== "function";
321
+ }
322
+ var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
323
+ /** @param {any} thing */
324
+ function is_plain_object(thing) {
325
+ const proto = Object.getPrototypeOf(thing);
326
+ return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
327
+ }
328
+ /** @param {any} thing */
329
+ function get_type(thing) {
330
+ return Object.prototype.toString.call(thing).slice(8, -1);
331
+ }
332
+ /** @param {string} char */
333
+ function get_escaped_char(char) {
334
+ switch (char) {
335
+ case "\"": return "\\\"";
336
+ case "<": return "\\u003C";
337
+ case "\\": return "\\\\";
338
+ case "\n": return "\\n";
339
+ case "\r": return "\\r";
340
+ case " ": return "\\t";
341
+ case "\b": return "\\b";
342
+ case "\f": return "\\f";
343
+ case "\u2028": return "\\u2028";
344
+ case "\u2029": return "\\u2029";
345
+ default: return char < " " ? `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
346
+ }
347
+ }
348
+ /** @param {string} str */
349
+ function stringify_string(str) {
350
+ let result = "";
351
+ let last_pos = 0;
352
+ const len = str.length;
353
+ for (let i = 0; i < len; i += 1) {
354
+ const char = str[i];
355
+ const replacement = get_escaped_char(char);
356
+ if (replacement) {
357
+ result += str.slice(last_pos, i) + replacement;
358
+ last_pos = i + 1;
359
+ }
360
+ }
361
+ return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
362
+ }
363
+ /** @param {Record<string | symbol, any>} object */
364
+ function enumerable_symbols(object) {
365
+ return Object.getOwnPropertySymbols(object).filter((symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable);
366
+ }
367
+ var is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
368
+ /** @param {string} key */
369
+ function stringify_key(key) {
370
+ return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
371
+ }
372
+ /** @param {number} n */
373
+ function is_valid_array_index(n) {
374
+ if (!Number.isInteger(n)) return false;
375
+ if (n < 0) return false;
376
+ if (n > MAX_ARRAY_INDEX) return false;
377
+ return true;
378
+ }
379
+ /** @param {string} s */
380
+ function is_valid_array_index_string(s) {
381
+ if (s.length === 0) return false;
382
+ if (s.length > 1 && s.charCodeAt(0) === 48) return false;
383
+ for (let i = 0; i < s.length; i++) {
384
+ const c = s.charCodeAt(i);
385
+ if (c < 48 || c > 57) return false;
386
+ }
387
+ return is_valid_array_index(+s);
388
+ }
389
+ /**
390
+ * Finds the populated indices of an array.
391
+ * @param {unknown[]} array
392
+ */
393
+ function valid_array_indices(array) {
394
+ const keys = Object.keys(array);
395
+ for (var i = keys.length - 1; i >= 0; i--) if (is_valid_array_index_string(keys[i])) break;
396
+ keys.length = i + 1;
397
+ return keys;
398
+ }
399
+ //#endregion
400
+ //#region ../../../../node_modules/.pnpm/devalue@5.8.1/node_modules/devalue/src/uneval.js
401
+ var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
402
+ var unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
403
+ var reserved = /^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
404
+ /**
405
+ * Turn a value into the JavaScript that creates an equivalent value
406
+ * @param {any} value
407
+ * @param {(value: any, uneval: (value: any) => string) => string | void} [replacer]
408
+ */
409
+ function uneval(value, replacer) {
410
+ const counts = /* @__PURE__ */ new Map();
411
+ /** @type {string[]} */
412
+ const keys = [];
413
+ const custom = /* @__PURE__ */ new Map();
414
+ /** @param {any} thing */
415
+ function walk(thing) {
416
+ if (!is_primitive(thing)) {
417
+ if (counts.has(thing)) {
418
+ counts.set(thing, counts.get(thing) + 1);
419
+ return;
420
+ }
421
+ counts.set(thing, 1);
422
+ if (replacer) {
423
+ const str = replacer(thing, (value) => uneval(value, replacer));
424
+ if (typeof str === "string") {
425
+ custom.set(thing, str);
426
+ return;
427
+ }
428
+ }
429
+ if (typeof thing === "function") throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
430
+ switch (get_type(thing)) {
431
+ case "Number":
432
+ case "BigInt":
433
+ case "String":
434
+ case "Boolean":
435
+ case "Date":
436
+ case "RegExp":
437
+ case "URL":
438
+ case "URLSearchParams": return;
439
+ case "Array":
440
+ /** @type {any[]} */ thing.forEach((value, i) => {
441
+ keys.push(`[${i}]`);
442
+ walk(value);
443
+ keys.pop();
444
+ });
445
+ break;
446
+ case "Set":
447
+ Array.from(thing).forEach(walk);
448
+ break;
449
+ case "Map":
450
+ for (const [key, value] of thing) {
451
+ keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`);
452
+ walk(value);
453
+ keys.pop();
454
+ }
455
+ break;
456
+ case "Int8Array":
457
+ case "Uint8Array":
458
+ case "Uint8ClampedArray":
459
+ case "Int16Array":
460
+ case "Uint16Array":
461
+ case "Float16Array":
462
+ case "Int32Array":
463
+ case "Uint32Array":
464
+ case "Float32Array":
465
+ case "Float64Array":
466
+ case "BigInt64Array":
467
+ case "BigUint64Array":
468
+ case "DataView":
469
+ walk(thing.buffer);
470
+ return;
471
+ case "ArrayBuffer": return;
472
+ case "Temporal.Duration":
473
+ case "Temporal.Instant":
474
+ case "Temporal.PlainDate":
475
+ case "Temporal.PlainTime":
476
+ case "Temporal.PlainDateTime":
477
+ case "Temporal.PlainMonthDay":
478
+ case "Temporal.PlainYearMonth":
479
+ case "Temporal.ZonedDateTime": return;
480
+ default:
481
+ if (!is_plain_object(thing)) throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
482
+ if (enumerable_symbols(thing).length > 0) throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
483
+ for (const key of Object.keys(thing)) {
484
+ if (key === "__proto__") throw new DevalueError(`Cannot stringify objects with __proto__ keys`, keys, thing, value);
485
+ keys.push(stringify_key(key));
486
+ walk(thing[key]);
487
+ keys.pop();
488
+ }
489
+ }
490
+ } else if (typeof thing === "symbol") throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
491
+ }
492
+ walk(value);
493
+ const names = /* @__PURE__ */ new Map();
494
+ Array.from(counts).filter((entry) => entry[1] > 1).sort((a, b) => b[1] - a[1]).forEach((entry, i) => {
495
+ names.set(entry[0], get_name(i));
496
+ });
497
+ /**
498
+ * @param {any} thing
499
+ * @returns {string}
500
+ */
501
+ function stringify(thing) {
502
+ if (names.has(thing)) return names.get(thing);
503
+ if (is_primitive(thing)) return stringify_primitive(thing);
504
+ if (custom.has(thing)) return custom.get(thing);
505
+ const type = get_type(thing);
506
+ switch (type) {
507
+ case "Number":
508
+ case "String":
509
+ case "Boolean":
510
+ case "BigInt": return `Object(${stringify(thing.valueOf())})`;
511
+ case "RegExp":
512
+ const { source, flags } = thing;
513
+ return flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
514
+ case "Date": return `new Date(${thing.getTime()})`;
515
+ case "URL": return `new URL(${stringify_string(thing.toString())})`;
516
+ case "URLSearchParams": return `new URLSearchParams(${stringify_string(thing.toString())})`;
517
+ case "Array": {
518
+ let has_holes = false;
519
+ let result = "[";
520
+ for (let i = 0; i < thing.length; i += 1) {
521
+ if (i > 0) result += ",";
522
+ if (Object.hasOwn(thing, i)) result += stringify(thing[i]);
523
+ else if (!has_holes) {
524
+ const populated_keys = valid_array_indices(thing);
525
+ const population = populated_keys.length;
526
+ const d = String(thing.length).length;
527
+ if (thing.length + 2 > 25 + d + population * (d + 2)) {
528
+ const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(",");
529
+ return `Object.assign(Array(${thing.length}),{${entries}})`;
530
+ }
531
+ has_holes = true;
532
+ i -= 1;
533
+ }
534
+ }
535
+ const tail = thing.length === 0 || thing.length - 1 in thing ? "" : ",";
536
+ return result + tail + "]";
537
+ }
538
+ case "Set":
539
+ case "Map": return `new ${type}([${Array.from(thing).map(stringify).join(",")}])`;
540
+ case "Int8Array":
541
+ case "Uint8Array":
542
+ case "Uint8ClampedArray":
543
+ case "Int16Array":
544
+ case "Uint16Array":
545
+ case "Float16Array":
546
+ case "Int32Array":
547
+ case "Uint32Array":
548
+ case "Float32Array":
549
+ case "Float64Array":
550
+ case "BigInt64Array":
551
+ case "BigUint64Array": {
552
+ let str = `new ${type}`;
553
+ if (!names.has(thing.buffer)) {
554
+ const array = new thing.constructor(thing.buffer);
555
+ str += `([${array}])`;
556
+ } else str += `(${stringify(thing.buffer)})`;
557
+ if (thing.byteLength !== thing.buffer.byteLength) {
558
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
559
+ const end = start + thing.length;
560
+ str += `.subarray(${start},${end})`;
561
+ }
562
+ return str;
563
+ }
564
+ case "DataView": {
565
+ let str = `new DataView`;
566
+ if (!names.has(thing.buffer)) str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
567
+ else str += `(${stringify(thing.buffer)}`;
568
+ if (thing.byteLength !== thing.buffer.byteLength) str += `,${thing.startOffset},${thing.byteLength}`;
569
+ return str + ")";
570
+ }
571
+ case "ArrayBuffer": return `new Uint8Array([${new Uint8Array(thing).toString()}]).buffer`;
572
+ case "Temporal.Duration":
573
+ case "Temporal.Instant":
574
+ case "Temporal.PlainDate":
575
+ case "Temporal.PlainTime":
576
+ case "Temporal.PlainDateTime":
577
+ case "Temporal.PlainMonthDay":
578
+ case "Temporal.PlainYearMonth":
579
+ case "Temporal.ZonedDateTime": return `${type}.from(${stringify_string(thing.toString())})`;
580
+ default:
581
+ const keys = Object.keys(thing);
582
+ const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(",");
583
+ if (Object.getPrototypeOf(thing) === null) return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
584
+ return `{${obj}}`;
585
+ }
586
+ }
587
+ const str = stringify(value);
588
+ if (names.size) {
589
+ /** @type {string[]} */
590
+ const params = [];
591
+ /** @type {string[]} */
592
+ const statements = [];
593
+ /** @type {string[]} */
594
+ const values = [];
595
+ names.forEach((name, thing) => {
596
+ params.push(name);
597
+ if (custom.has(thing)) {
598
+ values.push(custom.get(thing));
599
+ return;
600
+ }
601
+ if (is_primitive(thing)) {
602
+ values.push(stringify_primitive(thing));
603
+ return;
604
+ }
605
+ const type = get_type(thing);
606
+ switch (type) {
607
+ case "Number":
608
+ case "String":
609
+ case "Boolean":
610
+ case "BigInt":
611
+ values.push(`Object(${stringify(thing.valueOf())})`);
612
+ break;
613
+ case "RegExp":
614
+ const { source, flags } = thing;
615
+ const regexp = flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
616
+ values.push(regexp);
617
+ break;
618
+ case "Date":
619
+ values.push(`new Date(${thing.getTime()})`);
620
+ break;
621
+ case "URL":
622
+ values.push(`new URL(${stringify_string(thing.toString())})`);
623
+ break;
624
+ case "URLSearchParams":
625
+ values.push(`new URLSearchParams(${stringify_string(thing.toString())})`);
626
+ break;
627
+ case "Array":
628
+ values.push(`Array(${thing.length})`);
629
+ /** @type {any[]} */ thing.forEach((v, i) => {
630
+ statements.push(`${name}[${i}]=${stringify(v)}`);
631
+ });
632
+ break;
633
+ case "Set":
634
+ values.push(`new Set`);
635
+ statements.push(`${name}.${Array.from(thing).map((v) => `add(${stringify(v)})`).join(".")}`);
636
+ break;
637
+ case "Map":
638
+ values.push(`new Map`);
639
+ statements.push(`${name}.${Array.from(thing).map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`).join(".")}`);
640
+ break;
641
+ case "Int8Array":
642
+ case "Uint8Array":
643
+ case "Uint8ClampedArray":
644
+ case "Int16Array":
645
+ case "Uint16Array":
646
+ case "Float16Array":
647
+ case "Int32Array":
648
+ case "Uint32Array":
649
+ case "Float32Array":
650
+ case "Float64Array":
651
+ case "BigInt64Array":
652
+ case "BigUint64Array": {
653
+ let str = `new ${type}`;
654
+ if (!names.has(thing.buffer)) {
655
+ const array = new thing.constructor(thing.buffer);
656
+ str += `([${array}])`;
657
+ } else str += `(${stringify(thing.buffer)})`;
658
+ if (thing.byteLength !== thing.buffer.byteLength) {
659
+ const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
660
+ const end = start + thing.length;
661
+ str += `.subarray(${start},${end})`;
662
+ }
663
+ values.push(`{}`);
664
+ statements.push(`${name}=${str}`);
665
+ break;
666
+ }
667
+ case "DataView": {
668
+ let str = `new DataView`;
669
+ if (!names.has(thing.buffer)) str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
670
+ else str += `(${stringify(thing.buffer)}`;
671
+ if (thing.byteLength !== thing.buffer.byteLength) str += `,${thing.byteOffset},${thing.byteLength}`;
672
+ str += ")";
673
+ values.push(`{}`);
674
+ statements.push(`${name}=${str}`);
675
+ break;
676
+ }
677
+ case "ArrayBuffer":
678
+ values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`);
679
+ break;
680
+ default:
681
+ values.push(Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}");
682
+ Object.keys(thing).forEach((key) => {
683
+ statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
684
+ });
685
+ }
686
+ });
687
+ statements.push(`return ${str}`);
688
+ return `(function(${params.join(",")}){${statements.join(";")}}(${values.join(",")}))`;
689
+ } else return str;
690
+ }
691
+ /** @param {number} num */
692
+ function get_name(num) {
693
+ let name = "";
694
+ do {
695
+ name = chars[num % 54] + name;
696
+ num = ~~(num / 54) - 1;
697
+ } while (num >= 0);
698
+ return reserved.test(name) ? `${name}0` : name;
699
+ }
700
+ /** @param {string} c */
701
+ function escape_unsafe_char(c) {
702
+ return escaped[c] || c;
703
+ }
704
+ /** @param {string} str */
705
+ function escape_unsafe_chars(str) {
706
+ return str.replace(unsafe_chars, escape_unsafe_char);
707
+ }
708
+ /** @param {string} key */
709
+ function safe_key(key) {
710
+ return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
711
+ }
712
+ /** @param {string} key */
713
+ function safe_prop(key) {
714
+ return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? `.${key}` : `[${escape_unsafe_chars(JSON.stringify(key))}]`;
715
+ }
716
+ /** @param {any} thing */
717
+ function stringify_primitive(thing) {
718
+ const type = typeof thing;
719
+ if (type === "string") return stringify_string(thing);
720
+ if (thing === void 0) return "void 0";
721
+ if (thing === 0 && 1 / thing < 0) return "-0";
722
+ const str = String(thing);
723
+ if (type === "number") return str.replace(/^(-)?0\./, "$1.");
724
+ if (type === "bigint") return thing + "n";
725
+ return str;
726
+ }
727
+ //#endregion
728
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/warnings.js
729
+ var bold = "font-weight: bold";
730
+ var normal = "font-weight: normal";
731
+ /**
732
+ * A `hydratable` value with key `%key%` was created, but at least part of it was not used during the render.
733
+ *
734
+ * The `hydratable` was initialized in:
735
+ * %stack%
736
+ * @param {string} key
737
+ * @param {string} stack
738
+ */
739
+ function unresolved_hydratable(key, stack) {
740
+ console.warn(`%c[svelte] unresolved_hydratable\n%cA \`hydratable\` value with key \`${key}\` was created, but at least part of it was not used during the render.
741
+
742
+ The \`hydratable\` was initialized in:
743
+ ${stack}\nhttps://svelte.dev/e/unresolved_hydratable`, bold, normal);
744
+ }
745
+ //#endregion
746
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/blocks/html.js
747
+ /**
748
+ * @param {string} value
749
+ */
750
+ function html(value) {
751
+ var html = String(value ?? "");
752
+ return `<!--${hash(html)}-->` + html + "<!---->";
753
+ }
754
+ //#endregion
755
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/index.js
756
+ 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;
757
+ /**
758
+ * @param {Renderer} renderer
759
+ * @param {string} tag
760
+ * @param {() => void} attributes_fn
761
+ * @param {() => void} children_fn
762
+ * @returns {void}
763
+ */
764
+ function element(renderer, tag, attributes_fn = noop, children_fn = noop) {
765
+ renderer.push("<!---->");
766
+ if (tag) {
767
+ if (!REGEX_VALID_TAG_NAME.test(tag)) dynamic_element_invalid_tag(tag);
768
+ renderer.push(`<${tag}`);
769
+ attributes_fn();
770
+ renderer.push(`>`);
771
+ if (!is_void(tag)) {
772
+ children_fn();
773
+ if (!is_raw_text_element(tag)) renderer.push(EMPTY_COMMENT);
774
+ renderer.push(`</${tag}>`);
775
+ }
776
+ }
777
+ renderer.push("<!---->");
778
+ }
779
+ /**
780
+ * Only available on the server and when compiling with the `server` option.
781
+ * 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.
782
+ * @template {Record<string, any>} Props
783
+ * @param {Component<Props> | ComponentType<SvelteComponent<Props>>} component
784
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} [options]
785
+ * @returns {RenderOutput}
786
+ */
787
+ function render(component, options = {}) {
788
+ if (options.csp?.hash && options.csp.nonce) invalid_csp();
789
+ return Renderer.render(component, options);
790
+ }
791
+ /**
792
+ * @param {string} hash
793
+ * @param {Renderer} renderer
794
+ * @param {(renderer: Renderer) => Promise<void> | void} fn
795
+ * @returns {void}
796
+ */
797
+ function head(hash, renderer, fn) {
798
+ renderer.head((renderer) => {
799
+ renderer.push(`<!--${hash}-->`);
800
+ renderer.child(fn);
801
+ renderer.push(EMPTY_COMMENT);
802
+ });
803
+ }
804
+ /**
805
+ * @param {Renderer} renderer
806
+ * @param {boolean} is_html
807
+ * @param {Record<string, string>} props
808
+ * @param {() => void} component
809
+ * @param {boolean} dynamic
810
+ * @returns {void}
811
+ */
812
+ function css_props(renderer, is_html, props, component, dynamic = false) {
813
+ const styles = style_object_to_string(props);
814
+ if (is_html) renderer.push(`<svelte-css-wrapper style="display: contents; ${styles}">`);
815
+ else renderer.push(`<g style="${styles}">`);
816
+ component();
817
+ if (!dynamic) renderer.push("<!---->");
818
+ if (is_html) renderer.push("</svelte-css-wrapper>");
819
+ else renderer.push("</g>");
820
+ }
821
+ /**
822
+ * @param {Record<string, unknown>} attrs
823
+ * @param {string} [css_hash]
824
+ * @param {Record<string, boolean>} [classes]
825
+ * @param {Record<string, string>} [styles]
826
+ * @param {number} [flags]
827
+ * @returns {string}
828
+ */
829
+ function attributes(attrs, css_hash, classes, styles, flags = 0) {
830
+ if (styles) attrs.style = to_style(attrs.style, styles);
831
+ if (attrs.class) attrs.class = clsx(attrs.class);
832
+ if (css_hash || classes) attrs.class = to_class(attrs.class, css_hash, classes);
833
+ let attr_str = "";
834
+ let name;
835
+ const is_html = (flags & 1) === 0;
836
+ const lowercase = (flags & 2) === 0;
837
+ const is_input = (flags & 4) !== 0;
838
+ for (name of Object.keys(attrs)) {
839
+ if (typeof attrs[name] === "function") continue;
840
+ if (name[0] === "$" && name[1] === "$") continue;
841
+ if (name === "" || INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
842
+ var value = attrs[name];
843
+ var lower = name.toLowerCase();
844
+ if (lowercase) name = lower;
845
+ if (lower.length > 2 && lower.startsWith("on")) continue;
846
+ if (is_input) {
847
+ if (name === "defaultvalue" || name === "defaultchecked") {
848
+ name = name === "defaultvalue" ? "value" : "checked";
849
+ if (attrs[name]) continue;
850
+ }
851
+ }
852
+ attr_str += attr(name, value, is_html && is_boolean_attribute(name));
853
+ }
854
+ return attr_str;
855
+ }
856
+ /**
857
+ * @param {Record<string, unknown>[]} props
858
+ * @returns {Record<string, unknown>}
859
+ */
860
+ function spread_props(props) {
861
+ /** @type {Record<string, unknown>} */
862
+ const merged_props = {};
863
+ let key;
864
+ for (let i = 0; i < props.length; i++) {
865
+ const obj = props[i];
866
+ if (obj == null) continue;
867
+ for (key of Object.keys(obj)) {
868
+ const desc = Object.getOwnPropertyDescriptor(obj, key);
869
+ if (desc) Object.defineProperty(merged_props, key, desc);
870
+ else merged_props[key] = obj[key];
871
+ }
872
+ }
873
+ return merged_props;
874
+ }
875
+ /**
876
+ * @param {unknown} value
877
+ * @returns {string}
878
+ */
879
+ function stringify(value) {
880
+ return typeof value === "string" ? value : value == null ? "" : value + "";
881
+ }
882
+ /** @param {Record<string, string>} style_object */
883
+ function style_object_to_string(style_object) {
884
+ return Object.keys(style_object).filter(
885
+ /** @param {any} key */
886
+ (key) => style_object[key] != null && style_object[key] !== ""
887
+ ).map(
888
+ /** @param {any} key */
889
+ (key) => `${key}: ${escape_html(style_object[key], true)};`
890
+ ).join(" ");
891
+ }
892
+ /**
893
+ * @param {any} value
894
+ * @param {string | undefined} [hash]
895
+ * @param {Record<string, boolean>} [directives]
896
+ */
897
+ function attr_class(value, hash, directives) {
898
+ var result = to_class(value, hash, directives);
899
+ return result ? ` class="${escape_html(result, true)}"` : "";
900
+ }
901
+ /**
902
+ * @param {any} value
903
+ * @param {Record<string,any>|[Record<string,any>,Record<string,any>]} [directives]
904
+ */
905
+ function attr_style(value, directives) {
906
+ var result = to_style(value, directives);
907
+ return result ? ` style="${escape_html(result, true)}"` : "";
908
+ }
909
+ /**
910
+ * @template V
911
+ * @param {Record<string, [any, any, any]>} store_values
912
+ * @param {string} store_name
913
+ * @param {Store<V> | null | undefined} store
914
+ * @returns {V}
915
+ */
916
+ function store_get(store_values, store_name, store) {
917
+ validate_store(store, store_name.slice(1));
918
+ if (store_name in store_values && store_values[store_name][0] === store) return store_values[store_name][2];
919
+ store_values[store_name]?.[1]();
920
+ store_values[store_name] = [
921
+ store,
922
+ null,
923
+ void 0
924
+ ];
925
+ const unsub = subscribe_to_store(
926
+ store,
927
+ /** @param {any} v */
928
+ (v) => store_values[store_name][2] = v
929
+ );
930
+ store_values[store_name][1] = unsub;
931
+ return store_values[store_name][2];
932
+ }
933
+ /**
934
+ * Sets the new value of a store and returns that value.
935
+ * @template V
936
+ * @param {Store<V>} store
937
+ * @param {V} value
938
+ * @returns {V}
939
+ */
940
+ function store_set(store, value) {
941
+ store.set(value);
942
+ return value;
943
+ }
944
+ /**
945
+ * Updates a store with a new value.
946
+ * @template V
947
+ * @param {Record<string, [any, any, any]>} store_values
948
+ * @param {string} store_name
949
+ * @param {Store<V>} store
950
+ * @param {any} expression
951
+ */
952
+ function store_mutate(store_values, store_name, store, expression) {
953
+ store_set(store, store_get(store_values, store_name, store));
954
+ return expression;
955
+ }
956
+ /**
957
+ * @param {Record<string, [any, any, any]>} store_values
958
+ * @param {string} store_name
959
+ * @param {Store<number>} store
960
+ * @param {1 | -1} [d]
961
+ * @returns {number}
962
+ */
963
+ function update_store(store_values, store_name, store, d = 1) {
964
+ let store_value = store_get(store_values, store_name, store);
965
+ store.set(store_value + d);
966
+ return store_value;
967
+ }
968
+ /**
969
+ * @param {Record<string, [any, any, any]>} store_values
970
+ * @param {string} store_name
971
+ * @param {Store<number>} store
972
+ * @param {1 | -1} [d]
973
+ * @returns {number}
974
+ */
975
+ function update_store_pre(store_values, store_name, store, d = 1) {
976
+ const value = store_get(store_values, store_name, store) + d;
977
+ store.set(value);
978
+ return value;
979
+ }
980
+ /** @param {Record<string, [any, any, any]>} store_values */
981
+ function unsubscribe_stores(store_values) {
982
+ for (const store_name of Object.keys(store_values)) store_values[store_name][1]();
983
+ }
984
+ /**
985
+ * @param {Renderer} renderer
986
+ * @param {Record<string, any>} $$props
987
+ * @param {string} name
988
+ * @param {Record<string, unknown>} slot_props
989
+ * @param {null | (() => void)} fallback_fn
990
+ * @returns {void}
991
+ */
992
+ function slot(renderer, $$props, name, slot_props, fallback_fn) {
993
+ var slot_fn = $$props.$$slots?.[name];
994
+ if (slot_fn === true) slot_fn = $$props[name === "default" ? "children" : name];
995
+ if (slot_fn !== void 0) slot_fn(renderer, slot_props);
996
+ else fallback_fn?.();
997
+ }
998
+ /**
999
+ * @param {Record<string, unknown>} props
1000
+ * @param {string[]} rest
1001
+ * @returns {Record<string, unknown>}
1002
+ */
1003
+ function rest_props(props, rest) {
1004
+ /** @type {Record<string, unknown>} */
1005
+ const rest_props = {};
1006
+ let key;
1007
+ for (key of Object.keys(props)) if (!rest.includes(key)) rest_props[key] = props[key];
1008
+ return rest_props;
1009
+ }
1010
+ /**
1011
+ * @param {Record<string, unknown>} props
1012
+ * @returns {Record<string, unknown>}
1013
+ */
1014
+ function sanitize_props(props) {
1015
+ const { children, $$slots, ...sanitized } = props;
1016
+ return sanitized;
1017
+ }
1018
+ /**
1019
+ * @param {Record<string, any>} props
1020
+ * @returns {Record<string, boolean>}
1021
+ */
1022
+ function sanitize_slots(props) {
1023
+ /** @type {Record<string, boolean>} */
1024
+ const sanitized = {};
1025
+ if (props.children) sanitized.default = true;
1026
+ for (const key of Object.keys(props.$$slots || {})) sanitized[key] = true;
1027
+ return sanitized;
1028
+ }
1029
+ /**
1030
+ * Legacy mode: If the prop has a fallback and is bound in the
1031
+ * parent component, propagate the fallback value upwards.
1032
+ * @param {Record<string, unknown>} props_parent
1033
+ * @param {Record<string, unknown>} props_now
1034
+ */
1035
+ function bind_props(props_parent, props_now) {
1036
+ for (const key of Object.keys(props_now)) {
1037
+ const initial_value = props_parent[key];
1038
+ const value = props_now[key];
1039
+ if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) props_parent[key] = value;
1040
+ }
1041
+ }
1042
+ /**
1043
+ * @template V
1044
+ * @param {Renderer} renderer
1045
+ * @param {Promise<V>} promise
1046
+ * @param {null | (() => void)} pending_fn
1047
+ * @param {(value: V) => void} then_fn
1048
+ * @returns {void}
1049
+ */
1050
+ function await_block(renderer, promise, pending_fn, then_fn) {
1051
+ if (is_promise(promise)) {
1052
+ renderer.push(BLOCK_OPEN);
1053
+ promise.then(null, noop);
1054
+ if (pending_fn !== null) pending_fn();
1055
+ } else if (then_fn !== null) {
1056
+ renderer.push(BLOCK_OPEN_ELSE);
1057
+ then_fn(promise);
1058
+ }
1059
+ }
1060
+ /** @param {any} array_like_or_iterator */
1061
+ function ensure_array_like(array_like_or_iterator) {
1062
+ if (array_like_or_iterator) return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
1063
+ return [];
1064
+ }
1065
+ /**
1066
+ * @template V
1067
+ * @param {() => V} get_value
1068
+ */
1069
+ function once(get_value) {
1070
+ let value = UNINITIALIZED;
1071
+ return () => {
1072
+ if (value === UNINITIALIZED) value = get_value();
1073
+ return value;
1074
+ };
1075
+ }
1076
+ /**
1077
+ * Create an unique ID
1078
+ * @param {Renderer} renderer
1079
+ * @returns {string}
1080
+ */
1081
+ function props_id(renderer) {
1082
+ const uid = renderer.global.uid();
1083
+ renderer.push("<!--$" + uid + "-->");
1084
+ return uid;
1085
+ }
1086
+ /**
1087
+ * @template T
1088
+ * @param {()=>T} fn
1089
+ * @returns {(new_value?: T) => (T | void)}
1090
+ */
1091
+ function derived(fn) {
1092
+ const get_value = ssr_context === null ? fn : once(fn);
1093
+ /** @type {T | undefined} */
1094
+ let updated_value;
1095
+ return function(new_value) {
1096
+ if (arguments.length === 0) return updated_value ?? get_value();
1097
+ updated_value = new_value;
1098
+ return updated_value;
1099
+ };
1100
+ }
1101
+ /**
1102
+ * @template {number | bigint} T
1103
+ * @param {(value?: T) => T} derived
1104
+ * @param {1 | -1} [d]
1105
+ * @returns {T}
1106
+ */
1107
+ function update_derived(derived, d = 1) {
1108
+ const value = derived();
1109
+ derived(value + (typeof value === "bigint" ? BigInt(d) : d));
1110
+ return value;
1111
+ }
1112
+ /**
1113
+ * @template {number | bigint} T
1114
+ * @param {(value?: T) => T} derived
1115
+ * @param {1 | -1} [d]
1116
+ * @returns {T}
1117
+ */
1118
+ function update_derived_pre(derived, d = 1) {
1119
+ const old_value = derived();
1120
+ const value = old_value + (typeof old_value === "bigint" ? BigInt(d) : d);
1121
+ derived(value);
1122
+ return value;
1123
+ }
1124
+ /**
1125
+ * @template T
1126
+ * @param {()=>T} fn
1127
+ */
1128
+ function async_derived(fn) {
1129
+ return Promise.resolve(fn()).then((value) => {
1130
+ return () => value;
1131
+ });
1132
+ }
1133
+ //#endregion
1134
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/crypto.js
1135
+ var text_encoder;
1136
+ var crypto;
1137
+ /** @param {string} module_name */
1138
+ var obfuscated_import = (module_name) => import(
1139
+ /* @vite-ignore */
1140
+ module_name
1141
+ );
1142
+ /** @param {string} data */
1143
+ async function sha256(data) {
1144
+ text_encoder ??= new TextEncoder();
1145
+ crypto ??= globalThis.crypto?.subtle?.digest ? globalThis.crypto : (await obfuscated_import("node:crypto")).webcrypto;
1146
+ return base64_encode(await crypto.subtle.digest("SHA-256", text_encoder.encode(data)));
1147
+ }
1148
+ /**
1149
+ * @param {Uint8Array} bytes
1150
+ * @returns {string}
1151
+ */
1152
+ function base64_encode(bytes) {
1153
+ if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64");
1154
+ let binary = "";
1155
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
1156
+ return btoa(binary);
1157
+ }
1158
+ //#endregion
1159
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/renderer.js
1160
+ /** @import { Component } from 'svelte' */
1161
+ /** @import { Csp, HydratableContext, RenderOutput, SSRContext, SyncRenderOutput, Sha256Source } from './types.js' */
1162
+ /** @import { MaybePromise } from '#shared' */
1163
+ /** @typedef {'head' | 'body'} RendererType */
1164
+ /** @typedef {{ [key in RendererType]: string }} AccumulatedContent */
1165
+ /**
1166
+ * @typedef {string | Renderer} RendererItem
1167
+ */
1168
+ /**
1169
+ * Renderers are basically a tree of `string | Renderer`s, where each `Renderer` in the tree represents
1170
+ * work that may or may not have completed. A renderer can be {@link collect}ed to aggregate the
1171
+ * content from itself and all of its children, but this will throw if any of the children are
1172
+ * performing asynchronous work. To asynchronously collect a renderer, just `await` it.
1173
+ *
1174
+ * The `string` values within a renderer are always associated with the {@link type} of that renderer. To switch types,
1175
+ * call {@link child} with a different `type` argument.
1176
+ */
1177
+ var Renderer = class Renderer {
1178
+ /**
1179
+ * The contents of the renderer.
1180
+ * @type {RendererItem[]}
1181
+ */
1182
+ #out = [];
1183
+ /**
1184
+ * Any `onDestroy` callbacks registered during execution of this renderer.
1185
+ * @type {(() => void)[] | undefined}
1186
+ */
1187
+ #on_destroy = void 0;
1188
+ /**
1189
+ * Whether this renderer is a component body.
1190
+ * @type {boolean}
1191
+ */
1192
+ #is_component_body = false;
1193
+ /**
1194
+ * If set, this renderer is an error boundary. When async collection
1195
+ * of the children fails, the failed snippet is rendered instead.
1196
+ * @type {{
1197
+ * failed: (renderer: Renderer, error: unknown, reset: () => void) => void;
1198
+ * transformError: (error: unknown) => unknown;
1199
+ * context: SSRContext | null;
1200
+ * } | null}
1201
+ */
1202
+ #boundary = null;
1203
+ /**
1204
+ * The type of string content that this renderer is accumulating.
1205
+ * @type {RendererType}
1206
+ */
1207
+ type;
1208
+ /** @type {Renderer | undefined} */
1209
+ #parent;
1210
+ /**
1211
+ * Asynchronous work associated with this renderer
1212
+ * @type {Promise<void> | undefined}
1213
+ */
1214
+ promise = void 0;
1215
+ /**
1216
+ * State which is associated with the content tree as a whole.
1217
+ * It will be re-exposed, uncopied, on all children.
1218
+ * @type {SSRState}
1219
+ * @readonly
1220
+ */
1221
+ global;
1222
+ /**
1223
+ * State that is local to the branch it is declared in.
1224
+ * It will be shallow-copied to all children.
1225
+ *
1226
+ * @type {{ select_value: string | undefined }}
1227
+ */
1228
+ local;
1229
+ /**
1230
+ * @param {SSRState} global
1231
+ * @param {Renderer | undefined} [parent]
1232
+ */
1233
+ constructor(global, parent) {
1234
+ this.#parent = parent;
1235
+ this.global = global;
1236
+ this.local = parent ? { ...parent.local } : { select_value: void 0 };
1237
+ this.type = parent ? parent.type : "body";
1238
+ }
1239
+ /**
1240
+ * @param {(renderer: Renderer) => void} fn
1241
+ */
1242
+ head(fn) {
1243
+ const head = new Renderer(this.global, this);
1244
+ head.type = "head";
1245
+ this.#out.push(head);
1246
+ head.child(fn);
1247
+ }
1248
+ /**
1249
+ * @param {Array<Promise<void>>} blockers
1250
+ * @param {(renderer: Renderer) => void} fn
1251
+ */
1252
+ async_block(blockers, fn) {
1253
+ this.#out.push(BLOCK_OPEN);
1254
+ this.async(blockers, fn);
1255
+ this.#out.push(BLOCK_CLOSE);
1256
+ }
1257
+ /**
1258
+ * @param {Array<Promise<void>>} blockers
1259
+ * @param {(renderer: Renderer) => void} fn
1260
+ */
1261
+ async(blockers, fn) {
1262
+ let callback = fn;
1263
+ if (blockers.length > 0) {
1264
+ const context = ssr_context;
1265
+ callback = (renderer) => {
1266
+ return Promise.all(blockers).then(() => {
1267
+ const previous_context = ssr_context;
1268
+ try {
1269
+ set_ssr_context(context);
1270
+ return fn(renderer);
1271
+ } finally {
1272
+ set_ssr_context(previous_context);
1273
+ }
1274
+ });
1275
+ };
1276
+ }
1277
+ this.child(callback);
1278
+ }
1279
+ /**
1280
+ * @param {Array<() => void>} thunks
1281
+ */
1282
+ run(thunks) {
1283
+ const context = ssr_context;
1284
+ let promise = Promise.resolve(thunks[0]());
1285
+ const promises = [promise];
1286
+ for (const fn of thunks.slice(1)) {
1287
+ promise = promise.then(() => {
1288
+ const previous_context = ssr_context;
1289
+ set_ssr_context(context);
1290
+ try {
1291
+ return fn();
1292
+ } finally {
1293
+ set_ssr_context(previous_context);
1294
+ }
1295
+ });
1296
+ promises.push(promise);
1297
+ }
1298
+ promise.catch(noop);
1299
+ this.promise = promise;
1300
+ return promises;
1301
+ }
1302
+ /**
1303
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
1304
+ */
1305
+ child_block(fn) {
1306
+ this.#out.push(BLOCK_OPEN);
1307
+ this.child(fn);
1308
+ this.#out.push(BLOCK_CLOSE);
1309
+ }
1310
+ /**
1311
+ * Create a child renderer. The child renderer inherits the state from the parent,
1312
+ * but has its own content.
1313
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
1314
+ */
1315
+ child(fn) {
1316
+ const child = new Renderer(this.global, this);
1317
+ this.#out.push(child);
1318
+ const parent = ssr_context;
1319
+ set_ssr_context({
1320
+ ...ssr_context,
1321
+ p: parent,
1322
+ c: null,
1323
+ r: child
1324
+ });
1325
+ const result = fn(child);
1326
+ set_ssr_context(parent);
1327
+ if (result instanceof Promise) {
1328
+ result.catch(noop);
1329
+ result.finally(() => set_ssr_context(null)).catch(noop);
1330
+ if (child.global.mode === "sync") await_invalid();
1331
+ child.promise = result;
1332
+ }
1333
+ return child;
1334
+ }
1335
+ /**
1336
+ * Render children inside an error boundary. If the children throw and the API-level
1337
+ * `transformError` transform handles the error (doesn't re-throw), the `failed` snippet is
1338
+ * rendered instead. Otherwise the error propagates.
1339
+ *
1340
+ * @param {{ failed?: (renderer: Renderer, error: unknown, reset: () => void) => void }} props
1341
+ * @param {(renderer: Renderer) => MaybePromise<void>} children_fn
1342
+ */
1343
+ boundary(props, children_fn) {
1344
+ const child = new Renderer(this.global, this);
1345
+ this.#out.push(child);
1346
+ const parent_context = ssr_context;
1347
+ if (props.failed) child.#boundary = {
1348
+ failed: props.failed,
1349
+ transformError: this.global.transformError,
1350
+ context: parent_context
1351
+ };
1352
+ set_ssr_context({
1353
+ ...ssr_context,
1354
+ p: parent_context,
1355
+ c: null,
1356
+ r: child
1357
+ });
1358
+ try {
1359
+ const result = children_fn(child);
1360
+ set_ssr_context(parent_context);
1361
+ if (result instanceof Promise) {
1362
+ if (child.global.mode === "sync") await_invalid();
1363
+ result.catch(noop);
1364
+ child.promise = result;
1365
+ }
1366
+ } catch (error) {
1367
+ set_ssr_context(parent_context);
1368
+ const failed_snippet = props.failed;
1369
+ if (!failed_snippet) throw error;
1370
+ const result = this.global.transformError(error);
1371
+ child.#out.length = 0;
1372
+ child.#boundary = null;
1373
+ if (result instanceof Promise) {
1374
+ if (this.global.mode === "sync") await_invalid();
1375
+ child.promise = result.then((transformed) => {
1376
+ set_ssr_context(parent_context);
1377
+ child.#out.push(Renderer.#serialize_failed_boundary(transformed));
1378
+ failed_snippet(child, transformed, noop);
1379
+ child.#out.push(BLOCK_CLOSE);
1380
+ });
1381
+ child.promise.catch(noop);
1382
+ } else {
1383
+ child.#out.push(Renderer.#serialize_failed_boundary(result));
1384
+ failed_snippet(child, result, noop);
1385
+ child.#out.push(BLOCK_CLOSE);
1386
+ }
1387
+ }
1388
+ }
1389
+ /**
1390
+ * Create a component renderer. The component renderer inherits the state from the parent,
1391
+ * but has its own content. It is treated as an ordering boundary for ondestroy callbacks.
1392
+ * @param {(renderer: Renderer) => MaybePromise<void>} fn
1393
+ * @param {Function} [component_fn]
1394
+ * @returns {void}
1395
+ */
1396
+ component(fn, component_fn) {
1397
+ push(component_fn);
1398
+ const child = this.child(fn);
1399
+ child.#is_component_body = true;
1400
+ pop();
1401
+ }
1402
+ /**
1403
+ * @param {Record<string, any>} attrs
1404
+ * @param {(renderer: Renderer) => void} fn
1405
+ * @param {string | undefined} [css_hash]
1406
+ * @param {Record<string, boolean> | undefined} [classes]
1407
+ * @param {Record<string, string> | undefined} [styles]
1408
+ * @param {number | undefined} [flags]
1409
+ * @param {boolean | undefined} [is_rich]
1410
+ * @returns {void}
1411
+ */
1412
+ select(attrs, fn, css_hash, classes, styles, flags, is_rich) {
1413
+ const { value, ...select_attrs } = attrs;
1414
+ this.push(`<select${attributes(select_attrs, css_hash, classes, styles, flags)}>`);
1415
+ this.child((renderer) => {
1416
+ renderer.local.select_value = value;
1417
+ fn(renderer);
1418
+ });
1419
+ this.push(`${is_rich ? "<!>" : ""}</select>`);
1420
+ }
1421
+ /**
1422
+ * @param {Record<string, any>} attrs
1423
+ * @param {string | number | boolean | ((renderer: Renderer) => void)} body
1424
+ * @param {string | undefined} [css_hash]
1425
+ * @param {Record<string, boolean> | undefined} [classes]
1426
+ * @param {Record<string, string> | undefined} [styles]
1427
+ * @param {number | undefined} [flags]
1428
+ * @param {boolean | undefined} [is_rich]
1429
+ */
1430
+ option(attrs, body, css_hash, classes, styles, flags, is_rich) {
1431
+ this.#out.push(`<option${attributes(attrs, css_hash, classes, styles, flags)}`);
1432
+ /**
1433
+ * @param {Renderer} renderer
1434
+ * @param {any} value
1435
+ * @param {{ head?: string, body: any }} content
1436
+ */
1437
+ const close = (renderer, value, { head, body }) => {
1438
+ if (has_own_property.call(attrs, "value")) value = attrs.value;
1439
+ if (value === this.local.select_value) renderer.#out.push(" selected=\"\"");
1440
+ renderer.#out.push(`>${body}${is_rich ? "<!>" : ""}</option>`);
1441
+ if (head) renderer.head((child) => child.push(head));
1442
+ };
1443
+ if (typeof body === "function") this.child((renderer) => {
1444
+ const r = new Renderer(this.global, this);
1445
+ body(r);
1446
+ if (this.global.mode === "async") return r.#collect_content_async().then((content) => {
1447
+ close(renderer, content.body.replaceAll("<!---->", ""), content);
1448
+ });
1449
+ else {
1450
+ const content = r.#collect_content();
1451
+ close(renderer, content.body.replaceAll("<!---->", ""), content);
1452
+ }
1453
+ });
1454
+ else close(this, body, { body: escape_html(body) });
1455
+ }
1456
+ /**
1457
+ * @param {(renderer: Renderer) => void} fn
1458
+ */
1459
+ title(fn) {
1460
+ const path = this.get_path();
1461
+ /** @param {string} head */
1462
+ const close = (head) => {
1463
+ this.global.set_title(head, path);
1464
+ };
1465
+ this.child((renderer) => {
1466
+ const r = new Renderer(renderer.global, renderer);
1467
+ fn(r);
1468
+ if (renderer.global.mode === "async") return r.#collect_content_async().then((content) => {
1469
+ close(content.head);
1470
+ });
1471
+ else {
1472
+ const content = r.#collect_content();
1473
+ close(content.head);
1474
+ }
1475
+ });
1476
+ }
1477
+ /**
1478
+ * @param {string | (() => Promise<string>)} content
1479
+ */
1480
+ push(content) {
1481
+ if (typeof content === "function") this.child(async (renderer) => renderer.push(await content()));
1482
+ else this.#out.push(content);
1483
+ }
1484
+ /**
1485
+ * @param {() => void} fn
1486
+ */
1487
+ on_destroy(fn) {
1488
+ (this.#on_destroy ??= []).push(fn);
1489
+ }
1490
+ /**
1491
+ * @returns {number[]}
1492
+ */
1493
+ get_path() {
1494
+ return this.#parent ? [...this.#parent.get_path(), this.#parent.#out.indexOf(this)] : [];
1495
+ }
1496
+ /**
1497
+ * @deprecated this is needed for legacy component bindings
1498
+ */
1499
+ copy() {
1500
+ const copy = new Renderer(this.global, this.#parent);
1501
+ copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item);
1502
+ copy.promise = this.promise;
1503
+ return copy;
1504
+ }
1505
+ /**
1506
+ * @param {Renderer} other
1507
+ * @deprecated this is needed for legacy component bindings
1508
+ */
1509
+ subsume(other) {
1510
+ 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!");
1511
+ this.local = other.local;
1512
+ this.#out = other.#out.map((item, i) => {
1513
+ const current = this.#out[i];
1514
+ if (current instanceof Renderer && item instanceof Renderer) {
1515
+ current.subsume(item);
1516
+ return current;
1517
+ }
1518
+ return item;
1519
+ });
1520
+ this.promise = other.promise;
1521
+ this.type = other.type;
1522
+ }
1523
+ get length() {
1524
+ return this.#out.length;
1525
+ }
1526
+ /**
1527
+ * Creates the hydration comment that marks the start of a failed boundary.
1528
+ * The error is JSON-serialized and embedded inside an HTML comment for the client
1529
+ * to parse during hydration. The JSON is escaped to prevent `-->` or `<!--` sequences
1530
+ * from breaking out of the comment (XSS). Uses unicode escapes which `JSON.parse()`
1531
+ * handles transparently.
1532
+ * @param {unknown} error
1533
+ * @returns {string}
1534
+ */
1535
+ static #serialize_failed_boundary(error) {
1536
+ return `<!--[?${JSON.stringify(error).replace(/>/g, "\\u003e").replace(/</g, "\\u003c")}-->`;
1537
+ }
1538
+ /**
1539
+ * Only available on the server and when compiling with the `server` option.
1540
+ * 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.
1541
+ * @template {Record<string, any>} Props
1542
+ * @param {Component<Props>} component
1543
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} [options]
1544
+ * @returns {RenderOutput}
1545
+ */
1546
+ static render(component, options = {}) {
1547
+ /** @type {AccumulatedContent | undefined} */
1548
+ let sync;
1549
+ /** @type {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }> | undefined} */
1550
+ let async;
1551
+ const result = {};
1552
+ Object.defineProperties(result, {
1553
+ html: { get: () => {
1554
+ return (sync ??= Renderer.#render(component, options)).body;
1555
+ } },
1556
+ head: { get: () => {
1557
+ return (sync ??= Renderer.#render(component, options)).head;
1558
+ } },
1559
+ body: { get: () => {
1560
+ return (sync ??= Renderer.#render(component, options)).body;
1561
+ } },
1562
+ hashes: { value: { script: "" } },
1563
+ then: { value:
1564
+ /**
1565
+ * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
1566
+ *
1567
+ * @template TResult1
1568
+ * @template [TResult2=never]
1569
+ * @param { (value: SyncRenderOutput) => TResult1 } onfulfilled
1570
+ * @param { (reason: unknown) => TResult2 } onrejected
1571
+ */
1572
+ (onfulfilled, onrejected) => {
1573
+ if (!async_mode_flag) {
1574
+ const result = sync ??= Renderer.#render(component, options);
1575
+ const user_result = onfulfilled({
1576
+ head: result.head,
1577
+ body: result.body,
1578
+ html: result.body,
1579
+ hashes: { script: [] }
1580
+ });
1581
+ return Promise.resolve(user_result);
1582
+ }
1583
+ async ??= init_render_context().then(() => with_render_context(() => Renderer.#render_async(component, options)));
1584
+ return async.then((result) => {
1585
+ Object.defineProperty(result, "html", { get: () => {
1586
+ html_deprecated();
1587
+ } });
1588
+ return onfulfilled(result);
1589
+ }, onrejected);
1590
+ } }
1591
+ });
1592
+ return result;
1593
+ }
1594
+ /**
1595
+ * Collect all of the `onDestroy` callbacks registered during rendering. In an async context, this is only safe to call
1596
+ * after awaiting `collect_async`.
1597
+ *
1598
+ * Child renderers are "porous" and don't affect execution order, but component body renderers
1599
+ * create ordering boundaries. Within a renderer, callbacks run in order until hitting a component boundary.
1600
+ * @returns {Iterable<() => void>}
1601
+ */
1602
+ *#collect_on_destroy() {
1603
+ for (const component of this.#traverse_components()) yield* component.#collect_ondestroy();
1604
+ }
1605
+ /**
1606
+ * Performs a depth-first search of renderers, yielding the deepest components first, then additional components as we backtrack up the tree.
1607
+ * @returns {Iterable<Renderer>}
1608
+ */
1609
+ *#traverse_components() {
1610
+ for (const child of this.#out) if (typeof child !== "string") yield* child.#traverse_components();
1611
+ if (this.#is_component_body) yield this;
1612
+ }
1613
+ /**
1614
+ * @returns {Iterable<() => void>}
1615
+ */
1616
+ *#collect_ondestroy() {
1617
+ if (this.#on_destroy) for (const fn of this.#on_destroy) yield fn;
1618
+ for (const child of this.#out) if (child instanceof Renderer && !child.#is_component_body) yield* child.#collect_ondestroy();
1619
+ }
1620
+ /**
1621
+ * Render a component. Throws if any of the children are performing asynchronous work.
1622
+ *
1623
+ * @template {Record<string, any>} Props
1624
+ * @param {Component<Props>} component
1625
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
1626
+ * @returns {AccumulatedContent}
1627
+ */
1628
+ static #render(component, options) {
1629
+ var previous_context = ssr_context;
1630
+ try {
1631
+ const renderer = Renderer.#open_render("sync", component, options);
1632
+ const content = renderer.#collect_content();
1633
+ return Renderer.#close_render(content, renderer);
1634
+ } finally {
1635
+ abort();
1636
+ set_ssr_context(previous_context);
1637
+ }
1638
+ }
1639
+ /**
1640
+ * Render a component.
1641
+ *
1642
+ * @template {Record<string, any>} Props
1643
+ * @param {Component<Props>} component
1644
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} options
1645
+ * @returns {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>}
1646
+ */
1647
+ static async #render_async(component, options) {
1648
+ const previous_context = ssr_context;
1649
+ try {
1650
+ const renderer = Renderer.#open_render("async", component, options);
1651
+ const content = await renderer.#collect_content_async();
1652
+ const hydratables = await renderer.#collect_hydratables();
1653
+ if (hydratables !== null) content.head = hydratables + content.head;
1654
+ return Renderer.#close_render(content, renderer);
1655
+ } finally {
1656
+ set_ssr_context(previous_context);
1657
+ abort();
1658
+ }
1659
+ }
1660
+ /**
1661
+ * Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string.
1662
+ * @param {AccumulatedContent} content
1663
+ * @returns {AccumulatedContent}
1664
+ */
1665
+ #collect_content(content = {
1666
+ head: "",
1667
+ body: ""
1668
+ }) {
1669
+ for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
1670
+ else if (item instanceof Renderer) item.#collect_content(content);
1671
+ return content;
1672
+ }
1673
+ /**
1674
+ * Collect all of the code from the `out` array and return it as a string.
1675
+ * @param {AccumulatedContent} content
1676
+ * @returns {Promise<AccumulatedContent>}
1677
+ */
1678
+ async #collect_content_async(content = {
1679
+ head: "",
1680
+ body: ""
1681
+ }) {
1682
+ await this.promise;
1683
+ for (const item of this.#out) if (typeof item === "string") content[this.type] += item;
1684
+ else if (item instanceof Renderer) {
1685
+ if (item.#boundary) {
1686
+ /** @type {AccumulatedContent} */
1687
+ const boundary_content = {
1688
+ head: "",
1689
+ body: ""
1690
+ };
1691
+ try {
1692
+ await item.#collect_content_async(boundary_content);
1693
+ content.head += boundary_content.head;
1694
+ content.body += boundary_content.body;
1695
+ } catch (error) {
1696
+ const { context, failed, transformError } = item.#boundary;
1697
+ set_ssr_context(context);
1698
+ let promise = transformError(error);
1699
+ set_ssr_context(null);
1700
+ let transformed = await promise;
1701
+ set_ssr_context(context);
1702
+ const failed_renderer = new Renderer(item.global, item);
1703
+ failed_renderer.type = item.type;
1704
+ failed_renderer.#out.push(Renderer.#serialize_failed_boundary(transformed));
1705
+ failed(failed_renderer, transformed, noop);
1706
+ failed_renderer.#out.push(BLOCK_CLOSE);
1707
+ await failed_renderer.#collect_content_async(content);
1708
+ }
1709
+ } else await item.#collect_content_async(content);
1710
+ }
1711
+ return content;
1712
+ }
1713
+ async #collect_hydratables() {
1714
+ const ctx = get_render_context().hydratable;
1715
+ for (const [_, key] of ctx.unresolved_promises) unresolved_hydratable(key, ctx.lookup.get(key)?.stack ?? "<missing stack trace>");
1716
+ for (const comparison of ctx.comparisons) await comparison;
1717
+ return await this.#hydratable_block(ctx);
1718
+ }
1719
+ /**
1720
+ * @template {Record<string, any>} Props
1721
+ * @param {'sync' | 'async'} mode
1722
+ * @param {import('svelte').Component<Props>} component
1723
+ * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} options
1724
+ * @returns {Renderer}
1725
+ */
1726
+ static #open_render(mode, component, options) {
1727
+ if (options.idPrefix?.includes("--")) invalid_id_prefix();
1728
+ var previous_context = ssr_context;
1729
+ try {
1730
+ const renderer = new Renderer(new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "", options.csp, options.transformError));
1731
+ set_ssr_context({
1732
+ p: null,
1733
+ c: options.context ?? null,
1734
+ r: renderer
1735
+ });
1736
+ renderer.push(BLOCK_OPEN);
1737
+ component(renderer, options.props ?? {});
1738
+ renderer.push(BLOCK_CLOSE);
1739
+ return renderer;
1740
+ } finally {
1741
+ set_ssr_context(previous_context);
1742
+ }
1743
+ }
1744
+ /**
1745
+ * @param {AccumulatedContent} content
1746
+ * @param {Renderer} renderer
1747
+ * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}
1748
+ */
1749
+ static #close_render(content, renderer) {
1750
+ for (const cleanup of renderer.#collect_on_destroy()) cleanup();
1751
+ let head = content.head + renderer.global.get_title();
1752
+ let body = content.body;
1753
+ for (const { hash, code } of renderer.global.css) head += `<style id="${hash}">${code}</style>`;
1754
+ return {
1755
+ head,
1756
+ body,
1757
+ hashes: { script: renderer.global.csp.script_hashes }
1758
+ };
1759
+ }
1760
+ /**
1761
+ * @param {HydratableContext} ctx
1762
+ */
1763
+ async #hydratable_block(ctx) {
1764
+ if (ctx.lookup.size === 0) return null;
1765
+ let entries = [];
1766
+ let has_promises = false;
1767
+ for (const [k, v] of ctx.lookup) {
1768
+ if (v.promises) {
1769
+ has_promises = true;
1770
+ for (const p of v.promises) await p;
1771
+ }
1772
+ entries.push(`[${uneval(k)},${v.serialized}]`);
1773
+ }
1774
+ let prelude = `const h = (window.__svelte ??= {}).h ??= new Map();`;
1775
+ if (has_promises) prelude = `const r = (v) => Promise.resolve(v);
1776
+ ${prelude}`;
1777
+ const body = `
1778
+ {
1779
+ ${prelude}
1780
+
1781
+ for (const [k, v] of [
1782
+ ${entries.join(",\n ")}
1783
+ ]) {
1784
+ h.set(k, v);
1785
+ }
1786
+ }
1787
+ `;
1788
+ let csp_attr = "";
1789
+ if (this.global.csp.nonce) csp_attr = ` nonce="${this.global.csp.nonce}"`;
1790
+ else if (this.global.csp.hash) {
1791
+ const hash = await sha256(body);
1792
+ this.global.csp.script_hashes.push(`sha256-${hash}`);
1793
+ }
1794
+ return `\n\t\t<script${csp_attr}>${body}<\/script>`;
1795
+ }
1796
+ };
1797
+ var SSRState = class {
1798
+ /** @readonly @type {Csp & { script_hashes: Sha256Source[] }} */
1799
+ csp;
1800
+ /** @readonly @type {'sync' | 'async'} */
1801
+ mode;
1802
+ /** @readonly @type {() => string} */
1803
+ uid;
1804
+ /** @readonly @type {Set<{ hash: string; code: string }>} */
1805
+ css = /* @__PURE__ */ new Set();
1806
+ /**
1807
+ * `transformError` passed to `render`. Called when an error boundary catches an error.
1808
+ * Throws by default if unset in `render`.
1809
+ * @type {(error: unknown) => unknown}
1810
+ */
1811
+ transformError;
1812
+ /** @type {{ path: number[], value: string }} */
1813
+ #title = {
1814
+ path: [],
1815
+ value: ""
1816
+ };
1817
+ /**
1818
+ * @param {'sync' | 'async'} mode
1819
+ * @param {string} id_prefix
1820
+ * @param {Csp} csp
1821
+ * @param {((error: unknown) => unknown) | undefined} [transformError]
1822
+ */
1823
+ constructor(mode, id_prefix = "", csp = { hash: false }, transformError) {
1824
+ this.mode = mode;
1825
+ this.csp = {
1826
+ ...csp,
1827
+ script_hashes: []
1828
+ };
1829
+ this.transformError = transformError ?? ((error) => {
1830
+ throw error;
1831
+ });
1832
+ let uid = 1;
1833
+ this.uid = () => `${id_prefix}s${uid++}`;
1834
+ }
1835
+ get_title() {
1836
+ return this.#title.value;
1837
+ }
1838
+ /**
1839
+ * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
1840
+ * from earlier than or equal to the current value.
1841
+ * @param {string} value
1842
+ * @param {number[]} path
1843
+ */
1844
+ set_title(value, path) {
1845
+ const current = this.#title.path;
1846
+ let i = 0;
1847
+ let l = Math.min(path.length, current.length);
1848
+ while (i < l && path[i] === current[i]) i += 1;
1849
+ if (path[i] === void 0) return;
1850
+ if (current[i] === void 0 || path[i] > current[i]) {
1851
+ this.#title.path = path;
1852
+ this.#title.value = value;
1853
+ }
1854
+ }
1855
+ };
1856
+ //#endregion
1857
+ //#region ../../../../node_modules/.pnpm/svelte@5.55.9_@typescript-eslint+types@8.67.0/node_modules/svelte/src/internal/server/dev.js
1858
+ /** @import { SSRContext } from '#server' */
1859
+ /**
1860
+ * @typedef {{
1861
+ * tag: string;
1862
+ * parent: undefined | Element;
1863
+ * filename: undefined | string;
1864
+ * line: number;
1865
+ * column: number;
1866
+ * }} Element
1867
+ */
1868
+ /**
1869
+ * This is exported so that it can be cleared between tests
1870
+ * @type {Set<string>}
1871
+ */
1872
+ var seen;
1873
+ /**
1874
+ * @param {Renderer} renderer
1875
+ * @param {string} message
1876
+ */
1877
+ function print_error(renderer, message) {
1878
+ message = `node_invalid_placement_ssr: ${message}\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a \`hydration_mismatch\` warning.`;
1879
+ if ((seen ??= /* @__PURE__ */ new Set()).has(message)) return;
1880
+ seen.add(message);
1881
+ console.error(message);
1882
+ renderer.head((r) => r.push(`<script>console.error(${JSON.stringify(message).replaceAll("</", "<\\u002f")})<\/script>`));
1883
+ }
1884
+ /**
1885
+ * @param {Renderer} renderer
1886
+ * @param {string} tag
1887
+ * @param {number} line
1888
+ * @param {number} column
1889
+ */
1890
+ function push_element(renderer, tag, line, column) {
1891
+ var context = ssr_context;
1892
+ var filename = context.function[FILENAME];
1893
+ var parent = context.element;
1894
+ var element = {
1895
+ tag,
1896
+ parent,
1897
+ filename,
1898
+ line,
1899
+ column
1900
+ };
1901
+ if (parent !== void 0) {
1902
+ var ancestor = parent.parent;
1903
+ var ancestors = [parent.tag];
1904
+ const child_loc = filename ? `${filename}:${line}:${column}` : void 0;
1905
+ const parent_loc = parent.filename ? `${parent.filename}:${parent.line}:${parent.column}` : void 0;
1906
+ const message = is_tag_valid_with_parent(tag, parent.tag, child_loc, parent_loc);
1907
+ if (message) print_error(renderer, message);
1908
+ while (ancestor != null) {
1909
+ ancestors.push(ancestor.tag);
1910
+ const ancestor_loc = ancestor.filename ? `${ancestor.filename}:${ancestor.line}:${ancestor.column}` : void 0;
1911
+ const message = is_tag_valid_with_ancestor(tag, ancestors, child_loc, ancestor_loc);
1912
+ if (message) print_error(renderer, message);
1913
+ ancestor = ancestor.parent;
1914
+ }
1915
+ }
1916
+ set_ssr_context({
1917
+ ...context,
1918
+ p: context,
1919
+ element
1920
+ });
1921
+ }
1922
+ function pop_element() {
1923
+ set_ssr_context(
1924
+ /** @type {SSRContext} */
1925
+ ssr_context.p
1926
+ );
1927
+ }
1928
+ /**
1929
+ * @param {Renderer} renderer
1930
+ */
1931
+ function validate_snippet_args(renderer) {
1932
+ if (typeof renderer !== "object" || !(renderer instanceof Renderer)) invalid_snippet_arguments();
1933
+ }
1934
+ function get_user_code_location() {
1935
+ return get_stack().filter((line) => line.trim().startsWith("at ")).map((line) => line.replace(/\((.*):\d+:\d+\)$/, (_, file) => `(${file})`)).join("\n");
1936
+ }
1937
+ //#endregion
1938
+ export { update_derived_pre as A, hasContext as B, spread_props as C, stringify as D, store_set as E, get_render_context as F, hydratable_serialization_failed as G, setContext as H, getAbortSignal as I, lifecycle_function_unavailable as K, createContext as L, update_store_pre as M, html as N, unsubscribe_stores as O, uneval as P, getAllContexts as R, slot as S, store_mutate as T, ssr_context as U, save as V, hydratable_clobbering as W, props_id as _, async_derived as a, sanitize_props as b, attributes as c, css_props as d, derived as f, once as g, head as h, validate_snippet_args as i, update_store as j, update_derived as k, await_block as l, ensure_array_like as m, pop_element as n, attr_class as o, element as p, push_element as r, attr_style as s, get_user_code_location as t, bind_props as u, render as v, store_get as w, sanitize_slots as x, rest_props as y, getContext as z };