konoha-mcp 2.1.3 → 2.1.5

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 (367) hide show
  1. package/.agents/skills.fingerprint +1 -1
  2. package/README.md +4 -4
  3. package/apps/web/build/adapter-node.js +11 -0
  4. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js +1 -0
  5. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.br +2 -0
  6. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.gz +0 -0
  7. package/apps/web/build/client/_app/immutable/chunks/BaNbYf_w.js +1 -0
  8. package/apps/web/build/client/_app/immutable/chunks/BaNbYf_w.js.br +0 -0
  9. package/apps/web/build/client/_app/immutable/chunks/BaNbYf_w.js.gz +0 -0
  10. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js +1 -0
  11. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.br +1 -0
  12. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.gz +0 -0
  13. package/apps/web/build/client/_app/immutable/chunks/{Bv85lp2r.js → CBY268r4.js} +1 -1
  14. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.br +3 -0
  15. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.gz +0 -0
  16. package/apps/web/build/client/_app/immutable/chunks/Cg3pm-K7.js +1 -0
  17. package/apps/web/build/client/_app/immutable/chunks/Cg3pm-K7.js.br +4 -0
  18. package/apps/web/build/client/_app/immutable/chunks/Cg3pm-K7.js.gz +0 -0
  19. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js +1 -0
  20. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.br +0 -0
  21. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.gz +0 -0
  22. package/apps/web/build/client/_app/immutable/chunks/Dek69VGa.js +1 -0
  23. package/apps/web/build/client/_app/immutable/chunks/Dek69VGa.js.br +0 -0
  24. package/apps/web/build/client/_app/immutable/chunks/Dek69VGa.js.gz +0 -0
  25. package/apps/web/build/client/_app/immutable/chunks/{CP4ze5kR.js → Dzm74gVd.js} +1 -1
  26. package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.br +0 -0
  27. package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.gz +0 -0
  28. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js +2 -0
  29. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.br +0 -0
  30. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.gz +0 -0
  31. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js +3 -0
  32. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js.br +0 -0
  33. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js.gz +0 -0
  34. package/apps/web/build/client/_app/immutable/chunks/{tFx9Vkzn.js → fbrtLByB.js} +1 -1
  35. package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.br +0 -0
  36. package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.gz +0 -0
  37. package/apps/web/build/client/_app/immutable/entry/app.DLayTcYu.js +2 -0
  38. package/apps/web/build/client/_app/immutable/entry/app.DLayTcYu.js.br +0 -0
  39. package/apps/web/build/client/_app/immutable/entry/app.DLayTcYu.js.gz +0 -0
  40. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js +2 -0
  41. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.br +0 -0
  42. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.gz +0 -0
  43. package/apps/web/build/client/_app/immutable/nodes/{0.BV_U6rd9.js → 0.5uSjyTy0.js} +1 -1
  44. package/apps/web/build/client/_app/immutable/nodes/0.5uSjyTy0.js.br +0 -0
  45. package/apps/web/build/client/_app/immutable/nodes/0.5uSjyTy0.js.gz +0 -0
  46. package/apps/web/build/client/_app/immutable/nodes/{1.317ei_PM.js → 1.BZu6jsAH.js} +1 -1
  47. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.br +0 -0
  48. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.gz +0 -0
  49. package/apps/web/build/client/_app/immutable/nodes/{10.C9BHUF6_.js → 10.CZKScTFN.js} +1 -1
  50. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.br +0 -0
  51. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.gz +0 -0
  52. package/apps/web/build/client/_app/immutable/nodes/{11._7rmywnA.js → 11.DFglFW_i.js} +1 -1
  53. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.br +0 -0
  54. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.gz +0 -0
  55. package/apps/web/build/client/_app/immutable/nodes/{12.B_UJh_Cw.js → 12.CSShcv5z.js} +1 -1
  56. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.br +0 -0
  57. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.gz +0 -0
  58. package/apps/web/build/client/_app/immutable/nodes/{13.FtUj7AO8.js → 13.jWUWoBcs.js} +1 -1
  59. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.br +0 -0
  60. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.gz +0 -0
  61. package/apps/web/build/client/_app/immutable/nodes/{14.CsMWcbH2.js → 14.H-jSqqen.js} +1 -1
  62. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.br +0 -0
  63. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.gz +0 -0
  64. package/apps/web/build/client/_app/immutable/nodes/{15.DbSoDlZF.js → 15.CpAoyhzV.js} +1 -1
  65. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.br +0 -0
  66. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.gz +0 -0
  67. package/apps/web/build/client/_app/immutable/nodes/{16.BcMZYQJR.js → 16.DT_-MxCT.js} +1 -1
  68. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.br +0 -0
  69. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.gz +0 -0
  70. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js +1 -0
  71. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.br +0 -0
  72. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.gz +0 -0
  73. package/apps/web/build/client/_app/immutable/nodes/{3.Co5hy99T.js → 3.Cgc-xN3x.js} +1 -1
  74. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.br +0 -0
  75. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.gz +0 -0
  76. package/apps/web/build/client/_app/immutable/nodes/{4.Ckjmv74-.js → 4.CYJQ4bWz.js} +1 -1
  77. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.br +0 -0
  78. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.gz +0 -0
  79. package/apps/web/build/client/_app/immutable/nodes/{5.jG4rh5-7.js → 5.DbHL-3Es.js} +1 -1
  80. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.br +0 -0
  81. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.gz +0 -0
  82. package/apps/web/build/client/_app/immutable/nodes/{6.am-4Bf0e.js → 6.BvWH2qas.js} +1 -1
  83. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.br +0 -0
  84. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.gz +0 -0
  85. package/apps/web/build/client/_app/immutable/nodes/{7.DpWtqqaL.js → 7.CmbiPMU3.js} +1 -1
  86. package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.br +0 -0
  87. package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.gz +0 -0
  88. package/apps/web/build/client/_app/immutable/nodes/{8.CbbKDJTU.js → 8.B9897Zm9.js} +1 -1
  89. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.br +0 -0
  90. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.gz +0 -0
  91. package/apps/web/build/client/_app/immutable/nodes/{9.CB21-Q9D.js → 9.CGMmeMVC.js} +2 -2
  92. package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js.br +0 -0
  93. package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js.gz +0 -0
  94. package/apps/web/build/client/_app/version.json +1 -1
  95. package/apps/web/build/client/_app/version.json.br +0 -0
  96. package/apps/web/build/client/_app/version.json.gz +0 -0
  97. package/apps/web/build/handler.js +1 -2
  98. package/apps/web/build/index.js +1 -74
  99. package/apps/web/build/server/.vite/manifest.json +419 -0
  100. package/apps/web/build/server/_app/immutable/assets/_layout.CsjxL1aa.css +2 -0
  101. package/apps/web/build/server/adapter-env.js +2 -0
  102. package/apps/web/build/server/adapter-index.js +74 -0
  103. package/apps/web/build/server/adapter-index.js.map +1 -0
  104. package/apps/web/build/server/{chunks/env-RhfAqpCd.js → adapter-node-env.js} +28 -7
  105. package/apps/web/build/server/adapter-node-env.js.map +1 -0
  106. package/apps/web/build/server/adapter-node-handler.js +584 -0
  107. package/apps/web/build/server/adapter-node-handler.js.map +1 -0
  108. package/apps/web/build/server/chunks/api.js +81 -0
  109. package/apps/web/build/server/chunks/api.js.map +1 -0
  110. package/apps/web/build/server/chunks/{env-DU2WieJy.js → config.js} +2 -2
  111. package/apps/web/build/server/chunks/config.js.map +1 -0
  112. package/apps/web/build/server/chunks/exports.js +625 -0
  113. package/apps/web/build/server/chunks/exports.js.map +1 -0
  114. package/apps/web/build/server/chunks/functions.js +30 -0
  115. package/apps/web/build/server/chunks/functions.js.map +1 -0
  116. package/apps/web/build/server/chunks/index-server.js +2 -0
  117. package/apps/web/build/server/chunks/instance.js +3600 -0
  118. package/apps/web/build/server/chunks/instance.js.map +1 -0
  119. package/apps/web/build/server/chunks/internal.js +2849 -0
  120. package/apps/web/build/server/chunks/internal.js.map +1 -0
  121. package/apps/web/build/server/chunks/scrollLock.svelte.js +7 -0
  122. package/apps/web/build/server/chunks/scrollLock.svelte.js.map +1 -0
  123. package/apps/web/build/server/chunks/server-errors.js +489 -0
  124. package/apps/web/build/server/chunks/server-errors.js.map +1 -0
  125. package/apps/web/build/server/chunks/server.js +9 -0
  126. package/apps/web/build/server/chunks/server.js.map +1 -0
  127. package/apps/web/build/server/chunks/{server2-xUKEUzWG.js → server2.js} +140 -718
  128. package/apps/web/build/server/chunks/server2.js.map +1 -0
  129. package/apps/web/build/server/chunks/shared.js +84 -0
  130. package/apps/web/build/server/chunks/shared.js.map +1 -0
  131. package/apps/web/build/server/chunks/{state-C6VH2NAw.js → state.js} +5 -4
  132. package/apps/web/build/server/chunks/state.js.map +1 -0
  133. package/apps/web/build/server/chunks/{sweetAlert.svelte-BKTpmvHp.js → sweetAlert.svelte.js} +3 -3
  134. package/apps/web/build/server/chunks/sweetAlert.svelte.js.map +1 -0
  135. package/apps/web/build/server/chunks/{uiState.svelte-NgyZk5Jz.js → uiState.svelte.js} +3 -3
  136. package/apps/web/build/server/chunks/uiState.svelte.js.map +1 -0
  137. package/apps/web/build/server/chunks/uneval.js +645 -0
  138. package/apps/web/build/server/chunks/uneval.js.map +1 -0
  139. package/apps/web/build/server/entries/fallbacks/error.svelte.js +12 -0
  140. package/apps/web/build/server/entries/fallbacks/error.svelte.js.map +1 -0
  141. package/apps/web/build/server/entries/hooks.server.js +8 -0
  142. package/apps/web/build/server/entries/hooks.server.js.map +1 -0
  143. package/apps/web/build/server/entries/pages/_layout.js +7 -0
  144. package/apps/web/build/server/entries/pages/_layout.js.map +1 -0
  145. package/apps/web/build/server/{chunks/_layout.svelte-FKDEmK4m.js → entries/pages/_layout.svelte.js} +15 -8
  146. package/apps/web/build/server/entries/pages/_layout.svelte.js.map +1 -0
  147. package/apps/web/build/server/entries/pages/_page.js +9 -0
  148. package/apps/web/build/server/entries/pages/_page.js.map +1 -0
  149. package/apps/web/build/server/entries/pages/_page.svelte.js +7 -0
  150. package/apps/web/build/server/entries/pages/_page.svelte.js.map +1 -0
  151. package/apps/web/build/server/{chunks/_page.svelte-K0WRgefN.js → entries/pages/agents/_page.svelte.js} +8 -5
  152. package/apps/web/build/server/entries/pages/agents/_page.svelte.js.map +1 -0
  153. package/apps/web/build/server/{chunks/_page.svelte-BKU-UjQ2.js → entries/pages/bridges/_page.svelte.js} +9 -6
  154. package/apps/web/build/server/entries/pages/bridges/_page.svelte.js.map +1 -0
  155. package/apps/web/build/server/{chunks/_page.svelte-DBQMj6O8.js → entries/pages/clients/_page.svelte.js} +8 -5
  156. package/apps/web/build/server/entries/pages/clients/_page.svelte.js.map +1 -0
  157. package/apps/web/build/server/{chunks/_page.svelte-BQP0Z2mg.js → entries/pages/context/_page.svelte.js} +9 -6
  158. package/apps/web/build/server/entries/pages/context/_page.svelte.js.map +1 -0
  159. package/apps/web/build/server/{chunks/_page.svelte-D_bQaPtJ.js → entries/pages/dashboard/_page.svelte.js} +7 -4
  160. package/apps/web/build/server/entries/pages/dashboard/_page.svelte.js.map +1 -0
  161. package/apps/web/build/server/{chunks/_page.svelte-CxxsZeRm.js → entries/pages/detector/_page.svelte.js} +5 -3
  162. package/apps/web/build/server/entries/pages/detector/_page.svelte.js.map +1 -0
  163. package/apps/web/build/server/{chunks/_page.svelte-DJp9fAk8.js → entries/pages/docs/_page.svelte.js} +8 -5
  164. package/apps/web/build/server/entries/pages/docs/_page.svelte.js.map +1 -0
  165. package/apps/web/build/server/{chunks/_page.svelte-DFBbcBLc.js → entries/pages/doctor/_page.svelte.js} +8 -5
  166. package/apps/web/build/server/entries/pages/doctor/_page.svelte.js.map +1 -0
  167. package/apps/web/build/server/{chunks/_page.svelte-yXv2Aj6-.js → entries/pages/persona/_page.svelte.js} +9 -6
  168. package/apps/web/build/server/entries/pages/persona/_page.svelte.js.map +1 -0
  169. package/apps/web/build/server/{chunks/_page.svelte-CvH3pIDb.js → entries/pages/savings/_page.svelte.js} +7 -4
  170. package/apps/web/build/server/entries/pages/savings/_page.svelte.js.map +1 -0
  171. package/apps/web/build/server/{chunks/_page.svelte-FUbd8bWv.js → entries/pages/search/_page.svelte.js} +9 -6
  172. package/apps/web/build/server/entries/pages/search/_page.svelte.js.map +1 -0
  173. package/apps/web/build/server/{chunks/_page.svelte-Bu5RfcD4.js → entries/pages/semble/_page.svelte.js} +8 -5
  174. package/apps/web/build/server/entries/pages/semble/_page.svelte.js.map +1 -0
  175. package/apps/web/build/server/{chunks/_page.svelte-B4DKG2sO.js → entries/pages/skills/_page.svelte.js} +10 -7
  176. package/apps/web/build/server/entries/pages/skills/_page.svelte.js.map +1 -0
  177. package/apps/web/build/server/{chunks/_page.svelte-D1yHfBBh.js → entries/pages/tasks/_page.svelte.js} +8 -83
  178. package/apps/web/build/server/entries/pages/tasks/_page.svelte.js.map +1 -0
  179. package/apps/web/build/{env.js → server/env.js} +1 -1
  180. package/apps/web/build/server/handler.js +2 -0
  181. package/apps/web/build/server/index.js +68 -0
  182. package/apps/web/build/server/index.js.map +1 -0
  183. package/apps/web/build/server/manifest-full.js +149 -0
  184. package/apps/web/build/server/manifest.js +149 -0
  185. package/apps/web/build/server/nodes/0.js +10 -0
  186. package/apps/web/build/server/nodes/1.js +8 -0
  187. package/apps/web/build/server/nodes/10.js +8 -0
  188. package/apps/web/build/server/nodes/11.js +8 -0
  189. package/apps/web/build/server/nodes/12.js +8 -0
  190. package/apps/web/build/server/nodes/13.js +8 -0
  191. package/apps/web/build/server/nodes/14.js +8 -0
  192. package/apps/web/build/server/nodes/15.js +8 -0
  193. package/apps/web/build/server/nodes/16.js +8 -0
  194. package/apps/web/build/server/nodes/2.js +10 -0
  195. package/apps/web/build/server/nodes/3.js +8 -0
  196. package/apps/web/build/server/nodes/4.js +8 -0
  197. package/apps/web/build/server/nodes/5.js +8 -0
  198. package/apps/web/build/server/nodes/6.js +8 -0
  199. package/apps/web/build/server/nodes/7.js +8 -0
  200. package/apps/web/build/server/nodes/8.js +8 -0
  201. package/apps/web/build/server/nodes/9.js +8 -0
  202. package/apps/web/build/server/remote-entry.js +1565 -0
  203. package/apps/web/build/server/remote-entry.js.map +1 -0
  204. package/apps/web/build/server/server.js +151 -0
  205. package/apps/web/package.json +10 -9
  206. package/bin/cli.js +6 -6
  207. package/bin/lib/ui_commands.js +4 -3
  208. package/docs/SecurityCompliance/qa_report_2.1.5_2026-10-07.md +65 -0
  209. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.4_2026-10-06.md +77 -0
  210. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.5_2026-10-07.md +74 -0
  211. package/docs/SecurityCompliance/socket_baseline_2026-10-07.md +60 -0
  212. package/docs/SecurityCompliance/socket_burndown_2.1.5_2026-10-07.md +73 -0
  213. package/docs/SecurityCompliance/socket_report_2.1.5_2026-10-07.md +54 -0
  214. package/docs/architecture/TOKEN-BASELINE.md +1 -1
  215. package/package.json +6 -18
  216. package/src/antigravity_manager.js +81 -15
  217. package/src/db.js +2 -2
  218. package/src/db_agents.js +1 -1
  219. package/src/db_bridges.js +1 -1
  220. package/src/db_savings.js +1 -1
  221. package/src/db_stats.js +1 -1
  222. package/src/deploy_utils.js +4 -5
  223. package/src/doctor.js +10 -0
  224. package/src/migrate.js +1 -1
  225. package/src/persona_memory.js +1 -1
  226. package/src/sqlite_driver.js +211 -0
  227. package/src/vector_search.js +1 -1
  228. package/apps/web/build/adapter-env.js +0 -2
  229. package/apps/web/build/client/_app/immutable/chunks/Ae0obco1.js +0 -3
  230. package/apps/web/build/client/_app/immutable/chunks/Ae0obco1.js.br +0 -0
  231. package/apps/web/build/client/_app/immutable/chunks/Ae0obco1.js.gz +0 -0
  232. package/apps/web/build/client/_app/immutable/chunks/BUgOhUo6.js +0 -1
  233. package/apps/web/build/client/_app/immutable/chunks/BUgOhUo6.js.br +0 -1
  234. package/apps/web/build/client/_app/immutable/chunks/BUgOhUo6.js.gz +0 -0
  235. package/apps/web/build/client/_app/immutable/chunks/Bv85lp2r.js.br +0 -3
  236. package/apps/web/build/client/_app/immutable/chunks/Bv85lp2r.js.gz +0 -0
  237. package/apps/web/build/client/_app/immutable/chunks/CP0LAeYI.js +0 -2
  238. package/apps/web/build/client/_app/immutable/chunks/CP0LAeYI.js.br +0 -0
  239. package/apps/web/build/client/_app/immutable/chunks/CP0LAeYI.js.gz +0 -0
  240. package/apps/web/build/client/_app/immutable/chunks/CP4ze5kR.js.br +0 -0
  241. package/apps/web/build/client/_app/immutable/chunks/CP4ze5kR.js.gz +0 -0
  242. package/apps/web/build/client/_app/immutable/chunks/CV8VO5Jt.js +0 -1
  243. package/apps/web/build/client/_app/immutable/chunks/CV8VO5Jt.js.br +0 -0
  244. package/apps/web/build/client/_app/immutable/chunks/CV8VO5Jt.js.gz +0 -0
  245. package/apps/web/build/client/_app/immutable/chunks/DNVgNyBC.js +0 -1
  246. package/apps/web/build/client/_app/immutable/chunks/DNVgNyBC.js.br +0 -2
  247. package/apps/web/build/client/_app/immutable/chunks/DNVgNyBC.js.gz +0 -0
  248. package/apps/web/build/client/_app/immutable/chunks/DVr7DrHY.js +0 -1
  249. package/apps/web/build/client/_app/immutable/chunks/DVr7DrHY.js.br +0 -0
  250. package/apps/web/build/client/_app/immutable/chunks/DVr7DrHY.js.gz +0 -0
  251. package/apps/web/build/client/_app/immutable/chunks/HclGiUj8.js +0 -1
  252. package/apps/web/build/client/_app/immutable/chunks/HclGiUj8.js.br +0 -0
  253. package/apps/web/build/client/_app/immutable/chunks/HclGiUj8.js.gz +0 -0
  254. package/apps/web/build/client/_app/immutable/chunks/tFx9Vkzn.js.br +0 -0
  255. package/apps/web/build/client/_app/immutable/chunks/tFx9Vkzn.js.gz +0 -0
  256. package/apps/web/build/client/_app/immutable/entry/app.qpZh6bSp.js +0 -2
  257. package/apps/web/build/client/_app/immutable/entry/app.qpZh6bSp.js.br +0 -0
  258. package/apps/web/build/client/_app/immutable/entry/app.qpZh6bSp.js.gz +0 -0
  259. package/apps/web/build/client/_app/immutable/entry/start.CUhKN6Eq.js +0 -2
  260. package/apps/web/build/client/_app/immutable/entry/start.CUhKN6Eq.js.br +0 -2
  261. package/apps/web/build/client/_app/immutable/entry/start.CUhKN6Eq.js.gz +0 -0
  262. package/apps/web/build/client/_app/immutable/nodes/0.BV_U6rd9.js.br +0 -0
  263. package/apps/web/build/client/_app/immutable/nodes/0.BV_U6rd9.js.gz +0 -0
  264. package/apps/web/build/client/_app/immutable/nodes/1.317ei_PM.js.br +0 -1
  265. package/apps/web/build/client/_app/immutable/nodes/1.317ei_PM.js.gz +0 -0
  266. package/apps/web/build/client/_app/immutable/nodes/10.C9BHUF6_.js.br +0 -0
  267. package/apps/web/build/client/_app/immutable/nodes/10.C9BHUF6_.js.gz +0 -0
  268. package/apps/web/build/client/_app/immutable/nodes/11._7rmywnA.js.br +0 -0
  269. package/apps/web/build/client/_app/immutable/nodes/11._7rmywnA.js.gz +0 -0
  270. package/apps/web/build/client/_app/immutable/nodes/12.B_UJh_Cw.js.br +0 -0
  271. package/apps/web/build/client/_app/immutable/nodes/12.B_UJh_Cw.js.gz +0 -0
  272. package/apps/web/build/client/_app/immutable/nodes/13.FtUj7AO8.js.br +0 -0
  273. package/apps/web/build/client/_app/immutable/nodes/13.FtUj7AO8.js.gz +0 -0
  274. package/apps/web/build/client/_app/immutable/nodes/14.CsMWcbH2.js.br +0 -0
  275. package/apps/web/build/client/_app/immutable/nodes/14.CsMWcbH2.js.gz +0 -0
  276. package/apps/web/build/client/_app/immutable/nodes/15.DbSoDlZF.js.br +0 -0
  277. package/apps/web/build/client/_app/immutable/nodes/15.DbSoDlZF.js.gz +0 -0
  278. package/apps/web/build/client/_app/immutable/nodes/16.BcMZYQJR.js.br +0 -0
  279. package/apps/web/build/client/_app/immutable/nodes/16.BcMZYQJR.js.gz +0 -0
  280. package/apps/web/build/client/_app/immutable/nodes/2.Bs0YCKXY.js +0 -1
  281. package/apps/web/build/client/_app/immutable/nodes/2.Bs0YCKXY.js.br +0 -0
  282. package/apps/web/build/client/_app/immutable/nodes/2.Bs0YCKXY.js.gz +0 -0
  283. package/apps/web/build/client/_app/immutable/nodes/3.Co5hy99T.js.br +0 -0
  284. package/apps/web/build/client/_app/immutable/nodes/3.Co5hy99T.js.gz +0 -0
  285. package/apps/web/build/client/_app/immutable/nodes/4.Ckjmv74-.js.br +0 -0
  286. package/apps/web/build/client/_app/immutable/nodes/4.Ckjmv74-.js.gz +0 -0
  287. package/apps/web/build/client/_app/immutable/nodes/5.jG4rh5-7.js.br +0 -0
  288. package/apps/web/build/client/_app/immutable/nodes/5.jG4rh5-7.js.gz +0 -0
  289. package/apps/web/build/client/_app/immutable/nodes/6.am-4Bf0e.js.br +0 -0
  290. package/apps/web/build/client/_app/immutable/nodes/6.am-4Bf0e.js.gz +0 -0
  291. package/apps/web/build/client/_app/immutable/nodes/7.DpWtqqaL.js.br +0 -0
  292. package/apps/web/build/client/_app/immutable/nodes/7.DpWtqqaL.js.gz +0 -0
  293. package/apps/web/build/client/_app/immutable/nodes/8.CbbKDJTU.js.br +0 -0
  294. package/apps/web/build/client/_app/immutable/nodes/8.CbbKDJTU.js.gz +0 -0
  295. package/apps/web/build/client/_app/immutable/nodes/9.CB21-Q9D.js.br +0 -0
  296. package/apps/web/build/client/_app/immutable/nodes/9.CB21-Q9D.js.gz +0 -0
  297. package/apps/web/build/dir.js +0 -8
  298. package/apps/web/build/dir.js.map +0 -1
  299. package/apps/web/build/index.js.map +0 -1
  300. package/apps/web/build/server/chunks/0-D09zEpvl.js +0 -31
  301. package/apps/web/build/server/chunks/0-D09zEpvl.js.map +0 -1
  302. package/apps/web/build/server/chunks/1-2My56RES.js +0 -17
  303. package/apps/web/build/server/chunks/1-2My56RES.js.map +0 -1
  304. package/apps/web/build/server/chunks/10-M1HtRrZp.js +0 -17
  305. package/apps/web/build/server/chunks/10-M1HtRrZp.js.map +0 -1
  306. package/apps/web/build/server/chunks/11-BDyQuE2U.js +0 -18
  307. package/apps/web/build/server/chunks/11-BDyQuE2U.js.map +0 -1
  308. package/apps/web/build/server/chunks/12-DR3YohxS.js +0 -16
  309. package/apps/web/build/server/chunks/12-DR3YohxS.js.map +0 -1
  310. package/apps/web/build/server/chunks/13-BJri0QNV.js +0 -18
  311. package/apps/web/build/server/chunks/13-BJri0QNV.js.map +0 -1
  312. package/apps/web/build/server/chunks/14-DJhiE2DY.js +0 -17
  313. package/apps/web/build/server/chunks/14-DJhiE2DY.js.map +0 -1
  314. package/apps/web/build/server/chunks/15-CJUlxcu3.js +0 -19
  315. package/apps/web/build/server/chunks/15-CJUlxcu3.js.map +0 -1
  316. package/apps/web/build/server/chunks/16-BCncPEHV.js +0 -17
  317. package/apps/web/build/server/chunks/16-BCncPEHV.js.map +0 -1
  318. package/apps/web/build/server/chunks/2-B_JPNlak.js +0 -26
  319. package/apps/web/build/server/chunks/2-B_JPNlak.js.map +0 -1
  320. package/apps/web/build/server/chunks/3-BSOfGnYr.js +0 -17
  321. package/apps/web/build/server/chunks/3-BSOfGnYr.js.map +0 -1
  322. package/apps/web/build/server/chunks/4-DUmAi2o6.js +0 -18
  323. package/apps/web/build/server/chunks/4-DUmAi2o6.js.map +0 -1
  324. package/apps/web/build/server/chunks/5-DSM_rY93.js +0 -17
  325. package/apps/web/build/server/chunks/5-DSM_rY93.js.map +0 -1
  326. package/apps/web/build/server/chunks/6-CquXfuY3.js +0 -18
  327. package/apps/web/build/server/chunks/6-CquXfuY3.js.map +0 -1
  328. package/apps/web/build/server/chunks/7-CBNvUHPu.js +0 -16
  329. package/apps/web/build/server/chunks/7-CBNvUHPu.js.map +0 -1
  330. package/apps/web/build/server/chunks/8-BlIFjRiQ.js +0 -16
  331. package/apps/web/build/server/chunks/8-BlIFjRiQ.js.map +0 -1
  332. package/apps/web/build/server/chunks/9-sa0-Zgfq.js +0 -16
  333. package/apps/web/build/server/chunks/9-sa0-Zgfq.js.map +0 -1
  334. package/apps/web/build/server/chunks/_layout.svelte-FKDEmK4m.js.map +0 -1
  335. package/apps/web/build/server/chunks/_page.svelte-B4DKG2sO.js.map +0 -1
  336. package/apps/web/build/server/chunks/_page.svelte-BKU-UjQ2.js.map +0 -1
  337. package/apps/web/build/server/chunks/_page.svelte-BQP0Z2mg.js.map +0 -1
  338. package/apps/web/build/server/chunks/_page.svelte-Bu5RfcD4.js.map +0 -1
  339. package/apps/web/build/server/chunks/_page.svelte-CvH3pIDb.js.map +0 -1
  340. package/apps/web/build/server/chunks/_page.svelte-CxxsZeRm.js.map +0 -1
  341. package/apps/web/build/server/chunks/_page.svelte-D1yHfBBh.js.map +0 -1
  342. package/apps/web/build/server/chunks/_page.svelte-DBQMj6O8.js.map +0 -1
  343. package/apps/web/build/server/chunks/_page.svelte-DFBbcBLc.js.map +0 -1
  344. package/apps/web/build/server/chunks/_page.svelte-DJp9fAk8.js.map +0 -1
  345. package/apps/web/build/server/chunks/_page.svelte-D_bQaPtJ.js.map +0 -1
  346. package/apps/web/build/server/chunks/_page.svelte-FUbd8bWv.js.map +0 -1
  347. package/apps/web/build/server/chunks/_page.svelte-K0WRgefN.js.map +0 -1
  348. package/apps/web/build/server/chunks/_page.svelte-LJxJVjMb.js +0 -7
  349. package/apps/web/build/server/chunks/_page.svelte-LJxJVjMb.js.map +0 -1
  350. package/apps/web/build/server/chunks/_page.svelte-yXv2Aj6-.js.map +0 -1
  351. package/apps/web/build/server/chunks/env-DU2WieJy.js.map +0 -1
  352. package/apps/web/build/server/chunks/env-RhfAqpCd.js.map +0 -1
  353. package/apps/web/build/server/chunks/error.svelte-CNqmrJIT.js +0 -12
  354. package/apps/web/build/server/chunks/error.svelte-CNqmrJIT.js.map +0 -1
  355. package/apps/web/build/server/chunks/exports-DzZ-4-Dy.js +0 -327
  356. package/apps/web/build/server/chunks/exports-DzZ-4-Dy.js.map +0 -1
  357. package/apps/web/build/server/chunks/handler-CNvIc1cp.js +0 -7301
  358. package/apps/web/build/server/chunks/handler-CNvIc1cp.js.map +0 -1
  359. package/apps/web/build/server/chunks/hooks.server-DqbY7q70.js +0 -8
  360. package/apps/web/build/server/chunks/hooks.server-DqbY7q70.js.map +0 -1
  361. package/apps/web/build/server/chunks/index-server-ULRIL6sb.js +0 -2
  362. package/apps/web/build/server/chunks/rolldown-runtime-D7D4PA-g.js +0 -13
  363. package/apps/web/build/server/chunks/scrollLock.svelte-ULRIL6sb.js +0 -2
  364. package/apps/web/build/server/chunks/server2-xUKEUzWG.js.map +0 -1
  365. package/apps/web/build/server/chunks/state-C6VH2NAw.js.map +0 -1
  366. package/apps/web/build/server/chunks/sweetAlert.svelte-BKTpmvHp.js.map +0 -1
  367. package/apps/web/build/server/chunks/uiState.svelte-NgyZk5Jz.js.map +0 -1
