nolzu 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +24 -7
  3. package/build/client/_app/immutable/assets/0.SPD4wYkc.css +1 -0
  4. package/build/client/_app/immutable/assets/1.BRilEoOO.css +1 -0
  5. package/build/client/_app/immutable/assets/10.DwLiBGDj.css +1 -0
  6. package/build/client/_app/immutable/assets/11.D_TtWT3D.css +1 -0
  7. package/build/client/_app/immutable/assets/12.CSVGmtUY.css +1 -0
  8. package/build/client/_app/immutable/assets/13.qTa7IHbg.css +1 -0
  9. package/build/client/_app/immutable/assets/19.CbCFXKb8.css +1 -0
  10. package/build/client/_app/immutable/assets/2.CfHhgI77.css +1 -0
  11. package/build/client/_app/immutable/assets/20.C5CSZhyT.css +1 -0
  12. package/build/client/_app/immutable/assets/21.BBpYkZcc.css +1 -0
  13. package/build/client/_app/immutable/assets/22.C9RgY9kl.css +1 -0
  14. package/build/client/_app/immutable/assets/23.B6Dp9RJO.css +1 -0
  15. package/build/client/_app/immutable/assets/24.C7g2abUW.css +1 -0
  16. package/build/client/_app/immutable/assets/26.DTMI6ROV.css +1 -0
  17. package/build/client/_app/immutable/assets/27.AxXMpDkB.css +1 -0
  18. package/build/client/_app/immutable/assets/28.939ac-98.css +1 -0
  19. package/build/client/_app/immutable/assets/3.3lqex1t-.css +1 -0
  20. package/build/client/_app/immutable/assets/4.C52MzO_d.css +1 -0
  21. package/build/client/_app/immutable/assets/5.CsfJAwvS.css +1 -0
  22. package/build/client/_app/immutable/assets/8.ByspUp-s.css +1 -0
  23. package/build/client/_app/immutable/assets/9.BCSFZmce.css +1 -0
  24. package/build/client/_app/immutable/assets/Banner.DDqfpWLD.css +1 -0
  25. package/build/client/_app/immutable/assets/BoardOff.mpX08-Be.css +1 -0
  26. package/build/client/_app/immutable/assets/Button.BlwsEgUc.css +1 -0
  27. package/build/client/_app/immutable/assets/Chip.qAAa6_e5.css +1 -0
  28. package/build/client/_app/immutable/assets/Dialog.D5Ln60a8.css +1 -0
  29. package/build/client/_app/immutable/assets/FeaturePanels.DZ_Mth5M.css +1 -0
  30. package/build/client/_app/immutable/assets/FolderBrowser.DBmRWDCH.css +1 -0
  31. package/build/client/_app/immutable/assets/Geist-Variable.Bj2R_7yk.woff2 +0 -0
  32. package/build/client/_app/immutable/assets/GeistMono-Variable.Dispecij.woff2 +0 -0
  33. package/build/client/_app/immutable/assets/HelpTip.DF6T9nns.css +1 -0
  34. package/build/client/_app/immutable/assets/InfoBox.CpavOykF.css +1 -0
  35. package/build/client/_app/immutable/assets/KeyCaps.D2t-lY-8.css +1 -0
  36. package/build/client/_app/immutable/assets/LogLine.Bu4feLn5.css +1 -0
  37. package/build/client/_app/immutable/assets/Markdown.DI6AtWAc.css +1 -0
  38. package/build/client/_app/immutable/assets/ModelPicker.DQzj7Nj8.css +1 -0
  39. package/build/client/_app/immutable/assets/OptionButtons.BYiyOXOE.css +1 -0
  40. package/build/client/_app/immutable/assets/PeekPanel.DzMdHoqg.css +1 -0
  41. package/build/client/_app/immutable/assets/ScoutPage.CVIiLy5c.css +1 -0
  42. package/build/client/_app/immutable/assets/SetupSteps.B6pZP1Bk.css +1 -0
  43. package/build/client/_app/immutable/assets/Skeleton.BC-1_U5d.css +1 -0
  44. package/build/client/_app/immutable/assets/SlotsMeter.Dq7GGYlD.css +1 -0
  45. package/build/client/_app/immutable/assets/StartConfirm.DxNN2AOb.css +1 -0
  46. package/build/client/_app/immutable/assets/StatePill.CGWFVUUg.css +1 -0
  47. package/build/client/_app/immutable/assets/Streamed.DpZ6wgO2.css +1 -0
  48. package/build/client/_app/immutable/assets/card-pulls.C5uGMuAh.css +1 -0
  49. package/build/client/_app/immutable/assets/next-step.CKg1w06J.css +1 -0
  50. package/build/client/_app/immutable/chunks/-B5EclhK.js +1 -0
  51. package/build/client/_app/immutable/chunks/-Q3zApAy.js +1 -0
  52. package/build/client/_app/immutable/chunks/6-hwN_Ik.js +3 -0
  53. package/build/client/_app/immutable/chunks/B16UF4PA.js +11 -0
  54. package/build/client/_app/immutable/chunks/B1V3h1VF.js +1 -0
  55. package/build/client/_app/immutable/chunks/B2d2Mkuz.js +68 -0
  56. package/build/client/_app/immutable/chunks/B2yzhiEa.js +1 -0
  57. package/build/client/_app/immutable/chunks/B5zDDQUU.js +2 -0
  58. package/build/client/_app/immutable/chunks/B8DHSiWf.js +1 -0
  59. package/build/client/_app/immutable/chunks/B8z33EzI.js +1 -0
  60. package/build/client/_app/immutable/chunks/BCRkrH6c.js +1 -0
  61. package/build/client/_app/immutable/chunks/BCScjOxu.js +1 -0
  62. package/build/client/_app/immutable/chunks/BMUQtCEC.js +1 -0
  63. package/build/client/_app/immutable/chunks/BNnfkvZM.js +1 -0
  64. package/build/client/_app/immutable/chunks/BelWyZaW.js +1 -0
  65. package/build/client/_app/immutable/chunks/BhZpqODT.js +1 -0
  66. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  67. package/build/client/_app/immutable/chunks/BmafI-Bs.js +1 -0
  68. package/build/client/_app/immutable/chunks/BvRk9kiK.js +0 -0
  69. package/build/client/_app/immutable/chunks/C4i6bdQg.js +1 -0
  70. package/build/client/_app/immutable/chunks/C8u5TyIB.js +1 -0
  71. package/build/client/_app/immutable/chunks/CFs2xhoy.js +1 -0
  72. package/build/client/_app/immutable/chunks/CIm2DioU.js +1 -0
  73. package/build/client/_app/immutable/chunks/CONqGBXC.js +1 -0
  74. package/build/client/_app/immutable/chunks/CSOz40qO.js +1 -0
  75. package/build/client/_app/immutable/chunks/CXxuD1ef.js +3 -0
  76. package/build/client/_app/immutable/chunks/CarrGsZA.js +2 -0
  77. package/build/client/_app/immutable/chunks/CdrmTD44.js +1 -0
  78. package/build/client/_app/immutable/chunks/CfJRH9gh.js +2 -0
  79. package/build/client/_app/immutable/chunks/Ci7C9Cki.js +1 -0
  80. package/build/client/_app/immutable/chunks/CkOTL1vK.js +1 -0
  81. package/build/client/_app/immutable/chunks/CngTtGc_.js +1 -0
  82. package/build/client/_app/immutable/chunks/Cp3A1zR8.js +1 -0
  83. package/build/client/_app/immutable/chunks/CwtMnwNL.js +3 -0
  84. package/build/client/_app/immutable/chunks/Cy7f_oXg.js +1 -0
  85. package/build/client/_app/immutable/chunks/D-wwLm5t.js +1 -0
  86. package/build/client/_app/immutable/chunks/D2imbgaf.js +1 -0
  87. package/build/client/_app/immutable/chunks/D32mip60.js +1 -0
  88. package/build/client/_app/immutable/chunks/D46Vk19W.js +1 -0
  89. package/build/client/_app/immutable/chunks/DCUUgo-6.js +1 -0
  90. package/build/client/_app/immutable/chunks/DFjnjJjy.js +1 -0
  91. package/build/client/_app/immutable/chunks/DHMbSbMg.js +1 -0
  92. package/build/client/_app/immutable/chunks/DJOFx2wx.js +1 -0
  93. package/build/client/_app/immutable/chunks/DV4tvxHp.js +3 -0
  94. package/build/client/_app/immutable/chunks/DXk_5YEw.js +1 -0
  95. package/build/client/_app/immutable/chunks/DjgnRLJt.js +1 -0
  96. package/build/client/_app/immutable/chunks/DlWlQ_vP.js +1 -0
  97. package/build/client/_app/immutable/chunks/DpIAei2y.js +2 -0
  98. package/build/client/_app/immutable/chunks/Dt-HX3Vu.js +1 -0
  99. package/build/client/_app/immutable/chunks/DuSthUWX.js +1 -0
  100. package/build/client/_app/immutable/chunks/Ecfl8TOn.js +2 -0
  101. package/build/client/_app/immutable/chunks/ITHE99Aa.js +1 -0
  102. package/build/client/_app/immutable/chunks/Khdge0KS.js +1 -0
  103. package/build/client/_app/immutable/chunks/LMEKNlm0.js +1 -0
  104. package/build/client/_app/immutable/chunks/OnIeaiuO.js +1 -0
  105. package/build/client/_app/immutable/chunks/VFQLu55q.js +1 -0
  106. package/build/client/_app/immutable/chunks/ZsUxKnQw.js +1 -0
  107. package/build/client/_app/immutable/chunks/aWP8DVhV.js +1 -0
  108. package/build/client/_app/immutable/chunks/bB04Xp1f.js +1 -0
  109. package/build/client/_app/immutable/chunks/eylBqhv8.js +3 -0
  110. package/build/client/_app/immutable/chunks/hx0ssLL_.js +2 -0
  111. package/build/client/_app/immutable/chunks/mumDj17t.js +1 -0
  112. package/build/client/_app/immutable/chunks/pZYp3_TE.js +1 -0
  113. package/build/client/_app/immutable/chunks/tImwjqWn.js +1 -0
  114. package/build/client/_app/immutable/chunks/uBIymjUX.js +1 -0
  115. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  116. package/build/client/_app/immutable/entry/app.DVZ1wE36.js +2 -0
  117. package/build/client/_app/immutable/entry/start.DluCc61B.js +1 -0
  118. package/build/client/_app/immutable/nodes/0.CwNFevXf.js +1 -0
  119. package/build/client/_app/immutable/nodes/1.BR6FYiC-.js +1 -0
  120. package/build/client/_app/immutable/nodes/10.wNwBFtom.js +2 -0
  121. package/build/client/_app/immutable/nodes/11.DpoIbMNF.js +2 -0
  122. package/build/client/_app/immutable/nodes/12.CWdUJ8l3.js +2 -0
  123. package/build/client/_app/immutable/nodes/13.CZ2uTvNS.js +1 -0
  124. package/build/client/_app/immutable/nodes/14.CzgyXuvL.js +1 -0
  125. package/build/client/_app/immutable/nodes/15.CzgyXuvL.js +1 -0
  126. package/build/client/_app/immutable/nodes/16.odL9eB2N.js +1 -0
  127. package/build/client/_app/immutable/nodes/17.B-RnUeVU.js +1 -0
  128. package/build/client/_app/immutable/nodes/18.BLYKxyq2.js +1 -0
  129. package/build/client/_app/immutable/nodes/19.CgyFfPqF.js +3 -0
  130. package/build/client/_app/immutable/nodes/2.CCWT41Qr.js +1 -0
  131. package/build/client/_app/immutable/nodes/20.BBk5-krg.js +1 -0
  132. package/build/client/_app/immutable/nodes/21.CJoU3s1A.js +2 -0
  133. package/build/client/_app/immutable/nodes/22.CoRvPh8m.js +1 -0
  134. package/build/client/_app/immutable/nodes/23.zXO3NjnM.js +3 -0
  135. package/build/client/_app/immutable/nodes/24.CmO27TED.js +1 -0
  136. package/build/client/_app/immutable/nodes/26.TVKNr_xX.js +18 -0
  137. package/build/client/_app/immutable/nodes/27.RojtGU_o.js +1 -0
  138. package/build/client/_app/immutable/nodes/28.CVTdeeSI.js +2 -0
  139. package/build/client/_app/immutable/nodes/3.Cgib7Vi6.js +1 -0
  140. package/build/client/_app/immutable/nodes/4.CnMwOCec.js +1 -0
  141. package/build/client/_app/immutable/nodes/5.-NqYtQj_.js +1 -0
  142. package/build/client/_app/immutable/nodes/6.D5xk-UBM.js +1 -0
  143. package/build/client/_app/immutable/nodes/7.IL4b-DII.js +1 -0
  144. package/build/client/_app/immutable/nodes/8.DJrguHjO.js +11 -0
  145. package/build/client/_app/immutable/nodes/9.DTUSzWiK.js +1 -0
  146. package/build/client/_app/version.json +1 -0
  147. package/build/client/favicon.svg +7 -0
  148. package/build/env.js +70 -0
  149. package/build/handler.js +26 -0
  150. package/build/index.js +149 -0
  151. package/build/server/chunks/chunks/Banner.js-D4mtxUfF.js +17 -0
  152. package/build/server/chunks/chunks/BoardOff.js-Dg5-LoR3.js +1627 -0
  153. package/build/server/chunks/chunks/Button.js-Buh9rnpu.js +43 -0
  154. package/build/server/chunks/chunks/Chip.js-xZ7vFkHx.js +12 -0
  155. package/build/server/chunks/chunks/Dialog.js-CGpwdpM-.js +60 -0
  156. package/build/server/chunks/chunks/FeaturePanels.js-B2sKozgF.js +84 -0
  157. package/build/server/chunks/chunks/FolderBrowser.js-DUHFhDaX.js +28 -0
  158. package/build/server/chunks/chunks/HelpTip.js-CzemvmjC.js +19 -0
  159. package/build/server/chunks/chunks/InfoBox.js-BJiVzZgw.js +10 -0
  160. package/build/server/chunks/chunks/KeyCaps.js-BMI2Hrh2.js +37 -0
  161. package/build/server/chunks/chunks/LogLine.js-2b7uX__H.js +35 -0
  162. package/build/server/chunks/chunks/Markdown.js-Clud88KU.js +4233 -0
  163. package/build/server/chunks/chunks/ModelPicker.js-FuBgyKIA.js +141 -0
  164. package/build/server/chunks/chunks/OptionButtons.js-LQKrAwUX.js +28 -0
  165. package/build/server/chunks/chunks/PeekPanel.js-aZ-r_v3N.js +375 -0
  166. package/build/server/chunks/chunks/ScoutPage.js-2DcNia96.js +733 -0
  167. package/build/server/chunks/chunks/SetupSteps.js-D7TAF7xa.js +66 -0
  168. package/build/server/chunks/chunks/Skeleton.js-diCP2sd5.js +30 -0
  169. package/build/server/chunks/chunks/SlotsMeter.js-BV_sAGf5.js +18 -0
  170. package/build/server/chunks/chunks/StartConfirm.js-CzEdFtbO.js +124 -0
  171. package/build/server/chunks/chunks/StatePill.js-CM7-HXNM.js +27 -0
  172. package/build/server/chunks/chunks/Streamed.js-_NgwNMMs.js +43 -0
  173. package/build/server/chunks/chunks/_page.server.js-BaGoctEY.js +1419 -0
  174. package/build/server/chunks/chunks/activity.js-CSoPUQLq.js +84 -0
  175. package/build/server/chunks/chunks/add-repo.js-DtHEobfm.js +305 -0
  176. package/build/server/chunks/chunks/app-header.js-CCflgeEQ.js +13 -0
  177. package/build/server/chunks/chunks/app.js-CuPn8jtk.js +12 -0
  178. package/build/server/chunks/chunks/bin.js-Cyb2cYLc.js +58 -0
  179. package/build/server/chunks/chunks/board-keys.js-CW3qw-MC.js +32 -0
  180. package/build/server/chunks/chunks/board-page.js-D0tdsE9J.js +860 -0
  181. package/build/server/chunks/chunks/board.js-BxL3CjB1.js +203 -0
  182. package/build/server/chunks/chunks/browser-test.js-DJEpOoVz.js +170 -0
  183. package/build/server/chunks/chunks/card-pulls.js-d_uGmBB3.js +229 -0
  184. package/build/server/chunks/chunks/card-repos.js-QaMCxiyV.js +59 -0
  185. package/build/server/chunks/chunks/chain-store.js-D42m8DUo.js +91 -0
  186. package/build/server/chunks/chunks/chain.js-CJFRywIC.js +52 -0
  187. package/build/server/chunks/chunks/changes.js-D8ITRMgU.js +513 -0
  188. package/build/server/chunks/chunks/checkout.js-Ys5L_gA4.js +319 -0
  189. package/build/server/chunks/chunks/client.js-B7jIMDuS.js +68 -0
  190. package/build/server/chunks/chunks/clipboard.js-qXskOBim.js +12 -0
  191. package/build/server/chunks/chunks/cloud-status.js-hy-9zUVX.js +95 -0
  192. package/build/server/chunks/chunks/coach.js-BhNB14rV.js +296 -0
  193. package/build/server/chunks/chunks/comments.js-1nWJQptB.js +311 -0
  194. package/build/server/chunks/chunks/commit-message.js-CMcNZUZw.js +8 -0
  195. package/build/server/chunks/chunks/create-card.js-DKtprMG6.js +498 -0
  196. package/build/server/chunks/chunks/db.js-pqoVpAzG.js +80 -0
  197. package/build/server/chunks/chunks/diff-comments.js-BSCuay_U.js +95 -0
  198. package/build/server/chunks/chunks/discussion.js-rJ5OMfvX.js +355 -0
  199. package/build/server/chunks/chunks/display.js-Bf-vGQ7Q.js +61 -0
  200. package/build/server/chunks/chunks/elapsed.js-DikkNhaD.js +27 -0
  201. package/build/server/chunks/chunks/engine.js-DS5zUwsE.js +115 -0
  202. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  203. package/build/server/chunks/chunks/estimate.js-BHTYVTaQ.js +2484 -0
  204. package/build/server/chunks/chunks/evidence-timeline.js-Dk0dTZIy.js +253 -0
  205. package/build/server/chunks/chunks/evidence.js-CT3tWdbB.js +257 -0
  206. package/build/server/chunks/chunks/exports.js-Hn-WQRMB.js +150 -0
  207. package/build/server/chunks/chunks/features.svelte.js-DNsFmFZb.js +10 -0
  208. package/build/server/chunks/chunks/files.js-V46lE0-6.js +46 -0
  209. package/build/server/chunks/chunks/filter.js-CsmCtJMd.js +11 -0
  210. package/build/server/chunks/chunks/forms.js-03E8qnFz.js +35 -0
  211. package/build/server/chunks/chunks/gate.js-Cbqo8Yy0.js +82 -0
  212. package/build/server/chunks/chunks/getting-started.js-DKbHofN5.js +55 -0
  213. package/build/server/chunks/chunks/git.js-l43vBHqs.js +16 -0
  214. package/build/server/chunks/chunks/home-path.js-BXgrl3TP.js +11 -0
  215. package/build/server/chunks/chunks/hub-link.js-B5kjLyyd.js +1532 -0
  216. package/build/server/chunks/chunks/internal.js-DaSBO6jY.js +1239 -0
  217. package/build/server/chunks/chunks/internal2.js-D6AKyUgY.js +27 -0
  218. package/build/server/chunks/chunks/knowledge-page.js-D2ALB3v9.js +292 -0
  219. package/build/server/chunks/chunks/knowledge-revert.js-2eyN9Lcb.js +109 -0
  220. package/build/server/chunks/chunks/knowledge.js--eAgdzNx.js +394 -0
  221. package/build/server/chunks/chunks/last-board.js-BemeiK3t.js +23 -0
  222. package/build/server/chunks/chunks/log.js-R2zUph6T.js +228 -0
  223. package/build/server/chunks/chunks/loop.js-D3guWKLp.js +4038 -0
  224. package/build/server/chunks/chunks/loop2.js-B_Qd2m4y.js +67 -0
  225. package/build/server/chunks/chunks/navigation.js-DQJMz-SM.js +2 -0
  226. package/build/server/chunks/chunks/new-project.js-DNcr9JpB.js +305 -0
  227. package/build/server/chunks/chunks/next-step.js-B8Kl0Iv9.js +522 -0
  228. package/build/server/chunks/chunks/node.js-Bz2jT5wt.js +3381 -0
  229. package/build/server/chunks/chunks/now-live.svelte.js-hIaDgjJ3.js +13 -0
  230. package/build/server/chunks/chunks/now-snapshot.js-zGKLIzox.js +207 -0
  231. package/build/server/chunks/chunks/now.js-Dfm-o0Ha.js +765 -0
  232. package/build/server/chunks/chunks/onboard.js-LBqPOxyU.js +1525 -0
  233. package/build/server/chunks/chunks/ordinal.js-Bm_9QEBD.js +12 -0
  234. package/build/server/chunks/chunks/overview.js-C32iHkXD.js +1108 -0
  235. package/build/server/chunks/chunks/page-keys.svelte.js-D8vXA_8Z.js +14 -0
  236. package/build/server/chunks/chunks/patch.js-Bl7vwsUj.js +62 -0
  237. package/build/server/chunks/chunks/paths.js-DVRjNYFW.js +19 -0
  238. package/build/server/chunks/chunks/peek.js-D9sSjT9t.js +95 -0
  239. package/build/server/chunks/chunks/plan.js-DFq5ntMM.js +143 -0
  240. package/build/server/chunks/chunks/project-files-notice.js-CcqcBgUP.js +19 -0
  241. package/build/server/chunks/chunks/project-files.js-DTC4jUxy.js +52 -0
  242. package/build/server/chunks/chunks/project-folder.js-CoKgPiM0.js +22 -0
  243. package/build/server/chunks/chunks/projects.js-bw2V11od.js +989 -0
  244. package/build/server/chunks/chunks/prs.js-CLfImauu.js +118 -0
  245. package/build/server/chunks/chunks/publish.js-D2vWpIJU.js +195 -0
  246. package/build/server/chunks/chunks/pull-list.js-BCIBJdyz.js +691 -0
  247. package/build/server/chunks/chunks/qa-ask.svelte.js-8Hf1JWW2.js +47 -0
  248. package/build/server/chunks/chunks/qa-setup.js-DFOEcNxH.js +1241 -0
  249. package/build/server/chunks/chunks/quiet.js-1GKY40Ay.js +104 -0
  250. package/build/server/chunks/chunks/rail.js-BePBwOqZ.js +135 -0
  251. package/build/server/chunks/chunks/review.js-MPqnq9Gy.js +98 -0
  252. package/build/server/chunks/chunks/routing.js-B8s1QwSP.js +265 -0
  253. package/build/server/chunks/chunks/run-log.js-CnN2jOcg.js +94 -0
  254. package/build/server/chunks/chunks/run.js-COSejjLl.js +34 -0
  255. package/build/server/chunks/chunks/scout-findings.js-CqJti10a.js +940 -0
  256. package/build/server/chunks/chunks/scout.js-Bm7wQLX2.js +62 -0
  257. package/build/server/chunks/chunks/sentinels.js-BXvpnzr3.js +13 -0
  258. package/build/server/chunks/chunks/server.js-BR0D07DR.js +3803 -0
  259. package/build/server/chunks/chunks/settings-sections.js-V70W7BkZ.js +103 -0
  260. package/build/server/chunks/chunks/shared.js-BgfCUZUJ.js +776 -0
  261. package/build/server/chunks/chunks/sign-in.js-O-pBhi19.js +14 -0
  262. package/build/server/chunks/chunks/snapshot.js-BekzL_He.js +38 -0
  263. package/build/server/chunks/chunks/spend.js-BabnR69T.js +63 -0
  264. package/build/server/chunks/chunks/src.js-Cm8RAH_q.js +609 -0
  265. package/build/server/chunks/chunks/src2.js-CV8tsClO.js +1186 -0
  266. package/build/server/chunks/chunks/src3.js-h9tTEbVb.js +11222 -0
  267. package/build/server/chunks/chunks/stack.js-CMWXhMZS.js +13 -0
  268. package/build/server/chunks/chunks/standup.js-D-qBnMx4.js +103 -0
  269. package/build/server/chunks/chunks/state.js-BTDrgu7s.js +71 -0
  270. package/build/server/chunks/chunks/stream.js-D6r6iqjD.js +66 -0
  271. package/build/server/chunks/chunks/terms.js-DPZztSEn.js +88 -0
  272. package/build/server/chunks/chunks/ticket-system.js-Dj9R3XJw.js +147 -0
  273. package/build/server/chunks/chunks/ticket.js-6sj-2ZEM.js +110 -0
  274. package/build/server/chunks/chunks/timesheet.js-DfhIokoE.js +212 -0
  275. package/build/server/chunks/chunks/timesheet2.js-Cu95ddl3.js +84 -0
  276. package/build/server/chunks/chunks/to-workspace.js-DiOJP59J.js +308 -0
  277. package/build/server/chunks/chunks/toast-stack.svelte.js-CXIg3_KT.js +10 -0
  278. package/build/server/chunks/chunks/uneval.js-VnZcgzZr.js +488 -0
  279. package/build/server/chunks/chunks/utils.js-DQTBh7_6.js +1006 -0
  280. package/build/server/chunks/chunks/when-said.js-0F9asAma.js +35 -0
  281. package/build/server/chunks/chunks/workspace.js-BBdJRon9.js +212 -0
  282. package/build/server/chunks/entries/endpoints/api/board/_server.ts.js-BlYC_lpV.js +69 -0
  283. package/build/server/chunks/entries/endpoints/api/board/minimize/_server.ts.js-Wddt9YPR.js +68 -0
  284. package/build/server/chunks/entries/endpoints/api/board/move/_server.ts.js-BwZpCKx0.js +68 -0
  285. package/build/server/chunks/entries/endpoints/api/board/promote/_server.ts.js-Cw6kvkMq.js +68 -0
  286. package/build/server/chunks/entries/endpoints/api/board/pulls/_server.ts.js-DFhpbiMo.js +71 -0
  287. package/build/server/chunks/entries/endpoints/api/board/stop/_server.ts.js-D5eylDMw.js +68 -0
  288. package/build/server/chunks/entries/endpoints/api/card/_key_/answer/_server.ts.js-CG8xh52y.js +68 -0
  289. package/build/server/chunks/entries/endpoints/api/card/_key_/branch/_server.ts.js-a5_P9voA.js +40 -0
  290. package/build/server/chunks/entries/endpoints/api/card/_key_/chain/_server.ts.js-tJvQy6RK.js +70 -0
  291. package/build/server/chunks/entries/endpoints/api/card/_key_/checkouts/_server.ts.js-B2_gx6vF.js +41 -0
  292. package/build/server/chunks/entries/endpoints/api/card/_key_/choice/_server.ts.js-pmAdIQkK.js +34 -0
  293. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_id_/_server.ts.js-C5NxGWw3.js +68 -0
  294. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_server.ts.js-0rw7UNv8.js +64 -0
  295. package/build/server/chunks/entries/endpoints/api/card/_key_/commit/_server.ts.js-_yXWCOlQ.js +68 -0
  296. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-diff/_server.ts.js-CRPV3z-g.js +61 -0
  297. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-message/_server.ts.js-CO9mD3u6.js +82 -0
  298. package/build/server/chunks/entries/endpoints/api/card/_key_/context/_server.ts.js-7kzrigFz.js +42 -0
  299. package/build/server/chunks/entries/endpoints/api/card/_key_/delete/_server.ts.js-DH0nO9wG.js +516 -0
  300. package/build/server/chunks/entries/endpoints/api/card/_key_/file/_server.ts.js-D80SvJDi.js +35 -0
  301. package/build/server/chunks/entries/endpoints/api/card/_key_/files/_...path_/_server.ts.js-GxFjb2H0.js +34 -0
  302. package/build/server/chunks/entries/endpoints/api/card/_key_/fix/_server.ts.js-B-HAB050.js +68 -0
  303. package/build/server/chunks/entries/endpoints/api/card/_key_/knowledge/_server.ts.js-D4fN-j7X.js +81 -0
  304. package/build/server/chunks/entries/endpoints/api/card/_key_/link/_other_/_server.ts.js-C00pQDCu.js +42 -0
  305. package/build/server/chunks/entries/endpoints/api/card/_key_/log/_server.ts.js-BXW_tG-I.js +32 -0
  306. package/build/server/chunks/entries/endpoints/api/card/_key_/log/raw/_server.ts.js-pT8StZGR.js +32 -0
  307. package/build/server/chunks/entries/endpoints/api/card/_key_/message/_server.ts.js-ZMno2Hu6.js +68 -0
  308. package/build/server/chunks/entries/endpoints/api/card/_key_/models/_server.ts.js-DEZVpqO3.js +73 -0
  309. package/build/server/chunks/entries/endpoints/api/card/_key_/patch/_server.ts.js-BxfLi-Zs.js +61 -0
  310. package/build/server/chunks/entries/endpoints/api/card/_key_/peek/_server.ts.js-CsTKWIP_.js +169 -0
  311. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/_server.ts.js-CsOeAXkf.js +53 -0
  312. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/comments/_server.ts.js-DZ2XHOhF.js +71 -0
  313. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discuss/_server.ts.js-CO8eM0e8.js +72 -0
  314. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discussions/_server.ts.js-Lp7l0Yqv.js +71 -0
  315. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix/_server.ts.js-CeIhjpQ4.js +68 -0
  316. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix-all/_server.ts.js-D-DKoCpQ.js +68 -0
  317. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/links/_server.ts.js-B_q3jUP3.js +72 -0
  318. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/qa/_server.ts.js-BulVcJY9.js +68 -0
  319. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/seen/_server.ts.js-Z06A6MS1.js +71 -0
  320. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/triage/_server.ts.js-qADU4URF.js +68 -0
  321. package/build/server/chunks/entries/endpoints/api/card/_key_/pull/_server.ts.js-CHnTH9WK.js +58 -0
  322. package/build/server/chunks/entries/endpoints/api/card/_key_/push/_server.ts.js-BPdPwPo2.js +83 -0
  323. package/build/server/chunks/entries/endpoints/api/card/_key_/repos/_server.ts.js-Bjqa3Uoo.js +73 -0
  324. package/build/server/chunks/entries/endpoints/api/card/_key_/research/_server.ts.js-DzQjoHOZ.js +138 -0
  325. package/build/server/chunks/entries/endpoints/api/card/_key_/retry/_server.ts.js-CAodrXqd.js +68 -0
  326. package/build/server/chunks/entries/endpoints/api/card/_key_/send-back/_server.ts.js-CmJSnvTx.js +68 -0
  327. package/build/server/chunks/entries/endpoints/api/card/_key_/stack/_server.ts.js-DjI8S94J.js +82 -0
  328. package/build/server/chunks/entries/endpoints/api/card/_key_/tasks/_server.ts.js-BzX_nNJk.js +71 -0
  329. package/build/server/chunks/entries/endpoints/api/card/_key_/thread/_server.ts.js-Dn36Guxk.js +33 -0
  330. package/build/server/chunks/entries/endpoints/api/cards/_server.ts.js-DPMOBsvp.js +77 -0
  331. package/build/server/chunks/entries/endpoints/api/cards/context/_server.ts.js-D6y-g2O-.js +52 -0
  332. package/build/server/chunks/entries/endpoints/api/cards/next/_server.ts.js-C2se67rf.js +55 -0
  333. package/build/server/chunks/entries/endpoints/api/chain/_server.ts.js-DKO5Q8GV.js +70 -0
  334. package/build/server/chunks/entries/endpoints/api/clones/_server.ts.js-Bgcc_Beg.js +56 -0
  335. package/build/server/chunks/entries/endpoints/api/current-project/_server.ts.js-DZCtSlXs.js +81 -0
  336. package/build/server/chunks/entries/endpoints/api/evidence/timesheet/_server.ts.js-xJwzSrcl.js +32 -0
  337. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-BdcE7k8S.js +83 -0
  338. package/build/server/chunks/entries/endpoints/api/gh/_server.ts.js-CGvM8fn7.js +66 -0
  339. package/build/server/chunks/entries/endpoints/api/gh/name/_server.ts.js-CHh3tAu7.js +36 -0
  340. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-DLUfrHo6.js +22 -0
  341. package/build/server/chunks/entries/endpoints/api/login-item/_server.ts.js-Cya7S7W6.js +77 -0
  342. package/build/server/chunks/entries/endpoints/api/notes/_server.ts.js-DaUFVqSM.js +26 -0
  343. package/build/server/chunks/entries/endpoints/api/notifications/_server.ts.js-DK6NFnII.js +76 -0
  344. package/build/server/chunks/entries/endpoints/api/now/_server.ts.js-xW0jeJdy.js +83 -0
  345. package/build/server/chunks/entries/endpoints/api/package/entry/_server.ts.js-DQyZanpo.js +35 -0
  346. package/build/server/chunks/entries/endpoints/api/projects/_server.ts.js-CzXJTj_l.js +58 -0
  347. package/build/server/chunks/entries/endpoints/api/qa-setup/_server.ts.js-DujrYbEP.js +76 -0
  348. package/build/server/chunks/entries/endpoints/api/remove-check/_server.ts.js-1KAi9LDi.js +58 -0
  349. package/build/server/chunks/entries/endpoints/api/setup/_server.ts.js-D0MKtjR7.js +69 -0
  350. package/build/server/chunks/entries/endpoints/api/tickets/jira/_server.ts.js-Z2LdOr5l.js +39 -0
  351. package/build/server/chunks/entries/endpoints/api/tickets/read/_server.ts.js-BziHtc8Y.js +68 -0
  352. package/build/server/chunks/entries/endpoints/api/tools/_server.ts.js-oyvq8i1y.js +30 -0
  353. package/build/server/chunks/entries/endpoints/api/workspace/_server.ts.js-CMGBL5cX.js +58 -0
  354. package/build/server/chunks/entries/endpoints/api/workspace/commit/_server.ts.js-BZQQJ1YG.js +66 -0
  355. package/build/server/chunks/entries/endpoints/api/workspace/patch/_server.ts.js-xrjgHECx.js +64 -0
  356. package/build/server/chunks/entries/endpoints/api/workspace/push/_server.ts.js-CTdia7Uz.js +66 -0
  357. package/build/server/chunks/entries/hooks.server.js-B0jE-ELC.js +211 -0
  358. package/build/server/chunks/entries/pages/_error.svelte.js-DPcKI5sX.js +25 -0
  359. package/build/server/chunks/entries/pages/_layout.server.ts.js-Jj3i2Th9.js +134 -0
  360. package/build/server/chunks/entries/pages/_layout.svelte.js-Cu3ghN80.js +1251 -0
  361. package/build/server/chunks/entries/pages/_page.svelte.js-DEYydBCm.js +662 -0
  362. package/build/server/chunks/entries/pages/accept/_page.server.ts.js-BF7MrA5s.js +29 -0
  363. package/build/server/chunks/entries/pages/accept/_page.svelte.js-8yPsedd-.js +54 -0
  364. package/build/server/chunks/entries/pages/b/_board_/_page.svelte.js-S9acLF3f.js +68 -0
  365. package/build/server/chunks/entries/pages/b/_board_/_page.ts.js-BcKdG_Tp.js +21 -0
  366. package/build/server/chunks/entries/pages/b/research/_page.svelte.js-FW6Hw9g5.js +68 -0
  367. package/build/server/chunks/entries/pages/b/research/_page.ts.js-Ds2AjFFK.js +13 -0
  368. package/build/server/chunks/entries/pages/evidence/_page.server.ts.js-uwu2X7bA.js +1382 -0
  369. package/build/server/chunks/entries/pages/evidence/_page.svelte.js-DBCjiT59.js +594 -0
  370. package/build/server/chunks/entries/pages/f/_...path_/_page.svelte.js-DxwJaJzh.js +58 -0
  371. package/build/server/chunks/entries/pages/knowledge/_page.server.ts.js-BAUvFEcM.js +80 -0
  372. package/build/server/chunks/entries/pages/knowledge/_page.svelte.js-D9117gHM.js +732 -0
  373. package/build/server/chunks/entries/pages/new/_page.server.ts.js-BNCQQpyw.js +110 -0
  374. package/build/server/chunks/entries/pages/new/_page.svelte.js-Ben8-N_h.js +503 -0
  375. package/build/server/chunks/entries/pages/new/idea/_page.server.ts.js-jssA29y3.js +46 -0
  376. package/build/server/chunks/entries/pages/new/idea/_page.svelte.js-XoKspqAc.js +210 -0
  377. package/build/server/chunks/entries/pages/new/task/_page.server.ts.js-CmZgfvyt.js +66 -0
  378. package/build/server/chunks/entries/pages/new/task/_page.svelte.js-BKpERKvm.js +169 -0
  379. package/build/server/chunks/entries/pages/onboard/_page.server.ts.js-pmc_pXvs.js +12 -0
  380. package/build/server/chunks/entries/pages/onboard/_page.svelte.js-C7LNK-ba.js +5 -0
  381. package/build/server/chunks/entries/pages/projects/_page.server.ts.js-BEhLRfJ_.js +12 -0
  382. package/build/server/chunks/entries/pages/projects/_page.svelte.js-OraOjsyb.js +5 -0
  383. package/build/server/chunks/entries/pages/scout/_page.server.ts.js-hQYnMHwY.js +10 -0
  384. package/build/server/chunks/entries/pages/scout/_page.svelte.js-7q4d044Z.js +40 -0
  385. package/build/server/chunks/entries/pages/scout/f/_id_/_page.server.ts.js-BN4TnSpB.js +22 -0
  386. package/build/server/chunks/entries/pages/scout/f/_id_/_page.svelte.js-GzpLhARi.js +40 -0
  387. package/build/server/chunks/entries/pages/settings/_layout.server.ts.js-B5LgqMMT.js +12 -0
  388. package/build/server/chunks/entries/pages/settings/_layout.svelte.js-CSCpV6qA.js +81 -0
  389. package/build/server/chunks/entries/pages/settings/_page.svelte.js-DNpsNFo0.js +25 -0
  390. package/build/server/chunks/entries/pages/settings/_section_/_page.server.ts.js-nRDEV3i_.js +348 -0
  391. package/build/server/chunks/entries/pages/settings/_section_/_page.svelte.js-BihUf-nY.js +1052 -0
  392. package/build/server/chunks/entries/pages/settings/integrations/_page.server.ts.js-BTuRpg8m.js +58 -0
  393. package/build/server/chunks/entries/pages/settings/integrations/_page.svelte.js-C8i8ZmZR.js +161 -0
  394. package/build/server/chunks/entries/pages/settings/mcp/_page.server.ts.js-TFISfO1a.js +925 -0
  395. package/build/server/chunks/entries/pages/settings/mcp/_page.svelte.js-D1X0TNOm.js +433 -0
  396. package/build/server/chunks/entries/pages/settings/phases/_page.server.ts.js-CgK7MTZf.js +48 -0
  397. package/build/server/chunks/entries/pages/settings/phases/_page.svelte.js-u-sTQ-ue.js +80 -0
  398. package/build/server/chunks/entries/pages/settings/project/_page.server.ts.js-CCnk9WbO.js +363 -0
  399. package/build/server/chunks/entries/pages/settings/project/_page.svelte.js-MxvNqYlQ.js +1269 -0
  400. package/build/server/chunks/entries/pages/settings/wall/_page.server.ts.js-Bt5siY_N.js +12 -0
  401. package/build/server/chunks/entries/pages/settings/wall/_page.svelte.js-CMR4zSAt.js +43 -0
  402. package/build/server/chunks/entries/pages/t/_key_/_layout.server.ts.js-W6YPvOCA.js +124 -0
  403. package/build/server/chunks/entries/pages/t/_key_/_layout.svelte.js-CK0PiWsz.js +543 -0
  404. package/build/server/chunks/entries/pages/t/_key_/_page.server.ts.js-CdB7v0WX.js +15 -0
  405. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.server.ts.js-Bksaje8R.js +75 -0
  406. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.svelte.js-9OQ2eQxu.js +4607 -0
  407. package/build/server/chunks/entries/pages/team/_page.svelte.js-BdUSXC04.js +18 -0
  408. package/build/server/chunks/entries/pages/team/_page.ts.js-DfhJmoZI.js +20 -0
  409. package/build/server/chunks/entries/pages/workspace/_page.svelte.js-DLaWe23r.js +579 -0
  410. package/build/server/chunks/handler-Dlwmumt5.js +1735 -0
  411. package/build/server/chunks/index.js-BX0fZD5G.js +3701 -0
  412. package/build/server/chunks/manifest.js-B2Of6Dj7.js +761 -0
  413. package/build/server/chunks/nodes/0.js-DSzhdY0D.js +87 -0
  414. package/build/server/chunks/nodes/1.js-j4osL1br.js +9 -0
  415. package/build/server/chunks/nodes/10.js-jkvevEFY.js +75 -0
  416. package/build/server/chunks/nodes/11.js-plyiDP2n.js +72 -0
  417. package/build/server/chunks/nodes/12.js-DwtvDAyM.js +78 -0
  418. package/build/server/chunks/nodes/13.js-BpxwqFh4.js +72 -0
  419. package/build/server/chunks/nodes/14.js-B5iNIKGy.js +15 -0
  420. package/build/server/chunks/nodes/15.js-CXCAqUsG.js +15 -0
  421. package/build/server/chunks/nodes/16.js-oxkLEH0n.js +76 -0
  422. package/build/server/chunks/nodes/17.js-B-ZJEo9K.js +76 -0
  423. package/build/server/chunks/nodes/18.js-C0OUCEux.js +9 -0
  424. package/build/server/chunks/nodes/19.js-M8EAQJdW.js +76 -0
  425. package/build/server/chunks/nodes/2.js-ZedduK-3.js +33 -0
  426. package/build/server/chunks/nodes/20.js-BHvsLNjD.js +72 -0
  427. package/build/server/chunks/nodes/21.js-eOaW4si1.js +76 -0
  428. package/build/server/chunks/nodes/22.js-CbJ6tQSs.js +38 -0
  429. package/build/server/chunks/nodes/23.js-DXk8ejlx.js +81 -0
  430. package/build/server/chunks/nodes/24.js-C4qGJc4X.js +33 -0
  431. package/build/server/chunks/nodes/25.js-Cal8uT5V.js +21 -0
  432. package/build/server/chunks/nodes/26.js-Cp5jBcrN.js +80 -0
  433. package/build/server/chunks/nodes/27.js-Do55o_cb.js +17 -0
  434. package/build/server/chunks/nodes/28.js-SNz3QVix.js +9 -0
  435. package/build/server/chunks/nodes/3.js-DyivQ5dN.js +75 -0
  436. package/build/server/chunks/nodes/4.js-BGgTTQFR.js +9 -0
  437. package/build/server/chunks/nodes/5.js-DQYA2BBI.js +31 -0
  438. package/build/server/chunks/nodes/6.js-BVTi2KFL.js +24 -0
  439. package/build/server/chunks/nodes/7.js-CnprIn3p.js +12 -0
  440. package/build/server/chunks/nodes/8.js-Bdicn369.js +50 -0
  441. package/build/server/chunks/nodes/9.js-DVclPGXf.js +9 -0
  442. package/build/shims.js +33 -0
  443. package/dist/THIRD-PARTY-NOTICES.md +659 -0
  444. package/dist/detect-BmI_gskA.js +585 -0
  445. package/dist/fonts/OFL.txt +92 -0
  446. package/dist/nolzu.js +48 -0
  447. package/dist/package-vezZOzhD.js +181 -0
  448. package/dist/shared/finish.md +110 -0
  449. package/dist/shared/knowledge.md +72 -0
  450. package/dist/shared/verdict.md +42 -0
  451. package/dist/skills/.gitkeep +0 -0
  452. package/dist/skills/nolzu-architecture/SKILL.md +140 -0
  453. package/dist/skills/nolzu-architecture/finish.md +110 -0
  454. package/dist/skills/nolzu-assess/SKILL.md +99 -0
  455. package/dist/skills/nolzu-assess/finish.md +110 -0
  456. package/dist/skills/nolzu-design/SKILL.md +115 -0
  457. package/dist/skills/nolzu-design/finish.md +110 -0
  458. package/dist/skills/nolzu-feedback/SKILL.md +107 -0
  459. package/dist/skills/nolzu-feedback/finish.md +110 -0
  460. package/dist/skills/nolzu-implement/SKILL.md +138 -0
  461. package/dist/skills/nolzu-implement/finish.md +110 -0
  462. package/dist/skills/nolzu-investigate/SKILL.md +139 -0
  463. package/dist/skills/nolzu-investigate/finish.md +110 -0
  464. package/dist/skills/nolzu-learn-repo/SKILL.md +115 -0
  465. package/dist/skills/nolzu-learn-repo/finish.md +110 -0
  466. package/dist/skills/nolzu-learn-repo/knowledge.md +72 -0
  467. package/dist/skills/nolzu-optimize/SKILL.md +82 -0
  468. package/dist/skills/nolzu-optimize/finish.md +110 -0
  469. package/dist/skills/nolzu-optimize/knowledge.md +72 -0
  470. package/dist/skills/nolzu-orient/SKILL.md +115 -0
  471. package/dist/skills/nolzu-orient/finish.md +110 -0
  472. package/dist/skills/nolzu-orient/knowledge.md +72 -0
  473. package/dist/skills/nolzu-plan/SKILL.md +165 -0
  474. package/dist/skills/nolzu-plan/finish.md +110 -0
  475. package/dist/skills/nolzu-pr-review/SKILL.md +150 -0
  476. package/dist/skills/nolzu-pr-review/finish.md +110 -0
  477. package/dist/skills/nolzu-qa/SKILL.md +177 -0
  478. package/dist/skills/nolzu-qa/finish.md +110 -0
  479. package/dist/skills/nolzu-qa/verdict.md +42 -0
  480. package/dist/skills/nolzu-refine/SKILL.md +145 -0
  481. package/dist/skills/nolzu-refine/finish.md +110 -0
  482. package/dist/skills/nolzu-research/SKILL.md +140 -0
  483. package/dist/skills/nolzu-research/finish.md +110 -0
  484. package/dist/skills/nolzu-wrapup/SKILL.md +126 -0
  485. package/dist/skills/nolzu-wrapup/finish.md +110 -0
  486. package/dist/skills/nolzu-wrapup/knowledge.md +72 -0
  487. package/dist/src-BG8LaXLS.js +723 -0
  488. package/dist/src-DPfcvRqs.js +4 -0
  489. package/dist/start-ItZOcBtM.js +362 -0
  490. package/package.json +49 -9
  491. package/bin/nolzu.js +0 -8
