fundus 0.0.2 → 0.0.3

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 (300) hide show
  1. package/README.md +58 -0
  2. package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/2.wavcNhPC.css +1 -0
  5. package/build/client/_app/immutable/assets/2.wavcNhPC.css.br +0 -0
  6. package/build/client/_app/immutable/assets/2.wavcNhPC.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css +1 -0
  8. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.br +0 -0
  9. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
  11. package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
  12. package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
  14. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
  15. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css +1 -0
  17. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.br +0 -0
  18. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.gz +0 -0
  19. package/build/client/_app/immutable/chunks/BiIto6ft.js +1 -0
  20. package/build/client/_app/immutable/chunks/BiIto6ft.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/BiIto6ft.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
  23. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  24. package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
  28. package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/CvY6YsFE.js} +1 -1
  29. package/build/client/_app/immutable/chunks/CvY6YsFE.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CvY6YsFE.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/DL0_39Ys.js +5 -0
  32. package/build/client/_app/immutable/chunks/DL0_39Ys.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/DL0_39Ys.js.gz +0 -0
  34. package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DQ8SXFaX.js} +1 -1
  35. package/build/client/_app/immutable/chunks/DQ8SXFaX.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/DQ8SXFaX.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/DjdrdRzT.js.br +0 -0
  38. package/build/client/_app/immutable/chunks/DjdrdRzT.js.gz +0 -0
  39. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  40. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  41. package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.ubN0v9bN.js} +2 -2
  42. package/build/client/_app/immutable/entry/app.ubN0v9bN.js.br +0 -0
  43. package/build/client/_app/immutable/entry/app.ubN0v9bN.js.gz +0 -0
  44. package/build/client/_app/immutable/entry/start.BW8dBDh6.js +1 -0
  45. package/build/client/_app/immutable/entry/start.BW8dBDh6.js.br +0 -0
  46. package/build/client/_app/immutable/entry/start.BW8dBDh6.js.gz +0 -0
  47. package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.Dr5ijCIl.js} +1 -1
  48. package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.br +0 -0
  49. package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.gz +0 -0
  50. package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.DiIGIRAb.js} +1 -1
  51. package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.br +3 -0
  52. package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.gz +0 -0
  53. package/{dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js → build/client/_app/immutable/nodes/2.B8KYmQcV.js} +3 -3
  54. package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.br +0 -0
  55. package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.gz +0 -0
  56. package/build/client/_app/immutable/nodes/3.B1jc7arT.js +104 -0
  57. package/build/client/_app/immutable/nodes/3.B1jc7arT.js.br +0 -0
  58. package/build/client/_app/immutable/nodes/3.B1jc7arT.js.gz +0 -0
  59. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js +2 -0
  60. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.br +0 -0
  61. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.gz +0 -0
  62. package/build/client/_app/version.json +1 -0
  63. package/build/client/_app/version.json.br +0 -0
  64. package/build/client/_app/version.json.gz +0 -0
  65. package/build/env.js +100 -0
  66. package/build/env.js.map +1 -0
  67. package/build/handler.js +22 -0
  68. package/build/handler.js.map +1 -0
  69. package/build/index.js +145 -0
  70. package/build/index.js.map +1 -0
  71. package/build/server/chunks/chunks/context.js-Bw4WWLhG.js +443 -0
  72. package/build/server/chunks/chunks/context.js-Bw4WWLhG.js.map +1 -0
  73. package/build/server/chunks/chunks/core.js-DDntpb72.js +409 -0
  74. package/build/server/chunks/chunks/core.js-DDntpb72.js.map +1 -0
  75. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  76. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
  77. package/build/server/chunks/chunks/exports.js-CLTzaOxn.js +152 -0
  78. package/build/server/chunks/chunks/exports.js-CLTzaOxn.js.map +1 -0
  79. package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
  80. package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
  81. package/build/server/chunks/chunks/http.js-Dxoa-jtP.js +100 -0
  82. package/build/server/chunks/chunks/http.js-Dxoa-jtP.js.map +1 -0
  83. package/build/server/chunks/chunks/internal.js-BDBSzJId.js +5753 -0
  84. package/build/server/chunks/chunks/internal.js-BDBSzJId.js.map +1 -0
  85. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
  86. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
  87. package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-BP8cL-qD.js} +344 -444
  88. package/build/server/chunks/chunks/library-store.js-BP8cL-qD.js.map +1 -0
  89. package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
  90. package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
  91. package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
  92. package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
  93. package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js +255 -0
  94. package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js.map +1 -0
  95. package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js +1048 -0
  96. package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js.map +1 -0
  97. package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js +27 -0
  98. package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js.map +1 -0
  99. package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js +24 -0
  100. package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js.map +1 -0
  101. package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js +45 -0
  102. package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js.map +1 -0
  103. package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js +31 -0
  104. package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js.map +1 -0
  105. package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js +31 -0
  106. package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js.map +1 -0
  107. package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js +38 -0
  108. package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js.map +1 -0
  109. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js +31 -0
  110. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js.map +1 -0
  111. package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js +24 -0
  112. package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js.map +1 -0
  113. package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js +31 -0
  114. package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js.map +1 -0
  115. package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js +24 -0
  116. package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js.map +1 -0
  117. package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js +27 -0
  118. package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js.map +1 -0
  119. package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js +24 -0
  120. package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js.map +1 -0
  121. package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js +24 -0
  122. package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js.map +1 -0
  123. package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js +23 -0
  124. package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js.map +1 -0
  125. package/build/server/chunks/handler-10cx4zHn.js +1475 -0
  126. package/build/server/chunks/handler-10cx4zHn.js.map +1 -0
  127. package/build/server/chunks/index.js-DvPfiC00.js +3789 -0
  128. package/build/server/chunks/index.js-DvPfiC00.js.map +1 -0
  129. package/build/server/chunks/manifest.js-DoPjUnzD.js +149 -0
  130. package/build/server/chunks/manifest.js-DoPjUnzD.js.map +1 -0
  131. package/build/server/chunks/nodes/0.js-Di3qgAtW.js +11 -0
  132. package/build/server/chunks/nodes/0.js-Di3qgAtW.js.map +1 -0
  133. package/build/server/chunks/nodes/1.js-BlWSFIA8.js +7 -0
  134. package/build/server/chunks/nodes/1.js-BlWSFIA8.js.map +1 -0
  135. package/build/server/chunks/nodes/2.js-CO9nSPUN.js +7 -0
  136. package/build/server/chunks/nodes/2.js-CO9nSPUN.js.map +1 -0
  137. package/build/server/chunks/nodes/3.js-C2D6xpEO.js +7 -0
  138. package/build/server/chunks/nodes/3.js-C2D6xpEO.js.map +1 -0
  139. package/build/server/chunks/nodes/4.js-B3IuagJW.js +7 -0
  140. package/build/server/chunks/nodes/4.js-B3IuagJW.js.map +1 -0
  141. package/build/shims.js +33 -0
  142. package/build/shims.js.map +1 -0
  143. package/dist/cli.d.ts +2 -1
  144. package/dist/cli.js +109 -1332
  145. package/dist/config.d.ts +3 -2
  146. package/dist/config.js +2 -2
  147. package/dist/core/api-types.d.ts +141 -0
  148. package/dist/core/api-types.js +1 -0
  149. package/dist/core/asset-id.d.ts +28 -0
  150. package/dist/core/asset-id.js +59 -0
  151. package/dist/core/asset-reference.d.ts +23 -0
  152. package/dist/core/asset-reference.js +15 -0
  153. package/dist/core/canonicalize.d.ts +9 -0
  154. package/dist/core/canonicalize.js +36 -0
  155. package/dist/core/chroma-key.d.ts +30 -0
  156. package/dist/core/chroma-key.js +55 -0
  157. package/dist/core/config.d.ts +35 -0
  158. package/dist/core/config.js +4 -0
  159. package/dist/core/folder-path.d.ts +19 -0
  160. package/dist/core/folder-path.js +86 -0
  161. package/dist/core/index.d.ts +33 -499
  162. package/dist/core/index.js +17 -962
  163. package/dist/core/ingest.d.ts +18 -0
  164. package/dist/core/ingest.js +58 -0
  165. package/dist/core/library.d.ts +54 -0
  166. package/dist/core/library.js +138 -0
  167. package/dist/core/manifest-appearance.d.ts +35 -0
  168. package/dist/core/manifest-appearance.js +123 -0
  169. package/dist/core/manifest-entry.d.ts +104 -0
  170. package/dist/core/manifest-entry.js +1 -0
  171. package/dist/core/manifest-membership.d.ts +56 -0
  172. package/dist/core/manifest-membership.js +54 -0
  173. package/dist/core/plugins/audio.d.ts +26 -0
  174. package/dist/core/plugins/audio.js +44 -0
  175. package/dist/core/plugins/chroma-key-video.d.ts +29 -0
  176. package/dist/core/plugins/chroma-key-video.js +69 -0
  177. package/dist/core/plugins/contract.d.ts +35 -0
  178. package/dist/core/plugins/contract.js +1 -0
  179. package/dist/core/plugins/image.d.ts +30 -0
  180. package/dist/core/plugins/image.js +45 -0
  181. package/dist/core/plugins/slice.d.ts +22 -0
  182. package/dist/core/plugins/slice.js +60 -0
  183. package/dist/core/plugins/video.d.ts +45 -0
  184. package/dist/core/plugins/video.js +77 -0
  185. package/dist/core/reference-graph.d.ts +41 -0
  186. package/dist/core/reference-graph.js +138 -0
  187. package/dist/core/slice-data.d.ts +61 -0
  188. package/dist/core/slice-data.js +49 -0
  189. package/dist/runtime/chroma-key-gl.d.ts +40 -22
  190. package/dist/runtime/chroma-key-gl.js +189 -183
  191. package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
  192. package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
  193. package/dist/runtime/components/Image.svelte +1 -1
  194. package/dist/runtime/components/Image.svelte.d.ts +9 -0
  195. package/dist/runtime/components/Slice.svelte +1 -1
  196. package/dist/runtime/components/Slice.svelte.d.ts +19 -0
  197. package/dist/runtime/components/SliceCanvas.svelte +3 -3
  198. package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
  199. package/dist/runtime/components/SliceDom.svelte +3 -3
  200. package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
  201. package/dist/runtime/components/Video.svelte +2 -2
  202. package/dist/runtime/components/Video.svelte.d.ts +18 -0
  203. package/dist/runtime/geometry.d.ts +55 -35
  204. package/dist/runtime/geometry.js +186 -191
  205. package/dist/runtime/index.d.ts +9 -9
  206. package/dist/runtime/index.js +9 -9
  207. package/dist/runtime/kind-handlers.d.ts +33 -24
  208. package/dist/runtime/kind-handlers.js +74 -65
  209. package/dist/runtime/manifest.d.ts +53 -47
  210. package/dist/runtime/manifest.js +133 -113
  211. package/dist/runtime/observe-border-box-size.d.ts +1 -4
  212. package/dist/runtime/observe-border-box-size.js +9 -10
  213. package/dist/runtime/preload-registry.d.ts +22 -8
  214. package/dist/runtime/preload-registry.js +65 -62
  215. package/dist/server/build.d.ts +8 -0
  216. package/dist/server/build.js +25 -0
  217. package/dist/server/check.d.ts +24 -0
  218. package/dist/server/check.js +199 -0
  219. package/dist/server/cli-commands.d.ts +25 -0
  220. package/dist/server/cli-commands.js +1178 -0
  221. package/dist/server/cli-init.d.ts +3 -0
  222. package/dist/server/cli-init.js +53 -0
  223. package/dist/server/cli-io.d.ts +46 -0
  224. package/dist/server/cli-io.js +105 -0
  225. package/dist/server/codegen.d.ts +58 -0
  226. package/dist/server/codegen.js +185 -0
  227. package/dist/server/config-loader.d.ts +34 -0
  228. package/dist/server/config-loader.js +103 -0
  229. package/dist/server/context.d.ts +8 -0
  230. package/dist/server/context.js +19 -0
  231. package/dist/server/folder-filesystem.d.ts +7 -0
  232. package/dist/server/folder-filesystem.js +39 -0
  233. package/dist/server/http.d.ts +12 -0
  234. package/dist/server/http.js +100 -0
  235. package/dist/server/index.d.ts +16 -0
  236. package/dist/server/index.js +9 -0
  237. package/dist/server/job-hash.d.ts +10 -0
  238. package/dist/server/job-hash.js +23 -0
  239. package/dist/server/library-store.d.ts +82 -0
  240. package/dist/server/library-store.js +763 -0
  241. package/dist/server/operations.d.ts +87 -0
  242. package/dist/server/operations.js +427 -0
  243. package/dist/server/plugins/audio.d.ts +7 -0
  244. package/dist/server/plugins/audio.js +27 -0
  245. package/dist/server/plugins/chroma-key-video.d.ts +9 -0
  246. package/dist/server/plugins/chroma-key-video.js +38 -0
  247. package/dist/server/plugins/contract.d.ts +100 -0
  248. package/dist/server/plugins/contract.js +16 -0
  249. package/dist/server/plugins/image.d.ts +8 -0
  250. package/dist/server/plugins/image.js +30 -0
  251. package/dist/server/plugins/slice.d.ts +14 -0
  252. package/dist/server/plugins/slice.js +63 -0
  253. package/dist/server/plugins/video.d.ts +6 -0
  254. package/dist/server/plugins/video.js +29 -0
  255. package/dist/server/plugins.d.ts +23 -0
  256. package/dist/server/plugins.js +33 -0
  257. package/dist/server/processing/audio-processing.d.ts +17 -0
  258. package/dist/server/processing/audio-processing.js +46 -0
  259. package/dist/server/processing/ffmpeg.d.ts +9 -0
  260. package/dist/server/processing/ffmpeg.js +50 -0
  261. package/dist/server/processing/image-processing.d.ts +16 -0
  262. package/dist/server/processing/image-processing.js +26 -0
  263. package/dist/server/processing/media-probe.d.ts +15 -0
  264. package/dist/server/processing/media-probe.js +27 -0
  265. package/dist/server/processing/processor.d.ts +50 -0
  266. package/dist/server/processing/processor.js +158 -0
  267. package/dist/server/processing/video-processing.d.ts +35 -0
  268. package/dist/server/processing/video-processing.js +87 -0
  269. package/dist/server/server.d.ts +13 -0
  270. package/dist/server/server.js +57 -0
  271. package/dist/server/start.d.ts +1 -0
  272. package/dist/server/start.js +33 -0
  273. package/package.json +29 -16
  274. package/dist/build-CZYFLLvl.js +0 -191
  275. package/dist/core/image-Dqmz8FXS.js +0 -54
  276. package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
  277. package/dist/core/testing.d.ts +0 -27
  278. package/dist/core/testing.js +0 -80
  279. package/dist/editor/200.html +0 -37
  280. package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
  281. package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
  282. package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
  283. package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
  284. package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
  285. package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
  286. package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
  287. package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
  288. package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
  289. package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
  290. package/dist/editor/_app/version.json +0 -1
  291. package/dist/index.d.ts +0 -370
  292. package/dist/index.js +0 -4
  293. package/dist/start-Bhnqt9Dc.js +0 -279
  294. package/dist/start-D2IXOrni.js +0 -2
  295. /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
  296. /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
  297. /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
  298. /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
  299. /package/{dist/editor → build/client}/_app/immutable/chunks/DjdrdRzT.js +0 -0
  300. /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