@@ -0,0 +1,3600 @@
1
+ import { A as BODY_DEPENDENT_METHODS, E as merge_tracing, F as REROUTED_URL_HEADER, M as IN_WEBCONTAINER, P as PAGE_METHODS, b as invalid_export, c as decode_pathname, d as normalize_path, f as relative_pathname, i as text, j as ENDPOINT_METHODS, k as with_request_store, l as disable_search, n as isRedirect, p as resolve, u as make_trackable, x as invalid_export_location } from "./exports.js";
2
+ import { B as get_status, C as has_prerendered_path, Ct as app_dir, D as throw_devalue_error, E as serialize_uses, G as fetch_cache_url, H as INVALIDATED_PARAM, O as with_version_header, Q as init_transport, S as get_node_type, St as text_encoder, T as redirect_response, U as TRAILING_SLASH_PARAM, V as normalize_error, X as encoders, Z as has_custom_transporters, _ as handle_action_request, _t as has_resolution_suffix, a as set_hooks, b as uneval_action_response, bt as base64_encode, d as get_remote_action, dt as find_route, f as get_remote_id, ft as otel, g as handle_action_json_request, gt as has_data_suffix, h as action_json_redirect, ht as add_resolution_suffix, i as read_implementation, k as handle_error_and_jsonify, m as handle_remote_form_post, mt as add_data_suffix, n as hooks, nt as is_form_content_type, p as handle_remote_call, pt as record_span, r as manifest, rt as negotiate, tt as uneval, u as collect_remote_data, ut as stringify, v as is_action_json_request, vt as strip_data_suffix, w as method_not_allowed, wt as assets, xt as stream_text, y as is_action_request, yt as strip_resolution_suffix } from "./internal.js";
3
+ import { a as SvelteKitError, i as Redirect } from "./shared.js";
4
+ import { C as prerender_endpoint_methods, E as prerender_template_nonce, K as set_headers_after_response, S as prerender_actions, T as prerender_nonce, Z as capture_error, _ as load_fetch_cors, b as load_promise_not_serializable, c as client_address_unsupported, d as cookies_set_after_response, f as csp_report_only_missing_report, g as header_already_set, p as endpoint_invalid_response, q as set_headers_cookie, u as cookies_serialize_before_route, w as prerender_endpoint_not_prerenderable, x as load_response_header_not_serialized } from "./server-errors.js";
5
+ import { t as uneval$1 } from "./uneval.js";
6
+ import { n as noop, r as once, t as disallow_on_server } from "./functions.js";
7
+ import { i as set_env, n as explicit_public_env, r as rendered_env } from "./config.js";
8
+ import { d as escape_html$1, o as render, r as derived } from "./server2.js";
9
+ //#region .svelte-kit/generated/build/shared/error-template.js
10
+ var error_template_default = ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>" + message + "</title>\n\n <style>\n body {\n --bg: white;\n --fg: #222;\n --divider: #ccc;\n background: var(--bg);\n color: var(--fg);\n font-family:\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n 'Open Sans',\n 'Helvetica Neue',\n sans-serif;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n }\n\n .error {\n display: flex;\n align-items: center;\n max-width: 32rem;\n margin: 0 1rem;\n }\n\n .status {\n font-weight: 200;\n font-size: 3rem;\n line-height: 1;\n position: relative;\n top: -0.05rem;\n }\n\n .message {\n border-left: 1px solid var(--divider);\n padding: 0 0 0 1rem;\n margin: 0 0 0 1rem;\n min-height: 2.5rem;\n display: flex;\n align-items: center;\n }\n\n .message h1 {\n font-weight: 400;\n font-size: 1em;\n margin: 0;\n }\n\n @media (prefers-color-scheme: dark) {\n body {\n --bg: #222;\n --fg: #ddd;\n --divider: #666;\n }\n }\n </style>\n </head>\n <body>\n <div class=\"error\">\n <span class=\"status\">" + status + "</span>\n <div class=\"message\">\n <h1>" + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n";
11
+ //#endregion
12
+ //#region .svelte-kit/generated/build/server.js
13
+ var options = {
14
+ app_template_contains_nonce: false,
15
+ csp: {
16
+ "mode": "auto",
17
+ "directives": {
18
+ "upgrade-insecure-requests": false,
19
+ "block-all-mixed-content": false
20
+ },
21
+ "reportOnly": {
22
+ "upgrade-insecure-requests": false,
23
+ "block-all-mixed-content": false
24
+ }
25
+ },
26
+ csrf_trusted_origins: [],
27
+ service_worker_options: void 0,
28
+ templates: {
29
+ app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"en\" class=\"theme-light\" data-theme=\"byakugan\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\" />\n <title>Konoha Web UI</title>\n <link rel=\"icon\" href=\"/favicon.ico\" sizes=\"any\" />\n <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/fox_kyubi_32.png\" />\n <link rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/fox_kyubi_192.png\" />\n <link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png\" />\n <link rel=\"manifest\" href=\"/manifest.webmanifest\" />\n " + head + "\n </head>\n <body class=\"min-h-screen antialiased\">\n <div style=\"display: contents\">" + body + "</div>\n </body>\n</html>\n",
30
+ error: error_template_default
31
+ }
32
+ };
33
+ async function get_hooks() {
34
+ let handle;
35
+ let handleFetch;
36
+ let handleError;
37
+ let init;
38
+ ({handle, handleFetch, handleError, init} = await import("../entries/hooks.server.js"));
39
+ let reroute;
40
+ let transport;
41
+ return {
42
+ handle,
43
+ handleFetch,
44
+ handleError,
45
+ init,
46
+ reroute,
47
+ transport
48
+ };
49
+ }
50
+ //#endregion
51
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js
52
+ /**
53
+ * @param {import('@sveltejs/kit').RequestEvent} event
54
+ * @param {import('types').RequestState} state
55
+ * @param {import('types').SSREndpoint} mod
56
+ * @returns {Promise<Response>}
57
+ */
58
+ async function render_endpoint(event, state, mod) {
59
+ const method = event.request.method;
60
+ let handler = mod[method] || mod.fallback;
61
+ if (method === "HEAD" && !mod.HEAD && mod.GET) handler = mod.GET;
62
+ if (!handler) return method_not_allowed(mod, method);
63
+ const prerender = mod.prerender ?? state.prerender_default;
64
+ if (prerender && (mod.fallback || BODY_DEPENDENT_METHODS.some((method) => mod[method]))) prerender_endpoint_methods({
65
+ methods: BODY_DEPENDENT_METHODS.join(", "),
66
+ id: event.route.id
67
+ });
68
+ if (state.prerendering && !state.prerendering.inside_reroute && !prerender) {
69
+ if (state.depth > 0) prerender_endpoint_not_prerenderable({ id: event.route.id });
70
+ else return new Response(void 0, { status: 204 });
71
+ }
72
+ try {
73
+ const response = await with_request_store({
74
+ event,
75
+ state
76
+ }, () => handler(event));
77
+ if (!(response instanceof Response)) endpoint_invalid_response({ path: event.url.pathname });
78
+ if (state.prerendering && (!state.prerendering.inside_reroute || prerender)) {
79
+ const cloned = new Response(response.clone().body, {
80
+ status: response.status,
81
+ statusText: response.statusText,
82
+ headers: new Headers(response.headers)
83
+ });
84
+ cloned.headers.set("x-sveltekit-prerender", String(prerender));
85
+ if (state.prerendering.inside_reroute && prerender) {
86
+ cloned.headers.set("x-sveltekit-routeid", encodeURI(event.route.id));
87
+ state.prerendering.dependencies.set(event.url.pathname, {
88
+ response: cloned,
89
+ body: null
90
+ });
91
+ } else return cloned;
92
+ }
93
+ return response;
94
+ } catch (e) {
95
+ if (e instanceof Redirect) return new Response(void 0, {
96
+ status: e.status,
97
+ headers: { location: e.location }
98
+ });
99
+ throw e;
100
+ }
101
+ }
102
+ /**
103
+ * @param {import('@sveltejs/kit').RequestEvent} event
104
+ */
105
+ function is_endpoint_request(event) {
106
+ const { method, headers } = event.request;
107
+ if (ENDPOINT_METHODS.includes(method) && !PAGE_METHODS.includes(method)) return true;
108
+ if (method === "POST" && headers.get("x-sveltekit-action") === "true") return false;
109
+ const accept = event.request.headers.get("accept") ?? "*/*";
110
+ return negotiate(accept, ["*", "text/html"]) !== "text/html";
111
+ }
112
+ //#endregion
113
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/array.js
114
+ /**
115
+ * Removes nullish values from an array.
116
+ *
117
+ * @template T
118
+ * @param {Array<T>} arr
119
+ */
120
+ function compact(arr) {
121
+ return arr.filter(
122
+ /** @returns {val is NonNullable<T>} */
123
+ (val) => val != null
124
+ );
125
+ }
126
+ //#endregion
127
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/pathname.js
128
+ var ROUTES_PREFIX = "/routes";
129
+ /**
130
+ * The pathname of the route-ID-keyed resolution module for a given route ID,
131
+ * e.g. `/_app/routes/blog/[slug]/__route.js` (before prefixing with `base`).
132
+ * @param {string} route_id
133
+ * @returns {string}
134
+ */
135
+ function route_id_resolution_pathname(route_id) {
136
+ return add_resolution_suffix(`/${app_dir}${ROUTES_PREFIX}${route_id === "/" ? "" : route_id}`);
137
+ }
138
+ /**
139
+ * Whether a pathname (with the `/__route.js` suffix already stripped, and `base` NOT yet stripped)
140
+ * is a route-ID resolution request rather than a pathname resolution request.
141
+ * @param {string} pathname
142
+ * @returns {boolean}
143
+ */
144
+ function is_route_id_resolution_path(pathname) {
145
+ const prefix = `/${app_dir}${ROUTES_PREFIX}`;
146
+ return pathname === prefix || pathname.startsWith(prefix + "/");
147
+ }
148
+ /**
149
+ * Extract the route ID from a decoded, base-stripped, suffix-stripped pathname,
150
+ * e.g. `/_app/routes/blog/[slug]` -> `/blog/[slug]`, `/_app/routes` -> `/`.
151
+ * @param {string} pathname
152
+ * @returns {string}
153
+ */
154
+ function extract_route_id(pathname) {
155
+ return pathname.slice(`/_app${ROUTES_PREFIX}`.length) || "/";
156
+ }
157
+ //#endregion
158
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/error-chain.js
159
+ /** @import { Component } from 'svelte'; */
160
+ /**
161
+ * Resolves the `+error.svelte` component that guards each node of `branch`, aligned to the
162
+ * branch with its empty slots removed. A node is guarded by the closest error page declared
163
+ * at or above it, except the root layout, which wraps the root error component rather than
164
+ * being wrapped by it.
165
+ * @template T
166
+ * @param {Array<unknown>} branch
167
+ * @param {Array<T | undefined | null>} errors the error page declared at each depth, if any
168
+ * @param {(error: T) => Promise<Component | undefined> | undefined} load
169
+ * @returns {Promise<Array<Component | undefined>>}
170
+ */
171
+ function build_error_chain(branch, errors, load) {
172
+ /** @type {Array<Promise<Component | undefined> | undefined>} */
173
+ const chain = [void 0];
174
+ let last_idx = -1;
175
+ for (let i = 1; i < branch.length; i += 1) {
176
+ if (!branch[i]) continue;
177
+ let j = i - 1;
178
+ while (j > last_idx + 1 && errors[j] == null) j -= 1;
179
+ last_idx = j;
180
+ const error = errors[j];
181
+ chain.push(error == null ? void 0 : load(error)?.catch(() => void 0));
182
+ }
183
+ return Promise.all(chain);
184
+ }
185
+ /**
186
+ * Walks up from the node at index `i` through the `+error.svelte` pages declared strictly
187
+ * above it, nearest first. Yields each candidate with the branch depth it attaches at,
188
+ * rewound past empty branch slots, so callers can skip candidates that fail to load.
189
+ * @template T
190
+ * @param {number} i
191
+ * @param {Array<unknown>} branch
192
+ * @param {Array<T | undefined | null>} errors the error page declared at each depth, if any
193
+ * @returns {Generator<{ error: T; idx: number }>}
194
+ */
195
+ function* nearest_error_pages(i, branch, errors) {
196
+ while (i--) {
197
+ const error = errors[i];
198
+ if (error != null) {
199
+ let j = i;
200
+ while (!branch[j]) j -= 1;
201
+ yield {
202
+ error,
203
+ idx: j + 1
204
+ };
205
+ }
206
+ }
207
+ }
208
+ //#endregion
209
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/streaming.js
210
+ /**
211
+ * Create an async iterator and a function to push values into it
212
+ * @template T
213
+ * @returns {{
214
+ * iterate: (transform?: (input: T) => T) => AsyncIterable<T>;
215
+ * add: (promise: Promise<T>) => void;
216
+ * }}
217
+ */
218
+ function create_async_iterator() {
219
+ let resolved = -1;
220
+ /** @type {PromiseWithResolvers<T>[]} */
221
+ const deferred = [];
222
+ return {
223
+ async *iterate(transform = (x) => x) {
224
+ for (let i = 0; i < deferred.length; i += 1) yield transform(await deferred[i].promise);
225
+ },
226
+ add: (promise) => {
227
+ const next = Promise.withResolvers();
228
+ next.promise.catch(noop);
229
+ deferred.push(next);
230
+ promise.then((value) => {
231
+ deferred[++resolved].resolve(value);
232
+ }, (error) => {
233
+ deferred[++resolved].reject(error);
234
+ });
235
+ }
236
+ };
237
+ }
238
+ //#endregion
239
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/data_serializer.js
240
+ /**
241
+ * If the serialized data contains promises, `chunks` will be an
242
+ * async iterable containing their resolutions
243
+ * @param {import('@sveltejs/kit').RequestEvent} event
244
+ * @param {import('types').RequestState} state
245
+ * @returns {import('./types.js').ServerDataSerializer}
246
+ */
247
+ function server_data_serializer(event, state) {
248
+ let promise_id = 1;
249
+ let max_nodes = -1;
250
+ const iterator = create_async_iterator();
251
+ const global = "__sveltekit_1ddm64b";
252
+ /** @param {number} index */
253
+ function get_replacer(index) {
254
+ /** @param {any} thing */
255
+ return function replacer(thing) {
256
+ if (typeof thing?.then === "function") {
257
+ const id = promise_id++;
258
+ const promise = thing.then(
259
+ /** @param {any} data */
260
+ (data) => ({ data })
261
+ ).catch(
262
+ /** @param {any} error */
263
+ async (error) => ({ error: await handle_error_and_jsonify(event, state, error) })
264
+ ).then(
265
+ /**
266
+ * @param {{data: any; error: any}} result
267
+ */
268
+ async ({ data, error }) => {
269
+ let str;
270
+ try {
271
+ str = uneval$1(error ? [, error] : [data], replacer);
272
+ } catch (serialization_error) {
273
+ error = await handle_error_and_jsonify(event, state, capture_error(() => load_promise_not_serializable({ id: event.route.id }, { cause: serialization_error })));
274
+ str = uneval$1([, error], replacer);
275
+ }
276
+ return {
277
+ index,
278
+ str: `${global}.resolve(${id}, ${str.includes("app.decode") ? `(app) => ${str}` : `() => ${str}`})`
279
+ };
280
+ }
281
+ );
282
+ iterator.add(promise);
283
+ return `${global}.defer(${id})`;
284
+ } else for (const key in encoders) {
285
+ const encoded = encoders[key](thing);
286
+ if (encoded) return `app.decode('${key}', ${uneval$1(encoded, replacer)})`;
287
+ }
288
+ };
289
+ }
290
+ const strings = [];
291
+ return {
292
+ set_max_nodes(i) {
293
+ max_nodes = i;
294
+ },
295
+ add_node(i, node) {
296
+ try {
297
+ if (!node) {
298
+ strings[i] = "null";
299
+ return;
300
+ }
301
+ /** @type {any} */
302
+ const payload = {
303
+ type: "data",
304
+ data: node.data,
305
+ uses: serialize_uses(node)
306
+ };
307
+ if (node.slash) payload.slash = node.slash;
308
+ strings[i] = uneval$1(payload, get_replacer(i));
309
+ } catch (error) {
310
+ error.path = error.path.slice(1);
311
+ throw_devalue_error(event, error);
312
+ }
313
+ },
314
+ get_data(csp) {
315
+ const open = `<script${csp.script_needs_nonce ? ` nonce="${csp.nonce}"` : ""}>`;
316
+ const close = `<\/script>\n`;
317
+ return {
318
+ data: `[${compact(max_nodes > -1 ? strings.slice(0, max_nodes) : strings).join(",")}]`,
319
+ chunks: promise_id > 1 ? iterator.iterate(({ index, str }) => {
320
+ if (max_nodes > -1 && index >= max_nodes) return "";
321
+ return open + str + close;
322
+ }) : null
323
+ };
324
+ }
325
+ };
326
+ }
327
+ /**
328
+ * If the serialized data contains promises, `chunks` will be an
329
+ * async iterable containing their resolutions
330
+ * @param {import('@sveltejs/kit').RequestEvent} event
331
+ * @param {import('types').RequestState} state
332
+ * @returns {import('./types.js').ServerDataSerializerJson}
333
+ */
334
+ function server_data_serializer_json(event, state) {
335
+ let promise_id = 1;
336
+ const iterator = create_async_iterator();
337
+ const reducers = {
338
+ ...encoders,
339
+ /** @param {any} thing */
340
+ Promise: (thing) => {
341
+ if (typeof thing?.then !== "function") return;
342
+ const id = promise_id++;
343
+ /** @type {'data' | 'error'} */
344
+ let key = "data";
345
+ const promise = thing.catch(
346
+ /** @param {any} error */
347
+ async (error) => {
348
+ key = "error";
349
+ return handle_error_and_jsonify(event, state, error);
350
+ }
351
+ ).then(
352
+ /** @param {any} value */
353
+ async (value) => {
354
+ let str;
355
+ try {
356
+ str = stringify(value, reducers);
357
+ } catch (serialization_error) {
358
+ const error = await handle_error_and_jsonify(event, state, capture_error(() => load_promise_not_serializable({ id: event.route.id }, { cause: serialization_error })));
359
+ key = "error";
360
+ str = stringify(error, reducers);
361
+ }
362
+ return `{"type":"chunk","id":${id},"${key}":${str}}\n`;
363
+ }
364
+ );
365
+ iterator.add(promise);
366
+ return id;
367
+ }
368
+ };
369
+ const strings = [];
370
+ return {
371
+ add_node(i, node) {
372
+ try {
373
+ if (!node) {
374
+ strings[i] = "null";
375
+ return;
376
+ }
377
+ if (node.type === "error" || node.type === "skip") {
378
+ strings[i] = JSON.stringify(node);
379
+ return;
380
+ }
381
+ strings[i] = `{"type":"data","data":${stringify(node.data, reducers)},"uses":${JSON.stringify(serialize_uses(node))}${node.slash ? `,"slash":${JSON.stringify(node.slash)}` : ""}}`;
382
+ } catch (error) {
383
+ error.path = "data" + error.path;
384
+ throw_devalue_error(event, error);
385
+ }
386
+ },
387
+ get_data() {
388
+ return {
389
+ data: `{"type":"data","nodes":[${strings.join(",")}]}\n`,
390
+ chunks: promise_id > 1 ? iterator.iterate() : null
391
+ };
392
+ }
393
+ };
394
+ }
395
+ //#endregion
396
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/constants.js
397
+ var NULL_BODY_STATUS = [
398
+ 101,
399
+ 103,
400
+ 204,
401
+ 205,
402
+ 304
403
+ ];
404
+ //#endregion
405
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/load_data.js
406
+ /**
407
+ * Calls the user's server `load` function.
408
+ * @param {{
409
+ * event: import('@sveltejs/kit').RequestEvent;
410
+ * state: import('types').RequestState;
411
+ * node: import('types').SSRNode | undefined;
412
+ * parent: () => Promise<Record<string, any>>;
413
+ * }} opts
414
+ * @returns {Promise<import('types').ServerDataNode | null>}
415
+ */
416
+ async function load_server_data({ event, state, node, parent }) {
417
+ if (!node?.server) return null;
418
+ let is_tracking = true;
419
+ const uses = {
420
+ dependencies: /* @__PURE__ */ new Set(),
421
+ params: /* @__PURE__ */ new Set(),
422
+ parent: false,
423
+ route: false,
424
+ url: false,
425
+ search_params: /* @__PURE__ */ new Set()
426
+ };
427
+ const load = node.server.load;
428
+ const slash = node.server.trailingSlash;
429
+ if (!load) return {
430
+ type: "data",
431
+ data: null,
432
+ uses,
433
+ slash
434
+ };
435
+ const url = make_trackable(event.url, () => {
436
+ if (is_tracking) uses.url = true;
437
+ }, (param) => {
438
+ if (is_tracking) uses.search_params.add(param);
439
+ });
440
+ if (state.prerendering || state.prerender_default === true) disable_search(url);
441
+ return {
442
+ type: "data",
443
+ data: await record_span({
444
+ name: "sveltekit.load",
445
+ attributes: {
446
+ "sveltekit.load.node_id": node.server_id || "unknown",
447
+ "sveltekit.load.node_type": get_node_type(node.server_id),
448
+ "sveltekit.load.environment": "server",
449
+ "http.route": event.route.id || "unknown"
450
+ },
451
+ fn: async (current) => {
452
+ const traced_event = merge_tracing(event, current);
453
+ return await with_request_store({
454
+ event: traced_event,
455
+ state
456
+ }, () => load.call(null, {
457
+ ...traced_event,
458
+ fetch: (info, init) => {
459
+ new URL(info instanceof Request ? info.url : info, event.url);
460
+ return event.fetch(info, init);
461
+ },
462
+ /** @param {string[]} deps */
463
+ depends: (...deps) => {
464
+ for (const dep of deps) {
465
+ const { href } = new URL(dep, event.url);
466
+ uses.dependencies.add(href);
467
+ }
468
+ },
469
+ params: new Proxy(event.params, { get: (target, key) => {
470
+ if (is_tracking) uses.params.add(key);
471
+ return target[key];
472
+ } }),
473
+ parent: async () => {
474
+ if (is_tracking) uses.parent = true;
475
+ return parent();
476
+ },
477
+ route: new Proxy(event.route, { get: (target, key) => {
478
+ if (is_tracking) uses.route = true;
479
+ return target[key];
480
+ } }),
481
+ url,
482
+ untrack(fn) {
483
+ is_tracking = false;
484
+ try {
485
+ return fn();
486
+ } finally {
487
+ is_tracking = true;
488
+ }
489
+ }
490
+ }));
491
+ }
492
+ }) ?? null,
493
+ uses,
494
+ slash
495
+ };
496
+ }
497
+ /**
498
+ * Calls the user's `load` function.
499
+ * @param {{
500
+ * event: import('@sveltejs/kit').RequestEvent;
501
+ * state: import('types').RequestState;
502
+ * fetched: import('./types.js').Fetched[];
503
+ * node: import('types').SSRNode | undefined;
504
+ * parent: () => Promise<Record<string, any>>;
505
+ * resolve_opts: import('types').RequiredResolveOptions;
506
+ * server_data_promise: Promise<import('types').ServerDataNode | null>;
507
+ * csr: boolean;
508
+ * }} opts
509
+ * @returns {Promise<Record<string, any | Promise<any>> | null>}
510
+ */
511
+ async function load_data({ event, state, fetched, node, parent, server_data_promise, resolve_opts, csr }) {
512
+ const server_data_node = await server_data_promise;
513
+ const load = node?.universal?.load;
514
+ if (!load) return server_data_node?.data ?? null;
515
+ return await record_span({
516
+ name: "sveltekit.load",
517
+ attributes: {
518
+ "sveltekit.load.node_id": node.universal_id || "unknown",
519
+ "sveltekit.load.node_type": get_node_type(node.universal_id),
520
+ "sveltekit.load.environment": "server",
521
+ "http.route": event.route.id || "unknown"
522
+ },
523
+ fn: async (current) => {
524
+ const traced_event = merge_tracing(event, current);
525
+ return await with_request_store({
526
+ event: traced_event,
527
+ state
528
+ }, () => load.call(null, {
529
+ url: event.url,
530
+ params: event.params,
531
+ data: server_data_node?.data ?? null,
532
+ route: event.route,
533
+ fetch: create_universal_fetch(event, state.prerendering, fetched, csr, resolve_opts),
534
+ setHeaders: event.setHeaders,
535
+ depends: noop,
536
+ parent,
537
+ untrack: (fn) => fn(),
538
+ tracing: traced_event.tracing
539
+ }));
540
+ }
541
+ }) ?? null;
542
+ }
543
+ /**
544
+ * @param {Pick<import('@sveltejs/kit').RequestEvent, 'fetch' | 'url' | 'request' | 'route'>} event
545
+ * @param {import('types').PrerenderOptions | undefined} prerendering
546
+ * @param {import('./types.js').Fetched[]} fetched
547
+ * @param {boolean} csr
548
+ * @param {Pick<Required<import('@sveltejs/kit/hooks').ResolveOptions>, 'filterSerializedResponseHeaders'>} resolve_opts
549
+ * @returns {typeof fetch}
550
+ */
551
+ function create_universal_fetch(event, prerendering, fetched, csr, resolve_opts) {
552
+ /**
553
+ * @param {URL | RequestInfo} input
554
+ * @param {RequestInit} [init]
555
+ */
556
+ const universal_fetch = async (input, init) => {
557
+ const cloned_body = input instanceof Request && input.body ? input.clone().body : null;
558
+ const cloned_headers = input instanceof Request && [...input.headers].length ? new Headers(input.headers) : init?.headers;
559
+ let response = await event.fetch(input, init);
560
+ const url = new URL(input instanceof Request ? input.url : input, event.url);
561
+ const same_origin = url.origin === event.url.origin;
562
+ /** @type {import('types').PrerenderDependency} */
563
+ let dependency;
564
+ if (same_origin) {
565
+ if (prerendering) {
566
+ dependency = {
567
+ response,
568
+ body: null
569
+ };
570
+ prerendering.dependencies.set(url.pathname, dependency);
571
+ }
572
+ } else if (url.protocol === "https:" || url.protocol === "http:") {
573
+ if ((input instanceof Request ? input.mode : init?.mode ?? "cors") === "no-cors") response = new Response("", {
574
+ status: response.status,
575
+ statusText: response.statusText,
576
+ headers: response.headers
577
+ });
578
+ else {
579
+ const acao = response.headers.get("access-control-allow-origin");
580
+ if (!acao || acao !== event.url.origin && acao !== "*") load_fetch_cors({ reason: acao ? "Incorrect" : "No" });
581
+ }
582
+ }
583
+ /** @type {ReadableStream<Uint8Array>} */
584
+ let teed_body;
585
+ const proxy = new Proxy(response, { get(response, key, receiver) {
586
+ /**
587
+ * @param {string | undefined} body
588
+ * @param {boolean} is_b64
589
+ */
590
+ async function push_fetched(body, is_b64) {
591
+ const status_number = Number(response.status);
592
+ if (isNaN(status_number)) throw new Error(`response.status is not a number. value: "${response.status}" type: ${typeof response.status}`);
593
+ const request_body = input instanceof Request && cloned_body ? await new Response(cloned_body).text() : init?.body;
594
+ if (request_body && typeof request_body !== "string" && !ArrayBuffer.isView(request_body)) return;
595
+ fetched.push({
596
+ url: fetch_cache_url(url, event.url),
597
+ method: event.request.method,
598
+ request_body,
599
+ request_headers: cloned_headers,
600
+ response_body: body,
601
+ response,
602
+ is_b64
603
+ });
604
+ }
605
+ if (key === "body") {
606
+ if (response.body === null) return null;
607
+ if (teed_body) return teed_body;
608
+ const [a, b] = response.body.tee();
609
+ (async () => {
610
+ const result = new Uint8Array(await new Response(a).arrayBuffer());
611
+ if (dependency) dependency.body = new Uint8Array(result);
612
+ push_fetched(base64_encode(result), true);
613
+ })().catch(noop);
614
+ return teed_body = b;
615
+ }
616
+ if (key === "arrayBuffer") return async () => {
617
+ const buffer = await response.arrayBuffer();
618
+ const bytes = new Uint8Array(buffer);
619
+ if (dependency) dependency.body = bytes;
620
+ if (buffer instanceof ArrayBuffer) await push_fetched(base64_encode(bytes), true);
621
+ return buffer;
622
+ };
623
+ async function text() {
624
+ const body = await response.text();
625
+ if (body === "" && NULL_BODY_STATUS.includes(response.status)) {
626
+ await push_fetched(void 0, false);
627
+ return;
628
+ }
629
+ if (!body || typeof body === "string") await push_fetched(body, false);
630
+ if (dependency) dependency.body = body;
631
+ return body;
632
+ }
633
+ if (key === "text") return text;
634
+ if (key === "json") return async () => {
635
+ const body = await text();
636
+ return body ? JSON.parse(body) : void 0;
637
+ };
638
+ const value = Reflect.get(response, key, response);
639
+ if (value instanceof Function) return Object.defineProperties(
640
+ /**
641
+ * @this {any}
642
+ */
643
+ function() {
644
+ return Reflect.apply(value, this === receiver ? response : this, arguments);
645
+ },
646
+ {
647
+ name: { value: value.name },
648
+ length: { value: value.length }
649
+ }
650
+ );
651
+ return value;
652
+ } });
653
+ if (csr) {
654
+ const get = response.headers.get;
655
+ response.headers.get = (key) => {
656
+ const lower = key.toLowerCase();
657
+ const value = get.call(response.headers, lower);
658
+ if (value && !lower.startsWith("x-sveltekit-")) {
659
+ if (!resolve_opts.filterSerializedResponseHeaders(lower, value)) load_response_header_not_serialized({
660
+ name: lower,
661
+ id: event.route.id
662
+ });
663
+ }
664
+ return value;
665
+ };
666
+ const get_set_cookie = response.headers.getSetCookie;
667
+ response.headers.getSetCookie = () => {
668
+ const values = get_set_cookie.call(response.headers);
669
+ for (const value of values) if (!resolve_opts.filterSerializedResponseHeaders("set-cookie", value)) load_response_header_not_serialized({
670
+ name: "set-cookie",
671
+ id: event.route.id
672
+ });
673
+ return values;
674
+ };
675
+ }
676
+ return proxy;
677
+ };
678
+ return (input, init) => {
679
+ const response = universal_fetch(input, init);
680
+ response.catch(noop);
681
+ return response;
682
+ };
683
+ }
684
+ //#endregion
685
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/hash.js
686
+ /**
687
+ * Hash using djb2
688
+ * @param {import('types').StrictBody[]} values
689
+ */
690
+ function hash(...values) {
691
+ let hash = 5381;
692
+ for (const value of values) if (typeof value === "string") {
693
+ let i = value.length;
694
+ while (i) hash = hash * 33 ^ value.charCodeAt(--i);
695
+ } else if (ArrayBuffer.isView(value)) {
696
+ const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
697
+ let i = buffer.length;
698
+ while (i) hash = hash * 33 ^ buffer[--i];
699
+ } else throw new TypeError("value must be a string or TypedArray");
700
+ return (hash >>> 0).toString(36);
701
+ }
702
+ /**
703
+ * Hash of the headers and body a `fetch` was called with. The server-side serializer and the
704
+ * client-side cache lookup must produce identical values for cached responses to be found.
705
+ * @param {HeadersInit | undefined} headers
706
+ * @param {import('types').StrictBody | null | undefined} body
707
+ */
708
+ function hash_request(headers, body) {
709
+ /** @type {import('types').StrictBody[]} */
710
+ const values = [];
711
+ if (headers) values.push([...new Headers(headers)].join(","));
712
+ if (body) values.push(body);
713
+ return hash(...values);
714
+ }
715
+ //#endregion
716
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/misc.js
717
+ var s = JSON.stringify;
718
+ //#endregion
719
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/escape.js
720
+ /**
721
+ * When inside a double-quoted attribute value, only `&` and `"` hold special meaning.
722
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(double-quoted)-state
723
+ * @type {Record<string, string>}
724
+ */
725
+ var escape_html_attr_dict = {
726
+ "&": "&amp;",
727
+ "\"": "&quot;"
728
+ };
729
+ /**
730
+ * @type {Record<string, string>}
731
+ */
732
+ var escape_html_dict = {
733
+ "&": "&amp;",
734
+ "<": "&lt;"
735
+ };
736
+ /** @param {Record<string, string>} dict */
737
+ var escape_regex = (dict) => new RegExp(`[${Object.keys(dict).join("")}]|\\p{Surrogate}`, "gu");
738
+ var escape_html_attr_regex = escape_regex(escape_html_attr_dict);
739
+ var escape_html_regex = escape_regex(escape_html_dict);
740
+ /**
741
+ * Escapes unpaired surrogates (which are allowed in js strings but invalid in HTML) and
742
+ * escapes characters that are special.
743
+ *
744
+ * @param {string} str
745
+ * @param {boolean} [is_attr]
746
+ * @returns {string} escaped string
747
+ * @example const html = `<tag data-value="${escape_html('value', true)}">...</tag>`;
748
+ */
749
+ function escape_html(str, is_attr) {
750
+ const dict = is_attr ? escape_html_attr_dict : escape_html_dict;
751
+ return str.replace(is_attr ? escape_html_attr_regex : escape_html_regex, (match) => dict[match] ?? `&#${match.charCodeAt(0)};`);
752
+ }
753
+ //#endregion
754
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/serialize_data.js
755
+ /**
756
+ * Inside a script element, only `<\/script` and `<!--` hold special meaning to the HTML parser.
757
+ *
758
+ * The first closes the script element, so everything after is treated as raw HTML.
759
+ * The second disables further parsing until `-->`, so the script element might be unexpectedly
760
+ * kept open up until an unrelated HTML comment in the page.
761
+ *
762
+ * U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR are escaped for the sake of pre-2018
763
+ * browsers.
764
+ *
765
+ * @see tests for unsafe parsing examples.
766
+ * @see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements
767
+ * @see https://html.spec.whatwg.org/multipage/syntax.html#cdata-rcdata-restrictions
768
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#script-data-state
769
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#script-data-double-escaped-state
770
+ * @see https://github.com/tc39/proposal-json-superset
771
+ * @type {Record<string, string>}
772
+ */
773
+ var replacements = {
774
+ "<": "\\u003C",
775
+ "\u2028": "\\u2028",
776
+ "\u2029": "\\u2029"
777
+ };
778
+ var pattern = new RegExp(`[${Object.keys(replacements).join("")}]`, "g");
779
+ /**
780
+ * Generates a raw HTML string containing a safe script element carrying data and associated attributes.
781
+ *
782
+ * It escapes all the special characters needed to guarantee the element is unbroken, but care must
783
+ * be taken to ensure it is inserted in the document at an acceptable position for a script element,
784
+ * and that the resulting string isn't further modified.
785
+ *
786
+ * @param {import('./types.js').Fetched} fetched
787
+ * @param {(name: string, value: string) => boolean} filter
788
+ * @param {boolean} [prerendering]
789
+ * @returns {string} The raw HTML of a script element carrying the JSON payload.
790
+ * @example const html = serialize_data('/data.json', null, { foo: 'bar' });
791
+ */
792
+ function serialize_data(fetched, filter, prerendering = false) {
793
+ /** @type {Record<string, string>} */
794
+ const headers = {};
795
+ let cache_control = null;
796
+ let age = null;
797
+ let varyAny = false;
798
+ for (const [key, value] of fetched.response.headers) {
799
+ if (filter(key, value)) headers[key] = value;
800
+ if (key === "cache-control") cache_control = value;
801
+ else if (key === "age") age = value;
802
+ else if (key === "vary" && value.trim() === "*") varyAny = true;
803
+ }
804
+ const payload = {
805
+ status: fetched.response.status,
806
+ statusText: fetched.response.statusText,
807
+ headers,
808
+ body: fetched.response_body
809
+ };
810
+ const safe_payload = JSON.stringify(payload).replace(pattern, (match) => replacements[match]);
811
+ const attrs = [
812
+ "type=\"application/json\"",
813
+ "data-sveltekit-fetched",
814
+ `data-url="${escape_html(fetched.url, true)}"`
815
+ ];
816
+ if (fetched.is_b64) attrs.push("data-b64");
817
+ if (fetched.request_headers || fetched.request_body) attrs.push(`data-hash="${hash_request(fetched.request_headers, fetched.request_body)}"`);
818
+ if (!prerendering && fetched.method === "GET" && cache_control && !varyAny) {
819
+ const match = /s-maxage=(\d+)/g.exec(cache_control) ?? /max-age=(\d+)/g.exec(cache_control);
820
+ if (match) {
821
+ const ttl = +match[1] - +(age ?? "0");
822
+ attrs.push(`data-ttl="${ttl}"`);
823
+ }
824
+ }
825
+ return `<script ${attrs.join(" ")}>${safe_payload}<\/script>`;
826
+ }
827
+ //#endregion
828
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/csp.js
829
+ var array = /* @__PURE__ */ new Uint8Array(16);
830
+ function generate_nonce() {
831
+ crypto.getRandomValues(array);
832
+ return base64_encode(array);
833
+ }
834
+ /** @param {string} content */
835
+ async function sha256(content) {
836
+ const digest = await crypto.subtle.digest("SHA-256", text_encoder.encode(content));
837
+ return base64_encode(new Uint8Array(digest));
838
+ }
839
+ /** @typedef {`nonce-${string}` | `sha256-${string}`} CspSource */
840
+ var quoted = /* @__PURE__ */ new Set([
841
+ "self",
842
+ "unsafe-eval",
843
+ "unsafe-hashes",
844
+ "unsafe-inline",
845
+ "none",
846
+ "strict-dynamic",
847
+ "report-sample",
848
+ "wasm-unsafe-eval",
849
+ "script"
850
+ ]);
851
+ var crypto_pattern = /^(nonce|sha\d\d\d)-/;
852
+ var BaseProvider = class {
853
+ /** @type {boolean} */
854
+ #use_hashes;
855
+ /** @type {boolean} */
856
+ script_needs_csp;
857
+ /** @type {boolean} */
858
+ #script_src_needs_csp;
859
+ /** @type {boolean} */
860
+ #script_src_elem_needs_csp;
861
+ /** @type {boolean} */
862
+ style_needs_csp;
863
+ /** @type {boolean} */
864
+ #style_src_needs_csp;
865
+ /** @type {boolean} */
866
+ #style_src_attr_needs_csp;
867
+ /** @type {boolean} */
868
+ #style_src_elem_needs_csp;
869
+ /** @type {import('types').CspDirectives} */
870
+ #directives;
871
+ /** @type {Set<import('types').Csp.Source>} */
872
+ #script_src = /* @__PURE__ */ new Set();
873
+ /** @type {Set<import('types').Csp.Source>} */
874
+ #script_src_elem = /* @__PURE__ */ new Set();
875
+ /** @type {Set<import('types').Csp.Source>} */
876
+ #style_src = /* @__PURE__ */ new Set();
877
+ /** @type {Set<import('types').Csp.Source>} */
878
+ #style_src_attr = /* @__PURE__ */ new Set();
879
+ /** @type {Set<import('types').Csp.Source>} */
880
+ #style_src_elem = /* @__PURE__ */ new Set();
881
+ /** @type {boolean} */
882
+ script_needs_nonce;
883
+ /** @type {boolean} */
884
+ style_needs_nonce;
885
+ /** @type {boolean} */
886
+ script_needs_hash;
887
+ /**
888
+ * @param {boolean} use_hashes
889
+ * @param {import('types').CspDirectives} directives
890
+ */
891
+ constructor(use_hashes, directives) {
892
+ this.#use_hashes = use_hashes;
893
+ this.#directives = directives;
894
+ const d = this.#directives;
895
+ const effective_script_src = d["script-src"] || d["default-src"];
896
+ const script_src_elem = d["script-src-elem"];
897
+ const effective_style_src = d["style-src"] || d["default-src"];
898
+ const style_src_attr = d["style-src-attr"];
899
+ const style_src_elem = d["style-src-elem"];
900
+ /** @param {(import('types').Csp.Source | import('types').Csp.ActionSource)[] | undefined} directive */
901
+ const style_needs_csp = (directive) => !!directive && !directive.some((value) => value === "unsafe-inline");
902
+ /** @param {(import('types').Csp.Source | import('types').Csp.ActionSource)[] | undefined} directive */
903
+ const script_needs_csp = (directive) => !!directive && (!directive.some((value) => value === "unsafe-inline") || directive.some((value) => value === "strict-dynamic"));
904
+ this.#script_src_needs_csp = script_needs_csp(effective_script_src);
905
+ this.#script_src_elem_needs_csp = script_needs_csp(script_src_elem);
906
+ this.#style_src_needs_csp = style_needs_csp(effective_style_src);
907
+ this.#style_src_attr_needs_csp = style_needs_csp(style_src_attr);
908
+ this.#style_src_elem_needs_csp = style_needs_csp(style_src_elem);
909
+ this.script_needs_csp = this.#script_src_needs_csp || this.#script_src_elem_needs_csp;
910
+ this.style_needs_csp = this.#style_src_needs_csp || this.#style_src_attr_needs_csp || this.#style_src_elem_needs_csp;
911
+ this.script_needs_nonce = this.script_needs_csp && !this.#use_hashes;
912
+ this.style_needs_nonce = this.style_needs_csp && !this.#use_hashes;
913
+ this.script_needs_hash = this.script_needs_csp && this.#use_hashes;
914
+ }
915
+ /** @param {CspSource} source */
916
+ add_script(source) {
917
+ if (this.#script_src_needs_csp) this.#script_src.add(source);
918
+ if (this.#script_src_elem_needs_csp) this.#script_src_elem.add(source);
919
+ }
920
+ /** @param {CspSource} source */
921
+ add_style(source) {
922
+ if (!this.style_needs_csp) return;
923
+ if (this.#style_src_needs_csp) this.#style_src.add(source);
924
+ if (this.#style_src_attr_needs_csp) this.#style_src_attr.add(source);
925
+ if (this.#style_src_elem_needs_csp) {
926
+ const sha256_empty_comment_hash = "sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=";
927
+ const d = this.#directives;
928
+ if (d["style-src-elem"] && !d["style-src-elem"].includes(sha256_empty_comment_hash) && !this.#style_src_elem.has(sha256_empty_comment_hash)) this.#style_src_elem.add(sha256_empty_comment_hash);
929
+ if (source !== sha256_empty_comment_hash) this.#style_src_elem.add(source);
930
+ }
931
+ }
932
+ /**
933
+ * @param {boolean} [is_meta]
934
+ */
935
+ get_header(is_meta = false) {
936
+ const header = [];
937
+ const directives = { ...this.#directives };
938
+ /**
939
+ * @template {'style-src' | 'style-src-attr' | 'style-src-elem' | 'script-src' | 'script-src-elem'} K
940
+ * @param {K} key
941
+ * @param {Set<import('types').Csp.Source>} sources
942
+ * @param {import('types').CspDirectives[K]} [base]
943
+ */
944
+ const merge_sources = (key, sources, base) => {
945
+ if (sources.size > 0) directives[key] = [...base || [], ...sources];
946
+ };
947
+ merge_sources("style-src", this.#style_src, directives["style-src"] || directives["default-src"]);
948
+ merge_sources("style-src-attr", this.#style_src_attr, directives["style-src-attr"]);
949
+ merge_sources("style-src-elem", this.#style_src_elem, directives["style-src-elem"]);
950
+ merge_sources("script-src", this.#script_src, directives["script-src"] || directives["default-src"]);
951
+ merge_sources("script-src-elem", this.#script_src_elem, directives["script-src-elem"]);
952
+ for (const key in directives) {
953
+ if (is_meta && (key === "frame-ancestors" || key === "report-uri" || key === "sandbox")) continue;
954
+ const value = directives[key];
955
+ if (!value) continue;
956
+ const directive = [key];
957
+ if (Array.isArray(value)) for (const source of value) directive.push(quoted.has(source) || crypto_pattern.test(source) ? `'${source}'` : source);
958
+ header.push(directive.join(" "));
959
+ }
960
+ return header.join("; ");
961
+ }
962
+ };
963
+ var CspProvider = class extends BaseProvider {
964
+ get_meta() {
965
+ const content = this.get_header(true);
966
+ if (!content) return;
967
+ return `<meta http-equiv="content-security-policy" content="${escape_html(content, true)}">`;
968
+ }
969
+ };
970
+ var CspReportOnlyProvider = class extends BaseProvider {
971
+ /**
972
+ * @param {boolean} use_hashes
973
+ * @param {import('types').CspDirectives} directives
974
+ */
975
+ constructor(use_hashes, directives) {
976
+ super(use_hashes, directives);
977
+ if (Object.values(directives).some((v) => !!v) && !directives["report-to"]?.length && !directives["report-uri"]?.length) csp_report_only_missing_report();
978
+ }
979
+ };
980
+ var Csp = class {
981
+ /** @readonly */
982
+ nonce = generate_nonce();
983
+ /** @type {CspProvider} */
984
+ csp_provider;
985
+ /** @type {CspReportOnlyProvider} */
986
+ report_only_provider;
987
+ /** @type {boolean} */
988
+ #use_hashes;
989
+ /**
990
+ * @param {import('./types.js').CspConfig} config
991
+ * @param {import('./types.js').CspOpts} opts
992
+ */
993
+ constructor({ mode, directives, reportOnly }, { prerender }) {
994
+ this.#use_hashes = mode === "hash" || mode === "auto" && prerender;
995
+ this.csp_provider = new CspProvider(this.#use_hashes, directives);
996
+ this.report_only_provider = new CspReportOnlyProvider(this.#use_hashes, reportOnly);
997
+ }
998
+ /**
999
+ * @param {string} content
1000
+ * @returns {Promise<CspSource>}
1001
+ */
1002
+ async #get_source(content) {
1003
+ return this.#use_hashes ? `sha256-${await sha256(content)}` : `nonce-${this.nonce}`;
1004
+ }
1005
+ get script_needs_hash() {
1006
+ return this.csp_provider.script_needs_hash || this.report_only_provider.script_needs_hash;
1007
+ }
1008
+ get script_needs_nonce() {
1009
+ return this.csp_provider.script_needs_nonce || this.report_only_provider.script_needs_nonce;
1010
+ }
1011
+ get style_needs_nonce() {
1012
+ return this.csp_provider.style_needs_nonce || this.report_only_provider.style_needs_nonce;
1013
+ }
1014
+ /** @param {string} content */
1015
+ async add_script(content) {
1016
+ if (!this.csp_provider.script_needs_csp && !this.report_only_provider.script_needs_csp) return;
1017
+ const source = await this.#get_source(content);
1018
+ if (this.csp_provider.script_needs_csp) this.csp_provider.add_script(source);
1019
+ if (this.report_only_provider.script_needs_csp) this.report_only_provider.add_script(source);
1020
+ }
1021
+ /** @param {`sha256-${string}`[]} hashes */
1022
+ add_script_hashes(hashes) {
1023
+ for (const hash of hashes) {
1024
+ this.csp_provider.add_script(hash);
1025
+ this.report_only_provider.add_script(hash);
1026
+ }
1027
+ }
1028
+ /** @param {string} content */
1029
+ async add_style(content) {
1030
+ if (!this.csp_provider.style_needs_csp && !this.report_only_provider.style_needs_csp) return;
1031
+ const source = await this.#get_source(content);
1032
+ this.csp_provider.add_style(source);
1033
+ this.report_only_provider.add_style(source);
1034
+ }
1035
+ };
1036
+ //#endregion
1037
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/server_routing.js
1038
+ /** @import { ParamValue } from '@sveltejs/kit/params' */
1039
+ /** @import { SSRManifest } from 'types' */
1040
+ /**
1041
+ * @param {import('types').SSRClientRoute} route
1042
+ * @param {URL} url
1043
+ * @param {NonNullable<SSRManifest['client']>} client
1044
+ * @returns {string}
1045
+ */
1046
+ function generate_route_object(route, url, client) {
1047
+ const { errors, layouts, leaf } = route;
1048
+ const paths = resolve_paths(url.pathname);
1049
+ const nodes = [
1050
+ ...errors,
1051
+ ...layouts.map((l) => l?.[1]),
1052
+ leaf[1]
1053
+ ].filter((n) => typeof n === "number").map((n) => `'${n}': () => ${create_client_import(client.nodes?.[n], paths)}`).join(",\n ");
1054
+ return [
1055
+ `{\n\tid: ${s(route.id)}`,
1056
+ `errors: ${s(route.errors)}`,
1057
+ `layouts: ${s(route.layouts)}`,
1058
+ `leaf: ${s(route.leaf)}`,
1059
+ `nodes: {\n\t\t${nodes}\n\t}\n}`
1060
+ ].join(",\n ");
1061
+ }
1062
+ /**
1063
+ * The `base` and `assets` prefixes for client paths in a document at `pathname`. With
1064
+ * `paths.relative`, they're relative to that document so the app also works when served
1065
+ * from IPFS, the internet archive, or behind a proxy.
1066
+ * @param {string} pathname
1067
+ */
1068
+ function resolve_paths(pathname) {
1069
+ const relative_base = pathname.slice(0).split("/").slice(2).map(() => "..").join("/") || ".";
1070
+ return {
1071
+ base: relative_base,
1072
+ assets: !assets || assets[0] === "/" && assets !== "/_svelte_kit_assets" ? relative_base : assets
1073
+ };
1074
+ }
1075
+ /**
1076
+ * @param {string} path a root-absolute dev path (e.g. `/@fs/...`) or a prod path relative to `assets`
1077
+ * @param {ReturnType<typeof resolve_paths>} paths
1078
+ */
1079
+ function client_path(path, { base, assets }) {
1080
+ return path[0] === "/" ? base + path : `${assets}/${path}`;
1081
+ }
1082
+ /**
1083
+ * @param {string | undefined} import_path
1084
+ * @param {ReturnType<typeof resolve_paths>} paths
1085
+ */
1086
+ function create_client_import(import_path, paths) {
1087
+ return import_path ? `import('${client_path(import_path, paths)}')` : "Promise.resolve({})";
1088
+ }
1089
+ /**
1090
+ * @param {string} resolved_path
1091
+ * @param {URL} url
1092
+ * @returns {Promise<Response>}
1093
+ */
1094
+ async function resolve_route(resolved_path, url) {
1095
+ if (!manifest.client?.routes) return text("Server-side route resolution disabled", { status: 400 });
1096
+ try {
1097
+ const matchers = await manifest.matchers();
1098
+ const result = find_route(resolved_path, manifest.client.routes, matchers);
1099
+ return create_server_routing_response(result?.route ?? null, result?.params ?? {}, url, manifest.client).response;
1100
+ } catch {
1101
+ return text("Error resolving route", { status: 500 });
1102
+ }
1103
+ }
1104
+ /**
1105
+ * Resolve a route-ID resolution request (`/_app/routes/<id>/__route.js`) to a
1106
+ * JS module containing the route's node loaders. Params are always `{}` since
1107
+ * this endpoint exists to support `preloadCode(routeId)`, which doesn't need them.
1108
+ *
1109
+ * The module has one of three shapes, which the client uses to tell three cases apart:
1110
+ *
1111
+ * - `export const route = {...}` — a page route, with loaders to import
1112
+ * - `export const endpoint_only = true` — a real route with no `+page`, so there is
1113
+ * nothing to preload, but the client can cache that fact and stop asking
1114
+ * - an empty module — no such route
1115
+ *
1116
+ * @param {string} route_id
1117
+ * @param {URL} url
1118
+ * @returns {Response}
1119
+ */
1120
+ function resolve_route_by_id(route_id, url) {
1121
+ if (!manifest.client?.routes) return text("Server-side route resolution disabled", { status: 400 });
1122
+ try {
1123
+ const route = manifest.client.routes.find((r) => r.id === route_id);
1124
+ if (route) return create_server_routing_response(route, null, url, manifest.client).response;
1125
+ if (manifest.routes.some((r) => r.id === route_id && !r.page)) return text("export const endpoint_only = true;", { headers: js_headers() });
1126
+ return create_server_routing_response(null, null, url, manifest.client).response;
1127
+ } catch {
1128
+ return text("Error resolving route", { status: 500 });
1129
+ }
1130
+ }
1131
+ function js_headers() {
1132
+ return new Headers({ "content-type": "application/javascript; charset=utf-8" });
1133
+ }
1134
+ /**
1135
+ * @param {import('types').SSRClientRoute | null} route
1136
+ * @param {Partial<Record<string, ParamValue>> | null} params
1137
+ * @param {URL} url
1138
+ * @param {NonNullable<SSRManifest['client']>} client
1139
+ * @returns {{response: Response, body: string}}
1140
+ */
1141
+ function create_server_routing_response(route, params, url, client) {
1142
+ const headers = js_headers();
1143
+ let body = "";
1144
+ if (route) {
1145
+ const csr_route = generate_route_object(route, url, client);
1146
+ body = `${create_css_import(route, url, client)}export const route = ${csr_route};`;
1147
+ if (params !== null) body += `\nexport const params = ${uneval$1(params)}`;
1148
+ }
1149
+ return {
1150
+ response: text(body, { headers }),
1151
+ body
1152
+ };
1153
+ }
1154
+ /**
1155
+ * This function generates the client-side import for the CSS files that are
1156
+ * associated with the current route. Vite takes care of that when using
1157
+ * client-side route resolution, but for server-side resolution it does
1158
+ * not know about the CSS files automatically.
1159
+ *
1160
+ * @param {import('types').SSRClientRoute} route
1161
+ * @param {URL} url
1162
+ * @param {NonNullable<SSRManifest['client']>} client
1163
+ * @returns {string}
1164
+ */
1165
+ function create_css_import(route, url, client) {
1166
+ const { errors, layouts, leaf } = route;
1167
+ const paths = resolve_paths(url.pathname);
1168
+ let css = "";
1169
+ for (const node of [
1170
+ ...errors,
1171
+ ...layouts.map((l) => l?.[1]),
1172
+ leaf[1]
1173
+ ]) {
1174
+ if (typeof node !== "number") continue;
1175
+ const node_css = client.css?.[node];
1176
+ for (const css_path of node_css ?? []) css += `'${client_path(css_path, paths)}',`;
1177
+ }
1178
+ if (!css) return "";
1179
+ return `${create_client_import(client.start, paths)}.then(x => x.load_css([${css}]));\n`;
1180
+ }
1181
+ //#endregion
1182
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/app/navigation/server.js
1183
+ var afterNavigate = noop;
1184
+ disallow_on_server("disableScrollHandling", "()");
1185
+ disallow_on_server("goto");
1186
+ disallow_on_server("invalidate");
1187
+ disallow_on_server("invalidateAll", "()");
1188
+ disallow_on_server("refreshAll", "()");
1189
+ disallow_on_server("preloadCode");
1190
+ disallow_on_server("preloadData");
1191
+ disallow_on_server("pushState");
1192
+ disallow_on_server("replaceState");
1193
+ //#endregion
1194
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/components/root.svelte
1195
+ function Root($$renderer, $$props) {
1196
+ $$renderer.component(($$renderer) => {
1197
+ const { page, components, onerror, tree, form, error } = $$props;
1198
+ let mounted = false;
1199
+ let navigated = false;
1200
+ let title = "";
1201
+ afterNavigate(() => {
1202
+ if (mounted) {
1203
+ navigated = true;
1204
+ title = document.title || "untitled page";
1205
+ } else mounted = true;
1206
+ });
1207
+ function node($$renderer, n, depth) {
1208
+ const Component = derived(() => n.component);
1209
+ const Error = derived(() => n.error);
1210
+ const data = derived(() => n.data);
1211
+ function failed($$renderer, error) {
1212
+ if (Error()) {
1213
+ $$renderer.push("<!--[-->");
1214
+ Error()($$renderer, { error });
1215
+ $$renderer.push("<!--]-->");
1216
+ } else {
1217
+ $$renderer.push("<!--[!-->");
1218
+ $$renderer.push("<!--]-->");
1219
+ }
1220
+ }
1221
+ $$renderer.boundary({ failed: Error() ? failed : void 0 }, ($$renderer) => {
1222
+ $$renderer.push(`<!--[-->`);
1223
+ if (n.child) {
1224
+ $$renderer.push("<!--[0-->");
1225
+ if (Component()) {
1226
+ $$renderer.push("<!--[-->");
1227
+ Component()($$renderer, {
1228
+ data: data(),
1229
+ form,
1230
+ params: page.params,
1231
+ children: ($$renderer) => {
1232
+ node($$renderer, n.child, depth + 1);
1233
+ },
1234
+ $$slots: { default: true }
1235
+ });
1236
+ $$renderer.push("<!--]-->");
1237
+ } else {
1238
+ $$renderer.push("<!--[!-->");
1239
+ $$renderer.push("<!--]-->");
1240
+ }
1241
+ } else {
1242
+ $$renderer.push("<!--[-1-->");
1243
+ if (Component()) {
1244
+ $$renderer.push("<!--[-->");
1245
+ Component()($$renderer, {
1246
+ data: data(),
1247
+ form,
1248
+ params: page.params,
1249
+ error
1250
+ });
1251
+ $$renderer.push("<!--]-->");
1252
+ } else {
1253
+ $$renderer.push("<!--[!-->");
1254
+ $$renderer.push("<!--]-->");
1255
+ }
1256
+ }
1257
+ $$renderer.push(`<!--]-->`);
1258
+ $$renderer.push(`<!--]-->`);
1259
+ });
1260
+ }
1261
+ node($$renderer, tree, 0);
1262
+ $$renderer.push(`<!----> `);
1263
+ if (mounted) {
1264
+ $$renderer.push(`<!--[0--><div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px">`);
1265
+ if (navigated) $$renderer.push(`<!--[0-->${escape_html$1(title)}`);
1266
+ else $$renderer.push("<!--[-1-->");
1267
+ $$renderer.push(`<!--]--></div>`);
1268
+ } else $$renderer.push("<!--[-1-->");
1269
+ $$renderer.push(`<!--]-->`);
1270
+ });
1271
+ }
1272
+ //#endregion
1273
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/props.svelte.js
1274
+ var Props = class {
1275
+ /** @type {Page} */
1276
+ page;
1277
+ /**
1278
+ * An array of the `+layout.svelte` and `+page.svelte` component instances
1279
+ * that currently live on the page — used for capturing and restoring snapshots.
1280
+ * It's updated/manipulated through `bind:this` in `Root.svelte`.
1281
+ * @type {Array<Record<string, any>>}
1282
+ * @deprecated only used for `export const snapshot` — TODO 4.0 get rid
1283
+ */
1284
+ components = [];
1285
+ /** @type {any} */
1286
+ form;
1287
+ /** @type {App.Error | undefined} */
1288
+ error;
1289
+ /** @type {RenderNode} */
1290
+ tree;
1291
+ /** @type {(error: unknown, reset: () => void) => void} */
1292
+ onerror;
1293
+ /**
1294
+ * @param {{
1295
+ * page: Page;
1296
+ * tree: RenderNode;
1297
+ * form: any;
1298
+ * error: App.Error | undefined;
1299
+ * onerror?: (error: unknown, reset: () => void) => void;
1300
+ * }} props
1301
+ */
1302
+ constructor({ page, tree, form, error, onerror = noop }) {
1303
+ this.page = page;
1304
+ this.tree = tree;
1305
+ this.onerror = onerror;
1306
+ this.form = form;
1307
+ this.error = error;
1308
+ }
1309
+ };
1310
+ var RenderNode = class {
1311
+ /** @type {Component} */
1312
+ component;
1313
+ /** @type {Component | undefined} */
1314
+ error;
1315
+ /** @type {Record<string, any>} */
1316
+ data = {};
1317
+ /** @type {RenderNode | undefined} */
1318
+ child;
1319
+ /**
1320
+ *
1321
+ * @param {Component} component
1322
+ * @param {Component | undefined} error
1323
+ */
1324
+ constructor(component, error) {
1325
+ this.component = component;
1326
+ this.error = error;
1327
+ }
1328
+ };
1329
+ //#endregion
1330
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/render.js
1331
+ /** @import { Component } from 'svelte'; */
1332
+ /** @import { SyncRenderOutput } from 'svelte/server' */
1333
+ /**
1334
+ * Creates the HTML response.
1335
+ * @param {{
1336
+ * branch: Array<import('./types.js').Loaded>;
1337
+ * fetched: Array<import('./types.js').Fetched>;
1338
+ * page_config: { ssr: boolean; csr: boolean };
1339
+ * status: number;
1340
+ * error: App.Error | null;
1341
+ * event: import('@sveltejs/kit').RequestEvent;
1342
+ * state: import('types').RequestState;
1343
+ * resolve_opts: import('types').RequiredResolveOptions;
1344
+ * action_result?: import('types').ServerActionResult;
1345
+ * data_serializer: import('./types.js').ServerDataSerializer;
1346
+ * error_components?: Array<import('svelte').Component | undefined>
1347
+ * }} opts
1348
+ */
1349
+ async function render_response({ branch, fetched, page_config, status, error = null, event, state, resolve_opts, action_result, data_serializer, error_components }) {
1350
+ if (state.prerendering || state.prerender_default === true) {
1351
+ if (options.csp.mode === "nonce") prerender_nonce();
1352
+ if (options.app_template_contains_nonce) prerender_template_nonce({ tag: "%sveltekit.nonce%" });
1353
+ }
1354
+ const client = manifest.client;
1355
+ const modulepreloads = new Set(client?.imports);
1356
+ const stylesheets = new Set(client?.stylesheets);
1357
+ /** @type {Map<string, import('types').FontDependency>} */
1358
+ const fonts = new Map(client?.fonts.map((font) => [font.file, font]));
1359
+ /** @type {Map<string, string>} */
1360
+ const inline_styles = /* @__PURE__ */ new Map();
1361
+ /** @type {Omit<SyncRenderOutput, 'html'>} */
1362
+ let rendered;
1363
+ const form_value = action_result?.type === "success" || action_result?.type === "failure" ? action_result.data ?? null : null;
1364
+ /** @type {string} */
1365
+ let base = "";
1366
+ /** @type {string} */
1367
+ let assets$1 = assets;
1368
+ /**
1369
+ * An expression that will evaluate in the client to determine the resolved base path.
1370
+ * We use a relative path when possible to support IPFS, the internet archive, etc.
1371
+ */
1372
+ let base_expression = s("");
1373
+ const csp = new Csp(options.csp, { prerender: !!(state.prerendering || state.prerender_default === true) });
1374
+ if (!state.prerendering?.fallback) {
1375
+ const pathname = event.isDataRequest ? add_data_suffix(event.url.pathname) : event.url.pathname;
1376
+ ({base, assets: assets$1} = resolve_paths(pathname));
1377
+ base_expression = `new URL(${s(base)}, location).pathname.slice(0, -1)`;
1378
+ }
1379
+ if (page_config.ssr) {
1380
+ const props = new Props({
1381
+ page: {
1382
+ error,
1383
+ params: event.params,
1384
+ route: event.route,
1385
+ status,
1386
+ url: event.url,
1387
+ data: {},
1388
+ form: form_value,
1389
+ shallow: null,
1390
+ state: {}
1391
+ },
1392
+ tree: new RenderNode(await branch[0].node.component?.(), void 0),
1393
+ form: form_value,
1394
+ error: error ?? void 0
1395
+ });
1396
+ let current_node = props.tree;
1397
+ let data = props.page.data;
1398
+ for (let i = 0; i < branch.length; i += 1) {
1399
+ const node = branch[i];
1400
+ data = {
1401
+ ...data,
1402
+ ...node.data
1403
+ };
1404
+ current_node.data = data;
1405
+ if (i < branch.length - 1) current_node = current_node.child = new RenderNode(await branch[i + 1].node.component?.(), error_components?.[i + 1]);
1406
+ }
1407
+ props.page.data = data;
1408
+ const render_state = {
1409
+ ...state,
1410
+ is_in_render: true
1411
+ };
1412
+ const render_opts = {
1413
+ context: /* @__PURE__ */ new Map([["__request__", { page: props.page }]]),
1414
+ csp: csp.script_needs_nonce ? { nonce: csp.nonce } : { hash: csp.script_needs_hash },
1415
+ transformError: error_components ? (e) => {
1416
+ if (isRedirect(e)) throw e;
1417
+ const handled = handle_error_and_jsonify(event, render_state, e);
1418
+ if (handled instanceof Promise) return handled.then((e) => {
1419
+ error = e;
1420
+ props.page.error = error;
1421
+ props.page.status = status = error.status;
1422
+ return error;
1423
+ });
1424
+ error = handled;
1425
+ props.page.error = error;
1426
+ props.page.status = status = error.status;
1427
+ return error;
1428
+ } : void 0
1429
+ };
1430
+ globalThis.fetch;
1431
+ try {
1432
+ rendered = await with_request_store({
1433
+ event,
1434
+ state: render_state
1435
+ }, async () => {
1436
+ return render(Root, {
1437
+ ...render_opts,
1438
+ props
1439
+ });
1440
+ });
1441
+ if (rendered.hashes) csp.add_script_hashes(rendered.hashes.script);
1442
+ } finally {}
1443
+ } else rendered = {
1444
+ head: "",
1445
+ body: "",
1446
+ hashes: { script: [] }
1447
+ };
1448
+ for (const { node } of branch) {
1449
+ for (const url of node.imports) modulepreloads.add(url);
1450
+ for (const url of node.stylesheets) stylesheets.add(url);
1451
+ for (const font of node.fonts) fonts.set(font.file, font);
1452
+ if (node.inline_styles && !client?.inline) Object.entries(await node.inline_styles()).forEach(([filename, css]) => {
1453
+ if (typeof css === "string") {
1454
+ inline_styles.set(filename, css);
1455
+ return;
1456
+ }
1457
+ inline_styles.set(filename, css(`${assets$1}/${app_dir}/immutable/assets`, assets$1));
1458
+ });
1459
+ }
1460
+ const head = new Head(rendered.head);
1461
+ let body = rendered.body;
1462
+ /** @param {string} path */
1463
+ const prefixed = (path) => client_path(path, {
1464
+ base,
1465
+ assets: assets$1
1466
+ });
1467
+ const style = client?.inline ? client.inline?.style : Array.from(inline_styles.values()).join("\n");
1468
+ if (style) {
1469
+ const attributes = [];
1470
+ if (csp.style_needs_nonce) attributes.push(`nonce="${csp.nonce}"`);
1471
+ await csp.add_style(style);
1472
+ head.add_style(style, attributes);
1473
+ }
1474
+ /**
1475
+ * see the `output.linkHeaderPreload` option for details on why we have multiple options here
1476
+ * @param {string} path
1477
+ * @param {string[]} attributes
1478
+ */
1479
+ const add_preload = (path, attributes) => {
1480
+ head.add_link_tag(path, attributes);
1481
+ };
1482
+ for (const dep of stylesheets) {
1483
+ const path = prefixed(dep);
1484
+ const attributes = ["rel=\"stylesheet\""];
1485
+ if (inline_styles.has(dep)) attributes.push("disabled", "media=\"(max-width: 0)\"");
1486
+ head.add_stylesheet(path, attributes);
1487
+ }
1488
+ for (const { file, filename } of fonts.values()) {
1489
+ const path = prefixed(file);
1490
+ if (resolve_opts.preload({
1491
+ type: "font",
1492
+ path,
1493
+ filename
1494
+ })) add_preload(path, [
1495
+ "rel=\"preload\"",
1496
+ "as=\"font\"",
1497
+ `type="font/${file.slice(file.lastIndexOf(".") + 1)}"`,
1498
+ "crossorigin"
1499
+ ]);
1500
+ }
1501
+ const global = "__sveltekit_1ddm64b";
1502
+ const { data, chunks } = data_serializer.get_data(csp);
1503
+ if (page_config.ssr && page_config.csr) body += `\n\t\t\t${fetched.map((item) => serialize_data(item, resolve_opts.filterSerializedResponseHeaders, !!(state.prerendering || state.prerender_default === true))).join("\n ")}`;
1504
+ if (page_config.csr && client) {
1505
+ const route = client.routes?.find((r) => r.id === event.route.id) ?? null;
1506
+ const load_env_eagerly = client.uses_env_dynamic_public && (state.prerendering || state.prerender_default === true);
1507
+ if (load_env_eagerly) modulepreloads.add(`${app_dir}/env.js`);
1508
+ if (!client.inline) for (const dep of modulepreloads) {
1509
+ const path = prefixed(dep);
1510
+ if (resolve_opts.preload({
1511
+ type: "js",
1512
+ path
1513
+ })) add_preload(path, ["rel=\"modulepreload\""]);
1514
+ }
1515
+ if (client.routes && state.prerendering && !state.prerendering.fallback) {
1516
+ const pathname = add_resolution_suffix(event.url.pathname);
1517
+ state.prerendering.dependencies.set(pathname, create_server_routing_response(route, event.params, new URL(pathname, event.url), client));
1518
+ if (route && !state.prerendering.resolved_route_ids.has(route.id)) {
1519
+ state.prerendering.resolved_route_ids.add(route.id);
1520
+ const id_pathname = "" + route_id_resolution_pathname(route.id);
1521
+ state.prerendering.dependencies.set(id_pathname, create_server_routing_response(route, null, new URL(id_pathname, event.url), client));
1522
+ }
1523
+ }
1524
+ const blocks = [];
1525
+ const properties = [`base: ${base_expression}`, `version: ${s("1791345699545")}`];
1526
+ if (assets) properties.push(`assets: ${s(assets)}`);
1527
+ if (client.uses_env_dynamic_public) properties.push(`env: ${load_env_eagerly ? "null" : uneval$1(rendered_env)}`);
1528
+ if (chunks) {
1529
+ blocks.push("const deferred = new Map();");
1530
+ properties.push(`defer: (id) => new Promise((fulfil, reject) => {
1531
+ deferred.set(id, { fulfil, reject });
1532
+ })`);
1533
+ let app_declaration = "";
1534
+ if (has_custom_transporters) {
1535
+ if (client.inline) app_declaration = `const app = ${global}.app.app;`;
1536
+ else if (client.app) app_declaration = `const kit = await import(${s(prefixed(client.start))});
1537
+ kit.init(${global});
1538
+ const app = await import(${s(prefixed(client.app))});`;
1539
+ else app_declaration = `const { app } = await import(${s(prefixed(client.start))});`;
1540
+ }
1541
+ const prelude = app_declaration ? `${app_declaration}
1542
+ const [data, error] = fn(app);` : `const [data, error] = fn();`;
1543
+ properties.push(`resolve: async (id, fn) => {
1544
+ ${prelude}
1545
+
1546
+ const try_to_resolve = () => {
1547
+ if (!deferred.has(id)) {
1548
+ setTimeout(try_to_resolve, 0);
1549
+ return;
1550
+ }
1551
+ const { fulfil, reject } = deferred.get(id);
1552
+ deferred.delete(id);
1553
+ if (error) reject(error);
1554
+ else fulfil(data);
1555
+ }
1556
+ try_to_resolve();
1557
+ }`);
1558
+ }
1559
+ blocks.push(`${global} = {
1560
+ ${properties.join(",\n ")}
1561
+ };`);
1562
+ const args = ["element"];
1563
+ blocks.push("const element = document.currentScript.parentElement;");
1564
+ if (page_config.ssr) {
1565
+ const serialized = {
1566
+ form: "null",
1567
+ error: "null"
1568
+ };
1569
+ if (form_value) serialized.form = uneval_action_response(form_value, event.route.id);
1570
+ if (error) serialized.error = uneval$1(error);
1571
+ const hydrate = [
1572
+ `node_ids: [${branch.map(({ node }) => node.index).join(", ")}]`,
1573
+ `data: ${data}`,
1574
+ `form: ${serialized.form}`,
1575
+ `error: ${serialized.error}`
1576
+ ];
1577
+ if (status !== 200 && !error) hydrate.push(`status: ${status}`);
1578
+ if (client.routes) {
1579
+ if (route) {
1580
+ const stringified = generate_route_object(route, event.url, client).replaceAll("\n", "\n ");
1581
+ hydrate.push(`params: ${uneval$1(event.params)}`, `server_route: ${stringified}`);
1582
+ }
1583
+ }
1584
+ const indent = " ".repeat(load_env_eagerly ? 7 : 6);
1585
+ args.push(`{\n${indent}\t${hydrate.join(`,\n${indent}\t`)}\n${indent}}`);
1586
+ }
1587
+ const remote_data = await collect_remote_data({}, event, state);
1588
+ const serialized_data = Object.keys(remote_data).length > 0 ? `${global}.data = ${uneval(remote_data)};\n\n\t\t\t\t\t\t` : "";
1589
+ const boot = client.inline ? `${client.inline.script}
1590
+
1591
+ ${serialized_data}${global}.app.start(${args.join(", ")});` : client.app ? `import(${s(prefixed(client.start))}).then(async (kit) => {
1592
+ kit.init(${global});
1593
+ const app = await import(${s(prefixed(client.app))});
1594
+ ${serialized_data}kit.start(app, ${args.join(", ")});
1595
+ });` : `import(${s(prefixed(client.start))}).then((app) => {
1596
+ ${serialized_data}app.start(${args.join(", ")})
1597
+ });`;
1598
+ if (load_env_eagerly) blocks.push(`import(${s(`${base}/${app_dir}/env.js`)}).then(({ env }) => {
1599
+ ${global}.env = env;
1600
+
1601
+ ${boot.replace(/\n/g, "\n ")}
1602
+ });`);
1603
+ else blocks.push(boot);
1604
+ const init_app = `
1605
+ {
1606
+ ${blocks.join("\n\n ")}
1607
+ }
1608
+ `;
1609
+ await csp.add_script(init_app);
1610
+ body += `\n\t\t\t<script${csp.script_needs_nonce ? ` nonce="${csp.nonce}"` : ""}>${init_app}<\/script>\n\t\t`;
1611
+ }
1612
+ const headers = new Headers({
1613
+ "x-sveltekit-page": "true",
1614
+ "content-type": "text/html"
1615
+ });
1616
+ if (state.prerendering || state.prerender_default === true) {
1617
+ const csp_headers = csp.csp_provider.get_meta();
1618
+ if (csp_headers) head.add_http_equiv(csp_headers);
1619
+ if (state.prerendering?.cache) head.add_http_equiv(`<meta http-equiv="cache-control" content="${escape_html(state.prerendering.cache, true)}">`);
1620
+ } else {
1621
+ const csp_header = csp.csp_provider.get_header();
1622
+ if (csp_header) headers.set("content-security-policy", csp_header);
1623
+ const report_only_header = csp.report_only_provider.get_header();
1624
+ if (report_only_header) headers.set("content-security-policy-report-only", report_only_header);
1625
+ }
1626
+ const html = options.templates.app({
1627
+ head: head.build(),
1628
+ body,
1629
+ assets: assets$1,
1630
+ nonce: csp.nonce,
1631
+ env: explicit_public_env
1632
+ });
1633
+ const transformed = await resolve_opts.transformPageChunk({
1634
+ html,
1635
+ done: true
1636
+ }) || "";
1637
+ if (!chunks) headers.set("etag", `"${hash(transformed)}"`);
1638
+ return chunks ? new Response(stream_text(transformed + "\n", chunks), {
1639
+ status,
1640
+ headers
1641
+ }) : text(transformed, {
1642
+ status,
1643
+ headers
1644
+ });
1645
+ }
1646
+ var Head = class {
1647
+ #rendered;
1648
+ /** @type {string[]} */
1649
+ #http_equiv = [];
1650
+ /** @type {string[]} */
1651
+ #link_tags = [];
1652
+ /** @type {string[]} */
1653
+ #style_tags = [];
1654
+ /** @type {string[]} */
1655
+ #stylesheet_links = [];
1656
+ /**
1657
+ * @param {string} rendered
1658
+ */
1659
+ constructor(rendered) {
1660
+ this.#rendered = rendered;
1661
+ }
1662
+ build() {
1663
+ return [
1664
+ ...this.#http_equiv,
1665
+ ...this.#link_tags,
1666
+ this.#rendered,
1667
+ ...this.#style_tags,
1668
+ ...this.#stylesheet_links
1669
+ ].join("\n ");
1670
+ }
1671
+ /**
1672
+ * @param {string} style
1673
+ * @param {string[]} attributes
1674
+ */
1675
+ add_style(style, attributes) {
1676
+ this.#style_tags.push(`<style${attributes.length ? " " + attributes.join(" ") : ""}>${style}</style>`);
1677
+ }
1678
+ /**
1679
+ * @param {string} href
1680
+ * @param {string[]} attributes
1681
+ */
1682
+ add_stylesheet(href, attributes) {
1683
+ this.#stylesheet_links.push(`<link href="${href}" ${attributes.join(" ")}>`);
1684
+ }
1685
+ /**
1686
+ * @param {string} href
1687
+ * @param {string[]} attributes
1688
+ */
1689
+ add_link_tag(href, attributes) {
1690
+ this.#link_tags.push(`<link href="${href}" ${attributes.join(" ")}>`);
1691
+ }
1692
+ /** @param {string} tag */
1693
+ add_http_equiv(tag) {
1694
+ this.#http_equiv.push(tag);
1695
+ }
1696
+ };
1697
+ //#endregion
1698
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/format.js
1699
+ /**
1700
+ * Joins a list as `a`, `a or b` or `a, b or c`, for use in diagnostics
1701
+ * @param {string[]} items
1702
+ */
1703
+ function join_or(items) {
1704
+ return items.length > 1 ? `${items.slice(0, -1).join(", ")} or ${items.at(-1)}` : items[0];
1705
+ }
1706
+ //#endregion
1707
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/exports.js
1708
+ /**
1709
+ * @param {Set<string>} expected
1710
+ */
1711
+ function validator(expected) {
1712
+ /**
1713
+ * @param {any} module
1714
+ * @param {string} [file]
1715
+ */
1716
+ function validate(module, file) {
1717
+ if (!module) return;
1718
+ for (const key in module) {
1719
+ if (key[0] === "_" || expected.has(key)) continue;
1720
+ const locations = valid_locations(key, file?.slice(file.lastIndexOf(".")));
1721
+ if (locations.length > 0) invalid_export_location({
1722
+ key,
1723
+ locations: join_or(locations),
1724
+ file: file || void 0
1725
+ });
1726
+ invalid_export({
1727
+ key,
1728
+ exports: [...expected.values()].join(", "),
1729
+ file: file || void 0
1730
+ });
1731
+ }
1732
+ }
1733
+ return validate;
1734
+ }
1735
+ /**
1736
+ * Returns the route files in which `key` is a valid export
1737
+ * @param {string} key
1738
+ * @param {string} ext
1739
+ * @returns {string[]}
1740
+ */
1741
+ function valid_locations(key, ext = ".js") {
1742
+ const locations = [];
1743
+ if (valid_layout_exports.has(key)) locations.push(`+layout${ext}`);
1744
+ if (valid_page_exports.has(key)) locations.push(`+page${ext}`);
1745
+ if (valid_layout_server_exports.has(key)) locations.push(`+layout.server${ext}`);
1746
+ if (valid_page_server_exports.has(key)) locations.push(`+page.server${ext}`);
1747
+ if (valid_server_exports.has(key)) locations.push(`+server${ext}`);
1748
+ return locations;
1749
+ }
1750
+ var valid_layout_exports = /* @__PURE__ */ new Set([
1751
+ "load",
1752
+ "prerender",
1753
+ "csr",
1754
+ "ssr",
1755
+ "trailingSlash",
1756
+ "config"
1757
+ ]);
1758
+ var valid_page_exports = /* @__PURE__ */ new Set([...valid_layout_exports, "entries"]);
1759
+ var valid_layout_server_exports = /* @__PURE__ */ new Set([...valid_layout_exports]);
1760
+ var valid_page_server_exports = /* @__PURE__ */ new Set([
1761
+ ...valid_layout_server_exports,
1762
+ "actions",
1763
+ "entries"
1764
+ ]);
1765
+ var valid_server_exports = /* @__PURE__ */ new Set([
1766
+ "GET",
1767
+ "POST",
1768
+ "PATCH",
1769
+ "PUT",
1770
+ "DELETE",
1771
+ "OPTIONS",
1772
+ "HEAD",
1773
+ "QUERY",
1774
+ "fallback",
1775
+ "prerender",
1776
+ "trailingSlash",
1777
+ "config",
1778
+ "entries"
1779
+ ]);
1780
+ var validate_layout_exports = validator(valid_layout_exports);
1781
+ var validate_page_exports = validator(valid_page_exports);
1782
+ var validate_layout_server_exports = validator(valid_layout_server_exports);
1783
+ var validate_page_server_exports = validator(valid_page_server_exports);
1784
+ //#endregion
1785
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/utils/page_nodes.js
1786
+ /** @import { UniversalNode, ServerNode } from 'types' */
1787
+ var PageNodes = class {
1788
+ /** All layout nodes and the page node, if any */
1789
+ data;
1790
+ /**
1791
+ * @param {Array<import('types').SSRNode | undefined>} nodes
1792
+ */
1793
+ constructor(nodes) {
1794
+ this.data = nodes;
1795
+ }
1796
+ layouts() {
1797
+ return this.data.slice(0, -1);
1798
+ }
1799
+ page() {
1800
+ return this.data.at(-1);
1801
+ }
1802
+ validate() {
1803
+ for (const layout of this.layouts()) if (layout) {
1804
+ validate_layout_server_exports(layout.server, layout.server_id);
1805
+ validate_layout_exports(layout.universal, layout.universal_id);
1806
+ }
1807
+ const page = this.page();
1808
+ if (page) {
1809
+ validate_page_server_exports(page.server, page.server_id);
1810
+ validate_page_exports(page.universal, page.universal_id);
1811
+ }
1812
+ }
1813
+ /**
1814
+ * @template {'prerender' | 'ssr' | 'csr' | 'trailingSlash'} Option
1815
+ * @param {Option} option
1816
+ * @returns {(UniversalNode | ServerNode)[Option] | undefined}
1817
+ */
1818
+ #get_option(option) {
1819
+ /** @typedef {(UniversalNode | ServerNode)[Option]} Value */
1820
+ return this.data.reduce((value, node) => {
1821
+ return node?.universal?.[option] ?? node?.server?.[option] ?? value;
1822
+ }, void 0);
1823
+ }
1824
+ csr() {
1825
+ return this.#get_option("csr") ?? true;
1826
+ }
1827
+ ssr() {
1828
+ return this.#get_option("ssr") ?? true;
1829
+ }
1830
+ prerender() {
1831
+ return this.#get_option("prerender") ?? false;
1832
+ }
1833
+ trailing_slash() {
1834
+ return this.#get_option("trailingSlash") ?? "never";
1835
+ }
1836
+ get_config() {
1837
+ /** @type {Record<string, any>} */
1838
+ let current = {};
1839
+ for (const node of this.data) {
1840
+ if (!node?.universal?.config && !node?.server?.config) continue;
1841
+ current = {
1842
+ ...current,
1843
+ ...node?.server?.config,
1844
+ ...node?.universal?.config
1845
+ };
1846
+ }
1847
+ return Object.keys(current).length ? current : void 0;
1848
+ }
1849
+ should_prerender_data() {
1850
+ return this.data.some((node) => node?.server?.load || node?.server?.trailingSlash !== void 0);
1851
+ }
1852
+ };
1853
+ //#endregion
1854
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/respond_with_error.js
1855
+ /**
1856
+ * @typedef {import('./types.js').Loaded} Loaded
1857
+ */
1858
+ /**
1859
+ * @param {{
1860
+ * event: import('@sveltejs/kit').RequestEvent;
1861
+ * state: import('types').RequestState;
1862
+ * error: unknown;
1863
+ * resolve_opts: import('types').RequiredResolveOptions;
1864
+ * }} opts
1865
+ */
1866
+ async function respond_with_error({ event, state, error, resolve_opts }) {
1867
+ if (event.request.headers.get("x-sveltekit-error")) {
1868
+ const transformed = await handle_error_and_jsonify(event, state, error);
1869
+ return static_error_page(transformed.status, transformed.message);
1870
+ }
1871
+ /** @type {import('./types.js').Fetched[]} */
1872
+ const fetched = [];
1873
+ try {
1874
+ const branch = [];
1875
+ const default_layout = await manifest.nodes[0]();
1876
+ const nodes = new PageNodes([default_layout]);
1877
+ const ssr = nodes.ssr();
1878
+ const csr = nodes.csr();
1879
+ const data_serializer = server_data_serializer(event, state);
1880
+ const transformed = await handle_error_and_jsonify(event, state, error);
1881
+ if (ssr) {
1882
+ state.error = true;
1883
+ const server_data_promise = load_server_data({
1884
+ event,
1885
+ state,
1886
+ node: default_layout,
1887
+ parent: async () => ({})
1888
+ });
1889
+ const server_data = await server_data_promise;
1890
+ data_serializer.add_node(0, server_data);
1891
+ const data = await load_data({
1892
+ event,
1893
+ state,
1894
+ fetched,
1895
+ node: default_layout,
1896
+ parent: async () => ({}),
1897
+ resolve_opts,
1898
+ server_data_promise,
1899
+ csr
1900
+ });
1901
+ branch.push({
1902
+ node: default_layout,
1903
+ server_data,
1904
+ data
1905
+ }, {
1906
+ node: await manifest.nodes[1](),
1907
+ data: null,
1908
+ server_data: null
1909
+ });
1910
+ }
1911
+ return await render_response({
1912
+ page_config: {
1913
+ ssr,
1914
+ csr
1915
+ },
1916
+ status: transformed.status,
1917
+ error: transformed,
1918
+ branch,
1919
+ error_components: [],
1920
+ fetched,
1921
+ event,
1922
+ state,
1923
+ resolve_opts,
1924
+ data_serializer
1925
+ });
1926
+ } catch (e) {
1927
+ if (e instanceof Redirect) return redirect_response(e.status, e.location);
1928
+ const transformed = await handle_error_and_jsonify(event, state, e);
1929
+ return static_error_page(transformed.status, transformed.message);
1930
+ }
1931
+ }
1932
+ /**
1933
+ * Return as a response that renders the error.html
1934
+ *
1935
+ * @param {number} status
1936
+ * @param {string} message
1937
+ */
1938
+ function static_error_page(status, message) {
1939
+ let page = options.templates.error({
1940
+ status,
1941
+ message: escape_html(message)
1942
+ });
1943
+ return text(page, {
1944
+ headers: { "content-type": "text/html; charset=utf-8" },
1945
+ status
1946
+ });
1947
+ }
1948
+ /**
1949
+ * @param {import('@sveltejs/kit').RequestEvent} event
1950
+ * @param {import('types').RequestState} state
1951
+ * @param {unknown} error
1952
+ */
1953
+ async function handle_fatal_error(event, state, error) {
1954
+ const body = await handle_error_and_jsonify(event, state, error);
1955
+ const status = body.status;
1956
+ const type = negotiate(event.request.headers.get("accept") || "text/html", ["application/json", "text/html"]);
1957
+ if (event.isDataRequest || type === "application/json") return Response.json(body, { status });
1958
+ return static_error_page(status, body.message);
1959
+ }
1960
+ //#endregion
1961
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/page/index.js
1962
+ /** @import { RequestEvent } from '@sveltejs/kit' */
1963
+ /** @import { PageNodeIndexes, RequestState, RequiredResolveOptions, ServerDataNode, SSRNode } from 'types' */
1964
+ /**
1965
+ * The maximum request depth permitted before assuming we're stuck in an infinite loop
1966
+ */
1967
+ var MAX_DEPTH = 10;
1968
+ /**
1969
+ * @param {RequestEvent} event
1970
+ * @param {RequestState} state
1971
+ * @param {PageNodeIndexes} page
1972
+ * @param {import('../../../utils/page_nodes.js').PageNodes} nodes
1973
+ * @param {RequiredResolveOptions} resolve_opts
1974
+ * @returns {Promise<Response>}
1975
+ */
1976
+ async function render_page(event, state, page, nodes, resolve_opts) {
1977
+ if (state.depth > MAX_DEPTH) return text(`Not found: ${event.url.pathname}`, { status: 404 });
1978
+ if (is_action_json_request(event)) {
1979
+ const node = await manifest.nodes[page.leaf]();
1980
+ return handle_action_json_request(event, state, node?.server);
1981
+ }
1982
+ try {
1983
+ const leaf_node = nodes.page();
1984
+ let status = 200;
1985
+ /** @type {import('types').ServerActionResult | undefined} */
1986
+ let action_result = void 0;
1987
+ if (is_action_request(event)) {
1988
+ const remote_id = get_remote_action(event.url);
1989
+ if (remote_id) action_result = await handle_remote_form_post(event, state, remote_id);
1990
+ else action_result = await handle_action_request(event, state, leaf_node.server);
1991
+ if (action_result?.type === "redirect") return redirect_response(action_result.status, action_result.location);
1992
+ if (action_result?.type === "error") status = get_status(action_result.error);
1993
+ if (action_result?.type === "failure") status = action_result.status;
1994
+ }
1995
+ const should_prerender = nodes.prerender();
1996
+ if (should_prerender) {
1997
+ if (leaf_node.server?.actions) prerender_actions();
1998
+ } else if (state.prerendering) return new Response(void 0, { status: 204 });
1999
+ state.prerender_default = should_prerender;
2000
+ const should_prerender_data = nodes.should_prerender_data();
2001
+ const data_pathname = add_data_suffix(event.url.pathname);
2002
+ /** @type {import('./types.js').Fetched[]} */
2003
+ const fetched = [];
2004
+ const ssr = nodes.ssr();
2005
+ const csr = nodes.csr();
2006
+ if (ssr === false && !((state.prerendering || state.prerender_default === true) && should_prerender_data)) return await render_response({
2007
+ branch: compact(nodes.data).map((node) => {
2008
+ return {
2009
+ node,
2010
+ data: null,
2011
+ server_data: null
2012
+ };
2013
+ }),
2014
+ fetched,
2015
+ page_config: {
2016
+ ssr: false,
2017
+ csr
2018
+ },
2019
+ status,
2020
+ error: null,
2021
+ event,
2022
+ state,
2023
+ resolve_opts,
2024
+ data_serializer: server_data_serializer(event, state)
2025
+ });
2026
+ /** @type {Array<import('./types.js').Loaded | null>} */
2027
+ const branch = [];
2028
+ /** @type {Error | null} */
2029
+ let load_error = null;
2030
+ const data_serializer = server_data_serializer(event, state);
2031
+ const data_serializer_json = (state.prerendering || state.prerender_default === true) && should_prerender_data ? server_data_serializer_json(event, state) : null;
2032
+ /** @type {Array<Promise<ServerDataNode | null>>} */
2033
+ const server_promises = nodes.data.map((node, i) => {
2034
+ if (load_error) throw load_error;
2035
+ return Promise.resolve().then(async () => {
2036
+ try {
2037
+ if (node === leaf_node && action_result?.type === "error") throw action_result.error;
2038
+ const server_data = await load_server_data({
2039
+ event,
2040
+ state,
2041
+ node,
2042
+ parent: async () => {
2043
+ /** @type {Record<string, any>} */
2044
+ const data = {};
2045
+ for (let j = 0; j < i; j += 1) {
2046
+ const parent = await server_promises[j];
2047
+ if (parent) Object.assign(data, parent.data);
2048
+ }
2049
+ return data;
2050
+ }
2051
+ });
2052
+ if (node) data_serializer.add_node(i, server_data);
2053
+ data_serializer_json?.add_node(i, server_data);
2054
+ return server_data;
2055
+ } catch (e) {
2056
+ load_error = e;
2057
+ throw load_error;
2058
+ }
2059
+ });
2060
+ });
2061
+ /** @type {Array<Promise<Record<string, any> | null>>} */
2062
+ const load_promises = nodes.data.map((node, i) => {
2063
+ if (load_error) throw load_error;
2064
+ return Promise.resolve().then(async () => {
2065
+ try {
2066
+ return await load_data({
2067
+ event,
2068
+ state,
2069
+ fetched,
2070
+ node,
2071
+ parent: async () => {
2072
+ const data = {};
2073
+ for (let j = 0; j < i; j += 1) Object.assign(data, await load_promises[j]);
2074
+ return data;
2075
+ },
2076
+ resolve_opts,
2077
+ server_data_promise: server_promises[i],
2078
+ csr
2079
+ });
2080
+ } catch (e) {
2081
+ load_error = e;
2082
+ throw load_error;
2083
+ }
2084
+ });
2085
+ });
2086
+ for (const p of server_promises) p.catch(noop);
2087
+ for (const p of load_promises) p.catch(noop);
2088
+ for (let i = 0; i < nodes.data.length; i += 1) {
2089
+ const node = nodes.data[i];
2090
+ if (node) try {
2091
+ const server_data = await server_promises[i];
2092
+ const data = await load_promises[i];
2093
+ branch.push({
2094
+ node,
2095
+ server_data,
2096
+ data
2097
+ });
2098
+ } catch (e) {
2099
+ const err = normalize_error(e);
2100
+ if (err instanceof Redirect) {
2101
+ if (state.prerendering && should_prerender_data) {
2102
+ const body = JSON.stringify({
2103
+ type: "redirect",
2104
+ status: err.status,
2105
+ location: err.location
2106
+ });
2107
+ state.prerendering.dependencies.set(data_pathname, {
2108
+ response: text(body),
2109
+ body
2110
+ });
2111
+ }
2112
+ return redirect_response(err.status, err.location);
2113
+ }
2114
+ const error = await handle_error_and_jsonify(event, state, err);
2115
+ const status = error.status;
2116
+ for (const { error: index, idx } of nearest_error_pages(i, branch, page.errors)) {
2117
+ const node = await manifest.nodes[index]();
2118
+ data_serializer.set_max_nodes(idx);
2119
+ const layouts = compact(branch.slice(0, idx));
2120
+ const nodes = new PageNodes(layouts.map((layout) => layout.node));
2121
+ const error_branch = layouts.concat({
2122
+ node,
2123
+ data: null,
2124
+ server_data: null
2125
+ });
2126
+ return await render_response({
2127
+ event,
2128
+ state,
2129
+ resolve_opts,
2130
+ page_config: {
2131
+ ssr: nodes.ssr(),
2132
+ csr: nodes.csr()
2133
+ },
2134
+ status,
2135
+ error,
2136
+ error_components: await load_error_components(ssr, error_branch, page),
2137
+ branch: error_branch,
2138
+ fetched,
2139
+ data_serializer
2140
+ });
2141
+ }
2142
+ return static_error_page(status, error.message);
2143
+ }
2144
+ else branch.push(null);
2145
+ }
2146
+ if (state.prerendering && data_serializer_json) {
2147
+ let { data, chunks } = data_serializer_json.get_data();
2148
+ if (chunks) for await (const chunk of chunks) data += chunk;
2149
+ state.prerendering.dependencies.set(data_pathname, {
2150
+ response: text(data),
2151
+ body: data
2152
+ });
2153
+ }
2154
+ return await render_response({
2155
+ event,
2156
+ state,
2157
+ resolve_opts,
2158
+ page_config: {
2159
+ csr,
2160
+ ssr
2161
+ },
2162
+ status,
2163
+ error: null,
2164
+ branch: compact(branch),
2165
+ action_result,
2166
+ fetched,
2167
+ data_serializer: !ssr ? server_data_serializer(event, state) : data_serializer,
2168
+ error_components: await load_error_components(ssr, branch, page)
2169
+ });
2170
+ } catch (e) {
2171
+ if (e instanceof Redirect) return redirect_response(e.status, e.location);
2172
+ return await respond_with_error({
2173
+ event,
2174
+ state,
2175
+ error: e,
2176
+ resolve_opts
2177
+ });
2178
+ }
2179
+ }
2180
+ /**
2181
+ * @param {boolean} ssr
2182
+ * @param {Array<import('./types.js').Loaded | null>} branch
2183
+ * @param {PageNodeIndexes} page
2184
+ */
2185
+ function load_error_components(ssr, branch, page) {
2186
+ if (!ssr) return void 0;
2187
+ return build_error_chain(branch, page.errors, (idx) => manifest.nodes[idx]?.().then((e) => e.component?.()));
2188
+ }
2189
+ //#endregion
2190
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/csrf.js
2191
+ var mutating_form_methods = /* @__PURE__ */ new Set([
2192
+ "POST",
2193
+ "PUT",
2194
+ "PATCH",
2195
+ "DELETE"
2196
+ ]);
2197
+ /**
2198
+ * The origin SvelteKit treats as "self" when validating the `Origin` header on
2199
+ * cross-site requests.
2200
+ *
2201
+ * By default (`paths.origin` is `undefined`), SvelteKit derives the origin
2202
+ * from `request.url` (which is set by the adapter, and ultimately by the
2203
+ * platform). When `paths.origin` is configured — for example so that a preview
2204
+ * deployment whose URL isn't known at build time, or an app behind a reverse
2205
+ * proxy, can declare a canonical origin — that value takes precedence.
2206
+ *
2207
+ * @param {string | undefined} paths_origin the configured `kit.paths.origin`
2208
+ * @param {string} url_origin the origin derived from `request.url`
2209
+ * @returns {string}
2210
+ */
2211
+ function get_self_origin(paths_origin, url_origin) {
2212
+ return paths_origin || url_origin;
2213
+ }
2214
+ /**
2215
+ * Determines whether a non-remote request should be rejected as a cross-site
2216
+ * request forgery (CSRF). Used by `respond.js` to gate form `POST`/`PUT`/
2217
+ * `PATCH`/`DELETE` requests whose `Origin` header doesn't match the app's
2218
+ * self-origin (and isn't in `trusted_origins`).
2219
+ *
2220
+ * @param {{
2221
+ * request: Request;
2222
+ * request_origin: string | null;
2223
+ * self_origin: string;
2224
+ * trusted_origins: string[];
2225
+ * }} input
2226
+ * @returns {boolean}
2227
+ */
2228
+ function is_csrf_forbidden({ request, request_origin, self_origin, trusted_origins }) {
2229
+ return (!request.headers.get("content-type") || is_form_content_type(request)) && mutating_form_methods.has(request.method) && request_origin !== self_origin && (!request_origin || !trusted_origins.includes(request_origin));
2230
+ }
2231
+ /**
2232
+ * Determines whether a remote-function request should be rejected as cross-site.
2233
+ *
2234
+ * Unlike form submissions, remote functions accept any content type (e.g.
2235
+ * `application/json`), so the check is solely on the request method and origin:
2236
+ * a non-`GET` request is forbidden when its `Origin` header doesn't match the
2237
+ * app's self-origin. Unlike `is_csrf_forbidden`, entries in `trusted_origins`
2238
+ * are *not* honoured — remote function endpoints are an implementation detail,
2239
+ * not a public API, so cross-origin calls are forbidden regardless.
2240
+ *
2241
+ * @param {{
2242
+ * request: Request;
2243
+ * request_origin: string | null;
2244
+ * self_origin: string;
2245
+ * }} input
2246
+ * @returns {boolean}
2247
+ */
2248
+ function is_remote_forbidden({ request, request_origin, self_origin }) {
2249
+ return request.method !== "GET" && request_origin !== self_origin;
2250
+ }
2251
+ //#endregion
2252
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/data/index.js
2253
+ /**
2254
+ * @param {import('@sveltejs/kit').RequestEvent} event
2255
+ * @param {import('types').RequestState} state
2256
+ * @param {{ page: Pick<import('types').PageNodeIndexes, 'layouts' | 'leaf'> | null }} route
2257
+ * @param {boolean[] | undefined} invalidated_data_nodes
2258
+ * @param {import('types').TrailingSlash} trailing_slash
2259
+ * @returns {Promise<Response>}
2260
+ */
2261
+ async function render_data(event, state, route, invalidated_data_nodes, trailing_slash) {
2262
+ if (!route.page) return with_version_header(new Response(void 0, { status: 404 }));
2263
+ try {
2264
+ const node_ids = [...route.page.layouts, route.page.leaf];
2265
+ const invalidated = invalidated_data_nodes ?? node_ids.map(() => true);
2266
+ let aborted = false;
2267
+ const url = new URL(event.url);
2268
+ url.pathname = normalize_path(url.pathname, trailing_slash);
2269
+ const new_event = {
2270
+ ...event,
2271
+ url
2272
+ };
2273
+ const functions = node_ids.map((n, i) => {
2274
+ return once(async () => {
2275
+ try {
2276
+ if (aborted) return { type: "skip" };
2277
+ const node = n == void 0 ? n : await manifest.nodes[n]();
2278
+ return load_server_data({
2279
+ event: new_event,
2280
+ state,
2281
+ node,
2282
+ parent: async () => {
2283
+ /** @type {Record<string, any>} */
2284
+ const data = {};
2285
+ for (let j = 0; j < i; j += 1) {
2286
+ const parent = await functions[j]();
2287
+ if (parent) Object.assign(data, parent.data);
2288
+ }
2289
+ return data;
2290
+ }
2291
+ });
2292
+ } catch (e) {
2293
+ aborted = true;
2294
+ throw e;
2295
+ }
2296
+ });
2297
+ });
2298
+ const promises = functions.map(async (fn, i) => {
2299
+ if (!invalidated[i]) return { type: "skip" };
2300
+ return fn();
2301
+ });
2302
+ const data_serializer = server_data_serializer_json(event, state);
2303
+ await Promise.all(promises.map(async (p, i) => {
2304
+ const node = await p.catch(async (error) => {
2305
+ if (error instanceof Redirect) throw error;
2306
+ return {
2307
+ type: "error",
2308
+ error: await handle_error_and_jsonify(event, state, error)
2309
+ };
2310
+ });
2311
+ data_serializer.add_node(i, node);
2312
+ }));
2313
+ const { data, chunks } = data_serializer.get_data();
2314
+ if (!chunks) return json_response(data);
2315
+ return with_version_header(new Response(stream_text(data, chunks), { headers: {
2316
+ "content-type": "text/sveltekit-data",
2317
+ "cache-control": "private, no-store"
2318
+ } }));
2319
+ } catch (e) {
2320
+ const error = normalize_error(e);
2321
+ if (error instanceof Redirect) return redirect_json_response(error);
2322
+ else {
2323
+ const transformed = await handle_error_and_jsonify(event, state, error);
2324
+ return json_response(transformed, transformed.status);
2325
+ }
2326
+ }
2327
+ }
2328
+ /**
2329
+ * @param {Record<string, any> | string} json
2330
+ * @param {number} [status]
2331
+ */
2332
+ function json_response(json, status = 200) {
2333
+ return with_version_header(text(typeof json === "string" ? json : JSON.stringify(json), {
2334
+ status,
2335
+ headers: {
2336
+ "content-type": "application/json",
2337
+ "cache-control": "private, no-store"
2338
+ }
2339
+ }));
2340
+ }
2341
+ /**
2342
+ * @param {Redirect} redirect
2343
+ */
2344
+ function redirect_json_response(redirect) {
2345
+ return json_response({
2346
+ type: "redirect",
2347
+ status: redirect.status,
2348
+ location: redirect.location
2349
+ });
2350
+ }
2351
+ //#endregion
2352
+ //#region ../../node_modules/.pnpm/cookie@2.0.1/node_modules/cookie/dist/index.js
2353
+ /**
2354
+ * RegExp to match cookie-name in RFC 6265 sec 4.1.1
2355
+ * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
2356
+ * which has been replaced by the token definition in RFC 7230 appendix B.
2357
+ *
2358
+ * cookie-name = token
2359
+ * token = 1*tchar
2360
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" /
2361
+ * "*" / "+" / "-" / "." / "^" / "_" /
2362
+ * "`" / "|" / "~" / DIGIT / ALPHA
2363
+ *
2364
+ * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191
2365
+ * Allow same range as cookie value, except `=`, which delimits end of name.
2366
+ */
2367
+ var cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
2368
+ /**
2369
+ * RegExp to match cookie-value in RFC 6265 sec 4.1.1
2370
+ *
2371
+ * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
2372
+ * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
2373
+ * ; US-ASCII characters excluding CTLs,
2374
+ * ; whitespace DQUOTE, comma, semicolon,
2375
+ * ; and backslash
2376
+ *
2377
+ * Allowing more characters: https://github.com/jshttp/cookie/issues/191
2378
+ * Comma, backslash, and DQUOTE are not part of the parsing algorithm.
2379
+ */
2380
+ var cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
2381
+ /**
2382
+ * RegExp to match domain-value in RFC 6265 sec 4.1.1
2383
+ *
2384
+ * domain-value = <subdomain>
2385
+ * ; defined in [RFC1034], Section 3.5, as
2386
+ * ; enhanced by [RFC1123], Section 2.1
2387
+ * <subdomain> = <label> | <subdomain> "." <label>
2388
+ * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
2389
+ * Labels must be 63 characters or less.
2390
+ * 'let-dig' not 'letter' in the first char, per RFC1123
2391
+ * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
2392
+ * <let-dig-hyp> = <let-dig> | "-"
2393
+ * <let-dig> = <letter> | <digit>
2394
+ * <letter> = any one of the 52 alphabetic characters A through Z in
2395
+ * upper case and a through z in lower case
2396
+ * <digit> = any one of the ten digits 0 through 9
2397
+ *
2398
+ * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
2399
+ *
2400
+ * > (Note that a leading %x2E ("."), if present, is ignored even though that
2401
+ * character is not permitted, but a trailing %x2E ("."), if present, will
2402
+ * cause the user agent to ignore the attribute.)
2403
+ */
2404
+ var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
2405
+ /**
2406
+ * RegExp to match path-value in RFC 6265 sec 4.1.1
2407
+ *
2408
+ * path-value = <any CHAR except CTLs or ";">
2409
+ * CHAR = %x01-7F
2410
+ * ; defined in RFC 5234 appendix B.1
2411
+ */
2412
+ var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
2413
+ /**
2414
+ * RegExp to match max-age-value in RFC 6265 sec 5.6.2
2415
+ */
2416
+ var maxAgeRegExp = /^-?\d+$/;
2417
+ /**
2418
+ * RegExp to match RFC 6265 cookie-octet values (without % to preserve roundtrip) that need no URL encoding.
2419
+ */
2420
+ var cookieOctetRegExp = /^[!#$&'()*+\-.\/0-9:<=>?@A-Z[\]\^_`a-z{|}~]*$/;
2421
+ var NullObject = /* @__PURE__ */ (() => {
2422
+ const C = function() {};
2423
+ C.prototype = Object.create(null);
2424
+ return C;
2425
+ })();
2426
+ /**
2427
+ * Parse a `Cookie` header.
2428
+ *
2429
+ * Parse the given cookie header string into an object
2430
+ * The object has the various cookies as keys(names) => values
2431
+ */
2432
+ function parseCookie(str, options) {
2433
+ const obj = new NullObject();
2434
+ const len = str.length;
2435
+ if (len < 2) return obj;
2436
+ const dec = options?.decode || decode;
2437
+ let index = 0;
2438
+ do {
2439
+ const eqIdx = eqIndex(str, index, len);
2440
+ if (eqIdx === len) break;
2441
+ const endIdx = endIndex(str, index, len);
2442
+ if (eqIdx > endIdx) {
2443
+ index = str.lastIndexOf(";", eqIdx - 1) + 1;
2444
+ continue;
2445
+ }
2446
+ const key = valueSlice(str, index, eqIdx);
2447
+ if (obj[key] === void 0) obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));
2448
+ index = endIdx + 1;
2449
+ } while (index < len);
2450
+ return obj;
2451
+ }
2452
+ /**
2453
+ * Serialize data into a cookie header.
2454
+ *
2455
+ * Serialize a name value pair into a cookie string suitable for
2456
+ * http headers. An optional options object specifies cookie parameters.
2457
+ *
2458
+ * stringifySetCookie({ name: 'foo', value: 'bar', httpOnly: true })
2459
+ * => "foo=bar; HttpOnly"
2460
+ */
2461
+ function stringifySetCookie(cookie, options) {
2462
+ const enc = options?.encode || defaultEncode;
2463
+ if (!cookieNameRegExp.test(cookie.name)) throw new TypeError(`argument name is invalid: ${cookie.name}`);
2464
+ const value = cookie.value == null ? "" : enc(cookie.value);
2465
+ if (!cookieValueRegExp.test(value)) throw new TypeError(`argument val is invalid: ${cookie.value}`);
2466
+ let str = cookie.name + "=" + value;
2467
+ if (cookie.maxAge !== void 0) {
2468
+ if (!Number.isInteger(cookie.maxAge)) throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);
2469
+ str += "; Max-Age=" + cookie.maxAge;
2470
+ }
2471
+ if (cookie.domain) {
2472
+ if (!domainValueRegExp.test(cookie.domain)) throw new TypeError(`option domain is invalid: ${cookie.domain}`);
2473
+ str += "; Domain=" + cookie.domain;
2474
+ }
2475
+ if (cookie.path) {
2476
+ if (!pathValueRegExp.test(cookie.path)) throw new TypeError(`option path is invalid: ${cookie.path}`);
2477
+ str += "; Path=" + cookie.path;
2478
+ }
2479
+ if (cookie.expires) {
2480
+ if (!Number.isFinite(cookie.expires.valueOf())) throw new TypeError(`option expires is invalid: ${cookie.expires}`);
2481
+ str += "; Expires=" + cookie.expires.toUTCString();
2482
+ }
2483
+ if (cookie.httpOnly) str += "; HttpOnly";
2484
+ if (cookie.secure) str += "; Secure";
2485
+ if (cookie.partitioned) str += "; Partitioned";
2486
+ if (cookie.priority) switch (typeof cookie.priority === "string" ? cookie.priority.toLowerCase() : void 0) {
2487
+ case "low":
2488
+ str += "; Priority=Low";
2489
+ break;
2490
+ case "medium":
2491
+ str += "; Priority=Medium";
2492
+ break;
2493
+ case "high":
2494
+ str += "; Priority=High";
2495
+ break;
2496
+ default: throw new TypeError(`option priority is invalid: ${cookie.priority}`);
2497
+ }
2498
+ if (cookie.sameSite) switch (typeof cookie.sameSite === "string" ? cookie.sameSite.toLowerCase() : cookie.sameSite) {
2499
+ case true:
2500
+ case "strict":
2501
+ str += "; SameSite=Strict";
2502
+ break;
2503
+ case "lax":
2504
+ str += "; SameSite=Lax";
2505
+ break;
2506
+ case "none":
2507
+ str += "; SameSite=None";
2508
+ break;
2509
+ default: throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);
2510
+ }
2511
+ return str;
2512
+ }
2513
+ /**
2514
+ * Deserialize a `Set-Cookie` header into an object.
2515
+ *
2516
+ * parseSetCookie('foo=bar; HttpOnly')
2517
+ * => { name: 'foo', value: 'bar', httpOnly: true }
2518
+ */
2519
+ function parseSetCookie(str, options) {
2520
+ const dec = options?.decode || decode;
2521
+ const len = str.length;
2522
+ const endIdx = endIndex(str, 0, len);
2523
+ let eqIdx = eqIndex(str, 0, len);
2524
+ const setCookie = eqIdx < endIdx ? {
2525
+ name: valueSlice(str, 0, eqIdx),
2526
+ value: dec(valueSlice(str, eqIdx + 1, endIdx))
2527
+ } : {
2528
+ name: "",
2529
+ value: dec(valueSlice(str, 0, endIdx))
2530
+ };
2531
+ let index = endIdx + 1;
2532
+ while (index < len) {
2533
+ const endIdx = endIndex(str, index, len);
2534
+ if (eqIdx < index) eqIdx = eqIndex(str, index, len);
2535
+ const attr = eqIdx < endIdx ? valueSlice(str, index, eqIdx) : valueSlice(str, index, endIdx);
2536
+ const val = eqIdx < endIdx ? valueSlice(str, eqIdx + 1, endIdx) : void 0;
2537
+ switch (attr.toLowerCase()) {
2538
+ case "httponly":
2539
+ setCookie.httpOnly = true;
2540
+ break;
2541
+ case "secure":
2542
+ setCookie.secure = true;
2543
+ break;
2544
+ case "partitioned":
2545
+ setCookie.partitioned = true;
2546
+ break;
2547
+ case "domain":
2548
+ setCookie.domain = val;
2549
+ break;
2550
+ case "path":
2551
+ setCookie.path = val;
2552
+ break;
2553
+ case "max-age":
2554
+ if (val && maxAgeRegExp.test(val)) setCookie.maxAge = Number(val);
2555
+ break;
2556
+ case "expires":
2557
+ if (!val) break;
2558
+ const date = new Date(val);
2559
+ if (Number.isFinite(date.valueOf())) setCookie.expires = date;
2560
+ break;
2561
+ case "priority":
2562
+ if (!val) break;
2563
+ const priority = val.toLowerCase();
2564
+ if (priority === "low" || priority === "medium" || priority === "high") setCookie.priority = priority;
2565
+ break;
2566
+ case "samesite":
2567
+ if (!val) break;
2568
+ const sameSite = val.toLowerCase();
2569
+ if (sameSite === "lax" || sameSite === "strict" || sameSite === "none") setCookie.sameSite = sameSite;
2570
+ }
2571
+ index = endIdx + 1;
2572
+ }
2573
+ return setCookie;
2574
+ }
2575
+ /**
2576
+ * Find the next `;` character, or return `len`.
2577
+ */
2578
+ function endIndex(str, min, len) {
2579
+ const index = str.indexOf(";", min);
2580
+ return index === -1 ? len : index;
2581
+ }
2582
+ /**
2583
+ * Find the next `=` character, or return `len`.
2584
+ */
2585
+ function eqIndex(str, min, len) {
2586
+ const index = str.indexOf("=", min);
2587
+ return index === -1 ? len : index;
2588
+ }
2589
+ /**
2590
+ * Slice out a value between startPod to max.
2591
+ */
2592
+ function valueSlice(str, min, max) {
2593
+ if (min === max) return "";
2594
+ let start = min;
2595
+ let end = max;
2596
+ do {
2597
+ const code = str.charCodeAt(start);
2598
+ if (code !== 32 && code !== 9) break;
2599
+ } while (++start < end);
2600
+ while (end > start) {
2601
+ const code = str.charCodeAt(end - 1);
2602
+ if (code !== 32 && code !== 9) break;
2603
+ end--;
2604
+ }
2605
+ return str.slice(start, end);
2606
+ }
2607
+ /**
2608
+ * URL-decode string value. Optimized to skip native call when no %.
2609
+ */
2610
+ function decode(str) {
2611
+ if (str.indexOf("%") === -1) return str;
2612
+ try {
2613
+ return decodeURIComponent(str);
2614
+ } catch (e) {
2615
+ return str;
2616
+ }
2617
+ }
2618
+ /**
2619
+ * URL-encode string value. Optimized to skip native call for roundtrip-safe cookie-octet values.
2620
+ */
2621
+ function defaultEncode(str) {
2622
+ return cookieOctetRegExp.test(str) ? str : encodeURIComponent(str);
2623
+ }
2624
+ /**
2625
+ * Generates a unique key for a cookie based on its domain, path, and name in
2626
+ * the format: `<domain>/<path>?<name>`.
2627
+ * If domain is undefined, it will be omitted.
2628
+ * For example: `/?name`, `example.com/foo?name`.
2629
+ *
2630
+ * @param {string | undefined} domain
2631
+ * @param {string} path
2632
+ * @param {string} name
2633
+ * @returns {string}
2634
+ */
2635
+ function generate_cookie_key(domain, path, name) {
2636
+ return `${domain || ""}${path}?${encodeURIComponent(name)}`;
2637
+ }
2638
+ /**
2639
+ * @param {Request} request
2640
+ * @param {URL} url
2641
+ */
2642
+ function get_cookies(request, url) {
2643
+ const header = request.headers.get("cookie") ?? "";
2644
+ const initial_cookies = parseCookie(header, { decode: (value) => value });
2645
+ /** @type {ReturnType<typeof parseCookie> | undefined} */
2646
+ let default_cookies;
2647
+ /**
2648
+ * The header never changes during the request, so the default-decode parse is cached
2649
+ * @param {import('cookie').ParseOptions} [opts]
2650
+ */
2651
+ function parse_header(opts) {
2652
+ return opts?.decode ? parseCookie(header, opts) : default_cookies ??= parseCookie(header);
2653
+ }
2654
+ /** @param {import('./page/types.js').Cookie} cookie */
2655
+ function matches_url(cookie) {
2656
+ return domain_matches(url.hostname, cookie.options.domain) && path_matches(url.pathname, cookie.options.path);
2657
+ }
2658
+ /** @type {string | undefined} */
2659
+ let normalized_url;
2660
+ /** @type {Map<string, import('./page/types.js').Cookie>} */
2661
+ const new_cookies = /* @__PURE__ */ new Map();
2662
+ /** @type {Omit<import('cookie').SetCookie, 'name' | 'value'>} */
2663
+ const defaults = {
2664
+ httpOnly: true,
2665
+ path: "/",
2666
+ sameSite: "lax",
2667
+ secure: !(url.hostname === "localhost" && url.protocol === "http:")
2668
+ };
2669
+ /** @type {import('@sveltejs/kit').Cookies} */
2670
+ const cookies = {
2671
+ get(name, opts) {
2672
+ /** @type {import('./page/types.js').Cookie | undefined} */
2673
+ let best_match;
2674
+ for (const c of new_cookies.values()) if (c.name === name && matches_url(c) && (!best_match || c.options.path.length > best_match.options.path.length)) best_match = c;
2675
+ if (best_match) return best_match.options.maxAge === 0 ? void 0 : best_match.value;
2676
+ return parse_header(opts)[name];
2677
+ },
2678
+ getAll(opts) {
2679
+ const cookies = { ...parse_header(opts) };
2680
+ const lookup = /* @__PURE__ */ new Map();
2681
+ for (const c of new_cookies.values()) if (matches_url(c)) {
2682
+ const existing = lookup.get(c.name);
2683
+ if (!existing || c.options.path.length > existing.options.path.length) lookup.set(c.name, c);
2684
+ }
2685
+ for (const c of lookup.values()) if (c.options.maxAge === 0) delete cookies[c.name];
2686
+ else cookies[c.name] = c.value;
2687
+ return Object.entries(cookies).filter(([, value]) => value != null).map(([name, value]) => ({
2688
+ name,
2689
+ value
2690
+ }));
2691
+ },
2692
+ set(name, value, options) {
2693
+ set_internal(name, value, {
2694
+ ...defaults,
2695
+ ...options
2696
+ });
2697
+ },
2698
+ delete(name, options) {
2699
+ cookies.set(name, "", {
2700
+ ...options,
2701
+ maxAge: 0
2702
+ });
2703
+ },
2704
+ parse: parseSetCookie,
2705
+ serialize(name, value, { encode, ...options } = {}) {
2706
+ let path = options.path ?? "/";
2707
+ if (!options.domain || options.domain === url.hostname) {
2708
+ if (!normalized_url) cookies_serialize_before_route();
2709
+ path = resolve(normalized_url, path);
2710
+ }
2711
+ return stringifySetCookie({
2712
+ name,
2713
+ value,
2714
+ ...defaults,
2715
+ ...options,
2716
+ path
2717
+ }, { encode });
2718
+ }
2719
+ };
2720
+ /**
2721
+ * @param {URL} destination
2722
+ * @param {string | null} header
2723
+ */
2724
+ function get_cookie_header(destination, header) {
2725
+ /** @type {Record<string, string>} */
2726
+ const combined_cookies = { ...initial_cookies };
2727
+ for (const cookie of new_cookies.values()) {
2728
+ if (!domain_matches(destination.hostname, cookie.options.domain)) continue;
2729
+ if (!path_matches(destination.pathname, cookie.options.path)) continue;
2730
+ const encoder = cookie.options.encode || encodeURIComponent;
2731
+ combined_cookies[cookie.name] = encoder(cookie.value);
2732
+ }
2733
+ if (header) {
2734
+ const parsed = parseCookie(header, { decode: (value) => value });
2735
+ for (const name in parsed) combined_cookies[name] = parsed[name];
2736
+ }
2737
+ return Object.entries(combined_cookies).map(([name, value]) => `${name}=${value}`).join("; ");
2738
+ }
2739
+ /** @type {Array<() => void>} */
2740
+ const internal_queue = [];
2741
+ /**
2742
+ * @param {string} name
2743
+ * @param {string} value
2744
+ * @param {import('cookie').SerializeOptions} options
2745
+ */
2746
+ function set_internal(name, value, options) {
2747
+ if (!normalized_url) {
2748
+ internal_queue.push(() => set_internal(name, value, options));
2749
+ return;
2750
+ }
2751
+ let path = options.path ?? "/";
2752
+ if (!options.domain || options.domain === url.hostname) path = resolve(normalized_url, path);
2753
+ const cookie_key = generate_cookie_key(options.domain, path, name);
2754
+ const cookie = {
2755
+ name,
2756
+ value,
2757
+ options: {
2758
+ ...options,
2759
+ path
2760
+ }
2761
+ };
2762
+ new_cookies.set(cookie_key, cookie);
2763
+ }
2764
+ /**
2765
+ * @param {import('types').TrailingSlash} trailing_slash
2766
+ */
2767
+ function set_trailing_slash(trailing_slash) {
2768
+ normalized_url = normalize_path(url.pathname, trailing_slash);
2769
+ internal_queue.forEach((fn) => fn());
2770
+ }
2771
+ return {
2772
+ cookies,
2773
+ new_cookies,
2774
+ get_cookie_header,
2775
+ set_internal,
2776
+ set_trailing_slash
2777
+ };
2778
+ }
2779
+ /**
2780
+ * @param {string} hostname
2781
+ * @param {string} [constraint]
2782
+ */
2783
+ function domain_matches(hostname, constraint) {
2784
+ if (!constraint) return true;
2785
+ const normalized = constraint[0] === "." ? constraint.slice(1) : constraint;
2786
+ if (hostname === normalized) return true;
2787
+ return hostname.endsWith("." + normalized);
2788
+ }
2789
+ /**
2790
+ * @param {string} path
2791
+ * @param {string} [constraint]
2792
+ */
2793
+ function path_matches(path, constraint) {
2794
+ if (!constraint) return true;
2795
+ const normalized = constraint.endsWith("/") ? constraint.slice(0, -1) : constraint;
2796
+ if (path === normalized) return true;
2797
+ return path.startsWith(normalized + "/");
2798
+ }
2799
+ /**
2800
+ * @param {Headers} headers
2801
+ * @param {MapIterator<import('./page/types.js').Cookie>} cookies
2802
+ */
2803
+ function add_cookies_to_headers(headers, cookies) {
2804
+ for (const new_cookie of cookies) {
2805
+ const { name, value, options: { encode, ...options } } = new_cookie;
2806
+ headers.append("set-cookie", stringifySetCookie({
2807
+ name,
2808
+ value,
2809
+ ...options
2810
+ }, { encode }));
2811
+ if (options.path.endsWith(".html")) {
2812
+ const path = add_data_suffix(options.path);
2813
+ headers.append("set-cookie", stringifySetCookie({
2814
+ name,
2815
+ value,
2816
+ ...options,
2817
+ path
2818
+ }, { encode }));
2819
+ }
2820
+ }
2821
+ }
2822
+ //#endregion
2823
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/state.js
2824
+ /** @import { InternalRequestOptions, RequestState } from 'types' */
2825
+ /** Per-request caches and context flags — never carried into a fork. */
2826
+ function transient_fields() {
2827
+ return {
2828
+ remote: {
2829
+ data: null,
2830
+ explicit: null,
2831
+ implicit: null,
2832
+ forms: null,
2833
+ requested: null,
2834
+ ignored: null,
2835
+ batches: null,
2836
+ live_iterators: null
2837
+ },
2838
+ is_in_remote_function: false,
2839
+ is_in_remote_form_or_command: false,
2840
+ is_in_remote_query: false,
2841
+ is_in_remote_prerender: false,
2842
+ is_in_render: false
2843
+ };
2844
+ }
2845
+ /**
2846
+ * @param {InternalRequestOptions} options
2847
+ * @returns {RequestState}
2848
+ */
2849
+ function create_request_state(options) {
2850
+ return {
2851
+ getClientAddress: options.getClientAddress,
2852
+ platform: options.platform,
2853
+ read: options.read,
2854
+ before_handle: options.before_handle,
2855
+ emulator: options.emulator,
2856
+ prerendering: options.prerendering,
2857
+ prerender_default: void 0,
2858
+ error: false,
2859
+ depth: 0,
2860
+ rerouted_url: null,
2861
+ ...transient_fields()
2862
+ };
2863
+ }
2864
+ /**
2865
+ * @param {RequestState} state
2866
+ * @returns {RequestState}
2867
+ */
2868
+ function fork_state_for_subrequest(state) {
2869
+ return {
2870
+ ...state,
2871
+ ...transient_fields(),
2872
+ depth: state.depth + 1
2873
+ };
2874
+ }
2875
+ //#endregion
2876
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/fetch.js
2877
+ /**
2878
+ * @param {{
2879
+ * event: import('@sveltejs/kit').RequestEvent;
2880
+ * state: import('types').RequestState;
2881
+ * get_cookie_header: (url: URL, header: string | null) => string;
2882
+ * set_internal: (name: string, value: string, opts: import('./page/types.js').Cookie['options']) => void;
2883
+ * }} opts
2884
+ * @returns {typeof fetch}
2885
+ */
2886
+ function create_fetch({ event, state, get_cookie_header, set_internal }) {
2887
+ /**
2888
+ * @type {typeof fetch}
2889
+ */
2890
+ const server_fetch = async (info, init) => {
2891
+ const original_request = normalize_fetch_input(info, init, event.url);
2892
+ let mode = (info instanceof Request ? info.mode : init?.mode) ?? "cors";
2893
+ let credentials = (info instanceof Request ? info.credentials : init?.credentials) ?? "same-origin";
2894
+ return hooks.handleFetch({
2895
+ event,
2896
+ request: original_request,
2897
+ fetch: async (info, init) => {
2898
+ const request = normalize_fetch_input(info, init, event.url);
2899
+ const url = new URL(request.url);
2900
+ if (!request.headers.has("origin")) request.headers.set("origin", event.url.origin);
2901
+ if (info !== original_request) {
2902
+ mode = (info instanceof Request ? info.mode : init?.mode) ?? "cors";
2903
+ credentials = (info instanceof Request ? info.credentials : init?.credentials) ?? "same-origin";
2904
+ }
2905
+ if ((request.method === "GET" || request.method === "HEAD") && (mode === "no-cors" && url.origin !== event.url.origin || url.origin === event.url.origin)) request.headers.delete("origin");
2906
+ const decoded = decodeURIComponent(url.pathname);
2907
+ if (url.origin !== event.url.origin || "") {
2908
+ if (`.${url.hostname}`.endsWith(`.${event.url.hostname}`) && credentials !== "omit") {
2909
+ const cookie = get_cookie_header(url, request.headers.get("cookie"));
2910
+ if (cookie) request.headers.set("cookie", cookie);
2911
+ }
2912
+ return fetch(request);
2913
+ }
2914
+ const filename = (decoded.startsWith(assets) ? decoded.slice(assets.length) : decoded).slice(1);
2915
+ const filename_html = `${filename}/index.html`;
2916
+ const is_asset = manifest.assets.has(filename) || filename in manifest.server_assets;
2917
+ const is_asset_html = manifest.assets.has(filename_html) || filename_html in manifest.server_assets;
2918
+ if (is_asset || is_asset_html) {
2919
+ const file = is_asset ? filename : filename_html;
2920
+ if (state.read) {
2921
+ const type = is_asset ? manifest.mime_types[filename.slice(filename.lastIndexOf("."))] : "text/html";
2922
+ return new Response(state.read(file), { headers: type ? { "content-type": type } : {} });
2923
+ } else if (read_implementation && file in manifest.server_assets) {
2924
+ const length = manifest.server_assets[file];
2925
+ const type = manifest.mime_types[file.slice(file.lastIndexOf("."))];
2926
+ return new Response(read_implementation(file), { headers: {
2927
+ "Content-Length": "" + length,
2928
+ "Content-Type": type
2929
+ } });
2930
+ }
2931
+ return await fetch(request, { redirect: "manual" });
2932
+ }
2933
+ if (has_prerendered_path(decoded)) return await fetch(request, { redirect: "manual" });
2934
+ if (credentials !== "omit") {
2935
+ const cookie = get_cookie_header(url, request.headers.get("cookie"));
2936
+ if (cookie) request.headers.set("cookie", cookie);
2937
+ const authorization = event.request.headers.get("authorization");
2938
+ if (authorization && !request.headers.has("authorization")) request.headers.set("authorization", authorization);
2939
+ }
2940
+ if (!request.headers.has("accept")) request.headers.set("accept", "*/*");
2941
+ const accept_language = event.request.headers.get("accept-language");
2942
+ if (accept_language && !request.headers.has("accept-language")) request.headers.set("accept-language", accept_language);
2943
+ const response = await internal_fetch(request, state);
2944
+ for (const str of response.headers.getSetCookie()) {
2945
+ const { name, value, ...cookie_options } = parseSetCookie(str, { decode: (v) => v });
2946
+ set_internal(name, value, {
2947
+ path: cookie_options.path ?? (url.pathname.split("/").slice(0, -1).join("/") || "/"),
2948
+ encode: (value) => value,
2949
+ ...cookie_options
2950
+ });
2951
+ }
2952
+ return response;
2953
+ }
2954
+ });
2955
+ };
2956
+ return (input, init) => {
2957
+ const response = server_fetch(input, init);
2958
+ response.catch(noop);
2959
+ return response;
2960
+ };
2961
+ }
2962
+ /**
2963
+ * @param {RequestInfo | URL} info
2964
+ * @param {RequestInit | undefined} init
2965
+ * @param {URL} url
2966
+ */
2967
+ function normalize_fetch_input(info, init, url) {
2968
+ if (info instanceof Request) return info;
2969
+ return new Request(typeof info === "string" ? new URL(info, url) : info, init);
2970
+ }
2971
+ /**
2972
+ * @param {Request} request
2973
+ * @param {import('types').RequestState} state
2974
+ * @returns {Promise<Response>}
2975
+ */
2976
+ async function internal_fetch(request, state) {
2977
+ if (request.signal?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
2978
+ const subrequest_state = fork_state_for_subrequest(state);
2979
+ if (!request.signal) return await respond$1(request, subrequest_state);
2980
+ let remove_abort_listener = noop;
2981
+ /** @type {Promise<never>} */
2982
+ const abort_promise = new Promise((_, reject) => {
2983
+ const on_abort = () => {
2984
+ reject(new DOMException("The operation was aborted.", "AbortError"));
2985
+ };
2986
+ request.signal.addEventListener("abort", on_abort, { once: true });
2987
+ remove_abort_listener = () => request.signal.removeEventListener("abort", on_abort);
2988
+ });
2989
+ return Promise.race([respond$1(request, subrequest_state), abort_promise]).finally(remove_abort_listener);
2990
+ }
2991
+ //#endregion
2992
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/env_module.js
2993
+ /** @type {string} */
2994
+ var payload;
2995
+ /** @type {string} */
2996
+ var etag;
2997
+ /** @type {Headers} */
2998
+ var headers;
2999
+ /**
3000
+ * @param {Request} request
3001
+ * @returns {Response}
3002
+ */
3003
+ function get_public_env(request) {
3004
+ payload ??= uneval$1(rendered_env);
3005
+ etag ??= `W/${Date.now()}`;
3006
+ headers ??= new Headers({
3007
+ "content-type": "application/javascript; charset=utf-8",
3008
+ etag
3009
+ });
3010
+ if (request.headers.get("if-none-match") === etag) return new Response(void 0, {
3011
+ status: 304,
3012
+ headers
3013
+ });
3014
+ return new Response(`export const env=${payload}`, { headers });
3015
+ }
3016
+ //#endregion
3017
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/respond.js
3018
+ /** @import { SSRNode } from 'types' */
3019
+ /** @type {import('types').RequiredResolveOptions['transformPageChunk']} */
3020
+ var default_transform = ({ html }) => html;
3021
+ /** @type {import('types').RequiredResolveOptions['filterSerializedResponseHeaders']} */
3022
+ var default_filter = () => false;
3023
+ /** @type {import('types').RequiredResolveOptions['preload']} */
3024
+ var default_preload = ({ type }) => type === "js" || type === "css";
3025
+ var non_html_fetch_destinations = /* @__PURE__ */ new Set([
3026
+ "audio",
3027
+ "audioworklet",
3028
+ "font",
3029
+ "image",
3030
+ "json",
3031
+ "manifest",
3032
+ "paintworklet",
3033
+ "report",
3034
+ "script",
3035
+ "serviceworker",
3036
+ "sharedworker",
3037
+ "style",
3038
+ "track",
3039
+ "video",
3040
+ "webidentity",
3041
+ "worker",
3042
+ "xslt"
3043
+ ]);
3044
+ var page_methods = /* @__PURE__ */ new Set([
3045
+ "GET",
3046
+ "HEAD",
3047
+ "POST"
3048
+ ]);
3049
+ var allowed_page_methods = /* @__PURE__ */ new Set([
3050
+ "GET",
3051
+ "HEAD",
3052
+ "OPTIONS"
3053
+ ]);
3054
+ var respond$1 = propagate_context(internal_respond);
3055
+ /**
3056
+ * @param {Request} request
3057
+ * @param {import('types').RequestState} state
3058
+ * @returns {Promise<Response>}
3059
+ */
3060
+ async function internal_respond(request, state) {
3061
+ /** URL but stripped from the potential `/__data.json` suffix and its search param */
3062
+ const url = new URL(request.url);
3063
+ const is_route_resolution_request = has_resolution_suffix(url.pathname);
3064
+ const is_data_request = has_data_suffix(url.pathname);
3065
+ const remote_id = get_remote_id(url);
3066
+ {
3067
+ const request_origin = request.headers.get("origin");
3068
+ const self_origin = get_self_origin(void 0, url.origin);
3069
+ if (remote_id) {
3070
+ if (is_remote_forbidden({
3071
+ request,
3072
+ request_origin,
3073
+ self_origin
3074
+ })) return Response.json({ message: "Cross-site remote requests are forbidden" }, { status: 403 });
3075
+ } else if (is_csrf_forbidden({
3076
+ request,
3077
+ request_origin,
3078
+ self_origin,
3079
+ trusted_origins: options.csrf_trusted_origins
3080
+ })) {
3081
+ const message = `Cross-site ${request.method} form submissions are forbidden`;
3082
+ const opts = { status: 403 };
3083
+ if (request.headers.get("accept") === "application/json") return Response.json({ message }, opts);
3084
+ return text(message, opts);
3085
+ }
3086
+ }
3087
+ /** @type {boolean[] | undefined} */
3088
+ let invalidated_data_nodes;
3089
+ let skip_route_resolution = false;
3090
+ /** Whether this is a `/${app_dir}/routes/<route_id>/__route.js` request, used by `preloadCode` */
3091
+ let is_route_id_resolution_request = false;
3092
+ if (is_route_resolution_request) {
3093
+ /**
3094
+ * If the request is for a route resolution, first modify the URL, then continue as normal
3095
+ * for path resolution, then return the route object as a JS file.
3096
+ */
3097
+ url.pathname = strip_resolution_suffix(url.pathname);
3098
+ is_route_id_resolution_request = is_route_id_resolution_path(url.pathname);
3099
+ } else if (is_data_request) {
3100
+ url.pathname = strip_data_suffix(url.pathname) + (url.searchParams.get("x-sveltekit-trailing-slash") === "1" ? "/" : "") || "/";
3101
+ url.searchParams.delete(TRAILING_SLASH_PARAM);
3102
+ invalidated_data_nodes = url.searchParams.get(INVALIDATED_PARAM)?.split("").map((node) => node === "1");
3103
+ url.searchParams.delete(INVALIDATED_PARAM);
3104
+ } else if (remote_id) {
3105
+ const pathname = request.headers.get("x-sveltekit-pathname");
3106
+ if (pathname === null) skip_route_resolution = true;
3107
+ else {
3108
+ url.pathname = pathname;
3109
+ url.search = request.headers.get("x-sveltekit-search") ?? "";
3110
+ }
3111
+ }
3112
+ for (const key of url.searchParams.keys()) if (key.startsWith("x-sveltekit-")) return text(`Cannot use reserved query parameter "${key}"`, { status: 400 });
3113
+ /** @type {Record<string, string>} */
3114
+ const headers = {};
3115
+ const { cookies, new_cookies, get_cookie_header, set_internal, set_trailing_slash } = get_cookies(request, url);
3116
+ /** @type {import('@sveltejs/kit').RequestEvent} */
3117
+ const event = {
3118
+ cookies,
3119
+ fetch: null,
3120
+ getClientAddress: state.getClientAddress || (() => {
3121
+ client_address_unsupported({ adapter: "@sveltejs/adapter-node" });
3122
+ }),
3123
+ locals: {},
3124
+ params: {},
3125
+ platform: state.emulator?.platform ? await state.emulator.platform({
3126
+ config: {},
3127
+ prerender: !!state.prerendering?.fallback
3128
+ }) : state.platform,
3129
+ request,
3130
+ route: { id: null },
3131
+ setHeaders: (new_headers) => {
3132
+ for (const key in new_headers) {
3133
+ const lower = key.toLowerCase();
3134
+ const value = new_headers[key];
3135
+ if (lower === "set-cookie") set_headers_cookie();
3136
+ else if (lower in headers) {
3137
+ if (lower === "server-timing") headers[lower] += ", " + value;
3138
+ else header_already_set({ name: key });
3139
+ } else {
3140
+ headers[lower] = value;
3141
+ if (state.prerendering && lower === "cache-control") state.prerendering.cache = value;
3142
+ }
3143
+ }
3144
+ },
3145
+ url,
3146
+ isDataRequest: is_data_request,
3147
+ isSubRequest: state.depth > 0,
3148
+ isRemoteRequest: !!remote_id
3149
+ };
3150
+ event.fetch = create_fetch({
3151
+ event,
3152
+ state,
3153
+ get_cookie_header,
3154
+ set_internal
3155
+ });
3156
+ /** @type {string | null} */
3157
+ let resolved_path = url.pathname;
3158
+ if (!remote_id && !is_route_id_resolution_request) {
3159
+ const prerendering_reroute_state = state.prerendering?.inside_reroute;
3160
+ try {
3161
+ if (state.prerendering) state.prerendering.inside_reroute = true;
3162
+ resolved_path = await hooks.reroute({
3163
+ url: new URL(url),
3164
+ fetch: event.fetch
3165
+ }) ?? url.pathname;
3166
+ if (!manifest.routes.length && resolved_path !== url.pathname) state.rerouted_url = denormalise_url({
3167
+ request_url: request.url,
3168
+ resolved_path,
3169
+ is_data_request,
3170
+ is_route_resolution_request
3171
+ }).toString();
3172
+ } catch {
3173
+ return text("Internal Server Error", { status: 500 });
3174
+ } finally {
3175
+ if (state.prerendering) state.prerendering.inside_reroute = prerendering_reroute_state;
3176
+ }
3177
+ }
3178
+ /** @type {import('types').RequiredResolveOptions} */
3179
+ let resolve_opts = {
3180
+ transformPageChunk: default_transform,
3181
+ filterSerializedResponseHeaders: default_filter,
3182
+ preload: default_preload
3183
+ };
3184
+ /** @type {import('types').TrailingSlash} */
3185
+ let trailing_slash = "never";
3186
+ /** @type {PageNodes | undefined} */
3187
+ let page_nodes;
3188
+ try {
3189
+ resolved_path = decode_pathname(resolved_path);
3190
+ } catch {
3191
+ resolved_path = null;
3192
+ return await handle();
3193
+ }
3194
+ if (resolved_path !== decode_pathname(url.pathname) && !state.prerendering?.fallback && has_prerendered_path(resolved_path)) {
3195
+ const url = denormalise_url({
3196
+ request_url: request.url,
3197
+ resolved_path,
3198
+ is_data_request,
3199
+ is_route_resolution_request
3200
+ });
3201
+ try {
3202
+ const response = await fetch(new Request(url, request), { redirect: "manual" });
3203
+ const headers = new Headers(response.headers);
3204
+ if (headers.has("content-encoding")) {
3205
+ headers.delete("content-encoding");
3206
+ headers.delete("content-length");
3207
+ }
3208
+ return new Response(response.body, {
3209
+ headers,
3210
+ status: response.status,
3211
+ statusText: response.statusText
3212
+ });
3213
+ } catch (error) {
3214
+ return await handle_fatal_error(event, state, error);
3215
+ }
3216
+ }
3217
+ /** @type {import('types').SSRRoute | null} */
3218
+ let route = null;
3219
+ if (is_route_resolution_request) {
3220
+ if (is_route_id_resolution_request) return resolve_route_by_id(extract_route_id(resolved_path), new URL(request.url));
3221
+ return resolve_route(resolved_path, new URL(request.url));
3222
+ }
3223
+ if (resolved_path === `/_app/env.js`) return get_public_env(request);
3224
+ if (!remote_id && resolved_path.startsWith(`/_app`)) {
3225
+ const headers = new Headers();
3226
+ headers.set("cache-control", "public, max-age=0, must-revalidate");
3227
+ return text("Not found", {
3228
+ status: 404,
3229
+ headers
3230
+ });
3231
+ }
3232
+ if (!state.prerendering?.fallback && !skip_route_resolution) try {
3233
+ const matchers = await manifest.matchers();
3234
+ const result = find_route(resolved_path, manifest.routes, matchers);
3235
+ if (result) {
3236
+ route = result.route;
3237
+ event.route = { id: route.id };
3238
+ event.params = result.params;
3239
+ }
3240
+ } catch (e) {
3241
+ return await handle_fatal_error(event, state, e);
3242
+ }
3243
+ try {
3244
+ page_nodes = route?.page ? new PageNodes(await load_page_nodes(route.page)) : void 0;
3245
+ if (route && !remote_id) {
3246
+ if (url.pathname === "" || url.pathname === "/") trailing_slash = "always";
3247
+ else if (page_nodes) trailing_slash = page_nodes.trailing_slash();
3248
+ else if (route.endpoint) trailing_slash = (await route.endpoint()).trailingSlash ?? "never";
3249
+ if (!is_data_request) {
3250
+ const normalized = normalize_path(url.pathname, trailing_slash);
3251
+ if (normalized !== url.pathname && !state.prerendering?.fallback) return new Response(void 0, {
3252
+ status: 308,
3253
+ headers: {
3254
+ "x-sveltekit-normalize": "1",
3255
+ location: relative_pathname(url.pathname, normalized) + (url.search === "?" ? "" : url.search)
3256
+ }
3257
+ });
3258
+ }
3259
+ if (state.before_handle || state.emulator?.platform) {
3260
+ let config = {};
3261
+ /** @type {import('types').PrerenderOption} */
3262
+ let prerender = false;
3263
+ if (route.endpoint) {
3264
+ const node = await route.endpoint();
3265
+ config = node.config ?? config;
3266
+ prerender = node.prerender ?? prerender;
3267
+ } else if (page_nodes) {
3268
+ config = page_nodes.get_config() ?? config;
3269
+ prerender = state.prerender_default = page_nodes.prerender();
3270
+ }
3271
+ if (state.emulator?.platform) event.platform = await state.emulator.platform({
3272
+ config,
3273
+ prerender
3274
+ });
3275
+ if (state.before_handle) return await state.before_handle(event, config, prerender, handle);
3276
+ }
3277
+ }
3278
+ return await handle();
3279
+ } catch (e) {
3280
+ if (e instanceof Redirect) try {
3281
+ const response = is_data_request || remote_id ? redirect_json_response(e) : route?.page && is_action_json_request(event) ? action_json_redirect(e) : redirect_response(e.status, e.location);
3282
+ add_cookies_to_headers(response.headers, new_cookies.values());
3283
+ return response;
3284
+ } catch (err) {
3285
+ return await handle_fatal_error(event, state, err);
3286
+ }
3287
+ return await handle_fatal_error(event, state, e);
3288
+ }
3289
+ async function handle() {
3290
+ set_trailing_slash(trailing_slash);
3291
+ if (state.prerendering && !state.prerendering.fallback && !state.prerendering.inside_reroute) disable_search(url);
3292
+ const response = await record_span({
3293
+ name: "sveltekit.handle.root",
3294
+ attributes: {
3295
+ "http.route": event.route.id || "unknown",
3296
+ "http.method": event.request.method,
3297
+ "http.url": event.url.href,
3298
+ "sveltekit.is_data_request": is_data_request,
3299
+ "sveltekit.is_sub_request": event.isSubRequest
3300
+ },
3301
+ fn: async (root_span) => {
3302
+ const traced_event = {
3303
+ ...event,
3304
+ tracing: {
3305
+ enabled: false,
3306
+ root: root_span,
3307
+ current: root_span
3308
+ }
3309
+ };
3310
+ return await with_request_store({
3311
+ event: traced_event,
3312
+ state
3313
+ }, () => hooks.handle({
3314
+ event: traced_event,
3315
+ resolve: (event, opts) => {
3316
+ return record_span({
3317
+ name: "sveltekit.resolve",
3318
+ attributes: { "http.route": event.route.id || "unknown" },
3319
+ fn: (resolve_span) => {
3320
+ return with_request_store(null, () => resolve(merge_tracing(event, resolve_span), page_nodes, opts).then((response) => {
3321
+ for (const key in headers) {
3322
+ const value = headers[key];
3323
+ response.headers.set(key, value);
3324
+ }
3325
+ add_cookies_to_headers(response.headers, new_cookies.values());
3326
+ if (state.prerendering && event.route.id !== null) response.headers.set("x-sveltekit-routeid", encodeURI(event.route.id));
3327
+ resolve_span.setAttributes({
3328
+ "http.response.status_code": response.status,
3329
+ "http.response.body.size": response.headers.get("content-length") || "unknown"
3330
+ });
3331
+ return response;
3332
+ }));
3333
+ }
3334
+ });
3335
+ }
3336
+ }));
3337
+ }
3338
+ });
3339
+ if (response.status === 200 && response.headers.has("etag")) {
3340
+ let if_none_match_value = request.headers.get("if-none-match");
3341
+ if (if_none_match_value?.startsWith("W/\"")) if_none_match_value = if_none_match_value.substring(2);
3342
+ const etag = response.headers.get("etag");
3343
+ if (if_none_match_value === etag) {
3344
+ const headers = new Headers({ etag });
3345
+ for (const key of [
3346
+ "cache-control",
3347
+ "content-location",
3348
+ "date",
3349
+ "expires",
3350
+ "vary"
3351
+ ]) {
3352
+ const value = response.headers.get(key);
3353
+ if (value) headers.set(key, value);
3354
+ }
3355
+ for (const cookie of response.headers.getSetCookie()) headers.append("set-cookie", cookie);
3356
+ return new Response(void 0, {
3357
+ status: 304,
3358
+ headers
3359
+ });
3360
+ }
3361
+ }
3362
+ if (is_data_request && response.status >= 300 && response.status <= 308) {
3363
+ const location = response.headers.get("location");
3364
+ if (location) return redirect_json_response(new Redirect(response.status, location));
3365
+ }
3366
+ return response;
3367
+ }
3368
+ /**
3369
+ * @param {import('@sveltejs/kit').RequestEvent} event
3370
+ * @param {PageNodes | undefined} page_nodes
3371
+ * @param {import('@sveltejs/kit/hooks').ResolveOptions} [opts]
3372
+ */
3373
+ async function resolve(event, page_nodes, opts) {
3374
+ try {
3375
+ if (opts) resolve_opts = {
3376
+ transformPageChunk: opts.transformPageChunk || default_transform,
3377
+ filterSerializedResponseHeaders: opts.filterSerializedResponseHeaders || default_filter,
3378
+ preload: opts.preload || default_preload
3379
+ };
3380
+ if (resolved_path === null) return await respond_with_error({
3381
+ event,
3382
+ state,
3383
+ error: new SvelteKitError(400, "Malformed URI", `Failed to decode URI: ${event.url.pathname}`),
3384
+ resolve_opts
3385
+ });
3386
+ if (state.prerendering?.fallback) return await render_response({
3387
+ event,
3388
+ state,
3389
+ page_config: {
3390
+ ssr: false,
3391
+ csr: true
3392
+ },
3393
+ status: 200,
3394
+ error: null,
3395
+ branch: [{
3396
+ node: await manifest.nodes[0](),
3397
+ data: null,
3398
+ server_data: null
3399
+ }],
3400
+ fetched: [],
3401
+ resolve_opts,
3402
+ data_serializer: server_data_serializer(event, state)
3403
+ });
3404
+ if (remote_id) return await handle_remote_call(event, state, remote_id);
3405
+ if (route) {
3406
+ const method = event.request.method;
3407
+ /** @type {Response} */
3408
+ let response;
3409
+ if (is_data_request) response = await render_data(event, state, route, invalidated_data_nodes, trailing_slash);
3410
+ else {
3411
+ let endpoint;
3412
+ if (route.endpoint && (!route.page || !state.prerendering && is_endpoint_request(event))) {
3413
+ endpoint = await route.endpoint();
3414
+ if (route.page && (method === "GET" || method === "HEAD" || method === "POST")) {
3415
+ if (!(method === "POST" ? !!(endpoint.POST || endpoint.fallback) : !!(endpoint.GET || endpoint.fallback || method === "HEAD" && endpoint.HEAD))) endpoint = void 0;
3416
+ }
3417
+ }
3418
+ if (endpoint) response = await render_endpoint(event, state, endpoint);
3419
+ else if (route.page) {
3420
+ if (!page_nodes) throw new Error("page_nodes not found. This should never happen");
3421
+ else if (page_methods.has(method)) response = await render_page(event, state, route.page, page_nodes, resolve_opts);
3422
+ else {
3423
+ const allowed_methods = new Set(allowed_page_methods);
3424
+ if ((await manifest.nodes[route.page.leaf]())?.server?.actions) allowed_methods.add("POST");
3425
+ if (method === "OPTIONS") response = new Response(null, {
3426
+ status: 204,
3427
+ headers: { allow: Array.from(allowed_methods.values()).join(", ") }
3428
+ });
3429
+ else {
3430
+ const mod = [...allowed_methods].reduce((acc, curr) => {
3431
+ acc[curr] = true;
3432
+ return acc;
3433
+ }, {});
3434
+ response = method_not_allowed(mod, method);
3435
+ }
3436
+ }
3437
+ } else throw new Error("Route is neither page nor endpoint. This should never happen");
3438
+ }
3439
+ if ((request.method === "GET" || request.method === "HEAD") && route.page && route.endpoint) {
3440
+ const vary = response.headers.get("vary")?.split(",")?.map((v) => v.trim().toLowerCase());
3441
+ if (!(vary?.includes("accept") || vary?.includes("*"))) {
3442
+ response = new Response(response.body, {
3443
+ status: response.status,
3444
+ statusText: response.statusText,
3445
+ headers: new Headers(response.headers)
3446
+ });
3447
+ response.headers.append("Vary", "Accept");
3448
+ }
3449
+ }
3450
+ return response;
3451
+ }
3452
+ if (state.error && event.isSubRequest) {
3453
+ const headers = new Headers(request.headers);
3454
+ headers.set("x-sveltekit-error", "true");
3455
+ return await fetch(request, {
3456
+ headers,
3457
+ redirect: "manual"
3458
+ });
3459
+ }
3460
+ if (state.error) return text("Internal Server Error", { status: 500 });
3461
+ if (state.depth === 0) {
3462
+ if (!state.prerendering && is_data_request && invalidated_data_nodes?.length === 1 && invalidated_data_nodes[0]) return await render_data(event, state, { page: {
3463
+ layouts: [],
3464
+ leaf: 0
3465
+ } }, invalidated_data_nodes, "ignore");
3466
+ if (non_html_fetch_destinations.has(event.request.headers.get("sec-fetch-dest") ?? "")) return text("Not Found", {
3467
+ status: 404,
3468
+ headers: { vary: "Sec-Fetch-Dest" }
3469
+ });
3470
+ return await respond_with_error({
3471
+ event,
3472
+ state,
3473
+ error: new SvelteKitError(404, "Not Found", `Not found: ${event.url.pathname}`),
3474
+ resolve_opts
3475
+ });
3476
+ }
3477
+ if (state.prerendering) return text("not found", { status: 404 });
3478
+ const response = await fetch(request, { redirect: "manual" });
3479
+ return new Response(response.body, response);
3480
+ } catch (e) {
3481
+ return await handle_fatal_error(event, state, e);
3482
+ } finally {
3483
+ event.cookies.set = () => {
3484
+ cookies_set_after_response();
3485
+ };
3486
+ event.setHeaders = () => {
3487
+ set_headers_after_response();
3488
+ };
3489
+ }
3490
+ }
3491
+ }
3492
+ /**
3493
+ * @param {import('types').PageNodeIndexes} page
3494
+ */
3495
+ function load_page_nodes(page) {
3496
+ return Promise.all([...page.layouts.map((n) => n == void 0 ? n : manifest.nodes[n]()), manifest.nodes[page.leaf]()]);
3497
+ }
3498
+ /**
3499
+ * It's likely that, in a distributed system, there are spans starting outside the SvelteKit server -- eg.
3500
+ * started on the frontend client, or in a service that calls the SvelteKit server. There are standardized
3501
+ * ways to represent this context in HTTP headers, so we can extract that context and run our tracing inside of it
3502
+ * so that when our traces are exported, they are associated with the correct parent context.
3503
+ * @param {typeof internal_respond} fn
3504
+ * @returns {typeof internal_respond}
3505
+ */
3506
+ function propagate_context(fn) {
3507
+ return async (req, ...rest) => {
3508
+ if (otel === null) return fn(req, ...rest);
3509
+ const { propagation, context } = await otel;
3510
+ const c = propagation.extract(context.active(), Object.fromEntries(req.headers));
3511
+ return context.with(c, async () => {
3512
+ return await fn(req, ...rest);
3513
+ });
3514
+ };
3515
+ }
3516
+ /**
3517
+ * @param {object} opts
3518
+ * @param {string} opts.request_url - The original request URL
3519
+ * @param {string} opts.resolved_path - The resolved pathname
3520
+ * @param {boolean} opts.is_data_request - Whether the request is a data request
3521
+ * @param {boolean} opts.is_route_resolution_request -
3522
+ * @returns {URL}
3523
+ */
3524
+ function denormalise_url({ request_url, resolved_path, is_data_request, is_route_resolution_request }) {
3525
+ const url = new URL(request_url);
3526
+ url.pathname = is_data_request ? add_data_suffix(resolved_path) : is_route_resolution_request ? add_resolution_suffix(resolved_path) : resolved_path;
3527
+ return url;
3528
+ }
3529
+ //#endregion
3530
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_jiti@2._2180d2dbf687eed18f260b26dab65894/node_modules/@sveltejs/kit/src/runtime/server/instance.js
3531
+ /** @type {Promise<any>} */
3532
+ var init_promise;
3533
+ /**
3534
+ * Loads the user's hooks, once, however many times an adapter calls it
3535
+ */
3536
+ async function init() {
3537
+ await (init_promise ??= (async () => {
3538
+ try {
3539
+ const module = await get_hooks();
3540
+ set_hooks({
3541
+ handle: module.handle || (({ event, resolve }) => resolve(event)),
3542
+ handleError: module.handleError || (({ kind, error, issues }) => {
3543
+ if (kind === "validation") {
3544
+ console.error("Remote function schema validation failed:", issues);
3545
+ return;
3546
+ }
3547
+ if (kind !== "unknown") return;
3548
+ let e = error;
3549
+ while (e instanceof Error) {
3550
+ if (e.stack) console.error(e.stack);
3551
+ e = e.cause;
3552
+ }
3553
+ if (e) console.error(String(e));
3554
+ }),
3555
+ handleFetch: module.handleFetch || (({ request, fetch }) => fetch(request)),
3556
+ reroute: module.reroute || noop
3557
+ });
3558
+ init_transport(module.transport ?? {});
3559
+ if (module.init) await module.init();
3560
+ } catch (e) {
3561
+ throw e;
3562
+ }
3563
+ })());
3564
+ }
3565
+ /**
3566
+ * @param {Request} request
3567
+ * @param {import('types').InternalRequestOptions} options
3568
+ */
3569
+ async function respond_to(request, options) {
3570
+ const request_state = create_request_state(options);
3571
+ const response = await respond$1(request, request_state);
3572
+ if (request_state.rerouted_url) response.headers.set(REROUTED_URL_HEADER, request_state.rerouted_url);
3573
+ if (request.method === "HEAD" && response.body !== null) {
3574
+ response.body.cancel().catch(noop);
3575
+ return new Response(null, response);
3576
+ }
3577
+ return response;
3578
+ }
3579
+ /**
3580
+ * AsyncLocalStorage does not work in webcontainers, so there `sync_store` is never reset
3581
+ * (see `src/exports/internal/server/event.js`) and requests are handled one at a time
3582
+ * @param {typeof respond_to} fn
3583
+ */
3584
+ function serialise(fn) {
3585
+ /** @type {Promise<void> | null} */
3586
+ let current = null;
3587
+ /** @type {typeof respond_to} */
3588
+ return async (...args) => {
3589
+ const { promise, resolve } = Promise.withResolvers();
3590
+ const previous = current;
3591
+ current = promise;
3592
+ await previous;
3593
+ return fn(...args).finally(resolve);
3594
+ };
3595
+ }
3596
+ var respond = IN_WEBCONTAINER ? serialise(respond_to) : respond_to;
3597
+ //#endregion
3598
+ export { init, respond, set_env };
3599
+
3600
+ //# sourceMappingURL=instance.js.map