@@ -0,0 +1,1735 @@
1
+ import '../../shims.js';
2
+ import * as fs from 'node:fs';
3
+ import fs__default, { readdirSync, statSync, createReadStream } from 'node:fs';
4
+ import path, { resolve, sep, join, normalize } from 'node:path';
5
+ import process from 'node:process';
6
+ import http from 'node:http';
7
+ import { setImmediate } from 'node:timers';
8
+ import * as qs from 'node:querystring';
9
+ import { Readable } from 'node:stream';
10
+ import { S as SvelteKitError } from './chunks/shared.js-BgfCUZUJ.js';
11
+ import './chunks/utils.js-DQTBh7_6.js';
12
+ import { S as Server } from './index.js-BX0fZD5G.js';
13
+ import { m as manifest } from './manifest.js-B2Of6Dj7.js';
14
+ import { env, dir, env_prefix } from '../../env.js';
15
+ import { format } from 'node:url';
16
+
17
+ function totalist(dir, callback, pre='') {
18
+ dir = resolve('.', dir);
19
+ let arr = readdirSync(dir);
20
+ let i=0, abs, stats;
21
+ for (; i < arr.length; i++) {
22
+ abs = join(dir, arr[i]);
23
+ stats = statSync(abs);
24
+ stats.isDirectory()
25
+ ? totalist(abs, callback, join(pre, arr[i]))
26
+ : callback(join(pre, arr[i]), abs, stats);
27
+ }
28
+ }
29
+
30
+ /**
31
+ * @typedef ParsedURL
32
+ * @type {import('.').ParsedURL}
33
+ */
34
+
35
+ /**
36
+ * @typedef Request
37
+ * @property {string} url
38
+ * @property {ParsedURL} _parsedUrl
39
+ */
40
+
41
+ /**
42
+ * @param {Request} req
43
+ * @returns {ParsedURL|void}
44
+ */
45
+ function parse$1(req) {
46
+ let raw = req.url;
47
+ if (raw == null) return;
48
+
49
+ let prev = req._parsedUrl;
50
+ if (prev && prev.raw === raw) return prev;
51
+
52
+ let pathname=raw, search='', query;
53
+
54
+ if (raw.length > 1) {
55
+ let idx = raw.indexOf('?', 1);
56
+
57
+ if (idx !== -1) {
58
+ search = raw.substring(idx);
59
+ pathname = raw.substring(0, idx);
60
+ if (search.length > 1) {
61
+ query = qs.parse(search.substring(1));
62
+ }
63
+ }
64
+ }
65
+
66
+ return req._parsedUrl = { pathname, search, query, raw };
67
+ }
68
+
69
+ const mimes = {
70
+ "3g2": "video/3gpp2",
71
+ "3gp": "video/3gpp",
72
+ "3gpp": "video/3gpp",
73
+ "3mf": "model/3mf",
74
+ "aac": "audio/aac",
75
+ "ac": "application/pkix-attr-cert",
76
+ "adp": "audio/adpcm",
77
+ "adts": "audio/aac",
78
+ "ai": "application/postscript",
79
+ "aml": "application/automationml-aml+xml",
80
+ "amlx": "application/automationml-amlx+zip",
81
+ "amr": "audio/amr",
82
+ "apng": "image/apng",
83
+ "appcache": "text/cache-manifest",
84
+ "appinstaller": "application/appinstaller",
85
+ "appx": "application/appx",
86
+ "appxbundle": "application/appxbundle",
87
+ "asc": "application/pgp-keys",
88
+ "atom": "application/atom+xml",
89
+ "atomcat": "application/atomcat+xml",
90
+ "atomdeleted": "application/atomdeleted+xml",
91
+ "atomsvc": "application/atomsvc+xml",
92
+ "au": "audio/basic",
93
+ "avci": "image/avci",
94
+ "avcs": "image/avcs",
95
+ "avif": "image/avif",
96
+ "aw": "application/applixware",
97
+ "bdoc": "application/bdoc",
98
+ "bin": "application/octet-stream",
99
+ "bmp": "image/bmp",
100
+ "bpk": "application/octet-stream",
101
+ "btf": "image/prs.btif",
102
+ "btif": "image/prs.btif",
103
+ "buffer": "application/octet-stream",
104
+ "ccxml": "application/ccxml+xml",
105
+ "cdfx": "application/cdfx+xml",
106
+ "cdmia": "application/cdmi-capability",
107
+ "cdmic": "application/cdmi-container",
108
+ "cdmid": "application/cdmi-domain",
109
+ "cdmio": "application/cdmi-object",
110
+ "cdmiq": "application/cdmi-queue",
111
+ "cer": "application/pkix-cert",
112
+ "cgm": "image/cgm",
113
+ "cjs": "application/node",
114
+ "class": "application/java-vm",
115
+ "coffee": "text/coffeescript",
116
+ "conf": "text/plain",
117
+ "cpl": "application/cpl+xml",
118
+ "cpt": "application/mac-compactpro",
119
+ "crl": "application/pkix-crl",
120
+ "css": "text/css",
121
+ "csv": "text/csv",
122
+ "cu": "application/cu-seeme",
123
+ "cwl": "application/cwl",
124
+ "cww": "application/prs.cww",
125
+ "davmount": "application/davmount+xml",
126
+ "dbk": "application/docbook+xml",
127
+ "deb": "application/octet-stream",
128
+ "def": "text/plain",
129
+ "deploy": "application/octet-stream",
130
+ "dib": "image/bmp",
131
+ "disposition-notification": "message/disposition-notification",
132
+ "dist": "application/octet-stream",
133
+ "distz": "application/octet-stream",
134
+ "dll": "application/octet-stream",
135
+ "dmg": "application/octet-stream",
136
+ "dms": "application/octet-stream",
137
+ "doc": "application/msword",
138
+ "dot": "application/msword",
139
+ "dpx": "image/dpx",
140
+ "drle": "image/dicom-rle",
141
+ "dsc": "text/prs.lines.tag",
142
+ "dssc": "application/dssc+der",
143
+ "dtd": "application/xml-dtd",
144
+ "dump": "application/octet-stream",
145
+ "dwd": "application/atsc-dwd+xml",
146
+ "ear": "application/java-archive",
147
+ "ecma": "application/ecmascript",
148
+ "elc": "application/octet-stream",
149
+ "emf": "image/emf",
150
+ "eml": "message/rfc822",
151
+ "emma": "application/emma+xml",
152
+ "emotionml": "application/emotionml+xml",
153
+ "eps": "application/postscript",
154
+ "epub": "application/epub+zip",
155
+ "exe": "application/octet-stream",
156
+ "exi": "application/exi",
157
+ "exp": "application/express",
158
+ "exr": "image/aces",
159
+ "ez": "application/andrew-inset",
160
+ "fdf": "application/fdf",
161
+ "fdt": "application/fdt+xml",
162
+ "fits": "image/fits",
163
+ "g3": "image/g3fax",
164
+ "gbr": "application/rpki-ghostbusters",
165
+ "geojson": "application/geo+json",
166
+ "gif": "image/gif",
167
+ "glb": "model/gltf-binary",
168
+ "gltf": "model/gltf+json",
169
+ "gml": "application/gml+xml",
170
+ "gpx": "application/gpx+xml",
171
+ "gram": "application/srgs",
172
+ "grxml": "application/srgs+xml",
173
+ "gxf": "application/gxf",
174
+ "gz": "application/gzip",
175
+ "h261": "video/h261",
176
+ "h263": "video/h263",
177
+ "h264": "video/h264",
178
+ "heic": "image/heic",
179
+ "heics": "image/heic-sequence",
180
+ "heif": "image/heif",
181
+ "heifs": "image/heif-sequence",
182
+ "hej2": "image/hej2k",
183
+ "held": "application/atsc-held+xml",
184
+ "hjson": "application/hjson",
185
+ "hlp": "application/winhlp",
186
+ "hqx": "application/mac-binhex40",
187
+ "hsj2": "image/hsj2",
188
+ "htm": "text/html",
189
+ "html": "text/html",
190
+ "ics": "text/calendar",
191
+ "ief": "image/ief",
192
+ "ifb": "text/calendar",
193
+ "iges": "model/iges",
194
+ "igs": "model/iges",
195
+ "img": "application/octet-stream",
196
+ "in": "text/plain",
197
+ "ini": "text/plain",
198
+ "ink": "application/inkml+xml",
199
+ "inkml": "application/inkml+xml",
200
+ "ipfix": "application/ipfix",
201
+ "iso": "application/octet-stream",
202
+ "its": "application/its+xml",
203
+ "jade": "text/jade",
204
+ "jar": "application/java-archive",
205
+ "jhc": "image/jphc",
206
+ "jls": "image/jls",
207
+ "jp2": "image/jp2",
208
+ "jpe": "image/jpeg",
209
+ "jpeg": "image/jpeg",
210
+ "jpf": "image/jpx",
211
+ "jpg": "image/jpeg",
212
+ "jpg2": "image/jp2",
213
+ "jpgm": "image/jpm",
214
+ "jpgv": "video/jpeg",
215
+ "jph": "image/jph",
216
+ "jpm": "image/jpm",
217
+ "jpx": "image/jpx",
218
+ "js": "text/javascript",
219
+ "json": "application/json",
220
+ "json5": "application/json5",
221
+ "jsonld": "application/ld+json",
222
+ "jsonml": "application/jsonml+json",
223
+ "jsx": "text/jsx",
224
+ "jt": "model/jt",
225
+ "jxr": "image/jxr",
226
+ "jxra": "image/jxra",
227
+ "jxrs": "image/jxrs",
228
+ "jxs": "image/jxs",
229
+ "jxsc": "image/jxsc",
230
+ "jxsi": "image/jxsi",
231
+ "jxss": "image/jxss",
232
+ "kar": "audio/midi",
233
+ "ktx": "image/ktx",
234
+ "ktx2": "image/ktx2",
235
+ "less": "text/less",
236
+ "lgr": "application/lgr+xml",
237
+ "list": "text/plain",
238
+ "litcoffee": "text/coffeescript",
239
+ "log": "text/plain",
240
+ "lostxml": "application/lost+xml",
241
+ "lrf": "application/octet-stream",
242
+ "m1v": "video/mpeg",
243
+ "m21": "application/mp21",
244
+ "m2a": "audio/mpeg",
245
+ "m2v": "video/mpeg",
246
+ "m3a": "audio/mpeg",
247
+ "m4a": "audio/mp4",
248
+ "m4p": "application/mp4",
249
+ "m4s": "video/iso.segment",
250
+ "ma": "application/mathematica",
251
+ "mads": "application/mads+xml",
252
+ "maei": "application/mmt-aei+xml",
253
+ "man": "text/troff",
254
+ "manifest": "text/cache-manifest",
255
+ "map": "application/json",
256
+ "mar": "application/octet-stream",
257
+ "markdown": "text/markdown",
258
+ "mathml": "application/mathml+xml",
259
+ "mb": "application/mathematica",
260
+ "mbox": "application/mbox",
261
+ "md": "text/markdown",
262
+ "mdx": "text/mdx",
263
+ "me": "text/troff",
264
+ "mesh": "model/mesh",
265
+ "meta4": "application/metalink4+xml",
266
+ "metalink": "application/metalink+xml",
267
+ "mets": "application/mets+xml",
268
+ "mft": "application/rpki-manifest",
269
+ "mid": "audio/midi",
270
+ "midi": "audio/midi",
271
+ "mime": "message/rfc822",
272
+ "mj2": "video/mj2",
273
+ "mjp2": "video/mj2",
274
+ "mjs": "text/javascript",
275
+ "mml": "text/mathml",
276
+ "mods": "application/mods+xml",
277
+ "mov": "video/quicktime",
278
+ "mp2": "audio/mpeg",
279
+ "mp21": "application/mp21",
280
+ "mp2a": "audio/mpeg",
281
+ "mp3": "audio/mpeg",
282
+ "mp4": "video/mp4",
283
+ "mp4a": "audio/mp4",
284
+ "mp4s": "application/mp4",
285
+ "mp4v": "video/mp4",
286
+ "mpd": "application/dash+xml",
287
+ "mpe": "video/mpeg",
288
+ "mpeg": "video/mpeg",
289
+ "mpf": "application/media-policy-dataset+xml",
290
+ "mpg": "video/mpeg",
291
+ "mpg4": "video/mp4",
292
+ "mpga": "audio/mpeg",
293
+ "mpp": "application/dash-patch+xml",
294
+ "mrc": "application/marc",
295
+ "mrcx": "application/marcxml+xml",
296
+ "ms": "text/troff",
297
+ "mscml": "application/mediaservercontrol+xml",
298
+ "msh": "model/mesh",
299
+ "msi": "application/octet-stream",
300
+ "msix": "application/msix",
301
+ "msixbundle": "application/msixbundle",
302
+ "msm": "application/octet-stream",
303
+ "msp": "application/octet-stream",
304
+ "mtl": "model/mtl",
305
+ "musd": "application/mmt-usd+xml",
306
+ "mxf": "application/mxf",
307
+ "mxmf": "audio/mobile-xmf",
308
+ "mxml": "application/xv+xml",
309
+ "n3": "text/n3",
310
+ "nb": "application/mathematica",
311
+ "nq": "application/n-quads",
312
+ "nt": "application/n-triples",
313
+ "obj": "model/obj",
314
+ "oda": "application/oda",
315
+ "oga": "audio/ogg",
316
+ "ogg": "audio/ogg",
317
+ "ogv": "video/ogg",
318
+ "ogx": "application/ogg",
319
+ "omdoc": "application/omdoc+xml",
320
+ "onepkg": "application/onenote",
321
+ "onetmp": "application/onenote",
322
+ "onetoc": "application/onenote",
323
+ "onetoc2": "application/onenote",
324
+ "opf": "application/oebps-package+xml",
325
+ "opus": "audio/ogg",
326
+ "otf": "font/otf",
327
+ "owl": "application/rdf+xml",
328
+ "oxps": "application/oxps",
329
+ "p10": "application/pkcs10",
330
+ "p7c": "application/pkcs7-mime",
331
+ "p7m": "application/pkcs7-mime",
332
+ "p7s": "application/pkcs7-signature",
333
+ "p8": "application/pkcs8",
334
+ "pdf": "application/pdf",
335
+ "pfr": "application/font-tdpfr",
336
+ "pgp": "application/pgp-encrypted",
337
+ "pkg": "application/octet-stream",
338
+ "pki": "application/pkixcmp",
339
+ "pkipath": "application/pkix-pkipath",
340
+ "pls": "application/pls+xml",
341
+ "png": "image/png",
342
+ "prc": "model/prc",
343
+ "prf": "application/pics-rules",
344
+ "provx": "application/provenance+xml",
345
+ "ps": "application/postscript",
346
+ "pskcxml": "application/pskc+xml",
347
+ "pti": "image/prs.pti",
348
+ "qt": "video/quicktime",
349
+ "raml": "application/raml+yaml",
350
+ "rapd": "application/route-apd+xml",
351
+ "rdf": "application/rdf+xml",
352
+ "relo": "application/p2p-overlay+xml",
353
+ "rif": "application/reginfo+xml",
354
+ "rl": "application/resource-lists+xml",
355
+ "rld": "application/resource-lists-diff+xml",
356
+ "rmi": "audio/midi",
357
+ "rnc": "application/relax-ng-compact-syntax",
358
+ "rng": "application/xml",
359
+ "roa": "application/rpki-roa",
360
+ "roff": "text/troff",
361
+ "rq": "application/sparql-query",
362
+ "rs": "application/rls-services+xml",
363
+ "rsat": "application/atsc-rsat+xml",
364
+ "rsd": "application/rsd+xml",
365
+ "rsheet": "application/urc-ressheet+xml",
366
+ "rss": "application/rss+xml",
367
+ "rtf": "text/rtf",
368
+ "rtx": "text/richtext",
369
+ "rusd": "application/route-usd+xml",
370
+ "s3m": "audio/s3m",
371
+ "sbml": "application/sbml+xml",
372
+ "scq": "application/scvp-cv-request",
373
+ "scs": "application/scvp-cv-response",
374
+ "sdp": "application/sdp",
375
+ "senmlx": "application/senml+xml",
376
+ "sensmlx": "application/sensml+xml",
377
+ "ser": "application/java-serialized-object",
378
+ "setpay": "application/set-payment-initiation",
379
+ "setreg": "application/set-registration-initiation",
380
+ "sgi": "image/sgi",
381
+ "sgm": "text/sgml",
382
+ "sgml": "text/sgml",
383
+ "shex": "text/shex",
384
+ "shf": "application/shf+xml",
385
+ "shtml": "text/html",
386
+ "sieve": "application/sieve",
387
+ "sig": "application/pgp-signature",
388
+ "sil": "audio/silk",
389
+ "silo": "model/mesh",
390
+ "siv": "application/sieve",
391
+ "slim": "text/slim",
392
+ "slm": "text/slim",
393
+ "sls": "application/route-s-tsid+xml",
394
+ "smi": "application/smil+xml",
395
+ "smil": "application/smil+xml",
396
+ "snd": "audio/basic",
397
+ "so": "application/octet-stream",
398
+ "spdx": "text/spdx",
399
+ "spp": "application/scvp-vp-response",
400
+ "spq": "application/scvp-vp-request",
401
+ "spx": "audio/ogg",
402
+ "sql": "application/sql",
403
+ "sru": "application/sru+xml",
404
+ "srx": "application/sparql-results+xml",
405
+ "ssdl": "application/ssdl+xml",
406
+ "ssml": "application/ssml+xml",
407
+ "stk": "application/hyperstudio",
408
+ "stl": "model/stl",
409
+ "stpx": "model/step+xml",
410
+ "stpxz": "model/step-xml+zip",
411
+ "stpz": "model/step+zip",
412
+ "styl": "text/stylus",
413
+ "stylus": "text/stylus",
414
+ "svg": "image/svg+xml",
415
+ "svgz": "image/svg+xml",
416
+ "swidtag": "application/swid+xml",
417
+ "t": "text/troff",
418
+ "t38": "image/t38",
419
+ "td": "application/urc-targetdesc+xml",
420
+ "tei": "application/tei+xml",
421
+ "teicorpus": "application/tei+xml",
422
+ "text": "text/plain",
423
+ "tfi": "application/thraud+xml",
424
+ "tfx": "image/tiff-fx",
425
+ "tif": "image/tiff",
426
+ "tiff": "image/tiff",
427
+ "toml": "application/toml",
428
+ "tr": "text/troff",
429
+ "trig": "application/trig",
430
+ "ts": "video/mp2t",
431
+ "tsd": "application/timestamped-data",
432
+ "tsv": "text/tab-separated-values",
433
+ "ttc": "font/collection",
434
+ "ttf": "font/ttf",
435
+ "ttl": "text/turtle",
436
+ "ttml": "application/ttml+xml",
437
+ "txt": "text/plain",
438
+ "u3d": "model/u3d",
439
+ "u8dsn": "message/global-delivery-status",
440
+ "u8hdr": "message/global-headers",
441
+ "u8mdn": "message/global-disposition-notification",
442
+ "u8msg": "message/global",
443
+ "ubj": "application/ubjson",
444
+ "uri": "text/uri-list",
445
+ "uris": "text/uri-list",
446
+ "urls": "text/uri-list",
447
+ "vcard": "text/vcard",
448
+ "vrml": "model/vrml",
449
+ "vtt": "text/vtt",
450
+ "vxml": "application/voicexml+xml",
451
+ "war": "application/java-archive",
452
+ "wasm": "application/wasm",
453
+ "wav": "audio/wav",
454
+ "weba": "audio/webm",
455
+ "webm": "video/webm",
456
+ "webmanifest": "application/manifest+json",
457
+ "webp": "image/webp",
458
+ "wgsl": "text/wgsl",
459
+ "wgt": "application/widget",
460
+ "wif": "application/watcherinfo+xml",
461
+ "wmf": "image/wmf",
462
+ "woff": "font/woff",
463
+ "woff2": "font/woff2",
464
+ "wrl": "model/vrml",
465
+ "wsdl": "application/wsdl+xml",
466
+ "wspolicy": "application/wspolicy+xml",
467
+ "x3d": "model/x3d+xml",
468
+ "x3db": "model/x3d+fastinfoset",
469
+ "x3dbz": "model/x3d+binary",
470
+ "x3dv": "model/x3d-vrml",
471
+ "x3dvz": "model/x3d+vrml",
472
+ "x3dz": "model/x3d+xml",
473
+ "xaml": "application/xaml+xml",
474
+ "xav": "application/xcap-att+xml",
475
+ "xca": "application/xcap-caps+xml",
476
+ "xcs": "application/calendar+xml",
477
+ "xdf": "application/xcap-diff+xml",
478
+ "xdssc": "application/dssc+xml",
479
+ "xel": "application/xcap-el+xml",
480
+ "xenc": "application/xenc+xml",
481
+ "xer": "application/patch-ops-error+xml",
482
+ "xfdf": "application/xfdf",
483
+ "xht": "application/xhtml+xml",
484
+ "xhtml": "application/xhtml+xml",
485
+ "xhvml": "application/xv+xml",
486
+ "xlf": "application/xliff+xml",
487
+ "xm": "audio/xm",
488
+ "xml": "text/xml",
489
+ "xns": "application/xcap-ns+xml",
490
+ "xop": "application/xop+xml",
491
+ "xpl": "application/xproc+xml",
492
+ "xsd": "application/xml",
493
+ "xsf": "application/prs.xsf+xml",
494
+ "xsl": "application/xml",
495
+ "xslt": "application/xml",
496
+ "xspf": "application/xspf+xml",
497
+ "xvm": "application/xv+xml",
498
+ "xvml": "application/xv+xml",
499
+ "yaml": "text/yaml",
500
+ "yang": "application/yang",
501
+ "yin": "application/yin+xml",
502
+ "yml": "text/yaml",
503
+ "zip": "application/zip"
504
+ };
505
+
506
+ function lookup(extn) {
507
+ let tmp = ('' + extn).trim().toLowerCase();
508
+ let idx = tmp.lastIndexOf('.');
509
+ return mimes[!~idx ? tmp : tmp.substring(++idx)];
510
+ }
511
+
512
+ const noop$1 = () => {};
513
+
514
+ function isMatch(uri, arr) {
515
+ for (let i=0; i < arr.length; i++) {
516
+ if (arr[i].test(uri)) return true;
517
+ }
518
+ }
519
+
520
+ function toAssume(uri, extns) {
521
+ let i=0, x, len=uri.length - 1;
522
+ if (uri.charCodeAt(len) === 47) {
523
+ uri = uri.substring(0, len);
524
+ }
525
+
526
+ let arr=[], tmp=`${uri}/index`;
527
+ for (; i < extns.length; i++) {
528
+ x = extns[i] ? `.${extns[i]}` : '';
529
+ if (uri) arr.push(uri + x);
530
+ arr.push(tmp + x);
531
+ }
532
+
533
+ return arr;
534
+ }
535
+
536
+ function viaCache(cache, uri, extns) {
537
+ let i=0, data, arr=toAssume(uri, extns);
538
+ for (; i < arr.length; i++) {
539
+ if (data = cache[arr[i]]) return data;
540
+ }
541
+ }
542
+
543
+ function viaLocal(dir, isEtag, uri, extns) {
544
+ let i=0, arr=toAssume(uri, extns);
545
+ let abs, stats, name, headers;
546
+ for (; i < arr.length; i++) {
547
+ abs = normalize(
548
+ join(dir, name=arr[i])
549
+ );
550
+
551
+ if (abs.startsWith(dir) && fs.existsSync(abs)) {
552
+ stats = fs.statSync(abs);
553
+ if (stats.isDirectory()) continue;
554
+ headers = toHeaders(name, stats, isEtag);
555
+ headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
556
+ return { abs, stats, headers };
557
+ }
558
+ }
559
+ }
560
+
561
+ function is404(req, res) {
562
+ return (res.statusCode=404,res.end());
563
+ }
564
+
565
+ function send(req, res, file, stats, headers) {
566
+ let code=200, tmp, opts={};
567
+ headers = { ...headers };
568
+
569
+ for (let key in headers) {
570
+ tmp = res.getHeader(key);
571
+ if (tmp) headers[key] = tmp;
572
+ }
573
+
574
+ if (tmp = res.getHeader('content-type')) {
575
+ headers['Content-Type'] = tmp;
576
+ }
577
+
578
+ if (req.headers.range) {
579
+ code = 206;
580
+ let [x, y] = req.headers.range.replace('bytes=', '').split('-');
581
+ let end = opts.end = parseInt(y, 10) || stats.size - 1;
582
+ let start = opts.start = parseInt(x, 10) || 0;
583
+
584
+ if (end >= stats.size) {
585
+ end = stats.size - 1;
586
+ }
587
+
588
+ if (start >= stats.size) {
589
+ res.setHeader('Content-Range', `bytes */${stats.size}`);
590
+ res.statusCode = 416;
591
+ return res.end();
592
+ }
593
+
594
+ headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`;
595
+ headers['Content-Length'] = (end - start + 1);
596
+ headers['Accept-Ranges'] = 'bytes';
597
+ }
598
+
599
+ res.writeHead(code, headers);
600
+ fs.createReadStream(file, opts).pipe(res);
601
+ }
602
+
603
+ const ENCODING = {
604
+ '.br': 'br',
605
+ '.gz': 'gzip',
606
+ };
607
+
608
+ function toHeaders(name, stats, isEtag) {
609
+ let enc = ENCODING[name.slice(-3)];
610
+
611
+ let ctype = lookup(name.slice(0, enc && -3)) || '';
612
+ if (ctype === 'text/html') ctype += ';charset=utf-8';
613
+
614
+ let headers = {
615
+ 'Content-Length': stats.size,
616
+ 'Content-Type': ctype,
617
+ 'Last-Modified': stats.mtime.toUTCString(),
618
+ };
619
+
620
+ if (enc) headers['Content-Encoding'] = enc;
621
+ if (isEtag) headers['ETag'] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
622
+
623
+ return headers;
624
+ }
625
+
626
+ function sirv (dir, opts={}) {
627
+ dir = resolve(dir || '.');
628
+
629
+ let isNotFound = opts.onNoMatch || is404;
630
+ let setHeaders = opts.setHeaders || noop$1;
631
+
632
+ let extensions = opts.extensions || ['html', 'htm'];
633
+ let gzips = opts.gzip && extensions.map(x => `${x}.gz`).concat('gz');
634
+ let brots = opts.brotli && extensions.map(x => `${x}.br`).concat('br');
635
+
636
+ const FILES = {};
637
+
638
+ let fallback = '/';
639
+ let isEtag = !!opts.etag;
640
+ let isSPA = !!opts.single;
641
+ if (typeof opts.single === 'string') {
642
+ let idx = opts.single.lastIndexOf('.');
643
+ fallback += !!~idx ? opts.single.substring(0, idx) : opts.single;
644
+ }
645
+
646
+ let ignores = [];
647
+ if (opts.ignores !== false) {
648
+ ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/); // any extn
649
+ if (opts.dotfiles) ignores.push(/\/\.\w/);
650
+ else ignores.push(/\/\.well-known/);
651
+ [].concat(opts.ignores || []).forEach(x => {
652
+ ignores.push(new RegExp(x, 'i'));
653
+ });
654
+ }
655
+
656
+ let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`;
657
+ if (cc && opts.immutable) cc += ',immutable';
658
+ else if (cc && opts.maxAge === 0) cc += ',must-revalidate';
659
+
660
+ if (!opts.dev) {
661
+ totalist(dir, (name, abs, stats) => {
662
+ if (/\.well-known[\\+\/]/.test(name)) ; // keep
663
+ else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
664
+
665
+ let headers = toHeaders(name, stats, isEtag);
666
+ if (cc) headers['Cache-Control'] = cc;
667
+
668
+ FILES['/' + name.normalize().replace(/\\+/g, '/')] = { abs, stats, headers };
669
+ });
670
+ }
671
+
672
+ let lookup = opts.dev ? viaLocal.bind(0, dir + sep, isEtag) : viaCache.bind(0, FILES);
673
+
674
+ return function (req, res, next) {
675
+ let extns = [''];
676
+ let pathname = parse$1(req).pathname;
677
+ let val = req.headers['accept-encoding'] || '';
678
+ if (gzips && val.includes('gzip')) extns.unshift(...gzips);
679
+ if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
680
+ extns.push(...extensions); // [...br, ...gz, orig, ...exts]
681
+
682
+ if (pathname.indexOf('%') !== -1) {
683
+ try { pathname = decodeURI(pathname); }
684
+ catch (err) { /* malform uri */ }
685
+ }
686
+
687
+ let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns);
688
+ if (!data) return next ? next() : isNotFound(req, res);
689
+
690
+ if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
691
+ res.writeHead(304);
692
+ return res.end();
693
+ }
694
+
695
+ if (gzips || brots) {
696
+ res.setHeader('Vary', 'Accept-Encoding');
697
+ }
698
+
699
+ setHeaders(res, pathname, data.stats);
700
+ send(req, res, data.abs, data.stats, data.headers);
701
+ };
702
+ }
703
+
704
+ /**
705
+ * @param {string|RegExp} input The route pattern
706
+ * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.
707
+ */
708
+ function parse(input, loose) {
709
+ if (input instanceof RegExp) return { keys:false, pattern:input };
710
+ var c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');
711
+ arr[0] || arr.shift();
712
+
713
+ while (tmp = arr.shift()) {
714
+ c = tmp[0];
715
+ if (c === '*') {
716
+ keys.push(c);
717
+ pattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';
718
+ } else if (c === ':') {
719
+ o = tmp.indexOf('?', 1);
720
+ ext = tmp.indexOf('.', 1);
721
+ keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
722
+ pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
723
+ if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
724
+ } else {
725
+ pattern += '/' + tmp;
726
+ }
727
+ }
728
+
729
+ return {
730
+ keys: keys,
731
+ pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i')
732
+ };
733
+ }
734
+
735
+ const MAP = {
736
+ "": 0,
737
+ GET: 1,
738
+ HEAD: 2,
739
+ PATCH: 3,
740
+ OPTIONS: 4,
741
+ CONNECT: 5,
742
+ DELETE: 6,
743
+ TRACE: 7,
744
+ POST: 8,
745
+ PUT: 9,
746
+ };
747
+
748
+ class Trouter {
749
+ constructor() {
750
+ this.routes = [];
751
+
752
+ this.all = this.add.bind(this, '');
753
+ this.get = this.add.bind(this, 'GET');
754
+ this.head = this.add.bind(this, 'HEAD');
755
+ this.patch = this.add.bind(this, 'PATCH');
756
+ this.options = this.add.bind(this, 'OPTIONS');
757
+ this.connect = this.add.bind(this, 'CONNECT');
758
+ this.delete = this.add.bind(this, 'DELETE');
759
+ this.trace = this.add.bind(this, 'TRACE');
760
+ this.post = this.add.bind(this, 'POST');
761
+ this.put = this.add.bind(this, 'PUT');
762
+ }
763
+
764
+ use(route, ...fns) {
765
+ let handlers = [].concat.apply([], fns);
766
+ let { keys, pattern } = parse(route, true);
767
+ this.routes.push({ keys, pattern, method: '', handlers, midx: MAP[''] });
768
+ return this;
769
+ }
770
+
771
+ add(method, route, ...fns) {
772
+ let { keys, pattern } = parse(route);
773
+ let handlers = [].concat.apply([], fns);
774
+ this.routes.push({ keys, pattern, method, handlers, midx: MAP[method] });
775
+ return this;
776
+ }
777
+
778
+ find(method, url) {
779
+ let midx = MAP[method];
780
+ let isHEAD = (midx === 2);
781
+ let i=0, j=0, k, tmp, arr=this.routes;
782
+ let matches=[], params={}, handlers=[];
783
+ for (; i < arr.length; i++) {
784
+ tmp = arr[i];
785
+ if (tmp.midx === midx || tmp.midx === 0 || (isHEAD && tmp.midx===1) ) {
786
+ if (tmp.keys === false) {
787
+ matches = tmp.pattern.exec(url);
788
+ if (matches === null) continue;
789
+ if (matches.groups !== void 0) for (k in matches.groups) params[k]=matches.groups[k];
790
+ tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
791
+ } else if (tmp.keys.length > 0) {
792
+ matches = tmp.pattern.exec(url);
793
+ if (matches === null) continue;
794
+ for (j=0; j < tmp.keys.length;) params[tmp.keys[j]]=matches[++j];
795
+ tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
796
+ } else if (tmp.pattern.test(url)) {
797
+ tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
798
+ }
799
+ } // else not a match
800
+ }
801
+
802
+ return { params, handlers };
803
+ }
804
+ }
805
+
806
+ function onError(err, req, res) {
807
+ let code = typeof err.status === 'number' && err.status;
808
+ code = res.statusCode = (code && code >= 100 ? code : 500);
809
+ if (typeof err === 'string' || Buffer.isBuffer(err)) res.end(err);
810
+ else res.end(err.message || http.STATUS_CODES[code]);
811
+ }
812
+
813
+ const mount = fn => fn instanceof Polka ? fn.attach : fn;
814
+
815
+ class Polka extends Trouter {
816
+ constructor(opts={}) {
817
+ super();
818
+ this.parse = parse$1;
819
+ this.server = opts.server;
820
+ this.handler = this.handler.bind(this);
821
+ this.onError = opts.onError || onError; // catch-all handler
822
+ this.onNoMatch = opts.onNoMatch || this.onError.bind(null, { status: 404 });
823
+ this.attach = (req, res) => setImmediate(this.handler, req, res);
824
+ }
825
+
826
+ use(base, ...fns) {
827
+ if (base === '/') {
828
+ super.use(base, fns.map(mount));
829
+ } else if (typeof base === 'function' || base instanceof Polka) {
830
+ super.use('/', [base, ...fns].map(mount));
831
+ } else {
832
+ super.use(base,
833
+ (req, _, next) => {
834
+ if (typeof base === 'string') {
835
+ let len = base.length;
836
+ base.startsWith('/') || len++;
837
+ req.url = req.url.substring(len) || '/';
838
+ req.path = req.path.substring(len) || '/';
839
+ } else {
840
+ req.url = req.url.replace(base, '') || '/';
841
+ req.path = req.path.replace(base, '') || '/';
842
+ }
843
+ if (req.url.charAt(0) !== '/') {
844
+ req.url = '/' + req.url;
845
+ }
846
+ next();
847
+ },
848
+ fns.map(mount),
849
+ (req, _, next) => {
850
+ req.path = req._parsedUrl.pathname;
851
+ req.url = req.path + req._parsedUrl.search;
852
+ next();
853
+ }
854
+ );
855
+ }
856
+ return this; // chainable
857
+ }
858
+
859
+ listen() {
860
+ (this.server = this.server || http.createServer()).on('request', this.attach);
861
+ this.server.listen.apply(this.server, arguments);
862
+ return this;
863
+ }
864
+
865
+ handler(req, res, next) {
866
+ let info = this.parse(req), path = info.pathname;
867
+ let obj = this.find(req.method, req.path=path);
868
+
869
+ req.url = path + info.search;
870
+ req.originalUrl = req.originalUrl || req.url;
871
+ req.query = info.query || {};
872
+ req.search = info.search;
873
+ req.params = obj.params;
874
+
875
+ if (path.length > 1 && path.indexOf('%', 1) !== -1) {
876
+ for (let k in req.params) {
877
+ try { req.params[k] = decodeURIComponent(req.params[k]); }
878
+ catch (e) { /* malform uri segment */ }
879
+ }
880
+ }
881
+
882
+ let i=0, arr=obj.handlers.concat(this.onNoMatch), len=arr.length;
883
+ let loop = async () => res.finished || (i < len) && arr[i++](req, res, next);
884
+ (next = next || (err => err ? this.onError(err, req, res, next) : loop().catch(next)))(); // init
885
+ }
886
+ }
887
+
888
+ function polka (opts) {
889
+ return new Polka(opts);
890
+ }
891
+
892
+ function noop() {}
893
+
894
+ var defaultParseOptions = {
895
+ decodeValues: true,
896
+ map: false,
897
+ silent: false,
898
+ split: "auto", // auto = split strings but not arrays
899
+ };
900
+
901
+ function isForbiddenKey(key) {
902
+ return typeof key !== "string" || key in {};
903
+ }
904
+
905
+ function createNullObj() {
906
+ return Object.create(null);
907
+ }
908
+
909
+ function isNonEmptyString(str) {
910
+ return typeof str === "string" && !!str.trim();
911
+ }
912
+
913
+ function parseString(setCookieValue, options) {
914
+ var parts = setCookieValue.split(";").filter(isNonEmptyString);
915
+
916
+ var nameValuePairStr = parts.shift();
917
+ if (!nameValuePairStr) {
918
+ return null;
919
+ }
920
+ var parsed = parseNameValuePair(nameValuePairStr);
921
+ var name = parsed.name;
922
+ var value = parsed.value;
923
+
924
+ options = options
925
+ ? Object.assign({}, defaultParseOptions, options)
926
+ : defaultParseOptions;
927
+
928
+ if (isForbiddenKey(name)) {
929
+ return null;
930
+ }
931
+
932
+ try {
933
+ value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
934
+ } catch (e) {
935
+ console.error(
936
+ "set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
937
+ e
938
+ );
939
+ }
940
+
941
+ var cookie = createNullObj();
942
+ cookie.name = name;
943
+ cookie.value = value;
944
+
945
+ parts.forEach(function (part) {
946
+ var sides = part.split("=");
947
+ var key = sides.shift().trim().toLowerCase();
948
+ if (isForbiddenKey(key)) {
949
+ return;
950
+ }
951
+ var value = sides.join("=").trim();
952
+ if (key === "expires") {
953
+ cookie.expires = new Date(value);
954
+ } else if (key === "max-age") {
955
+ var n = parseInt(value, 10);
956
+ if (!Number.isNaN(n)) cookie.maxAge = n;
957
+ } else if (key === "secure") {
958
+ cookie.secure = true;
959
+ } else if (key === "httponly") {
960
+ cookie.httpOnly = true;
961
+ } else if (key === "samesite") {
962
+ cookie.sameSite = value;
963
+ } else if (key === "partitioned") {
964
+ cookie.partitioned = true;
965
+ } else if (key) {
966
+ cookie[key] = value;
967
+ }
968
+ });
969
+
970
+ return cookie;
971
+ }
972
+
973
+ function parseNameValuePair(nameValuePairStr) {
974
+ // Parses name-value-pair according to rfc6265bis draft
975
+
976
+ var name = "";
977
+ var value = "";
978
+ var nameValueArr = nameValuePairStr.split("=");
979
+ if (nameValueArr.length > 1) {
980
+ name = nameValueArr.shift();
981
+ value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part
982
+ } else {
983
+ value = nameValuePairStr;
984
+ }
985
+
986
+ return { name: name, value: value };
987
+ }
988
+
989
+ function parseSetCookie(input, options) {
990
+ options = options
991
+ ? Object.assign({}, defaultParseOptions, options)
992
+ : defaultParseOptions;
993
+
994
+ if (!input) {
995
+ if (!options.map) {
996
+ return [];
997
+ } else {
998
+ return createNullObj();
999
+ }
1000
+ }
1001
+
1002
+ if (input.headers) {
1003
+ if (typeof input.headers.getSetCookie === "function") {
1004
+ // for fetch responses - they combine headers of the same type in the headers array,
1005
+ // but getSetCookie returns an uncombined array
1006
+ input = input.headers.getSetCookie();
1007
+ } else if (input.headers["set-cookie"]) {
1008
+ // fast-path for node.js (which automatically normalizes header names to lower-case)
1009
+ input = input.headers["set-cookie"];
1010
+ } else {
1011
+ // slow-path for other environments - see #25
1012
+ var sch =
1013
+ input.headers[
1014
+ Object.keys(input.headers).find(function (key) {
1015
+ return key.toLowerCase() === "set-cookie";
1016
+ })
1017
+ ];
1018
+ // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
1019
+ if (!sch && input.headers.cookie && !options.silent) {
1020
+ console.warn(
1021
+ "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."
1022
+ );
1023
+ }
1024
+ input = sch;
1025
+ }
1026
+ }
1027
+
1028
+ var split = options.split;
1029
+ var isArray = Array.isArray(input);
1030
+
1031
+ if (split === "auto") {
1032
+ split = !isArray;
1033
+ }
1034
+
1035
+ if (!isArray) {
1036
+ input = [input];
1037
+ }
1038
+
1039
+ input = input.filter(isNonEmptyString);
1040
+
1041
+ if (split) {
1042
+ input = input.map(splitCookiesString).flat();
1043
+ }
1044
+
1045
+ if (!options.map) {
1046
+ return input
1047
+ .map(function (str) {
1048
+ return parseString(str, options);
1049
+ })
1050
+ .filter(Boolean);
1051
+ } else {
1052
+ var cookies = createNullObj();
1053
+ return input.reduce(function (cookies, str) {
1054
+ var cookie = parseString(str, options);
1055
+ if (cookie && !isForbiddenKey(cookie.name)) {
1056
+ cookies[cookie.name] = cookie;
1057
+ }
1058
+ return cookies;
1059
+ }, cookies);
1060
+ }
1061
+ }
1062
+
1063
+ /*
1064
+ Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
1065
+ that are within a single set-cookie field-value, such as in the Expires portion.
1066
+
1067
+ This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
1068
+ Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
1069
+ React Native's fetch does this for *every* header, including set-cookie.
1070
+
1071
+ Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
1072
+ Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
1073
+ */
1074
+ function splitCookiesString(cookiesString) {
1075
+ if (Array.isArray(cookiesString)) {
1076
+ return cookiesString;
1077
+ }
1078
+ if (typeof cookiesString !== "string") {
1079
+ return [];
1080
+ }
1081
+
1082
+ var cookiesStrings = [];
1083
+ var pos = 0;
1084
+ var start;
1085
+ var ch;
1086
+ var lastComma;
1087
+ var nextStart;
1088
+ var cookiesSeparatorFound;
1089
+
1090
+ function skipWhitespace() {
1091
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
1092
+ pos += 1;
1093
+ }
1094
+ return pos < cookiesString.length;
1095
+ }
1096
+
1097
+ function notSpecialChar() {
1098
+ ch = cookiesString.charAt(pos);
1099
+
1100
+ return ch !== "=" && ch !== ";" && ch !== ",";
1101
+ }
1102
+
1103
+ while (pos < cookiesString.length) {
1104
+ start = pos;
1105
+ cookiesSeparatorFound = false;
1106
+
1107
+ while (skipWhitespace()) {
1108
+ ch = cookiesString.charAt(pos);
1109
+ if (ch === ",") {
1110
+ // ',' is a cookie separator if we have later first '=', not ';' or ','
1111
+ lastComma = pos;
1112
+ pos += 1;
1113
+
1114
+ skipWhitespace();
1115
+ nextStart = pos;
1116
+
1117
+ while (pos < cookiesString.length && notSpecialChar()) {
1118
+ pos += 1;
1119
+ }
1120
+
1121
+ // currently special character
1122
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
1123
+ // we found cookies separator
1124
+ cookiesSeparatorFound = true;
1125
+ // pos is inside the next cookie, so back up and return it.
1126
+ pos = nextStart;
1127
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
1128
+ start = pos;
1129
+ } else {
1130
+ // in param ',' or param separator ';',
1131
+ // we continue from that comma
1132
+ pos = lastComma + 1;
1133
+ }
1134
+ } else {
1135
+ pos += 1;
1136
+ }
1137
+ }
1138
+
1139
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
1140
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
1141
+ }
1142
+ }
1143
+
1144
+ return cookiesStrings;
1145
+ }
1146
+
1147
+ // named export for CJS
1148
+ parseSetCookie.parseSetCookie = parseSetCookie;
1149
+ // for backwards compatibility
1150
+ parseSetCookie.parse = parseSetCookie;
1151
+ parseSetCookie.parseString = parseString;
1152
+ parseSetCookie.splitCookiesString = splitCookiesString;
1153
+
1154
+ /** @import { RemoteForm } from '@sveltejs/kit' */
1155
+ /** @import { BinaryFormMeta, InternalRemoteFormIssue } from 'types' */
1156
+ /** @import { StandardSchemaV1 } from '@standard-schema/spec' */
1157
+
1158
+
1159
+ new TextDecoder();
1160
+
1161
+ /**
1162
+ * Reads all `Set-Cookie` headers as separate values. `Headers.get('set-cookie')`
1163
+ * collapses them into a single comma-joined string that browsers cannot parse, so
1164
+ * we use `Headers.getSetCookie()` where available and fall back to splitting the
1165
+ * joined string otherwise.
1166
+ *
1167
+ * TODO 3.0 `getSetCookie` is available in Node 19.7+; once we drop support for
1168
+ * older versions we can use it directly and remove the `splitCookiesString` fallback
1169
+ * @param {Headers} headers
1170
+ * @returns {string[]}
1171
+ */
1172
+ function get_set_cookies(headers) {
1173
+ if (typeof headers.getSetCookie === 'function') {
1174
+ return headers.getSetCookie();
1175
+ }
1176
+
1177
+ const set_cookie = headers.get('set-cookie');
1178
+ return set_cookie ? splitCookiesString(set_cookie) : [];
1179
+ }
1180
+
1181
+ /**
1182
+ * @param {import('http').IncomingMessage} req
1183
+ * @param {number} [body_size_limit]
1184
+ */
1185
+ function get_raw_body(req, body_size_limit) {
1186
+ const h = req.headers;
1187
+
1188
+ if (!h['content-type']) {
1189
+ return null;
1190
+ }
1191
+
1192
+ const content_length = Number(h['content-length']);
1193
+ const has_content_length = Number.isFinite(content_length);
1194
+
1195
+ // check if no request body
1196
+ if (
1197
+ (req.httpVersionMajor === 1 && !has_content_length && h['transfer-encoding'] == null) ||
1198
+ content_length === 0
1199
+ ) {
1200
+ return null;
1201
+ }
1202
+
1203
+ if (req.destroyed) {
1204
+ const readable = new ReadableStream();
1205
+ void readable.cancel();
1206
+ return readable;
1207
+ }
1208
+
1209
+ let size = 0;
1210
+ let cancelled = false;
1211
+
1212
+ return new ReadableStream({
1213
+ start(controller) {
1214
+ if (body_size_limit !== undefined && has_content_length && content_length > body_size_limit) {
1215
+ let message = `Content-length of ${content_length} exceeds limit of ${body_size_limit} bytes.`;
1216
+
1217
+ if (body_size_limit === 0) {
1218
+ // https://github.com/sveltejs/kit/pull/11589
1219
+ // TODO this exists to aid migration — remove in a future version
1220
+ message += ' To disable body size limits, specify Infinity rather than 0.';
1221
+ }
1222
+
1223
+ const error = new SvelteKitError(413, 'Payload Too Large', message);
1224
+
1225
+ controller.error(error);
1226
+ return;
1227
+ }
1228
+
1229
+ req.on('error', (error) => {
1230
+ cancelled = true;
1231
+ controller.error(error);
1232
+ });
1233
+
1234
+ req.on('end', () => {
1235
+ if (cancelled) return;
1236
+ controller.close();
1237
+ });
1238
+
1239
+ req.on('data', (chunk) => {
1240
+ if (cancelled) return;
1241
+
1242
+ size += chunk.length;
1243
+
1244
+ if (body_size_limit !== undefined && size > body_size_limit) {
1245
+ cancelled = true;
1246
+
1247
+ const message = `request body size exceeded BODY_SIZE_LIMIT of ${body_size_limit}`;
1248
+
1249
+ const error = new SvelteKitError(413, 'Payload Too Large', message);
1250
+ controller.error(error);
1251
+
1252
+ return;
1253
+ }
1254
+
1255
+ if (has_content_length && size > content_length) {
1256
+ cancelled = true;
1257
+
1258
+ const message = `request body size exceeded content-length of ${content_length}`;
1259
+
1260
+ const error = new SvelteKitError(413, 'Payload Too Large', message);
1261
+ controller.error(error);
1262
+
1263
+ return;
1264
+ }
1265
+
1266
+ controller.enqueue(chunk);
1267
+
1268
+ if (controller.desiredSize === null || controller.desiredSize <= 0) {
1269
+ req.pause();
1270
+ }
1271
+ });
1272
+ },
1273
+
1274
+ pull() {
1275
+ req.resume();
1276
+ },
1277
+
1278
+ cancel(reason) {
1279
+ cancelled = true;
1280
+ req.destroy(reason);
1281
+ }
1282
+ });
1283
+ }
1284
+
1285
+ /**
1286
+ * @param {{
1287
+ * request: import('http').IncomingMessage;
1288
+ * base: string;
1289
+ * bodySizeLimit?: number;
1290
+ * }} options
1291
+ * @returns {Promise<Request>}
1292
+ */
1293
+ // TODO 3.0 make the signature synchronous?
1294
+ // eslint-disable-next-line @typescript-eslint/require-await
1295
+ async function getRequest({ request, base, bodySizeLimit }) {
1296
+ let headers = /** @type {Record<string, string>} */ (request.headers);
1297
+ if (request.httpVersionMajor >= 2) {
1298
+ // the Request constructor rejects headers with ':' in the name
1299
+ headers = Object.assign({}, headers);
1300
+ // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.5
1301
+ if (headers[':authority']) {
1302
+ headers.host = headers[':authority'];
1303
+ }
1304
+ delete headers[':authority'];
1305
+ delete headers[':method'];
1306
+ delete headers[':path'];
1307
+ delete headers[':scheme'];
1308
+ }
1309
+
1310
+ // TODO: Whenever Node >=22 is minimum supported version, we can use `request.readableAborted`
1311
+ // @see https://github.com/nodejs/node/blob/5cf3c3e24c7257a0c6192ed8ef71efec8ddac22b/lib/internal/streams/readable.js#L1443-L1453
1312
+ const controller = new AbortController();
1313
+ let errored = false;
1314
+ let end_emitted = false;
1315
+ request.once('error', () => (errored = true));
1316
+ request.once('end', () => (end_emitted = true));
1317
+ request.once('close', () => {
1318
+ if ((errored || request.destroyed) && !end_emitted) {
1319
+ controller.abort();
1320
+ }
1321
+ });
1322
+
1323
+ return new Request(base + request.url, {
1324
+ // @ts-expect-error
1325
+ duplex: 'half',
1326
+ method: request.method,
1327
+ headers: Object.entries(headers),
1328
+ signal: controller.signal,
1329
+ body:
1330
+ request.method === 'GET' || request.method === 'HEAD'
1331
+ ? undefined
1332
+ : get_raw_body(request, bodySizeLimit)
1333
+ });
1334
+ }
1335
+
1336
+ /**
1337
+ * @param {import('http').ServerResponse} res
1338
+ * @param {Response} response
1339
+ * @returns {Promise<void>}
1340
+ */
1341
+ // TODO 3.0 make the signature synchronous?
1342
+ // eslint-disable-next-line @typescript-eslint/require-await
1343
+ async function setResponse(res, response) {
1344
+ for (const [key, value] of response.headers) {
1345
+ try {
1346
+ res.setHeader(key, key === 'set-cookie' ? get_set_cookies(response.headers) : value);
1347
+ } catch (error) {
1348
+ res.getHeaderNames().forEach((name) => res.removeHeader(name));
1349
+ res.writeHead(500).end(String(error));
1350
+ return;
1351
+ }
1352
+ }
1353
+
1354
+ res.writeHead(response.status);
1355
+
1356
+ if (!response.body) {
1357
+ res.end();
1358
+ return;
1359
+ }
1360
+
1361
+ if (response.body.locked) {
1362
+ res.end(
1363
+ 'Fatal error: Response body is locked. ' +
1364
+ "This can happen when the response was already read (for example through 'response.json()' or 'response.text()')."
1365
+ );
1366
+ return;
1367
+ }
1368
+
1369
+ const reader = response.body.getReader();
1370
+
1371
+ if (res.destroyed) {
1372
+ void reader.cancel();
1373
+ return;
1374
+ }
1375
+
1376
+ const cancel = (/** @type {Error|undefined} */ error) => {
1377
+ res.off('close', cancel);
1378
+ res.off('error', cancel);
1379
+
1380
+ // If the reader has already been interrupted with an error earlier,
1381
+ // then it will appear here, it is useless, but it needs to be catch.
1382
+ reader.cancel(error).catch(noop);
1383
+ if (error) res.destroy(error);
1384
+ };
1385
+
1386
+ res.on('close', cancel);
1387
+ res.on('error', cancel);
1388
+
1389
+ void next();
1390
+ async function next() {
1391
+ try {
1392
+ for (;;) {
1393
+ const { done, value } = await reader.read();
1394
+
1395
+ if (done) break;
1396
+
1397
+ if (!res.write(value)) {
1398
+ res.once('drain', next);
1399
+ return;
1400
+ }
1401
+ }
1402
+ res.end();
1403
+ } catch (error) {
1404
+ cancel(error instanceof Error ? error : new Error(String(error)));
1405
+ }
1406
+ }
1407
+ }
1408
+
1409
+ /**
1410
+ * Converts a file on disk to a readable stream
1411
+ * @param {string} file
1412
+ * @returns {ReadableStream}
1413
+ * @since 2.4.0
1414
+ */
1415
+ function createReadableStream(file) {
1416
+ return /** @type {ReadableStream} */ (Readable.toWeb(createReadStream(file)));
1417
+ }
1418
+
1419
+ /**
1420
+ * Parses the given value into number of bytes.
1421
+ *
1422
+ * @param {string} value - Size in bytes. Can also be specified with a unit suffix kilobytes (K), megabytes (M), or gigabytes (G).
1423
+ * @returns {number}
1424
+ */
1425
+ function parse_as_bytes(value) {
1426
+ const multiplier =
1427
+ {
1428
+ K: 1024,
1429
+ M: 1024 * 1024,
1430
+ G: 1024 * 1024 * 1024
1431
+ }[value[value.length - 1]?.toUpperCase()] ?? 1;
1432
+ return Number(multiplier != 1 ? value.substring(0, value.length - 1) : value) * multiplier;
1433
+ }
1434
+
1435
+ /**
1436
+ * Parses and validates an origin URL.
1437
+ *
1438
+ * @param {string | undefined} value - Origin URL with http:// or https:// protocol
1439
+ * @returns {string | undefined} The validated origin, or undefined if value is undefined
1440
+ * @throws {Error} If value is provided but invalid
1441
+ */
1442
+ function parse_origin(value) {
1443
+ if (value === undefined) {
1444
+ return undefined;
1445
+ }
1446
+
1447
+ const trimmed = value.trim();
1448
+
1449
+ let url;
1450
+ try {
1451
+ url = new URL(trimmed);
1452
+ } catch (error) {
1453
+ throw new Error(
1454
+ `Invalid ORIGIN: '${trimmed}'. ` +
1455
+ `ORIGIN must be a valid URL with http:// or https:// protocol. ` +
1456
+ `For example: 'http://localhost:3000' or 'https://my.site'`,
1457
+ { cause: error }
1458
+ );
1459
+ }
1460
+
1461
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') {
1462
+ throw new Error(
1463
+ `Invalid ORIGIN: '${trimmed}'. ` +
1464
+ `Only http:// and https:// protocols are supported. ` +
1465
+ `Received protocol: ${url.protocol}`
1466
+ );
1467
+ }
1468
+
1469
+ return url.origin;
1470
+ }
1471
+
1472
+ /**
1473
+ * Formats the address the server is listening on.
1474
+ *
1475
+ * @param {string | false} path
1476
+ * @param {string} host
1477
+ * @param {string | false} port
1478
+ * @param {import('node:net').AddressInfo | string | null} address
1479
+ * @returns {string}
1480
+ */
1481
+ function format_listening_address(path, host, port, address) {
1482
+ if (path) {
1483
+ return path;
1484
+ }
1485
+
1486
+ if (address && typeof address === 'object') {
1487
+ return format({
1488
+ protocol: 'http:',
1489
+ hostname: address.address,
1490
+ port: address.port
1491
+ });
1492
+ }
1493
+
1494
+ return format({
1495
+ protocol: 'http:',
1496
+ hostname: host,
1497
+ port: String(port)
1498
+ });
1499
+ }
1500
+
1501
+ const prerendered = new Set([]);
1502
+
1503
+ const server = new Server(manifest);
1504
+
1505
+ // parse_origin validates ORIGIN and throws descriptive errors for invalid values
1506
+ const origin = parse_origin(env('ORIGIN', undefined));
1507
+
1508
+ const xff_depth = parseInt(env('XFF_DEPTH', '1'));
1509
+ const address_header = env('ADDRESS_HEADER', '').toLowerCase();
1510
+ const protocol_header = env('PROTOCOL_HEADER', '').toLowerCase();
1511
+ const host_header = env('HOST_HEADER', '').toLowerCase();
1512
+ const port_header = env('PORT_HEADER', '').toLowerCase();
1513
+
1514
+ const body_size_limit = parse_as_bytes(env('BODY_SIZE_LIMIT', '512K'));
1515
+
1516
+ if (isNaN(body_size_limit)) {
1517
+ throw new Error(
1518
+ `Invalid BODY_SIZE_LIMIT: '${env('BODY_SIZE_LIMIT')}'. Please provide a numeric value.`
1519
+ );
1520
+ }
1521
+
1522
+ const asset_dir = `${dir}/client${""}`;
1523
+
1524
+ await server.init({
1525
+ env: /** @type {Record<string, string>} */ (process.env),
1526
+ read: (file) => createReadableStream(`${asset_dir}/${file}`)
1527
+ });
1528
+
1529
+ /**
1530
+ * @param {string} path
1531
+ * @param {boolean} client
1532
+ */
1533
+ function serve(path, client = false) {
1534
+ return fs__default.existsSync(path)
1535
+ ? sirv(path, {
1536
+ etag: true,
1537
+ gzip: false,
1538
+ brotli: false,
1539
+ setHeaders: client
1540
+ ? (res, pathname) => {
1541
+ // only apply to build directory, not e.g. version.json
1542
+ if (
1543
+ pathname.startsWith(`/${manifest.appPath}/immutable/`) &&
1544
+ res.statusCode === 200
1545
+ ) {
1546
+ res.setHeader('cache-control', 'public,max-age=31536000,immutable');
1547
+ }
1548
+ }
1549
+ : undefined
1550
+ })
1551
+ : undefined;
1552
+ }
1553
+
1554
+ // required because the static file server ignores trailing slashes
1555
+ /** @returns {import('polka').Middleware} */
1556
+ function serve_prerendered() {
1557
+ const handler = serve(path.join(dir, 'prerendered'));
1558
+
1559
+ return (req, res, next) => {
1560
+ let { pathname, search, query } = parse$1(req);
1561
+
1562
+ try {
1563
+ pathname = decodeURIComponent(pathname);
1564
+ } catch {
1565
+ // ignore invalid URI
1566
+ }
1567
+
1568
+ if (prerendered.has(pathname)) {
1569
+ return handler?.(req, res, next);
1570
+ }
1571
+
1572
+ // remove or add trailing slash as appropriate
1573
+ let location = pathname.at(-1) === '/' ? pathname.slice(0, -1) : pathname + '/';
1574
+ if (prerendered.has(location)) {
1575
+ if (query) location += search;
1576
+ res.writeHead(308, { location }).end();
1577
+ } else {
1578
+ void next();
1579
+ }
1580
+ };
1581
+ }
1582
+
1583
+ /** @type {import('polka').Middleware} */
1584
+ const ssr = async (req, res) => {
1585
+ /** @type {Request} */
1586
+ let request;
1587
+
1588
+ try {
1589
+ request = await getRequest({
1590
+ base: origin || get_origin(req.headers),
1591
+ request: req,
1592
+ bodySizeLimit: body_size_limit
1593
+ });
1594
+ } catch {
1595
+ res.statusCode = 400;
1596
+ res.end('Bad Request');
1597
+ return;
1598
+ }
1599
+
1600
+ const response = await server.respond(request, {
1601
+ platform: { req },
1602
+ getClientAddress: () => {
1603
+ if (address_header) {
1604
+ if (!(address_header in req.headers)) {
1605
+ throw new Error(
1606
+ `Address header was specified with ${
1607
+ env_prefix + 'ADDRESS_HEADER'
1608
+ }=${address_header} but is absent from request`
1609
+ );
1610
+ }
1611
+
1612
+ const value = /** @type {string} */ (req.headers[address_header]) || '';
1613
+
1614
+ if (address_header === 'x-forwarded-for') {
1615
+ const addresses = value.split(',');
1616
+
1617
+ if (xff_depth < 1) {
1618
+ throw new Error(`${env_prefix + 'XFF_DEPTH'} must be a positive integer`);
1619
+ }
1620
+
1621
+ if (xff_depth > addresses.length) {
1622
+ throw new Error(
1623
+ `${env_prefix + 'XFF_DEPTH'} is ${xff_depth}, but only found ${
1624
+ addresses.length
1625
+ } addresses`
1626
+ );
1627
+ }
1628
+ return addresses[addresses.length - xff_depth].trim();
1629
+ }
1630
+
1631
+ return value;
1632
+ }
1633
+
1634
+ return (
1635
+ req.connection?.remoteAddress ||
1636
+ // @ts-expect-error
1637
+ req.connection?.socket?.remoteAddress ||
1638
+ req.socket?.remoteAddress ||
1639
+ // @ts-expect-error
1640
+ req.info?.remoteAddress
1641
+ );
1642
+ }
1643
+ });
1644
+
1645
+ // Reverse proxies such as nginx buffer responses by default (ignoring
1646
+ // `cache-control`), which breaks streaming responses like server-sent events.
1647
+ // `X-Accel-Buffering: no` opts out of that buffering and is a no-op on proxies
1648
+ // that don't recognise it. See https://github.com/sveltejs/kit/issues/15790
1649
+ if (response.headers.get('content-type') === 'text/event-stream') {
1650
+ response.headers.set('x-accel-buffering', 'no');
1651
+ }
1652
+
1653
+ await setResponse(res, response);
1654
+ };
1655
+
1656
+ /** @param {import('polka').Middleware[]} handlers */
1657
+ function sequence(handlers) {
1658
+ /** @type {import('polka').Middleware} */
1659
+ return (req, res, next) => {
1660
+ /**
1661
+ * @param {number} i
1662
+ * @returns {ReturnType<import('polka').Middleware>}
1663
+ */
1664
+ function handle(i) {
1665
+ if (i < handlers.length) {
1666
+ return handlers[i](req, res, () => handle(i + 1));
1667
+ } else {
1668
+ return next();
1669
+ }
1670
+ }
1671
+
1672
+ return handle(0);
1673
+ };
1674
+ }
1675
+
1676
+ /**
1677
+ * @param {string} name
1678
+ * @param {string | string[] | undefined} value
1679
+ * @returns {string | undefined}
1680
+ */
1681
+ function normalise_header(name, value) {
1682
+ if (!name) return undefined;
1683
+ if (Array.isArray(value)) {
1684
+ if (value.length === 0) return undefined;
1685
+ if (value.length === 1) return value[0];
1686
+ throw new Error(
1687
+ `Multiple values provided for ${name} header where only one expected: ${value}`
1688
+ );
1689
+ }
1690
+ return value;
1691
+ }
1692
+
1693
+ /**
1694
+ * @param {import('http').IncomingHttpHeaders} headers
1695
+ * @returns {string}
1696
+ */
1697
+ function get_origin(headers) {
1698
+ const protocol = decodeURIComponent(
1699
+ normalise_header(protocol_header, headers[protocol_header]) || 'https'
1700
+ );
1701
+
1702
+ // this helps us avoid host injections through the protocol header
1703
+ if (protocol.includes(':')) {
1704
+ throw new Error(
1705
+ `The ${protocol_header} header specified ${protocol} which is an invalid because it includes \`:\`. It should only contain the protocol scheme (e.g. \`https\`)`
1706
+ );
1707
+ }
1708
+
1709
+ const host =
1710
+ normalise_header(host_header, headers[host_header]) ||
1711
+ normalise_header('host', headers['host']);
1712
+ if (!host) {
1713
+ const header_names = host_header ? `${host_header} or host headers` : 'host header';
1714
+ throw new Error(
1715
+ `Could not determine host. The request must have a value provided by the ${header_names}`
1716
+ );
1717
+ }
1718
+
1719
+ const port = normalise_header(port_header, headers[port_header]);
1720
+ if (port && isNaN(+port)) {
1721
+ throw new Error(
1722
+ `The ${port_header} header specified ${port} which is an invalid port because it is not a number. The value should only contain the port number (e.g. 443)`
1723
+ );
1724
+ }
1725
+
1726
+ return port ? `${protocol}://${host}:${port}` : `${protocol}://${host}`;
1727
+ }
1728
+
1729
+ const handler = sequence(
1730
+ /** @type {(import('sirv').RequestHandler | import('polka').Middleware)[]} */
1731
+ ([serve(path.join(dir, 'client'), true), serve_prerendered(), ssr].filter(Boolean))
1732
+ );
1733
+
1734
+ export { format_listening_address as f, handler as h, polka as p };
1735
+ //# sourceMappingURL=handler-Dlwmumt5.js.map