@@ -0,0 +1,1048 @@
1
+ import { R as Redirect, H as HttpError, c as coalesce_to_error, g as get_status, a as get_message, n as noop, S as SvelteKitError } from './shared.js-BWXgl1Xf.js';
2
+ import { u as uneval, p as parse } from './internal.js-BDBSzJId.js';
3
+
4
+ var defaultParseOptions = {
5
+ decodeValues: true,
6
+ map: false,
7
+ silent: false,
8
+ split: "auto", // auto = split strings but not arrays
9
+ };
10
+
11
+ function isForbiddenKey(key) {
12
+ return typeof key !== "string" || key in {};
13
+ }
14
+
15
+ function createNullObj() {
16
+ return Object.create(null);
17
+ }
18
+
19
+ function isNonEmptyString(str) {
20
+ return typeof str === "string" && !!str.trim();
21
+ }
22
+
23
+ function parseString(setCookieValue, options) {
24
+ var parts = setCookieValue.split(";").filter(isNonEmptyString);
25
+
26
+ var nameValuePairStr = parts.shift();
27
+ if (!nameValuePairStr) {
28
+ return null;
29
+ }
30
+ var parsed = parseNameValuePair(nameValuePairStr);
31
+ var name = parsed.name;
32
+ var value = parsed.value;
33
+
34
+ options = options
35
+ ? Object.assign({}, defaultParseOptions, options)
36
+ : defaultParseOptions;
37
+
38
+ if (isForbiddenKey(name)) {
39
+ return null;
40
+ }
41
+
42
+ try {
43
+ value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
44
+ } catch (e) {
45
+ console.error(
46
+ "set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
47
+ e
48
+ );
49
+ }
50
+
51
+ var cookie = createNullObj();
52
+ cookie.name = name;
53
+ cookie.value = value;
54
+
55
+ parts.forEach(function (part) {
56
+ var sides = part.split("=");
57
+ var key = sides.shift().trim().toLowerCase();
58
+ if (isForbiddenKey(key)) {
59
+ return;
60
+ }
61
+ var value = sides.join("=").trim();
62
+ if (key === "expires") {
63
+ cookie.expires = new Date(value);
64
+ } else if (key === "max-age") {
65
+ var n = parseInt(value, 10);
66
+ if (!Number.isNaN(n)) cookie.maxAge = n;
67
+ } else if (key === "secure") {
68
+ cookie.secure = true;
69
+ } else if (key === "httponly") {
70
+ cookie.httpOnly = true;
71
+ } else if (key === "samesite") {
72
+ cookie.sameSite = value;
73
+ } else if (key === "partitioned") {
74
+ cookie.partitioned = true;
75
+ } else if (key) {
76
+ cookie[key] = value;
77
+ }
78
+ });
79
+
80
+ return cookie;
81
+ }
82
+
83
+ function parseNameValuePair(nameValuePairStr) {
84
+ // Parses name-value-pair according to rfc6265bis draft
85
+
86
+ var name = "";
87
+ var value = "";
88
+ var nameValueArr = nameValuePairStr.split("=");
89
+ if (nameValueArr.length > 1) {
90
+ name = nameValueArr.shift();
91
+ value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part
92
+ } else {
93
+ value = nameValuePairStr;
94
+ }
95
+
96
+ return { name: name, value: value };
97
+ }
98
+
99
+ function parseSetCookie(input, options) {
100
+ options = options
101
+ ? Object.assign({}, defaultParseOptions, options)
102
+ : defaultParseOptions;
103
+
104
+ if (!input) {
105
+ if (!options.map) {
106
+ return [];
107
+ } else {
108
+ return createNullObj();
109
+ }
110
+ }
111
+
112
+ if (input.headers) {
113
+ if (typeof input.headers.getSetCookie === "function") {
114
+ // for fetch responses - they combine headers of the same type in the headers array,
115
+ // but getSetCookie returns an uncombined array
116
+ input = input.headers.getSetCookie();
117
+ } else if (input.headers["set-cookie"]) {
118
+ // fast-path for node.js (which automatically normalizes header names to lower-case)
119
+ input = input.headers["set-cookie"];
120
+ } else {
121
+ // slow-path for other environments - see #25
122
+ var sch =
123
+ input.headers[
124
+ Object.keys(input.headers).find(function (key) {
125
+ return key.toLowerCase() === "set-cookie";
126
+ })
127
+ ];
128
+ // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
129
+ if (!sch && input.headers.cookie && !options.silent) {
130
+ console.warn(
131
+ "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
132
+ );
133
+ }
134
+ input = sch;
135
+ }
136
+ }
137
+
138
+ var split = options.split;
139
+ var isArray = Array.isArray(input);
140
+
141
+ if (split === "auto") {
142
+ split = !isArray;
143
+ }
144
+
145
+ if (!isArray) {
146
+ input = [input];
147
+ }
148
+
149
+ input = input.filter(isNonEmptyString);
150
+
151
+ if (split) {
152
+ input = input.map(splitCookiesString).flat();
153
+ }
154
+
155
+ if (!options.map) {
156
+ return input
157
+ .map(function (str) {
158
+ return parseString(str, options);
159
+ })
160
+ .filter(Boolean);
161
+ } else {
162
+ var cookies = createNullObj();
163
+ return input.reduce(function (cookies, str) {
164
+ var cookie = parseString(str, options);
165
+ if (cookie && !isForbiddenKey(cookie.name)) {
166
+ cookies[cookie.name] = cookie;
167
+ }
168
+ return cookies;
169
+ }, cookies);
170
+ }
171
+ }
172
+
173
+ /*
174
+ Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
175
+ that are within a single set-cookie field-value, such as in the Expires portion.
176
+
177
+ This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
178
+ Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
179
+ React Native's fetch does this for *every* header, including set-cookie.
180
+
181
+ Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
182
+ Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
183
+ */
184
+ function splitCookiesString(cookiesString) {
185
+ if (Array.isArray(cookiesString)) {
186
+ return cookiesString;
187
+ }
188
+ if (typeof cookiesString !== "string") {
189
+ return [];
190
+ }
191
+
192
+ var cookiesStrings = [];
193
+ var pos = 0;
194
+ var start;
195
+ var ch;
196
+ var lastComma;
197
+ var nextStart;
198
+ var cookiesSeparatorFound;
199
+
200
+ function skipWhitespace() {
201
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
202
+ pos += 1;
203
+ }
204
+ return pos < cookiesString.length;
205
+ }
206
+
207
+ function notSpecialChar() {
208
+ ch = cookiesString.charAt(pos);
209
+
210
+ return ch !== "=" && ch !== ";" && ch !== ",";
211
+ }
212
+
213
+ while (pos < cookiesString.length) {
214
+ start = pos;
215
+ cookiesSeparatorFound = false;
216
+
217
+ while (skipWhitespace()) {
218
+ ch = cookiesString.charAt(pos);
219
+ if (ch === ",") {
220
+ // ',' is a cookie separator if we have later first '=', not ';' or ','
221
+ lastComma = pos;
222
+ pos += 1;
223
+
224
+ skipWhitespace();
225
+ nextStart = pos;
226
+
227
+ while (pos < cookiesString.length && notSpecialChar()) {
228
+ pos += 1;
229
+ }
230
+
231
+ // currently special character
232
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
233
+ // we found cookies separator
234
+ cookiesSeparatorFound = true;
235
+ // pos is inside the next cookie, so back up and return it.
236
+ pos = nextStart;
237
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
238
+ start = pos;
239
+ } else {
240
+ // in param ',' or param separator ';',
241
+ // we continue from that comma
242
+ pos = lastComma + 1;
243
+ }
244
+ } else {
245
+ pos += 1;
246
+ }
247
+ }
248
+
249
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
250
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
251
+ }
252
+ }
253
+
254
+ return cookiesStrings;
255
+ }
256
+
257
+ // named export for CJS
258
+ parseSetCookie.parseSetCookie = parseSetCookie;
259
+ // for backwards compatibility
260
+ parseSetCookie.parse = parseSetCookie;
261
+ parseSetCookie.parseString = parseString;
262
+ parseSetCookie.splitCookiesString = splitCookiesString;
263
+
264
+ const text_encoder = new TextEncoder();
265
+
266
+ /** @import { StandardSchemaV1 } from '@standard-schema/spec' */
267
+
268
+
269
+ // TODO 3.0: remove these types as they are not used anymore (we can't remove them yet because that would be a breaking change)
270
+ /**
271
+ * @template {number} TNumber
272
+ * @template {any[]} [TArray=[]]
273
+ * @typedef {TNumber extends TArray['length'] ? TArray[number] : LessThan<TNumber, [...TArray, TArray['length']]>} LessThan
274
+ */
275
+
276
+ /**
277
+ * @template {number} TStart
278
+ * @template {number} TEnd
279
+ * @typedef {Exclude<TEnd | LessThan<TEnd>, LessThan<TStart>>} NumericRange
280
+ */
281
+
282
+ // Keep the status codes as `number` because restricting to certain numbers makes it unnecessarily hard to use compared to the benefits
283
+ // (we have runtime errors already to check for invalid codes). Also see https://github.com/sveltejs/kit/issues/11780
284
+
285
+ // we have to repeat the JSDoc because the display for function overloads is broken
286
+ // see https://github.com/microsoft/TypeScript/issues/55056
287
+
288
+ /**
289
+ * Throws an error with a HTTP status code and an optional message.
290
+ * When called during request handling, this will cause SvelteKit to
291
+ * return an error response without invoking `handleError`.
292
+ * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
293
+ * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
294
+ * @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
295
+ * @overload
296
+ * @param {number} status
297
+ * @param {App.Error} body
298
+ * @return {never}
299
+ * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
300
+ * @throws {Error} If the provided status is invalid (not between 400 and 599).
301
+ */
302
+ /**
303
+ * Throws an error with a HTTP status code and an optional message.
304
+ * When called during request handling, this will cause SvelteKit to
305
+ * return an error response without invoking `handleError`.
306
+ * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
307
+ * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
308
+ * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
309
+ * @overload
310
+ * @param {number} status
311
+ * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body]
312
+ * @return {never}
313
+ * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
314
+ * @throws {Error} If the provided status is invalid (not between 400 and 599).
315
+ */
316
+ /**
317
+ * Throws an error with a HTTP status code and an optional message.
318
+ * When called during request handling, this will cause SvelteKit to
319
+ * return an error response without invoking `handleError`.
320
+ * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
321
+ * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
322
+ * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
323
+ * @return {never}
324
+ * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
325
+ * @throws {Error} If the provided status is invalid (not between 400 and 599).
326
+ */
327
+ function error(status, body) {
328
+ if ((isNaN(status) || status < 400 || status > 599)) {
329
+ throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);
330
+ }
331
+
332
+ throw new HttpError(status, body);
333
+ }
334
+
335
+ /**
336
+ * Checks whether this is a redirect thrown by {@link redirect}.
337
+ * @param {unknown} e The object to check.
338
+ * @return {e is Redirect}
339
+ */
340
+ function isRedirect(e) {
341
+ return e instanceof Redirect;
342
+ }
343
+
344
+ /**
345
+ * Create a JSON `Response` object from the supplied data.
346
+ * @param {any} data The value that will be serialized as JSON.
347
+ * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically.
348
+ */
349
+ function json(data, init) {
350
+ // TODO deprecate this in favour of `Response.json` when it's
351
+ // more widely supported
352
+ const body = JSON.stringify(data);
353
+
354
+ // we can't just do `text(JSON.stringify(data), init)` because
355
+ // it will set a default `content-type` header. duplicated code
356
+ // means less duplicated work
357
+ const headers = new Headers(init?.headers);
358
+ if (!headers.has('content-length')) {
359
+ headers.set('content-length', text_encoder.encode(body).byteLength.toString());
360
+ }
361
+
362
+ if (!headers.has('content-type')) {
363
+ headers.set('content-type', 'application/json');
364
+ }
365
+
366
+ return new Response(body, {
367
+ ...init,
368
+ headers
369
+ });
370
+ }
371
+
372
+ /**
373
+ * Create a `Response` object from the supplied body.
374
+ * @param {string} body The value that will be used as-is.
375
+ * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically.
376
+ */
377
+ function text(body, init) {
378
+ const headers = new Headers(init?.headers);
379
+ if (!headers.has('content-length')) {
380
+ const encoded = text_encoder.encode(body);
381
+ headers.set('content-length', encoded.byteLength.toString());
382
+ return new Response(encoded, {
383
+ ...init,
384
+ headers
385
+ });
386
+ }
387
+
388
+ return new Response(body, {
389
+ ...init,
390
+ headers
391
+ });
392
+ }
393
+
394
+ // eslint-disable-next-line n/prefer-global/process
395
+ const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
396
+
397
+ /** @import { RequestEvent } from '@sveltejs/kit' */
398
+ /** @import { RequestStore } from 'types' */
399
+ /** @import { AsyncLocalStorage } from 'node:async_hooks' */
400
+
401
+
402
+ /** @type {RequestStore | null} */
403
+ let sync_store = null;
404
+
405
+ /** @type {AsyncLocalStorage<RequestStore | null> | null} */
406
+ let als;
407
+
408
+ import('node:async_hooks')
409
+ .then((hooks) => (als = new hooks.AsyncLocalStorage()))
410
+ .catch(() => {
411
+ // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously.
412
+ // this isn't behind `supports` because it's basically just StackBlitz (i.e.
413
+ // in-browser usage) that doesn't support it AFAICT
414
+ });
415
+
416
+ /**
417
+ * @template T
418
+ * @param {RequestStore | null} store
419
+ * @param {() => T} fn
420
+ */
421
+ function with_request_store(store, fn) {
422
+ try {
423
+ sync_store = store;
424
+ return als ? als.run(store, fn) : fn();
425
+ } finally {
426
+ // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store`
427
+ // and handle only one request at a time in `src/runtime/server/index.js`.
428
+ if (!IN_WEBCONTAINER) {
429
+ sync_store = null;
430
+ }
431
+ }
432
+ }
433
+
434
+ /**
435
+ * @template {{ tracing: { enabled: boolean, root: import('@opentelemetry/api').Span, current: import('@opentelemetry/api').Span } }} T
436
+ * @param {T} event_like
437
+ * @param {import('@opentelemetry/api').Span} current
438
+ * @returns {T}
439
+ */
440
+ function merge_tracing(event_like, current) {
441
+ return {
442
+ ...event_like,
443
+ tracing: {
444
+ ...event_like.tracing,
445
+ current
446
+ }
447
+ };
448
+ }
449
+
450
+ var ENDPOINT_METHODS = [
451
+ "GET",
452
+ "POST",
453
+ "PUT",
454
+ "PATCH",
455
+ "DELETE",
456
+ "OPTIONS",
457
+ "HEAD"
458
+ ];
459
+ var PAGE_METHODS = [
460
+ "GET",
461
+ "POST",
462
+ "HEAD"
463
+ ];
464
+ //#endregion
465
+ //#region node_modules/@sveltejs/kit/src/runtime/form-utils.js
466
+ /** @import { RemoteForm } from '@sveltejs/kit' */
467
+ /** @import { BinaryFormMeta, InternalRemoteFormIssue } from 'types' */
468
+ /** @import { StandardSchemaV1 } from '@standard-schema/spec' */
469
+ var decoder = new TextDecoder();
470
+ /**
471
+ * Sets a value in a nested object using a path string, mutating the original object
472
+ * @param {Record<string, any>} object
473
+ * @param {string} path_string
474
+ * @param {any} value
475
+ */
476
+ function set_nested_value(object, path_string, value) {
477
+ if (path_string.startsWith("n:")) {
478
+ path_string = path_string.slice(2);
479
+ value = value === "" ? void 0 : parseFloat(value);
480
+ } else if (path_string.startsWith("b:")) {
481
+ path_string = path_string.slice(2);
482
+ value = value === "on";
483
+ }
484
+ deep_set(object, split_path(path_string), value);
485
+ }
486
+ /** Pass this to set_nested_value to delete the last part of the given path */
487
+ var DELETE_KEY = {};
488
+ /**
489
+ * Convert `FormData` into a POJO
490
+ * @param {FormData} data
491
+ */
492
+ function convert_formdata(data) {
493
+ /** @type {Record<string, any>} */
494
+ const result = {};
495
+ for (let key of data.keys()) {
496
+ const is_array = key.endsWith("[]");
497
+ /** @type {any[]} */
498
+ let values = data.getAll(key);
499
+ if (is_array) key = key.slice(0, -2);
500
+ values = values.filter((entry) => typeof entry === "string" || entry.name !== "" || entry.size > 0);
501
+ if (values.length === 0 && !is_array) continue;
502
+ if (key.startsWith("n:")) {
503
+ key = key.slice(2);
504
+ values = values.map((v) => v === "" ? void 0 : parseFloat(v));
505
+ } else if (key.startsWith("b:")) {
506
+ key = key.slice(2);
507
+ values = values.map((v) => v === "on");
508
+ }
509
+ if (values.length > 1 && !is_array) throw new Error(`Form cannot contain duplicated keys — "${key}" has ${values.length} values`);
510
+ set_nested_value(result, key, is_array ? values : values[0]);
511
+ }
512
+ return result;
513
+ }
514
+ var BINARY_FORM_CONTENT_TYPE = "application/x-sveltekit-formdata";
515
+ var BINARY_FORM_VERSION = 0;
516
+ var HEADER_BYTES = 7;
517
+ /**
518
+ * @param {Request} request
519
+ * @returns {Promise<{ data: Record<string, any>; meta: BinaryFormMeta; form_data: FormData | null }>}
520
+ */
521
+ async function deserialize_binary_form(request) {
522
+ if (request.headers.get("content-type") !== "application/x-sveltekit-formdata") {
523
+ const form_data = await request.formData();
524
+ return {
525
+ data: convert_formdata(form_data),
526
+ meta: {},
527
+ form_data
528
+ };
529
+ }
530
+ if (!request.body) throw deserialize_error("no body");
531
+ const reader = request.body.getReader();
532
+ /** @type {Array<Promise<Uint8Array<ArrayBuffer> | undefined>>} */
533
+ const chunks = [];
534
+ /**
535
+ * @param {number} index
536
+ * @returns {Promise<Uint8Array<ArrayBuffer> | undefined>}
537
+ */
538
+ function get_chunk(index) {
539
+ if (index in chunks) return chunks[index];
540
+ let i = chunks.length;
541
+ while (i <= index) {
542
+ chunks[i] = reader.read().then((chunk) => chunk.value);
543
+ i++;
544
+ }
545
+ return chunks[index];
546
+ }
547
+ /**
548
+ * @param {number} offset
549
+ * @param {number} length
550
+ * @returns {Promise<Uint8Array | null>}
551
+ */
552
+ async function get_buffer(offset, length) {
553
+ /** @type {Uint8Array} */
554
+ let start_chunk;
555
+ let chunk_start = 0;
556
+ /** @type {number} */
557
+ let chunk_index;
558
+ for (chunk_index = 0;; chunk_index++) {
559
+ const chunk = await get_chunk(chunk_index);
560
+ if (!chunk) return null;
561
+ const chunk_end = chunk_start + chunk.byteLength;
562
+ if (offset >= chunk_start && offset < chunk_end) {
563
+ start_chunk = chunk;
564
+ break;
565
+ }
566
+ chunk_start = chunk_end;
567
+ }
568
+ if (offset + length <= chunk_start + start_chunk.byteLength) return start_chunk.subarray(offset - chunk_start, offset + length - chunk_start);
569
+ const chunks = [start_chunk.subarray(offset - chunk_start)];
570
+ let cursor = start_chunk.byteLength - offset + chunk_start;
571
+ while (cursor < length) {
572
+ chunk_index++;
573
+ let chunk = await get_chunk(chunk_index);
574
+ if (!chunk) return null;
575
+ if (chunk.byteLength > length - cursor) chunk = chunk.subarray(0, length - cursor);
576
+ chunks.push(chunk);
577
+ cursor += chunk.byteLength;
578
+ }
579
+ const buffer = new Uint8Array(length);
580
+ cursor = 0;
581
+ for (const chunk of chunks) {
582
+ buffer.set(chunk, cursor);
583
+ cursor += chunk.byteLength;
584
+ }
585
+ return buffer;
586
+ }
587
+ const header = await get_buffer(0, HEADER_BYTES);
588
+ if (!header) throw deserialize_error("too short");
589
+ if (header[0] !== BINARY_FORM_VERSION) throw deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`);
590
+ const header_view = new DataView(header.buffer, header.byteOffset, header.byteLength);
591
+ const data_length = header_view.getUint32(1, true);
592
+ const file_offsets_length = header_view.getUint16(5, true);
593
+ const data_buffer = await get_buffer(HEADER_BYTES, data_length);
594
+ if (!data_buffer) throw deserialize_error("data too short");
595
+ /** @type {Array<number | undefined>} */
596
+ let file_offsets;
597
+ /** @type {number} */
598
+ let files_start_offset;
599
+ if (file_offsets_length > 0) {
600
+ const file_offsets_buffer = await get_buffer(HEADER_BYTES + data_length, file_offsets_length);
601
+ if (!file_offsets_buffer) throw deserialize_error("file offset table too short");
602
+ const parsed_offsets = JSON.parse(decoder.decode(file_offsets_buffer));
603
+ if (!Array.isArray(parsed_offsets) || parsed_offsets.some((n) => typeof n !== "number" || !Number.isInteger(n) || n < 0)) throw deserialize_error("invalid file offset table");
604
+ file_offsets = parsed_offsets;
605
+ files_start_offset = HEADER_BYTES + data_length + file_offsets_length;
606
+ }
607
+ /** @type {Array<{ offset: number, size: number }>} */
608
+ const file_spans = [];
609
+ const [data, meta] = parse(decoder.decode(data_buffer), { File: ([name, type, size, last_modified, index]) => {
610
+ if (typeof name !== "string" || typeof type !== "string" || typeof size !== "number" || typeof last_modified !== "number" || typeof index !== "number") throw deserialize_error("invalid file metadata");
611
+ let offset = file_offsets[index];
612
+ if (offset === void 0) throw deserialize_error("duplicate file offset table index");
613
+ file_offsets[index] = void 0;
614
+ offset += files_start_offset;
615
+ file_spans.push({
616
+ offset,
617
+ size
618
+ });
619
+ return new Proxy(new LazyFile(name, type, size, last_modified, get_chunk, offset), { getPrototypeOf() {
620
+ return File.prototype;
621
+ } });
622
+ } });
623
+ file_spans.sort((a, b) => a.offset - b.offset || a.size - b.size);
624
+ for (let i = 1; i < file_spans.length; i++) {
625
+ const previous = file_spans[i - 1];
626
+ const current = file_spans[i];
627
+ const previous_end = previous.offset + previous.size;
628
+ if (previous_end < current.offset) throw deserialize_error("gaps in file data");
629
+ if (previous_end > current.offset) throw deserialize_error("overlapping file data");
630
+ }
631
+ (async () => {
632
+ let has_more = true;
633
+ while (has_more) has_more = !!await get_chunk(chunks.length);
634
+ })().catch(noop);
635
+ return {
636
+ data,
637
+ meta,
638
+ form_data: null
639
+ };
640
+ }
641
+ /**
642
+ * @param {string} message
643
+ */
644
+ function deserialize_error(message) {
645
+ return new SvelteKitError(400, "Bad Request", `Could not deserialize binary form: ${message}`);
646
+ }
647
+ /** @implements {File} */
648
+ var LazyFile = class LazyFile {
649
+ /** @type {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} */
650
+ #get_chunk;
651
+ /** @type {number} */
652
+ #offset;
653
+ /**
654
+ * @param {string} name
655
+ * @param {string} type
656
+ * @param {number} size
657
+ * @param {number} last_modified
658
+ * @param {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} get_chunk
659
+ * @param {number} offset
660
+ */
661
+ constructor(name, type, size, last_modified, get_chunk, offset) {
662
+ this.name = name;
663
+ this.type = type;
664
+ this.size = size;
665
+ this.lastModified = last_modified;
666
+ this.webkitRelativePath = "";
667
+ this.#get_chunk = get_chunk;
668
+ this.#offset = offset;
669
+ this.arrayBuffer = this.arrayBuffer.bind(this);
670
+ this.bytes = this.bytes.bind(this);
671
+ this.slice = this.slice.bind(this);
672
+ this.stream = this.stream.bind(this);
673
+ this.text = this.text.bind(this);
674
+ }
675
+ /** @type {ArrayBuffer | undefined} */
676
+ #buffer;
677
+ async arrayBuffer() {
678
+ this.#buffer ??= await new Response(this.stream()).arrayBuffer();
679
+ return this.#buffer;
680
+ }
681
+ async bytes() {
682
+ return new Uint8Array(await this.arrayBuffer());
683
+ }
684
+ /**
685
+ * @param {number=} start
686
+ * @param {number=} end
687
+ * @param {string=} contentType
688
+ */
689
+ slice(start = 0, end = this.size, contentType = this.type) {
690
+ if (start < 0) start = Math.max(this.size + start, 0);
691
+ else start = Math.min(start, this.size);
692
+ if (end < 0) end = Math.max(this.size + end, 0);
693
+ else end = Math.min(end, this.size);
694
+ const size = Math.max(end - start, 0);
695
+ return new LazyFile(this.name, contentType, size, this.lastModified, this.#get_chunk, this.#offset + start);
696
+ }
697
+ stream() {
698
+ let cursor = 0;
699
+ let chunk_index = 0;
700
+ return new ReadableStream({
701
+ start: async (controller) => {
702
+ let chunk_start = 0;
703
+ /** @type {Uint8Array} */
704
+ let start_chunk;
705
+ for (chunk_index = 0;; chunk_index++) {
706
+ const chunk = await this.#get_chunk(chunk_index);
707
+ if (!chunk) return null;
708
+ const chunk_end = chunk_start + chunk.byteLength;
709
+ if (this.#offset >= chunk_start && this.#offset < chunk_end) {
710
+ start_chunk = chunk;
711
+ break;
712
+ }
713
+ chunk_start = chunk_end;
714
+ }
715
+ if (this.#offset + this.size <= chunk_start + start_chunk.byteLength) {
716
+ controller.enqueue(start_chunk.subarray(this.#offset - chunk_start, this.#offset + this.size - chunk_start));
717
+ controller.close();
718
+ } else {
719
+ controller.enqueue(start_chunk.subarray(this.#offset - chunk_start));
720
+ cursor = start_chunk.byteLength - this.#offset + chunk_start;
721
+ }
722
+ },
723
+ pull: async (controller) => {
724
+ chunk_index++;
725
+ let chunk = await this.#get_chunk(chunk_index);
726
+ if (!chunk) {
727
+ controller.error("incomplete file data");
728
+ controller.close();
729
+ return;
730
+ }
731
+ if (chunk.byteLength > this.size - cursor) chunk = chunk.subarray(0, this.size - cursor);
732
+ controller.enqueue(chunk);
733
+ cursor += chunk.byteLength;
734
+ if (cursor >= this.size) controller.close();
735
+ }
736
+ });
737
+ }
738
+ async text() {
739
+ return decoder.decode(await this.arrayBuffer());
740
+ }
741
+ };
742
+ var path_regex = /^[a-zA-Z_$]\w*(\.[a-zA-Z_$]\w*|\[\d+\])*$/;
743
+ /**
744
+ * @param {string} path
745
+ */
746
+ function split_path(path) {
747
+ if (!path_regex.test(path)) throw new Error(`Invalid path ${path}`);
748
+ return path.split(/\.|\[|\]/).filter(Boolean);
749
+ }
750
+ /**
751
+ * Check if a property key is dangerous and could lead to prototype pollution
752
+ * @param {string} key
753
+ */
754
+ function check_prototype_pollution(key) {
755
+ if (key === "__proto__" || key === "constructor" || key === "prototype") throw new Error(`Invalid key "${key}"`);
756
+ }
757
+ /**
758
+ * Sets a value in a nested object using an array of keys, mutating the original object.
759
+ * @param {Record<string, any>} object
760
+ * @param {string[]} keys
761
+ * @param {any} value
762
+ */
763
+ function deep_set(object, keys, value) {
764
+ let current = object;
765
+ for (let i = 0; i < keys.length - 1; i += 1) {
766
+ const key = keys[i];
767
+ check_prototype_pollution(key);
768
+ const is_array = /^\d+$/.test(keys[i + 1]);
769
+ const inner = Object.hasOwn(current, key) ? current[key] : void 0;
770
+ const exists = inner != null;
771
+ if (exists && is_array !== Array.isArray(inner)) throw new Error(`Invalid array key ${keys[i + 1]}`);
772
+ if (!exists) {
773
+ if (value === DELETE_KEY) return;
774
+ current[key] = is_array ? [] : {};
775
+ }
776
+ current = current[key];
777
+ }
778
+ const final_key = keys[keys.length - 1];
779
+ check_prototype_pollution(final_key);
780
+ if (value === DELETE_KEY) delete current[final_key];
781
+ else current[final_key] = value;
782
+ }
783
+ //#endregion
784
+ //#region node_modules/@sveltejs/kit/src/utils/http.js
785
+ /**
786
+ * Given an Accept header and a list of possible content types, pick
787
+ * the most suitable one to respond with
788
+ * @param {string} accept
789
+ * @param {string[]} types
790
+ */
791
+ function negotiate(accept, types) {
792
+ /** @type {Array<{ type: string, subtype: string, q: number, i: number }>} */
793
+ const parts = [];
794
+ accept.split(",").forEach((str, i) => {
795
+ const match = /([^/ \t]+)\/([^; \t]+)[ \t]*(?:;[ \t]*q=([0-9.]+))?/.exec(str);
796
+ if (match) {
797
+ const [, type, subtype, q = "1"] = match;
798
+ parts.push({
799
+ type,
800
+ subtype,
801
+ q: +q,
802
+ i
803
+ });
804
+ }
805
+ });
806
+ parts.sort((a, b) => {
807
+ if (a.q !== b.q) return b.q - a.q;
808
+ if (a.subtype === "*" !== (b.subtype === "*")) return a.subtype === "*" ? 1 : -1;
809
+ if (a.type === "*" !== (b.type === "*")) return a.type === "*" ? 1 : -1;
810
+ return a.i - b.i;
811
+ });
812
+ let accepted;
813
+ let min_priority = Infinity;
814
+ for (const mimetype of types) {
815
+ const [type, subtype] = mimetype.split("/");
816
+ const priority = parts.findIndex((part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*"));
817
+ if (priority !== -1 && priority < min_priority) {
818
+ accepted = mimetype;
819
+ min_priority = priority;
820
+ }
821
+ }
822
+ return accepted;
823
+ }
824
+ /**
825
+ * Reads all `Set-Cookie` headers as separate values. `Headers.get('set-cookie')`
826
+ * collapses them into a single comma-joined string that browsers cannot parse, so
827
+ * we use `Headers.getSetCookie()` where available and fall back to splitting the
828
+ * joined string otherwise.
829
+ *
830
+ * TODO 3.0 `getSetCookie` is available in Node 19.7+; once we drop support for
831
+ * older versions we can use it directly and remove the `splitCookiesString` fallback
832
+ * @param {Headers} headers
833
+ * @returns {string[]}
834
+ */
835
+ function get_set_cookies(headers) {
836
+ if (typeof headers.getSetCookie === "function") return headers.getSetCookie();
837
+ const set_cookie = headers.get("set-cookie");
838
+ return set_cookie ? splitCookiesString(set_cookie) : [];
839
+ }
840
+ /**
841
+ * Returns `true` if the request contains a `content-type` header with the given type
842
+ * @param {Request} request
843
+ * @param {...string} types
844
+ */
845
+ function is_content_type(request, ...types) {
846
+ const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? "";
847
+ return types.includes(type.toLowerCase());
848
+ }
849
+ /**
850
+ * @param {Request} request
851
+ */
852
+ function is_form_content_type(request) {
853
+ return is_content_type(request, "application/x-www-form-urlencoded", "multipart/form-data", "text/plain", BINARY_FORM_CONTENT_TYPE);
854
+ }
855
+ //#endregion
856
+ //#region node_modules/@sveltejs/kit/src/utils/escape.js
857
+ /**
858
+ * When inside a double-quoted attribute value, only `&` and `"` hold special meaning.
859
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(double-quoted)-state
860
+ * @type {Record<string, string>}
861
+ */
862
+ var escape_html_attr_dict = {
863
+ "&": "&amp;",
864
+ "\"": "&quot;"
865
+ };
866
+ /**
867
+ * @type {Record<string, string>}
868
+ */
869
+ var escape_html_dict = {
870
+ "&": "&amp;",
871
+ "<": "&lt;"
872
+ };
873
+ var escape_html_attr_regex = new RegExp(`[${Object.keys(escape_html_attr_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`, "g");
874
+ var escape_html_regex = new RegExp(`[${Object.keys(escape_html_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`, "g");
875
+ /**
876
+ * Escapes unpaired surrogates (which are allowed in js strings but invalid in HTML) and
877
+ * escapes characters that are special.
878
+ *
879
+ * @param {string} str
880
+ * @param {boolean} [is_attr]
881
+ * @returns {string} escaped string
882
+ * @example const html = `<tag data-value="${escape_html('value', true)}">...</tag>`;
883
+ */
884
+ function escape_html(str, is_attr) {
885
+ const dict = is_attr ? escape_html_attr_dict : escape_html_dict;
886
+ return str.replace(is_attr ? escape_html_attr_regex : escape_html_regex, (match) => {
887
+ if (match.length === 2) return match;
888
+ return dict[match] ?? `&#${match.charCodeAt(0)};`;
889
+ });
890
+ }
891
+ //#endregion
892
+ //#region node_modules/@sveltejs/kit/src/runtime/server/utils.js
893
+ /** @import { ServerHooks } from 'types' */
894
+ /**
895
+ * @param {Partial<Record<import('types').HttpMethod, any>>} mod
896
+ * @param {import('types').HttpMethod} method
897
+ */
898
+ function method_not_allowed(mod, method) {
899
+ return text(`${method} method not allowed`, {
900
+ status: 405,
901
+ headers: { allow: allowed_methods(mod).join(", ") }
902
+ });
903
+ }
904
+ /** @param {Partial<Record<import('types').HttpMethod, any>>} mod */
905
+ function allowed_methods(mod) {
906
+ const allowed = ENDPOINT_METHODS.filter((method) => method in mod);
907
+ if ("GET" in mod && !("HEAD" in mod)) allowed.push("HEAD");
908
+ return allowed;
909
+ }
910
+ /**
911
+ * @param {import('types').SSROptions} options
912
+ */
913
+ function get_global_name(options) {
914
+ return `__sveltekit_${options.version_hash}`;
915
+ }
916
+ /**
917
+ * Return as a response that renders the error.html
918
+ *
919
+ * @param {import('types').SSROptions} options
920
+ * @param {number} status
921
+ * @param {string} message
922
+ */
923
+ function static_error_page(options, status, message) {
924
+ return text(options.templates.error({
925
+ status,
926
+ message: escape_html(message)
927
+ }), {
928
+ headers: { "content-type": "text/html; charset=utf-8" },
929
+ status
930
+ });
931
+ }
932
+ /**
933
+ * @param {import('@sveltejs/kit').RequestEvent} event
934
+ * @param {import('types').RequestState} state
935
+ * @param {import('types').SSROptions} options
936
+ * @param {unknown} error
937
+ */
938
+ async function handle_fatal_error(event, state, options, error) {
939
+ error = error instanceof HttpError ? error : coalesce_to_error(error);
940
+ const status = get_status(error);
941
+ const body = await handle_error_and_jsonify(event, state, options, error);
942
+ const type = negotiate(event.request.headers.get("accept") || "text/html", ["application/json", "text/html"]);
943
+ if (event.isDataRequest || type === "application/json") return json(body, { status });
944
+ return static_error_page(options, status, body.message);
945
+ }
946
+ /**
947
+ * @param {import('@sveltejs/kit').RequestEvent} event
948
+ * @param {import('types').RequestState} state
949
+ * @param {import('types').SSROptions} options
950
+ * @param {any} error
951
+ * @returns {Promise<App.Error>}
952
+ */
953
+ async function handle_error_and_jsonify(event, state, options, error) {
954
+ if (error instanceof HttpError) return {
955
+ message: "Unknown Error",
956
+ ...error.body
957
+ };
958
+ const status = get_status(error);
959
+ const message = get_message(error);
960
+ return await with_request_store({
961
+ event,
962
+ state
963
+ }, () => options.hooks.handleError({
964
+ error,
965
+ event,
966
+ status,
967
+ message
968
+ })) ?? { message };
969
+ }
970
+ /**
971
+ * @param {number} status
972
+ * @param {string} location
973
+ */
974
+ function redirect_response(status, location) {
975
+ return new Response(void 0, {
976
+ status,
977
+ headers: { location }
978
+ });
979
+ }
980
+ /**
981
+ * @param {import('@sveltejs/kit').RequestEvent} event
982
+ * @param {Error & { path: string }} error
983
+ */
984
+ function clarify_devalue_error(event, error) {
985
+ if (error.path) return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path}). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#Universal-hooks-transport.`;
986
+ if (error.path === "") return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`;
987
+ return error.message;
988
+ }
989
+ /**
990
+ * @param {import('types').ServerDataNode} node
991
+ */
992
+ function serialize_uses(node) {
993
+ const uses = {};
994
+ if (node.uses && node.uses.dependencies.size > 0) uses.dependencies = Array.from(node.uses.dependencies);
995
+ if (node.uses && node.uses.search_params.size > 0) uses.search_params = Array.from(node.uses.search_params);
996
+ if (node.uses && node.uses.params.size > 0) uses.params = Array.from(node.uses.params);
997
+ if (node.uses?.parent) uses.parent = 1;
998
+ if (node.uses?.route) uses.route = 1;
999
+ if (node.uses?.url) uses.url = 1;
1000
+ return uses;
1001
+ }
1002
+ /**
1003
+ * Returns `true` if the given path was prerendered
1004
+ * @param {import('@sveltejs/kit').SSRManifest} manifest
1005
+ * @param {string} pathname Should include the base and be decoded
1006
+ */
1007
+ function has_prerendered_path(manifest, pathname) {
1008
+ return manifest._.prerendered_routes.has(pathname) || pathname.at(-1) === "/" && manifest._.prerendered_routes.has(pathname.slice(0, -1));
1009
+ }
1010
+ /**
1011
+ * Formats the error into a nice message with sanitized stack trace
1012
+ * @param {number} status
1013
+ * @param {Error} error
1014
+ * @param {import('@sveltejs/kit').RequestEvent} event
1015
+ */
1016
+ function format_server_error(status, error, event) {
1017
+ const formatted_text = `\n\x1b[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1b[0m`;
1018
+ if (status === 404) return formatted_text;
1019
+ return `${formatted_text}\n${error.stack}`;
1020
+ }
1021
+ /**
1022
+ * Returns the filename without the extension. e.g., `+page.server`, `+page`, etc.
1023
+ * @param {string | undefined} node_id
1024
+ * @returns {string}
1025
+ */
1026
+ function get_node_type(node_id) {
1027
+ const filename = (node_id?.split("/"))?.at(-1);
1028
+ if (!filename) return "unknown";
1029
+ return filename.split(".").slice(0, -1).join(".");
1030
+ }
1031
+ /**
1032
+ * Creates a serialiser for non-arbitrary POJOs using the app's transport hook
1033
+ * @param {ServerHooks['transport']} transport
1034
+ * @returns {(thing: unknown) => string | undefined}
1035
+ */
1036
+ function create_replacer(transport) {
1037
+ /** @param {unknown} thing */
1038
+ const replacer = (thing) => {
1039
+ for (const key in transport) {
1040
+ const encoded = transport[key].encode(thing);
1041
+ if (encoded) return `app.decode('${key}', ${uneval(encoded, replacer)})`;
1042
+ }
1043
+ };
1044
+ return replacer;
1045
+ }
1046
+
1047
+ export { ENDPOINT_METHODS as E, PAGE_METHODS as P, handle_fatal_error as a, method_not_allowed as b, handle_error_and_jsonify as c, get_global_name as d, create_replacer as e, format_server_error as f, get_set_cookies as g, has_prerendered_path as h, is_form_content_type as i, json as j, serialize_uses as k, clarify_devalue_error as l, merge_tracing as m, negotiate as n, get_node_type as o, parseString as p, isRedirect as q, redirect_response as r, static_error_page as s, text as t, escape_html as u, error as v, with_request_store as w, deserialize_binary_form as x, splitCookiesString as y };
1048
+ //# sourceMappingURL=utils.js-9oI5Oz0w.js.map