@vercel/cli-support 0.0.0 → 65.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +100 -3
  3. package/dist/chunks/add-7NS6HIWC.js +8 -0
  4. package/dist/chunks/add-NMYFDVXW.js +8 -0
  5. package/dist/chunks/add-PMJ5BECU.js +8 -0
  6. package/dist/chunks/build-BCY6HQJG.js +7 -0
  7. package/dist/chunks/chunk-25565AGS.js +7 -0
  8. package/dist/chunks/chunk-2EYYB6YN.js +7 -0
  9. package/dist/chunks/chunk-2GHZGOWT.js +7 -0
  10. package/dist/chunks/chunk-2K3ISCQ6.js +7 -0
  11. package/dist/chunks/chunk-2NABMKFV.js +29 -0
  12. package/dist/chunks/chunk-2S6PE6GB.js +7 -0
  13. package/dist/chunks/chunk-2TUVL6WE.js +12 -0
  14. package/dist/chunks/chunk-363SJ4TN.js +7 -0
  15. package/dist/chunks/chunk-3G3FQYMW.js +7 -0
  16. package/dist/chunks/chunk-3LIKVGFT.js +8 -0
  17. package/dist/chunks/chunk-3XW7N4W3.js +9 -0
  18. package/dist/chunks/chunk-462YCCJZ.js +7 -0
  19. package/dist/chunks/chunk-4CACOKMS.js +7 -0
  20. package/dist/chunks/chunk-4N6LMERQ.js +57 -0
  21. package/dist/chunks/chunk-4NTBYNFR.js +17 -0
  22. package/dist/chunks/chunk-4SAVH3H7.js +7 -0
  23. package/dist/chunks/chunk-4VFYJU37.js +7 -0
  24. package/dist/chunks/chunk-527GBU3K.js +7 -0
  25. package/dist/chunks/chunk-5IWFRZQT.js +10 -0
  26. package/dist/chunks/chunk-5KUUMQ3M.js +7 -0
  27. package/dist/chunks/chunk-5RMIM4S2.js +7 -0
  28. package/dist/chunks/chunk-5V53NA6C.js +7 -0
  29. package/dist/chunks/chunk-67GZ5REA.js +7 -0
  30. package/dist/chunks/chunk-6I6QJHCY.js +7 -0
  31. package/dist/chunks/chunk-6IDNVZZR.js +7 -0
  32. package/dist/chunks/chunk-6OVX3PWM.js +7 -0
  33. package/dist/chunks/chunk-6QKS6QK7.js +7 -0
  34. package/dist/chunks/chunk-6TXEVQA4.js +7 -0
  35. package/dist/chunks/chunk-6VH56CX2.js +19 -0
  36. package/dist/chunks/chunk-6Y2ZL5XJ.js +98 -0
  37. package/dist/chunks/chunk-6YXIWZ3X.js +25 -0
  38. package/dist/chunks/chunk-773GOZIR.js +13 -0
  39. package/dist/chunks/chunk-7E3WREH5.js +7 -0
  40. package/dist/chunks/chunk-7EJQLVWX.js +7 -0
  41. package/dist/chunks/chunk-7L2K4OKM.js +63 -0
  42. package/dist/chunks/chunk-7L5QUDUR.js +8 -0
  43. package/dist/chunks/chunk-7QAGSRCU.js +7 -0
  44. package/dist/chunks/chunk-7R6TRRG5.js +7 -0
  45. package/dist/chunks/chunk-7YKFF6CE.js +7 -0
  46. package/dist/chunks/chunk-A2RZZQEP.js +7 -0
  47. package/dist/chunks/chunk-ADLBLGT3.js +8 -0
  48. package/dist/chunks/chunk-AM46JVVN.js +7 -0
  49. package/dist/chunks/chunk-ANMDN3EG.js +9 -0
  50. package/dist/chunks/chunk-AYUUSAB7.js +7 -0
  51. package/dist/chunks/chunk-BLUPZPAS.js +7 -0
  52. package/dist/chunks/chunk-BPUANOGW.js +7 -0
  53. package/dist/chunks/chunk-BRQUZ5NC.js +7 -0
  54. package/dist/chunks/chunk-BS32OUOC.js +7 -0
  55. package/dist/chunks/chunk-BTI5TG6Q.js +7 -0
  56. package/dist/chunks/chunk-BUJITHGZ.js +8 -0
  57. package/dist/chunks/chunk-BVGGTBYE.js +7 -0
  58. package/dist/chunks/chunk-BVH2AEFE.js +7 -0
  59. package/dist/chunks/chunk-BZENIQ7N.js +7 -0
  60. package/dist/chunks/chunk-C6GY2G73.js +7 -0
  61. package/dist/chunks/chunk-C7FQMC6D.js +7 -0
  62. package/dist/chunks/chunk-CBVKB3DT.js +21 -0
  63. package/dist/chunks/chunk-CC6FLKIP.js +11 -0
  64. package/dist/chunks/chunk-COD3WAUI.js +7 -0
  65. package/dist/chunks/chunk-CR3NBTHV.js +7 -0
  66. package/dist/chunks/chunk-CWM2F235.js +7 -0
  67. package/dist/chunks/chunk-CZSOZKHX.js +7 -0
  68. package/dist/chunks/chunk-D3AHZ5LI.js +7 -0
  69. package/dist/chunks/chunk-D6REP5QQ.js +15 -0
  70. package/dist/chunks/chunk-DFVNL5ML.js +7 -0
  71. package/dist/chunks/chunk-DKJL2KV7.js +7 -0
  72. package/dist/chunks/chunk-DQ2SVW4R.js +12 -0
  73. package/dist/chunks/chunk-DWZBL4NK.js +7 -0
  74. package/dist/chunks/chunk-EAUDC24V.js +9 -0
  75. package/dist/chunks/chunk-EAXMWCOL.js +63 -0
  76. package/dist/chunks/chunk-ECEDD646.js +8 -0
  77. package/dist/chunks/chunk-ECQIO5K3.js +7 -0
  78. package/dist/chunks/chunk-EEUJLJEJ.js +7 -0
  79. package/dist/chunks/chunk-EGNR2DEI.js +7 -0
  80. package/dist/chunks/chunk-EISD3RG7.js +11 -0
  81. package/dist/chunks/chunk-EKZTFGDX.js +7 -0
  82. package/dist/chunks/chunk-ETV3C2CV.js +7 -0
  83. package/dist/chunks/chunk-EU2GBIPC.js +7 -0
  84. package/dist/chunks/chunk-F4KY2TOK.js +7 -0
  85. package/dist/chunks/chunk-F53OKXYI.js +7 -0
  86. package/dist/chunks/chunk-F6EBOT64.js +7 -0
  87. package/dist/chunks/chunk-F7AVGV4Y.js +7 -0
  88. package/dist/chunks/chunk-FBYA6LLM.js +7 -0
  89. package/dist/chunks/chunk-FGFLTLEA.js +7 -0
  90. package/dist/chunks/chunk-FHU2O7ZJ.js +8 -0
  91. package/dist/chunks/chunk-FLHO75XC.js +8 -0
  92. package/dist/chunks/chunk-FSPPKNKN.js +7 -0
  93. package/dist/chunks/chunk-FUX6LKNP.js +7 -0
  94. package/dist/chunks/chunk-GA277JFB.js +20 -0
  95. package/dist/chunks/chunk-GCZVIDNG.js +86 -0
  96. package/dist/chunks/chunk-GD7AV7BO.js +9 -0
  97. package/dist/chunks/chunk-GG5RME4X.js +7 -0
  98. package/dist/chunks/chunk-GHAY4PSD.js +7 -0
  99. package/dist/chunks/chunk-GYVJIIYL.js +7 -0
  100. package/dist/chunks/chunk-GZNDA6SV.js +8 -0
  101. package/dist/chunks/chunk-HCRD3JFL.js +7 -0
  102. package/dist/chunks/chunk-HEGJZJO7.js +7 -0
  103. package/dist/chunks/chunk-HRR57QNP.js +7 -0
  104. package/dist/chunks/chunk-HSFKISDH.js +9 -0
  105. package/dist/chunks/chunk-HTXDC7E2.js +10 -0
  106. package/dist/chunks/chunk-ID663OJ7.js +7 -0
  107. package/dist/chunks/chunk-IOZ3I765.js +7 -0
  108. package/dist/chunks/chunk-IQ7FPAI4.js +7 -0
  109. package/dist/chunks/chunk-IQKGQ2Y2.js +15 -0
  110. package/dist/chunks/chunk-ISWW3DKF.js +7 -0
  111. package/dist/chunks/chunk-IVSSTHB6.js +7 -0
  112. package/dist/chunks/chunk-J24BABG4.js +21 -0
  113. package/dist/chunks/chunk-JALVF3C2.js +7 -0
  114. package/dist/chunks/chunk-JELLVPCM.js +8 -0
  115. package/dist/chunks/chunk-JESNVRVR.js +7 -0
  116. package/dist/chunks/chunk-JLE7K4SY.js +9 -0
  117. package/dist/chunks/chunk-JLEJB6KM.js +7 -0
  118. package/dist/chunks/chunk-JP33AIDQ.js +7 -0
  119. package/dist/chunks/chunk-JRPNHWA3.js +7 -0
  120. package/dist/chunks/chunk-JUSR7V2L.js +7 -0
  121. package/dist/chunks/chunk-JWCEHQQF.js +29 -0
  122. package/dist/chunks/chunk-K5U47EVH.js +7 -0
  123. package/dist/chunks/chunk-KCKYPLIH.js +7 -0
  124. package/dist/chunks/chunk-KGBIRIFF.js +7 -0
  125. package/dist/chunks/chunk-KJA2GKPT.js +7 -0
  126. package/dist/chunks/chunk-KPQLUGFI.js +32 -0
  127. package/dist/chunks/chunk-KQCFC2JL.js +7 -0
  128. package/dist/chunks/chunk-KQCROPL3.js +8 -0
  129. package/dist/chunks/chunk-KRPY5FHJ.js +7 -0
  130. package/dist/chunks/chunk-KW6GSQXV.js +7 -0
  131. package/dist/chunks/chunk-KY335KWI.js +7 -0
  132. package/dist/chunks/chunk-L3JYCXVB.js +23 -0
  133. package/dist/chunks/chunk-LFOWP74R.js +7 -0
  134. package/dist/chunks/chunk-LOBA3E72.js +7 -0
  135. package/dist/chunks/chunk-LQVSU5HR.js +7 -0
  136. package/dist/chunks/chunk-LSF7FY6X.js +7 -0
  137. package/dist/chunks/chunk-LSQREJXO.js +11 -0
  138. package/dist/chunks/chunk-LW4N3CW6.js +9 -0
  139. package/dist/chunks/chunk-M2NXKZKX.js +16 -0
  140. package/dist/chunks/chunk-MBEKRUTQ.js +8 -0
  141. package/dist/chunks/chunk-MCRKBVZA.js +7 -0
  142. package/dist/chunks/chunk-MVGTMPMI.js +23 -0
  143. package/dist/chunks/chunk-MXTC4ZAQ.js +7 -0
  144. package/dist/chunks/chunk-N2FLYCCO.js +9 -0
  145. package/dist/chunks/chunk-N6JBQMOF.js +20 -0
  146. package/dist/chunks/chunk-NAX6IARA.js +11 -0
  147. package/dist/chunks/chunk-NB2WLB3J.js +12 -0
  148. package/dist/chunks/chunk-NGKO2OOU.js +8 -0
  149. package/dist/chunks/chunk-NW7WWUCQ.js +9 -0
  150. package/dist/chunks/chunk-NWGBDBZI.js +7 -0
  151. package/dist/chunks/chunk-NZ2TFADV.js +7 -0
  152. package/dist/chunks/chunk-O4WNSKQR.js +15 -0
  153. package/dist/chunks/chunk-O72YDZKD.js +10 -0
  154. package/dist/chunks/chunk-OAM5NJCU.js +9 -0
  155. package/dist/chunks/chunk-OCR5CRTH.js +10 -0
  156. package/dist/chunks/chunk-OFDTADPQ.js +7 -0
  157. package/dist/chunks/chunk-OHEOYFBU.js +9 -0
  158. package/dist/chunks/chunk-OO572JUC.js +7 -0
  159. package/dist/chunks/chunk-OPORM35X.js +7 -0
  160. package/dist/chunks/chunk-OZCQTXI4.js +7 -0
  161. package/dist/chunks/chunk-PADL3C6Z.js +7 -0
  162. package/dist/chunks/chunk-PFD7LETF.js +7 -0
  163. package/dist/chunks/chunk-PFPJLIFF.js +33 -0
  164. package/dist/chunks/chunk-PSOVLGHP.js +7 -0
  165. package/dist/chunks/chunk-PUKYAALC.js +7 -0
  166. package/dist/chunks/chunk-PVASGBEF.js +7 -0
  167. package/dist/chunks/chunk-Q4KTAQB3.js +7 -0
  168. package/dist/chunks/chunk-Q5ODLDCU.js +7 -0
  169. package/dist/chunks/chunk-Q7D7RGXM.js +7 -0
  170. package/dist/chunks/chunk-QB7F3UAP.js +7 -0
  171. package/dist/chunks/chunk-QHJLRTVY.js +7 -0
  172. package/dist/chunks/chunk-QIVX6SCR.js +27 -0
  173. package/dist/chunks/chunk-QVHXFHBV.js +14 -0
  174. package/dist/chunks/chunk-QVXS234E.js +7 -0
  175. package/dist/chunks/chunk-QVZAAMGQ.js +39 -0
  176. package/dist/chunks/chunk-R2BUF6Z7.js +7 -0
  177. package/dist/chunks/chunk-R2XHJDAP.js +7 -0
  178. package/dist/chunks/chunk-R6BEOVTU.js +7 -0
  179. package/dist/chunks/chunk-RLKS5G6C.js +12 -0
  180. package/dist/chunks/chunk-RM3ZDRYE.js +7 -0
  181. package/dist/chunks/chunk-RMZTB2IU.js +7 -0
  182. package/dist/chunks/chunk-RRDNKB2X.js +7 -0
  183. package/dist/chunks/chunk-RW3X523R.js +8 -0
  184. package/dist/chunks/chunk-S3L2OHPO.js +7 -0
  185. package/dist/chunks/chunk-SACGQMVQ.js +13 -0
  186. package/dist/chunks/chunk-SCV7XEEO.js +7 -0
  187. package/dist/chunks/chunk-SF4E3AQ3.js +7 -0
  188. package/dist/chunks/chunk-SLGUYM42.js +10 -0
  189. package/dist/chunks/chunk-SYFG2RM6.js +10 -0
  190. package/dist/chunks/chunk-T6243EDS.js +7 -0
  191. package/dist/chunks/chunk-TAAWMNNL.js +7 -0
  192. package/dist/chunks/chunk-TAISZMA2.js +7 -0
  193. package/dist/chunks/chunk-TEYREL44.js +7 -0
  194. package/dist/chunks/chunk-TG2RCYTH.js +7 -0
  195. package/dist/chunks/chunk-TIPQQ4TG.js +17 -0
  196. package/dist/chunks/chunk-U2OBPULW.js +7 -0
  197. package/dist/chunks/chunk-U4Z2MMOF.js +301 -0
  198. package/dist/chunks/chunk-U56NHYAH.js +7 -0
  199. package/dist/chunks/chunk-UGNIIDHR.js +32 -0
  200. package/dist/chunks/chunk-UHBMX3OK.js +7 -0
  201. package/dist/chunks/chunk-UVHKXCR5.js +11 -0
  202. package/dist/chunks/chunk-V6Y6UK6B.js +43 -0
  203. package/dist/chunks/chunk-VNIKIQVE.js +10 -0
  204. package/dist/chunks/chunk-VT6RIZJH.js +7 -0
  205. package/dist/chunks/chunk-WDXW6A4H.js +10 -0
  206. package/dist/chunks/chunk-WEH6XC4Y.js +22 -0
  207. package/dist/chunks/chunk-WKZ6JSGZ.js +7 -0
  208. package/dist/chunks/chunk-WVHCBDTB.js +7 -0
  209. package/dist/chunks/chunk-XC46OAAT.js +9 -0
  210. package/dist/chunks/chunk-XGTKHQTT.js +7 -0
  211. package/dist/chunks/chunk-XOETL6DB.js +96 -0
  212. package/dist/chunks/chunk-XP3FT56R.js +27 -0
  213. package/dist/chunks/chunk-XR6QY7RR.js +7 -0
  214. package/dist/chunks/chunk-XVDRGWXM.js +16 -0
  215. package/dist/chunks/chunk-Y5ZMKL7E.js +7 -0
  216. package/dist/chunks/chunk-YEZJNXQX.js +7 -0
  217. package/dist/chunks/chunk-YHPPP3SF.js +7 -0
  218. package/dist/chunks/chunk-YHULP2KK.js +7 -0
  219. package/dist/chunks/chunk-YMZ6WBKB.js +21 -0
  220. package/dist/chunks/chunk-ZF27J6FQ.js +7 -0
  221. package/dist/chunks/chunk-ZFRNVIHI.js +7 -0
  222. package/dist/chunks/chunk-ZN6CQWVP.js +7 -0
  223. package/dist/chunks/chunk-ZQBSAMFL.js +24 -0
  224. package/dist/chunks/cjs-2SMN43VH.js +54 -0
  225. package/dist/chunks/clear-FKVWDCVA.js +8 -0
  226. package/dist/chunks/compile-vercel-config-GWAJE44R.js +7 -0
  227. package/dist/chunks/config-5WVLG5SE.js +8 -0
  228. package/dist/chunks/config-RMOHN5YT.js +7 -0
  229. package/dist/chunks/config-validator.mjs +1 -0
  230. package/dist/chunks/connect-git-provider-FS5Q2HO4.js +7 -0
  231. package/dist/chunks/constants-JAB7MRSK.js +7 -0
  232. package/dist/chunks/create-project-IKCB6MB2.js +7 -0
  233. package/dist/chunks/delete-5WMB4WFR.js +9 -0
  234. package/dist/chunks/delete-EM4JZPFA.js +10 -0
  235. package/dist/chunks/detect-projects-OD4JEAW2.js +7 -0
  236. package/dist/chunks/detect-services-BSJGB4RM.js +7 -0
  237. package/dist/chunks/disable-QOM7UHQC.js +7 -0
  238. package/dist/chunks/discard-L5ZH7P5B.js +14 -0
  239. package/dist/chunks/dist-33WTJLVQ.js +7 -0
  240. package/dist/chunks/dist-RXYNZPEA.js +7 -0
  241. package/dist/chunks/edit-F3VJGCG2.js +9 -0
  242. package/dist/chunks/edit-TM7YCWBU.js +8 -0
  243. package/dist/chunks/enable-72C3QX34.js +7 -0
  244. package/dist/chunks/esm-33752ISR.js +7 -0
  245. package/dist/chunks/esm-4JKEE7PC.js +7 -0
  246. package/dist/chunks/esm-BYG5BWYH.js +9 -0
  247. package/dist/chunks/esm-DFFBNKNU.js +20 -0
  248. package/dist/chunks/esm-IF453UWS.js +7 -0
  249. package/dist/chunks/esm-LABWDJ72.js +7 -0
  250. package/dist/chunks/esm-TG37FXTU.js +9 -0
  251. package/dist/chunks/exec-OZSY46V6.js +16372 -0
  252. package/dist/chunks/export-EPLYZF2Q.js +19 -0
  253. package/dist/chunks/fetch-proxy-45DGILKR.js +67 -0
  254. package/dist/chunks/future-V77DRMQG.js +7 -0
  255. package/dist/chunks/generate-cert-for-deploy-Y3YHBMPU.js +7 -0
  256. package/dist/chunks/image-CVXEXU5R.js +7 -0
  257. package/dist/chunks/import-builders-PGRKJOOE.js +7 -0
  258. package/dist/chunks/inspect-BTRNXRJT.js +9 -0
  259. package/dist/chunks/inspect-CZ7WXYE5.js +20 -0
  260. package/dist/chunks/inspect-FGDVWAQP.js +13 -0
  261. package/dist/chunks/inspect-HFDGZNWC.js +15 -0
  262. package/dist/chunks/inspect-T2AIREYK.js +19 -0
  263. package/dist/chunks/list-CKRRHAOE.js +12 -0
  264. package/dist/chunks/list-FLREMGJR.js +16 -0
  265. package/dist/chunks/list-ON4YTQRN.js +10 -0
  266. package/dist/chunks/login-55LJ5ZA6.js +9 -0
  267. package/dist/chunks/login-DQRZSD4Z.js +7 -0
  268. package/dist/chunks/logs-2HQXWOHM.js +7 -0
  269. package/dist/chunks/ls-2HUJHVLA.js +12 -0
  270. package/dist/chunks/ls-3DVM5HLK.js +12 -0
  271. package/dist/chunks/ls-4B3QYHCI.js +8 -0
  272. package/dist/chunks/ls-A7K4XDQB.js +8 -0
  273. package/dist/chunks/ls-FK5XEJEU.js +12 -0
  274. package/dist/chunks/ls-QGUKJJY5.js +12 -0
  275. package/dist/chunks/ls-VTKHPDWS.js +11 -0
  276. package/dist/chunks/mutate-7ADZBCZM.js +9 -0
  277. package/dist/chunks/notifications-XZJXE2K4.js +7 -0
  278. package/dist/chunks/open-EE5IZQD7.js +7 -0
  279. package/dist/chunks/openapi-QBX62ZXC.js +7 -0
  280. package/dist/chunks/permissions-VYJ4LL5R.js +7 -0
  281. package/dist/chunks/pkg-EDJQLCNP.js +7 -0
  282. package/dist/chunks/plugin-offer-TEGYA3TA.js +9 -0
  283. package/dist/chunks/prompt-missing-credentials-VP6OVCFM.js +7 -0
  284. package/dist/chunks/publish-2HEK5UMJ.js +15 -0
  285. package/dist/chunks/pull-WRTTSY7J.js +7 -0
  286. package/dist/chunks/purchase-domain-if-available-6S3NLTUI.js +7 -0
  287. package/dist/chunks/push-L3QRGGLC.js +7 -0
  288. package/dist/chunks/query-FXXLX6UB.js +12 -0
  289. package/dist/chunks/reauthenticate-IXQDC4UZ.js +7 -0
  290. package/dist/chunks/reorder-B4OXSYCI.js +10 -0
  291. package/dist/chunks/reply-F637K6XH.js +9 -0
  292. package/dist/chunks/repo-info-to-url-XQSULSEO.js +7 -0
  293. package/dist/chunks/resolve-E3F6NYQZ.js +12 -0
  294. package/dist/chunks/resolve-agent-team-EIPCH766.js +7 -0
  295. package/dist/chunks/resolve-deployment-framework-preset-AXXYBFCL.js +7 -0
  296. package/dist/chunks/restore-Q25KRZPH.js +16 -0
  297. package/dist/chunks/rm-FWD2NUGX.js +8 -0
  298. package/dist/chunks/rm-JMQ4QKCC.js +8 -0
  299. package/dist/chunks/rm-PPG7P3GN.js +8 -0
  300. package/dist/chunks/rm-SH3DYKNS.js +8 -0
  301. package/dist/chunks/rm-UEBLKFVC.js +8 -0
  302. package/dist/chunks/routes-PKTWMDWQ.js +7 -0
  303. package/dist/chunks/rule-inspect-LKQA5I4V.js +8 -0
  304. package/dist/chunks/schema-FBV42W7N.js +14 -0
  305. package/dist/chunks/schema-ZWE5MNMG.js +44 -0
  306. package/dist/chunks/select-org-WMB752Z6.js +7 -0
  307. package/dist/chunks/set-UTYIPOLC.js +7 -0
  308. package/dist/chunks/setup-and-link-ZLY5XQW5.js +7 -0
  309. package/dist/chunks/skills-RKIGVVNM.js +590 -0
  310. package/dist/chunks/slugify-NMMUASYK.js +7 -0
  311. package/dist/chunks/stamp-TKONNIJ5.js +7 -0
  312. package/dist/chunks/tags-UCLZ5UMX.js +7 -0
  313. package/dist/chunks/token-W6P2KNI5.js +7 -0
  314. package/dist/chunks/token-util-JDQI37VN.js +7 -0
  315. package/dist/chunks/types-YM7TMHXW.js +14 -0
  316. package/dist/chunks/update-BGDQ5TXO.js +8 -0
  317. package/dist/chunks/update-route-version-KWK5S4UW.js +7 -0
  318. package/dist/chunks/utils-IQZEE4DT.js +86 -0
  319. package/dist/chunks/vlt-builder-graph-XL2XRO4V.js +7 -0
  320. package/dist/chunks/vlt-builder-importer-RBUPAB6J.js +11 -0
  321. package/dist/chunks/zod-2C2SXNIK.js +7 -0
  322. package/dist/commands/build/builder-worker.cjs +281 -0
  323. package/dist/commands/build/index.js +34 -0
  324. package/dist/commands/deploy/index.js +72 -0
  325. package/dist/commands/dev/builder-worker.cjs +110 -0
  326. package/dist/commands/dev/index.js +157 -0
  327. package/dist/commands/env/index.js +40 -0
  328. package/dist/commands/link/index.js +10 -0
  329. package/dist/commands/list/index.js +14 -0
  330. package/dist/commands/project/index.js +113 -0
  331. package/dist/commands-account.js +209 -0
  332. package/dist/commands-ai.js +200 -0
  333. package/dist/commands-blob.js +107 -0
  334. package/dist/commands-core.js +222 -0
  335. package/dist/commands-deployments.js +84 -0
  336. package/dist/commands-flags.js +377 -0
  337. package/dist/commands-integrations.js +143 -0
  338. package/dist/commands-observability.js +122 -0
  339. package/dist/commands-routing.js +273 -0
  340. package/dist/fetch-dist-tags.cjs +60 -0
  341. package/dist/get-latest-worker.cjs +222 -0
  342. package/dist/help.js +7 -0
  343. package/dist/index.js +27 -0
  344. package/dist/internal-build-worker.js +10 -0
  345. package/dist/internal-build.js +11 -0
  346. package/dist/package.json +264 -0
  347. package/dist/root-help-commands.mjs +1 -0
  348. package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
  349. package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
  350. package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
  351. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +220 -0
  352. package/dist/vc.js +404 -0
  353. package/dist/version.mjs +2 -0
  354. package/package.json +224 -14
  355. package/index.js +0 -1
@@ -0,0 +1,157 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{displayDetectedServices,readConfig,setupAndLink}from"../../chunks/chunk-JWCEHQQF.js";import{loadVercelConfig,tryDetectServices}from"../../chunks/chunk-DQ2SVW4R.js";import"../../chunks/chunk-COD3WAUI.js";import"../../chunks/chunk-QB7F3UAP.js";import{FIX_BY_CODE,createErrorReporter,import_write_build_result,require_detect_builders_with_services,require_get_files,require_mime_types,require_schedule_entrypoint,require_service_schedules,toDiagnostic}from"../../chunks/chunk-ZQBSAMFL.js";import{importBuilders,require_npa}from"../../chunks/chunk-ECEDD646.js";import"../../chunks/chunk-4CACOKMS.js";import"../../chunks/chunk-QHJLRTVY.js";import{decodeJwt}from"../../chunks/chunk-S3L2OHPO.js";import{require_fast_deep_equal}from"../../chunks/chunk-MCRKBVZA.js";import{remoteText}from"../../chunks/chunk-GYVJIIYL.js";import{LOCAL_SCHEDULES_SESSION_HEADER,createLocalSchedulesSession}from"../../chunks/chunk-SF4E3AQ3.js";import{getEnabledProtection}from"../../chunks/chunk-GG5RME4X.js";import"../../chunks/chunk-FHU2O7ZJ.js";import{promptExperimentalServicesMigration}from"../../chunks/chunk-UGNIIDHR.js";import{validateConfig}from"../../chunks/chunk-R2BUF6Z7.js";import{pickOverrides}from"../../chunks/chunk-KJA2GKPT.js";import"../../chunks/chunk-VT6RIZJH.js";import{require_dist as require_dist5}from"../../chunks/chunk-N6JBQMOF.js";import{require_raw_body}from"../../chunks/chunk-XOETL6DB.js";import{readJSONFile}from"../../chunks/chunk-R2XHJDAP.js";import{require_main}from"../../chunks/chunk-QVHXFHBV.js";import{getUpdateCommand}from"../../chunks/chunk-KQCFC2JL.js";import"../../chunks/chunk-BPUANOGW.js";import"../../chunks/chunk-IQKGQ2Y2.js";import"../../chunks/chunk-EAUDC24V.js";import"../../chunks/chunk-RRDNKB2X.js";import"../../chunks/chunk-MVGTMPMI.js";import"../../chunks/chunk-SACGQMVQ.js";import"../../chunks/chunk-D6REP5QQ.js";import"../../chunks/chunk-7L5QUDUR.js";import"../../chunks/chunk-J24BABG4.js";import"../../chunks/chunk-U4Z2MMOF.js";import{external_exports}from"../../chunks/chunk-2NABMKFV.js";import"../../chunks/chunk-BUJITHGZ.js";import"../../chunks/chunk-FBYA6LLM.js";import{require_brace_expansion,require_dist as require_dist3,require_dist2 as require_dist4,require_minimatch}from"../../chunks/chunk-7L2K4OKM.js";import"../../chunks/chunk-OCR5CRTH.js";import{VERCEL_OIDC_TOKEN}from"../../chunks/chunk-L3JYCXVB.js";import{pullEnvRecords}from"../../chunks/chunk-C7FQMC6D.js";import{require_frameworks}from"../../chunks/chunk-6Y2ZL5XJ.js";import"../../chunks/chunk-7QAGSRCU.js";import{require_json_parse_better_errors}from"../../chunks/chunk-25565AGS.js";import"../../chunks/chunk-JP33AIDQ.js";import"../../chunks/chunk-WEH6XC4Y.js";import"../../chunks/chunk-7YKFF6CE.js";import"../../chunks/chunk-6OVX3PWM.js";import"../../chunks/chunk-HTXDC7E2.js";import"../../chunks/chunk-PVASGBEF.js";import{printProjectNotFoundError}from"../../chunks/chunk-2TUVL6WE.js";import"../../chunks/chunk-R6BEOVTU.js";import"../../chunks/chunk-HCRD3JFL.js";import"../../chunks/chunk-7EJQLVWX.js";import"../../chunks/chunk-IQ7FPAI4.js";import"../../chunks/chunk-GD7AV7BO.js";import"../../chunks/chunk-T6243EDS.js";import{getSubcommand}from"../../chunks/chunk-ETV3C2CV.js";import{getTeams}from"../../chunks/chunk-FGFLTLEA.js";import"../../chunks/chunk-SCV7XEEO.js";import{DEV_QUEUE_API_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_QUEUE_PROXY_PREFIX,DEV_RESOURCE_TOKEN,DEV_RUNTIME_CACHE_DEFAULT_PORT,DEV_SCHEDULES_DEFAULT_PORT,DEV_SCHEDULES_PROXY_PREFIX,devCommand,getDevQueueEnv,getDevSchedulesEnv,isValidDevResourceHost,listenOnDevResourcePort}from"../../chunks/chunk-7R6TRRG5.js";import{require_dist as require_dist2}from"../../chunks/chunk-JALVF3C2.js";import"../../chunks/chunk-OZCQTXI4.js";import{help}from"../../chunks/chunk-FLHO75XC.js";import"../../chunks/chunk-773GOZIR.js";import{printError}from"../../chunks/chunk-HSFKISDH.js";import"../../chunks/chunk-67GZ5REA.js";import"../../chunks/chunk-BS32OUOC.js";import{param}from"../../chunks/chunk-3G3FQYMW.js";import{TelemetryClient}from"../../chunks/chunk-6YXIWZ3X.js";import"../../chunks/chunk-PUKYAALC.js";import{detectExplicitScope}from"../../chunks/chunk-K5U47EVH.js";import{require_ms}from"../../chunks/chunk-MXTC4ZAQ.js";import{isNativeBinaryInstall}from"../../chunks/chunk-NWGBDBZI.js";import{buildCommandWithYes,outputActionRequired}from"../../chunks/chunk-WDXW6A4H.js";import"../../chunks/chunk-DKJL2KV7.js";import{VERCEL_DIR,findRepoRoot,getLinkedProject,getLocalPathConfig,getUser,getVercelDirectory,highlight,localConfigFlagPath,require_lib,require_pluralize,resolveProjectCwd,ua_default}from"../../chunks/chunk-4N6LMERQ.js";import{printAlignedLabel}from"../../chunks/chunk-ADLBLGT3.js";import{getGlobalPathConfig}from"../../chunks/chunk-CWM2F235.js";import"../../chunks/chunk-4NTBYNFR.js";import{parseArguments}from"../../chunks/chunk-KCKYPLIH.js";import"../../chunks/chunk-F53OKXYI.js";import{getFlagsSpecification,warnDeprecatedSubcommand}from"../../chunks/chunk-QVXS234E.js";import{directFetch,getFetchDispatcher}from"../../chunks/chunk-FUX6LKNP.js";import"../../chunks/chunk-OPORM35X.js";import"../../chunks/chunk-4SAVH3H7.js";import{APIError,CantParseJSONFile,LambdaSizeExceededError,MissingDotenvVarsError,NowError,isAPIError,require_bytes}from"../../chunks/chunk-6VH56CX2.js";import{cmd,getCommandName,getCommandNamePlain,getTitleName}from"../../chunks/chunk-JESNVRVR.js";import{Diagnostic,chars_default,defineDiagnostics,init_dist,link_default,output_manager_default,require_build_utils}from"../../chunks/chunk-XP3FT56R.js";import"../../chunks/chunk-BLUPZPAS.js";import{require_dist}from"../../chunks/chunk-RM3ZDRYE.js";import{pkg_default}from"../../chunks/chunk-OO572JUC.js";import"../../chunks/chunk-D3AHZ5LI.js";import"../../chunks/chunk-2GHZGOWT.js";import"../../chunks/chunk-YHPPP3SF.js";import{require_source}from"../../chunks/chunk-NB2WLB3J.js";import{require_supports_color}from"../../chunks/chunk-ISWW3DKF.js";import"../../chunks/chunk-BRQUZ5NC.js";import{__commonJS,__require,__toESM}from"../../chunks/chunk-BZENIQ7N.js";var require_eventemitter3=__commonJS({"../../node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js"(exports,module){"use strict";var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(prefix=!1));function EE(fn,context,once2){this.fn=fn,this.context=context,this.once=once2||!1}function addListener(emitter,event,fn,context,once2){if(typeof fn!="function")throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once2),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){--emitter._eventsCount===0?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter(){this._events=new Events,this._eventsCount=0}EventEmitter.prototype.eventNames=function(){var names=[],events,name;if(this._eventsCount===0)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names};EventEmitter.prototype.listeners=function(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i<l;i++)ee[i]=handlers[i].fn;return ee};EventEmitter.prototype.listenerCount=function(event){var evt=prefix?prefix+event:event,listeners=this._events[evt];return listeners?listeners.fn?1:listeners.length:0};EventEmitter.prototype.emit=function(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return!1;var listeners=this._events[evt],len=arguments.length,args,i;if(listeners.fn){switch(listeners.once&&this.removeListener(event,listeners.fn,void 0,!0),len){case 1:return listeners.fn.call(listeners.context),!0;case 2:return listeners.fn.call(listeners.context,a1),!0;case 3:return listeners.fn.call(listeners.context,a1,a2),!0;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),!0;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),!0;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),!0}for(i=1,args=new Array(len-1);i<len;i++)args[i-1]=arguments[i];listeners.fn.apply(listeners.context,args)}else{var length=listeners.length,j;for(i=0;i<length;i++)switch(listeners[i].once&&this.removeListener(event,listeners[i].fn,void 0,!0),len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++)args[j-1]=arguments[j];listeners[i].fn.apply(listeners[i].context,args)}}return!0};EventEmitter.prototype.on=function(event,fn,context){return addListener(this,event,fn,context,!1)};EventEmitter.prototype.once=function(event,fn,context){return addListener(this,event,fn,context,!0)};EventEmitter.prototype.removeListener=function(event,fn,context,once2){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn)return clearEvent(this,evt),this;var listeners=this._events[evt];if(listeners.fn)listeners.fn===fn&&(!once2||listeners.once)&&(!context||listeners.context===context)&&clearEvent(this,evt);else{for(var i=0,events=[],length=listeners.length;i<length;i++)(listeners[i].fn!==fn||once2&&!listeners[i].once||context&&listeners[i].context!==context)&&events.push(listeners[i]);events.length?this._events[evt]=events.length===1?events[0]:events:clearEvent(this,evt)}return this};EventEmitter.prototype.removeAllListeners=function(event){var evt;return event?(evt=prefix?prefix+event:event,this._events[evt]&&clearEvent(this,evt)):(this._events=new Events,this._eventsCount=0),this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prefixed=prefix;EventEmitter.EventEmitter=EventEmitter;typeof module<"u"&&(module.exports=EventEmitter)}});var require_requires_port=__commonJS({"../../node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js"(exports,module){"use strict";module.exports=function(port,protocol){if(protocol=protocol.split(":")[0],port=+port,!port)return!1;switch(protocol){case"http":case"ws":return port!==80;case"https":case"wss":return port!==443;case"ftp":return port!==21;case"gopher":return port!==70;case"file":return!1}return port!==0}}});var require_common=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy/common.js"(exports){var common=exports,url4=__require("url"),extend=Object.assign,required=require_requires_port(),upgradeHeader=/(^|,)\s*upgrade\s*($|,)/i,isSSL=/^https|wss/;common.isSSL=isSSL;common.setupOutgoing=function(outgoing,options,req,forward){outgoing.port=options[forward||"target"].port||(isSSL.test(options[forward||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(e){outgoing[e]=options[forward||"target"][e]}),outgoing.method=options.method||req.method,outgoing.headers=extend({},req.headers),options.headers&&extend(outgoing.headers,options.headers),options.auth&&(outgoing.auth=options.auth),options.ca&&(outgoing.ca=options.ca),isSSL.test(options[forward||"target"].protocol)&&(outgoing.rejectUnauthorized=typeof options.secure>"u"?!0:options.secure),outgoing.agent=options.agent||!1,outgoing.localAddress=options.localAddress,outgoing.agent||(outgoing.headers=outgoing.headers||{},(typeof outgoing.headers.connection!="string"||!upgradeHeader.test(outgoing.headers.connection))&&(outgoing.headers.connection="close"));var target=options[forward||"target"],targetPath=target&&options.prependPath!==!1&&target.path||"",outgoingPath=options.toProxy?req.url:url4.parse(req.url).path||"";return outgoingPath=options.ignorePath?"":outgoingPath,outgoing.path=common.urlJoin(targetPath,outgoingPath),options.changeOrigin&&(outgoing.headers.host=required(outgoing.port,options[forward||"target"].protocol)&&!hasPort(outgoing.host)?outgoing.host+":"+outgoing.port:outgoing.host),outgoing};common.setupSocket=function(socket){return socket.setTimeout(0),socket.setNoDelay(!0),socket.setKeepAlive(!0,0),socket};common.getPort=function(req){var res=req.headers.host?req.headers.host.match(/:(\d+)/):"";return res?res[1]:common.hasEncryptedConnection(req)?"443":"80"};common.hasEncryptedConnection=function(req){return!!(req.connection.encrypted||req.connection.pair)};common.urlJoin=function(){var args=Array.prototype.slice.call(arguments),queryParams=[],queryParamRaw="",retSegs;return args.forEach((url5,index)=>{var qpStart=url5.indexOf("?");qpStart!==-1&&(queryParams.push(url5.substring(qpStart+1)),args[index]=url5.substring(0,qpStart))}),queryParamRaw=queryParams.filter(Boolean).join("&"),retSegs=args.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://"),queryParamRaw?retSegs+"?"+queryParamRaw:retSegs};common.rewriteCookieProperty=function rewriteCookieProperty(header,config,property){return Array.isArray(header)?header.map(function(headerElement){return rewriteCookieProperty(headerElement,config,property)}):header.replace(new RegExp("(;\\s*"+property+"=)([^;]+)","i"),function(match,prefix,previousValue){var newValue;if(previousValue in config)newValue=config[previousValue];else if("*"in config)newValue=config["*"];else return match;return newValue?prefix+newValue:""})};function hasPort(host){return!!~host.indexOf(":")}}});var require_web_outgoing=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy/passes/web-outgoing.js"(exports,module){var url4=__require("url"),common=require_common(),redirectRegex=/^201|30(1|2|7|8)$/;module.exports={removeChunked:function(req,res,proxyRes){req.httpVersion==="1.0"&&delete proxyRes.headers["transfer-encoding"]},setConnection:function(req,res,proxyRes){req.httpVersion==="1.0"?proxyRes.headers.connection=req.headers.connection||"close":req.httpVersion!=="2.0"&&!proxyRes.headers.connection&&(proxyRes.headers.connection=req.headers.connection||"keep-alive")},setRedirectHostRewrite:function(req,res,proxyRes,options){if((options.hostRewrite||options.autoRewrite||options.protocolRewrite)&&proxyRes.headers.location&&redirectRegex.test(proxyRes.statusCode)){var target=url4.parse(options.target),u=url4.parse(proxyRes.headers.location);if(target.host!=u.host)return;options.hostRewrite?u.host=options.hostRewrite:options.autoRewrite&&(u.host=req.headers.host),options.protocolRewrite&&(u.protocol=options.protocolRewrite),proxyRes.headers.location=u.format()}},writeHeaders:function(req,res,proxyRes,options){var rewriteCookieDomainConfig=options.cookieDomainRewrite,rewriteCookiePathConfig=options.cookiePathRewrite,preserveHeaderKeyCase=options.preserveHeaderKeyCase,rawHeaderKeyMap,setHeader=function(key2,header){header!=null&&(rewriteCookieDomainConfig&&key2.toLowerCase()==="set-cookie"&&(header=common.rewriteCookieProperty(header,rewriteCookieDomainConfig,"domain")),rewriteCookiePathConfig&&key2.toLowerCase()==="set-cookie"&&(header=common.rewriteCookieProperty(header,rewriteCookiePathConfig,"path")),res.setHeader(String(key2).trim(),header))};if(typeof rewriteCookieDomainConfig=="string"&&(rewriteCookieDomainConfig={"*":rewriteCookieDomainConfig}),typeof rewriteCookiePathConfig=="string"&&(rewriteCookiePathConfig={"*":rewriteCookiePathConfig}),preserveHeaderKeyCase&&proxyRes.rawHeaders!=null){rawHeaderKeyMap={};for(var i=0;i<proxyRes.rawHeaders.length;i+=2){var key=proxyRes.rawHeaders[i];rawHeaderKeyMap[key.toLowerCase()]=key}}Object.keys(proxyRes.headers).forEach(function(key2){var header=proxyRes.headers[key2];preserveHeaderKeyCase&&rawHeaderKeyMap&&(key2=rawHeaderKeyMap[key2]||key2),setHeader(key2,header)})},writeStatusCode:function(req,res,proxyRes){proxyRes.statusMessage?(res.statusCode=proxyRes.statusCode,res.statusMessage=proxyRes.statusMessage):res.statusCode=proxyRes.statusCode}}}});var require_ms2=__commonJS({"../../node_modules/.pnpm/ms@2.0.0/node_modules/ms/index.js"(exports,module){var s=1e3,m=s*60,h=m*60,d=h*24,y=d*365.25;module.exports=function(val,options){options=options||{};var type=typeof val;if(type==="string"&&val.length>0)return parse2(val);if(type==="number"&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse2(str){if(str=String(str),!(str.length>100)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]),type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms9){return ms9>=d?Math.round(ms9/d)+"d":ms9>=h?Math.round(ms9/h)+"h":ms9>=m?Math.round(ms9/m)+"m":ms9>=s?Math.round(ms9/s)+"s":ms9+"ms"}function fmtLong(ms9){return plural3(ms9,d,"day")||plural3(ms9,h,"hour")||plural3(ms9,m,"minute")||plural3(ms9,s,"second")||ms9+" ms"}function plural3(ms9,n,name){if(!(ms9<n))return ms9<n*1.5?Math.floor(ms9/n)+" "+name:Math.ceil(ms9/n)+" "+name+"s"}}});var require_debug=__commonJS({"../../node_modules/.pnpm/debug@3.1.0/node_modules/debug/src/debug.js"(exports,module){exports=module.exports=createDebug.debug=createDebug.default=createDebug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require_ms2();exports.instances=[];exports.names=[];exports.skips=[];exports.formatters={};function selectColor(namespace){var hash=0,i;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){var prevTime;function debug(){if(debug.enabled){var self2=debug,curr=+new Date,ms9=curr-(prevTime||curr);self2.diff=ms9,self2.prev=prevTime,self2.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i<args.length;i++)args[i]=arguments[i];args[0]=exports.coerce(args[0]),typeof args[0]!="string"&&args.unshift("%O");var index=0;args[0]=args[0].replace(/%([a-zA-Z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if(typeof formatter=="function"){var val=args[index];match=formatter.call(self2,val),args.splice(index,1),index--}return match}),exports.formatArgs.call(self2,args);var logFn=debug.log||exports.log||console.log.bind(console);logFn.apply(self2,args)}}return debug.namespace=namespace,debug.enabled=exports.enabled(namespace),debug.useColors=exports.useColors(),debug.color=selectColor(namespace),debug.destroy=destroy,typeof exports.init=="function"&&exports.init(debug),exports.instances.push(debug),debug}function destroy(){var index=exports.instances.indexOf(this);return index!==-1?(exports.instances.splice(index,1),!0):!1}function enable(namespaces){exports.save(namespaces),exports.names=[],exports.skips=[];var i,split=(typeof namespaces=="string"?namespaces:"").split(/[\s,]+/),len=split.length;for(i=0;i<len;i++)split[i]&&(namespaces=split[i].replace(/\*/g,".*?"),namespaces[0]==="-"?exports.skips.push(new RegExp("^"+namespaces.substr(1)+"$")):exports.names.push(new RegExp("^"+namespaces+"$")));for(i=0;i<exports.instances.length;i++){var instance=exports.instances[i];instance.enabled=exports.enabled(instance.namespace)}}function disable(){exports.enable("")}function enabled(name){if(name[name.length-1]==="*")return!0;var i,len;for(i=0,len=exports.skips.length;i<len;i++)if(exports.skips[i].test(name))return!1;for(i=0,len=exports.names.length;i<len;i++)if(exports.names[i].test(name))return!0;return!1}function coerce(val){return val instanceof Error?val.stack||val.message:val}}});var require_browser=__commonJS({"../../node_modules/.pnpm/debug@3.1.0/node_modules/debug/src/browser.js"(exports,module){exports=module.exports=require_debug();exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;exports.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:localstorage();exports.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}};function formatArgs(args){var useColors2=this.useColors;if(args[0]=(useColors2?"%c":"")+this.namespace+(useColors2?" %c":" ")+args[0]+(useColors2?"%c ":" ")+"+"+exports.humanize(this.diff),!!useColors2){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){match!=="%%"&&(index++,match==="%c"&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{namespaces==null?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch{}}function load(){var r;try{r=exports.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}exports.enable(load());function localstorage(){try{return window.localStorage}catch{}}}});var require_node=__commonJS({"../../node_modules/.pnpm/debug@3.1.0/node_modules/debug/src/node.js"(exports,module){var tty=__require("tty"),util=__require("util");exports=module.exports=require_debug();exports.init=init;exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;exports.colors=[6,2,3,4,5,1];try{supportsColor=require_supports_color(),supportsColor&&supportsColor.level>=2&&(exports.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}var supportsColor;exports.inspectOpts=Object.keys(process.env).filter(function(key){return/^debug_/i.test(key)}).reduce(function(obj,key){var prop=key.substring(6).toLowerCase().replace(/_([a-z])/g,function(_,k){return k.toUpperCase()}),val=process.env[key];return/^(yes|on|true|enabled)$/i.test(val)?val=!0:/^(no|off|false|disabled)$/i.test(val)?val=!1:val==="null"?val=null:val=Number(val),obj[prop]=val,obj},{});function useColors(){return"colors"in exports.inspectOpts?!!exports.inspectOpts.colors:tty.isatty(process.stderr.fd)}exports.formatters.o=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts).split(`
8
+ `).map(function(str){return str.trim()}).join(" ")};exports.formatters.O=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts)};function formatArgs(args){var name=this.namespace,useColors2=this.useColors;if(useColors2){var c=this.color,colorCode="\x1B[3"+(c<8?c:"8;5;"+c),prefix=" "+colorCode+";1m"+name+" \x1B[0m";args[0]=prefix+args[0].split(`
9
+ `).join(`
10
+ `+prefix),args.push(colorCode+"m+"+exports.humanize(this.diff)+"\x1B[0m")}else args[0]=getDate()+name+" "+args[0]}function getDate(){return exports.inspectOpts.hideDate?"":new Date().toISOString()+" "}function log(){return process.stderr.write(util.format.apply(util,arguments)+`
11
+ `)}function save(namespaces){namespaces==null?delete process.env.DEBUG:process.env.DEBUG=namespaces}function load(){return process.env.DEBUG}function init(debug){debug.inspectOpts={};for(var keys=Object.keys(exports.inspectOpts),i=0;i<keys.length;i++)debug.inspectOpts[keys[i]]=exports.inspectOpts[keys[i]]}exports.enable(load())}});var require_src=__commonJS({"../../node_modules/.pnpm/debug@3.1.0/node_modules/debug/src/index.js"(exports,module){typeof process>"u"||process.type==="renderer"?module.exports=require_browser():module.exports=require_node()}});var require_debug2=__commonJS({"../../node_modules/.pnpm/follow-redirects@1.16.0_debug@3.1.0/node_modules/follow-redirects/debug.js"(exports,module){var debug;module.exports=function(){if(!debug){try{debug=require_src()("follow-redirects")}catch{}typeof debug!="function"&&(debug=function(){})}debug.apply(null,arguments)}}});var require_follow_redirects=__commonJS({"../../node_modules/.pnpm/follow-redirects@1.16.0_debug@3.1.0/node_modules/follow-redirects/index.js"(exports,module){var url4=__require("url"),URL3=url4.URL,http4=__require("http"),https2=__require("https"),Writable2=__require("stream").Writable,assert2=__require("assert"),debug=require_debug2();(function(){var looksLikeNode=typeof process<"u",looksLikeBrowser=typeof window<"u"&&typeof document<"u",looksLikeV8=isFunction(Error.captureStackTrace);!looksLikeNode&&(looksLikeBrowser||!looksLikeV8)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var useNativeURL=!1;try{assert2(new URL3(""))}catch(error3){useNativeURL=error3.code==="ERR_INVALID_URL"}var sensitiveHeaders=["Authorization","Proxy-Authorization","Cookie"],preservedUrlFields=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],events=["abort","aborted","connect","error","socket","timeout"],eventHandlers=Object.create(null);events.forEach(function(event){eventHandlers[event]=function(arg1,arg2,arg3){this._redirectable.emit(event,arg1,arg2,arg3)}});var InvalidUrlError=createErrorType("ERR_INVALID_URL","Invalid URL",TypeError),RedirectionError=createErrorType("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),TooManyRedirectsError=createErrorType("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",RedirectionError),MaxBodyLengthExceededError=createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),WriteAfterEndError=createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),destroy=Writable2.prototype.destroy||noop;function RedirectableRequest(options,responseCallback){Writable2.call(this),this._sanitizeOptions(options),this._options=options,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],responseCallback&&this.on("response",responseCallback);var self2=this;this._onNativeResponse=function(response){try{self2._processResponse(response)}catch(cause){self2.emit("error",cause instanceof RedirectionError?cause:new RedirectionError({cause}))}},this._headerFilter=new RegExp("^(?:"+sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|")+")$","i"),this._performRequest()}RedirectableRequest.prototype=Object.create(Writable2.prototype);RedirectableRequest.prototype.abort=function(){destroyRequest(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};RedirectableRequest.prototype.destroy=function(error3){return destroyRequest(this._currentRequest,error3),destroy.call(this,error3),this};RedirectableRequest.prototype.write=function(data,encoding,callback){if(this._ending)throw new WriteAfterEndError;if(!isString(data)&&!isBuffer(data))throw new TypeError("data should be a string, Buffer or Uint8Array");if(isFunction(encoding)&&(callback=encoding,encoding=null),data.length===0){callback&&callback();return}this._requestBodyLength+data.length<=this._options.maxBodyLength?(this._requestBodyLength+=data.length,this._requestBodyBuffers.push({data,encoding}),this._currentRequest.write(data,encoding,callback)):(this.emit("error",new MaxBodyLengthExceededError),this.abort())};RedirectableRequest.prototype.end=function(data,encoding,callback){if(isFunction(data)?(callback=data,data=encoding=null):isFunction(encoding)&&(callback=encoding,encoding=null),!data)this._ended=this._ending=!0,this._currentRequest.end(null,null,callback);else{var self2=this,currentRequest=this._currentRequest;this.write(data,encoding,function(){self2._ended=!0,currentRequest.end(null,null,callback)}),this._ending=!0}};RedirectableRequest.prototype.setHeader=function(name,value){this._options.headers[name]=value,this._currentRequest.setHeader(name,value)};RedirectableRequest.prototype.removeHeader=function(name){delete this._options.headers[name],this._currentRequest.removeHeader(name)};RedirectableRequest.prototype.setTimeout=function(msecs,callback){var self2=this;function destroyOnTimeout(socket){socket.setTimeout(msecs),socket.removeListener("timeout",socket.destroy),socket.addListener("timeout",socket.destroy)}function startTimer(socket){self2._timeout&&clearTimeout(self2._timeout),self2._timeout=setTimeout(function(){self2.emit("timeout"),clearTimer()},msecs),destroyOnTimeout(socket)}function clearTimer(){self2._timeout&&(clearTimeout(self2._timeout),self2._timeout=null),self2.removeListener("abort",clearTimer),self2.removeListener("error",clearTimer),self2.removeListener("response",clearTimer),self2.removeListener("close",clearTimer),callback&&self2.removeListener("timeout",callback),self2.socket||self2._currentRequest.removeListener("socket",startTimer)}return callback&&this.on("timeout",callback),this.socket?startTimer(this.socket):this._currentRequest.once("socket",startTimer),this.on("socket",destroyOnTimeout),this.on("abort",clearTimer),this.on("error",clearTimer),this.on("response",clearTimer),this.on("close",clearTimer),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(method){RedirectableRequest.prototype[method]=function(a,b){return this._currentRequest[method](a,b)}});["aborted","connection","socket"].forEach(function(property){Object.defineProperty(RedirectableRequest.prototype,property,{get:function(){return this._currentRequest[property]}})});RedirectableRequest.prototype._sanitizeOptions=function(options){if(options.headers||(options.headers={}),isArray(options.sensitiveHeaders)||(options.sensitiveHeaders=[]),options.host&&(options.hostname||(options.hostname=options.host),delete options.host),!options.pathname&&options.path){var searchPos=options.path.indexOf("?");searchPos<0?options.pathname=options.path:(options.pathname=options.path.substring(0,searchPos),options.search=options.path.substring(searchPos))}};RedirectableRequest.prototype._performRequest=function(){var protocol=this._options.protocol,nativeProtocol=this._options.nativeProtocols[protocol];if(!nativeProtocol)throw new TypeError("Unsupported protocol "+protocol);if(this._options.agents){var scheme=protocol.slice(0,-1);this._options.agent=this._options.agents[scheme]}var request3=this._currentRequest=nativeProtocol.request(this._options,this._onNativeResponse);request3._redirectable=this;for(var event of events)request3.on(event,eventHandlers[event]);if(this._currentUrl=/^\//.test(this._options.path)?url4.format(this._options):this._options.path,this._isRedirect){var i=0,self2=this,buffers=this._requestBodyBuffers;(function writeNext(error3){if(request3===self2._currentRequest)if(error3)self2.emit("error",error3);else if(i<buffers.length){var buffer=buffers[i++];request3.finished||request3.write(buffer.data,buffer.encoding,writeNext)}else self2._ended&&request3.end()})()}};RedirectableRequest.prototype._processResponse=function(response){var statusCode=response.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:response.headers,statusCode});var location=response.headers.location;if(!location||this._options.followRedirects===!1||statusCode<300||statusCode>=400){response.responseUrl=this._currentUrl,response.redirects=this._redirects,this.emit("response",response),this._requestBodyBuffers=[];return}if(destroyRequest(this._currentRequest),response.destroy(),++this._redirectCount>this._options.maxRedirects)throw new TooManyRedirectsError;var requestHeaders,beforeRedirect=this._options.beforeRedirect;beforeRedirect&&(requestHeaders=Object.assign({Host:response.req.getHeader("host")},this._options.headers));var method=this._options.method;((statusCode===301||statusCode===302)&&this._options.method==="POST"||statusCode===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],removeMatchingHeaders(/^content-/i,this._options.headers));var currentHostHeader=removeMatchingHeaders(/^host$/i,this._options.headers),currentUrlParts=parseUrl2(this._currentUrl),currentHost=currentHostHeader||currentUrlParts.host,currentUrl=/^\w+:/.test(location)?this._currentUrl:url4.format(Object.assign(currentUrlParts,{host:currentHost})),redirectUrl=resolveUrl(location,currentUrl);if(debug("redirecting to",redirectUrl.href),this._isRedirect=!0,spreadUrlObject(redirectUrl,this._options),(redirectUrl.protocol!==currentUrlParts.protocol&&redirectUrl.protocol!=="https:"||redirectUrl.host!==currentHost&&!isSubdomain(redirectUrl.host,currentHost))&&removeMatchingHeaders(this._headerFilter,this._options.headers),isFunction(beforeRedirect)){var responseDetails={headers:response.headers,statusCode},requestDetails={url:currentUrl,method,headers:requestHeaders};beforeRedirect(this._options,responseDetails,requestDetails),this._sanitizeOptions(this._options)}this._performRequest()};function wrap(protocols){var exports2={maxRedirects:21,maxBodyLength:10485760},nativeProtocols={};return Object.keys(protocols).forEach(function(scheme){var protocol=scheme+":",nativeProtocol=nativeProtocols[protocol]=protocols[scheme],wrappedProtocol=exports2[scheme]=Object.create(nativeProtocol);function request3(input,options,callback){return isURL2(input)?input=spreadUrlObject(input):isString(input)?input=spreadUrlObject(parseUrl2(input)):(callback=options,options=validateUrl(input),input={protocol}),isFunction(options)&&(callback=options,options=null),options=Object.assign({maxRedirects:exports2.maxRedirects,maxBodyLength:exports2.maxBodyLength},input,options),options.nativeProtocols=nativeProtocols,!isString(options.host)&&!isString(options.hostname)&&(options.hostname="::1"),assert2.equal(options.protocol,protocol,"protocol mismatch"),debug("options",options),new RedirectableRequest(options,callback)}function get(input,options,callback){var wrappedRequest=wrappedProtocol.request(input,options,callback);return wrappedRequest.end(),wrappedRequest}Object.defineProperties(wrappedProtocol,{request:{value:request3,configurable:!0,enumerable:!0,writable:!0},get:{value:get,configurable:!0,enumerable:!0,writable:!0}})}),exports2}function noop(){}function parseUrl2(input){var parsed;if(useNativeURL)parsed=new URL3(input);else if(parsed=validateUrl(url4.parse(input)),!isString(parsed.protocol))throw new InvalidUrlError({input});return parsed}function resolveUrl(relative3,base){return useNativeURL?new URL3(relative3,base):parseUrl2(url4.resolve(base,relative3))}function validateUrl(input){if(/^\[/.test(input.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(input.hostname))throw new InvalidUrlError({input:input.href||input});if(/^\[/.test(input.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host))throw new InvalidUrlError({input:input.href||input});return input}function spreadUrlObject(urlObject,target){var spread=target||{};for(var key of preservedUrlFields)spread[key]=urlObject[key];return spread.hostname.startsWith("[")&&(spread.hostname=spread.hostname.slice(1,-1)),spread.port!==""&&(spread.port=Number(spread.port)),spread.path=spread.search?spread.pathname+spread.search:spread.pathname,spread}function removeMatchingHeaders(regex,headers){var lastValue;for(var header in headers)regex.test(header)&&(lastValue=headers[header],delete headers[header]);return lastValue===null||typeof lastValue>"u"?void 0:String(lastValue).trim()}function createErrorType(code,message,baseClass){function CustomError(properties){isFunction(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,properties||{}),this.code=code,this.message=this.cause?message+": "+this.cause.message:message}return CustomError.prototype=new(baseClass||Error),Object.defineProperties(CustomError.prototype,{constructor:{value:CustomError,enumerable:!1},name:{value:"Error ["+code+"]",enumerable:!1}}),CustomError}function destroyRequest(request3,error3){for(var event of events)request3.removeListener(event,eventHandlers[event]);request3.on("error",noop),request3.destroy(error3)}function isSubdomain(subdomain,domain){assert2(isString(subdomain)&&isString(domain));var dot=subdomain.length-domain.length-1;return dot>0&&subdomain[dot]==="."&&subdomain.endsWith(domain)}function isArray(value){return value instanceof Array}function isString(value){return typeof value=="string"||value instanceof String}function isFunction(value){return typeof value=="function"}function isBuffer(value){return typeof value=="object"&&"length"in value}function isURL2(value){return URL3&&value instanceof URL3}function escapeRegex(regex){return regex.replace(/[\]\\/()*+?.$]/g,"\\$&")}module.exports=wrap({http:http4,https:https2});module.exports.wrap=wrap}});var require_web_incoming=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy/passes/web-incoming.js"(exports,module){var httpNative=__require("http"),httpsNative=__require("https"),web_o=require_web_outgoing(),common=require_common(),followRedirects=require_follow_redirects();web_o=Object.keys(web_o).map(function(pass){return web_o[pass]});var nativeAgents={http:httpNative,https:httpsNative};var supportsAbortedEvent=function(){var ver=process.versions.node.split(".").map(Number);return ver[0]<=14||ver[0]===15&&ver[1]<=4}();module.exports={deleteLength:function(req,res,options){(req.method==="DELETE"||req.method==="OPTIONS")&&!req.headers["content-length"]&&(req.headers["content-length"]="0",delete req.headers["transfer-encoding"])},timeout:function(req,res,options){options.timeout&&req.socket.setTimeout(options.timeout)},XHeaders:function(req,res,options){if(options.xfwd){var encrypted=req.isSpdy||common.hasEncryptedConnection(req),values={for:req.connection.remoteAddress||req.socket.remoteAddress,port:common.getPort(req),proto:encrypted?"https":"http"};["for","port","proto"].forEach(function(header){req.headers["x-forwarded-"+header]=(req.headers["x-forwarded-"+header]||"")+(req.headers["x-forwarded-"+header]?",":"")+values[header]}),req.headers["x-forwarded-host"]=req.headers["x-forwarded-host"]||req.headers.host||""}},stream:function(req,res,options,_,server,clb){server.emit("start",req,res,options.target||options.forward);var agents=options.followRedirects?followRedirects:nativeAgents,http4=agents.http,https2=agents.https;if(options.forward){var forwardReq=(options.forward.protocol==="https:"?https2:http4).request(common.setupOutgoing(options.ssl||{},options,req,"forward")),forwardError=createErrorHandler(forwardReq,options.forward);if(req.on("error",forwardError),forwardReq.on("error",forwardError),(options.buffer||req).pipe(forwardReq),!options.target)return res.end()}var proxyReq=(options.target.protocol==="https:"?https2:http4).request(common.setupOutgoing(options.ssl||{},options,req));proxyReq.on("socket",function(socket){server&&!proxyReq.getHeader("expect")&&server.emit("proxyReq",proxyReq,req,res,options)}),options.proxyTimeout&&proxyReq.setTimeout(options.proxyTimeout,function(){proxyReq.abort()}),supportsAbortedEvent?req.on("aborted",function(){proxyReq.abort()}):res.on("close",function(){var aborted=!res.writableFinished;aborted&&proxyReq.abort()});var proxyError=createErrorHandler(proxyReq,options.target);req.on("error",proxyError),proxyReq.on("error",proxyError);function createErrorHandler(proxyReq2,url4){return function(err){if(req.socket.destroyed&&err.code==="ECONNRESET")return server.emit("econnreset",err,req,res,url4),proxyReq2.abort();clb?clb(err,req,res,url4):server.emit("error",err,req,res,url4)}}(options.buffer||req).pipe(proxyReq),proxyReq.on("response",function(proxyRes){if(server&&server.emit("proxyRes",proxyRes,req,res),!res.headersSent&&!options.selfHandleResponse)for(var i=0;i<web_o.length&&!web_o[i](req,res,proxyRes,options);i++);res.finished?server&&server.emit("end",req,res,proxyRes):(proxyRes.on("end",function(){server&&server.emit("end",req,res,proxyRes)}),options.selfHandleResponse||proxyRes.pipe(res))})}}}});var require_ws_incoming=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy/passes/ws-incoming.js"(exports,module){var http4=__require("http"),https2=__require("https"),common=require_common();module.exports={checkMethodAndHeader:function(req,socket){if(req.method!=="GET"||!req.headers.upgrade||req.headers.upgrade.toLowerCase()!=="websocket")return socket.destroy(),!0},XHeaders:function(req,socket,options){if(options.xfwd){var values={for:req.connection.remoteAddress||req.socket.remoteAddress,port:common.getPort(req),proto:common.hasEncryptedConnection(req)?"wss":"ws"};["for","port","proto"].forEach(function(header){req.headers["x-forwarded-"+header]=(req.headers["x-forwarded-"+header]||"")+(req.headers["x-forwarded-"+header]?",":"")+values[header]})}},stream:function(req,socket,options,head,server,clb){var createHttpHeader=function(line,headers){return Object.keys(headers).reduce(function(head2,key){var value=headers[key];if(!Array.isArray(value))return head2.push(key+": "+value),head2;for(var i=0;i<value.length;i++)head2.push(key+": "+value[i]);return head2},[line]).join(`\r
12
+ `)+`\r
13
+ \r
14
+ `};common.setupSocket(socket),head&&head.length&&socket.unshift(head);var proxyReq=(common.isSSL.test(options.target.protocol)?https2:http4).request(common.setupOutgoing(options.ssl||{},options,req));return server&&server.emit("proxyReqWs",proxyReq,req,socket,options,head),proxyReq.on("error",onOutgoingError),proxyReq.on("response",function(res){res.upgrade||(socket.write(createHttpHeader("HTTP/"+res.httpVersion+" "+res.statusCode+" "+res.statusMessage,res.headers)),res.pipe(socket))}),proxyReq.on("upgrade",function(proxyRes,proxySocket,proxyHead){proxySocket.on("error",onOutgoingError),proxySocket.on("end",function(){server.emit("close",proxyRes,proxySocket,proxyHead)}),socket.on("error",function(){proxySocket.destroy()}),common.setupSocket(proxySocket),proxyHead&&proxyHead.length&&proxySocket.unshift(proxyHead),socket.write(createHttpHeader("HTTP/1.1 101 Switching Protocols",proxyRes.headers)),proxySocket.pipe(socket).pipe(proxySocket),server.emit("open",proxySocket),server.emit("proxySocket",proxySocket)}),proxyReq.end();function onOutgoingError(err){clb?clb(err,req,socket):server.emit("error",err,req,socket),socket.end()}}}}});var require_http_proxy=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy/index.js"(exports,module){var httpProxy2=module.exports,extend=Object.assign,parse_url=__require("url").parse,EE3=require_eventemitter3(),http4=__require("http"),https2=__require("https"),web=require_web_incoming(),ws=require_ws_incoming();httpProxy2.Server=ProxyServer;function createRightProxy(type){return function(options){return function(req,res){var passes=type==="ws"?this.wsPasses:this.webPasses,args=[].slice.call(arguments),cntr=args.length-1,head,cbl;typeof args[cntr]=="function"&&(cbl=args[cntr],cntr--);var requestOptions=options;if(!(args[cntr]instanceof Buffer)&&args[cntr]!==res&&(requestOptions=extend({},options),extend(requestOptions,args[cntr]),cntr--),args[cntr]instanceof Buffer&&(head=args[cntr]),["target","forward"].forEach(function(e){typeof requestOptions[e]=="string"&&(requestOptions[e]=parse_url(requestOptions[e]))}),!requestOptions.target&&!requestOptions.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var i=0;i<passes.length&&!passes[i](req,res,requestOptions,head,this,cbl);i++);}}}httpProxy2.createRightProxy=createRightProxy;function ProxyServer(options){EE3.call(this),options=options||{},options.prependPath=options.prependPath!==!1,this.web=this.proxyRequest=createRightProxy("web")(options),this.ws=this.proxyWebsocketRequest=createRightProxy("ws")(options),this.options=options,this.webPasses=Object.keys(web).map(function(pass){return web[pass]}),this.wsPasses=Object.keys(ws).map(function(pass){return ws[pass]}),this.on("error",this.onError,this)}__require("util").inherits(ProxyServer,EE3);ProxyServer.prototype.onError=function(err){if(this.listeners("error").length===1)throw err};ProxyServer.prototype.listen=function(port,hostname){var self2=this,closure=function(req,res){self2.web(req,res)};return this._server=this.options.ssl?https2.createServer(this.options.ssl,closure):http4.createServer(closure),this.options.ws&&this._server.on("upgrade",function(req,socket,head){self2.ws(req,socket,head)}),this._server.listen(port,hostname),this};ProxyServer.prototype.close=function(callback){var self2=this;this._server&&this._server.close(done);function done(){self2._server=null,callback&&callback.apply(null,arguments)}};ProxyServer.prototype.before=function(type,passName,callback){if(type!=="ws"&&type!=="web")throw new Error("type must be `web` or `ws`");var passes=type==="ws"?this.wsPasses:this.webPasses,i=!1;if(passes.forEach(function(v,idx){v.name===passName&&(i=idx)}),i===!1)throw new Error("No such pass");passes.splice(i,0,callback)};ProxyServer.prototype.after=function(type,passName,callback){if(type!=="ws"&&type!=="web")throw new Error("type must be `web` or `ws`");var passes=type==="ws"?this.wsPasses:this.webPasses,i=!1;if(passes.forEach(function(v,idx){v.name===passName&&(i=idx)}),i===!1)throw new Error("No such pass");passes.splice(i++,0,callback)}}});var require_http_proxy2=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy.js"(exports,module){var ProxyServer=require_http_proxy().Server;function createProxyServer(options){return new ProxyServer(options)}ProxyServer.createProxyServer=createProxyServer;ProxyServer.createServer=createProxyServer;ProxyServer.createProxy=createProxyServer;module.exports=ProxyServer}});var require_http_proxy_node16=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/index.js"(exports,module){module.exports=require_http_proxy2()}});var require_urlparser=__commonJS({"../../node_modules/.pnpm/fast-url-parser@1.1.3/node_modules/fast-url-parser/src/urlparser.js"(exports,module){"use strict";function Url(){this._protocol=null,this._href="",this._port=-1,this._query=null,this.auth=null,this.slashes=null,this.host=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null,this._prependSlash=!1}var querystring=__require("querystring");Url.queryString=querystring;Url.prototype.parse=function(str,parseQueryString2,hostDenotesSlash,disableAutoEscapeChars){if(typeof str!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof str);for(var start=0,end=str.length-1;str.charCodeAt(start)<=32;)start++;for(;str.charCodeAt(end)<=32;)end--;if(start=this._parseProtocol(str,start,end),this._protocol!=="javascript"){start=this._parseHost(str,start,end,hostDenotesSlash);var proto=this._protocol;!this.hostname&&(this.slashes||proto&&!slashProtocols[proto])&&(this.hostname=this.host="")}if(start<=end){var ch=str.charCodeAt(start);ch===47||ch===92?this._parsePath(str,start,end,disableAutoEscapeChars):ch===63?this._parseQuery(str,start,end,disableAutoEscapeChars):ch===35?this._parseHash(str,start,end,disableAutoEscapeChars):this._protocol!=="javascript"?this._parsePath(str,start,end,disableAutoEscapeChars):this.pathname=str.slice(start,end+1)}if(!this.pathname&&this.hostname&&this._slashProtocols[this._protocol]&&(this.pathname="/"),parseQueryString2){var search=this.search;search==null&&(search=this.search=""),search.charCodeAt(0)===63&&(search=search.slice(1)),this.query=Url.queryString.parse(search)}};Url.prototype.resolve=function(relative3){return this.resolveObject(Url.parse(relative3,!1,!0)).format()};Url.prototype.format=function(){var auth=this.auth||"";auth&&(auth=encodeURIComponent(auth),auth=auth.replace(/%3A/i,":"),auth+="@");var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",search=this.search||"",query="",hostname=this.hostname||"",port=this.port||"",host=!1,scheme="",q=this.query;if(q&&typeof q=="object"&&(query=Url.queryString.stringify(q)),search||(search=query?"?"+query:""),protocol&&protocol.charCodeAt(protocol.length-1)!==58&&(protocol+=":"),this.host)host=auth+this.host;else if(hostname){var ip6=hostname.indexOf(":")>-1;ip6&&(hostname="["+hostname+"]"),host=auth+hostname+(port?":"+port:"")}var slashes=this.slashes||(!protocol||slashProtocols[protocol])&&host!==!1;return protocol?scheme=protocol+(slashes?"//":""):slashes&&(scheme="//"),slashes&&pathname&&pathname.charCodeAt(0)!==47&&(pathname="/"+pathname),search&&search.charCodeAt(0)!==63&&(search="?"+search),hash&&hash.charCodeAt(0)!==35&&(hash="#"+hash),pathname=escapePathName(pathname),search=escapeSearch(search),scheme+(host===!1?"":host)+pathname+search+hash};Url.prototype.resolveObject=function(relative3){typeof relative3=="string"&&(relative3=Url.parse(relative3,!1,!0));var result=this._clone();if(result.hash=relative3.hash,!relative3.href)return result._href="",result;if(relative3.slashes&&!relative3._protocol)return relative3._copyPropsTo(result,!0),slashProtocols[result._protocol]&&result.hostname&&!result.pathname&&(result.pathname="/"),result._href="",result;if(relative3._protocol&&relative3._protocol!==result._protocol){if(!slashProtocols[relative3._protocol])return relative3._copyPropsTo(result,!1),result._href="",result;if(result._protocol=relative3._protocol,!relative3.host&&relative3._protocol!=="javascript"){for(var relPath=(relative3.pathname||"").split("/");relPath.length&&!(relative3.host=relPath.shift()););relative3.host||(relative3.host=""),relative3.hostname||(relative3.hostname=""),relPath[0]!==""&&relPath.unshift(""),relPath.length<2&&relPath.unshift(""),result.pathname=relPath.join("/")}else result.pathname=relative3.pathname;return result.search=relative3.search,result.host=relative3.host||"",result.auth=relative3.auth,result.hostname=relative3.hostname||relative3.host,result._port=relative3._port,result.slashes=result.slashes||relative3.slashes,result._href="",result}var isSourceAbs=result.pathname&&result.pathname.charCodeAt(0)===47,isRelAbs=relative3.host||relative3.pathname&&relative3.pathname.charCodeAt(0)===47,mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative3.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split("/")||[],relPath=relative3.pathname&&relative3.pathname.split("/")||[],psychotic=result._protocol&&!slashProtocols[result._protocol];if(psychotic&&(result.hostname="",result._port=-1,result.host&&(srcPath[0]===""?srcPath[0]=result.host:srcPath.unshift(result.host)),result.host="",relative3._protocol&&(relative3.hostname="",relative3._port=-1,relative3.host&&(relPath[0]===""?relPath[0]=relative3.host:relPath.unshift(relative3.host)),relative3.host=""),mustEndAbs=mustEndAbs&&(relPath[0]===""||srcPath[0]==="")),isRelAbs)result.host=relative3.host?relative3.host:result.host,result.hostname=relative3.hostname?relative3.hostname:result.hostname,result.search=relative3.search,srcPath=relPath;else if(relPath.length)srcPath||(srcPath=[]),srcPath.pop(),srcPath=srcPath.concat(relPath),result.search=relative3.search;else if(relative3.search){if(psychotic){result.hostname=result.host=srcPath.shift();var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative3.search,result._href="",result}if(!srcPath.length)return result.pathname=null,result._href="",result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative3.host)&&(last==="."||last==="..")||last==="",up=0,i2=srcPath.length;i2>=0;i2--)last=srcPath[i2],last==="."?srcPath.splice(i2,1):last===".."?(srcPath.splice(i2,1),up++):up&&(srcPath.splice(i2,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charCodeAt(0)!==47)&&srcPath.unshift(""),hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"&&srcPath.push("");var isAbsolute4=srcPath[0]===""||srcPath[0]&&srcPath[0].charCodeAt(0)===47;if(psychotic){result.hostname=result.host=isAbsolute4?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute4&&srcPath.unshift(""),result.pathname=srcPath.length===0?null:srcPath.join("/"),result.auth=relative3.auth||result.auth,result.slashes=result.slashes||relative3.slashes,result._href="",result};var punycode=__require("punycode");Url.prototype._hostIdna=function(hostname){return punycode.toASCII(hostname)};var escapePathName=Url.prototype._escapePathName=function(pathname){return containsCharacter2(pathname,35,63)?_escapePath(pathname):pathname},escapeSearch=Url.prototype._escapeSearch=function(search){return containsCharacter2(search,35,-1)?_escapeSearch(search):search};Url.prototype._parseProtocol=function(str,start,end){for(var doLowerCase=!1,protocolCharacters=this._protocolCharacters,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===58){var protocol=str.slice(start,i2);return doLowerCase&&(protocol=protocol.toLowerCase()),this._protocol=protocol,i2+1}else if(protocolCharacters[ch]===1)ch<97&&(doLowerCase=!0);else return start}return start};Url.prototype._parseAuth=function(str,start,end,decode){var auth=str.slice(start,end+1);decode&&(auth=decodeURIComponent(auth)),this.auth=auth};Url.prototype._parsePort=function(str,start,end){for(var port=0,hadChars=!1,validPort=!0,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(48<=ch&&ch<=57)port=10*port+(ch-48),hadChars=!0;else{validPort=!1,(ch===92||ch===47)&&(validPort=!0);break}}return port===0&&!hadChars||!validPort?(validPort||(this._port=-2),0):(this._port=port,i2-start)};Url.prototype._parseHost=function(str,start,end,slashesDenoteHost){var hostEndingCharacters=this._hostEndingCharacters,first=str.charCodeAt(start),second=str.charCodeAt(start+1);if((first===47||first===92)&&(second===47||second===92)){if(this.slashes=!0,start===0){if(end<2)return start;var hasAuth=containsCharacter(str,64,2,hostEndingCharacters);if(!hasAuth&&!slashesDenoteHost)return this.slashes=null,start}start+=2}else if(!this._protocol||slashProtocols[this._protocol])return start;for(var doLowerCase=!1,idna=!1,hostNameStart=start,hostNameEnd=end,lastCh=-1,portLength=0,charsAfterDot=0,authNeedsDecoding=!1,j=-1,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===64)j=i2;else if(ch===37)authNeedsDecoding=!0;else if(hostEndingCharacters[ch]===1)break}if(j>-1&&(this._parseAuth(str,start,j-1,authNeedsDecoding),start=hostNameStart=j+1),str.charCodeAt(start)===91){for(var i2=start+1;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===93){str.charCodeAt(i2+1)===58&&(portLength=this._parsePort(str,i2+2,end)+1);var hostname=str.slice(start+1,i2).toLowerCase();return this.hostname=hostname,this.host=this._port>0?"["+hostname+"]:"+this._port:"["+hostname+"]",this.pathname="/",i2+portLength+1}}return start}for(var i2=start;i2<=end;++i2){if(charsAfterDot>62)return this.hostname=this.host=str.slice(start,i2),i2;var ch=str.charCodeAt(i2);if(ch===58){portLength=this._parsePort(str,i2+1,end)+1,hostNameEnd=i2-1;break}else if(ch<97){if(ch===46)charsAfterDot=-1;else if(65<=ch&&ch<=90)doLowerCase=!0;else if(!(ch===45||ch===95||ch===43||48<=ch&&ch<=57)){hostEndingCharacters[ch]===0&&this._noPrependSlashHostEnders[ch]===0&&(this._prependSlash=!0),hostNameEnd=i2-1;break}}else if(ch>=123){if(ch<=126){this._noPrependSlashHostEnders[ch]===0&&(this._prependSlash=!0),hostNameEnd=i2-1;break}idna=!0}lastCh=ch,charsAfterDot++}if(hostNameEnd+1!==start&&hostNameEnd-hostNameStart<=256){var hostname=str.slice(hostNameStart,hostNameEnd+1);doLowerCase&&(hostname=hostname.toLowerCase()),idna&&(hostname=this._hostIdna(hostname)),this.hostname=hostname,this.host=this._port>0?hostname+":"+this._port:hostname}return hostNameEnd+1+portLength};Url.prototype._copyPropsTo=function(input,noProtocol){noProtocol||(input._protocol=this._protocol),input._href=this._href,input._port=this._port,input._prependSlash=this._prependSlash,input.auth=this.auth,input.slashes=this.slashes,input.host=this.host,input.hostname=this.hostname,input.hash=this.hash,input.search=this.search,input.pathname=this.pathname};Url.prototype._clone=function(){var ret=new Url;return ret._protocol=this._protocol,ret._href=this._href,ret._port=this._port,ret._prependSlash=this._prependSlash,ret.auth=this.auth,ret.slashes=this.slashes,ret.host=this.host,ret.hostname=this.hostname,ret.hash=this.hash,ret.search=this.search,ret.pathname=this.pathname,ret};Url.prototype._getComponentEscaped=function(str,start,end,isAfterQuery){for(var cur=start,i2=start,ret="",autoEscapeMap2=isAfterQuery?this._afterQueryAutoEscapeMap:this._autoEscapeMap;i2<=end;++i2){var ch=str.charCodeAt(i2),escaped=autoEscapeMap2[ch];escaped!==""&&escaped!==void 0&&(cur<i2&&(ret+=str.slice(cur,i2)),ret+=escaped,cur=i2+1)}return cur<i2+1&&(ret+=str.slice(cur,i2)),ret};Url.prototype._parsePath=function(str,start,end,disableAutoEscapeChars){for(var pathStart=start,pathEnd=end,escape2=!1,autoEscapeCharacters=this._autoEscapeCharacters,prePath=this._port===-2?"/:":"",i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===35){this._parseHash(str,i2,end,disableAutoEscapeChars),pathEnd=i2-1;break}else if(ch===63){this._parseQuery(str,i2,end,disableAutoEscapeChars),pathEnd=i2-1;break}else!disableAutoEscapeChars&&!escape2&&autoEscapeCharacters[ch]===1&&(escape2=!0)}if(pathStart>pathEnd){this.pathname=prePath===""?"/":prePath;return}var path6;escape2?path6=this._getComponentEscaped(str,pathStart,pathEnd,!1):path6=str.slice(pathStart,pathEnd+1),this.pathname=prePath===""?this._prependSlash?"/"+path6:path6:prePath+path6};Url.prototype._parseQuery=function(str,start,end,disableAutoEscapeChars){for(var queryStart=start,queryEnd=end,escape2=!1,autoEscapeCharacters=this._autoEscapeCharacters,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===35){this._parseHash(str,i2,end,disableAutoEscapeChars),queryEnd=i2-1;break}else!disableAutoEscapeChars&&!escape2&&autoEscapeCharacters[ch]===1&&(escape2=!0)}if(queryStart>queryEnd){this.search="";return}var query;escape2?query=this._getComponentEscaped(str,queryStart,queryEnd,!0):query=str.slice(queryStart,queryEnd+1),this.search=query};Url.prototype._parseHash=function(str,start,end,disableAutoEscapeChars){if(start>end){this.hash="";return}this.hash=disableAutoEscapeChars?str.slice(start,end+1):this._getComponentEscaped(str,start,end,!0)};Object.defineProperty(Url.prototype,"port",{get:function(){return this._port>=0?""+this._port:null},set:function(v){v==null?this._port=-1:this._port=parseInt(v,10)}});Object.defineProperty(Url.prototype,"query",{get:function(){var query=this._query;if(query!=null)return query;var search=this.search;return search&&(search.charCodeAt(0)===63&&(search=search.slice(1)),search!=="")&&(this._query=search),search},set:function(v){this._query=v}});Object.defineProperty(Url.prototype,"path",{get:function(){var p=this.pathname||"",s=this.search||"";return p||s?p+s:p==null&&s?"/"+s:null},set:function(){}});Object.defineProperty(Url.prototype,"protocol",{get:function(){var proto=this._protocol;return proto&&proto+":"},set:function(v){if(typeof v=="string"){var end=v.length-1;v.charCodeAt(end)===58?this._protocol=v.slice(0,end):this._protocol=v}else v==null&&(this._protocol=null)}});Object.defineProperty(Url.prototype,"href",{get:function(){var href=this._href;return href||(href=this._href=this.format()),href},set:function(v){this._href=v}});Url.parse=function(str,parseQueryString2,hostDenotesSlash,disableAutoEscapeChars){if(str instanceof Url)return str;var ret=new Url;return ret.parse(str,!!parseQueryString2,!!hostDenotesSlash,!!disableAutoEscapeChars),ret};Url.format=function(obj){return typeof obj=="string"&&(obj=Url.parse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)};Url.resolve=function(source,relative3){return Url.parse(source,!1,!0).resolve(relative3)};Url.resolveObject=function(source,relative3){return source?Url.parse(source,!1,!0).resolveObject(relative3):relative3};function _escapePath(pathname){return pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match)})}function _escapeSearch(search){return search.replace(/#/g,function(match){return encodeURIComponent(match)})}function containsCharacter(string,char1,fromIndex,stopCharacterTable){for(var len2=string.length,i2=fromIndex;i2<len2;++i2){var ch=string.charCodeAt(i2);if(ch===char1)return!0;if(stopCharacterTable[ch]===1)return!1}return!1}function containsCharacter2(string,char1,char2){for(var i2=0,len2=string.length;i2<len2;++i2){var ch=string.charCodeAt(i2);if(ch===char1||ch===char2)return!0}return!1}function makeAsciiTable(spec){var ret=new Uint8Array(128);return spec.forEach(function(item){if(typeof item=="number")ret[item]=1;else for(var start=item[0],end=item[1],j=start;j<=end;++j)ret[j]=1}),ret}var autoEscape=["<",">",'"',"`"," ","\r",`
15
+ `," ","{","}","|","\\","^","`","'"],autoEscapeMap=new Array(128);for(i=0,len=autoEscapeMap.length;i<len;++i)autoEscapeMap[i]="";var i,len;for(i=0,len=autoEscape.length;i<len;++i)c=autoEscape[i],esc=encodeURIComponent(c),esc===c&&(esc=escape(c)),autoEscapeMap[c.charCodeAt(0)]=esc;var c,esc,i,len,afterQueryAutoEscapeMap=autoEscapeMap.slice();autoEscapeMap[92]="/";var slashProtocols=Url.prototype._slashProtocols={http:!0,https:!0,gopher:!0,file:!0,ftp:!0,"http:":!0,"https:":!0,"gopher:":!0,"file:":!0,"ftp:":!0};function f(){}f.prototype=slashProtocols;Url.prototype._protocolCharacters=makeAsciiTable([[97,122],[65,90],46,43,45]);Url.prototype._hostEndingCharacters=makeAsciiTable([35,63,47,92]);Url.prototype._autoEscapeCharacters=makeAsciiTable(autoEscape.map(function(v){return v.charCodeAt(0)}));Url.prototype._noPrependSlashHostEnders=makeAsciiTable(["<",">","'","`"," ","\r",`
16
+ `," ","{","}","|","^","`",'"',"%",";"].map(function(v){return v.charCodeAt(0)}));Url.prototype._autoEscapeMap=autoEscapeMap;Url.prototype._afterQueryAutoEscapeMap=afterQueryAutoEscapeMap;module.exports=Url;Url.replace=function(){__require.cache.url={exports:Url}}}});var require_glob_slash=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/glob-slash.js"(exports,module){var path6=__require("path"),normalize3=value=>path6.posix.normalize(path6.posix.join("/",value));module.exports=value=>value.charAt(0)==="!"?`!${normalize3(value.substr(1))}`:normalize3(value);module.exports.normalize=normalize3}});var require_minimatch2=__commonJS({"../../node_modules/.pnpm/minimatch@3.0.4/node_modules/minimatch/minimatch.js"(exports,module){module.exports=minimatch4;minimatch4.Minimatch=Minimatch;var path6={sep:"/"};try{path6=__require("path")}catch{}var GLOBSTAR=minimatch4.GLOBSTAR=Minimatch.GLOBSTAR={},expand=require_brace_expansion(),plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){return set[c]=!0,set},{})}var slashSplit=/\/+/;minimatch4.filter=filter;function filter(pattern,options){return options=options||{},function(p,i,list){return minimatch4(p,pattern,options)}}function ext(a,b){a=a||{},b=b||{};var t={};return Object.keys(b).forEach(function(k){t[k]=b[k]}),Object.keys(a).forEach(function(k){t[k]=a[k]}),t}minimatch4.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch4;var orig=minimatch4,m=function(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};return m.Minimatch=function(pattern,options){return new orig.Minimatch(pattern,ext(def,options))},m};Minimatch.defaults=function(def){return!def||!Object.keys(def).length?Minimatch:minimatch4.defaults(def).Minimatch};function minimatch4(p,pattern,options){if(typeof pattern!="string")throw new TypeError("glob pattern string required");return options||(options={}),!options.nocomment&&pattern.charAt(0)==="#"?!1:pattern.trim()===""?p==="":new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch))return new Minimatch(pattern,options);if(typeof pattern!="string")throw new TypeError("glob pattern string required");options||(options={}),pattern=pattern.trim(),path6.sep!=="/"&&(pattern=pattern.split(path6.sep).join("/")),this.options=options,this.set=[],this.pattern=pattern,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(!this._made){var pattern=this.pattern,options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=!0;return}if(!pattern){this.empty=!0;return}this.parseNegate();var set=this.globSet=this.braceExpand();options.debug&&(this.debug=console.error),this.debug(this.pattern,set),set=this.globParts=set.map(function(s){return s.split(slashSplit)}),this.debug(this.pattern,set),set=set.map(function(s,si,set2){return s.map(this.parse,this)},this),this.debug(this.pattern,set),set=set.filter(function(s){return s.indexOf(!1)===-1}),this.debug(this.pattern,set),this.set=set}}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate2=!1,options=this.options,negateOffset=0;if(!options.nonegate){for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++)negate2=!negate2,negateOffset++;negateOffset&&(this.pattern=pattern.substr(negateOffset)),this.negate=negate2}}minimatch4.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(options||(this instanceof Minimatch?options=this.options:options={}),pattern=typeof pattern>"u"?this.pattern:pattern,typeof pattern>"u")throw new TypeError("undefined pattern");return options.nobrace||!pattern.match(/\{.*\}/)?[pattern]:expand(pattern)}Minimatch.prototype.parse=parse2;var SUBPARSE={};function parse2(pattern,isSub){if(pattern.length>1024*64)throw new TypeError("pattern is too long");var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=!1,patternListStack=[],negativeLists=[],stateChar,inClass=!1,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self2=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star,hasMagic=!0;break;case"?":re+=qmark,hasMagic=!0;break;default:re+="\\"+stateChar;break}self2.debug("clearStateChar %j %j",stateChar,re),stateChar=!1}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){if(this.debug("%s %s %s %j",pattern,i,re,c),escaping&&reSpecials[c]){re+="\\"+c,escaping=!1;continue}switch(c){case"/":return!1;case"\\":clearStateChar(),escaping=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c),inClass){this.debug(" in class"),c==="!"&&i===classStart+1&&(c="^"),re+=c;continue}self2.debug("call clearStateChar %j",stateChar),clearStateChar(),stateChar=c,options.noext&&clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close}),re+=stateChar==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",stateChar,re),stateChar=!1;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar(),hasMagic=!0;var pl=patternListStack.pop();re+=pl.close,pl.type==="!"&&negativeLists.push(pl),pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|",escaping=!1;continue}clearStateChar(),re+="|";continue;case"[":if(clearStateChar(),inClass){re+="\\"+c;continue}inClass=!0,classStart=i,reClassStart=re.length,re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c,escaping=!1;continue}if(inClass){var cs=pattern.substring(classStart+1,i);try{RegExp("["+cs+"]")}catch{var sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]",hasMagic=hasMagic||sp[1],inClass=!1;continue}}hasMagic=!0,inClass=!1,re+=c;continue;default:clearStateChar(),escaping?escaping=!1:reSpecials[c]&&!(c==="^"&&inClass)&&(re+="\\"),re+=c}}for(inClass&&(cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0],hasMagic=hasMagic||sp[1]),pl=patternListStack.pop();pl;pl=patternListStack.pop()){var tail=re.slice(pl.reStart+pl.open.length);this.debug("setting tail",re,pl),tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(_,$1,$2){return $2||($2="\\"),$1+$1+$2+"|"}),this.debug(`tail=%j
17
+ %s`,tail,tail,pl,re);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=!0,re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar(),escaping&&(re+="\\\\");var addPatternStart=!1;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=!0}for(var n=negativeLists.length-1;n>-1;n--){var nl=negativeLists[n],nlBefore=re.slice(0,nl.reStart),nlFirst=re.slice(nl.reStart,nl.reEnd-8),nlLast=re.slice(nl.reEnd-8,nl.reEnd),nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1,cleanAfter=nlAfter;for(i=0;i<openParensBefore;i++)cleanAfter=cleanAfter.replace(/\)[+*?]?/,"");nlAfter=cleanAfter;var dollar="";nlAfter===""&&isSub!==SUBPARSE&&(dollar="$");var newRe=nlBefore+nlFirst+nlAfter+dollar+nlLast;re=newRe}if(re!==""&&hasMagic&&(re="(?=.)"+re),addPatternStart&&(re=patternStart+re),isSub===SUBPARSE)return[re,hasMagic];if(!hasMagic)return globUnescape(pattern);var flags=options.nocase?"i":"";try{var regExp=new RegExp("^"+re+"$",flags)}catch{return new RegExp("$.")}return regExp._glob=pattern,regExp._src=re,regExp}minimatch4.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;var set=this.set;if(!set.length)return this.regexp=!1,this.regexp;var options=this.options,twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"",re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p=="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$",this.negate&&(re="^(?!"+re+").*$");try{this.regexp=new RegExp(re,flags)}catch{this.regexp=!1}return this.regexp}minimatch4.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);return list=list.filter(function(f){return mm.match(f)}),mm.options.nonull&&!list.length&&list.push(pattern),list};Minimatch.prototype.match=match;function match(f,partial){if(this.debug("match",f,this.pattern),this.comment)return!1;if(this.empty)return f==="";if(f==="/"&&partial)return!0;var options=this.options;path6.sep!=="/"&&(f=f.split(path6.sep).join("/")),f=f.split(slashSplit),this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename,i;for(i=f.length-1;i>=0&&(filename=f[i],!filename);i--);for(i=0;i<set.length;i++){var pattern=set[i],file=f;options.matchBase&&pattern.length===1&&(file=[filename]);var hit=this.matchOne(file,pattern,partial);if(hit)return options.flipNegate?!0:!this.negate}return options.flipNegate?!1:this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{this:this,file,pattern}),this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];if(this.debug(pattern,p,f),p===!1)return!1;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){for(this.debug("** at the end");fi<fl;fi++)if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return!1;return!0}for(;fr<fl;){var swallowee=file[fr];if(this.debug(`
18
+ globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),pattern.slice(pr),partial))return this.debug("globstar found match!",fr,fl,swallowee),!0;if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue"),fr++}return!!(partial&&(this.debug(`
19
+ >>> no match, partial?`,file,fr,pattern,pr),fr===fl))}var hit;if(typeof p=="string"?(options.nocase?hit=f.toLowerCase()===p.toLowerCase():hit=f===p,this.debug("string match",p,f,hit)):(hit=f.match(p),this.debug("pattern match",p,f,hit)),!hit)return!1}if(fi===fl&&pi===pl)return!0;if(fi===fl)return partial;if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}});var require_path_to_regexp=__commonJS({"../../node_modules/.pnpm/path-to-regexp@2.2.1/node_modules/path-to-regexp/index.js"(exports,module){module.exports=pathToRegexp;module.exports.parse=parse2;module.exports.compile=compile;module.exports.tokensToFunction=tokensToFunction;module.exports.tokensToRegExp=tokensToRegExp;var DEFAULT_DELIMITER="/",DEFAULT_DELIMITERS="./",PATH_REGEXP=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function parse2(str,options){for(var tokens=[],key=0,index=0,path6="",defaultDelimiter=options&&options.delimiter||DEFAULT_DELIMITER,delimiters=options&&options.delimiters||DEFAULT_DELIMITERS,pathEscaped=!1,res;(res=PATH_REGEXP.exec(str))!==null;){var m=res[0],escaped=res[1],offset=res.index;if(path6+=str.slice(index,offset),index=offset+m.length,escaped){path6+=escaped[1],pathEscaped=!0;continue}var prev="",next=str[index],name=res[2],capture=res[3],group=res[4],modifier=res[5];if(!pathEscaped&&path6.length){var k=path6.length-1;delimiters.indexOf(path6[k])>-1&&(prev=path6[k],path6=path6.slice(0,k))}path6&&(tokens.push(path6),path6="",pathEscaped=!1);var partial=prev!==""&&next!==void 0&&next!==prev,repeat=modifier==="+"||modifier==="*",optional=modifier==="?"||modifier==="*",delimiter2=prev||defaultDelimiter,pattern=capture||group;tokens.push({name:name||key++,prefix:prev,delimiter:delimiter2,optional,repeat,partial,pattern:pattern?escapeGroup(pattern):"[^"+escapeString(delimiter2)+"]+?"})}return(path6||index<str.length)&&tokens.push(path6+str.substr(index)),tokens}function compile(str,options){return tokensToFunction(parse2(str,options))}function tokensToFunction(tokens){for(var matches=new Array(tokens.length),i=0;i<tokens.length;i++)typeof tokens[i]=="object"&&(matches[i]=new RegExp("^(?:"+tokens[i].pattern+")$"));return function(data,options){for(var path6="",encode=options&&options.encode||encodeURIComponent,i2=0;i2<tokens.length;i2++){var token=tokens[i2];if(typeof token=="string"){path6+=token;continue}var value=data?data[token.name]:void 0,segment;if(Array.isArray(value)){if(!token.repeat)throw new TypeError('Expected "'+token.name+'" to not repeat, but got array');if(value.length===0){if(token.optional)continue;throw new TypeError('Expected "'+token.name+'" to not be empty')}for(var j=0;j<value.length;j++){if(segment=encode(value[j],token),!matches[i2].test(segment))throw new TypeError('Expected all "'+token.name+'" to match "'+token.pattern+'"');path6+=(j===0?token.prefix:token.delimiter)+segment}continue}if(typeof value=="string"||typeof value=="number"||typeof value=="boolean"){if(segment=encode(String(value),token),!matches[i2].test(segment))throw new TypeError('Expected "'+token.name+'" to match "'+token.pattern+'", but got "'+segment+'"');path6+=token.prefix+segment;continue}if(token.optional){token.partial&&(path6+=token.prefix);continue}throw new TypeError('Expected "'+token.name+'" to be '+(token.repeat?"an array":"a string"))}return path6}}function escapeString(str){return str.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function escapeGroup(group){return group.replace(/([=!:$/()])/g,"\\$1")}function flags(options){return options&&options.sensitive?"":"i"}function regexpToRegexp(path6,keys){if(!keys)return path6;var groups=path6.source.match(/\((?!\?)/g);if(groups)for(var i=0;i<groups.length;i++)keys.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return path6}function arrayToRegexp(path6,keys,options){for(var parts=[],i=0;i<path6.length;i++)parts.push(pathToRegexp(path6[i],keys,options).source);return new RegExp("(?:"+parts.join("|")+")",flags(options))}function stringToRegexp(path6,keys,options){return tokensToRegExp(parse2(path6,options),keys,options)}function tokensToRegExp(tokens,keys,options){options=options||{};for(var strict=options.strict,end=options.end!==!1,delimiter2=escapeString(options.delimiter||DEFAULT_DELIMITER),delimiters=options.delimiters||DEFAULT_DELIMITERS,endsWith=[].concat(options.endsWith||[]).map(escapeString).concat("$").join("|"),route="",isEndDelimited=tokens.length===0,i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token=="string")route+=escapeString(token),isEndDelimited=i===tokens.length-1&&delimiters.indexOf(token[token.length-1])>-1;else{var prefix=escapeString(token.prefix),capture=token.repeat?"(?:"+token.pattern+")(?:"+prefix+"(?:"+token.pattern+"))*":token.pattern;keys&&keys.push(token),token.optional?token.partial?route+=prefix+"("+capture+")?":route+="(?:"+prefix+"("+capture+"))?":route+=prefix+"("+capture+")"}}return end?(strict||(route+="(?:"+delimiter2+")?"),route+=endsWith==="$"?"$":"(?="+endsWith+")"):(strict||(route+="(?:"+delimiter2+"(?="+endsWith+"))?"),isEndDelimited||(route+="(?="+delimiter2+"|"+endsWith+")")),new RegExp("^"+route,flags(options))}function pathToRegexp(path6,keys,options){return path6 instanceof RegExp?regexpToRegexp(path6,keys):Array.isArray(path6)?arrayToRegexp(path6,keys,options):stringToRegexp(path6,keys,options)}}});var require_db=__commonJS({"../../node_modules/.pnpm/mime-db@1.33.0/node_modules/mime-db/db.json"(exports,module){module.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana"},"application/3gpp-ims+xml":{source:"iana"},"application/a2l":{source:"iana"},"application/activemessage":{source:"iana"},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana"},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",extensions:["atomsvc"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana"},"application/bacnet-xdd+zip":{source:"iana"},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana"},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana"},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/cbor":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana"},"application/ccxml+xml":{source:"iana",extensions:["ccxml"]},"application/cdfx+xml":{source:"iana"},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana"},"application/cellml+xml":{source:"iana"},"application/cfw":{source:"iana"},"application/clue_info+xml":{source:"iana"},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana"},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana"},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana"},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana"},"application/cstadata+xml":{source:"iana"},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",extensions:["mpd"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana"},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana"},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/docbook+xml":{source:"apache",extensions:["dbk"]},"application/dskpp+xml":{source:"iana"},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/emergencycalldata.comment+xml":{source:"iana"},"application/emergencycalldata.control+xml":{source:"iana"},"application/emergencycalldata.deviceinfo+xml":{source:"iana"},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana"},"application/emergencycalldata.serviceinfo+xml":{source:"iana"},"application/emergencycalldata.subscriberinfo+xml":{source:"iana"},"application/emergencycalldata.veds+xml":{source:"iana"},"application/emma+xml":{source:"iana",extensions:["emma"]},"application/emotionml+xml":{source:"iana"},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana"},"application/epub+zip":{source:"iana",extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana"},"application/fhir+xml":{source:"iana"},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1,extensions:["woff"]},"application/framework-attributes+xml":{source:"iana"},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geoxacml+xml":{source:"iana"},"application/gml+xml":{source:"iana",extensions:["gml"]},"application/gpx+xml":{source:"apache",extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana"},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana"},"application/ibe-pkg-reply+xml":{source:"iana"},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana"},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana"},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana"},"application/kpml-response+xml":{source:"iana"},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana"},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana"},"application/lost+xml":{source:"iana",extensions:["lostxml"]},"application/lostsync+xml":{source:"iana"},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",extensions:["mads"]},"application/manifest+json":{charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",extensions:["mathml"]},"application/mathml-content+xml":{source:"iana"},"application/mathml-presentation+xml":{source:"iana"},"application/mbms-associated-procedure-description+xml":{source:"iana"},"application/mbms-deregister+xml":{source:"iana"},"application/mbms-envelope+xml":{source:"iana"},"application/mbms-msk+xml":{source:"iana"},"application/mbms-msk-response+xml":{source:"iana"},"application/mbms-protection-description+xml":{source:"iana"},"application/mbms-reception-report+xml":{source:"iana"},"application/mbms-register+xml":{source:"iana"},"application/mbms-register-response+xml":{source:"iana"},"application/mbms-schedule+xml":{source:"iana"},"application/mbms-user-service-description+xml":{source:"iana"},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana"},"application/media_control+xml":{source:"iana"},"application/mediaservercontrol+xml":{source:"iana",extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",extensions:["metalink"]},"application/metalink4+xml":{source:"iana",extensions:["meta4"]},"application/mets+xml":{source:"iana",extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mmt-usd+xml":{source:"iana"},"application/mods+xml":{source:"iana",extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana"},"application/mrb-publish+xml":{source:"iana"},"application/msc-ivr+xml":{source:"iana"},"application/msc-mixer+xml":{source:"iana"},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana"},"application/n-triples":{source:"iana"},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana"},"application/news-groupinfo":{source:"iana"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana"},"application/node":{source:"iana"},"application/nss":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p2p-overlay+xml":{source:"iana"},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana"},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana"},"application/pidf-diff+xml":{source:"iana"},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",extensions:["pls"]},"application/poc-settings+xml":{source:"iana"},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana"},"application/provenance+xml":{source:"iana"},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.hpub+zip":{source:"iana"},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana"},"application/pskc+xml":{source:"iana",extensions:["pskcxml"]},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf"]},"application/reginfo+xml":{source:"iana",extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",extensions:["rld"]},"application/rfc+xml":{source:"iana"},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana"},"application/rls-services+xml":{source:"iana",extensions:["rs"]},"application/route-apd+xml":{source:"iana"},"application/route-s-tsid+xml":{source:"iana"},"application/route-usd+xml":{source:"iana"},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana"},"application/samlmetadata+xml":{source:"iana"},"application/sbml+xml":{source:"iana",extensions:["sbml"]},"application/scaip+xml":{source:"iana"},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/sep+xml":{source:"iana"},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",extensions:["shf"]},"application/sieve":{source:"iana"},"application/simple-filter+xml":{source:"iana"},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",extensions:["srx"]},"application/spirits-event+xml":{source:"iana"},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",extensions:["grxml"]},"application/sru+xml":{source:"iana",extensions:["sru"]},"application/ssdl+xml":{source:"apache",extensions:["ssdl"]},"application/ssml+xml":{source:"iana",extensions:["ssml"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/tei+xml":{source:"iana",extensions:["tei","teicorpus"]},"application/thraud+xml":{source:"iana",extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tnauthlist":{source:"iana"},"application/trig":{source:"iana"},"application/ttml+xml":{source:"iana"},"application/tve-trigger":{source:"iana"},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana"},"application/urc-ressheet+xml":{source:"iana"},"application/urc-targetdesc+xml":{source:"iana"},"application/urc-uisocketdesc+xml":{source:"iana"},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana"},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana"},"application/vnd.3gpp-prose+xml":{source:"iana"},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana"},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana"},"application/vnd.3gpp.bsf+xml":{source:"iana"},"application/vnd.3gpp.gmop+xml":{source:"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana"},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana"},"application/vnd.3gpp.mcptt-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana"},"application/vnd.3gpp.mid-call+xml":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana"},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana"},"application/vnd.3gpp.srvcc-info+xml":{source:"iana"},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana"},"application/vnd.3gpp.ussd+xml":{source:"iana"},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana"},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",extensions:["mpkg"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana"},"application/vnd.balsamiq.bmml+xml":{source:"iana"},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana"},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana"},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana"},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",extensions:["wbs"]},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana"},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana"},"application/vnd.cybank":{source:"iana"},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume-movie":{source:"iana"},"application/vnd.desmume.movie":{source:"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana"},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana"},"application/vnd.dvb.notif-container+xml":{source:"iana"},"application/vnd.dvb.notif-generic+xml":{source:"iana"},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana"},"application/vnd.dvb.notif-init+xml":{source:"iana"},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana"},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana"},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana"},"application/vnd.eszigno3+xml":{source:"iana",extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana"},"application/vnd.etsi.asic-e+zip":{source:"iana"},"application/vnd.etsi.asic-s+zip":{source:"iana"},"application/vnd.etsi.cug+xml":{source:"iana"},"application/vnd.etsi.iptvcommand+xml":{source:"iana"},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana"},"application/vnd.etsi.iptvprofile+xml":{source:"iana"},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana"},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana"},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana"},"application/vnd.etsi.iptvservice+xml":{source:"iana"},"application/vnd.etsi.iptvsync+xml":{source:"iana"},"application/vnd.etsi.iptvueprofile+xml":{source:"iana"},"application/vnd.etsi.mcid+xml":{source:"iana"},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana"},"application/vnd.etsi.pstn+xml":{source:"iana"},"application/vnd.etsi.sci+xml":{source:"iana"},"application/vnd.etsi.simservs+xml":{source:"iana"},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana"},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana"},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana"},"application/vnd.gov.sk.e-form+zip":{source:"iana"},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana"},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana"},"application/vnd.imagemeter.image+zip":{source:"iana"},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana"},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana"},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana"},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana"},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana"},"application/vnd.iptc.g2.packageitem+xml":{source:"iana"},"application/vnd.iptc.g2.planningitem+xml":{source:"iana"},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",extensions:["lasxml"]},"application/vnd.liberty-request+xml":{source:"iana"},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",extensions:["lbe"]},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana"},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana"},"application/vnd.marlin.drm.conftoken+xml":{source:"iana"},"application/vnd.marlin.drm.license+xml":{source:"iana"},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana"},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana"},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana"},"application/vnd.ms-printing.printticket+xml":{source:"apache"},"application/vnd.ms-printschematicket+xml":{source:"iana"},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana"},"application/vnd.nokia.iptv.config+xml":{source:"iana"},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana"},"application/vnd.nokia.landmarkcollection+xml":{source:"iana"},"application/vnd.nokia.n-gage.ac+xml":{source:"iana"},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana"},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana"},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana"},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana"},"application/vnd.oipf.dae.xhtml+xml":{source:"iana"},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana"},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana"},"application/vnd.oipf.spdlist+xml":{source:"iana"},"application/vnd.oipf.ueprofile+xml":{source:"iana"},"application/vnd.oipf.userprofile+xml":{source:"iana"},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana"},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.imd+xml":{source:"iana"},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana"},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana"},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.sprov+xml":{source:"iana"},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana"},"application/vnd.oma.cab-feature-handler+xml":{source:"iana"},"application/vnd.oma.cab-pcc+xml":{source:"iana"},"application/vnd.oma.cab-subs-invite+xml":{source:"iana"},"application/vnd.oma.cab-user-prefs+xml":{source:"iana"},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana"},"application/vnd.oma.group-usage-list+xml":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana"},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana"},"application/vnd.oma.poc.final-report+xml":{source:"iana"},"application/vnd.oma.poc.groups+xml":{source:"iana"},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana"},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana"},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana"},"application/vnd.oma.xcap-directory+xml":{source:"iana"},"application/vnd.omads-email+xml":{source:"iana"},"application/vnd.omads-file+xml":{source:"iana"},"application/vnd.omads-folder+xml":{source:"iana"},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana"},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana"},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana"},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana"},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana"},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana"},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos+xml":{source:"iana"},"application/vnd.paos.xml":{source:"apache"},"application/vnd.patentdive":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana"},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana"},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana"},"application/vnd.radisys.msml+xml":{source:"iana"},"application/vnd.radisys.msml-audit+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana"},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana"},"application/vnd.radisys.msml-conf+xml":{source:"iana"},"application/vnd.radisys.msml-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana"},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana"},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.software602.filler.form+xml":{source:"iana"},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana"},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana"},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.tmd.mediaflex.api+xml":{source:"iana"},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana"},"application/vnd.wv.ssp+xml":{source:"iana"},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana"},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",extensions:["zaz"]},"application/voicexml+xml":{source:"iana",extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana"},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"apache",extensions:["der","crt","pem"]},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana"},"application/xaml+xml":{source:"apache",extensions:["xaml"]},"application/xcap-att+xml":{source:"iana"},"application/xcap-caps+xml":{source:"iana"},"application/xcap-diff+xml":{source:"iana",extensions:["xdf"]},"application/xcap-el+xml":{source:"iana"},"application/xcap-error+xml":{source:"iana"},"application/xcap-ns+xml":{source:"iana"},"application/xcon-conference-info+xml":{source:"iana"},"application/xcon-conference-info-diff+xml":{source:"iana"},"application/xenc+xml":{source:"iana",extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache"},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana"},"application/xmpp+xml":{source:"iana"},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",extensions:["xpl"]},"application/xslt+xml":{source:"iana",extensions:["xslt"]},"application/xspf+xml":{source:"apache",extensions:["xspf"]},"application/xv+xml":{source:"iana",extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana"},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana"},"application/yin+xml":{source:"iana",extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana"},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana"},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tone":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana"},"image/apng":{compressible:!1,extensions:["apng"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana"},"image/emf":{source:"iana"},"image/fits":{source:"iana"},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana"},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana"},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana"},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/tiff-fx":{source:"iana"},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana"},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana"},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana"},"image/vnd.valve.source.texture":{source:"iana"},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana"},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana"},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/vnd.collada+xml":{source:"iana",extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana"},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana"},"model/vnd.parasolid.transmit.binary":{source:"iana"},"model/vnd.parasolid.transmit.text":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.valve.source.compiled-map":{source:"iana"},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana"},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana"},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana",compressible:!1},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fwdred":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shex":{extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana"},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vp8":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}}});var require_mime_db=__commonJS({"../../node_modules/.pnpm/mime-db@1.33.0/node_modules/mime-db/index.js"(exports,module){module.exports=require_db()}});var require_mime_types2=__commonJS({"../../node_modules/.pnpm/mime-types@2.1.18/node_modules/mime-types/index.js"(exports){"use strict";var db=require_mime_db(),extname3=__require("path").extname,EXTRACT_TYPE_REGEXP=/^\s*([^;\s]*)(?:;|\s|$)/,TEXT_TYPE_REGEXP=/^text\//i;exports.charset=charset;exports.charsets={lookup:charset};exports.contentType=contentType2;exports.extension=extension;exports.extensions=Object.create(null);exports.lookup=lookup;exports.types=Object.create(null);populateMaps(exports.extensions,exports.types);function charset(type){if(!type||typeof type!="string")return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),mime=match&&db[match[1].toLowerCase()];return mime&&mime.charset?mime.charset:match&&TEXT_TYPE_REGEXP.test(match[1])?"UTF-8":!1}function contentType2(str){if(!str||typeof str!="string")return!1;var mime=str.indexOf("/")===-1?exports.lookup(str):str;if(!mime)return!1;if(mime.indexOf("charset")===-1){var charset2=exports.charset(mime);charset2&&(mime+="; charset="+charset2.toLowerCase())}return mime}function extension(type){if(!type||typeof type!="string")return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),exts=match&&exports.extensions[match[1].toLowerCase()];return!exts||!exts.length?!1:exts[0]}function lookup(path6){if(!path6||typeof path6!="string")return!1;var extension2=extname3("x."+path6).toLowerCase().substr(1);return extension2&&exports.types[extension2]||!1}function populateMaps(extensions,types){var preference=["nginx","apache",void 0,"iana"];Object.keys(db).forEach(function(type){var mime=db[type],exts=mime.extensions;if(!(!exts||!exts.length)){extensions[type]=exts;for(var i=0;i<exts.length;i++){var extension2=exts[i];if(types[extension2]){var from=preference.indexOf(db[types[extension2]].source),to=preference.indexOf(mime.source);if(types[extension2]!=="application/octet-stream"&&(from>to||from===to&&types[extension2].substr(0,12)==="application/"))continue}types[extension2]=type}}})}}});var require_content_disposition=__commonJS({"../../node_modules/.pnpm/content-disposition@0.5.2/node_modules/content-disposition/index.js"(exports,module){"use strict";module.exports=contentDisposition;module.exports.parse=parse2;var basename2=__require("path").basename,ENCODE_URL_ATTR_CHAR_REGEXP=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,HEX_ESCAPE_REGEXP=/%[0-9A-Fa-f]{2}/,HEX_ESCAPE_REPLACE_REGEXP=/%([0-9A-Fa-f]{2})/g,NON_LATIN1_REGEXP=/[^\x20-\x7e\xa0-\xff]/g,QESC_REGEXP=/\\([\u0000-\u007f])/g,QUOTE_REGEXP=/([\\"])/g,PARAM_REGEXP=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,TEXT_REGEXP=/^[\x20-\x7e\x80-\xff]+$/,TOKEN_REGEXP=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,EXT_VALUE_REGEXP=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,DISPOSITION_TYPE_REGEXP=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function contentDisposition(filename,options){var opts=options||{},type=opts.type||"attachment",params=createparams(filename,opts.fallback);return format(new ContentDisposition(type,params))}function createparams(filename,fallback){if(filename!==void 0){var params={};if(typeof filename!="string")throw new TypeError("filename must be a string");if(fallback===void 0&&(fallback=!0),typeof fallback!="string"&&typeof fallback!="boolean")throw new TypeError("fallback must be a string or boolean");if(typeof fallback=="string"&&NON_LATIN1_REGEXP.test(fallback))throw new TypeError("fallback must be ISO-8859-1 string");var name=basename2(filename),isQuotedString=TEXT_REGEXP.test(name),fallbackName=typeof fallback!="string"?fallback&&getlatin1(name):basename2(fallback),hasFallback=typeof fallbackName=="string"&&fallbackName!==name;return(hasFallback||!isQuotedString||HEX_ESCAPE_REGEXP.test(name))&&(params["filename*"]=name),(isQuotedString||hasFallback)&&(params.filename=hasFallback?fallbackName:name),params}}function format(obj){var parameters=obj.parameters,type=obj.type;if(!type||typeof type!="string"||!TOKEN_REGEXP.test(type))throw new TypeError("invalid type");var string=String(type).toLowerCase();if(parameters&&typeof parameters=="object")for(var param2,params=Object.keys(parameters).sort(),i=0;i<params.length;i++){param2=params[i];var val=param2.substr(-1)==="*"?ustring(parameters[param2]):qstring(parameters[param2]);string+="; "+param2+"="+val}return string}function decodefield(str){var match=EXT_VALUE_REGEXP.exec(str);if(!match)throw new TypeError("invalid extended field value");var charset=match[1].toLowerCase(),encoded=match[2],value,binary=encoded.replace(HEX_ESCAPE_REPLACE_REGEXP,pdecode);switch(charset){case"iso-8859-1":value=getlatin1(binary);break;case"utf-8":value=new Buffer(binary,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return value}function getlatin1(val){return String(val).replace(NON_LATIN1_REGEXP,"?")}function parse2(string){if(!string||typeof string!="string")throw new TypeError("argument string is required");var match=DISPOSITION_TYPE_REGEXP.exec(string);if(!match)throw new TypeError("invalid type format");var index=match[0].length,type=match[1].toLowerCase(),key,names=[],params={},value;for(index=PARAM_REGEXP.lastIndex=match[0].substr(-1)===";"?index-1:index;match=PARAM_REGEXP.exec(string);){if(match.index!==index)throw new TypeError("invalid parameter format");if(index+=match[0].length,key=match[1].toLowerCase(),value=match[2],names.indexOf(key)!==-1)throw new TypeError("invalid duplicate parameter");if(names.push(key),key.indexOf("*")+1===key.length){key=key.slice(0,-1),value=decodefield(value),params[key]=value;continue}typeof params[key]!="string"&&(value[0]==='"'&&(value=value.substr(1,value.length-2).replace(QESC_REGEXP,"$1")),params[key]=value)}if(index!==-1&&index!==string.length)throw new TypeError("invalid parameter format");return new ContentDisposition(type,params)}function pdecode(str,hex){return String.fromCharCode(parseInt(hex,16))}function pencode(char){var hex=String(char).charCodeAt(0).toString(16).toUpperCase();return hex.length===1?"%0"+hex:"%"+hex}function qstring(val){var str=String(val);return'"'+str.replace(QUOTE_REGEXP,"\\$1")+'"'}function ustring(val){var str=String(val),encoded=encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP,pencode);return"UTF-8''"+encoded}function ContentDisposition(type,parameters){this.type=type,this.parameters=parameters}}});var require_path_is_inside=__commonJS({"../../node_modules/.pnpm/path-is-inside@1.0.2/node_modules/path-is-inside/lib/path-is-inside.js"(exports,module){"use strict";var path6=__require("path");module.exports=function(thePath,potentialParent){return thePath=stripTrailingSep(thePath),potentialParent=stripTrailingSep(potentialParent),process.platform==="win32"&&(thePath=thePath.toLowerCase(),potentialParent=potentialParent.toLowerCase()),thePath.lastIndexOf(potentialParent,0)===0&&(thePath[potentialParent.length]===path6.sep||thePath[potentialParent.length]===void 0)};function stripTrailingSep(thePath){return thePath[thePath.length-1]===path6.sep?thePath.slice(0,-1):thePath}}});var require_range_parser=__commonJS({"../../node_modules/.pnpm/range-parser@1.2.0/node_modules/range-parser/index.js"(exports,module){"use strict";module.exports=rangeParser;function rangeParser(size,str,options){var index=str.indexOf("=");if(index===-1)return-2;var arr=str.slice(index+1).split(","),ranges=[];ranges.type=str.slice(0,index);for(var i=0;i<arr.length;i++){var range=arr[i].split("-"),start=parseInt(range[0],10),end=parseInt(range[1],10);isNaN(start)?(start=size-end,end=size-1):isNaN(end)&&(end=size-1),end>size-1&&(end=size-1),!(isNaN(start)||isNaN(end)||start>end||start<0)&&ranges.push({start,end})}return ranges.length<1?-1:options&&options.combine?combineRanges(ranges):ranges}function combineRanges(ranges){for(var ordered=ranges.map(mapWithIndex).sort(sortByRangeStart),j=0,i=1;i<ordered.length;i++){var range=ordered[i],current=ordered[j];range.start>current.end+1?ordered[++j]=range:range.end>current.end&&(current.end=range.end,current.index=Math.min(current.index,range.index))}ordered.length=j+1;var combined=ordered.sort(sortByRangeIndex).map(mapWithoutIndex);return combined.type=ranges.type,combined}function mapWithIndex(range,index){return{start:range.start,end:range.end,index}}function mapWithoutIndex(range){return{start:range.start,end:range.end}}function sortByRangeIndex(a,b){return a.index-b.index}function sortByRangeStart(a,b){return a.start-b.start}}});var require_directory=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/directory.js"(exports,module){(function(){function directory(it){var encodeHTML6=typeof _encodeHTML<"u"?_encodeHTML:function(doNotSkipEncoded){var encodeHTMLRules={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}(),out='<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Files within '+encodeHTML6(it.directory)+`</title> <style>body { margin: 0; padding: 30px; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased;}main { max-width: 920px;}header { display: flex; justify-content: space-between; flex-wrap: wrap;}h1 { font-size: 18px; font-weight: 500; margin-top: 0; color: #000;}header h1 a { font-size: 18px; font-weight: 500; margin-top: 0; color: #000;}h1 i { font-style: normal;}ul { margin: 0 0 0 -2px; padding: 20px 0 0 0;}ul li { list-style: none; font-size: 14px; display: flex; justify-content: space-between;}a { text-decoration: none;}ul a { color: #000; padding: 10px 5px; margin: 0 -5px; white-space: nowrap; overflow: hidden; display: block; width: 100%; text-overflow: ellipsis;}header a { color: #0076FF; font-size: 11px; font-weight: 400; display: inline-block; line-height: 20px;}svg { height: 13px; vertical-align: text-bottom;}ul a::before { display: inline-block; vertical-align: middle; margin-right: 10px; width: 24px; text-align: center; line-height: 12px;}ul a.file::before { content: url("data:image/svg+xml;utf8,<svg width='15' height='19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 8C8.34 8 7 6.66 7 5V1H3c-1.1 0-2 .9-2 2v13c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V8h-4zM8 5c0 1.1.9 2 2 2h3.59L8 1.41V5zM3 0h5l7 7v9c0 1.66-1.34 3-3 3H3c-1.66 0-3-1.34-3-3V3c0-1.66 1.34-3 3-3z' fill='black'/></svg>");}ul a:hover { text-decoration: underline;}ul a.folder::before { content: url("data:image/svg+xml;utf8,<svg width='20' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M18.784 3.87a1.565 1.565 0 0 0-.565-.356V2.426c0-.648-.523-1.171-1.15-1.171H8.996L7.908.25A.89.89 0 0 0 7.302 0H2.094C1.445 0 .944.523.944 1.171v2.3c-.21.085-.398.21-.565.356a1.348 1.348 0 0 0-.377 1.004l.398 9.83C.42 15.393 1.048 16 1.8 16h15.583c.753 0 1.36-.586 1.4-1.339l.398-9.83c.021-.313-.125-.69-.397-.962zM1.843 3.41V1.191c0-.146.104-.272.25-.272H7.26l1.234 1.088c.083.042.167.104.293.104h8.282c.125 0 .25.126.25.272V3.41H1.844zm15.54 11.712H1.78a.47.47 0 0 1-.481-.46l-.397-9.83c0-.147.041-.252.125-.356a.504.504 0 0 1 .377-.147H17.78c.125 0 .272.063.377.147.083.083.125.209.125.334l-.418 9.83c-.021.272-.23.482-.481.482z' fill='black'/></svg>");}ul a.lambda::before { content: url("data:image/svg+xml; utf8,<svg width='15' height='19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M3.5 14.4354H5.31622L7.30541 9.81311H7.43514L8.65315 13.0797C9.05676 14.1643 9.55405 14.5 10.7 14.5C11.0171 14.5 11.291 14.4677 11.5 14.4032V13.1572C11.3847 13.1766 11.2622 13.2024 11.1541 13.2024C10.6351 13.2024 10.3829 13.0281 10.1595 12.4664L8.02613 7.07586C7.21171 5.01646 6.54865 4.5 5.11441 4.5C4.83333 4.5 4.62432 4.53228 4.37207 4.59038V5.83635C4.56667 5.81052 4.66036 5.79761 4.77568 5.79761C5.64775 5.79761 5.9 6.0042 6.4045 7.19852L6.64234 7.77954L3.5 14.4354Z' fill='black'/><rect x='0.5' y='0.5' width='14' height='18' rx='2.5' stroke='black'/></svg>");}ul a.file.gif::before,ul a.file.jpg::before,ul a.file.png::before,ul a.file.svg::before { content: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'><rect x='6' y='6' width='68' height='68' rx='5' ry='5'/><circle cx='24' cy='24' r='8'/><path d='M73 49L59 34 37 52m16 20L27 42 7 58'/></svg>");}::selection { background-color: #79FFE1; color: #000;}::-moz-selection { background-color: #79FFE1; color: #000;}@media (min-width: 768px) { ul {display: flex;flex-wrap: wrap; } ul li {width: 230px;padding-right: 20px; }}@media (min-width: 992px) { body {padding: 45px; } h1, header h1 a {font-size: 15px; } ul li {font-size: 13px;box-sizing: border-box;justify-content: flex-start; }}</style> </head> <body> <main> <header> <h1> <i>Index of&nbsp;</i> `,arr1=it.paths;if(arr1)for(var value,index=-1,l1=arr1.length-1;index<l1;)value=arr1[index+=1],out+=' <a href="/'+encodeHTML6(value.url)+'">'+encodeHTML6(value.name)+"</a> ";out+=' </h1> </header> <ul id="files"> ';var arr2=it.files;if(arr2)for(var value,index=-1,l2=arr2.length-1;index<l2;)value=arr2[index+=1],out+=' <li> <a href="'+encodeHTML6(value.relative)+'" title="'+encodeHTML6(value.title)+'" class="'+encodeHTML6(value.type)+" "+encodeHTML6(value.ext)+'">'+encodeHTML6(value.base)+"</a> </li> ";return out+=" </ul></main> </body></html>",out}var itself=directory,_encodeHTML=function(doNotSkipEncoded){var encodeHTMLRules={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}();typeof module<"u"&&module.exports?module.exports=itself:typeof define=="function"?define(function(){return itself}):(window.render=window.render||{},window.render.directory=itself)})()}});var require_error=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/error.js"(exports,module){(function(){function error3(it){var out='<!DOCTYPE html><head> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/> <style> body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; } main, aside, section { display: flex; justify-content: center; align-items: center; flex-direction: column; } main { height: 100%; } aside { background: #000; flex-shrink: 1; padding: 30px 20px; } aside p { margin: 0; color: #999999; font-size: 14px; line-height: 24px; } aside a { color: #fff; text-decoration: none; } section span { font-size: 24px; font-weight: 500; display: block; border-bottom: 1px solid #EAEAEA; text-align: center; padding-bottom: 20px; width: 100px; } section p { font-size: 14px; font-weight: 400; } section span + p { margin: 20px 0 0 0; } @media (min-width: 768px) { section { height: 40px; flex-direction: row; } section span, section p { height: 100%; line-height: 40px; } section span { border-bottom: 0; border-right: 1px solid #EAEAEA; padding: 0 20px 0 0; width: auto; } section span + p { margin: 0; padding-left: 20px; } aside { padding: 50px 0; } aside p { max-width: 520px; text-align: center; } } </style></head><body> <main> <section> <span>'+it.statusCode+"</span> <p>"+it.message+"</p> </section> </main></body>";return out}var itself=error3,_encodeHTML=function(doNotSkipEncoded){var encodeHTMLRules={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}();typeof module<"u"&&module.exports?module.exports=itself:typeof define=="function"?define(function(){return itself}):(window.render=window.render||{},window.render.error=itself)})()}});var require_src2=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/index.js"(exports,module){var{promisify:promisify2}=__require("util"),path6=__require("path"),{createHash:createHash3}=__require("crypto"),{realpath,lstat:lstat2,createReadStream,readdir:readdir2}=__require("fs"),url4=require_urlparser(),slasher=require_glob_slash(),minimatch4=require_minimatch2(),pathToRegExp=require_path_to_regexp(),mime=require_mime_types2(),bytes2=require_bytes(),contentDisposition=require_content_disposition(),isPathInside=require_path_is_inside(),parseRange=require_range_parser(),directoryTemplate2=require_directory(),errorTemplate=require_error(),etags=new Map,calculateSha=(handlers,absolutePath)=>new Promise((resolve3,reject)=>{let hash=createHash3("sha1");hash.update(path6.extname(absolutePath)),hash.update("-");let rs=handlers.createReadStream(absolutePath);rs.on("error",reject),rs.on("data",buf=>hash.update(buf)),rs.on("end",()=>{let sha=hash.digest("hex");resolve3(sha)})}),sourceMatches=(source,requestPath,allowSegments)=>{let keys=[],slashed=slasher(source),resolvedPath=path6.posix.resolve(requestPath),results=null;if(allowSegments){let normalized=slashed.replace("*","(.*)");results=pathToRegExp(normalized,keys).exec(resolvedPath),results||(keys.length=0)}return results||minimatch4(resolvedPath,slashed)?{keys,results}:null},toTarget=(source,destination,previousPath)=>{let matches=sourceMatches(source,previousPath,!0);if(!matches)return null;let{keys,results}=matches,props={},{protocol}=url4.parse(destination),normalizedDest=protocol?destination:slasher(destination),toPath=pathToRegExp.compile(normalizedDest);for(let index=0;index<keys.length;index++){let{name}=keys[index];props[name]=results[index+1]}return toPath(props)},applyRewrites=(requestPath,rewrites=[],repetitive)=>{let rewritesCopy=rewrites.slice(),fallback=repetitive?requestPath:null;if(rewritesCopy.length===0)return fallback;for(let index=0;index<rewritesCopy.length;index++){let{source,destination}=rewrites[index],target=toTarget(source,destination,requestPath);if(target)return rewritesCopy.splice(index,1),applyRewrites(slasher(target),rewritesCopy,!0)}return fallback},ensureSlashStart=target=>target.startsWith("/")?target:`/${target}`,shouldRedirect=(decodedPath,{redirects=[],trailingSlash},cleanUrl)=>{let slashing=typeof trailingSlash=="boolean",defaultType=301,matchHTML=/(\.html|\/index)$/g;if(redirects.length===0&&!slashing&&!cleanUrl)return null;let cleanedUrl=!1;if(cleanUrl&&matchHTML.test(decodedPath)&&(decodedPath=decodedPath.replace(matchHTML,""),cleanedUrl=!0),slashing){let{ext,name}=path6.parse(decodedPath),isTrailed=decodedPath.endsWith("/"),isDotfile=name.startsWith("."),target=null;if(!trailingSlash&&isTrailed?target=decodedPath.slice(0,-1):trailingSlash&&!isTrailed&&!ext&&!isDotfile&&(target=`${decodedPath}/`),decodedPath.indexOf("//")>-1&&(target=decodedPath.replace(/\/+/g,"/")),target)return{target:ensureSlashStart(target),statusCode:defaultType}}if(cleanedUrl)return{target:ensureSlashStart(decodedPath),statusCode:defaultType};for(let index=0;index<redirects.length;index++){let{source,destination,type}=redirects[index],target=toTarget(source,destination,decodedPath);if(target)return{target,statusCode:type||defaultType}}return null},appendHeaders=(target,source)=>{for(let index=0;index<source.length;index++){let{key,value}=source[index];target[key]=value}},getHeaders=async(handlers,config,current,absolutePath,stats)=>{let{headers:customHeaders=[],etag=!1}=config,related={},{base}=path6.parse(absolutePath),relativePath=path6.relative(current,absolutePath);if(customHeaders.length>0)for(let index=0;index<customHeaders.length;index++){let{source,headers:headers2}=customHeaders[index];sourceMatches(source,slasher(relativePath))&&appendHeaders(related,headers2)}let defaultHeaders={};if(stats){if(defaultHeaders={"Content-Length":stats.size,"Content-Disposition":contentDisposition(base,{type:"inline"}),"Accept-Ranges":"bytes"},etag){let[mtime,sha]=etags.get(absolutePath)||[];Number(mtime)!==Number(stats.mtime)&&(sha=await calculateSha(handlers,absolutePath),etags.set(absolutePath,[stats.mtime,sha])),defaultHeaders.ETag=`"${sha}"`}else defaultHeaders["Last-Modified"]=stats.mtime.toUTCString();let contentType2=mime.contentType(base);contentType2&&(defaultHeaders["Content-Type"]=contentType2)}let headers=Object.assign(defaultHeaders,related);for(let key in headers)headers.hasOwnProperty(key)&&headers[key]===null&&delete headers[key];return headers},applicable=(decodedPath,configEntry)=>{if(typeof configEntry=="boolean")return configEntry;if(Array.isArray(configEntry)){for(let index=0;index<configEntry.length;index++){let source=configEntry[index];if(sourceMatches(source,decodedPath))return!0}return!1}return!0},getPossiblePaths=(relativePath,extension)=>[path6.join(relativePath,`index${extension}`),relativePath.endsWith("/")?relativePath.replace(/\/$/g,extension):relativePath+extension].filter(item=>path6.basename(item)!==extension),findRelated=async(current,relativePath,rewrittenPath,originalStat)=>{let possible=rewrittenPath?[rewrittenPath]:getPossiblePaths(relativePath,".html"),stats=null;for(let index=0;index<possible.length;index++){let related=possible[index],absolutePath=path6.join(current,related);try{stats=await originalStat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")throw err}if(stats)return{stats,absolutePath}}return null},canBeListed=(excluded,file)=>{let slashed=slasher(file),whether=!0;for(let mark=0;mark<excluded.length;mark++){let source=excluded[mark];if(sourceMatches(source,slashed)){whether=!1;break}}return whether},renderDirectory=async(current,acceptsJSON,handlers,methods,config,paths)=>{let{directoryListing,trailingSlash,unlisted=[],renderSingle}=config,slashSuffix=typeof trailingSlash=="boolean"?trailingSlash?"/":"":"/",{relativePath,absolutePath}=paths,excluded=[".DS_Store",".git",...unlisted];if(!applicable(relativePath,directoryListing)&&!renderSingle)return{};let files=await handlers.readdir(absolutePath),canRenderSingle=renderSingle&&files.length===1;for(let index=0;index<files.length;index++){let file=files[index],filePath=path6.resolve(absolutePath,file),details=path6.parse(filePath),stats=null;if(methods.lstat?stats=await handlers.lstat(filePath,!0):stats=await handlers.lstat(filePath),details.relative=path6.join(relativePath,details.base),stats.isDirectory())details.base+=slashSuffix,details.relative+=slashSuffix,details.type="folder";else{if(canRenderSingle)return{singleFile:!0,absolutePath:filePath,stats};details.ext=details.ext.split(".")[1]||"txt",details.type="file",details.size=bytes2(stats.size,{unitSeparator:" ",decimalPlaces:0})}details.title=details.base,canBeListed(excluded,file)?files[index]=details:delete files[index]}let toRoot=path6.relative(current,absolutePath),directory=path6.join(path6.basename(current),toRoot,slashSuffix),pathParts=directory.split(path6.sep).filter(Boolean);if(files=files.sort((a,b)=>{let aIsDir=a.type==="directory",bIsDir=b.type==="directory";return aIsDir&&!bIsDir?-1:bIsDir&&!aIsDir||a.base>b.base?1:a.base<b.base?-1:0}).filter(Boolean),toRoot.length>0){let directoryPath=[...pathParts].slice(1),relative3=path6.join("/",...directoryPath,"..",slashSuffix);files.unshift({type:"directory",base:"..",relative:relative3,title:relative3,ext:""})}let subPaths=[];for(let index=0;index<pathParts.length;index++){let parents=[],isLast=index===pathParts.length-1,before=0;for(;before<=index;)parents.push(pathParts[before]),before++;parents.shift(),subPaths.push({name:pathParts[index]+(isLast?slashSuffix:"/"),url:index===0?"":parents.join("/")+slashSuffix})}let spec={files,directory,paths:subPaths};return{directory:acceptsJSON?JSON.stringify(spec):directoryTemplate2(spec)}},sendError=async(absolutePath,response,acceptsJSON,current,handlers,config,spec)=>{let{err:original,message,code,statusCode}=spec;if(original&&process.env.NODE_ENV!=="test"&&console.error(original),response.statusCode=statusCode,acceptsJSON){response.setHeader("Content-Type","application/json; charset=utf-8"),response.end(JSON.stringify({error:{code,message}}));return}let stats=null,errorPage=path6.join(current,`${statusCode}.html`);try{stats=await handlers.lstat(errorPage)}catch(err){err.code!=="ENOENT"&&console.error(err)}if(stats){let stream=null;try{stream=await handlers.createReadStream(errorPage);let headers2=await getHeaders(handlers,config,current,errorPage,stats);response.writeHead(statusCode,headers2),stream.pipe(response);return}catch(err){console.error(err)}}let headers=await getHeaders(handlers,config,current,absolutePath,null);headers["Content-Type"]="text/html; charset=utf-8",response.writeHead(statusCode,headers),response.end(errorTemplate({statusCode,message}))},internalError=async(...args)=>{let lastIndex=args.length-1,err=args[lastIndex];return args[lastIndex]={statusCode:500,code:"internal_server_error",message:"A server error has occurred",err},sendError(...args)},getHandlers=methods=>Object.assign({lstat:promisify2(lstat2),realpath:promisify2(realpath),createReadStream,readdir:promisify2(readdir2),sendError},methods);module.exports=async(request3,response,config={},methods={})=>{let cwd=process.cwd(),current=config.public?path6.resolve(cwd,config.public):cwd,handlers=getHandlers(methods),relativePath=null,acceptsJSON=null;request3.headers.accept&&(acceptsJSON=request3.headers.accept.includes("application/json"));try{relativePath=decodeURIComponent(url4.parse(request3.url).pathname)}catch{return sendError("/",response,acceptsJSON,current,handlers,config,{statusCode:400,code:"bad_request",message:"Bad Request"})}let absolutePath=path6.join(current,relativePath);if(!isPathInside(absolutePath,current))return sendError(absolutePath,response,acceptsJSON,current,handlers,config,{statusCode:400,code:"bad_request",message:"Bad Request"});let cleanUrl=applicable(relativePath,config.cleanUrls),redirect2=shouldRedirect(relativePath,config,cleanUrl);if(redirect2){response.writeHead(redirect2.statusCode,{Location:encodeURI(redirect2.target)}),response.end();return}let stats=null;if(path6.extname(relativePath)!=="")try{stats=await handlers.lstat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}let rewrittenPath=applyRewrites(relativePath,config.rewrites);if(!stats&&(cleanUrl||rewrittenPath))try{let related=await findRelated(current,relativePath,rewrittenPath,handlers.lstat);related&&({stats,absolutePath}=related)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(!stats)try{stats=await handlers.lstat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(stats&&stats.isDirectory()){let directory=null,singleFile=null;try{let related=await renderDirectory(current,acceptsJSON,handlers,methods,config,{relativePath,absolutePath});related.singleFile?{stats,absolutePath,singleFile}=related:{directory}=related}catch(err){if(err.code!=="ENOENT")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(directory){let contentType2=acceptsJSON?"application/json; charset=utf-8":"text/html; charset=utf-8";response.statusCode=200,response.setHeader("Content-Type",contentType2),response.end(directory);return}singleFile||(stats=null)}let isSymLink=stats&&stats.isSymbolicLink();if(!stats||!config.symlinks&&isSymLink)return handlers.sendError(absolutePath,response,acceptsJSON,current,handlers,config,{statusCode:404,code:"not_found",message:"The requested path could not be found"});isSymLink&&(absolutePath=await handlers.realpath(absolutePath),stats=await handlers.lstat(absolutePath));let streamOpts={};if(request3.headers.range&&stats.size){let range=parseRange(stats.size,request3.headers.range);if(typeof range=="object"&&range.type==="bytes"){let{start,end}=range[0];streamOpts.start=start,streamOpts.end=end,response.statusCode=206}else response.statusCode=416,response.setHeader("Content-Range",`bytes */${stats.size}`)}let stream=null;try{stream=await handlers.createReadStream(absolutePath,streamOpts)}catch(err){return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}let headers=await getHeaders(handlers,config,current,absolutePath,stats);if(streamOpts.start!==void 0&&streamOpts.end!==void 0&&(headers["Content-Range"]=`bytes ${streamOpts.start}-${streamOpts.end}/${stats.size}`,headers["Content-Length"]=streamOpts.end-streamOpts.start+1),request3.headers.range==null&&headers.ETag&&headers.ETag===request3.headers["if-none-match"]){response.statusCode=304,response.end();return}response.writeHead(response.statusCode||200,headers),stream.pipe(response)}}});var require_dist6=__commonJS({"../../node_modules/.pnpm/pcre-to-regexp@1.0.0/node_modules/pcre-to-regexp/dist/index.js"(exports,module){"use strict";var characterClasses={alnum:"[A-Za-z0-9]",word:"[A-Za-z0-9_]",alpha:"[A-Za-z]",blank:"[ \\t]",cntrl:"[\\x00-\\x1F\\x7F]",digit:"\\d",graph:"[\\x21-\\x7E]",lower:"[a-z]",print:"[\\x20-\\x7E]",punct:"[\\]\\[!\"#$%&'()*+,./:;<=>?@\\\\^_`{|}~-]",space:"\\s",upper:"[A-Z]",xdigit:"[A-Fa-f0-9]"};function createPCRE(pattern,namedCaptures){pattern=String(pattern||"").trim();let originalPattern=pattern,delim,flags="";if(/^[^a-zA-Z\\\s]/.test(pattern)){delim=pattern[0];let lastDelimIndex=pattern.lastIndexOf(delim);flags+=pattern.substring(lastDelimIndex+1),pattern=pattern.substring(1,lastDelimIndex)}let numGroups=0;pattern=replaceCaptureGroups(pattern,group=>{if(/^\(\?[P<']/.test(group)){let match=/^\(\?P?[<']([^>']+)[>']/.exec(group);if(!match)throw new Error(`Failed to extract named captures from ${JSON.stringify(group)}`);let capture=group.substring(match[0].length,group.length-1);return namedCaptures&&(namedCaptures[numGroups]=match[1]),numGroups++,`(${capture})`}return group.substring(0,3)==="(?:"||numGroups++,group}),pattern=pattern.replace(/\[:([^:]+):\]/g,(characterClass,name)=>characterClasses[name]||characterClass);let regexp=new RegExp(pattern,flags);return regexp.delimiter=delim,regexp.pcrePattern=originalPattern,regexp.pcreFlags=flags,regexp}function replaceCaptureGroups(pattern,fn){let start=0,depth=0,escaped=!1;for(let i=0;i<pattern.length;i++){let cur=pattern[i];if(escaped){escaped=!1;continue}switch(cur){case"(":depth===0&&(start=i),depth++;break;case")":if(depth>0&&(depth--,depth===0)){let end=i+1,l=start===0?"":pattern.substring(0,start),r=pattern.substring(end),v=String(fn(pattern.substring(start,end)));pattern=l+v+r,i=start}break;case"\\":escaped=!0;break;default:break}}return pattern}createPCRE.characterClasses=characterClasses;module.exports=createPCRE}});var require_dist7=__commonJS({"../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js"(exports,module){"use strict";function noop(){}function once2(emitter,name){let o=once2.spread(emitter,name),r=o.then(args=>args[0]);return r.cancel=o.cancel,r}(function(once3){function spread(emitter,name){let c=null,p=new Promise((resolve3,reject)=>{function cancel(){emitter.removeListener(name,onEvent),emitter.removeListener("error",onError),p.cancel=noop}function onEvent(...args){cancel(),resolve3(args)}function onError(err){cancel(),reject(err)}c=cancel,emitter.on(name,onEvent),emitter.on("error",onError)});if(!c)throw new TypeError("Could not get `cancel()` function");return p.cancel=c,p}once3.spread=spread})(once2||(once2={}));module.exports=once2}});var require_get_port=__commonJS({"../../node_modules/.pnpm/get-port@5.1.1/node_modules/get-port/index.js"(exports,module){"use strict";var net=__require("net"),Locked=class extends Error{constructor(port){super(`${port} is locked`)}},lockedPorts={old:new Set,young:new Set},releaseOldLockedPortsIntervalMs=1e3*15,interval,getAvailablePort=options=>new Promise((resolve3,reject)=>{let server=net.createServer();server.unref(),server.on("error",reject),server.listen(options,()=>{let{port}=server.address();server.close(()=>{resolve3(port)})})}),portCheckSequence=function*(ports){ports&&(yield*ports),yield 0};module.exports=async options=>{let ports;options&&(ports=typeof options.port=="number"?[options.port]:options.port),interval===void 0&&(interval=setInterval(()=>{lockedPorts.old=lockedPorts.young,lockedPorts.young=new Set},releaseOldLockedPortsIntervalMs),interval.unref&&interval.unref());for(let port of portCheckSequence(ports))try{let availablePort=await getAvailablePort({...options,port});for(;lockedPorts.old.has(availablePort)||lockedPorts.young.has(availablePort);){if(port!==0)throw new Locked(port);availablePort=await getAvailablePort({...options,port})}return lockedPorts.young.add(availablePort),availablePort}catch(error3){if(!["EADDRINUSE","EACCES"].includes(error3.code)&&!(error3 instanceof Locked))throw error3}throw new Error("No available ports found")};module.exports.makeRange=(from,to)=>{if(!Number.isInteger(from)||!Number.isInteger(to))throw new TypeError("`from` and `to` must be integer numbers");if(from<1024||from>65535)throw new RangeError("`from` must be between 1024 and 65535");if(to<1024||to>65536)throw new RangeError("`to` must be between 1024 and 65536");if(to<from)throw new RangeError("`to` must be greater than or equal to `from`");return function*(from2,to2){for(let port=from2;port<=to2;port++)yield port}(from,to)}}});var require_is_port_reachable=__commonJS({"../../node_modules/.pnpm/is-port-reachable@3.1.0/node_modules/is-port-reachable/index.js"(exports,module){"use strict";var net=__require("net");module.exports=async(port,{timeout=1e3,host}={})=>{let promise=new Promise((resolve3,reject)=>{let socket=new net.Socket,onError=()=>{socket.destroy(),reject()};socket.setTimeout(timeout),socket.once("error",onError),socket.once("timeout",onError),socket.connect(port,host,()=>{socket.end(),resolve3()})});try{return await promise,!0}catch{return!1}}}});var require_dispatch=__commonJS({"../../internals/local-schedules/dist/dispatch.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),dispatch_exports={};__export(dispatch_exports,{createDispatch:()=>createDispatch});module.exports=__toCommonJS(dispatch_exports);function createDispatch(schedule,payload,scheduledAtMs,occurrenceId,invokeSource,signal){let scheduledAt=new Date(scheduledAtMs).toISOString(),common={schedule,occurrenceId,scheduledAt,invokeSource,signal};return schedule.target.type==="queue"?{...common,delivery:{type:"queue",topic:schedule.target.topic,message:{scheduleId:schedule.scheduleId,executionId:occurrenceId,name:schedule.name,namespace:schedule.namespace,scheduledAt,source:schedule.source,...payload===void 0?{}:{payload:JSON.parse(payload)}}}}:schedule.target.type==="path"?{...common,delivery:{type:"path",path:schedule.target.path,requestMethod:schedule.target.requestMethod??"POST"}}:{...common,delivery:{type:"function",function:schedule.target.function,headers:{"ce-specversion":"1.0","ce-type":"com.vercel.schedule.v1beta","ce-source":`/schedule/${encodeURIComponent(schedule.namespace)}/${encodeURIComponent(schedule.name)}`,"ce-id":occurrenceId,"ce-vssscheduleid":schedule.scheduleId,"ce-vssscheduledat":scheduledAt,"ce-vssschedulename":schedule.name,"ce-vssnamespace":schedule.namespace,"ce-vssschedulesource":schedule.source}}}}}});var require_node2=__commonJS({"../../node_modules/.pnpm/ulid@3.0.1/node_modules/ulid/dist/node/index.cjs"(exports){"use strict";var crypto=__require("node:crypto"),B32_CHARACTERS="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ENCODING="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ENCODING_LEN=32,MAX_ULID="7ZZZZZZZZZZZZZZZZZZZZZZZZZ",MIN_ULID="00000000000000000000000000",RANDOM_LEN=16,TIME_LEN=10,TIME_MAX=0xffffffffffff,ULID_REGEX=/^[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}$/,UUID_REGEX=/^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/;exports.ULIDErrorCode=void 0;(function(ULIDErrorCode){ULIDErrorCode.Base32IncorrectEncoding="B32_ENC_INVALID",ULIDErrorCode.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",ULIDErrorCode.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",ULIDErrorCode.EncodeTimeNegative="ENC_TIME_NEG",ULIDErrorCode.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",ULIDErrorCode.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",ULIDErrorCode.PRNGDetectFailure="PRNG_DETECT",ULIDErrorCode.ULIDInvalid="ULID_INVALID",ULIDErrorCode.Unexpected="UNEXPECTED",ULIDErrorCode.UUIDInvalid="UUID_INVALID"})(exports.ULIDErrorCode||(exports.ULIDErrorCode={}));var ULIDError=class extends Error{constructor(errorCode,message){super(`${message} (${errorCode})`),this.name="ULIDError",this.code=errorCode}};function randomChar(prng){let randomPosition=Math.floor(prng()*ENCODING_LEN)%ENCODING_LEN;return ENCODING.charAt(randomPosition)}function replaceCharAt(str,index,char){return index>str.length-1?str:str.substr(0,index)+char+str.substr(index+1)}function crockfordEncode(input){let output=[],bitsRead=0,buffer=0,reversedInput=new Uint8Array(input.slice().reverse());for(let byte of reversedInput)for(buffer|=byte<<bitsRead,bitsRead+=8;bitsRead>=5;)output.unshift(buffer&31),buffer>>>=5,bitsRead-=5;return bitsRead>0&&output.unshift(buffer&31),output.map(byte=>B32_CHARACTERS.charAt(byte)).join("")}function crockfordDecode(input){let sanitizedInput=input.toUpperCase().split("").reverse().join(""),output=[],bitsRead=0,buffer=0;for(let character of sanitizedInput){let byte=B32_CHARACTERS.indexOf(character);if(byte===-1)throw new Error(`Invalid base 32 character found in string: ${character}`);for(buffer|=byte<<bitsRead,bitsRead+=5;bitsRead>=8;)output.unshift(buffer&255),buffer>>>=8,bitsRead-=8}return(bitsRead>=5||buffer>0)&&output.unshift(buffer&255),new Uint8Array(output)}function fixULIDBase32(id){return id.replace(/i/gi,"1").replace(/l/gi,"1").replace(/o/gi,"0").replace(/-/g,"")}function incrementBase32(str){let done,index=str.length,char,charIndex,output=str,maxCharIndex=ENCODING_LEN-1;for(;!done&&index-->=0;){if(char=output[index],charIndex=ENCODING.indexOf(char),charIndex===-1)throw new ULIDError(exports.ULIDErrorCode.Base32IncorrectEncoding,"Incorrectly encoded string");if(charIndex===maxCharIndex){output=replaceCharAt(output,index,ENCODING[0]);continue}done=replaceCharAt(output,index,ENCODING[charIndex+1])}if(typeof done=="string")return done;throw new ULIDError(exports.ULIDErrorCode.Base32IncorrectEncoding,"Failed incrementing string")}function decodeTime(id){if(id.length!==TIME_LEN+RANDOM_LEN)throw new ULIDError(exports.ULIDErrorCode.DecodeTimeValueMalformed,"Malformed ULID");let time=id.substr(0,TIME_LEN).toUpperCase().split("").reverse().reduce((carry,char,index)=>{let encodingIndex=ENCODING.indexOf(char);if(encodingIndex===-1)throw new ULIDError(exports.ULIDErrorCode.DecodeTimeInvalidCharacter,`Time decode error: Invalid character: ${char}`);return carry+=encodingIndex*Math.pow(ENCODING_LEN,index)},0);if(time>TIME_MAX)throw new ULIDError(exports.ULIDErrorCode.DecodeTimeValueMalformed,`Malformed ULID: timestamp too large: ${time}`);return time}function detectPRNG(root){let rootLookup=detectRoot(),globalCrypto=rootLookup&&(rootLookup.crypto||rootLookup.msCrypto)||(typeof crypto<"u"?crypto:null);if(typeof globalCrypto?.getRandomValues=="function")return()=>{let buffer=new Uint8Array(1);return globalCrypto.getRandomValues(buffer),buffer[0]/255};if(typeof globalCrypto?.randomBytes=="function")return()=>globalCrypto.randomBytes(1).readUInt8()/255;if(crypto?.randomBytes)return()=>crypto.randomBytes(1).readUInt8()/255;throw new ULIDError(exports.ULIDErrorCode.PRNGDetectFailure,"Failed to find a reliable PRNG")}function detectRoot(){return inWebWorker()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function encodeRandom(len,prng){let str="";for(;len>0;len--)str=randomChar(prng)+str;return str}function encodeTime(now,len=TIME_LEN){if(isNaN(now))throw new ULIDError(exports.ULIDErrorCode.EncodeTimeValueMalformed,`Time must be a number: ${now}`);if(now>TIME_MAX)throw new ULIDError(exports.ULIDErrorCode.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${TIME_MAX}: ${now}`);if(now<0)throw new ULIDError(exports.ULIDErrorCode.EncodeTimeNegative,`Time must be positive: ${now}`);if(Number.isInteger(now)===!1)throw new ULIDError(exports.ULIDErrorCode.EncodeTimeValueMalformed,`Time must be an integer: ${now}`);let mod,str="";for(let currentLen=len;currentLen>0;currentLen--)mod=now%ENCODING_LEN,str=ENCODING.charAt(mod)+str,now=(now-mod)/ENCODING_LEN;return str}function inWebWorker(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function isValid(id){return typeof id=="string"&&id.length===TIME_LEN+RANDOM_LEN&&id.toUpperCase().split("").every(char=>ENCODING.indexOf(char)!==-1)}function monotonicFactory(prng){let currentPRNG=prng||detectPRNG(),lastTime=0,lastRandom;return function(seedTime){let seed=!seedTime||isNaN(seedTime)?Date.now():seedTime;if(seed<=lastTime){let incrementedRandom=lastRandom=incrementBase32(lastRandom);return encodeTime(lastTime,TIME_LEN)+incrementedRandom}lastTime=seed;let newRandom=lastRandom=encodeRandom(RANDOM_LEN,currentPRNG);return encodeTime(seed,TIME_LEN)+newRandom}}function ulid(seedTime,prng){let currentPRNG=prng||detectPRNG(),seed=!seedTime||isNaN(seedTime)?Date.now():seedTime;return encodeTime(seed,TIME_LEN)+encodeRandom(RANDOM_LEN,currentPRNG)}function ulidToUUID(ulid2){if(!ULID_REGEX.test(ulid2))throw new ULIDError(exports.ULIDErrorCode.ULIDInvalid,`Invalid ULID: ${ulid2}`);let uint8Array=crockfordDecode(ulid2),uuid=Array.from(uint8Array).map(byte=>byte.toString(16).padStart(2,"0")).join("");return uuid=uuid.substring(0,8)+"-"+uuid.substring(8,12)+"-"+uuid.substring(12,16)+"-"+uuid.substring(16,20)+"-"+uuid.substring(20),uuid.toUpperCase()}function uuidToULID(uuid){if(!UUID_REGEX.test(uuid))throw new ULIDError(exports.ULIDErrorCode.UUIDInvalid,`Invalid UUID: ${uuid}`);let bytes2=uuid.replace(/-/g,"").match(/.{1,2}/g);if(!bytes2)throw new ULIDError(exports.ULIDErrorCode.Unexpected,`Failed parsing UUID bytes: ${uuid}`);let uint8Array=new Uint8Array(bytes2.map(byte=>parseInt(byte,16)));return crockfordEncode(uint8Array)}exports.MAX_ULID=MAX_ULID;exports.MIN_ULID=MIN_ULID;exports.TIME_LEN=TIME_LEN;exports.TIME_MAX=TIME_MAX;exports.ULIDError=ULIDError;exports.decodeTime=decodeTime;exports.encodeTime=encodeTime;exports.fixULIDBase32=fixULIDBase32;exports.incrementBase32=incrementBase32;exports.isValid=isValid;exports.monotonicFactory=monotonicFactory;exports.ulid=ulid;exports.ulidToUUID=ulidToUUID;exports.uuidToULID=uuidToULID}});var require_ids=__commonJS({"../../internals/local-schedules/dist/ids.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),ids_exports={};__export(ids_exports,{generateScheduleId:()=>generateScheduleId,scheduleExecutionId:()=>scheduleExecutionId});module.exports=__toCommonJS(ids_exports);var import_node_crypto5=__require("node:crypto"),import_ulid=require_node2(),CROCKFORD_BASE32="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function generateScheduleId(){return`sch_${(0,import_ulid.ulid)()}`}function scheduleExecutionId(scheduleId,scheduledAtMs){let hash=(0,import_node_crypto5.createHash)("sha256").update(`${scheduleId}:${scheduledAtMs}`).digest(),value=hash.readBigUInt64BE(0)<<64n|hash.readBigUInt64BE(8),encoded="";for(let i=0;i<26;i++)encoded=CROCKFORD_BASE32[Number(value&31n)]+encoded,value>>=5n;return`schx_${encoded}`}}});var require_types=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/types.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0})}});var require_CronField=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronField.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronField=void 0;var CronField=class _CronField{#hasLastChar=!1;#hasQuestionMarkChar=!1;#wildcard=!1;#values=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(values,options={rawValue:""}){if(!Array.isArray(values))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(values.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...options,rawValue:options.rawValue??""},this.#values=values.sort(_CronField.sorter),this.#wildcard=this.options.wildcard!==void 0?this.options.wildcard:this.#isWildcardValue(),this.#hasLastChar=this.options.rawValue.includes("L")||values.includes("L"),this.#hasQuestionMarkChar=this.options.rawValue.includes("?")||values.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#hasLastChar}get hasQuestionMarkChar(){return this.#hasQuestionMarkChar}get isWildcard(){return this.#wildcard}get values(){return this.#values}static sorter(a,b){let aIsNumber=typeof a=="number",bIsNumber=typeof b=="number";return aIsNumber&&bIsNumber?a-b:!aIsNumber&&!bIsNumber?a.localeCompare(b):aIsNumber?-1:1}serialize(){return{wildcard:this.#wildcard,values:this.#values}}validate(){let badValue,charsString=this.chars.length>0?` or chars ${this.chars.join("")}`:"",charTest=value=>char=>new RegExp(`^\\d{0,2}${char}$`).test(value),rangeTest=value=>(badValue=value,typeof value=="number"?value>=this.min&&value<=this.max:this.chars.some(charTest(value)));if(!this.#values.every(rangeTest))throw new Error(`${this.constructor.name} Validation error, got value ${badValue} expected range ${this.min}-${this.max}${charsString}`);let duplicate=this.#values.find((value,index)=>this.#values.indexOf(value)!==index);if(duplicate)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${duplicate}`)}#isWildcardValue(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(_,i)=>i+this.min).every(value=>this.#values.includes(value))}};exports.CronField=CronField}});var require_CronDayOfMonth=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronDayOfMonth.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronDayOfMonth=void 0;var CronField_1=require_CronField(),MIN_DAY=1,MAX_DAY=31,DAY_CHARS=Object.freeze(["L"]),CronDayOfMonth=class extends CronField_1.CronField{static get min(){return MIN_DAY}static get max(){return MAX_DAY}static get chars(){return DAY_CHARS}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(values,options){super(values,options),this.validate()}get values(){return super.values}};exports.CronDayOfMonth=CronDayOfMonth}});var require_CronDayOfWeek=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronDayOfWeek.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronDayOfWeek=void 0;var CronField_1=require_CronField(),MIN_DAY=0,MAX_DAY=7,DAY_CHARS=Object.freeze(["L"]),CronDayOfWeek=class extends CronField_1.CronField{static get min(){return MIN_DAY}static get max(){return MAX_DAY}static get chars(){return DAY_CHARS}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(values,options){super(values,options),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};exports.CronDayOfWeek=CronDayOfWeek}});var require_CronHour=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronHour.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronHour=void 0;var CronField_1=require_CronField(),MIN_HOUR=0,MAX_HOUR=23,HOUR_CHARS=Object.freeze([]),CronHour=class extends CronField_1.CronField{static get min(){return MIN_HOUR}static get max(){return MAX_HOUR}static get chars(){return HOUR_CHARS}constructor(values,options){super(values,options),this.validate()}get values(){return super.values}};exports.CronHour=CronHour}});var require_CronMinute=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronMinute.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronMinute=void 0;var CronField_1=require_CronField(),MIN_MINUTE=0,MAX_MINUTE=59,MINUTE_CHARS=Object.freeze([]),CronMinute=class extends CronField_1.CronField{static get min(){return MIN_MINUTE}static get max(){return MAX_MINUTE}static get chars(){return MINUTE_CHARS}constructor(values,options){super(values,options),this.validate()}get values(){return super.values}};exports.CronMinute=CronMinute}});var require_luxon=__commonJS({"../../node_modules/.pnpm/luxon@3.7.2/node_modules/luxon/build/node/luxon.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var LuxonError=class extends Error{},InvalidDateTimeError=class extends LuxonError{constructor(reason){super(`Invalid DateTime: ${reason.toMessage()}`)}},InvalidIntervalError=class extends LuxonError{constructor(reason){super(`Invalid Interval: ${reason.toMessage()}`)}},InvalidDurationError=class extends LuxonError{constructor(reason){super(`Invalid Duration: ${reason.toMessage()}`)}},ConflictingSpecificationError=class extends LuxonError{},InvalidUnitError=class extends LuxonError{constructor(unit){super(`Invalid unit ${unit}`)}},InvalidArgumentError=class extends LuxonError{},ZoneIsAbstractError=class extends LuxonError{constructor(){super("Zone is an abstract class")}},n="numeric",s="short",l="long",DATE_SHORT={year:n,month:n,day:n},DATE_MED={year:n,month:s,day:n},DATE_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s},DATE_FULL={year:n,month:l,day:n},DATE_HUGE={year:n,month:l,day:n,weekday:l},TIME_SIMPLE={hour:n,minute:n},TIME_WITH_SECONDS={hour:n,minute:n,second:n},TIME_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,timeZoneName:s},TIME_WITH_LONG_OFFSET={hour:n,minute:n,second:n,timeZoneName:l},TIME_24_SIMPLE={hour:n,minute:n,hourCycle:"h23"},TIME_24_WITH_SECONDS={hour:n,minute:n,second:n,hourCycle:"h23"},TIME_24_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:s},TIME_24_WITH_LONG_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:l},DATETIME_SHORT={year:n,month:n,day:n,hour:n,minute:n},DATETIME_SHORT_WITH_SECONDS={year:n,month:n,day:n,hour:n,minute:n,second:n},DATETIME_MED={year:n,month:s,day:n,hour:n,minute:n},DATETIME_MED_WITH_SECONDS={year:n,month:s,day:n,hour:n,minute:n,second:n},DATETIME_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s,hour:n,minute:n},DATETIME_FULL={year:n,month:l,day:n,hour:n,minute:n,timeZoneName:s},DATETIME_FULL_WITH_SECONDS={year:n,month:l,day:n,hour:n,minute:n,second:n,timeZoneName:s},DATETIME_HUGE={year:n,month:l,day:n,weekday:l,hour:n,minute:n,timeZoneName:l},DATETIME_HUGE_WITH_SECONDS={year:n,month:l,day:n,weekday:l,hour:n,minute:n,second:n,timeZoneName:l},Zone=class{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get ianaName(){return this.name}get isUniversal(){throw new ZoneIsAbstractError}offsetName(ts,opts){throw new ZoneIsAbstractError}formatOffset(ts,format){throw new ZoneIsAbstractError}offset(ts){throw new ZoneIsAbstractError}equals(otherZone){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}},singleton$1=null,SystemZone=class _SystemZone extends Zone{static get instance(){return singleton$1===null&&(singleton$1=new _SystemZone),singleton$1}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(ts,{format,locale}){return parseZoneInfo(ts,format,locale)}formatOffset(ts,format){return formatOffset(this.offset(ts),format)}offset(ts){return-new Date(ts).getTimezoneOffset()}equals(otherZone){return otherZone.type==="system"}get isValid(){return!0}},dtfCache=new Map;function makeDTF(zoneName){let dtf=dtfCache.get(zoneName);return dtf===void 0&&(dtf=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:zoneName,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),dtfCache.set(zoneName,dtf)),dtf}var typeToPos={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hackyOffset(dtf,date){let formatted=dtf.format(date).replace(/\u200E/g,""),parsed=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted),[,fMonth,fDay,fYear,fadOrBc,fHour,fMinute,fSecond]=parsed;return[fYear,fMonth,fDay,fadOrBc,fHour,fMinute,fSecond]}function partsOffset(dtf,date){let formatted=dtf.formatToParts(date),filled=[];for(let i=0;i<formatted.length;i++){let{type,value}=formatted[i],pos=typeToPos[type];type==="era"?filled[pos]=value:isUndefined(pos)||(filled[pos]=parseInt(value,10))}return filled}var ianaZoneCache=new Map,IANAZone=class _IANAZone extends Zone{static create(name){let zone=ianaZoneCache.get(name);return zone===void 0&&ianaZoneCache.set(name,zone=new _IANAZone(name)),zone}static resetCache(){ianaZoneCache.clear(),dtfCache.clear()}static isValidSpecifier(s2){return this.isValidZone(s2)}static isValidZone(zone){if(!zone)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:zone}).format(),!0}catch{return!1}}constructor(name){super(),this.zoneName=name,this.valid=_IANAZone.isValidZone(name)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(ts,{format,locale}){return parseZoneInfo(ts,format,locale,this.name)}formatOffset(ts,format){return formatOffset(this.offset(ts),format)}offset(ts){if(!this.valid)return NaN;let date=new Date(ts);if(isNaN(date))return NaN;let dtf=makeDTF(this.name),[year,month,day,adOrBc,hour,minute,second]=dtf.formatToParts?partsOffset(dtf,date):hackyOffset(dtf,date);adOrBc==="BC"&&(year=-Math.abs(year)+1);let asUTC=objToLocalTS({year,month,day,hour:hour===24?0:hour,minute,second,millisecond:0}),asTS=+date,over=asTS%1e3;return asTS-=over>=0?over:1e3+over,(asUTC-asTS)/(60*1e3)}equals(otherZone){return otherZone.type==="iana"&&otherZone.name===this.name}get isValid(){return this.valid}},intlLFCache={};function getCachedLF(locString,opts={}){let key=JSON.stringify([locString,opts]),dtf=intlLFCache[key];return dtf||(dtf=new Intl.ListFormat(locString,opts),intlLFCache[key]=dtf),dtf}var intlDTCache=new Map;function getCachedDTF(locString,opts={}){let key=JSON.stringify([locString,opts]),dtf=intlDTCache.get(key);return dtf===void 0&&(dtf=new Intl.DateTimeFormat(locString,opts),intlDTCache.set(key,dtf)),dtf}var intlNumCache=new Map;function getCachedINF(locString,opts={}){let key=JSON.stringify([locString,opts]),inf=intlNumCache.get(key);return inf===void 0&&(inf=new Intl.NumberFormat(locString,opts),intlNumCache.set(key,inf)),inf}var intlRelCache=new Map;function getCachedRTF(locString,opts={}){let{base,...cacheKeyOpts}=opts,key=JSON.stringify([locString,cacheKeyOpts]),inf=intlRelCache.get(key);return inf===void 0&&(inf=new Intl.RelativeTimeFormat(locString,opts),intlRelCache.set(key,inf)),inf}var sysLocaleCache=null;function systemLocale(){return sysLocaleCache||(sysLocaleCache=new Intl.DateTimeFormat().resolvedOptions().locale,sysLocaleCache)}var intlResolvedOptionsCache=new Map;function getCachedIntResolvedOptions(locString){let opts=intlResolvedOptionsCache.get(locString);return opts===void 0&&(opts=new Intl.DateTimeFormat(locString).resolvedOptions(),intlResolvedOptionsCache.set(locString,opts)),opts}var weekInfoCache=new Map;function getCachedWeekInfo(locString){let data=weekInfoCache.get(locString);if(!data){let locale=new Intl.Locale(locString);data="getWeekInfo"in locale?locale.getWeekInfo():locale.weekInfo,"minimalDays"in data||(data={...fallbackWeekSettings,...data}),weekInfoCache.set(locString,data)}return data}function parseLocaleString(localeStr){let xIndex=localeStr.indexOf("-x-");xIndex!==-1&&(localeStr=localeStr.substring(0,xIndex));let uIndex=localeStr.indexOf("-u-");if(uIndex===-1)return[localeStr];{let options,selectedStr;try{options=getCachedDTF(localeStr).resolvedOptions(),selectedStr=localeStr}catch{let smaller=localeStr.substring(0,uIndex);options=getCachedDTF(smaller).resolvedOptions(),selectedStr=smaller}let{numberingSystem,calendar}=options;return[selectedStr,numberingSystem,calendar]}}function intlConfigString(localeStr,numberingSystem,outputCalendar){return(outputCalendar||numberingSystem)&&(localeStr.includes("-u-")||(localeStr+="-u"),outputCalendar&&(localeStr+=`-ca-${outputCalendar}`),numberingSystem&&(localeStr+=`-nu-${numberingSystem}`)),localeStr}function mapMonths(f){let ms9=[];for(let i=1;i<=12;i++){let dt=DateTime.utc(2009,i,1);ms9.push(f(dt))}return ms9}function mapWeekdays(f){let ms9=[];for(let i=1;i<=7;i++){let dt=DateTime.utc(2016,11,13+i);ms9.push(f(dt))}return ms9}function listStuff(loc,length,englishFn,intlFn){let mode=loc.listingMode();return mode==="error"?null:mode==="en"?englishFn(length):intlFn(length)}function supportsFastNumbers(loc){return loc.numberingSystem&&loc.numberingSystem!=="latn"?!1:loc.numberingSystem==="latn"||!loc.locale||loc.locale.startsWith("en")||getCachedIntResolvedOptions(loc.locale).numberingSystem==="latn"}var PolyNumberFormatter=class{constructor(intl,forceSimple,opts){this.padTo=opts.padTo||0,this.floor=opts.floor||!1;let{padTo,floor,...otherOpts}=opts;if(!forceSimple||Object.keys(otherOpts).length>0){let intlOpts={useGrouping:!1,...opts};opts.padTo>0&&(intlOpts.minimumIntegerDigits=opts.padTo),this.inf=getCachedINF(intl,intlOpts)}}format(i){if(this.inf){let fixed=this.floor?Math.floor(i):i;return this.inf.format(fixed)}else{let fixed=this.floor?Math.floor(i):roundTo(i,3);return padStart(fixed,this.padTo)}}},PolyDateFormatter=class{constructor(dt,intl,opts){this.opts=opts,this.originalZone=void 0;let z;if(this.opts.timeZone)this.dt=dt;else if(dt.zone.type==="fixed"){let gmtOffset=-1*(dt.offset/60),offsetZ=gmtOffset>=0?`Etc/GMT+${gmtOffset}`:`Etc/GMT${gmtOffset}`;dt.offset!==0&&IANAZone.create(offsetZ).valid?(z=offsetZ,this.dt=dt):(z="UTC",this.dt=dt.offset===0?dt:dt.setZone("UTC").plus({minutes:dt.offset}),this.originalZone=dt.zone)}else dt.zone.type==="system"?this.dt=dt:dt.zone.type==="iana"?(this.dt=dt,z=dt.zone.name):(z="UTC",this.dt=dt.setZone("UTC").plus({minutes:dt.offset}),this.originalZone=dt.zone);let intlOpts={...this.opts};intlOpts.timeZone=intlOpts.timeZone||z,this.dtf=getCachedDTF(intl,intlOpts)}format(){return this.originalZone?this.formatToParts().map(({value})=>value).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let parts=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?parts.map(part=>{if(part.type==="timeZoneName"){let offsetName=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...part,value:offsetName}}else return part}):parts}resolvedOptions(){return this.dtf.resolvedOptions()}},PolyRelFormatter=class{constructor(intl,isEnglish,opts){this.opts={style:"long",...opts},!isEnglish&&hasRelative()&&(this.rtf=getCachedRTF(intl,opts))}format(count,unit){return this.rtf?this.rtf.format(count,unit):formatRelativeTime(unit,count,this.opts.numeric,this.opts.style!=="long")}formatToParts(count,unit){return this.rtf?this.rtf.formatToParts(count,unit):[]}},fallbackWeekSettings={firstDay:1,minimalDays:4,weekend:[6,7]},Locale=class _Locale{static fromOpts(opts){return _Locale.create(opts.locale,opts.numberingSystem,opts.outputCalendar,opts.weekSettings,opts.defaultToEN)}static create(locale,numberingSystem,outputCalendar,weekSettings,defaultToEN=!1){let specifiedLocale=locale||Settings.defaultLocale,localeR=specifiedLocale||(defaultToEN?"en-US":systemLocale()),numberingSystemR=numberingSystem||Settings.defaultNumberingSystem,outputCalendarR=outputCalendar||Settings.defaultOutputCalendar,weekSettingsR=validateWeekSettings(weekSettings)||Settings.defaultWeekSettings;return new _Locale(localeR,numberingSystemR,outputCalendarR,weekSettingsR,specifiedLocale)}static resetCache(){sysLocaleCache=null,intlDTCache.clear(),intlNumCache.clear(),intlRelCache.clear(),intlResolvedOptionsCache.clear(),weekInfoCache.clear()}static fromObject({locale,numberingSystem,outputCalendar,weekSettings}={}){return _Locale.create(locale,numberingSystem,outputCalendar,weekSettings)}constructor(locale,numbering,outputCalendar,weekSettings,specifiedLocale){let[parsedLocale,parsedNumberingSystem,parsedOutputCalendar]=parseLocaleString(locale);this.locale=parsedLocale,this.numberingSystem=numbering||parsedNumberingSystem||null,this.outputCalendar=outputCalendar||parsedOutputCalendar||null,this.weekSettings=weekSettings,this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=specifiedLocale,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=supportsFastNumbers(this)),this.fastNumbersCached}listingMode(){let isActuallyEn=this.isEnglish(),hasNoWeirdness=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return isActuallyEn&&hasNoWeirdness?"en":"intl"}clone(alts){return!alts||Object.getOwnPropertyNames(alts).length===0?this:_Locale.create(alts.locale||this.specifiedLocale,alts.numberingSystem||this.numberingSystem,alts.outputCalendar||this.outputCalendar,validateWeekSettings(alts.weekSettings)||this.weekSettings,alts.defaultToEN||!1)}redefaultToEN(alts={}){return this.clone({...alts,defaultToEN:!0})}redefaultToSystem(alts={}){return this.clone({...alts,defaultToEN:!1})}months(length,format=!1){return listStuff(this,length,months,()=>{let monthSpecialCase=this.intl==="ja"||this.intl.startsWith("ja-");format&=!monthSpecialCase;let intl=format?{month:length,day:"numeric"}:{month:length},formatStr=format?"format":"standalone";if(!this.monthsCache[formatStr][length]){let mapper=monthSpecialCase?dt=>this.dtFormatter(dt,intl).format():dt=>this.extract(dt,intl,"month");this.monthsCache[formatStr][length]=mapMonths(mapper)}return this.monthsCache[formatStr][length]})}weekdays(length,format=!1){return listStuff(this,length,weekdays,()=>{let intl=format?{weekday:length,year:"numeric",month:"long",day:"numeric"}:{weekday:length},formatStr=format?"format":"standalone";return this.weekdaysCache[formatStr][length]||(this.weekdaysCache[formatStr][length]=mapWeekdays(dt=>this.extract(dt,intl,"weekday"))),this.weekdaysCache[formatStr][length]})}meridiems(){return listStuff(this,void 0,()=>meridiems,()=>{if(!this.meridiemCache){let intl={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map(dt=>this.extract(dt,intl,"dayperiod"))}return this.meridiemCache})}eras(length){return listStuff(this,length,eras,()=>{let intl={era:length};return this.eraCache[length]||(this.eraCache[length]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map(dt=>this.extract(dt,intl,"era"))),this.eraCache[length]})}extract(dt,intlOpts,field){let df=this.dtFormatter(dt,intlOpts),results=df.formatToParts(),matching=results.find(m=>m.type.toLowerCase()===field);return matching?matching.value:null}numberFormatter(opts={}){return new PolyNumberFormatter(this.intl,opts.forceSimple||this.fastNumbers,opts)}dtFormatter(dt,intlOpts={}){return new PolyDateFormatter(dt,this.intl,intlOpts)}relFormatter(opts={}){return new PolyRelFormatter(this.intl,this.isEnglish(),opts)}listFormatter(opts={}){return getCachedLF(this.intl,opts)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hasLocaleWeekInfo()?getCachedWeekInfo(this.locale):fallbackWeekSettings}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(other){return this.locale===other.locale&&this.numberingSystem===other.numberingSystem&&this.outputCalendar===other.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},singleton=null,FixedOffsetZone=class _FixedOffsetZone extends Zone{static get utcInstance(){return singleton===null&&(singleton=new _FixedOffsetZone(0)),singleton}static instance(offset2){return offset2===0?_FixedOffsetZone.utcInstance:new _FixedOffsetZone(offset2)}static parseSpecifier(s2){if(s2){let r=s2.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new _FixedOffsetZone(signedOffset(r[1],r[2]))}return null}constructor(offset2){super(),this.fixed=offset2}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${formatOffset(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(ts,format){return formatOffset(this.fixed,format)}get isUniversal(){return!0}offset(){return this.fixed}equals(otherZone){return otherZone.type==="fixed"&&otherZone.fixed===this.fixed}get isValid(){return!0}},InvalidZone=class extends Zone{constructor(zoneName){super(),this.zoneName=zoneName}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function normalizeZone(input,defaultZone2){if(isUndefined(input)||input===null)return defaultZone2;if(input instanceof Zone)return input;if(isString(input)){let lowered=input.toLowerCase();return lowered==="default"?defaultZone2:lowered==="local"||lowered==="system"?SystemZone.instance:lowered==="utc"||lowered==="gmt"?FixedOffsetZone.utcInstance:FixedOffsetZone.parseSpecifier(lowered)||IANAZone.create(input)}else return isNumber(input)?FixedOffsetZone.instance(input):typeof input=="object"&&"offset"in input&&typeof input.offset=="function"?input:new InvalidZone(input)}var numberingSystems={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},numberingSystemsUTF16={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hanidecChars=numberingSystems.hanidec.replace(/[\[|\]]/g,"").split("");function parseDigits(str){let value=parseInt(str,10);if(isNaN(value)){value="";for(let i=0;i<str.length;i++){let code=str.charCodeAt(i);if(str[i].search(numberingSystems.hanidec)!==-1)value+=hanidecChars.indexOf(str[i]);else for(let key in numberingSystemsUTF16){let[min,max]=numberingSystemsUTF16[key];code>=min&&code<=max&&(value+=code-min)}}return parseInt(value,10)}else return value}var digitRegexCache=new Map;function resetDigitRegexCache(){digitRegexCache.clear()}function digitRegex({numberingSystem},append=""){let ns=numberingSystem||"latn",appendCache=digitRegexCache.get(ns);appendCache===void 0&&(appendCache=new Map,digitRegexCache.set(ns,appendCache));let regex=appendCache.get(append);return regex===void 0&&(regex=new RegExp(`${numberingSystems[ns]}${append}`),appendCache.set(append,regex)),regex}var now=()=>Date.now(),defaultZone="system",defaultLocale=null,defaultNumberingSystem=null,defaultOutputCalendar=null,twoDigitCutoffYear=60,throwOnInvalid,defaultWeekSettings=null,Settings=class{static get now(){return now}static set now(n2){now=n2}static set defaultZone(zone){defaultZone=zone}static get defaultZone(){return normalizeZone(defaultZone,SystemZone.instance)}static get defaultLocale(){return defaultLocale}static set defaultLocale(locale){defaultLocale=locale}static get defaultNumberingSystem(){return defaultNumberingSystem}static set defaultNumberingSystem(numberingSystem){defaultNumberingSystem=numberingSystem}static get defaultOutputCalendar(){return defaultOutputCalendar}static set defaultOutputCalendar(outputCalendar){defaultOutputCalendar=outputCalendar}static get defaultWeekSettings(){return defaultWeekSettings}static set defaultWeekSettings(weekSettings){defaultWeekSettings=validateWeekSettings(weekSettings)}static get twoDigitCutoffYear(){return twoDigitCutoffYear}static set twoDigitCutoffYear(cutoffYear){twoDigitCutoffYear=cutoffYear%100}static get throwOnInvalid(){return throwOnInvalid}static set throwOnInvalid(t){throwOnInvalid=t}static resetCaches(){Locale.resetCache(),IANAZone.resetCache(),DateTime.resetCache(),resetDigitRegexCache()}},Invalid=class{constructor(reason,explanation){this.reason=reason,this.explanation=explanation}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(unit,value){return new Invalid("unit out of range",`you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`)}function dayOfWeek(year,month,day){let d=new Date(Date.UTC(year,month-1,day));year<100&&year>=0&&d.setUTCFullYear(d.getUTCFullYear()-1900);let js=d.getUTCDay();return js===0?7:js}function computeOrdinal(year,month,day){return day+(isLeapYear(year)?leapLadder:nonLeapLadder)[month-1]}function uncomputeOrdinal(year,ordinal){let table=isLeapYear(year)?leapLadder:nonLeapLadder,month0=table.findIndex(i=>i<ordinal),day=ordinal-table[month0];return{month:month0+1,day}}function isoWeekdayToLocal(isoWeekday,startOfWeek){return(isoWeekday-startOfWeek+7)%7+1}function gregorianToWeek(gregObj,minDaysInFirstWeek=4,startOfWeek=1){let{year,month,day}=gregObj,ordinal=computeOrdinal(year,month,day),weekday=isoWeekdayToLocal(dayOfWeek(year,month,day),startOfWeek),weekNumber=Math.floor((ordinal-weekday+14-minDaysInFirstWeek)/7),weekYear;return weekNumber<1?(weekYear=year-1,weekNumber=weeksInWeekYear(weekYear,minDaysInFirstWeek,startOfWeek)):weekNumber>weeksInWeekYear(year,minDaysInFirstWeek,startOfWeek)?(weekYear=year+1,weekNumber=1):weekYear=year,{weekYear,weekNumber,weekday,...timeObject(gregObj)}}function weekToGregorian(weekData,minDaysInFirstWeek=4,startOfWeek=1){let{weekYear,weekNumber,weekday}=weekData,weekdayOfJan4=isoWeekdayToLocal(dayOfWeek(weekYear,1,minDaysInFirstWeek),startOfWeek),yearInDays=daysInYear(weekYear),ordinal=weekNumber*7+weekday-weekdayOfJan4-7+minDaysInFirstWeek,year;ordinal<1?(year=weekYear-1,ordinal+=daysInYear(year)):ordinal>yearInDays?(year=weekYear+1,ordinal-=daysInYear(weekYear)):year=weekYear;let{month,day}=uncomputeOrdinal(year,ordinal);return{year,month,day,...timeObject(weekData)}}function gregorianToOrdinal(gregData){let{year,month,day}=gregData,ordinal=computeOrdinal(year,month,day);return{year,ordinal,...timeObject(gregData)}}function ordinalToGregorian(ordinalData){let{year,ordinal}=ordinalData,{month,day}=uncomputeOrdinal(year,ordinal);return{year,month,day,...timeObject(ordinalData)}}function usesLocalWeekValues(obj,loc){if(!isUndefined(obj.localWeekday)||!isUndefined(obj.localWeekNumber)||!isUndefined(obj.localWeekYear)){if(!isUndefined(obj.weekday)||!isUndefined(obj.weekNumber)||!isUndefined(obj.weekYear))throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields");return isUndefined(obj.localWeekday)||(obj.weekday=obj.localWeekday),isUndefined(obj.localWeekNumber)||(obj.weekNumber=obj.localWeekNumber),isUndefined(obj.localWeekYear)||(obj.weekYear=obj.localWeekYear),delete obj.localWeekday,delete obj.localWeekNumber,delete obj.localWeekYear,{minDaysInFirstWeek:loc.getMinDaysInFirstWeek(),startOfWeek:loc.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function hasInvalidWeekData(obj,minDaysInFirstWeek=4,startOfWeek=1){let validYear=isInteger(obj.weekYear),validWeek=integerBetween(obj.weekNumber,1,weeksInWeekYear(obj.weekYear,minDaysInFirstWeek,startOfWeek)),validWeekday=integerBetween(obj.weekday,1,7);return validYear?validWeek?validWeekday?!1:unitOutOfRange("weekday",obj.weekday):unitOutOfRange("week",obj.weekNumber):unitOutOfRange("weekYear",obj.weekYear)}function hasInvalidOrdinalData(obj){let validYear=isInteger(obj.year),validOrdinal=integerBetween(obj.ordinal,1,daysInYear(obj.year));return validYear?validOrdinal?!1:unitOutOfRange("ordinal",obj.ordinal):unitOutOfRange("year",obj.year)}function hasInvalidGregorianData(obj){let validYear=isInteger(obj.year),validMonth=integerBetween(obj.month,1,12),validDay=integerBetween(obj.day,1,daysInMonth(obj.year,obj.month));return validYear?validMonth?validDay?!1:unitOutOfRange("day",obj.day):unitOutOfRange("month",obj.month):unitOutOfRange("year",obj.year)}function hasInvalidTimeData(obj){let{hour,minute,second,millisecond}=obj,validHour=integerBetween(hour,0,23)||hour===24&&minute===0&&second===0&&millisecond===0,validMinute=integerBetween(minute,0,59),validSecond=integerBetween(second,0,59),validMillisecond=integerBetween(millisecond,0,999);return validHour?validMinute?validSecond?validMillisecond?!1:unitOutOfRange("millisecond",millisecond):unitOutOfRange("second",second):unitOutOfRange("minute",minute):unitOutOfRange("hour",hour)}function isUndefined(o){return typeof o>"u"}function isNumber(o){return typeof o=="number"}function isInteger(o){return typeof o=="number"&&o%1===0}function isString(o){return typeof o=="string"}function isDate(o){return Object.prototype.toString.call(o)==="[object Date]"}function hasRelative(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function hasLocaleWeekInfo(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function maybeArray(thing){return Array.isArray(thing)?thing:[thing]}function bestBy(arr,by,compare){if(arr.length!==0)return arr.reduce((best,next)=>{let pair=[by(next),next];return best&&compare(best[0],pair[0])===best[0]?best:pair},null)[1]}function pick(obj,keys){return keys.reduce((a,k)=>(a[k]=obj[k],a),{})}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}function validateWeekSettings(settings){if(settings==null)return null;if(typeof settings!="object")throw new InvalidArgumentError("Week settings must be an object");if(!integerBetween(settings.firstDay,1,7)||!integerBetween(settings.minimalDays,1,7)||!Array.isArray(settings.weekend)||settings.weekend.some(v=>!integerBetween(v,1,7)))throw new InvalidArgumentError("Invalid week settings");return{firstDay:settings.firstDay,minimalDays:settings.minimalDays,weekend:Array.from(settings.weekend)}}function integerBetween(thing,bottom,top){return isInteger(thing)&&thing>=bottom&&thing<=top}function floorMod(x,n2){return x-n2*Math.floor(x/n2)}function padStart(input,n2=2){let isNeg=input<0,padded;return isNeg?padded="-"+(""+-input).padStart(n2,"0"):padded=(""+input).padStart(n2,"0"),padded}function parseInteger(string){if(!(isUndefined(string)||string===null||string===""))return parseInt(string,10)}function parseFloating(string){if(!(isUndefined(string)||string===null||string===""))return parseFloat(string)}function parseMillis(fraction){if(!(isUndefined(fraction)||fraction===null||fraction==="")){let f=parseFloat("0."+fraction)*1e3;return Math.floor(f)}}function roundTo(number,digits,rounding="round"){let factor=10**digits;switch(rounding){case"expand":return number>0?Math.ceil(number*factor)/factor:Math.floor(number*factor)/factor;case"trunc":return Math.trunc(number*factor)/factor;case"round":return Math.round(number*factor)/factor;case"floor":return Math.floor(number*factor)/factor;case"ceil":return Math.ceil(number*factor)/factor;default:throw new RangeError(`Value rounding ${rounding} is out of range`)}}function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function daysInYear(year){return isLeapYear(year)?366:365}function daysInMonth(year,month){let modMonth=floorMod(month-1,12)+1,modYear=year+(month-modMonth)/12;return modMonth===2?isLeapYear(modYear)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][modMonth-1]}function objToLocalTS(obj){let d=Date.UTC(obj.year,obj.month-1,obj.day,obj.hour,obj.minute,obj.second,obj.millisecond);return obj.year<100&&obj.year>=0&&(d=new Date(d),d.setUTCFullYear(obj.year,obj.month-1,obj.day)),+d}function firstWeekOffset(year,minDaysInFirstWeek,startOfWeek){return-isoWeekdayToLocal(dayOfWeek(year,1,minDaysInFirstWeek),startOfWeek)+minDaysInFirstWeek-1}function weeksInWeekYear(weekYear,minDaysInFirstWeek=4,startOfWeek=1){let weekOffset=firstWeekOffset(weekYear,minDaysInFirstWeek,startOfWeek),weekOffsetNext=firstWeekOffset(weekYear+1,minDaysInFirstWeek,startOfWeek);return(daysInYear(weekYear)-weekOffset+weekOffsetNext)/7}function untruncateYear(year){return year>99?year:year>Settings.twoDigitCutoffYear?1900+year:2e3+year}function parseZoneInfo(ts,offsetFormat,locale,timeZone=null){let date=new Date(ts),intlOpts={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};timeZone&&(intlOpts.timeZone=timeZone);let modified={timeZoneName:offsetFormat,...intlOpts},parsed=new Intl.DateTimeFormat(locale,modified).formatToParts(date).find(m=>m.type.toLowerCase()==="timezonename");return parsed?parsed.value:null}function signedOffset(offHourStr,offMinuteStr){let offHour=parseInt(offHourStr,10);Number.isNaN(offHour)&&(offHour=0);let offMin=parseInt(offMinuteStr,10)||0,offMinSigned=offHour<0||Object.is(offHour,-0)?-offMin:offMin;return offHour*60+offMinSigned}function asNumber(value){let numericValue=Number(value);if(typeof value=="boolean"||value===""||!Number.isFinite(numericValue))throw new InvalidArgumentError(`Invalid unit value ${value}`);return numericValue}function normalizeObject(obj,normalizer){let normalized={};for(let u in obj)if(hasOwnProperty(obj,u)){let v=obj[u];if(v==null)continue;normalized[normalizer(u)]=asNumber(v)}return normalized}function formatOffset(offset2,format){let hours=Math.trunc(Math.abs(offset2/60)),minutes=Math.trunc(Math.abs(offset2%60)),sign=offset2>=0?"+":"-";switch(format){case"short":return`${sign}${padStart(hours,2)}:${padStart(minutes,2)}`;case"narrow":return`${sign}${hours}${minutes>0?`:${minutes}`:""}`;case"techie":return`${sign}${padStart(hours,2)}${padStart(minutes,2)}`;default:throw new RangeError(`Value format ${format} is out of range for property format`)}}function timeObject(obj){return pick(obj,["hour","minute","second","millisecond"])}var monthsLong=["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsNarrow=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(length){switch(length){case"narrow":return[...monthsNarrow];case"short":return[...monthsShort];case"long":return[...monthsLong];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var weekdaysLong=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysNarrow=["M","T","W","T","F","S","S"];function weekdays(length){switch(length){case"narrow":return[...weekdaysNarrow];case"short":return[...weekdaysShort];case"long":return[...weekdaysLong];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var meridiems=["AM","PM"],erasLong=["Before Christ","Anno Domini"],erasShort=["BC","AD"],erasNarrow=["B","A"];function eras(length){switch(length){case"narrow":return[...erasNarrow];case"short":return[...erasShort];case"long":return[...erasLong];default:return null}}function meridiemForDateTime(dt){return meridiems[dt.hour<12?0:1]}function weekdayForDateTime(dt,length){return weekdays(length)[dt.weekday-1]}function monthForDateTime(dt,length){return months(length)[dt.month-1]}function eraForDateTime(dt,length){return eras(length)[dt.year<0?0:1]}function formatRelativeTime(unit,count,numeric="always",narrow=!1){let units={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},lastable=["hours","minutes","seconds"].indexOf(unit)===-1;if(numeric==="auto"&&lastable){let isDay=unit==="days";switch(count){case 1:return isDay?"tomorrow":`next ${units[unit][0]}`;case-1:return isDay?"yesterday":`last ${units[unit][0]}`;case 0:return isDay?"today":`this ${units[unit][0]}`}}let isInPast=Object.is(count,-0)||count<0,fmtValue=Math.abs(count),singular=fmtValue===1,lilUnits=units[unit],fmtUnit=narrow?singular?lilUnits[1]:lilUnits[2]||lilUnits[1]:singular?units[unit][0]:unit;return isInPast?`${fmtValue} ${fmtUnit} ago`:`in ${fmtValue} ${fmtUnit}`}function stringifyTokens(splits,tokenToString){let s2="";for(let token of splits)token.literal?s2+=token.val:s2+=tokenToString(token.val);return s2}var macroTokenToFormatOpts={D:DATE_SHORT,DD:DATE_MED,DDD:DATE_FULL,DDDD:DATE_HUGE,t:TIME_SIMPLE,tt:TIME_WITH_SECONDS,ttt:TIME_WITH_SHORT_OFFSET,tttt:TIME_WITH_LONG_OFFSET,T:TIME_24_SIMPLE,TT:TIME_24_WITH_SECONDS,TTT:TIME_24_WITH_SHORT_OFFSET,TTTT:TIME_24_WITH_LONG_OFFSET,f:DATETIME_SHORT,ff:DATETIME_MED,fff:DATETIME_FULL,ffff:DATETIME_HUGE,F:DATETIME_SHORT_WITH_SECONDS,FF:DATETIME_MED_WITH_SECONDS,FFF:DATETIME_FULL_WITH_SECONDS,FFFF:DATETIME_HUGE_WITH_SECONDS},Formatter=class _Formatter{static create(locale,opts={}){return new _Formatter(locale,opts)}static parseFormat(fmt){let current=null,currentFull="",bracketed=!1,splits=[];for(let i=0;i<fmt.length;i++){let c=fmt.charAt(i);c==="'"?((currentFull.length>0||bracketed)&&splits.push({literal:bracketed||/^\s+$/.test(currentFull),val:currentFull===""?"'":currentFull}),current=null,currentFull="",bracketed=!bracketed):bracketed||c===current?currentFull+=c:(currentFull.length>0&&splits.push({literal:/^\s+$/.test(currentFull),val:currentFull}),currentFull=c,current=c)}return currentFull.length>0&&splits.push({literal:bracketed||/^\s+$/.test(currentFull),val:currentFull}),splits}static macroTokenToFormatOpts(token){return macroTokenToFormatOpts[token]}constructor(locale,formatOpts){this.opts=formatOpts,this.loc=locale,this.systemLoc=null}formatWithSystemDefault(dt,opts){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(dt,{...this.opts,...opts}).format()}dtFormatter(dt,opts={}){return this.loc.dtFormatter(dt,{...this.opts,...opts})}formatDateTime(dt,opts){return this.dtFormatter(dt,opts).format()}formatDateTimeParts(dt,opts){return this.dtFormatter(dt,opts).formatToParts()}formatInterval(interval,opts){return this.dtFormatter(interval.start,opts).dtf.formatRange(interval.start.toJSDate(),interval.end.toJSDate())}resolvedOptions(dt,opts){return this.dtFormatter(dt,opts).resolvedOptions()}num(n2,p=0,signDisplay=void 0){if(this.opts.forceSimple)return padStart(n2,p);let opts={...this.opts};return p>0&&(opts.padTo=p),signDisplay&&(opts.signDisplay=signDisplay),this.loc.numberFormatter(opts).format(n2)}formatDateTimeFromString(dt,fmt){let knownEnglish=this.loc.listingMode()==="en",useDateTimeFormatter=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",string=(opts,extract)=>this.loc.extract(dt,opts,extract),formatOffset2=opts=>dt.isOffsetFixed&&dt.offset===0&&opts.allowZ?"Z":dt.isValid?dt.zone.formatOffset(dt.ts,opts.format):"",meridiem=()=>knownEnglish?meridiemForDateTime(dt):string({hour:"numeric",hourCycle:"h12"},"dayperiod"),month=(length,standalone)=>knownEnglish?monthForDateTime(dt,length):string(standalone?{month:length}:{month:length,day:"numeric"},"month"),weekday=(length,standalone)=>knownEnglish?weekdayForDateTime(dt,length):string(standalone?{weekday:length}:{weekday:length,month:"long",day:"numeric"},"weekday"),maybeMacro=token=>{let formatOpts=_Formatter.macroTokenToFormatOpts(token);return formatOpts?this.formatWithSystemDefault(dt,formatOpts):token},era=length=>knownEnglish?eraForDateTime(dt,length):string({era:length},"era"),tokenToString=token=>{switch(token){case"S":return this.num(dt.millisecond);case"u":case"SSS":return this.num(dt.millisecond,3);case"s":return this.num(dt.second);case"ss":return this.num(dt.second,2);case"uu":return this.num(Math.floor(dt.millisecond/10),2);case"uuu":return this.num(Math.floor(dt.millisecond/100));case"m":return this.num(dt.minute);case"mm":return this.num(dt.minute,2);case"h":return this.num(dt.hour%12===0?12:dt.hour%12);case"hh":return this.num(dt.hour%12===0?12:dt.hour%12,2);case"H":return this.num(dt.hour);case"HH":return this.num(dt.hour,2);case"Z":return formatOffset2({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return formatOffset2({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return formatOffset2({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return dt.zone.offsetName(dt.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return dt.zone.offsetName(dt.ts,{format:"long",locale:this.loc.locale});case"z":return dt.zoneName;case"a":return meridiem();case"d":return useDateTimeFormatter?string({day:"numeric"},"day"):this.num(dt.day);case"dd":return useDateTimeFormatter?string({day:"2-digit"},"day"):this.num(dt.day,2);case"c":return this.num(dt.weekday);case"ccc":return weekday("short",!0);case"cccc":return weekday("long",!0);case"ccccc":return weekday("narrow",!0);case"E":return this.num(dt.weekday);case"EEE":return weekday("short",!1);case"EEEE":return weekday("long",!1);case"EEEEE":return weekday("narrow",!1);case"L":return useDateTimeFormatter?string({month:"numeric",day:"numeric"},"month"):this.num(dt.month);case"LL":return useDateTimeFormatter?string({month:"2-digit",day:"numeric"},"month"):this.num(dt.month,2);case"LLL":return month("short",!0);case"LLLL":return month("long",!0);case"LLLLL":return month("narrow",!0);case"M":return useDateTimeFormatter?string({month:"numeric"},"month"):this.num(dt.month);case"MM":return useDateTimeFormatter?string({month:"2-digit"},"month"):this.num(dt.month,2);case"MMM":return month("short",!1);case"MMMM":return month("long",!1);case"MMMMM":return month("narrow",!1);case"y":return useDateTimeFormatter?string({year:"numeric"},"year"):this.num(dt.year);case"yy":return useDateTimeFormatter?string({year:"2-digit"},"year"):this.num(dt.year.toString().slice(-2),2);case"yyyy":return useDateTimeFormatter?string({year:"numeric"},"year"):this.num(dt.year,4);case"yyyyyy":return useDateTimeFormatter?string({year:"numeric"},"year"):this.num(dt.year,6);case"G":return era("short");case"GG":return era("long");case"GGGGG":return era("narrow");case"kk":return this.num(dt.weekYear.toString().slice(-2),2);case"kkkk":return this.num(dt.weekYear,4);case"W":return this.num(dt.weekNumber);case"WW":return this.num(dt.weekNumber,2);case"n":return this.num(dt.localWeekNumber);case"nn":return this.num(dt.localWeekNumber,2);case"ii":return this.num(dt.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(dt.localWeekYear,4);case"o":return this.num(dt.ordinal);case"ooo":return this.num(dt.ordinal,3);case"q":return this.num(dt.quarter);case"qq":return this.num(dt.quarter,2);case"X":return this.num(Math.floor(dt.ts/1e3));case"x":return this.num(dt.ts);default:return maybeMacro(token)}};return stringifyTokens(_Formatter.parseFormat(fmt),tokenToString)}formatDurationFromString(dur,fmt){let invertLargest=this.opts.signMode==="negativeLargestOnly"?-1:1,tokenToField=token=>{switch(token[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},tokenToString=(lildur,info)=>token=>{let mapped=tokenToField(token);if(mapped){let inversionFactor=info.isNegativeDuration&&mapped!==info.largestUnit?invertLargest:1,signDisplay;return this.opts.signMode==="negativeLargestOnly"&&mapped!==info.largestUnit?signDisplay="never":this.opts.signMode==="all"?signDisplay="always":signDisplay="auto",this.num(lildur.get(mapped)*inversionFactor,token.length,signDisplay)}else return token},tokens=_Formatter.parseFormat(fmt),realTokens=tokens.reduce((found,{literal,val})=>literal?found:found.concat(val),[]),collapsed=dur.shiftTo(...realTokens.map(tokenToField).filter(t=>t)),durationInfo={isNegativeDuration:collapsed<0,largestUnit:Object.keys(collapsed.values)[0]};return stringifyTokens(tokens,tokenToString(collapsed,durationInfo))}},ianaRegex=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function combineRegexes(...regexes){let full=regexes.reduce((f,r)=>f+r.source,"");return RegExp(`^${full}$`)}function combineExtractors(...extractors){return m=>extractors.reduce(([mergedVals,mergedZone,cursor],ex)=>{let[val,zone,next]=ex(m,cursor);return[{...mergedVals,...val},zone||mergedZone,next]},[{},null,1]).slice(0,2)}function parse2(s2,...patterns){if(s2==null)return[null,null];for(let[regex,extractor]of patterns){let m=regex.exec(s2);if(m)return extractor(m)}return[null,null]}function simpleParse(...keys){return(match2,cursor)=>{let ret={},i;for(i=0;i<keys.length;i++)ret[keys[i]]=parseInteger(match2[cursor+i]);return[ret,null,cursor+i]}}var offsetRegex=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,isoExtendedZone=`(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`,isoTimeBaseRegex=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,isoTimeRegex=RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`),isoTimeExtensionRegex=RegExp(`(?:[Tt]${isoTimeRegex.source})?`),isoYmdRegex=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,isoWeekRegex=/(\d{4})-?W(\d\d)(?:-?(\d))?/,isoOrdinalRegex=/(\d{4})-?(\d{3})/,extractISOWeekData=simpleParse("weekYear","weekNumber","weekDay"),extractISOOrdinalData=simpleParse("year","ordinal"),sqlYmdRegex=/(\d{4})-(\d\d)-(\d\d)/,sqlTimeRegex=RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`),sqlTimeExtensionRegex=RegExp(`(?: ${sqlTimeRegex.source})?`);function int(match2,pos,fallback){let m=match2[pos];return isUndefined(m)?fallback:parseInteger(m)}function extractISOYmd(match2,cursor){return[{year:int(match2,cursor),month:int(match2,cursor+1,1),day:int(match2,cursor+2,1)},null,cursor+3]}function extractISOTime(match2,cursor){return[{hours:int(match2,cursor,0),minutes:int(match2,cursor+1,0),seconds:int(match2,cursor+2,0),milliseconds:parseMillis(match2[cursor+3])},null,cursor+4]}function extractISOOffset(match2,cursor){let local=!match2[cursor]&&!match2[cursor+1],fullOffset=signedOffset(match2[cursor+1],match2[cursor+2]),zone=local?null:FixedOffsetZone.instance(fullOffset);return[{},zone,cursor+3]}function extractIANAZone(match2,cursor){let zone=match2[cursor]?IANAZone.create(match2[cursor]):null;return[{},zone,cursor+1]}var isoTimeOnly=RegExp(`^T?${isoTimeBaseRegex.source}$`),isoDuration=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function extractISODuration(match2){let[s2,yearStr,monthStr,weekStr,dayStr,hourStr,minuteStr,secondStr,millisecondsStr]=match2,hasNegativePrefix=s2[0]==="-",negativeSeconds=secondStr&&secondStr[0]==="-",maybeNegate=(num,force=!1)=>num!==void 0&&(force||num&&hasNegativePrefix)?-num:num;return[{years:maybeNegate(parseFloating(yearStr)),months:maybeNegate(parseFloating(monthStr)),weeks:maybeNegate(parseFloating(weekStr)),days:maybeNegate(parseFloating(dayStr)),hours:maybeNegate(parseFloating(hourStr)),minutes:maybeNegate(parseFloating(minuteStr)),seconds:maybeNegate(parseFloating(secondStr),secondStr==="-0"),milliseconds:maybeNegate(parseMillis(millisecondsStr),negativeSeconds)}]}var obsOffsets={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr){let result={year:yearStr.length===2?untruncateYear(parseInteger(yearStr)):parseInteger(yearStr),month:monthsShort.indexOf(monthStr)+1,day:parseInteger(dayStr),hour:parseInteger(hourStr),minute:parseInteger(minuteStr)};return secondStr&&(result.second=parseInteger(secondStr)),weekdayStr&&(result.weekday=weekdayStr.length>3?weekdaysLong.indexOf(weekdayStr)+1:weekdaysShort.indexOf(weekdayStr)+1),result}var rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(match2){let[,weekdayStr,dayStr,monthStr,yearStr,hourStr,minuteStr,secondStr,obsOffset,milOffset,offHourStr,offMinuteStr]=match2,result=fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr),offset2;return obsOffset?offset2=obsOffsets[obsOffset]:milOffset?offset2=0:offset2=signedOffset(offHourStr,offMinuteStr),[result,new FixedOffsetZone(offset2)]}function preprocessRFC2822(s2){return s2.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var rfc1123=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rfc850=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ascii=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(match2){let[,weekdayStr,dayStr,monthStr,yearStr,hourStr,minuteStr,secondStr]=match2;return[fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr),FixedOffsetZone.utcInstance]}function extractASCII(match2){let[,weekdayStr,monthStr,dayStr,hourStr,minuteStr,secondStr,yearStr]=match2;return[fromStrings(weekdayStr,yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr),FixedOffsetZone.utcInstance]}var isoYmdWithTimeExtensionRegex=combineRegexes(isoYmdRegex,isoTimeExtensionRegex),isoWeekWithTimeExtensionRegex=combineRegexes(isoWeekRegex,isoTimeExtensionRegex),isoOrdinalWithTimeExtensionRegex=combineRegexes(isoOrdinalRegex,isoTimeExtensionRegex),isoTimeCombinedRegex=combineRegexes(isoTimeRegex),extractISOYmdTimeAndOffset=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),extractISOWeekTimeAndOffset=combineExtractors(extractISOWeekData,extractISOTime,extractISOOffset,extractIANAZone),extractISOOrdinalDateAndTime=combineExtractors(extractISOOrdinalData,extractISOTime,extractISOOffset,extractIANAZone),extractISOTimeAndOffset=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseISODate(s2){return parse2(s2,[isoYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[isoWeekWithTimeExtensionRegex,extractISOWeekTimeAndOffset],[isoOrdinalWithTimeExtensionRegex,extractISOOrdinalDateAndTime],[isoTimeCombinedRegex,extractISOTimeAndOffset])}function parseRFC2822Date(s2){return parse2(preprocessRFC2822(s2),[rfc2822,extractRFC2822])}function parseHTTPDate(s2){return parse2(s2,[rfc1123,extractRFC1123Or850],[rfc850,extractRFC1123Or850],[ascii,extractASCII])}function parseISODuration(s2){return parse2(s2,[isoDuration,extractISODuration])}var extractISOTimeOnly=combineExtractors(extractISOTime);function parseISOTimeOnly(s2){return parse2(s2,[isoTimeOnly,extractISOTimeOnly])}var sqlYmdWithTimeExtensionRegex=combineRegexes(sqlYmdRegex,sqlTimeExtensionRegex),sqlTimeCombinedRegex=combineRegexes(sqlTimeRegex),extractISOTimeOffsetAndIANAZone=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(s2){return parse2(s2,[sqlYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[sqlTimeCombinedRegex,extractISOTimeOffsetAndIANAZone])}var INVALID$2="Invalid Duration",lowOrderMatrix={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},casualMatrix={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...lowOrderMatrix},daysInYearAccurate=146097/400,daysInMonthAccurate=146097/4800,accurateMatrix={years:{quarters:4,months:12,weeks:daysInYearAccurate/7,days:daysInYearAccurate,hours:daysInYearAccurate*24,minutes:daysInYearAccurate*24*60,seconds:daysInYearAccurate*24*60*60,milliseconds:daysInYearAccurate*24*60*60*1e3},quarters:{months:3,weeks:daysInYearAccurate/28,days:daysInYearAccurate/4,hours:daysInYearAccurate*24/4,minutes:daysInYearAccurate*24*60/4,seconds:daysInYearAccurate*24*60*60/4,milliseconds:daysInYearAccurate*24*60*60*1e3/4},months:{weeks:daysInMonthAccurate/7,days:daysInMonthAccurate,hours:daysInMonthAccurate*24,minutes:daysInMonthAccurate*24*60,seconds:daysInMonthAccurate*24*60*60,milliseconds:daysInMonthAccurate*24*60*60*1e3},...lowOrderMatrix},orderedUnits$1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],reverseUnits=orderedUnits$1.slice(0).reverse();function clone$1(dur,alts,clear=!1){let conf={values:clear?alts.values:{...dur.values,...alts.values||{}},loc:dur.loc.clone(alts.loc),conversionAccuracy:alts.conversionAccuracy||dur.conversionAccuracy,matrix:alts.matrix||dur.matrix};return new Duration(conf)}function durationToMillis(matrix,vals){var _vals$milliseconds;let sum=(_vals$milliseconds=vals.milliseconds)!=null?_vals$milliseconds:0;for(let unit of reverseUnits.slice(1))vals[unit]&&(sum+=vals[unit]*matrix[unit].milliseconds);return sum}function normalizeValues(matrix,vals){let factor=durationToMillis(matrix,vals)<0?-1:1;orderedUnits$1.reduceRight((previous,current)=>{if(isUndefined(vals[current]))return previous;if(previous){let previousVal=vals[previous]*factor,conv=matrix[current][previous],rollUp=Math.floor(previousVal/conv);vals[current]+=rollUp*factor,vals[previous]-=rollUp*conv*factor}return current},null),orderedUnits$1.reduce((previous,current)=>{if(isUndefined(vals[current]))return previous;if(previous){let fraction=vals[previous]%1;vals[previous]-=fraction,vals[current]+=fraction*matrix[previous][current]}return current},null)}function removeZeroes(vals){let newVals={};for(let[key,value]of Object.entries(vals))value!==0&&(newVals[key]=value);return newVals}var Duration=class _Duration{constructor(config){let accurate=config.conversionAccuracy==="longterm"||!1,matrix=accurate?accurateMatrix:casualMatrix;config.matrix&&(matrix=config.matrix),this.values=config.values,this.loc=config.loc||Locale.create(),this.conversionAccuracy=accurate?"longterm":"casual",this.invalid=config.invalid||null,this.matrix=matrix,this.isLuxonDuration=!0}static fromMillis(count,opts){return _Duration.fromObject({milliseconds:count},opts)}static fromObject(obj,opts={}){if(obj==null||typeof obj!="object")throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj===null?"null":typeof obj}`);return new _Duration({values:normalizeObject(obj,_Duration.normalizeUnit),loc:Locale.fromObject(opts),conversionAccuracy:opts.conversionAccuracy,matrix:opts.matrix})}static fromDurationLike(durationLike){if(isNumber(durationLike))return _Duration.fromMillis(durationLike);if(_Duration.isDuration(durationLike))return durationLike;if(typeof durationLike=="object")return _Duration.fromObject(durationLike);throw new InvalidArgumentError(`Unknown duration argument ${durationLike} of type ${typeof durationLike}`)}static fromISO(text,opts){let[parsed]=parseISODuration(text);return parsed?_Duration.fromObject(parsed,opts):_Duration.invalid("unparsable",`the input "${text}" can't be parsed as ISO 8601`)}static fromISOTime(text,opts){let[parsed]=parseISOTimeOnly(text);return parsed?_Duration.fromObject(parsed,opts):_Duration.invalid("unparsable",`the input "${text}" can't be parsed as ISO 8601`)}static invalid(reason,explanation=null){if(!reason)throw new InvalidArgumentError("need to specify a reason the Duration is invalid");let invalid=reason instanceof Invalid?reason:new Invalid(reason,explanation);if(Settings.throwOnInvalid)throw new InvalidDurationError(invalid);return new _Duration({invalid})}static normalizeUnit(unit){let normalized={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[unit&&unit.toLowerCase()];if(!normalized)throw new InvalidUnitError(unit);return normalized}static isDuration(o){return o&&o.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(fmt,opts={}){let fmtOpts={...opts,floor:opts.round!==!1&&opts.floor!==!1};return this.isValid?Formatter.create(this.loc,fmtOpts).formatDurationFromString(this,fmt):INVALID$2}toHuman(opts={}){if(!this.isValid)return INVALID$2;let showZeros=opts.showZeros!==!1,l2=orderedUnits$1.map(unit=>{let val=this.values[unit];return isUndefined(val)||val===0&&!showZeros?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...opts,unit:unit.slice(0,-1)}).format(val)}).filter(n2=>n2);return this.loc.listFormatter({type:"conjunction",style:opts.listStyle||"narrow",...opts}).format(l2)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let s2="P";return this.years!==0&&(s2+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(s2+=this.months+this.quarters*3+"M"),this.weeks!==0&&(s2+=this.weeks+"W"),this.days!==0&&(s2+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(s2+="T"),this.hours!==0&&(s2+=this.hours+"H"),this.minutes!==0&&(s2+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(s2+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),s2==="P"&&(s2+="T0S"),s2}toISOTime(opts={}){if(!this.isValid)return null;let millis=this.toMillis();return millis<0||millis>=864e5?null:(opts={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...opts,includeOffset:!1},DateTime.fromMillis(millis,{zone:"UTC"}).toISOTime(opts))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?durationToMillis(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(duration){if(!this.isValid)return this;let dur=_Duration.fromDurationLike(duration),result={};for(let k of orderedUnits$1)(hasOwnProperty(dur.values,k)||hasOwnProperty(this.values,k))&&(result[k]=dur.get(k)+this.get(k));return clone$1(this,{values:result},!0)}minus(duration){if(!this.isValid)return this;let dur=_Duration.fromDurationLike(duration);return this.plus(dur.negate())}mapUnits(fn){if(!this.isValid)return this;let result={};for(let k of Object.keys(this.values))result[k]=asNumber(fn(this.values[k],k));return clone$1(this,{values:result},!0)}get(unit){return this[_Duration.normalizeUnit(unit)]}set(values){if(!this.isValid)return this;let mixed={...this.values,...normalizeObject(values,_Duration.normalizeUnit)};return clone$1(this,{values:mixed})}reconfigure({locale,numberingSystem,conversionAccuracy,matrix}={}){let opts={loc:this.loc.clone({locale,numberingSystem}),matrix,conversionAccuracy};return clone$1(this,opts)}as(unit){return this.isValid?this.shiftTo(unit).get(unit):NaN}normalize(){if(!this.isValid)return this;let vals=this.toObject();return normalizeValues(this.matrix,vals),clone$1(this,{values:vals},!0)}rescale(){if(!this.isValid)return this;let vals=removeZeroes(this.normalize().shiftToAll().toObject());return clone$1(this,{values:vals},!0)}shiftTo(...units){if(!this.isValid)return this;if(units.length===0)return this;units=units.map(u=>_Duration.normalizeUnit(u));let built={},accumulated={},vals=this.toObject(),lastUnit;for(let k of orderedUnits$1)if(units.indexOf(k)>=0){lastUnit=k;let own=0;for(let ak in accumulated)own+=this.matrix[ak][k]*accumulated[ak],accumulated[ak]=0;isNumber(vals[k])&&(own+=vals[k]);let i=Math.trunc(own);built[k]=i,accumulated[k]=(own*1e3-i*1e3)/1e3}else isNumber(vals[k])&&(accumulated[k]=vals[k]);for(let key in accumulated)accumulated[key]!==0&&(built[lastUnit]+=key===lastUnit?accumulated[key]:accumulated[key]/this.matrix[lastUnit][key]);return normalizeValues(this.matrix,built),clone$1(this,{values:built},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let negated={};for(let k of Object.keys(this.values))negated[k]=this.values[k]===0?0:-this.values[k];return clone$1(this,{values:negated},!0)}removeZeros(){if(!this.isValid)return this;let vals=removeZeroes(this.values);return clone$1(this,{values:vals},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(other){if(!this.isValid||!other.isValid||!this.loc.equals(other.loc))return!1;function eq(v1,v2){return v1===void 0||v1===0?v2===void 0||v2===0:v1===v2}for(let u of orderedUnits$1)if(!eq(this.values[u],other.values[u]))return!1;return!0}},INVALID$1="Invalid Interval";function validateStartEnd(start,end){return!start||!start.isValid?Interval.invalid("missing or invalid start"):!end||!end.isValid?Interval.invalid("missing or invalid end"):end<start?Interval.invalid("end before start",`The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`):null}var Interval=class _Interval{constructor(config){this.s=config.start,this.e=config.end,this.invalid=config.invalid||null,this.isLuxonInterval=!0}static invalid(reason,explanation=null){if(!reason)throw new InvalidArgumentError("need to specify a reason the Interval is invalid");let invalid=reason instanceof Invalid?reason:new Invalid(reason,explanation);if(Settings.throwOnInvalid)throw new InvalidIntervalError(invalid);return new _Interval({invalid})}static fromDateTimes(start,end){let builtStart=friendlyDateTime(start),builtEnd=friendlyDateTime(end),validateError=validateStartEnd(builtStart,builtEnd);return validateError??new _Interval({start:builtStart,end:builtEnd})}static after(start,duration){let dur=Duration.fromDurationLike(duration),dt=friendlyDateTime(start);return _Interval.fromDateTimes(dt,dt.plus(dur))}static before(end,duration){let dur=Duration.fromDurationLike(duration),dt=friendlyDateTime(end);return _Interval.fromDateTimes(dt.minus(dur),dt)}static fromISO(text,opts){let[s2,e]=(text||"").split("/",2);if(s2&&e){let start,startIsValid;try{start=DateTime.fromISO(s2,opts),startIsValid=start.isValid}catch{startIsValid=!1}let end,endIsValid;try{end=DateTime.fromISO(e,opts),endIsValid=end.isValid}catch{endIsValid=!1}if(startIsValid&&endIsValid)return _Interval.fromDateTimes(start,end);if(startIsValid){let dur=Duration.fromISO(e,opts);if(dur.isValid)return _Interval.after(start,dur)}else if(endIsValid){let dur=Duration.fromISO(s2,opts);if(dur.isValid)return _Interval.before(end,dur)}}return _Interval.invalid("unparsable",`the input "${text}" can't be parsed as ISO 8601`)}static isInterval(o){return o&&o.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(unit="milliseconds"){return this.isValid?this.toDuration(unit).get(unit):NaN}count(unit="milliseconds",opts){if(!this.isValid)return NaN;let start=this.start.startOf(unit,opts),end;return opts!=null&&opts.useLocaleWeeks?end=this.end.reconfigure({locale:start.locale}):end=this.end,end=end.startOf(unit,opts),Math.floor(end.diff(start,unit).get(unit))+(end.valueOf()!==this.end.valueOf())}hasSame(unit){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,unit):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(dateTime){return this.isValid?this.s>dateTime:!1}isBefore(dateTime){return this.isValid?this.e<=dateTime:!1}contains(dateTime){return this.isValid?this.s<=dateTime&&this.e>dateTime:!1}set({start,end}={}){return this.isValid?_Interval.fromDateTimes(start||this.s,end||this.e):this}splitAt(...dateTimes){if(!this.isValid)return[];let sorted=dateTimes.map(friendlyDateTime).filter(d=>this.contains(d)).sort((a,b)=>a.toMillis()-b.toMillis()),results=[],{s:s2}=this,i=0;for(;s2<this.e;){let added=sorted[i]||this.e,next=+added>+this.e?this.e:added;results.push(_Interval.fromDateTimes(s2,next)),s2=next,i+=1}return results}splitBy(duration){let dur=Duration.fromDurationLike(duration);if(!this.isValid||!dur.isValid||dur.as("milliseconds")===0)return[];let{s:s2}=this,idx=1,next,results=[];for(;s2<this.e;){let added=this.start.plus(dur.mapUnits(x=>x*idx));next=+added>+this.e?this.e:added,results.push(_Interval.fromDateTimes(s2,next)),s2=next,idx+=1}return results}divideEqually(numberOfParts){return this.isValid?this.splitBy(this.length()/numberOfParts).slice(0,numberOfParts):[]}overlaps(other){return this.e>other.s&&this.s<other.e}abutsStart(other){return this.isValid?+this.e==+other.s:!1}abutsEnd(other){return this.isValid?+other.e==+this.s:!1}engulfs(other){return this.isValid?this.s<=other.s&&this.e>=other.e:!1}equals(other){return!this.isValid||!other.isValid?!1:this.s.equals(other.s)&&this.e.equals(other.e)}intersection(other){if(!this.isValid)return this;let s2=this.s>other.s?this.s:other.s,e=this.e<other.e?this.e:other.e;return s2>=e?null:_Interval.fromDateTimes(s2,e)}union(other){if(!this.isValid)return this;let s2=this.s<other.s?this.s:other.s,e=this.e>other.e?this.e:other.e;return _Interval.fromDateTimes(s2,e)}static merge(intervals){let[found,final]=intervals.sort((a,b)=>a.s-b.s).reduce(([sofar,current],item)=>current?current.overlaps(item)||current.abutsStart(item)?[sofar,current.union(item)]:[sofar.concat([current]),item]:[sofar,item],[[],null]);return final&&found.push(final),found}static xor(intervals){let start=null,currentCount=0,results=[],ends=intervals.map(i=>[{time:i.s,type:"s"},{time:i.e,type:"e"}]),flattened=Array.prototype.concat(...ends),arr=flattened.sort((a,b)=>a.time-b.time);for(let i of arr)currentCount+=i.type==="s"?1:-1,currentCount===1?start=i.time:(start&&+start!=+i.time&&results.push(_Interval.fromDateTimes(start,i.time)),start=null);return _Interval.merge(results)}difference(...intervals){return _Interval.xor([this].concat(intervals)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:INVALID$1}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(formatOpts=DATE_SHORT,opts={}){return this.isValid?Formatter.create(this.s.loc.clone(opts),formatOpts).formatInterval(this):INVALID$1}toISO(opts){return this.isValid?`${this.s.toISO(opts)}/${this.e.toISO(opts)}`:INVALID$1}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:INVALID$1}toISOTime(opts){return this.isValid?`${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`:INVALID$1}toFormat(dateFormat,{separator=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`:INVALID$1}toDuration(unit,opts){return this.isValid?this.e.diff(this.s,unit,opts):Duration.invalid(this.invalidReason)}mapEndpoints(mapFn){return _Interval.fromDateTimes(mapFn(this.s),mapFn(this.e))}},Info=class{static hasDST(zone=Settings.defaultZone){let proto=DateTime.now().setZone(zone).set({month:12});return!zone.isUniversal&&proto.offset!==proto.set({month:6}).offset}static isValidIANAZone(zone){return IANAZone.isValidZone(zone)}static normalizeZone(input){return normalizeZone(input,Settings.defaultZone)}static getStartOfWeek({locale=null,locObj=null}={}){return(locObj||Locale.create(locale)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale=null,locObj=null}={}){return(locObj||Locale.create(locale)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale=null,locObj=null}={}){return(locObj||Locale.create(locale)).getWeekendDays().slice()}static months(length="long",{locale=null,numberingSystem=null,locObj=null,outputCalendar="gregory"}={}){return(locObj||Locale.create(locale,numberingSystem,outputCalendar)).months(length)}static monthsFormat(length="long",{locale=null,numberingSystem=null,locObj=null,outputCalendar="gregory"}={}){return(locObj||Locale.create(locale,numberingSystem,outputCalendar)).months(length,!0)}static weekdays(length="long",{locale=null,numberingSystem=null,locObj=null}={}){return(locObj||Locale.create(locale,numberingSystem,null)).weekdays(length)}static weekdaysFormat(length="long",{locale=null,numberingSystem=null,locObj=null}={}){return(locObj||Locale.create(locale,numberingSystem,null)).weekdays(length,!0)}static meridiems({locale=null}={}){return Locale.create(locale).meridiems()}static eras(length="short",{locale=null}={}){return Locale.create(locale,null,"gregory").eras(length)}static features(){return{relative:hasRelative(),localeWeek:hasLocaleWeekInfo()}}};function dayDiff(earlier,later){let utcDayStart=dt=>dt.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),ms9=utcDayStart(later)-utcDayStart(earlier);return Math.floor(Duration.fromMillis(ms9).as("days"))}function highOrderDiffs(cursor,later,units){let differs=[["years",(a,b)=>b.year-a.year],["quarters",(a,b)=>b.quarter-a.quarter+(b.year-a.year)*4],["months",(a,b)=>b.month-a.month+(b.year-a.year)*12],["weeks",(a,b)=>{let days=dayDiff(a,b);return(days-days%7)/7}],["days",dayDiff]],results={},earlier=cursor,lowestOrder,highWater;for(let[unit,differ]of differs)units.indexOf(unit)>=0&&(lowestOrder=unit,results[unit]=differ(cursor,later),highWater=earlier.plus(results),highWater>later?(results[unit]--,cursor=earlier.plus(results),cursor>later&&(highWater=cursor,results[unit]--,cursor=earlier.plus(results))):cursor=highWater);return[cursor,results,highWater,lowestOrder]}function diff(earlier,later,units,opts){let[cursor,results,highWater,lowestOrder]=highOrderDiffs(earlier,later,units),remainingMillis=later-cursor,lowerOrderUnits=units.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);lowerOrderUnits.length===0&&(highWater<later&&(highWater=cursor.plus({[lowestOrder]:1})),highWater!==cursor&&(results[lowestOrder]=(results[lowestOrder]||0)+remainingMillis/(highWater-cursor)));let duration=Duration.fromObject(results,opts);return lowerOrderUnits.length>0?Duration.fromMillis(remainingMillis,opts).shiftTo(...lowerOrderUnits).plus(duration):duration}var MISSING_FTP="missing Intl.DateTimeFormat.formatToParts support";function intUnit(regex,post=i=>i){return{regex,deser:([s2])=>post(parseDigits(s2))}}var NBSP=String.fromCharCode(160),spaceOrNBSP=`[ ${NBSP}]`,spaceOrNBSPRegExp=new RegExp(spaceOrNBSP,"g");function fixListRegex(s2){return s2.replace(/\./g,"\\.?").replace(spaceOrNBSPRegExp,spaceOrNBSP)}function stripInsensitivities(s2){return s2.replace(/\./g,"").replace(spaceOrNBSPRegExp," ").toLowerCase()}function oneOf(strings,startIndex){return strings===null?null:{regex:RegExp(strings.map(fixListRegex).join("|")),deser:([s2])=>strings.findIndex(i=>stripInsensitivities(s2)===stripInsensitivities(i))+startIndex}}function offset(regex,groups){return{regex,deser:([,h,m])=>signedOffset(h,m),groups}}function simple(regex){return{regex,deser:([s2])=>s2}}function escapeToken(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function unitForToken(token,loc){let one=digitRegex(loc),two=digitRegex(loc,"{2}"),three=digitRegex(loc,"{3}"),four=digitRegex(loc,"{4}"),six=digitRegex(loc,"{6}"),oneOrTwo=digitRegex(loc,"{1,2}"),oneToThree=digitRegex(loc,"{1,3}"),oneToSix=digitRegex(loc,"{1,6}"),oneToNine=digitRegex(loc,"{1,9}"),twoToFour=digitRegex(loc,"{2,4}"),fourToSix=digitRegex(loc,"{4,6}"),literal=t=>({regex:RegExp(escapeToken(t.val)),deser:([s2])=>s2,literal:!0}),unit=(t=>{if(token.literal)return literal(t);switch(t.val){case"G":return oneOf(loc.eras("short"),0);case"GG":return oneOf(loc.eras("long"),0);case"y":return intUnit(oneToSix);case"yy":return intUnit(twoToFour,untruncateYear);case"yyyy":return intUnit(four);case"yyyyy":return intUnit(fourToSix);case"yyyyyy":return intUnit(six);case"M":return intUnit(oneOrTwo);case"MM":return intUnit(two);case"MMM":return oneOf(loc.months("short",!0),1);case"MMMM":return oneOf(loc.months("long",!0),1);case"L":return intUnit(oneOrTwo);case"LL":return intUnit(two);case"LLL":return oneOf(loc.months("short",!1),1);case"LLLL":return oneOf(loc.months("long",!1),1);case"d":return intUnit(oneOrTwo);case"dd":return intUnit(two);case"o":return intUnit(oneToThree);case"ooo":return intUnit(three);case"HH":return intUnit(two);case"H":return intUnit(oneOrTwo);case"hh":return intUnit(two);case"h":return intUnit(oneOrTwo);case"mm":return intUnit(two);case"m":return intUnit(oneOrTwo);case"q":return intUnit(oneOrTwo);case"qq":return intUnit(two);case"s":return intUnit(oneOrTwo);case"ss":return intUnit(two);case"S":return intUnit(oneToThree);case"SSS":return intUnit(three);case"u":return simple(oneToNine);case"uu":return simple(oneOrTwo);case"uuu":return intUnit(one);case"a":return oneOf(loc.meridiems(),0);case"kkkk":return intUnit(four);case"kk":return intUnit(twoToFour,untruncateYear);case"W":return intUnit(oneOrTwo);case"WW":return intUnit(two);case"E":case"c":return intUnit(one);case"EEE":return oneOf(loc.weekdays("short",!1),1);case"EEEE":return oneOf(loc.weekdays("long",!1),1);case"ccc":return oneOf(loc.weekdays("short",!0),1);case"cccc":return oneOf(loc.weekdays("long",!0),1);case"Z":case"ZZ":return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`),2);case"ZZZ":return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);case" ":return simple(/[^\S\n\r]/);default:return literal(t)}})(token)||{invalidReason:MISSING_FTP};return unit.token=token,unit}var partTypeStyleToTokenVal={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function tokenForPart(part,formatOpts,resolvedOpts){let{type,value}=part;if(type==="literal"){let isSpace=/^\s+$/.test(value);return{literal:!isSpace,val:isSpace?" ":value}}let style=formatOpts[type],actualType=type;type==="hour"&&(formatOpts.hour12!=null?actualType=formatOpts.hour12?"hour12":"hour24":formatOpts.hourCycle!=null?formatOpts.hourCycle==="h11"||formatOpts.hourCycle==="h12"?actualType="hour12":actualType="hour24":actualType=resolvedOpts.hour12?"hour12":"hour24");let val=partTypeStyleToTokenVal[actualType];if(typeof val=="object"&&(val=val[style]),val)return{literal:!1,val}}function buildRegex(units){return[`^${units.map(u=>u.regex).reduce((f,r)=>`${f}(${r.source})`,"")}$`,units]}function match(input,regex,handlers){let matches=input.match(regex);if(matches){let all={},matchIndex=1;for(let i in handlers)if(hasOwnProperty(handlers,i)){let h=handlers[i],groups=h.groups?h.groups+1:1;!h.literal&&h.token&&(all[h.token.val[0]]=h.deser(matches.slice(matchIndex,matchIndex+groups))),matchIndex+=groups}return[matches,all]}else return[matches,{}]}function dateTimeFromMatches(matches){let toField=token=>{switch(token){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},zone=null,specificOffset;return isUndefined(matches.z)||(zone=IANAZone.create(matches.z)),isUndefined(matches.Z)||(zone||(zone=new FixedOffsetZone(matches.Z)),specificOffset=matches.Z),isUndefined(matches.q)||(matches.M=(matches.q-1)*3+1),isUndefined(matches.h)||(matches.h<12&&matches.a===1?matches.h+=12:matches.h===12&&matches.a===0&&(matches.h=0)),matches.G===0&&matches.y&&(matches.y=-matches.y),isUndefined(matches.u)||(matches.S=parseMillis(matches.u)),[Object.keys(matches).reduce((r,k)=>{let f=toField(k);return f&&(r[f]=matches[k]),r},{}),zone,specificOffset]}var dummyDateTimeCache=null;function getDummyDateTime(){return dummyDateTimeCache||(dummyDateTimeCache=DateTime.fromMillis(1555555555555)),dummyDateTimeCache}function maybeExpandMacroToken(token,locale){if(token.literal)return token;let formatOpts=Formatter.macroTokenToFormatOpts(token.val),tokens=formatOptsToTokens(formatOpts,locale);return tokens==null||tokens.includes(void 0)?token:tokens}function expandMacroTokens(tokens,locale){return Array.prototype.concat(...tokens.map(t=>maybeExpandMacroToken(t,locale)))}var TokenParser=class{constructor(locale,format){if(this.locale=locale,this.format=format,this.tokens=expandMacroTokens(Formatter.parseFormat(format),locale),this.units=this.tokens.map(t=>unitForToken(t,locale)),this.disqualifyingUnit=this.units.find(t=>t.invalidReason),!this.disqualifyingUnit){let[regexString,handlers]=buildRegex(this.units);this.regex=RegExp(regexString,"i"),this.handlers=handlers}}explainFromTokens(input){if(this.isValid){let[rawMatches,matches]=match(input,this.regex,this.handlers),[result,zone,specificOffset]=matches?dateTimeFromMatches(matches):[null,null,void 0];if(hasOwnProperty(matches,"a")&&hasOwnProperty(matches,"H"))throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");return{input,tokens:this.tokens,regex:this.regex,rawMatches,matches,result,zone,specificOffset}}else return{input,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function explainFromTokens(locale,input,format){return new TokenParser(locale,format).explainFromTokens(input)}function parseFromTokens(locale,input,format){let{result,zone,specificOffset,invalidReason}=explainFromTokens(locale,input,format);return[result,zone,specificOffset,invalidReason]}function formatOptsToTokens(formatOpts,locale){if(!formatOpts)return null;let df=Formatter.create(locale,formatOpts).dtFormatter(getDummyDateTime()),parts=df.formatToParts(),resolvedOpts=df.resolvedOptions();return parts.map(p=>tokenForPart(p,formatOpts,resolvedOpts))}var INVALID="Invalid DateTime",MAX_DATE=864e13;function unsupportedZone(zone){return new Invalid("unsupported zone",`the zone "${zone.name}" is not supported`)}function possiblyCachedWeekData(dt){return dt.weekData===null&&(dt.weekData=gregorianToWeek(dt.c)),dt.weekData}function possiblyCachedLocalWeekData(dt){return dt.localWeekData===null&&(dt.localWeekData=gregorianToWeek(dt.c,dt.loc.getMinDaysInFirstWeek(),dt.loc.getStartOfWeek())),dt.localWeekData}function clone(inst,alts){let current={ts:inst.ts,zone:inst.zone,c:inst.c,o:inst.o,loc:inst.loc,invalid:inst.invalid};return new DateTime({...current,...alts,old:current})}function fixOffset(localTS,o,tz){let utcGuess=localTS-o*60*1e3,o2=tz.offset(utcGuess);if(o===o2)return[utcGuess,o];utcGuess-=(o2-o)*60*1e3;let o3=tz.offset(utcGuess);return o2===o3?[utcGuess,o2]:[localTS-Math.min(o2,o3)*60*1e3,Math.max(o2,o3)]}function tsToObj(ts,offset2){ts+=offset2*60*1e3;let d=new Date(ts);return{year:d.getUTCFullYear(),month:d.getUTCMonth()+1,day:d.getUTCDate(),hour:d.getUTCHours(),minute:d.getUTCMinutes(),second:d.getUTCSeconds(),millisecond:d.getUTCMilliseconds()}}function objToTS(obj,offset2,zone){return fixOffset(objToLocalTS(obj),offset2,zone)}function adjustTime(inst,dur){let oPre=inst.o,year=inst.c.year+Math.trunc(dur.years),month=inst.c.month+Math.trunc(dur.months)+Math.trunc(dur.quarters)*3,c={...inst.c,year,month,day:Math.min(inst.c.day,daysInMonth(year,month))+Math.trunc(dur.days)+Math.trunc(dur.weeks)*7},millisToAdd=Duration.fromObject({years:dur.years-Math.trunc(dur.years),quarters:dur.quarters-Math.trunc(dur.quarters),months:dur.months-Math.trunc(dur.months),weeks:dur.weeks-Math.trunc(dur.weeks),days:dur.days-Math.trunc(dur.days),hours:dur.hours,minutes:dur.minutes,seconds:dur.seconds,milliseconds:dur.milliseconds}).as("milliseconds"),localTS=objToLocalTS(c),[ts,o]=fixOffset(localTS,oPre,inst.zone);return millisToAdd!==0&&(ts+=millisToAdd,o=inst.zone.offset(ts)),{ts,o}}function parseDataToDateTime(parsed,parsedZone,opts,format,text,specificOffset){let{setZone,zone}=opts;if(parsed&&Object.keys(parsed).length!==0||parsedZone){let interpretationZone=parsedZone||zone,inst=DateTime.fromObject(parsed,{...opts,zone:interpretationZone,specificOffset});return setZone?inst:inst.setZone(zone)}else return DateTime.invalid(new Invalid("unparsable",`the input "${text}" can't be parsed as ${format}`))}function toTechFormat(dt,format,allowZ=!0){return dt.isValid?Formatter.create(Locale.create("en-US"),{allowZ,forceSimple:!0}).formatDateTimeFromString(dt,format):null}function toISODate(o,extended,precision){let longFormat=o.c.year>9999||o.c.year<0,c="";if(longFormat&&o.c.year>=0&&(c+="+"),c+=padStart(o.c.year,longFormat?6:4),precision==="year")return c;if(extended){if(c+="-",c+=padStart(o.c.month),precision==="month")return c;c+="-"}else if(c+=padStart(o.c.month),precision==="month")return c;return c+=padStart(o.c.day),c}function toISOTime(o,extended,suppressSeconds,suppressMilliseconds,includeOffset,extendedZone,precision){let showSeconds=!suppressSeconds||o.c.millisecond!==0||o.c.second!==0,c="";switch(precision){case"day":case"month":case"year":break;default:if(c+=padStart(o.c.hour),precision==="hour")break;if(extended){if(c+=":",c+=padStart(o.c.minute),precision==="minute")break;showSeconds&&(c+=":",c+=padStart(o.c.second))}else{if(c+=padStart(o.c.minute),precision==="minute")break;showSeconds&&(c+=padStart(o.c.second))}if(precision==="second")break;showSeconds&&(!suppressMilliseconds||o.c.millisecond!==0)&&(c+=".",c+=padStart(o.c.millisecond,3))}return includeOffset&&(o.isOffsetFixed&&o.offset===0&&!extendedZone?c+="Z":o.o<0?(c+="-",c+=padStart(Math.trunc(-o.o/60)),c+=":",c+=padStart(Math.trunc(-o.o%60))):(c+="+",c+=padStart(Math.trunc(o.o/60)),c+=":",c+=padStart(Math.trunc(o.o%60)))),extendedZone&&(c+="["+o.zone.ianaName+"]"),c}var defaultUnitValues={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},defaultWeekUnitValues={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},defaultOrdinalUnitValues={ordinal:1,hour:0,minute:0,second:0,millisecond:0},orderedUnits=["year","month","day","hour","minute","second","millisecond"],orderedWeekUnits=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],orderedOrdinalUnits=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(unit){let normalized={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[unit.toLowerCase()];if(!normalized)throw new InvalidUnitError(unit);return normalized}function normalizeUnitWithLocalWeeks(unit){switch(unit.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return normalizeUnit(unit)}}function guessOffsetForZone(zone){if(zoneOffsetTs===void 0&&(zoneOffsetTs=Settings.now()),zone.type!=="iana")return zone.offset(zoneOffsetTs);let zoneName=zone.name,offsetGuess=zoneOffsetGuessCache.get(zoneName);return offsetGuess===void 0&&(offsetGuess=zone.offset(zoneOffsetTs),zoneOffsetGuessCache.set(zoneName,offsetGuess)),offsetGuess}function quickDT(obj,opts){let zone=normalizeZone(opts.zone,Settings.defaultZone);if(!zone.isValid)return DateTime.invalid(unsupportedZone(zone));let loc=Locale.fromObject(opts),ts,o;if(isUndefined(obj.year))ts=Settings.now();else{for(let u of orderedUnits)isUndefined(obj[u])&&(obj[u]=defaultUnitValues[u]);let invalid=hasInvalidGregorianData(obj)||hasInvalidTimeData(obj);if(invalid)return DateTime.invalid(invalid);let offsetProvis=guessOffsetForZone(zone);[ts,o]=objToTS(obj,offsetProvis,zone)}return new DateTime({ts,zone,loc,o})}function diffRelative(start,end,opts){let round=isUndefined(opts.round)?!0:opts.round,rounding=isUndefined(opts.rounding)?"trunc":opts.rounding,format=(c,unit)=>(c=roundTo(c,round||opts.calendary?0:2,opts.calendary?"round":rounding),end.loc.clone(opts).relFormatter(opts).format(c,unit)),differ=unit=>opts.calendary?end.hasSame(start,unit)?0:end.startOf(unit).diff(start.startOf(unit),unit).get(unit):end.diff(start,unit).get(unit);if(opts.unit)return format(differ(opts.unit),opts.unit);for(let unit of opts.units){let count=differ(unit);if(Math.abs(count)>=1)return format(count,unit)}return format(start>end?-0:0,opts.units[opts.units.length-1])}function lastOpts(argList){let opts={},args;return argList.length>0&&typeof argList[argList.length-1]=="object"?(opts=argList[argList.length-1],args=Array.from(argList).slice(0,argList.length-1)):args=Array.from(argList),[opts,args]}var zoneOffsetTs,zoneOffsetGuessCache=new Map,DateTime=class _DateTime{constructor(config){let zone=config.zone||Settings.defaultZone,invalid=config.invalid||(Number.isNaN(config.ts)?new Invalid("invalid input"):null)||(zone.isValid?null:unsupportedZone(zone));this.ts=isUndefined(config.ts)?Settings.now():config.ts;let c=null,o=null;if(!invalid)if(config.old&&config.old.ts===this.ts&&config.old.zone.equals(zone))[c,o]=[config.old.c,config.old.o];else{let ot=isNumber(config.o)&&!config.old?config.o:zone.offset(this.ts);c=tsToObj(this.ts,ot),invalid=Number.isNaN(c.year)?new Invalid("invalid input"):null,c=invalid?null:c,o=invalid?null:ot}this._zone=zone,this.loc=config.loc||Locale.create(),this.invalid=invalid,this.weekData=null,this.localWeekData=null,this.c=c,this.o=o,this.isLuxonDateTime=!0}static now(){return new _DateTime({})}static local(){let[opts,args]=lastOpts(arguments),[year,month,day,hour,minute,second,millisecond]=args;return quickDT({year,month,day,hour,minute,second,millisecond},opts)}static utc(){let[opts,args]=lastOpts(arguments),[year,month,day,hour,minute,second,millisecond]=args;return opts.zone=FixedOffsetZone.utcInstance,quickDT({year,month,day,hour,minute,second,millisecond},opts)}static fromJSDate(date,options={}){let ts=isDate(date)?date.valueOf():NaN;if(Number.isNaN(ts))return _DateTime.invalid("invalid input");let zoneToUse=normalizeZone(options.zone,Settings.defaultZone);return zoneToUse.isValid?new _DateTime({ts,zone:zoneToUse,loc:Locale.fromObject(options)}):_DateTime.invalid(unsupportedZone(zoneToUse))}static fromMillis(milliseconds,options={}){if(isNumber(milliseconds))return milliseconds<-MAX_DATE||milliseconds>MAX_DATE?_DateTime.invalid("Timestamp out of range"):new _DateTime({ts:milliseconds,zone:normalizeZone(options.zone,Settings.defaultZone),loc:Locale.fromObject(options)});throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`)}static fromSeconds(seconds,options={}){if(isNumber(seconds))return new _DateTime({ts:seconds*1e3,zone:normalizeZone(options.zone,Settings.defaultZone),loc:Locale.fromObject(options)});throw new InvalidArgumentError("fromSeconds requires a numerical input")}static fromObject(obj,opts={}){obj=obj||{};let zoneToUse=normalizeZone(opts.zone,Settings.defaultZone);if(!zoneToUse.isValid)return _DateTime.invalid(unsupportedZone(zoneToUse));let loc=Locale.fromObject(opts),normalized=normalizeObject(obj,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek,startOfWeek}=usesLocalWeekValues(normalized,loc),tsNow=Settings.now(),offsetProvis=isUndefined(opts.specificOffset)?zoneToUse.offset(tsNow):opts.specificOffset,containsOrdinal=!isUndefined(normalized.ordinal),containsGregorYear=!isUndefined(normalized.year),containsGregorMD=!isUndefined(normalized.month)||!isUndefined(normalized.day),containsGregor=containsGregorYear||containsGregorMD,definiteWeekDef=normalized.weekYear||normalized.weekNumber;if((containsGregor||containsOrdinal)&&definiteWeekDef)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(containsGregorMD&&containsOrdinal)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");let useWeekData=definiteWeekDef||normalized.weekday&&!containsGregor,units,defaultValues,objNow=tsToObj(tsNow,offsetProvis);useWeekData?(units=orderedWeekUnits,defaultValues=defaultWeekUnitValues,objNow=gregorianToWeek(objNow,minDaysInFirstWeek,startOfWeek)):containsOrdinal?(units=orderedOrdinalUnits,defaultValues=defaultOrdinalUnitValues,objNow=gregorianToOrdinal(objNow)):(units=orderedUnits,defaultValues=defaultUnitValues);let foundFirst=!1;for(let u of units){let v=normalized[u];isUndefined(v)?foundFirst?normalized[u]=defaultValues[u]:normalized[u]=objNow[u]:foundFirst=!0}let higherOrderInvalid=useWeekData?hasInvalidWeekData(normalized,minDaysInFirstWeek,startOfWeek):containsOrdinal?hasInvalidOrdinalData(normalized):hasInvalidGregorianData(normalized),invalid=higherOrderInvalid||hasInvalidTimeData(normalized);if(invalid)return _DateTime.invalid(invalid);let gregorian=useWeekData?weekToGregorian(normalized,minDaysInFirstWeek,startOfWeek):containsOrdinal?ordinalToGregorian(normalized):normalized,[tsFinal,offsetFinal]=objToTS(gregorian,offsetProvis,zoneToUse),inst=new _DateTime({ts:tsFinal,zone:zoneToUse,o:offsetFinal,loc});return normalized.weekday&&containsGregor&&obj.weekday!==inst.weekday?_DateTime.invalid("mismatched weekday",`you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`):inst.isValid?inst:_DateTime.invalid(inst.invalid)}static fromISO(text,opts={}){let[vals,parsedZone]=parseISODate(text);return parseDataToDateTime(vals,parsedZone,opts,"ISO 8601",text)}static fromRFC2822(text,opts={}){let[vals,parsedZone]=parseRFC2822Date(text);return parseDataToDateTime(vals,parsedZone,opts,"RFC 2822",text)}static fromHTTP(text,opts={}){let[vals,parsedZone]=parseHTTPDate(text);return parseDataToDateTime(vals,parsedZone,opts,"HTTP",opts)}static fromFormat(text,fmt,opts={}){if(isUndefined(text)||isUndefined(fmt))throw new InvalidArgumentError("fromFormat requires an input string and a format");let{locale=null,numberingSystem=null}=opts,localeToUse=Locale.fromOpts({locale,numberingSystem,defaultToEN:!0}),[vals,parsedZone,specificOffset,invalid]=parseFromTokens(localeToUse,text,fmt);return invalid?_DateTime.invalid(invalid):parseDataToDateTime(vals,parsedZone,opts,`format ${fmt}`,text,specificOffset)}static fromString(text,fmt,opts={}){return _DateTime.fromFormat(text,fmt,opts)}static fromSQL(text,opts={}){let[vals,parsedZone]=parseSQL(text);return parseDataToDateTime(vals,parsedZone,opts,"SQL",text)}static invalid(reason,explanation=null){if(!reason)throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");let invalid=reason instanceof Invalid?reason:new Invalid(reason,explanation);if(Settings.throwOnInvalid)throw new InvalidDateTimeError(invalid);return new _DateTime({invalid})}static isDateTime(o){return o&&o.isLuxonDateTime||!1}static parseFormatForOpts(formatOpts,localeOpts={}){let tokenList=formatOptsToTokens(formatOpts,Locale.fromObject(localeOpts));return tokenList?tokenList.map(t=>t?t.val:null).join(""):null}static expandFormat(fmt,localeOpts={}){return expandMacroTokens(Formatter.parseFormat(fmt),Locale.fromObject(localeOpts)).map(t=>t.val).join("")}static resetCache(){zoneOffsetTs=void 0,zoneOffsetGuessCache.clear()}get(unit){return this[unit]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}get weekNumber(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}get weekday(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?possiblyCachedLocalWeekData(this).weekday:NaN}get localWeekNumber(){return this.isValid?possiblyCachedLocalWeekData(this).weekNumber:NaN}get localWeekYear(){return this.isValid?possiblyCachedLocalWeekData(this).weekYear:NaN}get ordinal(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}get monthShort(){return this.isValid?Info.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Info.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Info.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Info.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let dayMs=864e5,minuteMs=6e4,localTS=objToLocalTS(this.c),oEarlier=this.zone.offset(localTS-dayMs),oLater=this.zone.offset(localTS+dayMs),o1=this.zone.offset(localTS-oEarlier*minuteMs),o2=this.zone.offset(localTS-oLater*minuteMs);if(o1===o2)return[this];let ts1=localTS-o1*minuteMs,ts2=localTS-o2*minuteMs,c1=tsToObj(ts1,o1),c2=tsToObj(ts2,o2);return c1.hour===c2.hour&&c1.minute===c2.minute&&c1.second===c2.second&&c1.millisecond===c2.millisecond?[clone(this,{ts:ts1}),clone(this,{ts:ts2})]:[this]}get isInLeapYear(){return isLeapYear(this.year)}get daysInMonth(){return daysInMonth(this.year,this.month)}get daysInYear(){return this.isValid?daysInYear(this.year):NaN}get weeksInWeekYear(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?weeksInWeekYear(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(opts={}){let{locale,numberingSystem,calendar}=Formatter.create(this.loc.clone(opts),opts).resolvedOptions(this);return{locale,numberingSystem,outputCalendar:calendar}}toUTC(offset2=0,opts={}){return this.setZone(FixedOffsetZone.instance(offset2),opts)}toLocal(){return this.setZone(Settings.defaultZone)}setZone(zone,{keepLocalTime=!1,keepCalendarTime=!1}={}){if(zone=normalizeZone(zone,Settings.defaultZone),zone.equals(this.zone))return this;if(zone.isValid){let newTS=this.ts;if(keepLocalTime||keepCalendarTime){let offsetGuess=zone.offset(this.ts),asObj=this.toObject();[newTS]=objToTS(asObj,offsetGuess,zone)}return clone(this,{ts:newTS,zone})}else return _DateTime.invalid(unsupportedZone(zone))}reconfigure({locale,numberingSystem,outputCalendar}={}){let loc=this.loc.clone({locale,numberingSystem,outputCalendar});return clone(this,{loc})}setLocale(locale){return this.reconfigure({locale})}set(values){if(!this.isValid)return this;let normalized=normalizeObject(values,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek,startOfWeek}=usesLocalWeekValues(normalized,this.loc),settingWeekStuff=!isUndefined(normalized.weekYear)||!isUndefined(normalized.weekNumber)||!isUndefined(normalized.weekday),containsOrdinal=!isUndefined(normalized.ordinal),containsGregorYear=!isUndefined(normalized.year),containsGregorMD=!isUndefined(normalized.month)||!isUndefined(normalized.day),containsGregor=containsGregorYear||containsGregorMD,definiteWeekDef=normalized.weekYear||normalized.weekNumber;if((containsGregor||containsOrdinal)&&definiteWeekDef)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(containsGregorMD&&containsOrdinal)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");let mixed;settingWeekStuff?mixed=weekToGregorian({...gregorianToWeek(this.c,minDaysInFirstWeek,startOfWeek),...normalized},minDaysInFirstWeek,startOfWeek):isUndefined(normalized.ordinal)?(mixed={...this.toObject(),...normalized},isUndefined(normalized.day)&&(mixed.day=Math.min(daysInMonth(mixed.year,mixed.month),mixed.day))):mixed=ordinalToGregorian({...gregorianToOrdinal(this.c),...normalized});let[ts,o]=objToTS(mixed,this.o,this.zone);return clone(this,{ts,o})}plus(duration){if(!this.isValid)return this;let dur=Duration.fromDurationLike(duration);return clone(this,adjustTime(this,dur))}minus(duration){if(!this.isValid)return this;let dur=Duration.fromDurationLike(duration).negate();return clone(this,adjustTime(this,dur))}startOf(unit,{useLocaleWeeks=!1}={}){if(!this.isValid)return this;let o={},normalizedUnit=Duration.normalizeUnit(unit);switch(normalizedUnit){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(normalizedUnit==="weeks")if(useLocaleWeeks){let startOfWeek=this.loc.getStartOfWeek(),{weekday}=this;weekday<startOfWeek&&(o.weekNumber=this.weekNumber-1),o.weekday=startOfWeek}else o.weekday=1;if(normalizedUnit==="quarters"){let q=Math.ceil(this.month/3);o.month=(q-1)*3+1}return this.set(o)}endOf(unit,opts){return this.isValid?this.plus({[unit]:1}).startOf(unit,opts).minus(1):this}toFormat(fmt,opts={}){return this.isValid?Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this,fmt):INVALID}toLocaleString(formatOpts=DATE_SHORT,opts={}){return this.isValid?Formatter.create(this.loc.clone(opts),formatOpts).formatDateTime(this):INVALID}toLocaleParts(opts={}){return this.isValid?Formatter.create(this.loc.clone(opts),opts).formatDateTimeParts(this):[]}toISO({format="extended",suppressSeconds=!1,suppressMilliseconds=!1,includeOffset=!0,extendedZone=!1,precision="milliseconds"}={}){if(!this.isValid)return null;precision=normalizeUnit(precision);let ext=format==="extended",c=toISODate(this,ext,precision);return orderedUnits.indexOf(precision)>=3&&(c+="T"),c+=toISOTime(this,ext,suppressSeconds,suppressMilliseconds,includeOffset,extendedZone,precision),c}toISODate({format="extended",precision="day"}={}){return this.isValid?toISODate(this,format==="extended",normalizeUnit(precision)):null}toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds=!1,suppressSeconds=!1,includeOffset=!0,includePrefix=!1,extendedZone=!1,format="extended",precision="milliseconds"}={}){return this.isValid?(precision=normalizeUnit(precision),(includePrefix&&orderedUnits.indexOf(precision)>=3?"T":"")+toISOTime(this,format==="extended",suppressSeconds,suppressMilliseconds,includeOffset,extendedZone,precision)):null}toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?toISODate(this,!0):null}toSQLTime({includeOffset=!0,includeZone=!1,includeOffsetSpace=!0}={}){let fmt="HH:mm:ss.SSS";return(includeZone||includeOffset)&&(includeOffsetSpace&&(fmt+=" "),includeZone?fmt+="z":includeOffset&&(fmt+="ZZ")),toTechFormat(this,fmt,!0)}toSQL(opts={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(opts)}`:null}toString(){return this.isValid?this.toISO():INVALID}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(opts={}){if(!this.isValid)return{};let base={...this.c};return opts.includeConfig&&(base.outputCalendar=this.outputCalendar,base.numberingSystem=this.loc.numberingSystem,base.locale=this.loc.locale),base}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(otherDateTime,unit="milliseconds",opts={}){if(!this.isValid||!otherDateTime.isValid)return Duration.invalid("created by diffing an invalid DateTime");let durOpts={locale:this.locale,numberingSystem:this.numberingSystem,...opts},units=maybeArray(unit).map(Duration.normalizeUnit),otherIsLater=otherDateTime.valueOf()>this.valueOf(),earlier=otherIsLater?this:otherDateTime,later=otherIsLater?otherDateTime:this,diffed=diff(earlier,later,units,durOpts);return otherIsLater?diffed.negate():diffed}diffNow(unit="milliseconds",opts={}){return this.diff(_DateTime.now(),unit,opts)}until(otherDateTime){return this.isValid?Interval.fromDateTimes(this,otherDateTime):this}hasSame(otherDateTime,unit,opts){if(!this.isValid)return!1;let inputMs=otherDateTime.valueOf(),adjustedToZone=this.setZone(otherDateTime.zone,{keepLocalTime:!0});return adjustedToZone.startOf(unit,opts)<=inputMs&&inputMs<=adjustedToZone.endOf(unit,opts)}equals(other){return this.isValid&&other.isValid&&this.valueOf()===other.valueOf()&&this.zone.equals(other.zone)&&this.loc.equals(other.loc)}toRelative(options={}){if(!this.isValid)return null;let base=options.base||_DateTime.fromObject({},{zone:this.zone}),padding=options.padding?this<base?-options.padding:options.padding:0,units=["years","months","days","hours","minutes","seconds"],unit=options.unit;return Array.isArray(options.unit)&&(units=options.unit,unit=void 0),diffRelative(base,this.plus(padding),{...options,numeric:"always",units,unit})}toRelativeCalendar(options={}){return this.isValid?diffRelative(options.base||_DateTime.fromObject({},{zone:this.zone}),this,{...options,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...dateTimes){if(!dateTimes.every(_DateTime.isDateTime))throw new InvalidArgumentError("min requires all arguments be DateTimes");return bestBy(dateTimes,i=>i.valueOf(),Math.min)}static max(...dateTimes){if(!dateTimes.every(_DateTime.isDateTime))throw new InvalidArgumentError("max requires all arguments be DateTimes");return bestBy(dateTimes,i=>i.valueOf(),Math.max)}static fromFormatExplain(text,fmt,options={}){let{locale=null,numberingSystem=null}=options,localeToUse=Locale.fromOpts({locale,numberingSystem,defaultToEN:!0});return explainFromTokens(localeToUse,text,fmt)}static fromStringExplain(text,fmt,options={}){return _DateTime.fromFormatExplain(text,fmt,options)}static buildFormatParser(fmt,options={}){let{locale=null,numberingSystem=null}=options,localeToUse=Locale.fromOpts({locale,numberingSystem,defaultToEN:!0});return new TokenParser(localeToUse,fmt)}static fromFormatParser(text,formatParser,opts={}){if(isUndefined(text)||isUndefined(formatParser))throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser");let{locale=null,numberingSystem=null}=opts,localeToUse=Locale.fromOpts({locale,numberingSystem,defaultToEN:!0});if(!localeToUse.equals(formatParser.locale))throw new InvalidArgumentError(`fromFormatParser called with a locale of ${localeToUse}, but the format parser was created for ${formatParser.locale}`);let{result,zone,specificOffset,invalidReason}=formatParser.explainFromTokens(text);return invalidReason?_DateTime.invalid(invalidReason):parseDataToDateTime(result,zone,opts,`format ${formatParser.format}`,text,specificOffset)}static get DATE_SHORT(){return DATE_SHORT}static get DATE_MED(){return DATE_MED}static get DATE_MED_WITH_WEEKDAY(){return DATE_MED_WITH_WEEKDAY}static get DATE_FULL(){return DATE_FULL}static get DATE_HUGE(){return DATE_HUGE}static get TIME_SIMPLE(){return TIME_SIMPLE}static get TIME_WITH_SECONDS(){return TIME_WITH_SECONDS}static get TIME_WITH_SHORT_OFFSET(){return TIME_WITH_SHORT_OFFSET}static get TIME_WITH_LONG_OFFSET(){return TIME_WITH_LONG_OFFSET}static get TIME_24_SIMPLE(){return TIME_24_SIMPLE}static get TIME_24_WITH_SECONDS(){return TIME_24_WITH_SECONDS}static get TIME_24_WITH_SHORT_OFFSET(){return TIME_24_WITH_SHORT_OFFSET}static get TIME_24_WITH_LONG_OFFSET(){return TIME_24_WITH_LONG_OFFSET}static get DATETIME_SHORT(){return DATETIME_SHORT}static get DATETIME_SHORT_WITH_SECONDS(){return DATETIME_SHORT_WITH_SECONDS}static get DATETIME_MED(){return DATETIME_MED}static get DATETIME_MED_WITH_SECONDS(){return DATETIME_MED_WITH_SECONDS}static get DATETIME_MED_WITH_WEEKDAY(){return DATETIME_MED_WITH_WEEKDAY}static get DATETIME_FULL(){return DATETIME_FULL}static get DATETIME_FULL_WITH_SECONDS(){return DATETIME_FULL_WITH_SECONDS}static get DATETIME_HUGE(){return DATETIME_HUGE}static get DATETIME_HUGE_WITH_SECONDS(){return DATETIME_HUGE_WITH_SECONDS}};function friendlyDateTime(dateTimeish){if(DateTime.isDateTime(dateTimeish))return dateTimeish;if(dateTimeish&&dateTimeish.valueOf&&isNumber(dateTimeish.valueOf()))return DateTime.fromJSDate(dateTimeish);if(dateTimeish&&typeof dateTimeish=="object")return DateTime.fromObject(dateTimeish);throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`)}var VERSION="3.7.2";exports.DateTime=DateTime;exports.Duration=Duration;exports.FixedOffsetZone=FixedOffsetZone;exports.IANAZone=IANAZone;exports.Info=Info;exports.Interval=Interval;exports.InvalidZone=InvalidZone;exports.Settings=Settings;exports.SystemZone=SystemZone;exports.VERSION=VERSION;exports.Zone=Zone}});var require_CronDate=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/CronDate.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronDate=exports.DAYS_IN_MONTH=exports.DateMathOp=exports.TimeUnit=void 0;var luxon_1=require_luxon(),TimeUnit;(function(TimeUnit2){TimeUnit2.Second="Second",TimeUnit2.Minute="Minute",TimeUnit2.Hour="Hour",TimeUnit2.Day="Day",TimeUnit2.Month="Month",TimeUnit2.Year="Year"})(TimeUnit||(exports.TimeUnit=TimeUnit={}));var DateMathOp;(function(DateMathOp2){DateMathOp2.Add="Add",DateMathOp2.Subtract="Subtract"})(DateMathOp||(exports.DateMathOp=DateMathOp={}));exports.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var CronDate=class _CronDate{#date;#dstStart=null;#dstEnd=null;#verbMap={add:{[TimeUnit.Year]:this.addYear.bind(this),[TimeUnit.Month]:this.addMonth.bind(this),[TimeUnit.Day]:this.addDay.bind(this),[TimeUnit.Hour]:this.addHour.bind(this),[TimeUnit.Minute]:this.addMinute.bind(this),[TimeUnit.Second]:this.addSecond.bind(this)},subtract:{[TimeUnit.Year]:this.subtractYear.bind(this),[TimeUnit.Month]:this.subtractMonth.bind(this),[TimeUnit.Day]:this.subtractDay.bind(this),[TimeUnit.Hour]:this.subtractHour.bind(this),[TimeUnit.Minute]:this.subtractMinute.bind(this),[TimeUnit.Second]:this.subtractSecond.bind(this)}};constructor(timestamp,tz){let dateOpts={zone:tz};if(timestamp?timestamp instanceof _CronDate?(this.#date=timestamp.#date,this.#dstStart=timestamp.#dstStart,this.#dstEnd=timestamp.#dstEnd):timestamp instanceof Date?this.#date=luxon_1.DateTime.fromJSDate(timestamp,dateOpts):typeof timestamp=="number"?this.#date=luxon_1.DateTime.fromMillis(timestamp,dateOpts):(this.#date=luxon_1.DateTime.fromISO(timestamp,dateOpts),this.#date.isValid||(this.#date=luxon_1.DateTime.fromRFC2822(timestamp,dateOpts)),this.#date.isValid||(this.#date=luxon_1.DateTime.fromSQL(timestamp,dateOpts)),this.#date.isValid||(this.#date=luxon_1.DateTime.fromFormat(timestamp,"EEE, d MMM yyyy HH:mm:ss",dateOpts))):this.#date=luxon_1.DateTime.local(),!this.#date.isValid)throw new Error(`CronDate: unhandled timestamp: ${timestamp}`);tz&&tz!==this.#date.zoneName&&(this.#date=this.#date.setZone(tz))}static#isLeapYear(year){return year%4===0&&year%100!==0||year%400===0}get dstStart(){return this.#dstStart}set dstStart(value){this.#dstStart=value}get dstEnd(){return this.#dstEnd}set dstEnd(value){this.#dstEnd=value}addYear(){this.#date=this.#date.plus({years:1})}addMonth(){this.#date=this.#date.plus({months:1}).startOf("month")}addDay(){this.#date=this.#date.plus({days:1}).startOf("day")}addHour(){this.#date=this.#date.plus({hours:1}).startOf("hour")}addMinute(){this.#date=this.#date.plus({minutes:1}).startOf("minute")}addSecond(){this.#date=this.#date.plus({seconds:1})}subtractYear(){this.#date=this.#date.minus({years:1})}subtractMonth(){this.#date=this.#date.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#date=this.#date.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#date=this.#date.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#date=this.#date.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#date=this.#date.minus({seconds:1})}addUnit(unit){this.#verbMap.add[unit]()}subtractUnit(unit){this.#verbMap.subtract[unit]()}invokeDateOperation(verb,unit){if(verb===DateMathOp.Add){this.addUnit(unit);return}if(verb===DateMathOp.Subtract){this.subtractUnit(unit);return}throw new Error(`Invalid verb: ${verb}`)}getDate(){return this.#date.day}getFullYear(){return this.#date.year}getDay(){let weekday=this.#date.weekday;return weekday===7?0:weekday}getMonth(){return this.#date.month-1}getHours(){return this.#date.hour}getMinutes(){return this.#date.minute}getSeconds(){return this.#date.second}getMilliseconds(){return this.#date.millisecond}getTime(){return this.#date.valueOf()}getUTCDate(){return this.#getUTC().day}getUTCFullYear(){return this.#getUTC().year}getUTCDay(){let weekday=this.#getUTC().weekday;return weekday===7?0:weekday}getUTCMonth(){return this.#getUTC().month-1}getUTCHours(){return this.#getUTC().hour}getUTCMinutes(){return this.#getUTC().minute}getUTCSeconds(){return this.#getUTC().second}toISOString(){return this.#date.toUTC().toISO()}toJSON(){return this.#date.toJSON()}setDate(d){this.#date=this.#date.set({day:d})}setFullYear(y){this.#date=this.#date.set({year:y})}setDay(d){this.#date=this.#date.set({weekday:d})}setMonth(m){this.#date=this.#date.set({month:m+1})}setHours(h){this.#date=this.#date.set({hour:h})}setMinutes(m){this.#date=this.#date.set({minute:m})}setSeconds(s){this.#date=this.#date.set({second:s})}setMilliseconds(s){this.#date=this.#date.set({millisecond:s})}toString(){return this.toDate().toString()}toDate(){return this.#date.toJSDate()}isLastDayOfMonth(){let{day,month}=this.#date;if(month===2){let isLeap=_CronDate.#isLeapYear(this.#date.year);return day===exports.DAYS_IN_MONTH[month-1]-(isLeap?0:1)}return day===exports.DAYS_IN_MONTH[month-1]}isLastWeekdayOfMonth(){let{day,month}=this.#date,lastDay;return month===2?lastDay=exports.DAYS_IN_MONTH[month-1]-(_CronDate.#isLeapYear(this.#date.year)?0:1):lastDay=exports.DAYS_IN_MONTH[month-1],day>lastDay-7}applyDateOperation(op,unit,hoursLength){if(unit===TimeUnit.Month||unit===TimeUnit.Day){this.invokeDateOperation(op,unit);return}let previousHour=this.getHours();this.invokeDateOperation(op,unit);let currentHour=this.getHours(),diff=currentHour-previousHour;diff===2?hoursLength!==24&&(this.dstStart=currentHour):diff===0&&this.getMinutes()===0&&this.getSeconds()===0&&hoursLength!==24&&(this.dstEnd=currentHour)}#getUTC(){return this.#date.toUTC()}};exports.CronDate=CronDate;exports.default=CronDate}});var require_CronMonth=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronMonth.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronMonth=void 0;var CronDate_1=require_CronDate(),CronField_1=require_CronField(),MIN_MONTH=1,MAX_MONTH=12,MONTH_CHARS=Object.freeze([]),CronMonth=class extends CronField_1.CronField{static get min(){return MIN_MONTH}static get max(){return MAX_MONTH}static get chars(){return MONTH_CHARS}static get daysInMonth(){return CronDate_1.DAYS_IN_MONTH}constructor(values,options){super(values,options),this.validate()}get values(){return super.values}};exports.CronMonth=CronMonth}});var require_CronSecond=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/CronSecond.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronSecond=void 0;var CronField_1=require_CronField(),MIN_SECOND=0,MAX_SECOND=59,SECOND_CHARS=Object.freeze([]),CronSecond=class extends CronField_1.CronField{static get min(){return MIN_SECOND}static get max(){return MAX_SECOND}static get chars(){return SECOND_CHARS}constructor(values,options){super(values,options),this.validate()}get values(){return super.values}};exports.CronSecond=CronSecond}});var require_fields=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/fields/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});__exportStar(require_types(),exports);__exportStar(require_CronDayOfMonth(),exports);__exportStar(require_CronDayOfWeek(),exports);__exportStar(require_CronField(),exports);__exportStar(require_CronHour(),exports);__exportStar(require_CronMinute(),exports);__exportStar(require_CronMonth(),exports);__exportStar(require_CronSecond(),exports)}});var require_CronFieldCollection=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/CronFieldCollection.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronFieldCollection=void 0;var fields_1=require_fields(),CronFieldCollection=class _CronFieldCollection{#second;#minute;#hour;#dayOfMonth;#month;#dayOfWeek;static from(base,fields){return new _CronFieldCollection({second:this.resolveField(fields_1.CronSecond,base.second,fields.second),minute:this.resolveField(fields_1.CronMinute,base.minute,fields.minute),hour:this.resolveField(fields_1.CronHour,base.hour,fields.hour),dayOfMonth:this.resolveField(fields_1.CronDayOfMonth,base.dayOfMonth,fields.dayOfMonth),month:this.resolveField(fields_1.CronMonth,base.month,fields.month),dayOfWeek:this.resolveField(fields_1.CronDayOfWeek,base.dayOfWeek,fields.dayOfWeek)})}static resolveField(constructor,baseField,fieldValue){return fieldValue?fieldValue instanceof fields_1.CronField?fieldValue:new constructor(fieldValue):baseField}constructor({second,minute,hour,dayOfMonth,month,dayOfWeek}){if(!second)throw new Error("Validation error, Field second is missing");if(!minute)throw new Error("Validation error, Field minute is missing");if(!hour)throw new Error("Validation error, Field hour is missing");if(!dayOfMonth)throw new Error("Validation error, Field dayOfMonth is missing");if(!month)throw new Error("Validation error, Field month is missing");if(!dayOfWeek)throw new Error("Validation error, Field dayOfWeek is missing");if(month.values.length===1&&!dayOfMonth.hasLastChar&&!(parseInt(dayOfMonth.values[0],10)<=fields_1.CronMonth.daysInMonth[month.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#second=second,this.#minute=minute,this.#hour=hour,this.#month=month,this.#dayOfWeek=dayOfWeek,this.#dayOfMonth=dayOfMonth}get second(){return this.#second}get minute(){return this.#minute}get hour(){return this.#hour}get dayOfMonth(){return this.#dayOfMonth}get month(){return this.#month}get dayOfWeek(){return this.#dayOfWeek}static compactField(input){if(input.length===0)return[];let output=[],current;return input.forEach((item,i,arr)=>{if(current===void 0){current={start:item,count:1};return}let prevItem=arr[i-1]||current.start,nextItem=arr[i+1];if(item==="L"||item==="W"){output.push(current),output.push({start:item,count:1}),current=void 0;return}if(current.step===void 0&&nextItem!==void 0){let step=item-prevItem,nextStep=nextItem-item;if(step<=nextStep){current={...current,count:2,end:item,step};return}current.step=1}item-(current.end??0)===current.step?(current.count++,current.end=item):(current.count===1?output.push({start:current.start,count:1}):current.count===2?(output.push({start:current.start,count:1}),output.push({start:current.end??prevItem,count:1})):output.push(current),current={start:item,count:1})}),current&&output.push(current),output}static#handleSingleRange(field,range,max){let step=range.step;return step?step===1&&range.start===field.min&&range.end&&range.end>=max?field.hasQuestionMarkChar?"?":"*":step!==1&&range.start===field.min&&range.end&&range.end>=max-step+1?`*/${step}`:null:null}static#handleMultipleRanges(range,max){let step=range.step;if(step===1)return`${range.start}-${range.end}`;let multiplier=range.start===0?range.count-1:range.count;if(!step)throw new Error("Unexpected range step");if(!range.end)throw new Error("Unexpected range end");if(step*multiplier>range.end){let mapFn=(_,index)=>{if(typeof range.start!="number")throw new Error("Unexpected range start");return index%step===0?range.start+index:null};if(typeof range.start!="number")throw new Error("Unexpected range start");let seed={length:range.end-range.start+1};return Array.from(seed,mapFn).filter(value=>value!==null).join(",")}return range.end===max-step+1?`${range.start}/${step}`:`${range.start}-${range.end}/${step}`}stringifyField(field){let max=field.max,values=field.values;if(field instanceof fields_1.CronDayOfWeek){max=6;let dayOfWeek=this.#dayOfWeek.values;values=dayOfWeek[dayOfWeek.length-1]===7?dayOfWeek.slice(0,-1):dayOfWeek}field instanceof fields_1.CronDayOfMonth&&(max=this.#month.values.length===1?fields_1.CronMonth.daysInMonth[this.#month.values[0]-1]:field.max);let ranges=_CronFieldCollection.compactField(values);if(ranges.length===1){let singleRangeResult=_CronFieldCollection.#handleSingleRange(field,ranges[0],max);if(singleRangeResult)return singleRangeResult}return ranges.map(range=>{let value=range.count===1?range.start.toString():_CronFieldCollection.#handleMultipleRanges(range,max);return field instanceof fields_1.CronDayOfWeek&&field.nthDay>0?`${value}#${field.nthDay}`:value}).join(",")}stringify(includeSeconds=!1){let arr=[];return includeSeconds&&arr.push(this.stringifyField(this.#second)),arr.push(this.stringifyField(this.#minute),this.stringifyField(this.#hour),this.stringifyField(this.#dayOfMonth),this.stringifyField(this.#month),this.stringifyField(this.#dayOfWeek)),arr.join(" ")}serialize(){return{second:this.#second.serialize(),minute:this.#minute.serialize(),hour:this.#hour.serialize(),dayOfMonth:this.#dayOfMonth.serialize(),month:this.#month.serialize(),dayOfWeek:this.#dayOfWeek.serialize()}}};exports.CronFieldCollection=CronFieldCollection}});var require_CronExpression=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/CronExpression.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronExpression=exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var CronDate_1=require_CronDate();exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range";exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";var LOOP_LIMIT=1e4,CronExpression=class _CronExpression{#options;#tz;#currentDate;#startDate;#endDate;#fields;constructor(fields,options){this.#options=options,this.#tz=options.tz,this.#startDate=options.startDate?new CronDate_1.CronDate(options.startDate,this.#tz):null,this.#endDate=options.endDate?new CronDate_1.CronDate(options.endDate,this.#tz):null;let currentDateValue=options.currentDate??options.startDate;if(currentDateValue){let tempCurrentDate=new CronDate_1.CronDate(currentDateValue,this.#tz);this.#startDate&&tempCurrentDate.getTime()<this.#startDate.getTime()?currentDateValue=this.#startDate:this.#endDate&&tempCurrentDate.getTime()>this.#endDate.getTime()&&(currentDateValue=this.#endDate)}this.#currentDate=new CronDate_1.CronDate(currentDateValue,this.#tz),this.#fields=fields}get fields(){return this.#fields}static fieldsToExpression(fields,options){return new _CronExpression(fields,options||{})}static#matchSchedule(value,sequence){return sequence.some(element=>element===value)}static#isLastWeekdayOfMonthMatch(expressions,currentDate){let isLastWeekdayOfMonth=currentDate.isLastWeekdayOfMonth();return expressions.some(expression=>{let weekday=parseInt(expression.toString().charAt(0),10)%7;if(Number.isNaN(weekday))throw new Error(`Invalid last weekday of the month expression: ${expression}`);return currentDate.getDay()===weekday&&isLastWeekdayOfMonth})}next(){return this.#findSchedule()}prev(){return this.#findSchedule(!0)}hasNext(){let current=this.#currentDate;try{return this.#findSchedule(),!0}catch{return!1}finally{this.#currentDate=current}}hasPrev(){let current=this.#currentDate;try{return this.#findSchedule(!0),!0}catch{return!1}finally{this.#currentDate=current}}take(limit){let items=[];if(limit>=0)for(let i=0;i<limit;i++)try{items.push(this.next())}catch{return items}else for(let i=0;i>limit;i--)try{items.push(this.prev())}catch{return items}return items}reset(newDate){this.#currentDate=new CronDate_1.CronDate(newDate||this.#options.currentDate)}stringify(includeSeconds=!1){return this.#fields.stringify(includeSeconds)}includesDate(date){let{second,minute,hour,month}=this.#fields,dt=new CronDate_1.CronDate(date,this.#tz);return!(!second.values.includes(dt.getSeconds())||!minute.values.includes(dt.getMinutes())||!hour.values.includes(dt.getHours())||!month.values.includes(dt.getMonth()+1)||!this.#matchDayOfMonth(dt)||this.#fields.dayOfWeek.nthDay>0&&Math.ceil(dt.getDate()/7)!==this.#fields.dayOfWeek.nthDay)}toString(){return this.#options.expression||this.stringify(!0)}#matchDayOfMonth(currentDate){let isDayOfMonthWildcardMatch=this.#fields.dayOfMonth.isWildcard,isRestrictedDayOfMonth=!isDayOfMonthWildcardMatch,isDayOfWeekWildcardMatch=this.#fields.dayOfWeek.isWildcard,isRestrictedDayOfWeek=!isDayOfWeekWildcardMatch,matchedDOM=_CronExpression.#matchSchedule(currentDate.getDate(),this.#fields.dayOfMonth.values)||this.#fields.dayOfMonth.hasLastChar&&currentDate.isLastDayOfMonth(),matchedDOW=_CronExpression.#matchSchedule(currentDate.getDay(),this.#fields.dayOfWeek.values)||this.#fields.dayOfWeek.hasLastChar&&_CronExpression.#isLastWeekdayOfMonthMatch(this.#fields.dayOfWeek.values,currentDate);return!!(isRestrictedDayOfMonth&&isRestrictedDayOfWeek&&(matchedDOM||matchedDOW)||matchedDOM&&!isRestrictedDayOfWeek||isDayOfMonthWildcardMatch&&!isDayOfWeekWildcardMatch&&matchedDOW)}#matchHour(currentDate,dateMathVerb,reverse){let currentHour=currentDate.getHours(),isMatch=_CronExpression.#matchSchedule(currentHour,this.#fields.hour.values),isDstStart=currentDate.dstStart===currentHour,isDstEnd=currentDate.dstEnd===currentHour;return!isMatch&&!isDstStart?(currentDate.dstStart=null,currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Hour,this.#fields.hour.values.length),!1):isDstStart&&!_CronExpression.#matchSchedule(currentHour-1,this.#fields.hour.values)?(currentDate.invokeDateOperation(dateMathVerb,CronDate_1.TimeUnit.Hour),!1):isDstEnd&&!reverse?(currentDate.dstEnd=null,currentDate.applyDateOperation(CronDate_1.DateMathOp.Add,CronDate_1.TimeUnit.Hour,this.#fields.hour.values.length),!1):!0}#validateTimeSpan(currentDate){if(!this.#startDate&&!this.#endDate)return;let currentTime=currentDate.getTime();if(this.#startDate&&currentTime<this.#startDate.getTime())throw new Error(exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#endDate&&currentTime>this.#endDate.getTime())throw new Error(exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#findSchedule(reverse=!1){let dateMathVerb=reverse?CronDate_1.DateMathOp.Subtract:CronDate_1.DateMathOp.Add,currentDate=new CronDate_1.CronDate(this.#currentDate),startTimestamp=currentDate.getTime(),stepCount=0;for(;++stepCount<LOOP_LIMIT;){if(this.#validateTimeSpan(currentDate),!this.#matchDayOfMonth(currentDate)){currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Day,this.#fields.hour.values.length);continue}if(!(this.#fields.dayOfWeek.nthDay<=0||Math.ceil(currentDate.getDate()/7)===this.#fields.dayOfWeek.nthDay)){currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Day,this.#fields.hour.values.length);continue}if(!_CronExpression.#matchSchedule(currentDate.getMonth()+1,this.#fields.month.values)){currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Month,this.#fields.hour.values.length);continue}if(this.#matchHour(currentDate,dateMathVerb,reverse)){if(!_CronExpression.#matchSchedule(currentDate.getMinutes(),this.#fields.minute.values)){currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Minute,this.#fields.hour.values.length);continue}if(!_CronExpression.#matchSchedule(currentDate.getSeconds(),this.#fields.second.values)){currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Second,this.#fields.hour.values.length);continue}if(startTimestamp===currentDate.getTime()){(dateMathVerb==="Add"||currentDate.getMilliseconds()===0)&&currentDate.applyDateOperation(dateMathVerb,CronDate_1.TimeUnit.Second,this.#fields.hour.values.length);continue}break}}if(stepCount>LOOP_LIMIT)throw new Error(exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return currentDate.getMilliseconds()!==0&&currentDate.setMilliseconds(0),this.#currentDate=currentDate,currentDate}[Symbol.iterator](){return{next:()=>({value:this.#findSchedule(),done:!this.hasNext()})}}};exports.CronExpression=CronExpression;exports.default=CronExpression}});var require_random=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/utils/random.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.seededRandom=seededRandom;function xfnv1a(str){let h=2166136261;for(let i=0;i<str.length;i++)h^=str.charCodeAt(i),h=Math.imul(h,16777619);return()=>h>>>0}function mulberry32(seed){return()=>{let t=seed+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function seededRandom(str){let seed=str?xfnv1a(str)():Math.floor(Math.random()*1e10);return mulberry32(seed)}}});var require_CronExpressionParser=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/CronExpressionParser.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CronExpressionParser=exports.DayOfWeek=exports.Months=exports.CronUnit=exports.PredefinedExpressions=void 0;var CronFieldCollection_1=require_CronFieldCollection(),CronExpression_1=require_CronExpression(),random_1=require_random(),fields_1=require_fields(),PredefinedExpressions;(function(PredefinedExpressions2){PredefinedExpressions2["@yearly"]="0 0 0 1 1 *",PredefinedExpressions2["@annually"]="0 0 0 1 1 *",PredefinedExpressions2["@monthly"]="0 0 0 1 * *",PredefinedExpressions2["@weekly"]="0 0 0 * * 0",PredefinedExpressions2["@daily"]="0 0 0 * * *",PredefinedExpressions2["@hourly"]="0 0 * * * *",PredefinedExpressions2["@minutely"]="0 * * * * *",PredefinedExpressions2["@secondly"]="* * * * * *",PredefinedExpressions2["@weekdays"]="0 0 0 * * 1-5",PredefinedExpressions2["@weekends"]="0 0 0 * * 0,6"})(PredefinedExpressions||(exports.PredefinedExpressions=PredefinedExpressions={}));var CronUnit;(function(CronUnit2){CronUnit2.Second="Second",CronUnit2.Minute="Minute",CronUnit2.Hour="Hour",CronUnit2.DayOfMonth="DayOfMonth",CronUnit2.Month="Month",CronUnit2.DayOfWeek="DayOfWeek"})(CronUnit||(exports.CronUnit=CronUnit={}));var Months;(function(Months2){Months2[Months2.jan=1]="jan",Months2[Months2.feb=2]="feb",Months2[Months2.mar=3]="mar",Months2[Months2.apr=4]="apr",Months2[Months2.may=5]="may",Months2[Months2.jun=6]="jun",Months2[Months2.jul=7]="jul",Months2[Months2.aug=8]="aug",Months2[Months2.sep=9]="sep",Months2[Months2.oct=10]="oct",Months2[Months2.nov=11]="nov",Months2[Months2.dec=12]="dec"})(Months||(exports.Months=Months={}));var DayOfWeek;(function(DayOfWeek2){DayOfWeek2[DayOfWeek2.sun=0]="sun",DayOfWeek2[DayOfWeek2.mon=1]="mon",DayOfWeek2[DayOfWeek2.tue=2]="tue",DayOfWeek2[DayOfWeek2.wed=3]="wed",DayOfWeek2[DayOfWeek2.thu=4]="thu",DayOfWeek2[DayOfWeek2.fri=5]="fri",DayOfWeek2[DayOfWeek2.sat=6]="sat"})(DayOfWeek||(exports.DayOfWeek=DayOfWeek={}));var CronExpressionParser=class _CronExpressionParser{static parse(expression,options={}){let{strict=!1,hashSeed}=options,rand=(0,random_1.seededRandom)(hashSeed);expression=PredefinedExpressions[expression]||expression;let rawFields=_CronExpressionParser.#getRawFields(expression,strict);if(!(rawFields.dayOfMonth==="*"||rawFields.dayOfWeek==="*"||!strict))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");let second=_CronExpressionParser.#parseField(CronUnit.Second,rawFields.second,fields_1.CronSecond.constraints,rand),minute=_CronExpressionParser.#parseField(CronUnit.Minute,rawFields.minute,fields_1.CronMinute.constraints,rand),hour=_CronExpressionParser.#parseField(CronUnit.Hour,rawFields.hour,fields_1.CronHour.constraints,rand),month=_CronExpressionParser.#parseField(CronUnit.Month,rawFields.month,fields_1.CronMonth.constraints,rand),dayOfMonth=_CronExpressionParser.#parseField(CronUnit.DayOfMonth,rawFields.dayOfMonth,fields_1.CronDayOfMonth.constraints,rand),{dayOfWeek:_dayOfWeek,nthDayOfWeek}=_CronExpressionParser.#parseNthDay(rawFields.dayOfWeek),dayOfWeek=_CronExpressionParser.#parseField(CronUnit.DayOfWeek,_dayOfWeek,fields_1.CronDayOfWeek.constraints,rand),fields=new CronFieldCollection_1.CronFieldCollection({second:new fields_1.CronSecond(second,{rawValue:rawFields.second}),minute:new fields_1.CronMinute(minute,{rawValue:rawFields.minute}),hour:new fields_1.CronHour(hour,{rawValue:rawFields.hour}),dayOfMonth:new fields_1.CronDayOfMonth(dayOfMonth,{rawValue:rawFields.dayOfMonth}),month:new fields_1.CronMonth(month,{rawValue:rawFields.month}),dayOfWeek:new fields_1.CronDayOfWeek(dayOfWeek,{rawValue:rawFields.dayOfWeek,nthDayOfWeek})});return new CronExpression_1.CronExpression(fields,{...options,expression})}static#getRawFields(expression,strict){if(strict&&!expression.length)throw new Error("Invalid cron expression");expression=expression||"0 * * * * *";let atoms=expression.trim().split(/\s+/);if(strict&&atoms.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(atoms.length>6)throw new Error("Invalid cron expression, too many fields");let defaults=["*","*","*","*","*","0"];atoms.length<defaults.length&&atoms.unshift(...defaults.slice(atoms.length));let[second,minute,hour,dayOfMonth,month,dayOfWeek]=atoms;return{second,minute,hour,dayOfMonth,month,dayOfWeek}}static#parseField(field,value,constraints,rand){if((field===CronUnit.Month||field===CronUnit.DayOfWeek)&&(value=value.replace(/[a-z]{3}/gi,match=>{match=match.toLowerCase();let replacer=Months[match]||DayOfWeek[match];if(replacer===void 0)throw new Error(`Validation error, cannot resolve alias "${match}"`);return replacer.toString()})),!constraints.validChars.test(value))throw new Error(`Invalid characters, got value: ${value}`);return value=this.#parseWildcard(value,constraints),value=this.#parseHashed(value,constraints,rand),this.#parseSequence(field,value,constraints)}static#parseWildcard(value,constraints){return value.replace(/[*?]/g,constraints.min+"-"+constraints.max)}static#parseHashed(value,constraints,rand){let randomValue=rand();return value.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(_,min,max,step)=>{if(min&&max&&step){let minNum=parseInt(min,10),maxNum=parseInt(max,10),stepNum=parseInt(step,10);if(minNum>maxNum)throw new Error(`Invalid range: ${minNum}-${maxNum}, min > max`);if(stepNum<=0)throw new Error(`Invalid step: ${stepNum}, must be positive`);let minStart=Math.max(minNum,constraints.min),offset=Math.floor(randomValue*stepNum),values=[];for(let i=Math.floor(minStart/stepNum)*stepNum+offset;i<=maxNum;i+=stepNum)i>=minStart&&values.push(i);return values.join(",")}else if(min&&max){let minNum=parseInt(min,10),maxNum=parseInt(max,10);if(minNum>maxNum)throw new Error(`Invalid range: ${minNum}-${maxNum}, min > max`);return String(Math.floor(randomValue*(maxNum-minNum+1))+minNum)}else if(step){let stepNum=parseInt(step,10);if(stepNum<=0)throw new Error(`Invalid step: ${stepNum}, must be positive`);let offset=Math.floor(randomValue*stepNum),values=[];for(let i=Math.floor(constraints.min/stepNum)*stepNum+offset;i<=constraints.max;i+=stepNum)i>=constraints.min&&values.push(i);return values.join(",")}else return String(Math.floor(randomValue*(constraints.max-constraints.min+1)+constraints.min))})}static#parseSequence(field,val,constraints){let stack=[];function handleResult(result,constraints2){if(Array.isArray(result))stack.push(...result);else if(_CronExpressionParser.#isValidConstraintChar(constraints2,result))stack.push(result);else{let v=parseInt(result.toString(),10);if(!(v>=constraints2.min&&v<=constraints2.max))throw new Error(`Constraint error, got value ${result} expected range ${constraints2.min}-${constraints2.max}`);stack.push(field===CronUnit.DayOfWeek?v%7:result)}}return val.split(",").forEach(atom=>{if(!(atom.length>0))throw new Error("Invalid list value format");handleResult(_CronExpressionParser.#parseRepeat(field,atom,constraints),constraints)}),stack}static#parseRepeat(field,val,constraints){let atoms=val.split("/");if(atoms.length>2)throw new Error(`Invalid repeat: ${val}`);return atoms.length===2?(isNaN(parseInt(atoms[0],10))||(atoms[0]=`${atoms[0]}-${constraints.max}`),_CronExpressionParser.#parseRange(field,atoms[0],parseInt(atoms[1],10),constraints)):_CronExpressionParser.#parseRange(field,val,1,constraints)}static#validateRange(min,max,constraints){if(!(!isNaN(min)&&!isNaN(max)&&min>=constraints.min&&max<=constraints.max))throw new Error(`Constraint error, got range ${min}-${max} expected range ${constraints.min}-${constraints.max}`);if(min>max)throw new Error(`Invalid range: ${min}-${max}, min(${min}) > max(${max})`)}static#validateRepeatInterval(repeatInterval){if(!(!isNaN(repeatInterval)&&repeatInterval>0))throw new Error(`Constraint error, cannot repeat at every ${repeatInterval} time.`)}static#createRange(field,min,max,repeatInterval){let stack=[];field===CronUnit.DayOfWeek&&max%7===0&&stack.push(0);for(let index=min;index<=max;index+=repeatInterval)stack.indexOf(index)===-1&&stack.push(index);return stack}static#parseRange(field,val,repeatInterval,constraints){let atoms=val.split("-");if(atoms.length<=1)return isNaN(+val)?val:+val;let[min,max]=atoms.map(num=>parseInt(num,10));return this.#validateRange(min,max,constraints),this.#validateRepeatInterval(repeatInterval),this.#createRange(field,min,max,repeatInterval)}static#parseNthDay(val){let atoms=val.split("#");if(atoms.length<=1)return{dayOfWeek:atoms[0]};let nthValue=+atoms[atoms.length-1],matches=val.match(/([,-/])/);if(matches!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${matches?.[0]}\` special characters are incompatible`);if(!(atoms.length<=2&&!isNaN(nthValue)&&nthValue>=1&&nthValue<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:atoms[0],nthDayOfWeek:nthValue}}static#isValidConstraintChar(constraints,value){return constraints.chars.some(char=>value.toString().includes(char))}};exports.CronExpressionParser=CronExpressionParser}});var require_CronFileParser=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/CronFileParser.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(){var ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(o2){var ar=[];for(var k in o2)Object.prototype.hasOwnProperty.call(o2,k)&&(ar[ar.length]=k);return ar},ownKeys(o)};return function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i<k.length;i++)k[i]!=="default"&&__createBinding(result,mod,k[i]);return __setModuleDefault(result,mod),result}}();Object.defineProperty(exports,"__esModule",{value:!0});exports.CronFileParser=void 0;var CronExpressionParser_1=require_CronExpressionParser(),CronFileParser=class _CronFileParser{static async parseFile(filePath){let{readFile:readFile4}=await Promise.resolve().then(()=>__importStar(__require("fs/promises"))),data=await readFile4(filePath,"utf8");return _CronFileParser.#parseContent(data)}static parseFileSync(filePath){let{readFileSync:readFileSync3}=__require("fs"),data=readFileSync3(filePath,"utf8");return _CronFileParser.#parseContent(data)}static#parseContent(data){let blocks=data.split(`
20
+ `),result={variables:{},expressions:[],errors:{}};for(let block of blocks){let entry=block.trim();if(entry.length===0||entry.startsWith("#"))continue;let variableMatch=entry.match(/^(.*)=(.*)$/);if(variableMatch){let[,key,value]=variableMatch;result.variables[key]=value.replace(/["']/g,"");continue}try{let parsedEntry=_CronFileParser.#parseEntry(entry);result.expressions.push(parsedEntry.interval)}catch(err){result.errors[entry]=err}}return result}static#parseEntry(entry){let atoms=entry.split(" ");return{interval:CronExpressionParser_1.CronExpressionParser.parse(atoms.slice(0,5).join(" ")),command:atoms.slice(5,atoms.length)}}};exports.CronFileParser=CronFileParser}});var require_dist8=__commonJS({"../../node_modules/.pnpm/cron-parser@5.4.0/node_modules/cron-parser/dist/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.CronFileParser=exports.CronExpressionParser=exports.CronExpression=exports.CronFieldCollection=exports.CronDate=void 0;var CronExpressionParser_1=require_CronExpressionParser(),CronDate_1=require_CronDate();Object.defineProperty(exports,"CronDate",{enumerable:!0,get:function(){return CronDate_1.CronDate}});var CronFieldCollection_1=require_CronFieldCollection();Object.defineProperty(exports,"CronFieldCollection",{enumerable:!0,get:function(){return CronFieldCollection_1.CronFieldCollection}});var CronExpression_1=require_CronExpression();Object.defineProperty(exports,"CronExpression",{enumerable:!0,get:function(){return CronExpression_1.CronExpression}});var CronExpressionParser_2=require_CronExpressionParser();Object.defineProperty(exports,"CronExpressionParser",{enumerable:!0,get:function(){return CronExpressionParser_2.CronExpressionParser}});var CronFileParser_1=require_CronFileParser();Object.defineProperty(exports,"CronFileParser",{enumerable:!0,get:function(){return CronFileParser_1.CronFileParser}});__exportStar(require_fields(),exports);exports.default=CronExpressionParser_1.CronExpressionParser}});var require_types2=__commonJS({"../../internals/local-schedules/dist/types.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),types_exports={};__export(types_exports,{ScheduleBrokerError:()=>ScheduleBrokerError2});module.exports=__toCommonJS(types_exports);var ScheduleBrokerError2=class extends Error{constructor(code,message){super(message),this.code=code,this.name="ScheduleBrokerError"}}}});var require_timing=__commonJS({"../../internals/local-schedules/dist/timing.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),timing_exports={};__export(timing_exports,{nextCronOccurrence:()=>nextCronOccurrence,nextOccurrence:()=>nextOccurrence,singleOccurrence:()=>singleOccurrence,validateCronJitter:()=>validateCronJitter,validateTimezone:()=>validateTimezone});module.exports=__toCommonJS(timing_exports);var import_cron_parser=require_dist8(),import_luxon=require_luxon(),import_types=require_types2();function invalid(message){throw new import_types.ScheduleBrokerError("invalid_request",message)}function validateTimezone(timezone){(timezone.length>50||!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(timezone))&&invalid("Expected a valid IANA timezone");try{new Intl.DateTimeFormat("en-US",{timeZone:timezone})}catch{invalid("Expected a valid IANA timezone")}}function parseCron(cron,timezone,after){let fields=cron.split(" ");(fields.length!==5||fields.some(field=>!/^[\d*,/-]+$/.test(field))||fields[2]!=="*"&&fields[4]!=="*"||fields[4].split(/\D+/).some(value=>Number(value)>6))&&invalid("Expected a numeric five-field cron; one of day-of-month/day-of-week must be *, Sunday is 0");try{return import_cron_parser.CronExpressionParser.parse(`0 ${cron}`,{currentDate:after,tz:timezone,strict:!0})}catch(error3){invalid(`Invalid cron: ${error3 instanceof Error?error3.message:String(error3)}`)}}function validateCronJitter(cron,timezone,jitter){let{fields}=parseCron(cron,timezone,0),times=fields.hour.values.flatMap(hour=>fields.minute.values.map(minute=>hour*60+minute)),dayCycle=1440,[,,dayOfMonth,month,dayOfWeek]=cron.split(" ");if(dayOfMonth==="*"&&month==="*"&&dayOfWeek!=="*"){let days=fields.dayOfWeek.values.map(Number),gap=7-days[days.length-1]+days[0];for(let i=1;i<days.length;i++)gap=Math.min(gap,days[i]-days[i-1]);dayCycle*=gap}let cadence=dayCycle-times[times.length-1]+times[0];for(let i=1;i<times.length;i++)cadence=Math.min(cadence,times[i]-times[i-1]);jitter>cadence&&invalid("Jitter exceeds the cron cadence")}function nextCronOccurrence(cron,timezone,after){let iterator=parseCron(cron,timezone,after);for(let attempt=0;attempt<1500;attempt++){let timestamp;try{timestamp=iterator.next().getTime()}catch{invalid("Cron has no calculable next occurrence")}let local=import_luxon.DateTime.fromMillis(timestamp,{zone:timezone}),fields=iterator.fields;if(!fields.hour.values.some(hour=>hour===local.hour)||!fields.minute.values.some(minute=>minute===local.minute))continue;let first=Math.min(...local.getPossibleOffsets().map(date=>date.toMillis()));if(timestamp===first)return timestamp}invalid("Could not resolve cron across timezone transitions")}function singleOccurrence(at,timezone){/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(at)||invalid("Expected YYYY-MM-DDTHH:mm:ss without a timezone suffix");let local=import_luxon.DateTime.fromISO(at,{zone:timezone});return(!local.isValid||local.toFormat("yyyy-MM-dd'T'HH:mm:ss")!==at)&&invalid("One-shot time is invalid or nonexistent in its timezone"),local.getPossibleOffsets().length!==1&&invalid("Ambiguous one-shot time in its timezone"),local.toMillis()}function nextOccurrence(expression,timezone,after){if(expression.type==="cron")return nextCronOccurrence(expression.cron,timezone,after);expression.type!=="single"&&invalid("Unknown schedule expression type");let at=singleOccurrence(expression.at,timezone);return at>=after?at:void 0}}});var require_schedule_broker=__commonJS({"../../internals/local-schedules/dist/schedule-broker.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),schedule_broker_exports={};__export(schedule_broker_exports,{ScheduleBroker:()=>ScheduleBroker3});module.exports=__toCommonJS(schedule_broker_exports);var import_node_crypto5=__require("node:crypto"),import_node_util=__require("node:util"),import_dispatch=require_dispatch(),import_ids=require_ids(),import_timing=require_timing(),import_types=require_types2(),MAX_TIMER_DELAY=6e4;function invalid(message){throw new import_types.ScheduleBrokerError("invalid_request",message)}function identifier2(value){return(typeof value!="string"||!/^[0-9A-Za-z._-]{1,256}$/.test(value))&&invalid("Invalid schedule name or namespace"),value}function keyOf(input){return`${identifier2(input.namespace??"default")}/${identifier2(input.name)}`}function serializePayload(payload){if(payload!==void 0)try{let result=JSON.stringify(payload);return result===void 0&&invalid("Payload must be JSON serializable"),result}catch{invalid("Payload must be JSON serializable")}}function prepare(input,now){let timezone=input.timezone??"UTC";(0,import_timing.validateTimezone)(timezone),input.jitter!==void 0&&(!Number.isInteger(input.jitter)||input.jitter<1||input.jitter>15)&&invalid("Jitter must be an integer from 1 to 15 minutes");let target=input.target,targetRef=target?.type==="queue"?target.topic:target?.type==="function"?target.function:target?.type==="path"?target.path:void 0;(!target||target.type!=="queue"&&target.type!=="function"&&target.type!=="path"||typeof targetRef!="string"||!targetRef)&&invalid("Expected a queue topic, function, or path target"),target.type==="path"&&target.requestMethod!==void 0&&target.requestMethod!=="GET"&&target.requestMethod!=="POST"&&invalid("Path target requestMethod must be GET or POST");let next=(0,import_timing.nextOccurrence)(input.expression,timezone,now);return input.expression.type==="cron"&&input.jitter!==void 0&&(0,import_timing.validateCronJitter)(input.expression.cron,timezone,input.jitter),{expression:{...input.expression},timezone,...input.jitter===void 0?{}:{jitter:input.jitter},target:{...target},payload:serializePayload(input.payload),next}}var ScheduleBroker3=class{constructor(options){this.options=options,this.entries=new Map,this.inFlight=new Set,this.running=!1,this.closed=!1,this.scope={ownerId:options.ownerId,projectId:options.projectId,trackId:options.trackId},Object.values(this.scope).some(value=>typeof value!="string"||!value)&&invalid("An owner, project, and track are required"),this.now=options.now??Date.now,this.random=options.random??Math.random}start(){this.assertOpen(),this.running=!0,this.arm()}create(input){this.assertOpen(),input.target.type!=="queue"&&invalid("Dynamic schedules require a queue target");let name=input.name??`dyn.${(0,import_node_crypto5.randomBytes)(12).toString("hex")}`,key=keyOf({...input,name});if(this.entries.has(key))throw new import_types.ScheduleBrokerError("conflict",`Schedule ${key} already exists`);let entry=this.insert({...input,name},prepare(input,this.now()),"dynamic");return this.arm(),structuredClone(entry.schedule)}get(input){return structuredClone(this.require(input).schedule)}list(input={}){let namespace=identifier2(input.namespace??"default"),limit=input.limit??20;(!Number.isInteger(limit)||limit<1||limit>100)&&invalid("Limit must be between 1 and 100");let after="",scope=[this.scope.ownerId,this.scope.projectId,this.scope.trackId,namespace];if(input.cursor!==void 0)try{let cursor=JSON.parse(Buffer.from(input.cursor,"base64url").toString());(!Array.isArray(cursor)||cursor.length!==5||!scope.every((value,i)=>value===cursor[i]))&&invalid("Invalid list cursor"),after=identifier2(cursor[4])}catch{invalid("Invalid list cursor")}let records=[...this.entries.values()].map(entry=>entry.schedule).filter(schedule=>schedule.namespace===namespace&&schedule.name>after).sort((a,b)=>a.name<b.name?-1:a.name>b.name?1:0),data=records.slice(0,limit);return{data:structuredClone(data),cursor:records.length>limit?Buffer.from(JSON.stringify([...scope,data[data.length-1].name])).toString("base64url"):null}}update(input,changes){this.assertOpen();let entry=this.require(input);changes.target&&changes.target.type!=="queue"&&invalid("Management updates require a queue target");let prepared=prepare({...entry.schedule,...changes,expression:changes.expression??entry.schedule.expression,timezone:changes.timezone??entry.schedule.timezone,target:changes.target??entry.schedule.target,jitter:changes.jitter===null?void 0:changes.jitter??entry.schedule.jitter,payload:changes.payload===void 0?entry.payload===void 0?void 0:JSON.parse(entry.payload):changes.payload===null?void 0:changes.payload},this.schedulingBoundary(entry));return this.replace(entry,prepared),this.arm(),structuredClone(entry.schedule)}delete(input){this.assertOpen();let entry=this.require(input);return this.cancel(entry),this.entries.delete(keyOf(input)),this.arm(),{scheduleId:entry.schedule.scheduleId}}enable(input){return this.setState(input,"active")}disable(input){return this.setState(input,"inactive")}validateStatic(inputs){this.prepareStatic(inputs)}prepareStatic(inputs){this.assertOpen();let prepared=new Map;for(let input of inputs){"payload"in input&&invalid("Static schedule definitions cannot include a payload");let key=keyOf(input),existing=this.entries.get(key);if(prepared.has(key)||existing?.schedule.source==="dynamic")throw new import_types.ScheduleBrokerError("conflict",`Static schedule ${key} conflicts with an existing definition`);prepared.set(key,{input,value:{...prepare(input,this.schedulingBoundary(existing)),payload:existing?.payload}})}return prepared}reconcileStatic(inputs){let prepared=this.prepareStatic(inputs);for(let[key,entry]of this.entries)entry.schedule.source==="static"&&!prepared.has(key)&&(this.cancel(entry),this.entries.delete(key));let result=[];for(let[key,{input,value}]of prepared){let existing=this.entries.get(key),entry=existing??this.insert(input,value,"static");existing&&!this.matches(existing,value)&&this.replace(existing,value),result.push(structuredClone(entry.schedule))}return this.arm(),result}async invoke(input){this.assertOpen();let entry=this.require(input),at=this.now();await this.dispatch(entry,at,"manual")}async close(){this.closed=!0,this.running=!1,this.timer&&clearTimeout(this.timer),this.timer=void 0;for(let entry of this.entries.values())this.cancel(entry);await Promise.allSettled([...this.inFlight])}assertOpen(){if(this.closed)throw new import_types.ScheduleBrokerError("closed","Schedule broker is closed")}require(input){let key=keyOf(input),entry=this.entries.get(key);if(!entry)throw new import_types.ScheduleBrokerError("not_found",`Schedule ${key} not found`);return entry}insert(input,value,source){let{payload,next,...definition2}=value,now=this.now(),entry={schedule:{ownerId:this.scope.ownerId,projectId:this.scope.projectId,...definition2,scheduleId:(0,import_ids.generateScheduleId)(),name:input.name,namespace:input.namespace??"default",state:"active",source,createdAt:now,updatedAt:now},payload,next,consumed:!1,pending:new Map,controllers:new Set};return this.entries.set(keyOf(input),entry),entry}matches(entry,value){return(0,import_node_util.isDeepStrictEqual)(entry.schedule.expression,value.expression)&&(0,import_node_util.isDeepStrictEqual)(entry.schedule.target,value.target)&&entry.schedule.timezone===value.timezone&&entry.schedule.jitter===value.jitter&&entry.payload===value.payload}replace(entry,value){this.cancel(entry),(!(0,import_node_util.isDeepStrictEqual)(entry.schedule.expression,value.expression)||entry.schedule.timezone!==value.timezone)&&(entry.consumed=!1);let{payload,next,...definition2}=value;entry.schedule={...entry.schedule,...definition2,jitter:value.jitter,updatedAt:this.now()},entry.payload=payload,entry.next=entry.consumed||entry.schedule.state!=="active"?void 0:next}setState(input,state){this.assertOpen();let entry=this.require(input);if(entry.schedule.state!==state){let next=state==="active"&&!entry.consumed?(0,import_timing.nextOccurrence)(entry.schedule.expression,entry.schedule.timezone,this.schedulingBoundary(entry)):void 0;this.cancel(entry),entry.schedule={...entry.schedule,state,updatedAt:this.now()},entry.next=next,this.arm()}return structuredClone(entry.schedule)}schedulingBoundary(entry){return Math.max(this.now(),(entry?.lastScheduledAt??-1/0)+1)}cancel(entry){entry.next=void 0,entry.pending.clear();for(let controller of entry.controllers)controller.abort();entry.controllers.clear()}arm(){if(this.timer&&clearTimeout(this.timer),this.timer=void 0,!this.running)return;let deadline=1/0;for(let entry of this.entries.values()){entry.next!==void 0&&(deadline=Math.min(deadline,entry.next));for(let due of entry.pending.values())deadline=Math.min(deadline,due)}Number.isFinite(deadline)&&(this.timer=setTimeout(()=>this.tick(),Math.max(0,Math.min(MAX_TIMER_DELAY,deadline-this.now()))),this.timer.unref())}tick(){if(this.timer=void 0,!this.running)return;let now=this.now();for(let entry of this.entries.values()){if(entry.next!==void 0&&entry.next<=now){let at=entry.next;entry.lastScheduledAt=at;let offset=entry.schedule.jitter===void 0?0:Math.floor(this.random()*(entry.schedule.jitter*60+1))*1e3;entry.pending.set(at,at+offset),entry.next=entry.schedule.expression.type==="cron"?(0,import_timing.nextOccurrence)(entry.schedule.expression,entry.schedule.timezone,now):void 0}for(let[at,due]of entry.pending)due>now||(entry.pending.delete(at),this.dispatch(entry,at,"scheduled"))}this.arm()}dispatch(entry,at,source){let controller=new AbortController;entry.controllers.add(controller);let invocation=(0,import_dispatch.createDispatch)(structuredClone(entry.schedule),entry.payload,at,(0,import_ids.scheduleExecutionId)(entry.schedule.scheduleId,at),source,controller.signal),promise=Promise.resolve().then(async()=>{if(!(this.closed||controller.signal.aborted)){source==="scheduled"&&entry.schedule.expression.type==="single"&&(entry.consumed=!0);try{await this.options.dispatch(invocation)}catch(error3){if(controller.signal.aborted)return;if(source==="manual")throw error3;try{this.options.onError(error3,invocation)}catch{}}}}).finally(()=>{entry.controllers.delete(controller),this.inFlight.delete(promise)});return this.inFlight.add(promise),promise}}}});var require_dist9=__commonJS({"../../internals/local-schedules/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{ScheduleBroker:()=>import_schedule_broker.ScheduleBroker});module.exports=__toCommonJS(src_exports);var import_schedule_broker=require_schedule_broker();__reExport(src_exports,require_types2(),module.exports)}});var require_tree_kill=__commonJS({"../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports,module){"use strict";var childProcess=__require("child_process"),spawn=childProcess.spawn,exec=childProcess.exec;module.exports=function(pid,signal,callback){if(typeof signal=="function"&&callback===void 0&&(callback=signal,signal=void 0),pid=parseInt(pid),Number.isNaN(pid)){if(callback)return callback(new Error("pid must be a number"));throw new Error("pid must be a number")}var tree={},pidsToProcess={};switch(tree[pid]=[],pidsToProcess[pid]=1,process.platform){case"win32":exec("taskkill /pid "+pid+" /T /F",callback);break;case"darwin":buildProcessTree(pid,tree,pidsToProcess,function(parentPid){return spawn("pgrep",["-P",parentPid])},function(){killAll(tree,signal,callback)});break;default:buildProcessTree(pid,tree,pidsToProcess,function(parentPid){return spawn("ps",["-o","pid","--no-headers","--ppid",parentPid])},function(){killAll(tree,signal,callback)});break}};function killAll(tree,signal,callback){var killed={};try{Object.keys(tree).forEach(function(pid){tree[pid].forEach(function(pidpid){killed[pidpid]||(killPid(pidpid,signal),killed[pidpid]=1)}),killed[pid]||(killPid(pid,signal),killed[pid]=1)})}catch(err){if(callback)return callback(err);throw err}if(callback)return callback()}function killPid(pid,signal){try{process.kill(parseInt(pid,10),signal)}catch(err){if(err.code!=="ESRCH")throw err}}function buildProcessTree(parentPid,tree,pidsToProcess,spawnChildProcessesList,cb){var ps=spawnChildProcessesList(parentPid),allData="";ps.stdout.on("data",function(data){var data=data.toString("ascii");allData+=data});var onClose=function(code){if(delete pidsToProcess[parentPid],code!=0){Object.keys(pidsToProcess).length==0&&cb();return}allData.match(/\d+/g).forEach(function(pid){pid=parseInt(pid,10),tree[parentPid].push(pid),tree[pid]=[],pidsToProcess[pid]=1,buildProcessTree(pid,tree,pidsToProcess,spawnChildProcessesList,cb)})};ps.on("close",onClose)}}});var require_escape_html=__commonJS({"../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js"(exports,module){"use strict";var matchHtmlRegExp=/["'&<>]/;module.exports=escapeHtml;function escapeHtml(string){var str=""+string,match=matchHtmlRegExp.exec(str);if(!match)return str;var escape2,html="",index=0,lastIndex=0;for(index=match.index;index<str.length;index++){switch(str.charCodeAt(index)){case 34:escape2="&quot;";break;case 38:escape2="&amp;";break;case 39:escape2="&#39;";break;case 60:escape2="&lt;";break;case 62:escape2="&gt;";break;default:continue}lastIndex!==index&&(html+=str.substring(lastIndex,index)),lastIndex=index+1,html+=escape2}return lastIndex!==index?html+str.substring(lastIndex,index):html}}});var import_chalk4=__toESM(require_source(),1);import path5 from"path";var import_chalk3=__toESM(require_source(),1),import_ms8=__toESM(require_ms(),1),import_fs_extra2=__toESM(require_lib(),1),import_fs_detectors3=__toESM(require_dist4(),1),import_frameworks4=__toESM(require_frameworks(),1),import_build_utils10=__toESM(require_build_utils(),1);import{resolve as resolve2,join as join9}from"path";var import_fs_extra=__toESM(require_lib(),1),import_ms6=__toESM(require_ms(),1),import_chalk2=__toESM(require_source(),1);import url3,{URL as URL2}from"url";import http from"http";import{Socket}from"net";var import_pluralize2=__toESM(require_pluralize(),1),import_raw_body2=__toESM(require_raw_body(),1),import_async_listen=__toESM(require_dist2(),1),import_minimatch3=__toESM(require_minimatch(),1),import_http_proxy_node16=__toESM(require_http_proxy_node16(),1),import_serve_handler=__toESM(require_src2(),1),import_pcre_to_regexp2=__toESM(require_dist6(),1),import_dotenv=__toESM(require_main(),1),import_once=__toESM(require_dist7(),1),import_directory=__toESM(require_directory(),1),import_get_port2=__toESM(require_get_port(),1),import_fast_deep_equal=__toESM(require_fast_deep_equal(),1);import{randomBytes as randomBytes2,timingSafeEqual}from"crypto";import{watch}from"chokidar";import path4,{isAbsolute as isAbsolute3,basename,dirname as dirname3,extname as extname2,join as join5,sep as sep2}from"path";var import_is_port_reachable=__toESM(require_is_port_reachable(),1);init_dist();var import_build_utils=__toESM(require_build_utils(),1),import_ms=__toESM(require_ms(),1);var REPORT_A_BUG="This is likely a bug in the Vercel CLI. Please report it at https://vercel.com/help.",REPORT_A_BUILDER_BUG="This is likely a bug in the Builder that produced this function. Report it to the Builder's author, or at https://vercel.com/help for an official `@vercel/*` Builder.",dev=defineDiagnostics({codes:{DEV_RECURSIVE_INVOCATION:{why:"`vercel dev` must not recursively invoke itself",fix:"Check the Development Command in your Project Settings and the `dev` script in `package.json` \u2014 neither should call `vercel dev`.",docs:"https://vercel.link/recursive-invocation-of-commands"},DEV_LOCK_HELD:{why:"Another `vercel dev` process is already running for this project",fix:p=>p.detail},DEV_INVALID_WINDOWS_PIPE:{why:p=>`Invalid Windows named pipe endpoint: ${p.endpoint}`,fix:"Use a pipe path beginning with `\\\\.\\`, e.g. `pipe:\\\\.\\pipe\\my-app`."},DEV_INVALID_UNIX_SOCKET:{why:p=>`Invalid UNIX domain socket endpoint: ${p.endpoint}`,fix:"Provide a socket path, e.g. `unix:/tmp/my-app.sock`."},DEV_INVALID_LISTEN_SCHEME:{why:p=>`Unknown \`--listen\` scheme (protocol): ${p.protocol}`,fix:"Use a port (e.g. `3000`), or a `tcp:`, `unix:`, or `pipe:` endpoint."},DEV_PORT_DETECTION_TIMED_OUT:{why:p=>`Detecting port ${p.port} timed out after ${(0,import_ms.default)(p.timeout)}`,fix:"Ensure your Development Command starts a server that listens on the expected port."},DEV_BUILDER_LOAD_FAILED:{why:p=>`Failed to load Builder "${p.use}"`,fix:"Check that the Builder is installed and spelled correctly in your `vercel.json` `builds` configuration."},DEV_SIDECAR_UNSUPPORTED_TYPE:{why:p=>`Development sidecar "${p.name}" has unsupported type "${p.type}"`,fix:REPORT_A_BUILDER_BUG},DEV_SIDECAR_DUPLICATE_NAME:{why:p=>`Multiple builders contributed a development sidecar named "${p.name}"`,fix:REPORT_A_BUILDER_BUG},DEV_QUEUE_CONSUMER_DUPLICATE:{why:p=>`Queue consumer "${p.consumerGroup}" is configured more than once for topic "${p.topic}"`,fix:"Remove the duplicate consumer configuration so each consumer subscribes to a topic only once."},DEV_QUEUE_FUNCTION_UNSUPPORTED:{why:p=>`Can't register the queue trigger for "${p.sourceFile}": ${p.reason}.`,fix:"Use an endpoint supported by the builder for local queue delivery, or test this trigger in a deployment."},DEV_FUNCTION_MANIFEST_INVALID:{why:p=>`Builder "${p.use}" returned an invalid development function manifest.`,fix:"Check getDevManifest output identities, invocation paths, and normalized trigger metadata. Paths must not contain an origin, query, fragment, or traversal."},DEV_FUNCTION_OUTPUT_DUPLICATE:{why:p=>`Development function output "${p.outputPath}" is configured more than once.`,fix:"Each deployment function output must have one owner."},DEV_SCHEDULE_FUNCTION_MISSING:{why:p=>`Schedule "${p.name}" targets missing development function "${p.outputPath}".`,fix:"Use the exact build output ID, not a source path or URL. The builder must expose it through getDevManifest or a supported per-entrypoint function build; service-hosted targets are not supported locally yet."},DEV_SCHEDULE_FUNCTION_TRIGGER:{why:p=>`Schedule "${p.name}" targets function "${p.outputPath}" without a sole schedule/v1beta trigger.`,fix:'Declare experimentalTriggers: [{ "type": "schedule/v1beta" }] on the target function, or have its builder return that trigger in getDevManifest.'},DEV_QUEUE_FUNCTION_UNMATCHED:{why:p=>`No local queue endpoint matches functions["${p.pattern}"]. Its queue trigger will not receive messages.`,fix:"Check the source path and earlier functions entries. The builder must support getDevManifest or a conventional per-entrypoint function build."},DEV_SERVICE_NO_DEV_SERVER:{why:p=>`No dev server available for service "${p.name}" (framework: ${p.framework})`,fix:"Add a Development Command for this service, or set its framework so one can be detected."},DEV_SERVICE_NO_PID:{why:p=>`Failed to start service "${p.name}": no PID returned`,fix:"Verify the service Development Command is executable and starts successfully."},DEV_SERVICE_NO_STDIO:{why:p=>`Failed to start service "${p.name}": expected child process to have stdout and stderr`,fix:REPORT_A_BUG},DEV_BUILDER_RESULT_NOT_LAMBDA:{why:'The result of "builder.build()" must be a `Lambda`',fix:REPORT_A_BUILDER_BUG},DEV_BUILDER_RESULT_HAS_MAXDURATION:{why:'The result of "builder.build()" must not contain `maxDuration`',fix:REPORT_A_BUILDER_BUG},DEV_BUILDER_RESULT_HAS_MEMORY:{why:'The result of "builder.build()" must not contain `memory`',fix:REPORT_A_BUILDER_BUG},DEV_UNSUPPORTED_BUILDER_VERSION:{why:p=>`${p.titleName} CLI does not support builder version ${p.version}`,fix:p=>p.updateMessage},DEV_INVALID_ROUTES:{why:p=>p.message,fix:REPORT_A_BUILDER_BUG},DEV_LISTEN_ADDRESS_IN_USE:{why:p=>`Requested socket ${p.address} is already in use`,fix:"Stop the process using that socket, or pass a different `--listen` address."},DEV_COMMAND_PORT_IN_USE:{why:p=>`Port ${p.port} is already in use`,fix:"Stop the process listening on it, or pass a different `--listen` port."},DEV_UNSUPPORTED_CONFIG_VERSION:{why:"Cannot run `version: 1` projects",fix:'Upgrade the project to the current configuration \u2014 remove `"version": 1` from your `vercel.json`.'},DEV_CWD_NOT_FOUND:{why:p=>`Directory \`${p.cwd}\` does not exist`,fix:"Run the command from an existing directory, or pass a valid path."},DEV_CWD_NOT_DIRECTORY:{why:p=>`Path \`${p.cwd}\` is not a directory`,fix:"Point the command at a directory rather than a file."},DEV_INTERNAL_ADDRESS_UNAVAILABLE:{why:"Invalid access to `address` because `start` has not yet populated `this.address`",fix:REPORT_A_BUG},DEV_INTERNAL_NO_ROUTE_RESULT:{why:"Expected Route Result but none was found",fix:REPORT_A_BUG},DEV_INTERNAL_MISSING_CHILD_STDIO:{why:"Expected child process to have stdout and stderr",fix:REPORT_A_BUG},DEV_SYSCALL_ERROR:{why:p=>p.message,fix:"This is an operating-system error. Check the file path, permissions, and ports referenced above, then retry."}}});function toDiagnostic2(err){return toDiagnostic(err,{syscall:(message,cause)=>dev.DEV_SYSCALL_ERROR({message,cause})})}var DevCommandExitError=class extends Diagnostic{constructor(message,exitCode){super({why:message,fix:"Your Development Command exited before the dev server was ready. Fix the error logged above, then confirm the command runs on its own (e.g. `npm run dev`)."});this.name="DEV_COMMAND_EXITED",this.exitCode=exitCode}},ServiceStartError=class extends Diagnostic{constructor(failures){let dedupeErrorCodes=new Set(["PYTHON_EXTERNAL_VENV_DETECTED"]),seenCodes=new Set,uniqueMessages=[],childFixes=[],childCodes=[];for(let err of failures){let message=err instanceof Error?err.message:String(err),rawCode=err?.code,code=err instanceof import_build_utils.NowBuildError?err.code:typeof rawCode=="string"?rawCode:void 0;code&&dedupeErrorCodes.has(code)?seenCodes.has(code)||(uniqueMessages.push(message),seenCodes.add(code)):uniqueMessages.push(message),code&&!childCodes.includes(code)&&childCodes.push(code);let childFix=code&&Object.hasOwn(FIX_BY_CODE,code)?FIX_BY_CODE[code]:void 0;childFix&&!childFixes.includes(childFix)&&childFixes.push(childFix)}super({why:uniqueMessages.join(`
21
+ `),fix:childFixes.length?childFixes.join(`
22
+ `):"Review the per-service errors above and fix each failing service before retrying."});this.name="DEV_SERVICE_START_FAILED",this.childCodes=childCodes}};function telemetryCodes(diagnostic){return diagnostic instanceof ServiceStartError&&diagnostic.childCodes.length?diagnostic.childCodes:[diagnostic.name]}function sleep(ms9){return new Promise(resolve3=>setTimeout(resolve3,ms9))}async function getReachableHostOnPort(port){let optsIpv4={host:"127.0.0.1"},optsIpv6={host:"::1"};return(await Promise.all([(0,import_is_port_reachable.default)(port,optsIpv6).then(r=>r&&`[${optsIpv6.host}]`),(0,import_is_port_reachable.default)(port,optsIpv4).then(r=>r&&optsIpv4.host)])).find(Boolean)||!1}async function waitForPortToFree(port,timeout=0){let start=Date.now();for(;await getReachableHostOnPort(port);){if(Date.now()-start>=timeout)return!1;await sleep(100)}return!0}async function checkForPort(port,timeout){let host,start=Date.now();for(;!(host=await getReachableHostOnPort(port))&&!(Date.now()-start>timeout);)await sleep(100);if(!host)throw dev.DEV_PORT_DETECTION_TIMED_OUT({port,timeout});return host}var import_npm_package_arg=__toESM(require_npa(),1),import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_client=__toESM(require_dist5(),1),import_routing_utils3=__toESM(require_dist3(),1),import_build_utils9=__toESM(require_build_utils(),1),import_fs_detectors2=__toESM(require_dist4(),1),import_detect_builders_with_services=__toESM(require_detect_builders_with_services(),1),import_schedule_entrypoint=__toESM(require_schedule_entrypoint(),1),import_frameworks3=__toESM(require_frameworks(),1),import_local_schedules2=__toESM(require_dist9(),1);var import_build_utils2=__toESM(require_build_utils(),1);import{relative as nativeRelative}from"path";function relative(a,b){return(0,import_build_utils2.normalizePath)(nativeRelative(a,b))}var import_get_files=__toESM(require_get_files(),1);function staticFiles(path6,options){return(0,import_get_files.staticFiles)(path6,options,output_manager_default)}var import_pcre_to_regexp=__toESM(require_dist6(),1);import url2 from"url";function isURL(str){return typeof str=="string"&&/^https?:\/\//.test(str)}var import_routing_utils=__toESM(require_dist3(),1);function parseQueryString(querystring){let query=Object.create(null);if(!querystring||!querystring.startsWith("?")||querystring==="?")return query;let params=querystring.slice(1).split("&");for(let param2 of params){let[key,value]=param2.split("=");key!==void 0&&(key=decodeURIComponent(key)),value!==void 0&&(value=decodeURIComponent(value));let existing=query[key];existing||(existing=[],query[key]=existing),existing.push(value)}return query}function formatQueryString(query){if(!query)return null;let s="",prefix="?";for(let[key,values]of Object.entries(query))for(let value of values)s+=prefix,s+=encodeURIComponent(key),value!==void 0&&(s+="=",s+=encodeURIComponent(value)),prefix="&";return s||null}import url from"url";function resolveTransforms(transforms,ctx){return!transforms||transforms.length===0?[]:transforms.map(transform=>transform.type==="request.path"?{...transform,args:resolveString(transform.args,transform,ctx)}:{...transform,target:{key:resolveKey(transform.target.key,transform,ctx)},args:resolveArgs(transform.args,transform,ctx)})}function applyResponseTransforms(headers,transforms){for(let transform of transforms)transform.type==="response.headers"&&"target"in transform&&applyTransform(headers,transform,!0)}function applyRequestTransforms(req,transforms){if(transforms.length===0)return;applyRequestHeaderTransforms(req.headers,transforms);let parsed=url.parse(req.url||"/"),query=parseQueryString(parsed.search);applyQueryTransforms(query,transforms);let newPath=getRequestPath(transforms);newPath!==void 0&&(parsed.pathname=newPath),parsed.search=formatQueryString(query),req.url=url.format(parsed)}function hasResponseTransforms(transforms){return transforms.some(t=>t.type==="response.headers")}function resolveKey(key,_transform,ctx){return typeof key=="string"?expandCaptureGroups(key,ctx.match,ctx.keys):key}function resolveArgs(args,transform,ctx){return typeof args=="string"?resolveString(args,transform,ctx):Array.isArray(args)?args.map(a=>typeof a=="string"?resolveString(a,transform,ctx):a):args}function resolveString(value,transform,ctx){let resolved=expandCaptureGroups(value,ctx.match,ctx.keys);return transform.env&&transform.env.length>0&&ctx.env&&(resolved=expandEnvVars(resolved,transform.env,ctx.env)),resolved}function expandCaptureGroups(str,match,keys){return str.replace(/\$([0-9A-Za-z_]+)/g,(whole,name)=>{let namedIdx=keys.indexOf(name);if(namedIdx!==-1)return match[namedIdx+1]??"";if(/^[0-9]+$/.test(name)){let n=parseInt(name,10);if(n<match.length)return match[n]??""}return whole})}function expandEnvVars(str,allowlist,env){let allowed=new Set(allowlist);return str.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}|\$([A-Za-z_][A-Za-z0-9_]*)/g,(match,braced,bare)=>{let name=braced??bare;return!allowed.has(name)||env[name]===void 0?match:env[name]})}function applyRequestHeaderTransforms(headers,transforms){for(let transform of transforms)transform.type==="request.headers"&&"target"in transform&&applyTransform(headers,transform,!0)}function applyQueryTransforms(query,transforms){for(let transform of transforms)transform.type==="request.query"&&"target"in transform&&applyTransform(query,transform,!1);for(let key of Object.keys(query)){let value=query[key];value===void 0?delete query[key]:typeof value=="string"&&(query[key]=[value])}}var HEADER_NAME_RE=/^[-\w]+$/,HEADER_VALUE_RE=/^[-\w:;.,/\\"'?!(){}[\]@<>=+*#$&`|~%^ ]+$/;function isValidHeaderName(name){return name.length>0&&HEADER_NAME_RE.test(name)}function isValidHeaderValue(value){return value.length>0&&HEADER_VALUE_RE.test(value)}function hasValidHeaderArgs(args){return typeof args=="string"?isValidHeaderValue(args):Array.isArray(args)?args.every(isValidHeaderValue):!1}function applyTransform(data,transform,isHeader){let keySelector=transform.target?.key;if(keySelector==null||isHeader&&(transform.op==="set"||transform.op==="append")&&(typeof keySelector=="string"&&!isValidHeaderName(keySelector)||!hasValidHeaderArgs(transform.args)))return;let matchedKeys=findMatchingKeys(data,keySelector);switch(transform.op){case"set":opSet(data,matchedKeys,keySelector,transform.args);break;case"append":opAppend(data,matchedKeys,keySelector,transform.args,isHeader);break;case"delete":opDelete(data,matchedKeys,transform.args,isHeader);break;default:break}}function isValidRequestPath(path6){if(path6===""||path6.length>2048||path6[0]!=="/"||path6.startsWith("//")||/[?#]/.test(path6))return!1;for(let i=0;i<path6.length;i++){let code=path6.charCodeAt(i);if(code<=32||code===127)return!1}return!0}function getRequestPath(transforms){let path6;for(let transform of transforms)transform.type==="request.path"&&transform.op==="set"&&typeof transform.args=="string"&&isValidRequestPath(transform.args)&&(path6=transform.args);return path6}function findMatchingKeys(data,keyPattern){let matched=[];for(let key of Object.keys(data))matchesRule(key,keyPattern)&&matched.push(key);return matched}function matchesRule(candidate,rule){if(candidate=candidate.toLowerCase(),rule==null)return!0;if(typeof rule=="string")return candidate===rule.toLowerCase();let r=rule;for(let[op,val]of Object.entries(r))if(val!==void 0)switch(op){case"eq":if(candidate!==String(val).toLowerCase())return!1;break;case"neq":if(candidate===val.toLowerCase())return!1;break;case"inc":if(!val.some(v=>candidate===v.toLowerCase()))return!1;break;case"ninc":if(val.some(v=>candidate===v.toLowerCase()))return!1;break;case"pre":if(!candidate.startsWith(String(val).toLowerCase()))return!1;break;case"suf":if(!candidate.endsWith(String(val).toLowerCase()))return!1;break;case"sub":if(!candidate.includes(String(val).toLowerCase()))return!1;break;case"gt":if(!(Number(candidate)>val))return!1;break;case"gte":if(!(Number(candidate)>=val))return!1;break;case"lt":if(!(Number(candidate)<val))return!1;break;case"lte":if(!(Number(candidate)<=val))return!1;break;default:break}return!0}function opSet(data,matchedKeys,keySelector,args){for(let key of matchedKeys)data[key]=args;matchedKeys.length===0&&typeof keySelector=="string"&&data[keySelector]===void 0&&!isEmptyArgs(args)&&(data[keySelector]=args)}function opAppend(data,matchedKeys,keySelector,args,isHeader){if(isEmptyArgs(args))return;let toAppend=typeof args=="string"?[args]:args??[];for(let key of matchedKeys){let next=[...toValueList(data[key],isHeader),...toAppend];setTransformValue(data,key,fromValueList(next))}matchedKeys.length===0&&typeof keySelector=="string"&&setTransformValue(data,keySelector,fromValueList(toAppend))}function opDelete(data,matchedKeys,args,isHeader){if(args==null){for(let key of matchedKeys)delete data[key];return}let patterns=typeof args=="string"?[args]:args;for(let key of matchedKeys){let kept=toValueList(data[key],isHeader).filter(value=>!patterns.some(pattern=>matchesRule(value,pattern)));setTransformValue(data,key,fromValueList(kept))}}function toValueList(value,isHeader){if(value===void 0)return[];if(Array.isArray(value))return value;let str=String(value);return isHeader&&str.includes(",")?str.split(",").map(v=>v.trim()).filter(v=>v!==""):[str]}function fromValueList(values){if(values.length!==0)return values.length===1?values[0]:values}function setTransformValue(data,key,value){value===void 0?delete data[key]:data[key]=value}function isEmptyArgs(args){return args==null?!0:typeof args=="string"?args==="":args.length===0}function resolveRouteParameters(str,match,keys){return str.replace(/\$([1-9a-zA-Z]+)/g,(_,param2)=>{let matchIndex=keys.indexOf(param2);return matchIndex===-1?matchIndex=parseInt(param2,10):matchIndex++,match[matchIndex]||""})}function getRoutesTypes(routes=[]){let handleMap=new Map,prevHandle=null;return routes.forEach(route=>{if((0,import_routing_utils.isHandler)(route))prevHandle=route.handle;else{let routes2=handleMap.get(prevHandle);routes2?routes2.push(route):handleMap.set(prevHandle,[route])}}),handleMap}async function devRouter(reqUrl="/",reqMethod,routes,devServer,vercelConfig,previousHeaders,missRoutes,phase){let result,{pathname:reqPathname,search:reqSearch}=url2.parse(reqUrl);reqPathname=reqPathname||"/";let reqQuery=parseQueryString(reqSearch),combinedHeaders={...previousHeaders},status,isContinue=!1,requestTransforms=[],responseTransforms;if(routes){let idx=-1;for(let routeConfig of routes){if(idx++,isContinue=!1,(0,import_routing_utils.isHandler)(routeConfig))continue;let{src,headers,methods}=routeConfig;if(Array.isArray(methods)&&reqMethod&&!methods.includes(reqMethod))continue;let keys=[],flags=devServer&&devServer.isCaseSensitive()?"":"i",matcher=(0,import_pcre_to_regexp.default)(`%${src}%${flags}`,keys),match=matcher.exec(reqPathname)||matcher.exec(reqPathname.substring(1));if(match){let routeTransforms=routeConfig.transforms?resolveTransforms(routeConfig.transforms,{match,keys,env:devServer?.envConfigs.runEnv}):[],isServiceMarker=typeof routeConfig.destination=="object"&&routeConfig.destination!==null&&routeConfig.destination.type==="service";!isServiceMarker&&routeTransforms.length>0&&requestTransforms.push(...routeTransforms);let destPath=reqPathname;if(routeConfig.dest&&(destPath=resolveRouteParameters(routeConfig.dest,match,keys)),headers)for(let originalKey of Object.keys(headers)){let lowerKey=originalKey.toLowerCase();if(!(previousHeaders&&Object.prototype.hasOwnProperty.call(previousHeaders,lowerKey)&&(phase==="hit"||phase==="miss"))){let originalValue=headers[originalKey],value=resolveRouteParameters(originalValue,match,keys);combinedHeaders[lowerKey]=value}}if(routeConfig.continue){routeConfig.status&&(status=routeConfig.status),routeTransforms.length>0&&(responseTransforms=routeTransforms),reqPathname=destPath,isContinue=!0;continue}let isDestUrl=isURL(destPath);if(routeConfig.check&&devServer&&vercelConfig&&phase!=="hit"&&!isDestUrl){let{pathname}=url2.parse(destPath);if(pathname=pathname||"/",!await devServer.hasFilesystem(pathname,vercelConfig)&&!(routeConfig.status&&phase!=="miss"))if(missRoutes&&missRoutes.length>0){routeTransforms.length>0&&(responseTransforms=routeTransforms);let missResult=await devRouter(destPath,reqMethod,missRoutes,devServer,vercelConfig,combinedHeaders,[],"miss");if(missResult.found)return requestTransforms.length>0&&(missResult.requestTransforms=[...requestTransforms,...missResult.requestTransforms??[]]),!missResult.responseTransforms&&responseTransforms&&(missResult.responseTransforms=responseTransforms),missResult;reqPathname=destPath;continue}else{routeConfig.status&&phase==="miss"&&(status=routeConfig.status),routeTransforms.length>0&&(responseTransforms=routeTransforms),reqPathname=destPath;continue}}let effectiveStatus=routeConfig.status||status,isRedirectExit=typeof effectiveStatus=="number"&&effectiveStatus>=300&&effectiveStatus<400;if(!isServiceMarker&&!isRedirectExit&&routeTransforms.length>0&&(responseTransforms=routeTransforms),isDestUrl){result={found:!0,dest:destPath,continue:isContinue,userDest:!1,isDestUrl,status:routeConfig.status||status,headers:combinedHeaders,query:reqQuery,matched_route:routeConfig,matched_route_idx:idx,phase,requestTransforms,responseTransforms};break}else{destPath.startsWith("/")||(destPath=`/${destPath}`);let{pathname:destPathname,search:destSearch}=url2.parse(destPath);destPathname=destPathname||"/";let destQuery=parseQueryString(destSearch);Object.assign(destQuery,reqQuery),result={found:!0,dest:destPathname,continue:isContinue,userDest:!!routeConfig.dest,isDestUrl,status:routeConfig.status||status,headers:combinedHeaders,query:destQuery,matched_route:routeConfig,matched_route_idx:idx,phase,requestTransforms,responseTransforms};break}}}}return result||(result={found:!1,dest:reqPathname,continue:isContinue,status,isDestUrl:!1,query:reqQuery,headers:combinedHeaders,phase,requestTransforms,responseTransforms}),result}var import_mime_types=__toESM(require_mime_types(),1);import path from"path";function getMimeType(fileName){let extension=path.extname(fileName);return(0,import_mime_types.contentType)(extension)||"application/octet-stream"}var import_ms2=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1);import{readFileSync,unlinkSync}from"fs";import{delimiter,dirname,join as join2}from"path";import{fork}from"child_process";import{createFunction}from"@vercel/fun";var import_error_utils=__toESM(require_dist(),1);import{chmod}from"node:fs/promises";import{join}from"node:path";import{initializeRuntime,runtimes}from"@vercel/fun";var LAUNCHERS=["bootstrap","executable"];async function initializeFunRuntime(name){let runtime=runtimes[name];if(!runtime)return;let{cacheDir}=await initializeRuntime(runtime);if(cacheDir)for(let launcher of LAUNCHERS)try{await chmod(join(cacheDir,launcher),493)}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ENOENT")throw err}}var import_build_utils3=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist4(),1),import_pluralize=__toESM(require_pluralize(),1),import_minimatch=__toESM(require_minimatch(),1);var import_tree_kill=__toESM(require_tree_kill(),1);function treeKill(pid,signal="SIGTERM"){return new Promise((resolve3,reject)=>{(0,import_tree_kill.default)(pid,signal,err=>{err?reject(err):resolve3()})})}var import_routing_utils2=__toESM(require_dist3(),1);async function getUnsupportedBuilderVersionError(version){let updateMessage;try{updateMessage=`Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`}catch(error3){updateMessage=error3 instanceof Error?error3.message:"Update the CLI with the package manager that installed it."}return dev.DEV_UNSUPPORTED_BUILDER_VERSION({titleName:getTitleName(),version,updateMessage})}async function deserializeOutput(obj){switch(obj.type){case"FileFsRef":return Object.assign(Object.create(import_build_utils3.FileFsRef.prototype),obj);case"FileBlob":{let fileBlob=Object.assign(Object.create(import_build_utils3.FileBlob.prototype),obj);return fileBlob.data=Buffer.from(obj.data.data),fileBlob}case"Lambda":{let lambda=Object.assign(Object.create(import_build_utils3.Lambda.prototype),obj);if(obj.zipBufferPath){lambda.zipBuffer=readFileSync(obj.zipBufferPath);try{unlinkSync(obj.zipBufferPath)}catch{}}else obj.zipBuffer&&(lambda.zipBuffer=Buffer.from(obj.zipBuffer.data));return lambda}}}async function deserializeBuildOutputs(serialized){let result={};for(let[name,obj]of Object.entries(serialized))result[name]=await deserializeOutput(obj);return result}async function createBuildProcess(match,envConfigs,workPath){output_manager_default.debug(`Creating build process for "${match.entrypoint}"`);let builderWorkerPath=join2(__dirname,"builder-worker.cjs"),nodeExecPath=(0,import_build_utils3.getNodeExecPath)(),PATH=`${dirname(nodeExecPath)}${delimiter}${process.env.PATH}`,env={...process.env,PATH,...envConfigs.allEnv},buildProcess=fork(builderWorkerPath,[],{cwd:workPath,execArgv:[],execPath:isNativeBinaryInstall()?process.execPath:nodeExecPath,env});return match.buildProcess=buildProcess,buildProcess.on("close",(code,signal)=>{output_manager_default.debug(`Build process for "${match.entrypoint}" exited with ${signal||code}`),match.buildProcess=void 0}),new Promise((resolve3,reject)=>{buildProcess.once("message",data=>{data!==null&&typeof data=="object"&&data.type!=="ready"?reject(new Error('Did not get "ready" event from builder')):resolve3(buildProcess)})})}async function executeBuild(vercelConfig,devServer,files,match,requestPath,isInitialBuild,filesChanged,filesRemoved){let{builderWithPkg:{path:requirePath,builder,pkg}}=match,{entrypoint,use}=match,isStatic=(0,import_fs_detectors.isStaticRuntime)(use),{envConfigs,cwd:workPath,devCacheDir}=devServer,debug=output_manager_default.isDebugEnabled(),startTime=Date.now(),showBuildTimestamp=!isStatic&&(!isInitialBuild||debug);showBuildTimestamp&&(output_manager_default.log(`Building ${use}:${entrypoint}`),output_manager_default.debug(`Using \`${pkg.name}${pkg.version?`@${pkg.version}`:""}\``));let config=match.config||{},result,{buildProcess}=match;!isStatic&&!buildProcess&&(buildProcess=await createBuildProcess(match,envConfigs,workPath));let serviceRoutePrefix=config.routePrefix,serviceWorkspace=config.workspace,buildOptions={files,entrypoint,workPath,repoRootPath:workPath,config,meta:{isDev:!0,requestPath,devCacheDir,filesChanged,filesRemoved,env:{...envConfigs.runEnv},buildEnv:{...envConfigs.buildEnv}},...typeof serviceRoutePrefix=="string"||typeof serviceWorkspace=="string"?{service:{routePrefix:typeof serviceRoutePrefix=="string"?serviceRoutePrefix:void 0,workspace:typeof serviceWorkspace=="string"?serviceWorkspace:void 0}}:void 0},buildResultOrOutputs;buildProcess?(buildProcess.send({type:"build",requirePath,buildOptions}),buildResultOrOutputs=await new Promise((resolve3,reject)=>{function onMessage({type,result:result2,error:error3}){cleanup(),type==="buildResult"?result2?resolve3(result2):error3&&reject(Object.assign(new Error,error3)):reject(new Error(`Got unexpected message type: ${type}`))}function onExit(code,signal){cleanup();let err=new Error(`Builder exited with ${signal||code} before sending build result`);reject(err)}function cleanup(){buildProcess.removeListener("close",onExit),buildProcess.removeListener("message",onMessage)}buildProcess.on("close",onExit),buildProcess.on("message",onMessage)})):buildResultOrOutputs=await builder.build(buildOptions);let effectiveVersion=builder.version;if(effectiveVersion===-1)if("resultVersion"in buildResultOrOutputs){let vx=buildResultOrOutputs;effectiveVersion=vx.resultVersion,buildResultOrOutputs=vx.result}else effectiveVersion=buildResultOrOutputs.output?.type==="Lambda"?3:2;if(!effectiveVersion||effectiveVersion===1)result={output:buildResultOrOutputs,routes:[],watch:[]};else if(effectiveVersion===2)result=buildResultOrOutputs;else if(effectiveVersion===3){let{output,...rest}=buildResultOrOutputs;if(!output||output.type!=="Lambda")throw dev.DEV_BUILDER_RESULT_NOT_LAMBDA();if(output.maxDuration)throw dev.DEV_BUILDER_RESULT_HAS_MAXDURATION();if(output.affinity)throw new Error('The result of "builder.build()" must not contain `affinity`');if(output.maxConcurrency)throw new Error('The result of "builder.build()" must not contain `maxConcurrency`');if(output.memory)throw dev.DEV_BUILDER_RESULT_HAS_MEMORY();for(let[src,func]of Object.entries(config.functions||{}))if(src===entrypoint||(0,import_minimatch.default)(entrypoint,src)){func.maxDuration&&(output.maxDuration=func.maxDuration),func.affinity&&(output.affinity=func.affinity),func.maxConcurrency&&(output.maxConcurrency=func.maxConcurrency),func.memory&&(output.memory=func.memory);break}result={...rest,output:{[entrypoint]:output}}}else throw await getUnsupportedBuilderVersionError(builder.version);let normalized=(0,import_routing_utils2.normalizeRoutes)(result.routes);if(normalized.error)throw dev.DEV_INVALID_ROUTES({message:normalized.error.message});result.routes=normalized.routes||[];let{output:buildOutput}=result,{cleanUrls}=vercelConfig;for(let[originalPath,value]of Object.entries(buildOutput)){let path6=(0,import_build_utils3.normalizePath)(originalPath);cleanUrls&&path6.endsWith(".html")&&(path6=path6.slice(0,-5),(value.type==="FileBlob"||value.type==="FileFsRef")&&(value.contentType=value.contentType||"text/html; charset=utf-8"));let extensionless=devServer.getExtensionlessFile(path6);extensionless&&(path6=extensionless),buildOutput[path6]=value}let deserializedOutput=await deserializeBuildOutputs(buildOutput);for(let[name,output]of Object.entries(deserializedOutput))buildOutput[name]=output;result.watch=(result.watch||[]).map(w=>w.startsWith("./")?w.substring(2):w),result.watch.includes(entrypoint)||result.watch.push(entrypoint);let maxLambdaBytes=(0,import_bytes.default)("50mb");for(let asset2 of Object.values(result.output))if(asset2.type==="Lambda"&&!(typeof asset2.runtime=="string"&&asset2.runtime.startsWith("python"))&&asset2.runtime!=="container"){let size=asset2.zipBuffer.length;if(size>maxLambdaBytes)throw new LambdaSizeExceededError(size,maxLambdaBytes)}if(await Promise.all(Object.entries(result.output).map(async entry=>{let path6=entry[0],asset2=entry[1];if(asset2.type==="Lambda"&&asset2.runtime!=="container"){let oldAsset=match.buildOutput&&match.buildOutput[path6];oldAsset&&oldAsset.type==="Lambda"&&oldAsset.fn&&await oldAsset.fn.destroy();let ZipFile=asset2.zipBuffer||await asset2.createZip();await initializeFunRuntime(asset2.runtime),asset2.fn=await createFunction({Code:{ZipFile},Handler:asset2.handler,Runtime:asset2.runtime,MemorySize:asset2.memory||3009,Environment:{Variables:{...vercelConfig.env,...asset2.environment,...envConfigs.runEnv}}})}match.buildTimestamp=Date.now()})),match.buildResultVersion=effectiveVersion,match.buildResults.set(requestPath,result),Object.assign(match.buildOutput,result.output),showBuildTimestamp){let endTime=Date.now();output_manager_default.log(`Built ${use}:${entrypoint} [${(0,import_ms2.default)(endTime-startTime)}]`)}}async function getBuildMatches(vercelConfig,cwd,devServer,fileList){let matches=[];if(fileList.length===0)return matches;let noMatches=[],builds=vercelConfig.builds||[{src:"**",use:"@vercel/static"}],builderSpecs=new Set(builds.map(b=>b.use).filter(Boolean)),buildersWithPkgs=await importBuilders(builderSpecs,cwd);for(let buildConfig of builds){let{src="**",use,config={}}=buildConfig;if(!use)continue;src[0]==="/"&&(src=src.substring(1)),(0,import_build_utils3.isBackendFramework)(buildConfig.config?.framework)&&(src="package.json");let mapToEntrypoint=new Map;if(buildConfig.config?.framework&&(0,import_build_utils3.isPythonFramework)(buildConfig.config?.framework)){let originalSrc=src,existing=["pyproject.toml","requirements.txt","Pipfile"].filter(p=>fileList.includes(p));existing.length>0&&(src=existing[0],mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="node"&&!fileList.includes(src)){let originalSrc=src,existing=fileList.find(path6=>/^(?:src\/)?server\.[cm]?[jt]s$/.test(path6));existing&&(src=existing,mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="go"&&!fileList.includes(src)){let originalSrc=src,existing=["main.go","cmd/api/main.go","cmd/server/main.go"].filter(p=>fileList.includes(p));existing.length>0&&(src=existing[0],mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="rust"&&src==="src/main.rs"&&!fileList.includes(src)){let originalSrc=src;fileList.includes("Cargo.toml")&&(src="Cargo.toml",mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="container"&&!fileList.includes(src)){let originalSrc=src,existing=["Dockerfile.vercel","Containerfile.vercel","Dockerfile","Containerfile"].find(p=>fileList.includes(p));existing&&(src=existing,mapToEntrypoint.set(src,originalSrc))}let extensionless=devServer.getExtensionlessFile(src);extensionless&&(mapToEntrypoint.set(extensionless,src),src=extensionless);let files=fileList.filter(name=>name===src||(0,import_minimatch.default)(name,src,{dot:!0})).map(name=>join2(cwd,name));files.length===0&&(config.zeroConfig&&use==="@vercel/static"||noMatches.push(buildConfig));for(let file of files){src=relative(cwd,file);let entrypoint=mapToEntrypoint.get(src)||src;if(config.zeroConfig&&config.outputDirectory){let outputMatch=config.outputDirectory+"/";src.startsWith(outputMatch)&&(src=src.slice(outputMatch.length))}let builderWithPkg=buildersWithPkgs.get(use);if(!builderWithPkg)throw dev.DEV_BUILDER_LOAD_FAILED({use});matches.push({...buildConfig,src,entrypoint,builderWithPkg,buildOutput:{},buildResults:new Map,buildTimestamp:0})}}if(noMatches.length>0){output_manager_default.warn(`You defined ${(0,import_pluralize.default)("build",noMatches.length,!0)} that did not match any source files (please ensure they are NOT defined in ${highlight(".vercelignore")}):`);for(let buildConfig of noMatches)output_manager_default.print(`- ${JSON.stringify(buildConfig)}
23
+ `)}return matches}async function shutdownBuilder(match){let ops=[];if(match.buildProcess){let{pid}=match.buildProcess;output_manager_default.debug(`Killing builder sub-process with PID ${pid}`);let killPromise=treeKill(pid).then(()=>{output_manager_default.debug(`Killed builder with PID ${pid}`)}).catch(err=>{output_manager_default.debug(`Failed to kill builder with PID ${pid}: ${err}`)});ops.push(killPromise),delete match.buildProcess}if(match.buildOutput)for(let asset2 of Object.values(match.buildOutput))asset2.type==="Lambda"&&asset2.fn&&(output_manager_default.debug("Shutting down Lambda function"),ops.push(asset2.fn.destroy()));await Promise.all(ops)}var import_build_utils4=__toESM(require_build_utils(),1),import_frameworks=__toESM(require_frameworks(),1);var BUILDPACK_DEV_UNSUPPORTED="BUILDPACK_DEV_UNSUPPORTED";function getBuildpackRuntime(builder){let buildpack=builder?.config?.buildpack;return typeof buildpack=="string"&&buildpack.length>0?buildpack:void 0}function runtimeDisplayName(runtime){return import_frameworks.frameworkList.find(f=>f.slug===runtime)?.name??runtime}function buildpackDevUnsupportedError(runtime){return new import_build_utils4.NowBuildError({code:BUILDPACK_DEV_UNSUPPORTED,message:`${getCommandName("dev")} doesn't support ${runtimeDisplayName(runtime)} projects yet.`})}function buildpackServicesDevUnsupportedError(services){let names=services.map(s=>`"${s.name}"`),list=names.length===1?names[0]:`${names.slice(0,-1).join(", ")} and ${names[names.length-1]}`,label=`${[...new Set(services.map(s=>runtimeDisplayName(s.runtime)))].join(" and ")} ${names.length===1?"service":"services"}`;return new import_build_utils4.NowBuildError({code:BUILDPACK_DEV_UNSUPPORTED,message:`${getCommandName("dev")} doesn't support the ${label} ${list} yet.`})}function assertNoBuildpackServices(services){let blocked=[];for(let service of services){let runtime=getBuildpackRuntime(service.builder);runtime&&blocked.push({name:service.name,runtime})}if(blocked.length>0)throw buildpackServicesDevUnsupportedError(blocked)}var httpStatusDescriptionMap=new Map([[400,"BAD_REQUEST"],[402,"PAYMENT_REQUIRED"],[403,"FORBIDDEN"],[404,"NOT_FOUND"],[405,"NOT_ALLOWED"],[410,"GONE"],[413,"PAYLOAD_TOO_LARGE"],[429,"RATE_LIMITED"],[500,"INTERNAL_SERVER_ERROR"],[501,"NOT_IMPLEMENTED"],[502,"BAD_GATEWAY"],[503,"SERVICE_UNAVAILABLE"],[504,"GATEWAY_TIMEOUT"],[508,"INFINITE_LOOP"]]),errorMessageMap=new Map([[400,"Bad request"],[402,"Payment required"],[403,"You don't have the required permissions"],[404,"The page could not be found"],[405,"Method not allowed"],[410,"The deployment has been removed"],[413,"Request Entity Too Large"],[429,"Rate limited"],[500,"A server error has occurred"],[501,"Not implemented"],[503,"The deployment is currently unavailable"],[504,"An error occurred with your deployment"],[508,"Infinite loop detected"]]),appError={title:"An error occurred with this application.",subtitle:"This is an error with the application itself, not the platform.",app_error:!0},pageNotFoundError={title:"The page could not be found.",subtitle:"The page could not be found in the application.",app_error:!0};function generateErrorMessage(statusCode,errorCode){return statusCode===404?pageNotFoundError:statusCode===502?appError:{title:errorMessageMap.get(statusCode)||"Error occurred",app_error:!1}}function generateHttpStatusDescription(statusCode){return httpStatusDescriptionMap.get(statusCode)||"UNKNOWN_ERROR"}function createErrorReporter2(recordCode){return createErrorReporter(recordCode,toDiagnostic2,telemetryCodes)}var import_escape_html=__toESM(require_escape_html(),1);function error(it){let out="<main> ";return it.error_code=="EDGE_FUNCTION_INVOCATION_FAILED"&&(out+=' <p class="error-title error-title-guilty"> <strong>This Edge Function</strong><span> has crashed.</span> </p> '),out+=" ",it.error_code=="FUNCTION_INVOCATION_FAILED"&&(out+=' <p class="error-title error-title-guilty"> <strong>This Serverless Function</strong><span> has crashed.</span> </p> '),out+=' <p class="devinfo-container"> <span class="error-code"><strong>'+it.http_status_code+"</strong>: "+(0,import_escape_html.default)(it.http_status_description)+"</span> ",it.error_code&&(out+=' <span class="devinfo-line">Code: <code>'+(0,import_escape_html.default)(it.error_code)+"</code></span> "),out+=' <span class="devinfo-line">ID: <code>'+(0,import_escape_html.default)(it.request_id)+"</code> </p> <p> <ul> <li> Check the logs in your terminal window to see the application error. </li> </ul> </p></main>",out}var import_escape_html2=__toESM(require_escape_html(),1);function error_base(it){return'<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#000"> <title>'+it.http_status_code+": "+(0,import_escape_html2.default)(it.http_status_description)+`</title> <style> html { font-size: 62.5%; box-sizing: border-box; height: -webkit-fill-available } *, ::after, ::before { box-sizing: inherit } body { font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif; font-size: 1.6rem; line-height: 1.65; word-break: break-word; font-kerning: auto; font-variant: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; hyphens: auto; height: 100vh; height: -webkit-fill-available; max-height: 100vh; max-height: -webkit-fill-available; margin: 0 } ::selection { background: #79FFE1; } ::-moz-selection { background: #79FFE1; } a { cursor: pointer; color: #0070f3; text-decoration: none; transition: all .2s ease; border-bottom: 1px solid transparent } a:hover { border-bottom: 1px solid #0070f3 } ul { padding: 0; margin-left: 1.5em; list-style-type: none } li { margin-bottom: 10px } ul li:before { content: '\\02013' } li:before { display: inline-block; color: #ccc; position: absolute; margin-left: -18px; transition: color .2s ease } code { font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: .92em } code:after, code:before { content: '\`' } .container { display: flex; justify-content: center; flex-direction: column; min-height: 100% } main { max-width: 80rem; padding: 4rem 6rem; margin: auto } ul { margin-bottom: 32px } .error-title { font-size: 2rem; padding-left: 22px; line-height: 1.5; margin-bottom: 24px; } .error-title-guilty { border-left: 2px solid #ED367F; } .error-title-innocent { border-left: 2px solid #59B89C; } main p { color: #333 } .devinfo-container { border: 1px solid #ddd; border-radius: 4px; padding: 2rem; display: flex; flex-direction: column; margin-bottom: 32px } .error-code { margin: 0; font-size: 1.6rem; color: #000; margin-bottom: 1.6rem } .devinfo-line { color: #333 } .devinfo-line code, code, li { color: #000 } .devinfo-line:not(:last-child) { margin-bottom: 8px } .docs-link, .contact-link { font-weight: 500 } header, footer, footer a { display: flex; justify-content: center; align-items: center } header, footer { min-height: 100px; height: 100px; } header { border-bottom: 1px solid #eaeaea; } header h1 { font-size: 1.8rem; margin: 0; font-weight: 500; } header p { font-size: 1.3rem; margin: 0; font-weight: 500; } .header-item { display: flex; padding: 0 2rem; margin: 2rem 0; text-decoration: line-through; color: #999; } .header-item.active { color: #ff0080; text-decoration: none; } .header-item.first { border-right: 1px solid #eaeaea; } .header-item-content { display: flex; flex-direction: column; } .header-item-icon { margin-right: 1rem; margin-top: 0.6rem; } footer { border-top: 1px solid #eaeaea; } footer a { color: #000 } footer a:hover { border-bottom-color: transparent } footer svg { margin-left: .8rem } .note { padding: 8pt 16pt; border-radius: 5px; border: 1px solid #0070f3; font-size: 14px; line-height: 1.8; color: #0070f3; } @media (max-width:500px) { .devinfo-container .devinfo-line code { margin-top: .4rem } .devinfo-container .devinfo-line:not(:last-child) { margin-bottom: 1.6rem } .devinfo-container { margin-bottom: 0; } header { flex-direction: column; height: auto; min-height: auto; align-items: flex-start; } .header-item.first { border-right: none; margin-bottom: 0; } main { padding: 1rem 2rem; } body { font-size: 1.4rem; line-height: 1.55; } footer { display: none; } .note { margin-top: 16px; } } </style> </head> <body> <div class="container"> `+it.view+" </div> </body></html>"}var import_escape_html3=__toESM(require_escape_html(),1);function error_404(it){let out='<main> <p class="devinfo-container"> <span class="error-code"><strong>'+it.http_status_code+"</strong>: "+(0,import_escape_html3.default)(it.http_status_description)+"</span> ";return it.error_code&&(out+=' <span class="devinfo-line">Code: <code>'+(0,import_escape_html3.default)(it.error_code)+"</code></span> "),out+=' <span class="devinfo-line">ID: <code>'+(0,import_escape_html3.default)(it.request_id)+"</code> </p></main>",out}var import_escape_html4=__toESM(require_escape_html(),1);function error_502(it){let out='<main> <p class="devinfo-container"> <span class="error-code"><strong>'+it.http_status_code+"</strong>: "+(0,import_escape_html4.default)(it.http_status_description)+"</span> ";return it.error_code&&(out+=' <span class="devinfo-line">Code: <code>'+(0,import_escape_html4.default)(it.error_code)+"</code></span> "),out+=' <span class="devinfo-line">ID: <code>'+(0,import_escape_html4.default)(it.request_id)+"</code> </p> <p> <ul> <li> Check the logs in your terminal window to see the application error. </li> </ul> </p></main>",out}var import_escape_html5=__toESM(require_escape_html(),1);function redirect(it){return"<!doctype html><!-- https://now.sh --><h1>Redirecting ("+it.statusCode+")</h1><a>"+(0,import_escape_html5.default)(it.location)+"</a>"}var import_ms4=__toESM(require_ms(),1),import_get_port=__toESM(require_get_port(),1),import_chalk=__toESM(require_source(),1),import_frameworks2=__toESM(require_frameworks(),1);import path2 from"path";import{Transform,Writable}from"stream";function parseCronFields(expression){let parts=expression.trim().split(/\s+/);if(parts.length!==5)return null;let[minute,hour,dayOfMonth,month,dayOfWeek]=parts;return{minute,hour,dayOfMonth,month,dayOfWeek}}function expandCronField(field,min,max){let values=new Set;for(let part of field.split(",")){let stepMatch=part.match(/^(.+)\/(\d+)$/),range=stepMatch?stepMatch[1]:part,step=stepMatch?parseInt(stepMatch[2],10):1,start,end;if(range==="*")start=min,end=max;else if(range.includes("-")){let[lo,hi]=range.split("-").map(Number);start=lo,end=hi}else{let val=parseInt(range,10);start=val,end=val}for(let i=start;i<=end;i+=step)values.add(i)}return values}function nextOrWrap(sorted,current){for(let v of sorted)if(v>=current)return v;return null}function dayMatches(date,daysOfMonth,daysOfWeek,orDays){return orDays?daysOfMonth.has(date.getDate())||daysOfWeek.has(date.getDay()):daysOfMonth.has(date.getDate())&&daysOfWeek.has(date.getDay())}function getNextCronDelay(expression,now=new Date){let parsed=parseCronFields(expression);if(!parsed)return null;let minuteSet=expandCronField(parsed.minute,0,59),hourSet=expandCronField(parsed.hour,0,23),domSet=expandCronField(parsed.dayOfMonth,1,31),monthSet=expandCronField(parsed.month,1,12),dowSet=expandCronField(parsed.dayOfWeek,0,6),sortedMinutes=[...minuteSet].sort((a,b)=>a-b),sortedHours=[...hourSet].sort((a,b)=>a-b),sortedMonths=[...monthSet].sort((a,b)=>a-b),orDays=parsed.dayOfMonth!=="*"&&parsed.dayOfWeek!=="*",t=new Date(now);t.setSeconds(0,0),t.setMinutes(t.getMinutes()+1);let maxYear=t.getFullYear()+4;for(;t.getFullYear()<=maxYear;){let month=t.getMonth()+1,nextMonth=nextOrWrap(sortedMonths,month);if(nextMonth===null||nextMonth>month){let targetMonth=nextMonth??sortedMonths[0];nextMonth===null&&t.setFullYear(t.getFullYear()+1),t.setMonth(targetMonth-1,1),t.setHours(sortedHours[0],sortedMinutes[0]);continue}if(!dayMatches(t,domSet,dowSet,orDays)){t.setDate(t.getDate()+1),t.setHours(sortedHours[0],sortedMinutes[0]);continue}let hour=t.getHours(),nextHour=nextOrWrap(sortedHours,hour);if(nextHour===null||nextHour>hour){nextHour===null?(t.setDate(t.getDate()+1),t.setHours(sortedHours[0],sortedMinutes[0])):t.setHours(nextHour,sortedMinutes[0]);continue}let minute=t.getMinutes(),nextMinute=nextOrWrap(sortedMinutes,minute);if(nextMinute===null||nextMinute>minute){nextMinute===null?t.setHours(t.getHours()+1,sortedMinutes[0]):t.setMinutes(nextMinute);continue}return t.getTime()-now.getTime()}return null}var import_build_utils5=__toESM(require_build_utils(),1);var import_service_schedules=__toESM(require_service_schedules(),1);import{chmodSync,mkdirSync,readFileSync as readFileSync2,renameSync,rmSync,writeFileSync}from"node:fs";import{randomUUID}from"node:crypto";import{dirname as dirname2,isAbsolute,join as join3,normalize,sep}from"node:path";var manifest_default={nextDevWebSocketPreload:{source:"node-preloads/next-dev-websocket.cjs",destination:"node-preloads/next-dev-websocket.cjs"},devTunnelFunction:{source:"dev-tunnel/api/tunnel.ts",destination:"dev-tunnel/api/tunnel.ts"},devTunnelEnv:{source:"dev-tunnel/lib/env.ts",destination:"dev-tunnel/lib/env.ts"},devTunnelProto:{source:"dev-tunnel/lib/tunnel_pb.ts",destination:"dev-tunnel/lib/tunnel_pb.ts"}};var runtimeAssets=manifest_default;function getRuntimeAssetsDir(version=pkg_default.version,globalRoot=getGlobalPathConfig()){return join3(globalRoot,"runtime-assets",version)}function materializeRuntimeAsset(id,options={}){let definition2=runtimeAssets[id];if(!definition2)throw new Error(`Unknown runtime asset: ${String(id)}`);let source=validateRelativePath(id,"source",definition2.source),destination=validateRelativePath(id,"destination",definition2.destination),data=readRuntimeAsset(source),destinationPath=join3(getRuntimeAssetsDir(options.version??pkg_default.version,options.globalRoot??getGlobalPathConfig()),destination),destinationDir=dirname2(destinationPath),temporaryPath=`${destinationPath}.${process.pid}.${randomUUID()}.tmp`;mkdirSync(destinationDir,{recursive:!0});try{writeFileSync(temporaryPath,new Uint8Array(data.buffer,data.byteOffset,data.byteLength)),definition2.executable&&chmodSync(temporaryPath,493);try{renameSync(temporaryPath,destinationPath)}catch(error3){let code=error3.code;if(code!=="EEXIST"&&code!=="EPERM")throw error3;rmSync(destinationPath,{force:!0}),renameSync(temporaryPath,destinationPath)}}finally{rmSync(temporaryPath,{force:!0})}return destinationPath}function readRuntimeAsset(source,moduleDir=__dirname){let candidates=[join3(moduleDir,"runtime-assets",source),join3(moduleDir,"..","runtime-assets",source),join3(moduleDir,"..","..","runtime-assets",source)],lastError;for(let candidate of candidates)try{return readFileSync2(candidate)}catch(error3){if(error3.code!=="ENOENT")throw error3;lastError=error3}throw lastError}function validateRelativePath(id,field,value){let normalized=normalize(value);if(!value||isAbsolute(value)||normalized===".."||normalized.startsWith(`..${sep}`))throw new Error(`Runtime asset "${id}" has an invalid ${field} path: ${JSON.stringify(value)}`);return normalized}function injectNextDevWebSocketShimIfNeeded(env,command,projectSettings,runtimeOptions){if(!shouldInjectNextDevWebSocketShim(command,projectSettings))return;let shimPath=materializeRuntimeAsset("nextDevWebSocketPreload",runtimeOptions);return env.NODE_OPTIONS=prependNodeRequireOption(env.NODE_OPTIONS,shimPath),shimPath}function shouldInjectNextDevWebSocketShim(command,projectSettings){return projectSettings?.framework==="nextjs"||/(?:^|\s)(?:next|next\.js)(?:\s+dev)?(?:\s+-|\s*$|$)/.test(command)}function prependNodeRequireOption(nodeOptions,requirePath){let requireOption=`--require ${JSON.stringify(requirePath)}`;return nodeOptions?`${requireOption} ${nodeOptions}`:requireOption}function replaceDevCommandPort(command,port){return command.replace(/\$PORT/g,`${port}`).replace(/%PORT%/g,`${port}`)}var import_ms3=__toESM(require_ms(),1);var DEV_RUNTIME_CACHE_PREFIX="/_svc/_cache/",DEV_RUNTIME_CACHE_API_PREFIX="/v1/suspense-cache/",DEV_RUNTIME_CACHE_ITEM_PREFIX=`${DEV_RUNTIME_CACHE_PREFIX}v1/suspense-cache/`,HEADER_CACHE_STATE="x-vercel-cache-state",HEADER_CACHE_TAGS="x-vercel-cache-tags",HEADER_REVALIDATE="x-vercel-revalidate",HEADER_CACHE_ITEM_NAME="x-vercel-cache-item-name",TICK_INTERVAL=(0,import_ms3.default)("1m");function getDevRuntimeCacheEnv(origin,itemPrefix=DEV_RUNTIME_CACHE_ITEM_PREFIX){return{RUNTIME_CACHE_ENDPOINT:`${origin}${itemPrefix}`,RUNTIME_CACHE_HEADERS:JSON.stringify({authorization:`Bearer ${DEV_RESOURCE_TOKEN}`})}}var RuntimeCacheStore=class{constructor(){this.entries=new Map;this.tagExpirations=new Map;this.sequence=0;this.tickTimer=setInterval(()=>this.tick(),TICK_INTERVAL),this.tickTimer.unref()}get(key){let entry=this.entries.get(key);return entry?this.isStale(entry)?(this.entries.delete(key),null):{value:entry.value,tags:entry.tags,ageSeconds:Math.floor((Date.now()-entry.lastModified)/1e3)}:null}set(key,value,options={}){let ttlSeconds=options.ttlSeconds;this.entries.set(key,{value,tags:options.tags??[],ttlMs:ttlSeconds&&ttlSeconds>0?ttlSeconds*1e3:null,lastModified:Date.now(),sequence:++this.sequence})}delete(key){this.entries.delete(key)}expireTags(tags){let sequence=++this.sequence;for(let tag of tags)this.tagExpirations.set(tag,sequence)}size(){return this.entries.size}stop(){clearInterval(this.tickTimer)}isStale(entry){if(entry.ttlMs!==null&&entry.lastModified+entry.ttlMs<=Date.now())return!0;for(let tag of entry.tags){let expiredAt=this.tagExpirations.get(tag);if(expiredAt!==void 0&&expiredAt>entry.sequence)return!0}return!1}tick(){for(let[key,entry]of this.entries)this.isStale(entry)&&this.entries.delete(key)}};var STARTUP_TIMEOUT=(0,import_ms4.default)("5m"),SERVICE_COLORS=[import_chalk.default.cyan,import_chalk.default.magenta,import_chalk.default.yellow,import_chalk.default.green,import_chalk.default.blue];function createServiceLogger(serviceName,colorIndex,maxNameLength){let color=SERVICE_COLORS[colorIndex%SERVICE_COLORS.length],padding=" ".repeat(maxNameLength-serviceName.length),prefix=color(`[${serviceName}]`)+padding,createTransform=streamLabel=>{let buffer="",labelPrefix=output_manager_default.debugEnabled?`${prefix} ${import_chalk.default.gray(`(${streamLabel})`)}`:prefix;return new Transform({transform(chunk,_encoding,callback){buffer+=chunk.toString();let lines=buffer.split(`
24
+ `);if(buffer=lines.pop()||"",lines.length>0){let prefixed=lines.map(line=>`${labelPrefix} ${line}`).join(`
25
+ `);callback(null,prefixed+`
26
+ `)}else callback(null,"")},flush(callback){buffer?callback(null,`${labelPrefix} ${buffer}
27
+ `):callback(null,"")}})},stdout=createTransform("stdout"),stderr=createTransform("stderr");return stdout.pipe(process.stdout),stderr.pipe(process.stderr),{stdout,stderr,cleanup:()=>{stdout.unpipe(process.stdout),stderr.unpipe(process.stderr),stdout.destroy(),stderr.destroy()}}}function getServiceRoutePrefixes(service){return(0,import_build_utils5.isQueueTriggeredService)(service)||(0,import_build_utils5.isWorkflowTriggeredService)(service)?[(0,import_build_utils5.getInternalServiceWorkerPathPrefix)(service.name)]:(0,import_build_utils5.isScheduleTriggeredService)(service)?[(0,import_build_utils5.getInternalServiceCronPathPrefix)(service.name)]:service.type==="web"?[service.routePrefix||"/"]:[]}function getEntrypointForService(builderSrc,entrypoint,dir){let resolved=builderSrc||entrypoint||"";if(dir&&dir!=="."){let prefix=dir.endsWith("/")?dir:`${dir}/`;resolved.startsWith(prefix)&&(resolved=resolved.slice(prefix.length))}return resolved}var FORCE_KILL_GRACE_MS=2e3,STOP_ALL_TIMEOUT_MS=8e3;function killGroup(pid,signal){try{return process.kill(-pid,signal),!0}catch(err){let code=err.code;if(code==="ESRCH"||code==="EPERM")return!1;throw err}}function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}function waitForExit(pid,proc,timeoutMs){return proc&&(proc.exitCode!==null||proc.signalCode!==null)||!isProcessAlive(pid)?Promise.resolve(!0):new Promise(resolve3=>{let settled=!1,finish=died=>{settled||(settled=!0,clearInterval(poll),clearTimeout(deadline),proc&&proc.removeListener("exit",onExit),resolve3(died))},onExit=()=>finish(!0);proc&&proc.once("exit",onExit);let poll=setInterval(()=>{isProcessAlive(pid)||finish(!0)},100),deadline=setTimeout(()=>finish(!1),timeoutMs)})}var ServicesOrchestrator=class{constructor(options){this.managedServices=new Map;this.managedProcesses=new Map;this.servicePorts=new Map;this.installMeta={};this.cronTimers=[];this.stopping=!1;this.services=options.services,this.cwd=options.cwd,this.repoRoot=options.repoRoot,this.maxNameLength=Math.max(...options.services.map(s=>s.name.length)),this.proxyOrigin=options.proxyOrigin,this.resourceEndpoints=options.resourceEndpoints,this.envFilesValues=options.env,this.useImplicitEnvInjection=options.useImplicitEnvInjection,this.preferServiceBuilder=options.preferServiceBuilder??!1,this.onQueueSubscriptions=options.onQueueSubscriptions;let pythonWorkspaces=options.services.filter(service=>service.runtime==="python").map(service=>path2.resolve(this.cwd,(0,import_build_utils5.isExperimentalServiceV2)(service)?service.root||".":service.workspace||"."));this.pythonServiceCount=new Set(pythonWorkspaces).size,this.hasQueueServices=options.services.filter(import_build_utils5.isExperimentalService).some(import_build_utils5.isQueueBackedService)}forceKillAllSync(){let killOne=pid=>{if(pid)try{killGroup(pid,"SIGKILL")}catch{}};for(let[,proc]of this.managedProcesses)killOne(proc.pid);for(let[,service]of this.managedServices)killOne(service.pid)}registerExitBackstop(){if(this.exitBackstop)return;let backstop=()=>this.forceKillAllSync();this.exitBackstop=backstop,process.on("exit",backstop)}unregisterExitBackstop(){this.exitBackstop&&(process.removeListener("exit",this.exitBackstop),this.exitBackstop=void 0)}async startAll(){output_manager_default.debug(`Starting ${this.services.length} services`),this.registerExitBackstop(),await this.allocateServicePorts();let startPromises=this.services.map((service,index)=>this.startService(service,index).then(result=>(this.managedServices.set(result.name,result),result))),failures=(await Promise.allSettled(startPromises)).filter(r=>r.status==="rejected");if(failures.length>0)throw await this.stopAll(),new ServiceStartError(failures.map(f=>f.reason));output_manager_default.debug(`All ${this.managedServices.size} services started successfully`),this.startCronSchedulers()}async stopAll(){if(this.stopping)return;this.stopping=!0;let totalCount=this.managedServices.size+this.managedProcesses.size;output_manager_default.debug(`Stopping ${totalCount} services/processes`);let stopPromises=[];for(let[name,service]of this.managedServices){output_manager_default.debug(`Stopping service "${name}" (PID: ${service.pid})`);let stopService=async()=>{service.shutdown&&await service.shutdown().catch(err=>{output_manager_default.debug(`Failed to shutdown service "${name}": ${err}`)}),service.pid&&await this.terminateProcessGroup(name,service.pid,service.process).catch(err=>{output_manager_default.debug(`Failed to kill service "${name}": ${err}`)})};stopPromises.push(stopService()),service.logger.cleanup()}for(let[name,proc]of this.managedProcesses)proc.pid&&!this.managedServices.has(name)&&(output_manager_default.debug(`Stopping process "${name}" (PID: ${proc.pid})`),stopPromises.push(this.terminateProcessGroup(name,proc.pid,proc).catch(err=>{output_manager_default.debug(`Failed to stop process "${name}": ${err}`)})));for(let timer of this.cronTimers)clearTimeout(timer);this.cronTimers=[];let timedOut=!1,timeoutHandle,timeout=new Promise(resolve3=>{timeoutHandle=setTimeout(()=>{timedOut=!0,output_manager_default.debug(`stopAll timed out after ${STOP_ALL_TIMEOUT_MS}ms; remaining processes will be SIGKILLed on exit`),resolve3()},STOP_ALL_TIMEOUT_MS)});try{await Promise.race([Promise.all(stopPromises),timeout])}finally{timeoutHandle&&clearTimeout(timeoutHandle)}timedOut||(this.managedServices.clear(),this.managedProcesses.clear(),this.unregisterExitBackstop(),output_manager_default.debug("All services stopped"))}async terminateProcessGroup(name,pid,proc){try{killGroup(pid,"SIGTERM")}catch(err){output_manager_default.debug(`SIGTERM group kill for "${name}" failed: ${err}`)}if(await treeKill(pid,"SIGTERM").catch(err=>{output_manager_default.debug(`tree-kill (SIGTERM) for "${name}" failed: ${err}`)}),!await waitForExit(pid,proc,FORCE_KILL_GRACE_MS)){output_manager_default.debug(`Escalating to SIGKILL for "${name}" (PID: ${pid})`);try{killGroup(pid,"SIGKILL")}catch(err){output_manager_default.debug(`SIGKILL group kill for "${name}" failed: ${err}`)}await treeKill(pid,"SIGKILL").catch(()=>{})}}getServiceForRoute(pathname){let bestMatch=null,bestMatchLength=-1;for(let service of this.managedServices.values())for(let routePrefix of service.routePrefixes){if(routePrefix==="/"){bestMatchLength===-1&&(bestMatch=service,bestMatchLength=0);continue}let normalizedPrefix=routePrefix.startsWith("/")?routePrefix:`/${routePrefix}`;(pathname===normalizedPrefix||pathname.startsWith(`${normalizedPrefix}/`))&&normalizedPrefix.length>bestMatchLength&&(bestMatch=service,bestMatchLength=normalizedPrefix.length)}return bestMatch}getServiceOrigin(serviceName){let service=this.managedServices.get(serviceName);return service?`http://${service.host}:${service.port}`:null}hasServices(){return this.managedServices.size>0}getServices(){return this.managedServices}async allocateServicePorts(){let used=new Set;for(let service of this.services){let port=await(0,import_get_port.default)();for(;used.has(port);)port=await(0,import_get_port.default)();used.add(port),this.servicePorts.set(service.name,port)}}async startService(service,colorIndex){let logger=createServiceLogger(service.name,colorIndex,this.maxNameLength),spec=(0,import_build_utils5.isExperimentalServiceV2)(service)?this.getV2StartSpec(service):this.getV1StartSpec(service),port=this.servicePorts.get(service.name);port!==void 0&&(spec.env.VERCEL_DEV_PORT=String(port));let buildpackRuntime=getBuildpackRuntime(service.builder);if(buildpackRuntime)throw buildpackServicesDevUnsupportedError([{name:service.name,runtime:buildpackRuntime}]);if(spec.builderSpec){let result=await this.tryStartWithBuilder(service.name,spec,logger,port);if(result)return result}let devCommand2=spec.explicitDevCommand||spec.framework?.settings?.devCommand?.value;if(!devCommand2)throw dev.DEV_SERVICE_NO_DEV_SERVER({name:service.name,framework:service.framework??"none"});return this.spawnDevCommandProcess({name:service.name,devCommand:devCommand2,framework:spec.framework,workspacePath:spec.rootPath,env:spec.env,logger,builderConfig:spec.builderConfig,routePrefixes:spec.routePrefixes,workspaceLabel:spec.rootLabel,port})}applyRuntimeCacheEnv(env){env.RUNTIME_CACHE_ENDPOINT||Object.assign(env,getDevRuntimeCacheEnv(this.resourceEndpoints.runtimeCache.direct,""))}applyContainerResourceProxyEnv(env){let endpoints=this.resourceEndpoints;Object.assign(env,getDevSchedulesEnv(endpoints.schedules?.proxy,!0)),env.VERCEL_QUEUE_BASE_URL===endpoints.queues.direct&&Object.assign(env,getDevQueueEnv(endpoints.queues.proxy,env.VERCEL_HAS_WORKER_SERVICES!==void 0)),env.RUNTIME_CACHE_ENDPOINT===endpoints.runtimeCache.direct&&Object.assign(env,getDevRuntimeCacheEnv(endpoints.runtimeCache.proxy,""))}getV1StartSpec(service){let framework=import_frameworks2.frameworkList.find(f=>f.slug===service.framework),effectiveProcessEnv=(0,import_build_utils5.cloneEnv)(this.envFilesValues,process.env),perServiceEnv={};this.useImplicitEnvInjection?perServiceEnv=(0,import_build_utils5.getExperimentalServiceUrlEnvVars)({services:this.services,frameworkList:framework?[framework]:[],origin:this.proxyOrigin,currentEnv:effectiveProcessEnv}):service.env&&(perServiceEnv=(0,import_build_utils5.getServiceUrlEnvVars)({requestedEnv:service.env,consumerService:service,services:this.services,frameworkList:import_frameworks2.frameworkList,origin:this.proxyOrigin,currentEnv:effectiveProcessEnv}));let env=(0,import_build_utils5.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},perServiceEnv,effectiveProcessEnv);env.VERCEL_SERVICE_TYPE=service.type,service.trigger&&(env.VERCEL_SERVICE_TRIGGER=service.trigger),this.hasQueueServices&&service.runtime==="python"&&env.VERCEL_HAS_WORKER_SERVICES===void 0&&(env.VERCEL_HAS_WORKER_SERVICES="1"),Object.assign(env,getDevQueueEnv(this.resourceEndpoints.queues.direct,this.hasQueueServices)),this.applyRuntimeCacheEnv(env),Object.assign(env,getDevSchedulesEnv(this.resourceEndpoints.schedules?.direct)),service.routePrefix&&service.routePrefix!=="/"&&(env.VERCEL_SERVICE_ROUTE_PREFIX=service.routePrefix,env.VERCEL_SERVICE_ROUTE_PREFIX_STRIP="1");let workspace=service.workspace||".";return{rootPath:path2.join(this.cwd,workspace),rootLabel:workspace,framework,builderSpec:this.preferServiceBuilder?service.builder?.use||framework?.useRuntime?.use:framework?.useRuntime?.use||service.builder?.use,entrypoint:getEntrypointForService(service.builder?.src,service.entrypoint,workspace),builderConfig:service.builder?.config,frameworkForDev:service.framework||"services",servicePayload:{name:service.name,type:service.type,trigger:service.trigger,routePrefix:service.routePrefix,subdomain:service.subdomain,workspace:service.workspace,schedule:service.schedule},routePrefixes:getServiceRoutePrefixes(service),env}}getV2StartSpec(service){let framework=import_frameworks2.frameworkList.find(f=>f.slug===service.framework),effectiveProcessEnv=(0,import_build_utils5.cloneEnv)(this.envFilesValues,process.env),perServiceEnv={};for(let binding of service.bindings??[]){if(binding.type!==void 0&&binding.type!=="service"||binding.format!=="url"||binding.env in effectiveProcessEnv)continue;let targetPort2=this.servicePorts.get(binding.service);targetPort2!==void 0&&(perServiceEnv[binding.env]=`http://127.0.0.1:${targetPort2}`)}let env=(0,import_build_utils5.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},effectiveProcessEnv,perServiceEnv);this.hasQueueServices&&service.runtime==="python"&&env.VERCEL_HAS_WORKER_SERVICES===void 0&&(env.VERCEL_HAS_WORKER_SERVICES="1"),Object.assign(env,getDevQueueEnv(this.resourceEndpoints.queues.direct,this.hasQueueServices)),this.applyRuntimeCacheEnv(env),Object.assign(env,getDevSchedulesEnv(this.resourceEndpoints.schedules?.direct));let root=service.root||".";return{rootPath:path2.join(this.cwd,root),rootLabel:root,framework,builderSpec:framework?.useRuntime?.use||service.builder?.use,entrypoint:getEntrypointForService(service.builder?.src,service.entrypoint,root),builderConfig:service.builder?.config,frameworkForDev:service.framework||"services",servicePayload:{name:service.name,workspace:root},routePrefixes:[],env,explicitDevCommand:service.devCommand}}async tryStartWithBuilder(name,spec,logger,port){if(!spec.builderSpec)return null;try{let builderWithPkg=(await importBuilders(new Set([spec.builderSpec]),this.cwd)).get(spec.builderSpec),builder=builderWithPkg?.builder;if(!builder?.startDevServer)return null;builderWithPkg?.pkg.name==="@vercel/container"&&this.applyContainerResourceProxyEnv(spec.env),output_manager_default.debug(`Starting ${import_chalk.default.bold(name)} using ${import_chalk.default.cyan.bold(spec.builderSpec)}`),injectNextDevWebSocketShimIfNeeded(spec.env,spec.framework?.settings.devCommand?.value||"",{framework:spec.framework?.slug});let result=await builder.startDevServer({entrypoint:spec.entrypoint,workPath:spec.rootPath,repoRootPath:this.repoRoot,config:{...spec.builderConfig||{},framework:spec.frameworkForDev},meta:{isDev:!0,env:spec.env,port,serviceCount:this.services.length,pythonServiceCount:this.pythonServiceCount,syncDependencies:!0,serviceName:name,devResourceEndpoints:this.resourceEndpoints},service:spec.servicePayload,files:{},onStdout:data=>logger.stdout.write(data),onStderr:data=>logger.stderr.write(data)});if(!result)return null;let host=await checkForPort(result.port,STARTUP_TIMEOUT);return output_manager_default.debug(`Service ${name} started on ${host}:${result.port}`),result.queueSubscriptions?.length&&this.onQueueSubscriptions?.(name,result.queueSubscriptions),{name,host,port:result.port,pid:result.pid,shutdown:result.shutdown,routePrefixes:spec.routePrefixes,workspace:spec.rootLabel,logger,crons:result.crons,queueSubscriptions:result.queueSubscriptions}}catch(err){if(output_manager_default.debug(`Failed to use startDevServer for ${name}: ${err}`),err instanceof import_build_utils5.NowBuildError)throw err;return null}}async spawnDevCommandProcess(params){let{name,devCommand:devCommand2,framework,workspacePath,env,logger,builderConfig,routePrefixes,workspaceLabel}=params;await this.syncDependencies(builderConfig,workspacePath,logger);let port=params.port??await(0,import_get_port.default)();env.PORT=`${port}`,env.VERCEL_CLI_VERSION=pkg_default.version;let command=replaceDevCommandPort(devCommand2,port),nodeBinPath=(0,import_build_utils5.getNodeBinPaths)({base:this.repoRoot,start:workspacePath}).join(path2.delimiter);env.PATH=`${nodeBinPath}${path2.delimiter}${env.PATH}`,output_manager_default.debug(`Starting ${import_chalk.default.bold(name)} with ${import_chalk.default.cyan.bold(`"${command}"`)}`),process.stdout.columns&&(env.COLUMNS=`${process.stdout.columns}`),injectNextDevWebSocketShimIfNeeded(env,command,{framework:framework?.slug});let child=(0,import_build_utils5.spawnCommand)(command,{cwd:workspacePath,env,stdio:["ignore","pipe","pipe"],detached:!0});if(child.pid){if(!child.stdout||!child.stderr)throw dev.DEV_SERVICE_NO_STDIO({name})}else throw dev.DEV_SERVICE_NO_PID({name});this.managedProcesses.set(name,child),child.stdout?.on("data",chunk=>{logger.stdout.write(chunk)}),child.stderr?.on("data",chunk=>{logger.stderr.write(chunk)});let host;try{host=await this.waitForPort(child,name,port)}catch(error3){throw this.managedProcesses.delete(name),error3}return output_manager_default.debug(`Service ${name} listening on ${host}:${port}`),{name,host,port,pid:child.pid,process:child,routePrefixes,workspace:workspaceLabel,logger}}async waitForPort(child,serviceName,port){let processError=new Promise((_,reject)=>{child.on("error",reject),child.on("exit",code=>{reject(new Error(`Service "${serviceName}" exited with code ${code} before port was available`))})});return Promise.race([checkForPort(port,STARTUP_TIMEOUT),processError])}async syncDependencies(config,workspacePath,logger){logger.stdout.write(`${import_chalk.default.gray("Synchronizing dependencies...")}
28
+ `);let installCommand=typeof config?.installCommand=="string"?config.installCommand.trim():"";installCommand?await this.runInstallCommand(installCommand,workspacePath,logger):await this.maybeInstallJSDependencies(workspacePath,logger)}async runBuffered(logger,task){let captured=[],bufStdout=new Writable({write(chunk,_enc,cb){let b=Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk);captured.push(["stdout",b]),output_manager_default.debugEnabled&&logger.stdout.write(b),cb()}}),bufStderr=new Writable({write(chunk,_enc,cb){let b=Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk);captured.push(["stderr",b]),output_manager_default.debugEnabled&&logger.stderr.write(b),cb()}});try{await task(bufStdout,bufStderr)}catch(err){for(let[channel,chunk]of captured)logger[channel].write(chunk);throw err}}async runInstallCommand(command,workspacePath,logger){await this.runBuffered(logger,(stdout,stderr)=>new Promise((resolve3,reject)=>{output_manager_default.debug(`Running install command: "${command}" in ${workspacePath}`);let child=(0,import_build_utils5.spawnCommand)(command,{cwd:workspacePath,stdio:["inherit","pipe","pipe"]});child.stdout?.on("data",chunk=>stdout.write(chunk)),child.stderr?.on("data",chunk=>stderr.write(chunk)),child.on("error",reject),child.on("exit",(code,signal)=>{code===0?resolve3():reject(new import_build_utils5.NowBuildError({code:"INSTALL_COMMAND_FAILED",message:`Install command "${command}" failed with code ${code}, signal ${signal}`}))})}))}async maybeInstallJSDependencies(workspacePath,logger){await this.runBuffered(logger,async(stdout,stderr)=>{try{await(0,import_build_utils5.runNpmInstall)(workspacePath,[],void 0,this.installMeta,void 0,{stdout,stderr})}catch(err){throw new import_build_utils5.NowBuildError({code:"NODE_DEPENDENCY_SYNC_FAILED",message:`Failed to install Node.JS dependencies: ${err instanceof Error?err.message:String(err)}`})}})}startCronSchedulers(){for(let[name,managed]of this.managedServices){let service=this.services.find(candidate=>candidate.name===name),crons=managed.crons&&managed.crons.length>0?managed.crons:service&&(0,import_build_utils5.isExperimentalService)(service)&&(0,import_build_utils5.isScheduleTriggeredService)(service)&&service.schedule?(0,import_service_schedules.getStaticServiceSchedules)(service.schedule).map(schedule=>({path:(0,import_build_utils5.getInternalServiceCronPath)(name,service.entrypoint||service.builder.src||"index",service.handlerFunction||"cron"),schedule})):[];if(crons.length!==0)for(let cron of crons)output_manager_default.debug(`Scheduling job service ${import_chalk.default.bold(name)} (${import_chalk.default.cyan(cron.schedule)})`),this.scheduleCronTrigger(name,cron.path,cron.schedule,managed)}}scheduleCronTrigger(serviceName,cronPath,schedule,managed){let delayMs=getNextCronDelay(schedule);if(delayMs===null){output_manager_default.warn(`Could not parse cron schedule "${schedule}" for service "${serviceName}", skipping auto-trigger`);return}let timer=setTimeout(async()=>{if(!this.stopping){output_manager_default.debug(`Triggering scheduled job ${import_chalk.default.bold(serviceName)} (schedule: ${import_chalk.default.cyan(schedule)})`);try{let url4=`http://${managed.host}:${managed.port}${cronPath}`,res=await fetch(url4,{method:"POST"});output_manager_default.debug(`Cron trigger for "${serviceName}" responded with status ${res.status}`)}catch(err){output_manager_default.error(`Cron trigger for "${serviceName}" failed: ${err instanceof Error?err.message:String(err)}`)}this.scheduleCronTrigger(serviceName,cronPath,schedule,managed)}},delayMs);this.cronTimers.push(timer)}};var import_ms5=__toESM(require_ms(),1);import{randomBytes}from"crypto";var import_build_utils6=__toESM(require_build_utils(),1);var DEFAULT_RETRY_AFTER=(0,import_ms5.default)("1m"),DEFAULT_MAX_DELIVERIES=32,DEFAULT_INITIAL_DELAY=0,DEFAULT_VISIBILITY_TIMEOUT=(0,import_ms5.default)("1m"),DEFAULT_RETENTION=(0,import_ms5.default)("1h"),TICK_INTERVAL2=(0,import_ms5.default)("1s");function topicPatternToRegex(pattern){let parts=pattern.split("*").map(s=>s.replace(/-/g,"\\-"));return new RegExp(`^${parts.join("[A-Za-z0-9_\\-]*")}$`)}var QueueBroker=class{constructor(services,getServiceOrigin){this.getServiceOrigin=getServiceOrigin;this.messages=new Map;this.idempotencyRecords=new Map;this.duplicateMessages=new Map;this.consumerGroups=[];this.deliveryState=new Map;this.registerServices(services),this.tickTimer=setInterval(()=>this.tick(),TICK_INTERVAL2),this.tickTimer.unref()}registerServices(services){let ids=new Set;for(let service of services.filter(import_build_utils6.isQueueBackedService))for(let{topic}of(0,import_build_utils6.getServiceQueueTopicConfigs)(service)){let consumerGroup=service.consumer??service.name,id=`${consumerGroup}::${topic}`,existing=this.consumerGroups.find(group=>group.id===id);if(ids.has(id)||existing?.serviceOriginFn||existing?.resolveFunction)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup,topic});ids.add(id)}for(let service of services){if(!(0,import_build_utils6.isQueueBackedService)(service))continue;let topicConfigs=(0,import_build_utils6.getServiceQueueTopicConfigs)(service),consumerGroup=service.consumer??service.name;for(let topicConfig of topicConfigs){let topicPattern=topicConfig.topic,id=`${consumerGroup}::${topicPattern}`,existingGroup=this.consumerGroups.find(group2=>group2.id===id);if(existingGroup&&!existingGroup.serviceOriginFn&&!existingGroup.resolveFunction){existingGroup.serviceName=service.name,existingGroup.serviceOriginFn=()=>this.getServiceOrigin(service.name),existingGroup.retryAfterMs=topicConfig.retryAfterSeconds!==void 0?topicConfig.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,existingGroup.initialDelayMs=topicConfig.initialDelaySeconds!==void 0?topicConfig.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY,this.activatePushGroup(existingGroup);continue}if(existingGroup)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup,topic:topicPattern});let group={id,name:consumerGroup,serviceName:service.name,topicPattern,topicRegex:topicPatternToRegex(topicPattern),serviceOriginFn:()=>this.getServiceOrigin(service.name),retryAfterMs:topicConfig.retryAfterSeconds!==void 0?topicConfig.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:topicConfig.initialDelaySeconds!==void 0?topicConfig.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY};this.consumerGroups.push(group),this.deliveryState.set(group.id,this.createRetainedDeliveries(group)),this.activatePushGroup(group)}}}updateServiceSubscriptions(serviceName,subscriptions){if(subscriptions.length===0)return;let kept=[];for(let group of this.consumerGroups)group.serviceName===serviceName?this.deliveryState.delete(group.id):kept.push(group);this.consumerGroups=kept;for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,existingGroup=this.consumerGroups.find(group2=>group2.id===id);if(existingGroup&&!existingGroup.serviceOriginFn&&!existingGroup.resolveFunction){existingGroup.serviceName=serviceName,existingGroup.serviceOriginFn=()=>this.getServiceOrigin(serviceName),existingGroup.retryAfterMs=subscription.retryAfterSeconds!==void 0?subscription.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,existingGroup.maxDeliveries=subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,existingGroup.initialDelayMs=subscription.initialDelaySeconds!==void 0?subscription.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY,this.activatePushGroup(existingGroup);continue}if(existingGroup){output_manager_default.debug(`Queue consumer "${subscription.consumer}" is already registered for topic "${subscription.topic}"; keeping the first registration`);continue}let group={id,name:subscription.consumer,serviceName,topicPattern:subscription.topic,topicRegex:topicPatternToRegex(subscription.topic),serviceOriginFn:()=>this.getServiceOrigin(serviceName),retryAfterMs:subscription.retryAfterSeconds!==void 0?subscription.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,maxDeliveries:subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,initialDelayMs:subscription.initialDelaySeconds!==void 0?subscription.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY};this.consumerGroups.push(group),this.deliveryState.set(group.id,this.createRetainedDeliveries(group)),this.activatePushGroup(group)}output_manager_default.debug(`Queue consumer groups for service "${serviceName}" updated from ${subscriptions.length} introspected subscription(s)`)}validateFunctionSubscriptions(subscriptions){let ids=new Set;for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,existing=this.consumerGroups.find(group=>group.id===id);if(ids.has(id)||existing?.serviceOriginFn&&!existing.configOwned)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup:subscription.consumer,topic:subscription.topic});ids.add(id)}}setFunctionSubscriptions(subscriptions,resolve3){this.validateFunctionSubscriptions(subscriptions);let ids=new Set(subscriptions.map(subscription=>`${subscription.consumer}::${subscription.topic}`));for(let group of this.consumerGroups)group.configOwned&&!ids.has(group.id)&&(delete group.configOwned,delete group.resolveFunction);for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,group=this.consumerGroups.find(group2=>group2.id===id);group||(group={id,name:subscription.consumer,topicPattern:subscription.topic,topicRegex:topicPatternToRegex(subscription.topic),retryAfterMs:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:DEFAULT_INITIAL_DELAY},this.consumerGroups.push(group),this.deliveryState.set(id,this.createRetainedDeliveries(group))),group.configOwned=!0,group.resolveFunction=()=>resolve3(subscription.outputPath),group.retryAfterMs=subscription.retryAfterSeconds===void 0?DEFAULT_RETRY_AFTER:subscription.retryAfterSeconds*1e3,group.maxDeliveries=subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,group.initialDelayMs=(subscription.initialDelaySeconds??0)*1e3,this.activatePushGroup(group)}}enqueue(queueName,payload,contentType2,options){let now=Date.now(),messageId=randomBytes(16).toString("hex"),retentionMs=(options?.retentionSeconds??0)>0?options.retentionSeconds*1e3:DEFAULT_RETENTION,idempotencyRecordKey=options?.idempotencyKey?`${queueName}:${options.idempotencyKey}`:void 0;if(idempotencyRecordKey){let record=this.idempotencyRecords.get(idempotencyRecordKey);if(record&&record.expiresAt>Date.now())return this.duplicateMessages.set(messageId,{queueName,originalMessageId:record.messageId,expiresAt:Date.now()+retentionMs}),output_manager_default.debug(`queues: skipped duplicate message for queue "${queueName}"`),{messageId};record&&this.idempotencyRecords.delete(idempotencyRecordKey)}idempotencyRecordKey&&this.idempotencyRecords.set(idempotencyRecordKey,{messageId,expiresAt:Date.now()+retentionMs});let message={messageId,payload,contentType:contentType2,queueName,createdAt:new Date(now).toISOString(),retentionMs,visibleAt:(options?.delaySeconds??0)>0?now+options.delaySeconds*1e3:0};this.messages.set(messageId,message),output_manager_default.debug(`queues: stored message ${messageId} for queue "${queueName}"`);let matchingGroups=this.consumerGroups.filter(g=>g.topicRegex.test(queueName));matchingGroups.length===0&&output_manager_default.debug(`queues: no consumer group matches topic "${queueName}", message stored but not dispatched`);for(let group of matchingGroups){let groupDeliveries=this.deliveryState.get(group.id),initialVisibleAt=group.initialDelayMs>0?now+group.initialDelayMs:0,visibleAt=Math.max(message.visibleAt,initialVisibleAt);groupDeliveries.set(messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt,leaseExpiresAt:0}),visibleAt<=now&&(group.serviceOriginFn||group.resolveFunction)&&this.dispatchToConsumer(message,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)})}return{messageId}}getOriginalMessageIdForDuplicate(queueName,messageId){let duplicate=this.duplicateMessages.get(messageId);return!duplicate||duplicate.queueName!==queueName?null:duplicate.expiresAt<=Date.now()?(this.duplicateMessages.delete(messageId),null):duplicate.originalMessageId}receiveById(queueName,messageId,consumerGroup){let message=this.messages.get(messageId);if(!message||message.queueName!==queueName||this.isMessageExpired(message))return null;let group=this.getOrCreatePullGroup(queueName,consumerGroup),state=this.deliveryState.get(group.id)?.get(messageId);if(!state)return null;if(state.status==="pending"){if(state.visibleAt>Date.now())return null;state.status="in-flight",state.receiptHandle=randomBytes(16).toString("hex"),state.deliveryCount++,state.leaseExpiresAt=Date.now()+DEFAULT_VISIBILITY_TIMEOUT}return{messageId:message.messageId,payload:message.payload,contentType:message.contentType,deliveryCount:state.deliveryCount,createdAt:message.createdAt,receiptHandle:state.receiptHandle}}receiveMessages(queueName,consumerGroup,options){let group=this.getOrCreatePullGroup(queueName,consumerGroup),groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return[];let now=Date.now(),limit=Math.min(Math.max(options?.limit??1,1),10),visibilityTimeoutMs=(options?.visibilityTimeoutSeconds??DEFAULT_VISIBILITY_TIMEOUT/1e3)*1e3,results=[];for(let[messageId,state]of groupDeliveries){let message=this.messages.get(messageId);if(!message){groupDeliveries.delete(messageId);continue}if(this.isMessageExpired(message,now)){this.deleteMessage(messageId);continue}if(message.queueName!==queueName||state.status!=="pending"||state.visibleAt>now)continue;let receiptHandle=randomBytes(16).toString("hex");if(state.status="in-flight",state.receiptHandle=receiptHandle,state.deliveryCount++,state.leaseExpiresAt=Date.now()+visibilityTimeoutMs,results.push({messageId:message.messageId,payload:message.payload,contentType:message.contentType,deliveryCount:state.deliveryCount,createdAt:message.createdAt,receiptHandle}),results.length>=limit)break}return results}acknowledge(messageId,consumerGroup,receiptHandle){let{deliveries:groupDeliveries,state}=this.findDeliveryState(messageId,consumerGroup);return!groupDeliveries||!state?!1:state.receiptHandle&&state.receiptHandle!==receiptHandle?(output_manager_default.debug(`queues: ACK rejected for ${messageId} in group "${consumerGroup}" - receipt handle mismatch`),!1):(state.status="acked",groupDeliveries.delete(messageId),output_manager_default.debug(`queues: ACK message ${messageId} in group "${consumerGroup}"`),!0)}changeVisibility(messageId,consumerGroup,receiptHandle,timeoutSeconds){let{state}=this.findDeliveryState(messageId,consumerGroup);return!state||state.status!=="in-flight"||state.receiptHandle&&state.receiptHandle!==receiptHandle?!1:(state.leaseExpiresAt=Date.now()+timeoutSeconds*1e3,output_manager_default.debug(`queues: visibility for ${messageId} in group "${consumerGroup}" extended by ${timeoutSeconds}s`),!0)}findMessageIdByReceiptHandle(consumerGroup,receiptHandle){for(let group of this.consumerGroups){if(group.name!==consumerGroup)continue;let deliveries=this.deliveryState.get(group.id);if(deliveries){for(let[messageId,state]of deliveries)if(state.receiptHandle===receiptHandle)return messageId}}return null}findDeliveryState(messageId,serviceName){for(let group of this.consumerGroups){if(group.name!==serviceName)continue;let deliveries=this.deliveryState.get(group.id);if(!deliveries)continue;let state=deliveries.get(messageId);if(state)return{deliveries,state}}return{deliveries:null,state:null}}getOrCreatePullGroup(queueName,consumerGroup){let existingGroup=this.consumerGroups.find(group2=>group2.name===consumerGroup&&group2.topicRegex.test(queueName));if(existingGroup)return existingGroup;let group={id:`${consumerGroup}::${queueName}`,name:consumerGroup,topicPattern:queueName,topicRegex:topicPatternToRegex(queueName),retryAfterMs:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:DEFAULT_INITIAL_DELAY},deliveries=new Map;for(let message of this.messages.values())message.queueName!==queueName||this.isMessageExpired(message)||deliveries.set(message.messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt:message.visibleAt,leaseExpiresAt:0});return this.consumerGroups.push(group),this.deliveryState.set(group.id,deliveries),group}isMessageExpired(message,now=Date.now()){return new Date(message.createdAt).getTime()+message.retentionMs<now}deleteMessage(messageId){this.messages.delete(messageId);for(let groupDeliveries of this.deliveryState.values())groupDeliveries.delete(messageId)}createRetainedDeliveries(group){let deliveries=new Map;for(let message of this.messages.values())!group.topicRegex.test(message.queueName)||this.isMessageExpired(message)||deliveries.set(message.messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt:Math.max(message.visibleAt,new Date(message.createdAt).getTime()+group.initialDelayMs),leaseExpiresAt:0});return deliveries}activatePushGroup(group){if(!group.serviceOriginFn&&!group.resolveFunction)return;let now=Date.now(),deliveries=this.deliveryState.get(group.id);if(deliveries)for(let[messageId,state]of deliveries){let message=this.messages.get(messageId);!message||state.status!=="pending"||(state.visibleAt=Math.max(state.visibleAt,new Date(message.createdAt).getTime()+group.initialDelayMs),state.visibleAt<=now&&this.dispatchToConsumer(message,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)}))}}async dispatchToConsumer(message,group){let groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return;let state=groupDeliveries.get(message.messageId);if(!state||state.status!=="pending")return;if(state.deliveryCount>=group.maxDeliveries){output_manager_default.debug(`queues: message ${message.messageId} exceeded maxDeliveries (${group.maxDeliveries}) for group "${group.name}", dropping`),groupDeliveries.delete(message.messageId);return}let upstream=group.serviceOriginFn?.(),dispatch=group.resolveFunction?.();if(!upstream&&!dispatch){state.visibleAt=Date.now()+TICK_INTERVAL2;return}let receiptHandle=randomBytes(16).toString("hex");state.status="in-flight",state.receiptHandle=receiptHandle,state.deliveryCount++,state.leaseExpiresAt=Date.now()+DEFAULT_VISIBILITY_TIMEOUT;let now=new Date().toISOString(),expiresAt=new Date(new Date(message.createdAt).getTime()+message.retentionMs).toISOString();output_manager_default.debug(`queues: dispatching v2beta callback to worker "${group.name}"`);try{let request3={method:"POST",headers:{"content-type":message.contentType,"ce-type":"com.vercel.queue.v2beta","ce-specversion":"1.0","ce-source":`/topic/${message.queueName}/consumer/${group.name}`,"ce-id":message.messageId,"ce-time":now,"ce-vqsmessageid":message.messageId,"ce-vqsqueuename":message.queueName,"ce-vqsconsumergroup":group.name,"ce-vqsreceipthandle":receiptHandle,"ce-vqsdeliverycount":String(state.deliveryCount),"ce-vqscreatedat":message.createdAt,"ce-vqsexpiresat":expiresAt,"ce-vqsregion":"dev1"},body:message.payload},response=dispatch?await dispatch(request3):await directFetch(`${upstream}/`,request3);if(response===null){state.receiptHandle===receiptHandle&&state.status==="in-flight"&&(state.status="pending",state.deliveryCount--,state.receiptHandle="",state.leaseExpiresAt=0,state.visibleAt=Date.now()+TICK_INTERVAL2);return}response.ok||(output_manager_default.debug(`queues: worker "${group.name}" returned ${response.status} for message ${message.messageId}`),this.handleDeliveryFailure(message.messageId,group,receiptHandle))}catch(err){output_manager_default.debug(`queues: failed to dispatch CloudEvent to "${group.name}": ${err}`),this.handleDeliveryFailure(message.messageId,group,receiptHandle)}}handleDeliveryFailure(messageId,group,receiptHandle){let groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return;let state=groupDeliveries.get(messageId);!state||state.receiptHandle!==receiptHandle||(state.status="pending",state.visibleAt=Date.now()+group.retryAfterMs,state.leaseExpiresAt=0)}tick(){let now=Date.now();for(let[key,record]of this.idempotencyRecords)record.expiresAt<=now&&this.idempotencyRecords.delete(key);for(let[messageId,record]of this.duplicateMessages)record.expiresAt<=now&&this.duplicateMessages.delete(messageId);for(let[messageId,message]of this.messages)this.isMessageExpired(message,now)&&this.deleteMessage(messageId);for(let group of this.consumerGroups){let groupDeliveries=this.deliveryState.get(group.id);if(groupDeliveries)for(let[messageId,state]of groupDeliveries){let message=this.messages.get(messageId);if(!message){groupDeliveries.delete(messageId);continue}if(state.status==="in-flight"&&state.leaseExpiresAt<=now){state.deliveryCount>=group.maxDeliveries?(output_manager_default.debug(`queues: message ${messageId} exceeded maxDeliveries (${group.maxDeliveries}) for group "${group.name}", dropping`),groupDeliveries.delete(messageId)):(state.status="pending",state.visibleAt=group.serviceOriginFn||group.resolveFunction?now+group.retryAfterMs:now,state.leaseExpiresAt=0);continue}state.status==="pending"&&state.visibleAt<=now&&(group.serviceOriginFn||group.resolveFunction)&&this.dispatchToConsumer(message,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)})}}}stop(){clearInterval(this.tickTimer)}};var import_build_utils7=__toESM(require_build_utils(),1),import_minimatch2=__toESM(require_minimatch(),1);import{posix}from"path";function validPath(value,http4=!1){if(typeof value!="string"||!value)return!1;try{let pathname=http4?value:`/${value}`,decoded=decodeURIComponent(pathname);return pathname.startsWith("/")&&!pathname.startsWith("//")&&!/[\\?#\s]/.test(pathname)&&new URL(pathname,"http://localhost").pathname===pathname&&!/[\\?#\x00-\x1f\x7f]/.test(decoded)&&!/%2f/i.test(pathname)&&!decoded.split("/").some(segment=>segment==="."||segment==="..")&&(http4||!value.endsWith("/")&&!value.includes("//"))}catch{return!1}}async function collectDevFunctions({scopes,workPath,files,config,env}){let builders=await importBuilders(new Set(scopes.map(({build})=>build.use)),workPath),unmatched=new Set(Object.entries(config.functions??{}).filter(([,fn])=>fn.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta")).map(([pattern])=>pattern)),functions=new Map,schedules=[];for(let scope of scopes){let{build,target}=scope,builder=builders.get(build.use)?.builder;if(!builder)throw dev.DEV_BUILDER_LOAD_FAILED({use:build.use});let scopedConfig=structuredClone({...config,...build.config,functions:build.config?.functions??(build.config?.zeroConfig?{}:config.functions)}),manifest,{scheduleFunction}=build.config??{};if(scheduleFunction&&build.src)manifest={functions:[{outputPath:scheduleFunction.outputPath,sourceFile:build.src,invocation:{type:"entrypoint",entrypoint:build.src},experimentalTriggers:[{type:"schedule/v1beta"}]}],matchedFunctionPatterns:[]};else if(builder.getDevManifest)manifest=await builder.getDevManifest({workPath,build,files,config:scopedConfig,env});else{manifest={functions:[],matchedFunctionPatterns:[]};let mode=build.config??{};if(target!=="builder"||mode.framework||mode.middleware||mode.buildType==="middleware"||mode.buildType==="app"||mode.serviceName||mode.serviceType||mode.buildpack||!build.src||build.src.includes("<"))continue;let pattern=build.src.replace(/^\//,"");for(let sourceFile of files){if(!(sourceFile===pattern||(0,import_minimatch2.default)(sourceFile,pattern,{dot:!0}))||builder.version!==3&&!(builder.version===-1&&mode.zeroConfig&&pattern.startsWith("api/")&&sourceFile.startsWith("api/"))||/(^|\/)package\.json$/.test(sourceFile)||/^(?:src\/)?middleware\.[^/]+$/.test(sourceFile))continue;let extension=posix.extname(sourceFile),outputPath=mode.zeroConfig&&extension?sourceFile.slice(0,-extension.length):sourceFile,{experimentalTriggers}=await(0,import_build_utils7.getLambdaOptionsFromFunction)({sourceFile,config:scopedConfig});manifest.functions.push({outputPath,sourceFile,invocation:{type:"entrypoint",entrypoint:sourceFile},experimentalTriggers});let matched=Object.keys(scopedConfig.functions??{}).find(key=>sourceFile===key||(0,import_minimatch2.default)(sourceFile,key));matched&&manifest.matchedFunctionPatterns.push(matched)}}if(!Array.isArray(manifest?.functions)||!Array.isArray(manifest?.matchedFunctionPatterns)||manifest.matchedFunctionPatterns.some(pattern=>typeof pattern!="string"))throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:build.use});let scheduleError=validateConfig({schedules:manifest.schedules});if(scheduleError)throw scheduleError;for(let fn of manifest.functions){if(!validPath(fn?.outputPath)||fn.outputPath.endsWith(".func")||fn.sourceFile!==void 0&&!validPath(fn.sourceFile)||!fn.invocation||(fn.invocation.type==="http"?!validPath(fn.invocation.pathname,!0):fn.invocation.type!=="entrypoint"||!validPath(fn.invocation.entrypoint))||fn.experimentalTriggers!==void 0&&!Array.isArray(fn.experimentalTriggers))throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:build.use});if(functions.has(fn.outputPath))throw dev.DEV_FUNCTION_OUTPUT_DUPLICATE({outputPath:fn.outputPath});functions.set(fn.outputPath,{outputPath:fn.outputPath,sourceFile:fn.sourceFile,invocation:structuredClone(fn.invocation),experimentalTriggers:structuredClone(fn.experimentalTriggers),scope})}schedules.push(...(0,import_build_utils7.getNamedSchedules)(structuredClone(manifest.schedules)));for(let pattern of manifest.matchedFunctionPatterns)unmatched.delete(pattern)}return{functions,schedules,unmatchedPatterns:[...unmatched]}}function deriveQueueSubscriptions(registry){let subscriptions=[],ids=new Set;for(let fn of registry.functions.values())for(let trigger of fn.experimentalTriggers??[]){if(!trigger||typeof trigger.type!="string")throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:fn.scope.build.use});if(trigger.type!=="queue/v2beta")continue;let{consumer,topic,retryAfterSeconds,initialDelaySeconds,maxDeliveries}=trigger;if(typeof consumer!="string"||!consumer||typeof topic!="string"||!topic||[retryAfterSeconds,initialDelaySeconds,maxDeliveries].some(value=>value!==void 0&&(!Number.isFinite(value)||value<0))||retryAfterSeconds!==void 0&&retryAfterSeconds<=0||maxDeliveries!==void 0&&(!Number.isInteger(maxDeliveries)||maxDeliveries<1))throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:fn.scope.build.use});let id=`${consumer}::${topic}`;if(ids.has(id))throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup:consumer,topic});ids.add(id),subscriptions.push({outputPath:fn.outputPath,consumer,topic,retryAfterSeconds,initialDelaySeconds,maxDeliveries})}return subscriptions}var import_raw_body=__toESM(require_raw_body(),1);var import_local_schedules=__toESM(require_dist9(),1),identifier=external_exports.string().min(1).max(256).regex(/^[0-9A-Za-z._-]+$/),definition=external_exports.strictObject({expression:external_exports.discriminatedUnion("type",[external_exports.strictObject({type:external_exports.literal("cron"),cron:external_exports.string().min(1)}),external_exports.strictObject({type:external_exports.literal("single"),at:external_exports.string().min(1)})]),timezone:external_exports.string().min(1).max(50).optional(),jitter:external_exports.number().int().min(1).max(15).optional(),target:external_exports.strictObject({type:external_exports.literal("queue"),topic:external_exports.string().regex(/^[A-Za-z0-9_-]+$/)}),payload:external_exports.unknown().optional()}),createBody=definition.extend({name:identifier.optional(),namespace:identifier.optional()}),updateBody=definition.partial().extend({jitter:definition.shape.jitter.nullable()}),scopeQuery=external_exports.object({projectId:external_exports.string().min(1).optional()}),identifierQuery=scopeQuery.extend({namespace:identifier.optional()}),listQuery=identifierQuery.extend({cursor:external_exports.string().min(1).optional(),limit:external_exports.coerce.number().int().min(1).max(100).default(20)}),MAX_PAYLOAD_BYTES=256*1024,MAX_BODY_BYTES=MAX_PAYLOAD_BYTES+16*1024;async function handleSchedulesRequest(broker,projectId,req,res,pathname){let send=(status,data)=>{res.writeHead(status,{"Content-Type":"application/json"}),res.end(JSON.stringify(data))},error3=(status,code,message)=>send(status,{error:{code,message}});try{let route=/^\/v1\/schedules(?:\/([^/]+)(?:\/(enable|disable|invoke))?)?$/.exec(pathname);if(!route){error3(404,"not_found","Schedule route not found");return}let[,encodedName,action]=route,methods=action?["POST"]:encodedName?["GET","PATCH","DELETE"]:["GET","POST"];if(!methods.includes(req.method||"")){res.setHeader("Allow",methods.join(", ")),error3(405,"method_not_allowed","Method not allowed");return}let query=Object.fromEntries(new URL(req.url||"/","http://localhost").searchParams),parsedQuery=(!encodedName&&req.method==="POST"?scopeQuery:identifierQuery).parse(query);if(parsedQuery.projectId!==void 0&&parsedQuery.projectId!==projectId)throw new import_local_schedules.ScheduleBrokerError("invalid_request","The projectId query parameter must match the local project.");if(!encodedName&&req.method==="GET"){let{namespace,cursor,limit}=listQuery.parse(query);send(200,broker.list({namespace,cursor,limit}));return}if(req.method==="PATCH"||!encodedName&&req.method==="POST"){let body;try{body=JSON.parse(await(0,import_raw_body.default)(req,{limit:MAX_BODY_BYTES,encoding:"utf8"}))}catch(err){let tooLarge=err.statusCode===413;error3(tooLarge?413:400,tooLarge?"payload_too_large":"bad_request",tooLarge?`Schedule request exceeds ${MAX_BODY_BYTES} bytes`:"Expected a JSON object as the request body");return}let parsed=(req.method==="PATCH"?updateBody:createBody).parse(body);if(parsed.payload!==void 0&&Buffer.byteLength(JSON.stringify(parsed.payload))>MAX_PAYLOAD_BYTES){error3(400,"payload_too_large",`Schedule payload exceeds ${MAX_PAYLOAD_BYTES} bytes`);return}encodedName?send(200,broker.update({name:identifier.parse(decodeURIComponent(encodedName)),namespace:identifierQuery.parse(query).namespace},parsed)):send(201,broker.create(createBody.parse(parsed)));return}let id={name:identifier.parse(decodeURIComponent(encodedName)),namespace:identifierQuery.parse(query).namespace};action==="invoke"?(await broker.invoke(id),res.writeHead(204),res.end()):action==="enable"||action==="disable"?send(200,broker[action](id)):req.method==="DELETE"?send(200,broker.delete(id)):send(200,broker.get(id))}catch(err){if(err instanceof external_exports.ZodError)error3(400,"bad_request",err.issues.map(issue=>`${issue.path.join(".")||"request"}: ${issue.message}`).join("; "));else if(err instanceof URIError)error3(400,"bad_request","Invalid encoded schedule name");else if(err instanceof import_local_schedules.ScheduleBrokerError){let status={invalid_request:400,not_found:404,conflict:409,closed:503}[err.code],code={invalid_request:"bad_request",conflict:"schedule_already_exists",closed:"unavailable",not_found:"not_found"}[err.code];error3(status,code,err.message)}else error3(500,"schedule_dispatch_failed",err instanceof Error?err.message:"Failed to dispatch schedule")}}var import_build_utils8=__toESM(require_build_utils(),1);function collectStaticSchedules(authored,registry){let schedules=[...authored,...registry.schedules],error3=validateConfig({schedules:(0,import_build_utils8.toScheduleRecord)(schedules)});if(error3)throw error3;for(let schedule of registry.schedules)if("entrypoint"in schedule)throw new import_build_utils8.NowBuildError({code:"DEV_SCHEDULE_MANIFEST_ENTRYPOINT",message:`Native schedule "${schedule.name}" has an unresolved entrypoint. The builder's getDevManifest must return a Build Output API function or topic instead.`});return schedules.sort((a,b)=>a.name.localeCompare(b.name)),schedules.map(schedule=>{let{name,timezone,jitter}=schedule;if("entrypoint"in schedule)throw new import_build_utils8.NowBuildError({code:"DEV_SCHEDULE_ENTRYPOINT_UNSUPPORTED",message:`Schedule "${name}" targets entrypoint "${schedule.entrypoint}", which vercel dev cannot resolve in a services project yet. Use function with an exact registered build output ID and a sole schedule/v1beta trigger, or topic for a queue.`});if("function"in schedule){if(schedule.service!==void 0)throw new import_build_utils8.NowBuildError({code:"DEV_SCHEDULE_SERVICE_FUNCTION_UNSUPPORTED",message:`Schedule "${name}" targets function "${schedule.function}" in service "${schedule.service}", which vercel dev does not support yet. Service-hosted schedule targets run once deployed.`});let fn=registry.functions.get(schedule.function);if(!fn)throw dev.DEV_SCHEDULE_FUNCTION_MISSING({name,outputPath:schedule.function});if(fn.experimentalTriggers?.length!==1||fn.experimentalTriggers[0]?.type!=="schedule/v1beta")throw dev.DEV_SCHEDULE_FUNCTION_TRIGGER({name,outputPath:schedule.function})}return{name,expression:{type:"cron",cron:schedule.schedule},jitter,timezone,target:"function"in schedule?{type:"function",function:schedule.function}:"path"in schedule?{type:"path",path:schedule.path,...schedule.requestMethod!==void 0&&{requestMethod:schedule.requestMethod}}:{type:"queue",topic:schedule.topic}}})}import path3 from"path";function toOrchestratorService(sidecar){let{type:_type,...subscriber}=sidecar;return{...subscriber,schema:"experimentalServices",type:"worker",trigger:"queue"}}async function collectBuilderDevSidecars({builds,workPath,services=[]}){let builderSpecs=new Set(builds.map(build=>build.use)),buildersWithPkgs=await importBuilders(builderSpecs,workPath),servicesByBuilder=new Map(services.map(service=>[service.builder,service])),sidecars=(await Promise.all(builds.map(async build=>{let builder=buildersWithPkgs.get(build.use)?.builder;if(!builder)throw dev.DEV_BUILDER_LOAD_FAILED({use:build.use});let service=servicesByBuilder.get(build),serviceRoot=service?.root??".",sidecars2=await builder.getDevSidecars?.({workPath:path3.join(workPath,serviceRoot),build,...service?{service}:{}})??[];return service?sidecars2.map(sidecar=>({...sidecar,name:`${service.name}-${sidecar.name}`,workspace:serviceRoot})):sidecars2}))).flat(),names=new Set;for(let sidecar of sidecars){let{name,type}=sidecar;if(type!=="subscriber")throw dev.DEV_SIDECAR_UNSUPPORTED_TYPE({name,type});if(names.has(name))throw dev.DEV_SIDECAR_DUPLICATE_NAME({name});names.add(name)}return sidecars}function nodeHeadersToFetchHeaders(nodeHeaders){let headers=new globalThis.Headers;for(let[name,value]of Object.entries(nodeHeaders))if(Array.isArray(value))for(let val of value)headers.append(name,val);else typeof value<"u"&&headers.set(name,String(value));return headers}var NEVER_COMBINE_RESPONSE_HEADERS=new Set(["set-cookie","www-authenticate","proxy-authenticate"]),COMMA_JOIN_RESPONSE_HEADERS=new Set(["vary"]);function applyChainResponseHeader(res,name,value){if(NEVER_COMBINE_RESPONSE_HEADERS.has(name)){let existing=res.getHeader(name),values=Array.isArray(existing)?existing.map(String):existing!==void 0?[String(existing)]:[];values.push(value),res.setHeader(name,values);return}if(COMMA_JOIN_RESPONSE_HEADERS.has(name)){let existing=res.getHeader(name);res.setHeader(name,existing!==void 0?`${existing}, ${value}`:value);return}res.setHeader(name,value)}var NONOVERRIDABLE_HEADERS=new Set(["host","connection","content-length","transfer-encoding","keep-alive","transfer-encoding","te","upgrade","trailer"]);function applyOverriddenHeaders(reqHeaders,respHeaders){let headers=new globalThis.Headers(respHeaders),overriddenHeaders=headers.get("x-middleware-override-headers");if(!overriddenHeaders)return headers;let overriddenKeys=new Set;for(let key of overriddenHeaders.split(","))overriddenKeys.add(key.trim());headers.delete("x-middleware-override-headers");for(let key of Object.keys(reqHeaders))!NONOVERRIDABLE_HEADERS.has(key)&&!overriddenKeys.has(key)&&delete reqHeaders[key];for(let key of overriddenKeys.keys()){if(NONOVERRIDABLE_HEADERS.has(key))continue;let valueKey="x-middleware-request-"+key,newValue=headers.get(valueKey);reqHeaders[key]!==newValue&&(newValue?reqHeaders[key]=newValue:delete reqHeaders[key]),headers.delete(valueKey)}return headers}var import_error_utils2=__toESM(require_dist(),1);import{parse}from"url";function parseListen(str,defaultPort=3e3){let port=Number(str);if(!isNaN(port))return[port];let url4=parse(str);switch(url4.protocol){case"pipe:":{let cutStr=str.replace(/^pipe:/,"");if(cutStr.slice(0,4)!=="\\\\.\\")throw dev.DEV_INVALID_WINDOWS_PIPE({endpoint:str});return[cutStr]}case"unix:":if(!url4.pathname)throw dev.DEV_INVALID_UNIX_SOCKET({endpoint:str});return[url4.pathname];case"tcp:":return url4.port=url4.port||String(defaultPort),[parseInt(url4.port,10),url4.hostname??void 0];default:if(!url4.slashes){if(url4.protocol===null)return[defaultPort,url4.pathname??void 0];if(port=Number(url4.hostname),url4.protocol&&!isNaN(port))return[port,url4.protocol.substring(0,url4.protocol.length-1)]}throw dev.DEV_INVALID_LISTEN_SCHEME({protocol:url4.protocol})}}function replaceLocalhost(address){return address.replace("[::]","localhost").replace("0.0.0.0","localhost")}import{lstat,readdir,readFile,stat}from"node:fs/promises";import{extname,isAbsolute as isAbsolute2,join as join4,relative as relative2,resolve}from"node:path";import{parse as parseUrl}from"node:url";var MAX_REDIRECTS=1e6,MAX_FILES=100,MAX_URL_LENGTH=2048,VALID_STATUS_CODES=new Set([301,302,303,307,308]),SUPPORTED_EXTENSIONS=new Set([".csv",".json",".jsonl"]),BulkRedirectTable=class{constructor(){this.caseSensitiveByHostPath=new Map;this.caseInsensitiveByHostPath=new Map;this.caseSensitiveByPath=new Map;this.caseInsensitiveByPath=new Map}get size(){return this.caseSensitiveByHostPath.size+this.caseInsensitiveByHostPath.size+this.caseSensitiveByPath.size+this.caseInsensitiveByPath.size}add(redirect2){let{host,pathname}=parseSource(redirect2.source),stored={destination:redirect2.destination,statusCode:redirect2.statusCode,preserveQueryParams:redirect2.preserveQueryParams};if(host){let key=hostPathKey(host,pathname);redirect2.caseSensitive?this.caseSensitiveByHostPath.set(key,stored):this.caseInsensitiveByHostPath.set(key.toLowerCase(),stored);return}redirect2.caseSensitive?this.caseSensitiveByPath.set(pathname,stored):this.caseInsensitiveByPath.set(pathname.toLowerCase(),stored)}lookup(pathname,host){let hostname=host?hostnameFromHostHeader(host):"";if(hostname){let hostKey=hostPathKey(hostname,pathname),hostMatch=this.caseSensitiveByHostPath.get(hostKey)||this.caseInsensitiveByHostPath.get(hostKey.toLowerCase());if(hostMatch)return hostMatch}return this.caseSensitiveByPath.get(pathname)||this.caseInsensitiveByPath.get(pathname.toLowerCase())}};async function getBulkRedirectsSignature(cwd,bulkRedirectsPath){if(!bulkRedirectsPath)return"";let resolved=resolveBulkRedirectsPath(cwd,bulkRedirectsPath);if(!resolved)return`invalid:${bulkRedirectsPath}`;try{let stats=await stat(resolved);if(stats.isFile())return`file:${resolved}:${stats.mtimeMs}:${stats.size}`;if(!stats.isDirectory())return`other:${resolved}:${stats.mtimeMs}`;let files=await listRedirectFiles(resolved),parts=await Promise.all(files.map(async file=>{try{let fileStats=await stat(file);return`${file}:${fileStats.mtimeMs}:${fileStats.size}`}catch{return`${file}:missing`}}));return`dir:${resolved}:${parts.join("|")}`}catch{return`missing:${resolved}`}}async function loadBulkRedirects(cwd,bulkRedirectsPath){let warnings=[],table=new BulkRedirectTable,resolved=resolveBulkRedirectsPath(cwd,bulkRedirectsPath);if(!resolved)return warnings.push(`Skipping bulk redirects path "${bulkRedirectsPath}" because it resolves outside the project directory.`),{table,redirectCount:0,fileCount:0,warnings};let files;try{let stats=await stat(resolved);if(stats.isDirectory())files=await listRedirectFiles(resolved),files.length>MAX_FILES&&(warnings.push(`Bulk redirects directory "${bulkRedirectsPath}" has ${files.length} files; only the first ${MAX_FILES} will be used.`),files=files.slice(0,MAX_FILES));else if(stats.isFile()){let ext=extname(resolved).toLowerCase();if(!SUPPORTED_EXTENSIONS.has(ext))return warnings.push(`Bulk redirects file "${bulkRedirectsPath}" must be a .csv, .json, or .jsonl file.`),{table,redirectCount:0,fileCount:0,warnings};files=[resolved]}else return warnings.push(`Bulk redirects path "${bulkRedirectsPath}" is not a file or directory.`),{table,redirectCount:0,fileCount:0,warnings}}catch(err){if(isNotFound(err))return warnings.push(`Bulk redirects path "${bulkRedirectsPath}" was not found.`),{table,redirectCount:0,fileCount:0,warnings};throw err}let redirectCount=0;for(let file of files){if(redirectCount>=MAX_REDIRECTS){warnings.push(`Bulk redirects limit of ${MAX_REDIRECTS} reached; remaining entries were skipped.`);break}let remaining=MAX_REDIRECTS-redirectCount,parsed=await parseRedirectFile(file,remaining,warnings,cwd);for(let redirect2 of parsed)table.add(redirect2),redirectCount++}let duplicateCount=redirectCount-table.size;return duplicateCount>0&&warnings.push(`Bulk redirects contain ${duplicateCount} duplicate ${duplicateCount===1?"source":"sources"}; the last occurrence wins.`),{table,redirectCount,fileCount:files.length,warnings}}function resolveBulkRedirect(table,reqUrl,host){let parsed=parseUrl(reqUrl),match=table.lookup(parsed.pathname||"/",host);if(!match)return;let location=match.destination;return match.preserveQueryParams&&parsed.search&&(location=appendQueryParams(location,parsed.search)),{location,statusCode:match.statusCode}}function appendQueryParams(destination,search){let query=search.startsWith("?")?search.slice(1):search;return query?destination.includes("?")?`${destination}&${query}`:`${destination}?${query}`:destination}function resolveBulkRedirectsPath(cwd,bulkRedirectsPath){let projectRoot=resolve(cwd),resolved=resolve(projectRoot,bulkRedirectsPath),relativeFromRoot=relative2(projectRoot,resolved);return relativeFromRoot.startsWith("..")||isAbsolute2(relativeFromRoot)?null:resolved}async function listRedirectFiles(dir){let files=[];return await walk(dir,files),files.sort(),files}async function walk(dir,files){let entries=await readdir(dir);for(let entry of entries){let fullPath=join4(dir,entry),stats=await lstat(fullPath);stats.isDirectory()?await walk(fullPath,files):stats.isFile()&&SUPPORTED_EXTENSIONS.has(extname(fullPath).toLowerCase())&&files.push(fullPath)}}async function parseRedirectFile(file,remaining,warnings,cwd){let rel=relative2(cwd,file)||file,ext=extname(file).toLowerCase(),content;try{content=stripBom(await readFile(file,"utf8"))}catch(err){return warnings.push(`Failed to read bulk redirects file "${rel}": ${errorMessage(err)}`),[]}try{return ext===".csv"?parseCsvRedirects(content,remaining,warnings,rel):ext===".jsonl"?parseJsonlRedirects(content,remaining,warnings,rel):parseJsonRedirects(content,remaining,warnings,rel)}catch(err){return warnings.push(`Failed to parse bulk redirects file "${rel}": ${errorMessage(err)}`),[]}}function parseJsonRedirects(content,remaining,warnings,rel){let parsed=JSON.parse(content);return Array.isArray(parsed)?normalizeRedirects(parsed,remaining,warnings,rel):(warnings.push(`Bulk redirects file "${rel}" must contain a JSON array of redirects.`),[])}function parseJsonlRedirects(content,remaining,warnings,rel){let rows=[],lines=content.split(/\r?\n/);for(let i=0;i<lines.length;i++){let line=lines[i].trim();if(line)try{rows.push(JSON.parse(line))}catch{warnings.push(`Skipping invalid JSONL in "${rel}" at line ${i+1}.`)}}return normalizeRedirects(rows,remaining,warnings,rel)}var CSV_HEADER_ALIASES={source:"source",destination:"destination",permanent:"permanent",statuscode:"statusCode",casesensitive:"caseSensitive",preservequeryparams:"preserveQueryParams"};function parseCsvRedirects(content,remaining,warnings,rel){let lines=content.split(/\r?\n/).filter(line=>line.trim().length>0);if(lines.length===0)return warnings.push(`Bulk redirects CSV "${rel}" is empty.`),[];let headers=parseCsvLine(lines[0]).map(header=>CSV_HEADER_ALIASES[header.trim().toLowerCase()]);if(!headers.includes("source")||!headers.includes("destination"))return warnings.push(`Bulk redirects CSV "${rel}" must have "source" and "destination" columns.`),[];let rows=[];for(let i=1;i<lines.length;i++){let values=parseCsvLine(lines[i]),row={};for(let col=0;col<headers.length;col++){let header=headers[col];header&&(row[header]=values[col]??"")}rows.push(row)}return normalizeRedirects(rows,remaining,warnings,rel)}function normalizeRedirects(rows,remaining,warnings,rel){let redirects=[];for(let i=0;i<rows.length;i++){if(redirects.length>=remaining){warnings.push(`Bulk redirects limit of ${MAX_REDIRECTS} reached while reading "${rel}"; remaining entries were skipped.`);break}let row=rows[i];if(!row||typeof row!="object"){warnings.push(`Skipping invalid redirect in "${rel}" at index ${i}.`);continue}let record=row,source=asTrimmedString(record.source),destination=asTrimmedString(record.destination);if(!source||!destination){warnings.push(`Skipping redirect in "${rel}" at index ${i}: source and destination are required.`);continue}if(source.length>MAX_URL_LENGTH||destination.length>MAX_URL_LENGTH){warnings.push(`Skipping redirect in "${rel}" at index ${i}: source and destination must be at most ${MAX_URL_LENGTH} characters.`);continue}let statusCode;if(record.statusCode!==void 0&&record.statusCode!==""){let parsedStatus=parseStatusCode(record.statusCode);if(parsedStatus===void 0){warnings.push(`Skipping redirect in "${rel}" at index ${i}: statusCode must be one of ${[...VALID_STATUS_CODES].join(", ")}.`);continue}statusCode=parsedStatus}else statusCode=parseBoolean(record.permanent)??!1?308:307;redirects.push({source,destination,statusCode,caseSensitive:parseBoolean(record.caseSensitive)??!1,preserveQueryParams:parseBoolean(record.preserveQueryParams)??!1})}return redirects}function parseSource(source){if(/^https?:\/\//i.test(source))try{let parsed=new URL(source);return{host:parsed.hostname.toLowerCase(),pathname:parsed.pathname||"/"}}catch{return{host:null,pathname:source}}return{host:null,pathname:source||"/"}}function hostPathKey(host,pathname){return`${host}\0${pathname}`}function hostnameFromHostHeader(hostHeader){let trimmed=hostHeader.trim();if(!trimmed)return"";if(trimmed.startsWith("[")){let end=trimmed.indexOf("]");return end===-1?trimmed.toLowerCase():trimmed.slice(1,end).toLowerCase()}let colon=trimmed.lastIndexOf(":");return colon!==-1&&trimmed.indexOf(":")===colon?trimmed.slice(0,colon).toLowerCase():trimmed.toLowerCase()}function parseBoolean(value){if(typeof value=="boolean")return value;if(typeof value=="number")return value===1?!0:value===0?!1:void 0;if(typeof value!="string")return;let normalized=value.trim().toLowerCase();if(normalized==="t"||normalized==="true")return!0;if(normalized==="f"||normalized==="false")return!1}function parseStatusCode(value){let n=typeof value=="number"?value:typeof value=="string"?Number(value.trim()):NaN;return VALID_STATUS_CODES.has(n)?n:void 0}function asTrimmedString(value){if(typeof value!="string")return;let trimmed=value.trim();return trimmed||void 0}function parseCsvLine(line){let fields=[],current="",inQuotes=!1;for(let i=0;i<line.length;i++){let char=line[i];inQuotes?char==='"'?line[i+1]==='"'?(current+='"',i++):inQuotes=!1:current+=char:char==='"'?inQuotes=!0:char===","?(fields.push(current),current=""):current+=char}return fields.push(current),fields}function stripBom(content){return content.charCodeAt(0)===65279?content.slice(1):content}function isNotFound(err){return typeof err=="object"&&err!==null&&"code"in err&&err.code==="ENOENT"}function errorMessage(err){return err instanceof Error?err.message:String(err)}var DEV_SERVER_PORT_BIND_TIMEOUT=(0,import_ms6.default)("5m"),DEV_COMMAND_PORT_RELEASE_TIMEOUT=(0,import_ms6.default)("10s"),DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS=60,DEV_RUNTIME_CACHE_MAX_ITEM_SIZE=2*1024*1024,DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS=31536e3,frameworkRuntimeSet=new Set(import_frameworks3.frameworkList.map(f=>f.useRuntime?.use||"@vercel/static-build"));function isApiDirBuild(build){let src=build.src?.replace(/^\.\//,"");return typeof src=="string"&&src.startsWith("api/")}function sortBuilders(buildA,buildB){return buildA&&buildA.use&&(0,import_fs_detectors2.isOfficialRuntime)("static-build",buildA.use)?1:buildB&&buildB.use&&(0,import_fs_detectors2.isOfficialRuntime)("static-build",buildB.use)?-1:0}var DevServer=class{constructor(cwd,options){this.initialDevCommandStarted=!1;this.devCommandStarts=new Set;this.functionDispatchReady=!1;this.functionReconciliations=0;this.configGeneration=0;this.unmatchedQueuePatterns=new Set;this.functionRegistry={functions:new Map,schedules:[],unmatchedPatterns:[]};this.envFromCloud=!1;this.responseTransformsByReq=new WeakMap;this.shouldBuildInDev=build=>{if(build.config?.scheduleFunction||!this.shouldUseServicesOrchestrator()&&isApiDirBuild(build))return!0;let{name}=(0,import_npm_package_arg.default)(build.use);return!frameworkRuntimeSet.has(name||"")};this.clearVercelConfigPromise=()=>{this.getVercelConfigPromise=null};this.getExtensionlessFile=path6=>{let ext=extname2(path6);return this.apiDir&&path6.startsWith(this.apiDir+"/")&&this.apiExtensions.has(ext)?path6.slice(0,-ext.length):null};this.devServerHandler=async(req,res)=>{if(await this.handleSchedulesProxyRequest(req,res))return;try{await this.startPromise}catch{res.destroy();return}let requestId=generateRequestId(this.podId);if(this.stopping){res.setHeader("Connection","close"),await this.send404(req,res,requestId);return}let method=req.method||"GET";output_manager_default.debug(`${import_chalk2.default.bold(method)} ${req.url}`);try{let vercelConfig=await this.getVercelConfig();await this.serveProjectAsNowV2(req,res,requestId,vercelConfig)}catch(err){console.error(err),(0,import_error_utils2.isError)(err)&&typeof err.stack=="string"&&output_manager_default.debug(err.stack),res.finished||(res.statusCode=500,res.end((0,import_error_utils2.errorToString)(err)))}};this.handleSchedulesRoute=async(req,res,pathname)=>{let session=this.schedulesSession?.session;if(this.stopping||!session&&req.method==="GET"&&pathname==="/v1/info"){res.writeHead(503,{"content-type":"application/json"}),res.end(JSON.stringify({error:{code:"local_session_unavailable",message:"Local Schedules is not ready or is stopping. Wait for vercel dev to start and try again."}}));return}if(req.headers[LOCAL_SCHEDULES_SESSION_HEADER]!==void 0&&req.headers[LOCAL_SCHEDULES_SESSION_HEADER]!==session?.id){res.writeHead(409,{"content-type":"application/json"}),res.end(JSON.stringify({error:{code:"local_session_mismatch",message:"The local Schedules session has changed. Run the command again to discover the current session."}}));return}if(req.method==="GET"&&pathname==="/v1/info"){res.writeHead(200,{"content-type":"application/json"}),res.end(JSON.stringify(session));return}await handleSchedulesRequest(this.scheduleBroker,this.projectId??"prj_local",req,res,pathname)};this.exitWithStatus=async(match,routeResult,phase,req,res,requestId,responseTransforms)=>{let{status,headers,dest}=routeResult,location=headers.location||dest;if(status&&location&&300<=status&&status<=399)return output_manager_default.debug(`Route found with redirect status code ${status}`),await this.sendRedirect(req,res,requestId,location,status,responseTransforms),!0;if(!match&&status&&phase!=="miss"){if(routeResult.userDest)return!1;output_manager_default.debug(`Route found with with status code ${status}`);let errorHeaders={...headers};return responseTransforms&&applyResponseTransforms(errorHeaders,responseTransforms),await this.sendError(req,res,requestId,"",status,errorHeaders),!0}return!1};this.handleQueuesRoute=async(req,res,pathname)=>{if(!this.queueBroker){res.writeHead(503),res.end("Queues broker not initialized");return}if(!pathname.startsWith(DEV_QUEUE_API_PREFIX)){res.writeHead(404),res.end("Not Found");return}let topicPath=pathname.slice(DEV_QUEUE_API_PREFIX.length),sendMatch=topicPath.match(/^([A-Za-z0-9_-]+)$/);if(req.method==="POST"&&sendMatch){let topic=sendMatch[1],contentType2=req.headers["content-type"]||"application/json",payload=await(0,import_raw_body2.default)(req),retentionHeader=req.headers["vqs-retention-seconds"],retentionSeconds=retentionHeader&&!isNaN(parseInt(retentionHeader,10))?parseInt(retentionHeader,10):void 0,delayHeader=req.headers["vqs-delay-seconds"],delaySeconds=delayHeader&&!isNaN(parseInt(delayHeader,10))?parseInt(delayHeader,10):void 0,idempotencyKey=req.headers["vqs-idempotency-key"],{messageId}=this.queueBroker.enqueue(topic,payload,contentType2,{retentionSeconds,delaySeconds,idempotencyKey});res.writeHead(201,{"Content-Type":"application/json","Vqs-Message-Id":messageId}),res.end(JSON.stringify({messageId}));return}let receiveByIdMatch=topicPath.match(/^([A-Za-z0-9_-]+)\/consumer\/([A-Za-z0-9_-]+)\/id\/([^/]+)$/);if(req.method==="POST"&&receiveByIdMatch){let[,queueName,consumer,messageId]=receiveByIdMatch,originalMessageId=this.queueBroker.getOriginalMessageIdForDuplicate(queueName,messageId);if(originalMessageId){res.writeHead(409,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"This messageId was a duplicate - use originalMessageId instead",originalMessageId}));return}let result=this.queueBroker.receiveById(queueName,messageId,consumer);if(!result){res.writeHead(404),res.end("Message not found");return}let boundary=`----vcdevboundary${randomBytes2(8).toString("hex")}`,partHeaders=[`Vqs-Message-Id: ${messageId}`,`Vqs-Delivery-Count: ${result.deliveryCount}`,`Vqs-Timestamp: ${result.createdAt}`,`Vqs-Receipt-Handle: ${result.receiptHandle}`,`Content-Type: ${result.contentType}`].join(`\r
29
+ `),body=Buffer.concat([Uint8Array.from(Buffer.from(`--${boundary}\r
30
+ ${partHeaders}\r
31
+ \r
32
+ `)),Uint8Array.from(result.payload),Uint8Array.from(Buffer.from(`\r
33
+ --${boundary}--\r
34
+ `))]);res.writeHead(200,{"Content-Type":`multipart/mixed; boundary=${boundary}`,"Content-Length":body.length}),res.end(body);return}let receiveMatch=topicPath.match(/^([A-Za-z0-9_-]+)\/consumer\/([A-Za-z0-9_-]+)$/);if(req.method==="POST"&&receiveMatch){let[,queueName,consumer]=receiveMatch,timeoutHeader=req.headers["vqs-visibility-timeout-seconds"],visibilityTimeoutSeconds=timeoutHeader&&!isNaN(parseInt(timeoutHeader,10))?parseInt(timeoutHeader,10):void 0,limitHeader=req.headers["vqs-max-messages"],limit=limitHeader&&!isNaN(parseInt(limitHeader,10))?parseInt(limitHeader,10):void 0,messages=this.queueBroker.receiveMessages(queueName,consumer,{limit,visibilityTimeoutSeconds});if(messages.length===0){res.writeHead(204),res.end();return}let boundary=`----vcdevboundary${randomBytes2(8).toString("hex")}`,parts=[];for(let msg of messages){let partHeaders=[`Vqs-Message-Id: ${msg.messageId}`,`Vqs-Delivery-Count: ${msg.deliveryCount}`,`Vqs-Timestamp: ${msg.createdAt}`,`Vqs-Receipt-Handle: ${msg.receiptHandle}`,`Content-Type: ${msg.contentType}`].join(`\r
35
+ `);parts.push(Uint8Array.from(Buffer.from(`--${boundary}\r
36
+ ${partHeaders}\r
37
+ \r
38
+ `)),Uint8Array.from(msg.payload),Uint8Array.from(Buffer.from(`\r
39
+ `)))}parts.push(Uint8Array.from(Buffer.from(`--${boundary}--\r
40
+ `)));let body=Buffer.concat(parts);res.writeHead(200,{"Content-Type":`multipart/mixed; boundary=${boundary}`,"Content-Length":body.length}),res.end(body);return}let leaseMatch=topicPath.match(/^([A-Za-z0-9_-]+)\/consumer\/([A-Za-z0-9_-]+)\/lease\/([^/]+)(?:\/visibility)?$/);if(leaseMatch&&(req.method==="DELETE"||req.method==="PATCH")){let[,,consumer,receiptHandle]=leaseMatch,messageId=this.queueBroker.findMessageIdByReceiptHandle(consumer,receiptHandle);if(!messageId){res.writeHead(404,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Message not found"}));return}if(req.method==="DELETE"){this.queueBroker.acknowledge(messageId,consumer,receiptHandle),res.writeHead(204),res.end();return}let body=await(0,import_raw_body2.default)(req),timeoutSeconds=DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS;try{let parsed=JSON.parse(body.toString());typeof parsed.visibilityTimeoutSeconds=="number"&&parsed.visibilityTimeoutSeconds>=0&&(timeoutSeconds=parsed.visibilityTimeoutSeconds)}catch(err){output_manager_default.debug(`queues: failed to parse visibility timeout body: ${err}`)}this.queueBroker.changeVisibility(messageId,consumer,receiptHandle,timeoutSeconds),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}res.writeHead(404),res.end("Not Found")};this.handleRuntimeCacheRoute=async(req,res,pathname)=>{let store=this.runtimeCache;if(!store){res.writeHead(503),res.end("Runtime Cache not initialized");return}if(!pathname.startsWith(DEV_RUNTIME_CACHE_API_PREFIX)){res.writeHead(404),res.end("Not Found");return}let itemPath=pathname.slice(DEV_RUNTIME_CACHE_API_PREFIX.length),searchParams=new URL2(req.url||"/","http://localhost").searchParams;if(itemPath==="revalidate"){if(req.method!=="POST"){res.writeHead(405),res.end("Method Not Allowed");return}let tags=(searchParams.get("tags")||"").split(",").map(tag=>tag.trim()).filter(Boolean),itemId=searchParams.get("itemId")||void 0;if(tags.length===0&&!itemId){res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"No tags or itemId provided"}));return}tags.length>0&&(store.expireTags(tags),output_manager_default.debug(`runtime cache: expired tags "${tags.join(",")}"`)),itemId&&(store.delete(itemId),output_manager_default.debug(`runtime cache: expired item "${itemId}"`)),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({revalidated:!0}));return}let key;try{key=decodeURIComponent(itemPath)}catch{res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Invalid cache key"}));return}if(!key){res.writeHead(404),res.end("Not Found");return}if(req.method==="GET"){let hit=store.get(key);if(!hit){output_manager_default.debug(`runtime cache: MISS "${key}"`),res.writeHead(404),res.end("Not Found");return}output_manager_default.debug(`runtime cache: HIT "${key}"`);let headers={"Content-Type":"application/json","Content-Length":hit.value.length,[HEADER_CACHE_STATE]:"fresh",Age:String(hit.ageSeconds)};hit.tags.length>0&&(headers[HEADER_CACHE_TAGS]=hit.tags.join(",")),res.writeHead(200,headers),res.end(hit.value);return}if(req.method==="POST"){let revalidateHeader=req.headers[HEADER_REVALIDATE],ttlSeconds;if(revalidateHeader)if(revalidateHeader==="Infinity"||["false","False","FALSE","f","F"].includes(revalidateHeader))ttlSeconds=DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS;else if(/^[+-]?\d+$/.test(revalidateHeader)){let parsedRevalidate=Number(revalidateHeader);if(!Number.isSafeInteger(parsedRevalidate)||parsedRevalidate<0){res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Invalid revalidate value"}));return}if(parsedRevalidate===0){res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}ttlSeconds=parsedRevalidate}else{res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Invalid revalidate value"}));return}let value;try{value=await(0,import_raw_body2.default)(req,{limit:DEV_RUNTIME_CACHE_MAX_ITEM_SIZE})}catch(err){if(err.statusCode===413){res.writeHead(413,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Cache item is too large"}));return}throw err}let tagsHeader=req.headers[HEADER_CACHE_TAGS];store.set(key,value,{ttlSeconds,tags:(tagsHeader||"").split(",").map(tag=>tag.trim()).filter(Boolean)});let name=req.headers[HEADER_CACHE_ITEM_NAME];output_manager_default.debug(`runtime cache: SET "${key}"${name?` (${name})`:""} ${value.length} bytes`),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}if(req.method==="DELETE"){store.delete(key),output_manager_default.debug(`runtime cache: DELETE "${key}"`),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}res.writeHead(405),res.end("Method Not Allowed")};this.serveProjectAsNowV2=async(req,res,requestId,vercelConfig,routes=vercelConfig.routes,callLevel=0)=>{let{debug}=output_manager_default;if(callLevel===0&&await this.handleSchedulesProxyRequest(req,res))return;let parsed=url3.parse(req.url||"/");if(typeof parsed.pathname=="string"&&parsed.pathname.includes("//")){let location=parsed.pathname.replace(/\/+/g,"/");if(parsed.search&&(location+=parsed.search),req.method==="GET"){await this.sendRedirect(req,res,requestId,location,301);return}debug(`Rewriting URL from "${req.url}" to "${location}"`),req.url=location}let queueProxyPrefix=`${DEV_QUEUE_PROXY_PREFIX}/${this.resourceProxyToken}`,runtimeCacheProxyPrefix=`${DEV_RUNTIME_CACHE_PREFIX}${this.resourceProxyToken}`;if(callLevel===0&&this.queueBroker){let pathname=parsed.pathname||"/";if(pathname.startsWith(`${queueProxyPrefix}/`)){if(!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}await this.handleQueuesRoute(req,res,pathname.slice(queueProxyPrefix.length));return}}if(callLevel===0){let pathname=parsed.pathname||"/";if(pathname.startsWith(`${runtimeCacheProxyPrefix}/`)){if(!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}await this.handleRuntimeCacheRoute(req,res,pathname.slice(runtimeCacheProxyPrefix.length));return}}if(callLevel===0&&this.bulkRedirects){let bulkMatch=resolveBulkRedirect(this.bulkRedirects,req.url||"/",typeof req.headers.host=="string"?req.headers.host:void 0);if(bulkMatch){debug(`Bulk redirect ${bulkMatch.statusCode}: ${req.url} -> ${bulkMatch.location}`),await this.sendRedirect(req,res,requestId,bulkMatch.location,bulkMatch.statusCode);return}}if(callLevel===0&&this.orchestrator){let pathname=parsed.pathname||"/",service=this.orchestrator.getServiceForRoute(pathname);if(service){debug(`Found service: ${service.name}`);let upstream=`http://${service.host}:${service.port}`;debug(`Proxying to service "${service.name}": ${upstream}`);let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.setResponseHeaders(res,requestId),proxyPass(req,res,upstream,this,requestId,!1)}}callLevel===0&&await this.updateBuildMatches(vercelConfig),this.blockingBuildsPromise&&(debug("Waiting for builds to complete before handling request"),await this.blockingBuildsPromise);let getReqUrl=rr=>{if(rr.dest){if(rr.query){let destParsed=url3.parse(rr.dest),destQuery=parseQueryString(destParsed.search);return Object.assign(destQuery,rr.query),destParsed.search=formatQueryString(destQuery),url3.format(destParsed)}return rr.dest}return req.url},handleMap=getRoutesTypes(routes),missRoutes=handleMap.get("miss")||[],hitRoutes=handleMap.get("hit")||[],errorRoutes=handleMap.get("error")||[],filesystemRoutes=handleMap.get("filesystem")||[],phases=[null,"filesystem"],routeResult=null,match=null,statusCode,prevUrl=req.url,prevHeaders={},requestTransforms=[],responseTransforms,middlewares=[...this.buildMatches.values()].filter(m=>m.config?.middleware===!0);for(let middleware of middlewares){let startMiddlewareResult,middlewarePid,{envConfigs,files,devCacheDir,cwd:workPath}=this;try{let{builder:builder2}=middleware.builderWithPkg;if(typeof builder2.startDevServer=="function"&&(startMiddlewareResult=await builder2.startDevServer({files,entrypoint:middleware.entrypoint,workPath,repoRootPath:this.repoRoot,config:{projectSettings:this.projectSettings,...middleware.config},meta:{isDev:!0,...this.getDevResourceMeta(),devCacheDir,requestUrl:req.url,env:this.getBuilderDevEnv(middleware,envConfigs.runEnv),buildEnv:{...envConfigs.buildEnv}}})),startMiddlewareResult){let{port,pid,shutdown}=startMiddlewareResult;middlewarePid=pid,this.shutdownCallbacks.set(pid,shutdown),debug(`Invoking middleware "${middleware.src}" (port=${port})`);let middlewareReqHeaders=nodeHeadersToFetchHeaders(req.headers),proxyHeaders=this.getProxyHeaders(req,requestId,!0);for(let[name,value]of nodeHeadersToFetchHeaders(proxyHeaders))middlewareReqHeaders.set(name,value);let middlewareReqPath=url3.parse(req.url||"/").path||"/",middlewareRes=await directFetch(`http://127.0.0.1:${port}${middlewareReqPath}`,{headers:middlewareReqHeaders,method:req.method,redirect:"manual"}),middlewareBody=Buffer.from(await middlewareRes.arrayBuffer());if(middlewareRes.status===500&&middlewareBody.byteLength===0){await this.sendError(req,res,requestId,"EDGE_FUNCTION_INVOCATION_FAILED",500);return}res.statusCode=middlewareRes.status;let rewritePath="",contentType2="",shouldContinue=!1,skipMiddlewareHeaders=new Set(["date","connection","content-length","transfer-encoding"]),middlewareHeaders=applyOverriddenHeaders(req.headers,middlewareRes.headers);for(let[name,value]of middlewareHeaders)name==="x-middleware-next"?shouldContinue=value==="1":name==="x-middleware-rewrite"?(rewritePath=value,shouldContinue=!0):name==="content-type"?contentType2=value:skipMiddlewareHeaders.has(name)||(applyChainResponseHeader(res,name,value),req.headers[name]=value);if(!shouldContinue){this.setResponseHeaders(res,requestId),middlewareBody.length>0?(res.setHeader("content-length",middlewareBody.length),contentType2&&res.setHeader("content-type",contentType2),res.end(middlewareBody)):res.end();return}if(rewritePath){debug(`Detected rewrite path from middleware: "${rewritePath}"`),prevUrl=rewritePath;let beforeRewriteUrl=req.url||"/";if(isURL(rewritePath)){let rewriteUrlParsed=new URL2(rewritePath);if(this.address.origin===rewriteUrlParsed.origin)req.url=rewritePath.slice(rewriteUrlParsed.origin.length)||"/",prevUrl=req.url;else{debug(`ProxyPass: ${rewritePath}`),this.setResponseHeaders(res,requestId),proxyPass(req,res,rewritePath,this,requestId);return}}else{let rewriteUrlParsed=url3.parse(beforeRewriteUrl);rewriteUrlParsed.search=url3.parse(rewritePath).search,req.url=url3.format(rewriteUrlParsed)}debug(`Rewrote incoming HTTP URL from "${beforeRewriteUrl}" to "${req.url}"`)}}}catch(err){(0,import_error_utils2.isSpawnError)(err)&&err.code==="ENOENT"&&(err.message=`Command not found: ${import_chalk2.default.cyan(err.path,...err.spawnargs)}
41
+ Please ensure that ${cmd(err.path)} is properly installed`,err.link="https://vercel.link/command-not-found"),output_manager_default.prettyError(err),await this.sendError(req,res,requestId,"MIDDLEWARE_INVOCATION_FAILED",500);return}finally{middlewarePid&&this.killBuilderDevServer(middlewarePid)}}for(let phase of phases){statusCode=void 0;let phaseRoutes=handleMap.get(phase)||[];if(routeResult=await devRouter(prevUrl,req.method,phaseRoutes,this,vercelConfig,prevHeaders,missRoutes,phase),routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms),routeResult.continue&&(routeResult.dest&&(prevUrl=getReqUrl(routeResult)),routeResult.headers&&(prevHeaders=routeResult.headers)),callLevel===0&&this.orchestrator&&!routeResult.continue&&isServiceDestination(routeResult.matched_route))return this.delegateToService(req,res,requestId,routeResult.matched_route,vercelConfig,requestTransforms,responseTransforms);if(routeResult.isDestUrl){let destParsed=url3.parse(routeResult.dest),destQuery=parseQueryString(destParsed.search);Object.assign(destQuery,routeResult.query),destParsed.search=formatQueryString(destQuery);let destUrl=url3.format(destParsed);return this.prepareTransforms(req,requestTransforms,responseTransforms),debug(`ProxyPass: ${destUrl}`),this.setResponseHeaders(res,requestId),proxyPass(req,res,destUrl,this,requestId)}if(match=await findBuildMatch(this.buildMatches,this.files,routeResult.dest,this,vercelConfig),await this.exitWithStatus(match,routeResult,phase,req,res,requestId,responseTransforms))return;if(!match&&missRoutes.length>0){if(routeResult=await devRouter(getReqUrl(routeResult),req.method,missRoutes,this,vercelConfig,routeResult.headers,[],"miss"),routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms),match=await findBuildMatch(this.buildMatches,this.files,routeResult.dest,this,vercelConfig),await this.exitWithStatus(match,routeResult,phase,req,res,requestId,responseTransforms))return}else if(match&&hitRoutes.length>0){let prevStatus=routeResult.status;routeResult=await devRouter(getReqUrl(routeResult),req.method,hitRoutes,this,vercelConfig,routeResult.headers,[],"hit"),routeResult.status=prevStatus,routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms)}if(statusCode=routeResult.status,match||phase===null&&filesystemRoutes.length===0)break}if(!match&&routeResult&&errorRoutes.length>0){let routeResultForError=await devRouter(getReqUrl(routeResult),req.method,errorRoutes,this,vercelConfig,routeResult.headers,[],"error"),{matched_route}=routeResultForError,matchForError=await findBuildMatch(this.buildMatches,this.files,routeResultForError.dest,this,vercelConfig);if(matchForError)debug("Route match detected in error phase, breaking loop"),routeResult=routeResultForError,statusCode=routeResultForError.status,match=matchForError,routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms);else if(matched_route&&matched_route.src&&!matched_route.dest&&(debug("Route without `dest` detected in error phase, attempting to exit early"),await this.exitWithStatus(matchForError,routeResultForError,"error",req,res,requestId,responseTransforms)))return}if(!routeResult)throw dev.DEV_INTERNAL_NO_ROUTE_RESULT();let{dest,query,headers}=routeResult;for(let[name,value]of Object.entries(headers))res.setHeader(name,value);statusCode&&Object.defineProperty(res,"statusCode",{get(){return statusCode},set(_){}});let requestPath=dest.replace(/^\//,"");if(!match){if(this.devProcessOrigin){let upstream=this.devProcessOrigin;debug(`Proxying to frontend dev server: ${upstream}`);let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;this.setResponseHeaders(res,requestId);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);return origUrl.pathname=dest,Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format(origUrl),this.prepareTransforms(req,requestTransforms,responseTransforms),proxyPass(req,res,upstream,this,requestId,!1)}(statusCode===404&&routeResult.phase==="miss"||!this.renderDirectoryListing(req,res,requestPath,requestId))&&await this.send404(req,res,requestId);return}let buildRequestPath=match.buildResults.has(null)?null:requestPath,buildResult=match.buildResults.get(buildRequestPath);if(buildResult&&Array.isArray(buildResult.routes)&&buildResult.routes.length>0){let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);origUrl.pathname=dest,Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery);let newUrl=url3.format(origUrl);debug(`Checking build result's ${buildResult.routes.length} \`routes\` to match ${newUrl}`);let matchedRoute=await devRouter(newUrl,req.method,buildResult.routes,this,vercelConfig);if(matchedRoute.found&&callLevel===0){debug(`Found matching route ${matchedRoute.dest} for ${newUrl}`),req.url=newUrl,await this.serveProjectAsNowV2(req,res,requestId,vercelConfig,buildResult.routes,callLevel+1);return}}let{builder,pkg:builderPkg}=match.builderWithPkg;if(typeof builder.startDevServer=="function"){let devServerResult=null;try{devServerResult=await this.startBuildMatchDevServer(match,requestPath)}catch(err){(0,import_error_utils2.isSpawnError)(err)&&err.code==="ENOENT"&&(err.message=`Command not found: ${import_chalk2.default.cyan(err.path,...err.spawnargs)}
42
+ Please ensure that ${cmd(err.path)} is properly installed`,err.link="https://vercel.link/command-not-found"),output_manager_default.prettyError(err),await this.sendError(req,res,requestId,"NO_RESPONSE_FROM_FUNCTION",502);return}if(devServerResult){requestId=generateRequestId(this.podId,!0);let{port,pid,shutdown,persistent}=devServerResult;this.shutdownCallbacks.set(pid,shutdown),persistent||res.once("close",()=>{this.killBuilderDevServer(pid)}),debug(`Proxying to "${builderPkg.name}" dev server (port=${port}, pid=${pid})`);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format({pathname:origUrl.pathname,search:origUrl.search});let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.prepareTransforms(req,requestTransforms,responseTransforms),this.setResponseHeaders(res,requestId),proxyPass(req,res,`http://127.0.0.1:${port}`,this,requestId,!1)}else debug(`Skipping \`startDevServer()\` for ${match.entrypoint}`)}let foundAsset=findAsset(match,requestPath,vercelConfig);if(!foundAsset&&callLevel===0&&(await this.triggerBuild(match,buildRequestPath,req,vercelConfig),foundAsset=findAsset(match,requestPath,vercelConfig)),this.devProcessOrigin&&(!foundAsset||foundAsset&&foundAsset.asset.type!=="Lambda")){debug("Proxying to frontend dev server");let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.prepareTransforms(req,requestTransforms,responseTransforms),this.setResponseHeaders(res,requestId),proxyPass(req,res,this.devProcessOrigin,this,requestId,!1)}if(!foundAsset){await this.send404(req,res,requestId);return}let{asset:asset2,assetKey}=foundAsset;switch(debug(`Serving asset: [${asset2.type}] ${assetKey} ${asset2.contentType||""}`),asset2.type){case"FileFsRef":this.setResponseHeaders(res,requestId);let staticResHeaders={};applyResponseTransforms(staticResHeaders,responseTransforms??[]);for(let[name,value]of Object.entries(staticResHeaders))value!==void 0&&res.setHeader(name,value);return req.url=`/${basename(asset2.fsPath)}`,serveStaticFile(req,res,dirname3(asset2.fsPath),{headers:[{source:"**/*",headers:[{key:"Content-Type",value:asset2.contentType||getMimeType(assetKey)}]}]});case"FileBlob":let headers2={"Content-Length":asset2.data.length,"Content-Type":asset2.contentType||getMimeType(assetKey)};applyResponseTransforms(headers2,responseTransforms??[]),this.setResponseHeaders(res,requestId,headers2),res.end(asset2.data);return;case"Lambda":if(!asset2.fn){await this.sendError(req,res,requestId,"INTERNAL_LAMBDA_NOT_FOUND");return}requestId=generateRequestId(this.podId,!0);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format({pathname:origUrl.pathname,search:origUrl.search}),applyRequestTransforms(req,requestTransforms);let path6=req.url||"/",body=await(0,import_raw_body2.default)(req);debug(`Invoking lambda: "${assetKey}" with ${path6}`);let result;try{result=await this.invokeBuiltLambda(asset2,req,requestId,body)}catch(err){console.error(err),await this.sendError(req,res,requestId,"NO_RESPONSE_FROM_FUNCTION",502);return}statusCode||(res.statusCode=result.statusCode);let lambdaHeaders=result.headers??{};applyResponseTransforms(lambdaHeaders,responseTransforms??[]),this.setResponseHeaders(res,requestId,lambdaHeaders);let resBody;return result.encoding==="base64"&&typeof result.body=="string"?resBody=Buffer.from(result.body,"base64"):resBody=result.body,res.end(resBody);default:await this.sendError(req,res,requestId,"UNKNOWN_ASSET_TYPE")}};if(this.cwd=cwd,this.repoRoot=options.repoRoot??cwd,this.envConfigs={buildEnv:{},runEnv:{},allEnv:{}},this.envValues=options.envValues||{},this.projectId=options.projectId,this.orgId=options.orgId,this.queuePort=options.queuePort,this.runtimeCachePort=options.runtimeCachePort,this.schedulesPort=options.schedulesPort,this.routing=options.routing??!0,this.devCommandPort=options.devCommandPort,this.onConfig=options.onConfig,!this.routing&&!this.devCommandPort)throw new Error("Running without the router needs a `devCommandPort`");this.scheduleBroker=new import_local_schedules2.ScheduleBroker({ownerId:this.orgId??"team_local",projectId:this.projectId??"prj_local",trackId:"development",dispatch:invocation=>this.dispatchSchedule(invocation),onError:(err,invocation)=>{try{output_manager_default.error(`Failed to dispatch schedule "${invocation.schedule.name}": ${(0,import_error_utils2.errorToString)(err)}`)}catch{}}}),this.resourceProxyToken=randomBytes2(32).toString("base64url"),this.reportError=createErrorReporter2(code=>options.onErrorCode?.(code)),this.files={},this.originalProjectSettings=options.projectSettings,this.projectSettings=options.projectSettings,this.services=options.services,this.useImplicitServicesEnvInjection=options.useImplicitServicesEnvInjection??!0,this.caseSensitive=!1,this.apiDir=null,this.apiExtensions=new Set,this.proxy=import_http_proxy_node16.default.createProxyServer({changeOrigin:!0,ws:!0,xfwd:!0}),this.proxy.on("proxyRes",(proxyRes,req)=>{proxyRes.headers.server="Vercel";let responseTransforms=this.responseTransformsByReq.get(req);responseTransforms&&(this.responseTransformsByReq.delete(req),applyResponseTransforms(proxyRes.headers,responseTransforms))}),this.proxy.on("error",(err,req,res)=>{if(output_manager_default.debug(`Proxy error for ${req?.url??"unknown request"}: ${(0,import_error_utils2.errorToString)(err)}`),!!res){if("destroy"in res&&typeof res.destroy=="function"){res.destroy();return}res instanceof http.ServerResponse&&(res.headersSent||res.writeHead(502),res.end())}}),this.server=http.createServer(this.devServerHandler),this.server.timeout=0,this.queueServer=http.createServer((req,res)=>{this.handleResourceServerRequest(req,res,this.queueOrigin,this.handleQueuesRoute)}),this.runtimeCacheServer=http.createServer((req,res)=>{this.handleResourceServerRequest(req,res,this.runtimeCacheOrigin,this.handleRuntimeCacheRoute)}),this.schedulesServer=http.createServer((req,res)=>{this.schedulesSession&&res.setHeader(LOCAL_SCHEDULES_SESSION_HEADER,this.schedulesSession.session.id),this.handleResourceServerRequest(req,res,this.schedulesOrigin,this.handleSchedulesRoute)}),this.stopping=!1,this.buildMatches=new Map,this.inProgressBuilds=new Map,this.devCacheDir=join5(getVercelDirectory(cwd),"cache"),this.vercelConfigWarning=!1,this.getVercelConfigPromise=null,this.blockingBuildsPromise=null,this.startPromise=null,this.bulkRedirects=null,this.bulkRedirectsSignature=null,this.bulkRedirectsLastPath=null,this.bulkRedirectsResolvedPath=null,this.bulkRedirectsDirty=!0,this.watchAggregationId=null,this.watchAggregationEvents=[],this.watchAggregationTimeout=500,this.filter=path6=>!!path6,this.podId=Math.random().toString(32).slice(-5),this.shutdownCallbacks=new Map}get address(){if(!this._address)throw dev.DEV_INTERNAL_ADDRESS_UNAVAILABLE();return this._address}shouldUseServicesOrchestrator(){return!!(this.services&&this.services.length>0)}hasSubscribers(){return!!this.sidecars?.length}getDevQueueEnv(){return this.queueOrigin?getDevQueueEnv(this.queueOrigin,this.hasSubscribers()):{}}getDevRuntimeCacheEnv(env){return!this.runtimeCacheOrigin||env.RUNTIME_CACHE_ENDPOINT?{}:process.env.RUNTIME_CACHE_ENDPOINT?{RUNTIME_CACHE_ENDPOINT:process.env.RUNTIME_CACHE_ENDPOINT,...process.env.RUNTIME_CACHE_HEADERS?{RUNTIME_CACHE_HEADERS:process.env.RUNTIME_CACHE_HEADERS}:{}}:getDevRuntimeCacheEnv(this.runtimeCacheOrigin,DEV_RUNTIME_CACHE_API_PREFIX)}get resourceEndpoints(){if(!this.queueOrigin||!this.runtimeCacheOrigin)throw new Error("Local resource servers have not started");let proxied=(direct,path6)=>this.routing?`${this.address.origin}${path6}`:direct,runtimeCache=`${this.runtimeCacheOrigin}${DEV_RUNTIME_CACHE_API_PREFIX}`;return{queues:{direct:this.queueOrigin,proxy:proxied(this.queueOrigin,`${DEV_QUEUE_PROXY_PREFIX}/${this.resourceProxyToken}`)},runtimeCache:{direct:runtimeCache,proxy:proxied(runtimeCache,`${DEV_RUNTIME_CACHE_PREFIX}${this.resourceProxyToken}${DEV_RUNTIME_CACHE_API_PREFIX}`)},...this.schedulesOrigin?{schedules:{direct:this.schedulesOrigin,proxy:proxied(this.schedulesOrigin,`${DEV_SCHEDULES_PROXY_PREFIX}/${this.resourceProxyToken}`)}}:{}}}getDevResourceMeta(){return{devResourceEndpoints:this.resourceEndpoints}}handleResourceServerRequest(req,res,origin,handler){if(!origin||!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}if(!isValidDevResourceHost(origin,req.headers.host)){res.writeHead(403),res.end("Forbidden");return}let pathname=new URL2(req.url||"/","http://127.0.0.1").pathname;handler(req,res,pathname).catch(err=>{output_manager_default.debug(`Local resource request failed for ${req.url||"/"}: ${(0,import_error_utils2.errorToString)(err)}`),res.headersSent||res.writeHead(500),res.end("Internal Server Error")})}isAuthorizedResourceRequest(req,token){let authorization=req.headers.authorization;if(typeof authorization!="string")return!1;let encoder=new TextEncoder,actual=encoder.encode(authorization),expected=encoder.encode(`Bearer ${token}`);return actual.length===expected.length&&timingSafeEqual(actual,expected)}getBuilderDevEnv(match,env){let result={...env,...getDevSchedulesEnv(this.schedulesOrigin)};if(match.builderWithPkg.pkg.name!=="@vercel/container")return result;let endpoints=this.resourceEndpoints;return Object.assign(result,getDevSchedulesEnv(endpoints.schedules?.proxy,!0)),result.VERCEL_QUEUE_BASE_URL===endpoints.queues.direct&&Object.assign(result,getDevQueueEnv(endpoints.queues.proxy,result.VERCEL_HAS_WORKER_SERVICES!==void 0)),result.RUNTIME_CACHE_ENDPOINT===endpoints.runtimeCache.direct&&Object.assign(result,getDevRuntimeCacheEnv(endpoints.runtimeCache.proxy,"")),result}getSidecarDevMeta(match){let serviceCount=(this.sidecars??[]).filter(sidecar=>sidecar.builder.use!==match.use?!1:!sidecar.workspace||sidecar.workspace===".").length;return serviceCount>0?{serviceCount}:{}}async setupBuilderDevSidecars(){if(this.shouldUseServicesOrchestrator())return;let sidecars=this.sidecars??[];if(sidecars.length===0)return;Object.assign(this.envConfigs.runEnv,this.getDevQueueEnv());let services=sidecars.map(toOrchestratorService),orchestrator=new ServicesOrchestrator({services,cwd:this.cwd,repoRoot:this.repoRoot,env:this.envConfigs.allEnv,proxyOrigin:this.address.origin,resourceEndpoints:this.resourceEndpoints,useImplicitEnvInjection:!1,preferServiceBuilder:!0,onQueueSubscriptions:(serviceName,subscriptions)=>this.queueBroker?.updateServiceSubscriptions(serviceName,subscriptions)});this.sidecarOrchestrator=orchestrator,this.queueBroker?.registerServices(services);try{await orchestrator.startAll()}catch(err){throw await orchestrator.stopAll(),this.sidecarOrchestrator=void 0,this.sidecars=[],err}output_manager_default.log(`Started ${sidecars.length} development ${(0,import_pluralize2.default)("sidecar",sidecars.length)}`)}async exit(code=1){await this.stop(code),process.exit(code)}enqueueFsEvent(type,path6){this.bulkRedirectsResolvedPath&&(path6===this.bulkRedirectsResolvedPath||path6.startsWith(this.bulkRedirectsResolvedPath+sep2))&&(this.bulkRedirectsDirty=!0),this.watchAggregationEvents.push({type,path:path6}),this.watchAggregationId===null&&(this.watchAggregationId=setTimeout(()=>{let events=this.watchAggregationEvents.slice();this.watchAggregationEvents.length=0,this.watchAggregationId=null,this.handleFilesystemEvents(events).catch(err=>{output_manager_default.prettyError(err),(0,import_error_utils2.isError)(err)&&typeof err.stack=="string"&&output_manager_default.debug(err.stack)})},this.watchAggregationTimeout))}async handleFilesystemEvents(events){if(this.stopping)return;output_manager_default.debug(`Filesystem watcher notified of ${events.length} events`);let filesChanged=new Set,filesRemoved=new Set,distPaths=[];for(let buildMatch of this.buildMatches.values())for(let buildResult of buildMatch.buildResults.values())buildResult.distPath&&distPaths.push(buildResult.distPath);if(events=events.filter(event=>distPaths.every(distPath=>!event.path.startsWith(distPath))),events.length!==0){this.functionReconciliations++;try{this.configGeneration++,this.functionDiscovery=void 0;for(let event of events)event.type==="add"?await this.handleFileCreated(event.path,filesChanged,filesRemoved):event.type==="unlink"?this.handleFileDeleted(event.path,filesChanged,filesRemoved):event.type==="change"&&await this.handleFileModified(event.path,filesChanged,filesRemoved);let vercelConfig=await this.getVercelConfig();if(this.stopping)return;await this.updateBuildMatches(vercelConfig);let filesChangedArray=[...filesChanged],filesRemovedArray=[...filesRemoved],needsRebuild=new Map;for(let match of this.buildMatches.values()){this.canonicalizeFunctionBuild(match);for(let[requestPath,result]of match.buildResults)if(!needsRebuild.has(result)&&Array.isArray(result.watch)){for(let pattern of result.watch)if(minimatches(filesChangedArray,pattern)||minimatches(filesRemovedArray,pattern)){needsRebuild.set(result,[requestPath,match]);break}}}if(needsRebuild.size>0){output_manager_default.debug(`Triggering ${needsRebuild.size} rebuilds`),filesChangedArray.length>0&&output_manager_default.debug(`Files changed: ${filesChangedArray.join(", ")}`),filesRemovedArray.length>0&&output_manager_default.debug(`Files removed: ${filesRemovedArray.join(", ")}`);for(let[result,[requestPath,match]]of needsRebuild)requestPath===null||await shouldServe(match,this.files,requestPath,this,vercelConfig)?this.triggerBuild(match,requestPath,null,vercelConfig,result,filesChangedArray,filesRemovedArray).catch(err=>{output_manager_default.warn(`An error occurred while rebuilding \`${match.src}\`:`),console.error(err.stack)}):output_manager_default.debug(`Not rebuilding because \`shouldServe()\` returned \`false\` for "${match.use}" request path "${requestPath}"`)}}finally{this.functionReconciliations--}}}async handleFileCreated(fsPath,changed,removed){let name=relative(this.cwd,fsPath);try{await this.getVercelConfig(),this.files[name]=await import_build_utils9.FileFsRef.fromFsPath({fsPath});let extensionless=this.getExtensionlessFile(name);extensionless&&(this.files[extensionless]=await import_build_utils9.FileFsRef.fromFsPath({fsPath})),fileChanged(name,changed,removed),output_manager_default.debug(`File created: ${name}`)}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")output_manager_default.debug(`File created, but has since been deleted: ${name}`),fileRemoved(name,this.files,changed,removed);else throw err}}handleFileDeleted(fsPath,changed,removed){let name=relative(this.cwd,fsPath);output_manager_default.debug(`File deleted: ${name}`),fileRemoved(name,this.files,changed,removed);let extensionless=this.getExtensionlessFile(name);extensionless&&(output_manager_default.debug(`File deleted: ${extensionless}`),fileRemoved(extensionless,this.files,changed,removed))}async handleFileModified(fsPath,changed,removed){let name=relative(this.cwd,fsPath);try{this.files[name]=await import_build_utils9.FileFsRef.fromFsPath({fsPath}),fileChanged(name,changed,removed),output_manager_default.debug(`File modified: ${name}`)}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")output_manager_default.debug(`File modified, but has since been deleted: ${name}`),fileRemoved(name,this.files,changed,removed);else throw err}}async updateBuildMatches(vercelConfig,isInitial=!1){let fileList=this.resolveBuildFiles(this.files),matches=await getBuildMatches(vercelConfig,this.cwd,this,fileList),sources=matches.map(m=>m.src);isInitial&&fileList.length===0&&output_manager_default.warn("There are no files inside your deployment.");let ops=[];for(let src of this.buildMatches.keys())if(!sources.includes(src)){output_manager_default.debug(`Removing build match for "${src}"`);let match=this.buildMatches.get(src);match&&ops.push(shutdownBuilder(match)),this.buildMatches.delete(src)}await Promise.all(ops);let blockingBuilds=[];for(let match of matches){let currentMatch=this.buildMatches.get(match.src);if(!buildMatchEquals(currentMatch,match)&&(output_manager_default.debug(`Adding build match for "${match.src}" with "${match.use}"`),this.buildMatches.set(match.src,match),!isInitial&&needsBlockingBuild(match))){let buildPromise=executeBuild(vercelConfig,this,this.files,match,null,!1);blockingBuilds.push(buildPromise)}}if(blockingBuilds.length>0&&(output_manager_default.debug(`Waiting for ${blockingBuilds.length} "blocking builds"`),this.blockingBuildsPromise=Promise.all(blockingBuilds).then(()=>{output_manager_default.debug('Cleaning up "blockingBuildsPromise" after successful resolve'),this.blockingBuildsPromise=null}).catch(err=>{output_manager_default.debug(`Cleaning up "blockingBuildsPromise" after error: ${err}`),this.blockingBuildsPromise=null,err&&output_manager_default.prettyError(err)})),this.buildMatches=new Map([...this.buildMatches.entries()].sort((matchA,matchB)=>sortBuilders(matchA[1],matchB[1]))),isInitial){let warnings=new Set;for(let match of this.buildMatches.values()){let{builder}=match.builderWithPkg;if(!builder.getDevWarnings)continue;let builderWarnings=await builder.getDevWarnings({files:this.files,entrypoint:match.entrypoint,workPath:this.cwd,repoRootPath:this.repoRoot,config:{projectSettings:this.projectSettings,...match.config},meta:{isDev:!0,env:this.getBuilderDevEnv(match,this.envConfigs.runEnv),buildEnv:{...this.envConfigs.buildEnv}}});for(let warning of builderWarnings)warnings.add(warning)}for(let warning of warnings)output_manager_default.warn(warning)}}async getLocalEnv(fileName,base){let filePath=join5(this.cwd,fileName),env={};try{let dotenv=await import_fs_extra.default.readFile(filePath,"utf8");output_manager_default.debug(`Using local env: ${filePath}`),env=(0,import_dotenv.parse)(dotenv),env=this.injectSystemValuesInDotenv(env)}catch(err){if(!(0,import_error_utils2.isErrnoException)(err)||err.code!=="ENOENT")throw err}try{return{...this.validateEnvConfig(fileName,base||{},env)}}catch(err){if(err instanceof MissingDotenvVarsError)this.reportError(err),await this.exit();else throw err}return{}}getVercelConfig(){if(this.getVercelConfigPromise)return this.getVercelConfigPromise;this.getVercelConfigPromise=(async()=>{for(;;){let generation=this.configGeneration;try{let config=await this._getVercelConfig();if(this.stopping||generation===this.configGeneration)return config}catch(err){if(this.stopping||generation===this.configGeneration)throw err}this.functionDiscovery=void 0}})();let clear=this.clearVercelConfigPromise;return this.getVercelConfigPromise.then(clear,clear),this.getVercelConfigPromise}get devCommand(){return this.getDevCommand(this.projectSettings)}get devCommandOrigin(){return this.devProcessOrigin}getDevCommand(projectSettings){if(projectSettings?.devCommand)return projectSettings.devCommand;if(projectSettings?.framework){let frameworkSlug=projectSettings.framework,framework=import_frameworks3.frameworkList.find(f=>f.slug===frameworkSlug);if(framework){let defaults=framework.settings.devCommand.value;if(defaults)return defaults}if((0,import_build_utils9.shouldUseExperimentalBackends)(frameworkSlug))return"npx @vercel/cervel dev"}}getFunctionDiscovery(options){let key=JSON.stringify(options);if(!this.functionDiscovery||this.functionDiscovery.key!==key){let promise=collectDevFunctions(options);this.functionDiscovery={key,promise},promise.catch(()=>{this.functionDiscovery?.promise===promise&&(this.functionDiscovery=void 0)})}return this.functionDiscovery.promise}getDevFunction(outputPath){return this.functionRegistry.functions.get(outputPath)}getDevSchedules(){return this.functionRegistry.schedules}async dispatchSchedule({delivery,signal}){if(signal.throwIfAborted(),this.stopping)throw new Error("Local Schedules is stopping");if(delivery.type==="queue"){if(!this.queueBroker)throw new Error("Local Queue broker is not ready");this.queueBroker.enqueue(delivery.topic,Buffer.from(JSON.stringify(delivery.message)),"application/json");return}if(delivery.type==="path"){if(!this.devProcessOrigin)throw new Error(`Schedule path "${delivery.path}" is not ready because the dev server is unavailable`);signal.throwIfAborted();let response=await directFetch(`${this.devProcessOrigin}${delivery.path}`,{method:delivery.requestMethod,signal});if(!response.ok)throw new Error(`Schedule path "${delivery.path}" returned HTTP ${response.status}`);return}let invoke=this.resolveDevFunction(delivery.function);if(!invoke)throw new Error(`Schedule function "${delivery.function}" is missing or not ready`);signal.throwIfAborted();let onAbort=()=>{},aborted=new Promise((_,reject)=>{onAbort=()=>reject(signal.reason),signal.addEventListener("abort",onAbort,{once:!0})});try{let result=await Promise.race([aborted,invoke({method:"POST",headers:delivery.headers,body:Buffer.alloc(0),signal})]);if(!result)throw new Error(`Schedule function "${delivery.function}" is missing or not ready`);if(!result.ok)throw new Error(`Schedule function "${delivery.function}" returned HTTP ${result.status}`)}finally{signal.removeEventListener("abort",onAbort)}}resolveDevFunction(outputPath){let fn=this.getDevFunction(outputPath);if(!fn||this.stopping)return null;if(fn.invocation.type==="http"){if(!this.devProcessOrigin)return null}else if(!this.functionDispatchReady||this.functionReconciliations>0||!this.getDevFunctionMatch(fn))return null;return request3=>this.invokeDevFunction(outputPath,request3)}getDevFunctionMatch(fn){if(fn.invocation.type!=="entrypoint"||fn.scope.target!=="builder")return;let{entrypoint}=fn.invocation;return[...this.buildMatches.values()].find(match=>match.entrypoint===entrypoint&&match.use===fn.scope.build.use&&(0,import_fast_deep_equal.default)(match.config??{},fn.scope.build.config??{}))}canonicalizeFunctionBuild(match){if(![...this.functionRegistry.functions.values()].some(fn=>this.getDevFunctionMatch(fn)===match))return!1;if(match.buildResults.size&&!(match.buildResults.size===1&&match.buildResults.has(null))){let results=[...match.buildResults.values()],result=results[results.length-1];result.watch=[...new Set(results.flatMap(result2=>result2.watch))],match.buildResults.clear(),match.buildResults.set(null,result)}return!0}async invokeDevFunction(outputPath,request3){request3.signal?.throwIfAborted();let fn=this.getDevFunction(outputPath);if(!fn||!this.resolveDevFunction(outputPath))return null;let generation=this.configGeneration,isCurrent=()=>!this.stopping&&generation===this.configGeneration&&this.getDevFunction(outputPath)===fn;if(fn.invocation.type==="http"){let response=await directFetch(`${this.devProcessOrigin}${fn.invocation.pathname}`,{...request3,redirect:"manual"});return await response.arrayBuffer(),{ok:response.ok,status:response.status}}let match=this.getDevFunctionMatch(fn),config=this.functionConfig,req=new http.IncomingMessage(new Socket);req.method=request3.method,req.url=`/${outputPath}`,req.headers={host:this.address.host,...request3.headers};let requestId=generateRequestId(this.podId,!0),currentMatch=()=>!request3.signal?.aborted&&isCurrent()&&this.getDevFunctionMatch(fn)===match,devServerResult=await this.startBuildMatchDevServer(match,outputPath);if(devServerResult){let{port,pid,shutdown,persistent}=devServerResult;this.shutdownCallbacks.set(pid,shutdown);try{if(!currentMatch())return null;let response=await directFetch(`http://127.0.0.1:${port}/${outputPath}`,{...request3,headers:nodeHeadersToFetchHeaders({...req.headers,...this.getProxyHeaders(req,requestId,!0)}),redirect:"manual"});return await response.arrayBuffer(),{ok:response.ok,status:response.status}}finally{let current=this.getDevFunction(outputPath);(this.stopping||!persistent||!current||this.getDevFunctionMatch(current)!==match)&&this.shutdownCallbacks.has(pid)&&await this.killBuilderDevServer(pid)}}if(!currentMatch())return null;let{entrypoint}=fn.invocation,getAsset=()=>match.buildOutput[(match.buildResultVersion??match.builderWithPkg.builder.version)===2?outputPath:entrypoint];this.canonicalizeFunctionBuild(match);let asset2=getAsset();if((!asset2||this.inProgressBuilds.get(match)?.size)&&(await this.triggerBuild(match,null,null,config),asset2=getAsset()),!currentMatch())return null;if(!asset2||asset2.type!=="Lambda"||!asset2.fn)return{ok:!1,status:404};let result=await this.invokeBuiltLambda(asset2,req,requestId,request3.body);return{ok:result.statusCode>=200&&result.statusCode<300,status:result.statusCode}}async startBuildMatchDevServer(match,requestPath){let{builder}=match.builderWithPkg;if(!builder.startDevServer)return null;let{envConfigs,files,devCacheDir,cwd:workPath}=this;return builder.startDevServer({files,entrypoint:match.entrypoint,workPath,config:match.config||{},repoRootPath:this.repoRoot,meta:{isDev:!0,...this.getDevResourceMeta(),requestPath,devCacheDir,...this.getSidecarDevMeta(match),env:this.getBuilderDevEnv(match,{...envConfigs.runEnv,VERCEL_DEBUG_PREFIX:output_manager_default.debugEnabled?"[builder]":void 0}),buildEnv:{...envConfigs.buildEnv}}})}invokeBuiltLambda(asset2,req,requestId,body){let payload={method:req.method||"GET",host:req.headers.host,path:req.url||"/",headers:{...req.headers,...this.getProxyHeaders(req,requestId,!0)},encoding:"base64",body:body.toString("base64")};return asset2.fn({Action:"Invoke",body:JSON.stringify(payload)})}async _getVercelConfig(){let generation=this.configGeneration,configPath=localConfigFlagPath();if(!configPath){let{compileVercelConfig}=await import("../../chunks/compile-vercel-config-GWAJE44R.js"),compiled=await compileVercelConfig(this.cwd);configPath=getLocalPathConfig(this.cwd,!!compiled.sourceFile)}let[pkg=null,vercelConfig={version:2,[import_client.fileNameSymbol]:"vercel.json"}]=await Promise.all([this.readJsonFile("package.json"),this.readJsonFile(configPath,!0)]);await this.validateVercelConfig(vercelConfig);let functionConfig=structuredClone(vercelConfig),sourceFiles;for(let[name,service]of Object.entries(this.queueBroker?vercelConfig.services??vercelConfig.experimentalServicesV2??{}:{}))if(Object.values(service.functions??{}).some(fn=>fn.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta")))throw dev.DEV_QUEUE_FUNCTION_UNSUPPORTED({sourceFile:`services.${name}.functions`,reason:"service-hosted function queue triggers are not supported locally yet"});let nextProjectSettings={...this.originalProjectSettings,...pickOverrides(vercelConfig)},{error:routeError,routes:maybeRoutes}=(0,import_routing_utils3.getTransformedRoutes)(vercelConfig);routeError&&(this.reportError(routeError),await this.exit()),vercelConfig.routes=maybeRoutes||[];let hasServices=(this.services?.length??0)>0,hasResolvedServices=!!this.services&&this.services.length>0,schedules=(0,import_build_utils9.getNamedSchedules)(functionConfig.schedules),scheduleEntrypointPlan;if(!hasResolvedServices&&schedules.some(import_schedule_entrypoint.hasScheduleEntrypointTarget)&&(sourceFiles=(await staticFiles(this.cwd,{})).map(f=>relative(this.cwd,f)),scheduleEntrypointPlan=(0,import_schedule_entrypoint.planScheduleEntrypoints)({schedules,files:sourceFiles,framework:nextProjectSettings.framework,functions:functionConfig.functions})),!vercelConfig.experimentalServices&&!hasResolvedServices&&(!vercelConfig.builds||vercelConfig.builds.length===0)){let{projectSettings,cleanUrls,trailingSlash}=vercelConfig,files=sourceFiles??(await staticFiles(this.cwd,{})).map(f=>relative(this.cwd,f));sourceFiles=files;let detectionOptions={tag:"latest",reservedFunctionFiles:scheduleEntrypointPlan?.reservedFunctionFiles,bunVersion:vercelConfig.bunVersion,functions:vercelConfig.functions,projectSettings:projectSettings||nextProjectSettings,featHandleMiss:!0,cleanUrls,trailingSlash,proxy:vercelConfig.proxy,workPath:this.cwd},detectedBuilders=await(0,import_detect_builders_with_services.detectBuildersWithServices)(files,pkg,detectionOptions);for(;detectedBuilders.errors?.length===1&&detectedBuilders.errors[0].code==="unused_function";){let error3=detectedBuilders.errors[0],unmatchedTrigger=Object.entries(detectionOptions.functions??{}).find(([pattern,fn])=>error3.message.startsWith(`The pattern "${pattern}" defined in \`functions\` `)&&fn.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta"||trigger.type==="schedule/v1beta"));if(!unmatchedTrigger)break;detectionOptions.functions={...detectionOptions.functions},delete detectionOptions.functions[unmatchedTrigger[0]],detectedBuilders=await(0,import_detect_builders_with_services.detectBuildersWithServices)(files,pkg,detectionOptions)}let{builders,warnings,errors,defaultRoutes,redirectRoutes,rewriteRoutes,errorRoutes}=detectedBuilders,hostRewriteRoutes=detectedBuilders.hostRewriteRoutes;if(errors){if(this.functionConfig)throw errors[0];this.reportError(errors[0]),await this.exit()}if(warnings?.length>0&&warnings.forEach(warning=>output_manager_default.warn(warning.message,null,warning.link,warning.action)),builders){let buildpackRuntime=builders.map(getBuildpackRuntime).find(runtime=>runtime!==void 0);if(buildpackRuntime)throw buildpackDevUnsupportedError(buildpackRuntime);vercelConfig.builds=vercelConfig.builds||[],vercelConfig.builds.push(...builders),delete vercelConfig.functions}let serviceRewrites=detectedBuilders.serviceRewrites,serviceRewriteRoutes=serviceRewrites&&serviceRewrites.length>0?(0,import_routing_utils3.convertRewrites)(serviceRewrites):null,routes=[];routes.push(...redirectRoutes||[]),routes=(0,import_routing_utils3.appendRoutesToPhase)({routes,newRoutes:hostRewriteRoutes??null,phase:null}),routes.push(...(0,import_routing_utils3.appendRoutesToPhase)({routes:vercelConfig.routes,newRoutes:[...rewriteRoutes||[],...serviceRewriteRoutes||[]],phase:"filesystem"})),routes=(0,import_routing_utils3.appendRoutesToPhase)({routes,newRoutes:errorRoutes,phase:"error"}),routes.push(...defaultRoutes||[]),vercelConfig.routes=routes}else if(hasResolvedServices&&vercelConfig.proxy){let{entrypoint}=vercelConfig.proxy;await import_fs_extra.default.pathExists(join5(this.cwd,entrypoint))||(output_manager_default.error(`The proxy entrypoint \`${entrypoint}\` does not exist. Set \`proxy.entrypoint\` to an existing \`.js\` or \`.ts\` file.`),await this.exit()),vercelConfig.builds=vercelConfig.builds||[],vercelConfig.builds.push((0,import_fs_detectors2.getProxyBuilder)(vercelConfig.proxy,"latest",vercelConfig.functions))}if(this.sidecars===void 0){let services=(this.services??[]).filter(import_build_utils9.isExperimentalServiceV2);this.sidecars=await collectBuilderDevSidecars({builds:this.shouldUseServicesOrchestrator()?services.map(service=>service.builder):vercelConfig.builds??[],workPath:this.cwd,services})}scheduleEntrypointPlan&&(vercelConfig.builds??=[{src:"**",use:"@vercel/static"}],(0,import_schedule_entrypoint.assertNoScheduleEntrypointSourceConflict)(vercelConfig.builds,scheduleEntrypointPlan),vercelConfig.builds.push(...scheduleEntrypointPlan.builds));let functionBuilds=[...vercelConfig.builds??[]];Array.isArray(vercelConfig.builds)&&((this.getDevCommand(nextProjectSettings)||hasServices)&&(vercelConfig.builds=vercelConfig.builds.filter(this.shouldBuildInDev)),vercelConfig.builds.sort(sortBuilders)),vercelConfig.routes=(vercelConfig.routes||[]).filter(route=>"has"in route?(this.vercelConfigWarning||(this.vercelConfigWarning=!0,output_manager_default.warn(`The "has" property in ${vercelConfig[import_client.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`)),!1):!0);let[runEnv,buildEnv]=await Promise.all([this.getLocalEnv(".env",vercelConfig.env),this.getLocalEnv(".env.build",vercelConfig.build?.env)]),allEnv={...buildEnv,...runEnv},envFromCloud=Object.keys(allEnv).length===0;if(envFromCloud){let envValues={...this.envValues};this.address.host&&(envValues.VERCEL_URL=this.address.host),allEnv={...envValues},runEnv={...envValues},buildEnv={...envValues}}runEnv.NODE_ENV??=process.env.NODE_ENV??"development",allEnv.NODE_ENV??=runEnv.NODE_ENV,runEnv.NOW_REGION="dev1",buildEnv.NOW_REGION="dev1",allEnv.NOW_REGION="dev1",allEnv.VERCEL_ENV="development",allEnv.VERCEL="1",this.projectId&&!process.env.VERCEL_PROJECT_ID&&("VERCEL_PROJECT_ID"in allEnv||(allEnv.VERCEL_PROJECT_ID=this.projectId),"VERCEL_PROJECT_ID"in runEnv||(runEnv.VERCEL_PROJECT_ID=this.projectId)),this.orgId&&!process.env.VERCEL_ORG_ID&&("VERCEL_ORG_ID"in allEnv||(allEnv.VERCEL_ORG_ID=this.orgId),"VERCEL_ORG_ID"in runEnv||(runEnv.VERCEL_ORG_ID=this.orgId)),nextProjectSettings?.autoExposeSystemEnvs&&(runEnv.VERCEL_REGION="dev1"),runEnv.VERCEL_CLI_VERSION=pkg_default.version,Object.assign(runEnv,this.getDevQueueEnv()),Object.assign(runEnv,getDevSchedulesEnv(this.schedulesOrigin)),Object.assign(allEnv,getDevSchedulesEnv(this.schedulesOrigin)),Object.assign(runEnv,this.getDevRuntimeCacheEnv(runEnv));let hasQueueFunctions=Object.values(functionConfig.functions??{}).some(fn=>fn.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta"));if(this.queueBroker&&hasQueueFunctions&&hasResolvedServices)throw dev.DEV_QUEUE_FUNCTION_UNSUPPORTED({sourceFile:"functions",reason:"service-hosted function queue triggers are not supported locally yet"});let registry=await this.getFunctionDiscovery({scopes:(hasResolvedServices?[]:functionBuilds).map(build=>({build,target:vercelConfig.builds?.includes(build)?"builder":"framework"})),workPath:this.cwd,files:(sourceFiles??(await staticFiles(this.cwd,{})).map(f=>relative(this.cwd,f))).sort(),config:functionConfig,env:{...process.env,...allEnv,...this.getDevQueueEnv(),...getDevSchedulesEnv(this.schedulesOrigin),...this.getDevRuntimeCacheEnv(allEnv)}}),subscriptions,staticSchedules,sourceChanged;try{subscriptions=deriveQueueSubscriptions(registry),this.queueBroker?.validateFunctionSubscriptions(subscriptions),staticSchedules=collectStaticSchedules(scheduleEntrypointPlan?(0,import_schedule_entrypoint.resolveScheduleEntrypointTargets)(schedules,scheduleEntrypointPlan):schedules,registry),sourceChanged=!(0,import_fast_deep_equal.default)(this.staticSchedulesSnapshot,staticSchedules),sourceChanged&&this.scheduleBroker.validateStatic(staticSchedules)}catch(err){throw this.functionDiscovery=void 0,err}let{unmatchedPatterns}=registry;if(await this.refreshBulkRedirects(vercelConfig.bulkRedirectsPath),this.devCommandStarts.size&&await Promise.all(this.devCommandStarts),this.stopping||generation!==this.configGeneration)return vercelConfig;let restartForFunctionEnv=!!(this.devCommandEnv&&[...registry.functions.values()].some(fn=>fn.invocation.type==="http")&&!(0,import_fast_deep_equal.default)(this.devCommandEnv,allEnv)),previousProcess=this.devProcess,previousOrigin=this.devProcessOrigin,previousCommand=this.currentDevCommand,previousEnv=this.devCommandEnv,previousRuntime={projectSettings:this.projectSettings,allEnv:previousEnv??this.envConfigs.allEnv},restarted,validated=!1;try{if(this.initialDevCommandStarted&&await this.runDevCommand(restartForFunctionEnv,{projectSettings:nextProjectSettings,allEnv},origin=>{restarted={origin}}),this.stopping||generation!==this.configGeneration)return vercelConfig;this.queueBroker?.validateFunctionSubscriptions(subscriptions),sourceChanged=!(0,import_fast_deep_equal.default)(this.staticSchedulesSnapshot,staticSchedules),sourceChanged&&(this.scheduleBroker.validateStatic(staticSchedules),this.scheduleBroker.reconcileStatic(staticSchedules),this.staticSchedulesSnapshot=structuredClone(staticSchedules)),validated=!0}finally{!this.stopping&&!validated&&(this.devProcess!==previousProcess||this.devProcessOrigin!==previousOrigin||this.currentDevCommand!==previousCommand||this.devCommandEnv!==previousEnv)&&await this.runDevCommand(!0,previousRuntime)}this.projectSettings=nextProjectSettings,this.caseSensitive=hasNewRoutingProperties(vercelConfig),this.apiDir=(0,import_fs_detectors2.detectApiDirectory)(vercelConfig.builds||[]),this.apiExtensions=(0,import_fs_detectors2.detectApiExtensions)(vercelConfig.builds||[]),this.envConfigs={buildEnv,runEnv,allEnv},this.envFromCloud=envFromCloud,this.functionRegistry=registry,this.functionConfig=vercelConfig,restarted&&(this.devProcessOrigin=restarted.origin),this.queueBroker?.setFunctionSubscriptions(subscriptions,outputPath=>this.resolveDevFunction(outputPath));for(let pattern of unmatchedPatterns)if(!this.unmatchedQueuePatterns.has(pattern)){let warning=dev.DEV_QUEUE_FUNCTION_UNMATCHED({pattern});output_manager_default.warn(`[${warning.name}] ${warning.message} ${warning.fix}`)}return this.unmatchedQueuePatterns=new Set(unmatchedPatterns),this.onConfig?.(functionConfig),vercelConfig}async refreshBulkRedirects(bulkRedirectsPath){let configPath=bulkRedirectsPath??null;if(configPath===this.bulkRedirectsLastPath&&!this.bulkRedirectsDirty)return;if(this.bulkRedirectsLastPath=configPath,this.bulkRedirectsDirty=!1,this.bulkRedirectsResolvedPath=configPath?resolveBulkRedirectsPath(this.cwd,configPath):null,!configPath){this.bulkRedirects=null,this.bulkRedirectsSignature=null;return}let signature=await getBulkRedirectsSignature(this.cwd,configPath);if(signature!==this.bulkRedirectsSignature){this.bulkRedirectsSignature=signature;try{let result=await loadBulkRedirects(this.cwd,configPath);this.bulkRedirects=result.table;for(let warning of result.warnings)output_manager_default.warn(warning);let count=result.table.size;count>0&&output_manager_default.log(`Loaded ${count} bulk ${(0,import_pluralize2.default)("redirect",count)} from ${configPath}`)}catch(err){this.bulkRedirects=null,output_manager_default.warn(`Failed to load bulk redirects from "${configPath}": ${(0,import_error_utils2.errorToString)(err)}`)}}}async readJsonFile(filePath,strict=!1){let rel,abs;isAbsolute3(filePath)?(rel=path4.relative(this.cwd,filePath),abs=filePath):(rel=filePath,abs=join5(this.cwd,filePath)),output_manager_default.debug(`Reading \`${rel}\` file`);try{let raw=await import_fs_extra.default.readFile(abs,"utf8"),parsed=(0,import_json_parse_better_errors.default)(raw);return parsed[import_client.fileNameSymbol]=rel,parsed}catch(err){if(strict&&!((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT"))throw err;if((0,import_error_utils2.isError)(err))(0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT"?output_manager_default.debug(`No \`${rel}\` file present`):err.name==="SyntaxError"&&output_manager_default.warn(`There is a syntax error in the \`${rel}\` file: ${err.message}`);else throw err}}async tryValidateOrExit(config,validate){let message=validate(config);message&&(output_manager_default.error(message),await this.exit(1))}async validateVercelConfig(config){if(config.version===1){if(this.functionConfig)throw dev.DEV_UNSUPPORTED_CONFIG_VERSION();this.reportError(dev.DEV_UNSUPPORTED_CONFIG_VERSION()),await this.exit(1);return}let error3=validateConfig(config);if(error3){if(this.functionConfig)throw error3;this.reportError(error3),await this.exit(1)}}validateEnvConfig(type,env={},localEnv={}){let missing=Object.entries(env).filter(([name,value])=>typeof value=="string"&&value.startsWith("@")&&!hasProp(localEnv,name)).map(([name])=>name);if(missing.length>0)throw new MissingDotenvVarsError(type,missing);let merged={...env,...localEnv},hasInvalidName=!1;for(let key of Object.keys(merged))/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)||(output_manager_default.warn(`Ignoring ${type.split(".").slice(1).reverse().join(" ")} var ${JSON.stringify(key)} because name is invalid`),hasInvalidName=!0,delete merged[key]);return hasInvalidName&&output_manager_default.log("The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should not start with a digit"),merged}injectSystemValuesInDotenv(env){for(let name of Object.keys(env))name==="VERCEL_URL"?env.VERCEL_URL=this.address.host:name==="VERCEL_REGION"&&(env.VERCEL_REGION="dev1");return env}resolveBuildFiles(files){return Object.keys(files).filter(this.filter)}isWatcherIgnored(fsPath){let relativePath=relative(this.cwd,fsPath);return relativePath===""?!1:!this.filter(relativePath)}start(...listenSpec){return this.startPromise||(this.startPromise=this._start(...listenSpec).catch(async err=>{throw await this.stop(),err})),this.startPromise}async _start(...listenSpec){if(this.stopping)return;if(!import_fs_extra.default.existsSync(this.cwd))throw dev.DEV_CWD_NOT_FOUND({cwd:this.cwd});if(!import_fs_extra.default.lstatSync(this.cwd).isDirectory())throw dev.DEV_CWD_NOT_DIRECTORY({cwd:this.cwd});let{ig}=await(0,import_client.getVercelIgnore)(this.cwd);this.filter=ig.createFilter();let address=this.routing?null:`http://localhost:${this.devCommandPort}`;for(;typeof address!="string";){if(this.stopping)return;try{address=(await(this.listenerStartup=(0,import_async_listen.listen)(this.server,...listenSpec))).toString()}catch(err){if((0,import_error_utils2.isErrnoException)(err))if(output_manager_default.debug(`Got listen error: ${err.code}`),err.code==="EADDRINUSE")typeof listenSpec[0]=="number"?(output_manager_default.note(`Requested port ${import_chalk2.default.yellow(String(listenSpec[0]))} is already in use`),listenSpec[0]++):(this.reportError(dev.DEV_LISTEN_ADDRESS_IN_USE({address:String(listenSpec[0])})),process.exit(1));else throw err;else throw err}}if(this.stopping)return;this._address=new URL2(replaceLocalhost(address)),this.runtimeCache=new RuntimeCacheStore;let devCommandPorts=this.devCommandPort?[this.devCommandPort]:[],runtimeCacheListener=await(this.listenerStartup=listenOnDevResourcePort(this.runtimeCacheServer,{name:"Runtime Cache",flag:"--runtime-cache-port",defaultPort:DEV_RUNTIME_CACHE_DEFAULT_PORT,port:this.runtimeCachePort,reservedPorts:[this.queuePort,this.schedulesPort??DEV_SCHEDULES_DEFAULT_PORT,...devCommandPorts].filter(port=>port!==void 0&&port!==0)}));if(this.stopping)return;this.runtimeCacheOrigin=runtimeCacheListener.origin,runtimeCacheListener.defaultPort!==void 0&&output_manager_default.warn(`Runtime Cache default port ${runtimeCacheListener.defaultPort} is unavailable; listening on ${runtimeCacheListener.port} instead.
43
+ External clients configured for ${runtimeCacheListener.defaultPort} will not reach this dev server. Pin a port with --runtime-cache-port.`);let queueListener=await(this.listenerStartup=listenOnDevResourcePort(this.queueServer,{name:"Vercel Queues",flag:"--queue-port",defaultPort:DEV_QUEUE_DEFAULT_PORT,port:this.queuePort,reservedPorts:[this.schedulesPort??DEV_SCHEDULES_DEFAULT_PORT,...devCommandPorts]}));if(this.stopping)return;this.queueOrigin=queueListener.origin,queueListener.defaultPort!==void 0&&output_manager_default.warn(`Vercel Queues default port ${queueListener.defaultPort} is unavailable; listening on ${queueListener.port} instead.
44
+ External clients configured for ${queueListener.defaultPort} will not reach this dev server. Pin a port with --queue-port.`),this.queueBroker=new QueueBroker([],name=>this.orchestrator?.getServiceOrigin(name)??this.sidecarOrchestrator?.getServiceOrigin(name)??null);let schedulesListener=await(this.listenerStartup=listenOnDevResourcePort(this.schedulesServer,{name:"Vercel Schedules",flag:"--schedules-port",defaultPort:DEV_SCHEDULES_DEFAULT_PORT,port:this.schedulesPort,reservedPorts:devCommandPorts}));if(this.stopping||(this.schedulesOrigin=schedulesListener.origin,this.schedulesSessionPublication=createLocalSchedulesSession(this.cwd,`http://127.0.0.1:${schedulesListener.port}`,this.projectId??"prj_local").then(async published=>{this.stopping?await published.dispose():this.schedulesSession=published}),await this.schedulesSessionPublication,this.stopping))return;schedulesListener.defaultPort!==void 0&&output_manager_default.print(import_chalk2.default.yellow(`! Vercel Schedules default port ${schedulesListener.defaultPort} is unavailable; listening on ${schedulesListener.port} instead.
45
+ Pin a port with --schedules-port for clients outside the dev server.
46
+ `));let vercelConfig=await this.getVercelConfig();if(this.stopping)return;let devCommandPromise,startDevCommand=()=>{this.initialDevCommandStarted=!0,devCommandPromise=this.runDevCommand(),devCommandPromise.catch(()=>{})};if(this.shouldUseServicesOrchestrator()){let orchestratorServices=[...this.services||[],...(this.sidecars||[]).map(toOrchestratorService)];this.orchestrator=new ServicesOrchestrator({services:orchestratorServices,cwd:this.cwd,repoRoot:this.repoRoot,env:this.envConfigs.allEnv,proxyOrigin:this.address.origin,resourceEndpoints:this.resourceEndpoints,useImplicitEnvInjection:this.useImplicitServicesEnvInjection,onQueueSubscriptions:(serviceName,subscriptions)=>this.queueBroker?.updateServiceSubscriptions(serviceName,subscriptions)});let queueServices=orchestratorServices.filter(import_build_utils9.isExperimentalService).filter(import_build_utils9.isQueueBackedService);this.queueBroker.registerServices(queueServices),devCommandPromise=this.orchestrator.startAll(),this.devProcessOrigin=void 0;let addressFormatted=this.address.toString();this.address.pathname==="/"&&this.address.protocol==="http:"&&(addressFormatted=addressFormatted.replace(/\/$/,"")),output_manager_default.print(`${import_chalk2.default.cyan(">")} Available at:
47
+ `);let v1WebServices=(this.services||[]).filter(import_build_utils9.isExperimentalService).filter(service=>service.type==="web");if(v1WebServices.length>0)for(let service of v1WebServices){let servicePath=service.routePrefix||"/",serviceUrl=`${addressFormatted}${servicePath==="/"?"":servicePath}`;output_manager_default.print(` ${import_chalk2.default.bold(service.name)}: ${link_default(serviceUrl)}
48
+ `)}else output_manager_default.print(` ${link_default(addressFormatted)}
49
+ `)}else this.hasSubscribers()||startDevCommand();let files=await staticFiles(this.cwd,{});this.files={};for(let fsPath of files){let path6=relative(this.cwd,fsPath),{mode}=await import_fs_extra.default.stat(fsPath);this.files[path6]=new import_build_utils9.FileFsRef({mode,fsPath});let extensionless=this.getExtensionlessFile(path6);extensionless&&(this.files[extensionless]=new import_build_utils9.FileFsRef({mode,fsPath}))}await this.updateBuildMatches(vercelConfig,!0),await this.setupBuilderDevSidecars(),!this.shouldUseServicesOrchestrator()&&!devCommandPromise&&startDevCommand();let blockingBuilds=Array.from(this.buildMatches.values()).filter(needsBlockingBuild);if(blockingBuilds.length>0){output_manager_default.log(`Creating initial ${(0,import_pluralize2.default)("build",blockingBuilds.length)}`);for(let match of blockingBuilds)await executeBuild(vercelConfig,this,this.files,match,null,!0);output_manager_default.success("Build completed")}if(await import_fs_extra.default.mkdirp(this.devCacheDir),this.watcher=watch(this.cwd,{ignored:fsPath=>this.isWatcherIgnored(fsPath),ignoreInitial:!0,usePolling:!1,persistent:!0}),this.watcher.on("add",path6=>{this.enqueueFsEvent("add",path6)}),this.watcher.on("change",path6=>{this.enqueueFsEvent("change",path6)}),this.watcher.on("unlink",path6=>{this.enqueueFsEvent("unlink",path6)}),this.watcher.on("error",err=>{output_manager_default.error(`Watcher error: ${err}`)}),await(0,import_once.default)(this.watcher,"ready"),this.server.on("upgrade",async(req,socket,head)=>{if(await this.startPromise,this.orchestrator||this.sidecarOrchestrator){let pathname2=url3.parse(req.url||"/").pathname||"/",service=this.orchestrator?.getServiceForRoute(pathname2)||this.sidecarOrchestrator?.getServiceForRoute(pathname2);if(service){let target=`http://${service.host}:${service.port}`;output_manager_default.debug(`Detected "upgrade" event, proxying to service "${service.name}" at ${target}`),this.proxy.ws(req,socket,head,{target});return}if(this.orchestrator){let vercelConfig2=await this.getVercelConfig();if(vercelConfig2.experimentalServicesV2||vercelConfig2.services){let routeResult=await devRouter(req.url||"/",req.method,vercelConfig2.routes,this,vercelConfig2);if(isServiceDestination(routeResult.matched_route)){let{service:serviceName}=routeResult.matched_route.destination,origin=this.orchestrator.getServiceOrigin(serviceName);if(origin){output_manager_default.debug(`Detected "upgrade" event, proxying to service "${serviceName}" at ${origin}`),this.proxy.ws(req,socket,head,{target:origin});return}}}output_manager_default.debug(`Detected "upgrade" event, but no matching service found for ${pathname2}`),socket.destroy();return}}if(this.devProcessOrigin){let target=this.devProcessOrigin;output_manager_default.debug(`Detected "upgrade" event, proxying to ${target}`),this.proxy.ws(req,socket,head,{target});return}let pathname=url3.parse(req.url||"/").pathname||"/";for(let match of this.buildMatches.values()){let{builder}=match.builderWithPkg;if(typeof builder.startDevServer=="function")try{let result=await builder.startDevServer({files:this.files,entrypoint:match.entrypoint,workPath:this.cwd,config:match.config||{},repoRootPath:this.repoRoot,meta:{isDev:!0,...this.getDevResourceMeta(),requestPath:pathname,devCacheDir:this.devCacheDir,...this.getSidecarDevMeta(match),env:this.getBuilderDevEnv(match,this.envConfigs.runEnv),buildEnv:{...this.envConfigs.buildEnv}}});if(result){let{port,pid,shutdown}=result;this.shutdownCallbacks.set(pid,shutdown);let target=`http://127.0.0.1:${port}`;output_manager_default.debug(`Detected "upgrade" event, proxying to builder dev server at ${target}`),this.proxy.ws(req,socket,head,{target});return}}catch(err){output_manager_default.debug(`Failed to start dev server for upgrade: ${err}`)}}output_manager_default.debug(`Detected "upgrade" event, but no backend available for ${pathname}`),socket.destroy()}),await devCommandPromise,!this.stopping&&(this.functionDispatchReady=!0,this.scheduleBroker.start(),output_manager_default.log("Local resources:"),printAlignedLabel("Vercel Queues",link_default(this.queueOrigin)),printAlignedLabel("Vercel Schedules",link_default(this.schedulesOrigin)),printAlignedLabel("Runtime Cache",link_default(this.resourceEndpoints.runtimeCache.direct)),!this.orchestrator?.hasServices())){let addressFormatted=this.address.toString();this.address.pathname==="/"&&this.address.protocol==="http:"&&(addressFormatted=addressFormatted.replace(/\/$/,"")),output_manager_default.ready(`Available at ${link_default(addressFormatted)}`)}}stop(_exitCode){return this.stopPromise||(this.stopPromise=this._stop()),this.stopPromise}async _stop(){this.stopping=!0,this.devProcessOrigin=void 0,await this.listenerStartup?.catch(()=>{}),await this.schedulesSessionPublication?.catch(()=>{}),await this.scheduleBroker.close();let{devProcess}=this,{debug}=output_manager_default,ops=[];this.schedulesSession&&(ops.push(this.schedulesSession.dispose()),this.schedulesSession=void 0);for(let match of this.buildMatches.values())ops.push(shutdownBuilder(match));if(devProcess?.pid&&ops.push(treeKill(devProcess.pid)),ops.push(...Array.from(this.devCommandStarts,start=>start.catch(()=>{}))),this.orchestrator&&ops.push(this.orchestrator.stopAll()),this.sidecarOrchestrator&&ops.push(this.sidecarOrchestrator.stopAll()),this.queueBroker&&this.queueBroker.stop(),this.runtimeCache&&(this.runtimeCache.stop(),this.runtimeCache=void 0),ops.push(close(this.queueServer)),ops.push(close(this.runtimeCacheServer)),ops.push(close(this.schedulesServer)),ops.push(close(this.server)),this.functionDispatchReady||this.server.closeAllConnections(),this.watcher){debug("Closing file watcher");let closePromise=this.watcher.close();closePromise&&ops.push(closePromise)}for(let pid of this.shutdownCallbacks.keys())ops.push(this.killBuilderDevServer(pid));await Promise.all(ops),this.devProcess=void 0,this.devCommandEnv=void 0,this.currentDevCommand=void 0}async killBuilderDevServer(pid){let{debug}=output_manager_default;debug(`Killing builder dev server with PID ${pid}`);let shutdownCb=this.shutdownCallbacks.get(pid);if(this.shutdownCallbacks.delete(pid),shutdownCb){debug(`Running shutdown callback for PID ${pid}`),await shutdownCb();return}try{await treeKill(pid),debug(`Killed builder dev server with PID ${pid}`)}catch(err){debug(`Failed to kill builder dev server with PID ${pid}: ${err}`)}}async send404(req,res,requestId){return this.sendError(req,res,requestId,"NOT_FOUND",404)}async sendError(req,res,requestId,errorCode,statusCode=500,headers={}){res.statusCode=statusCode,this.setResponseHeaders(res,requestId,headers);let http_status_description=generateHttpStatusDescription(statusCode),error_code=errorCode||http_status_description,errorMessage2=generateErrorMessage(statusCode,error_code),body,{accept="text/plain"}=req.headers;if(accept.includes("json"))res.setHeader("content-type","application/json"),body=`${JSON.stringify({error:{code:statusCode,message:errorMessage2.title}})}
50
+ `;else if(accept.includes("html")){res.setHeader("content-type","text/html; charset=utf-8");let view;statusCode===404?view=error_404({...errorMessage2,http_status_code:statusCode,http_status_description,error_code,request_id:requestId}):statusCode===502?view=error_502({...errorMessage2,http_status_code:statusCode,http_status_description,error_code,request_id:requestId}):view=error({http_status_code:statusCode,http_status_description,error_code,request_id:requestId}),body=error_base({http_status_code:statusCode,http_status_description,view})}else res.setHeader("content-type","text/plain; charset=utf-8"),body=`${errorMessage2.title}
51
+
52
+ ${error_code}
53
+ `;res.end(body)}async sendRedirect(req,res,requestId,location,statusCode=302,responseTransforms){output_manager_default.debug(`Redirect ${statusCode}: ${location}`),res.statusCode=statusCode;let redirectHeaders={location};responseTransforms&&applyResponseTransforms(redirectHeaders,responseTransforms),this.setResponseHeaders(res,requestId,redirectHeaders);let body,{accept="text/plain"}=req.headers;accept.includes("json")?(res.setHeader("content-type","application/json"),body=`${JSON.stringify({redirect:location,status:String(statusCode)})}
54
+ `):accept.includes("html")?(res.setHeader("content-type","text/html; charset=utf-8"),body=redirect({location,statusCode})):(res.setHeader("content-type","text/plain; charset=utf-8"),body=`Redirecting...
55
+ `),res.end(body)}getRequestIp(req){return req.connection.remoteAddress||"127.0.0.1"}setResponseHeaders(res,requestId,headers={}){let allHeaders={"cache-control":"public, max-age=0, must-revalidate",...headers,server:"Vercel","x-vercel-id":requestId,"x-vercel-cache":"MISS"};for(let[name,value]of Object.entries(allHeaders))res.setHeader(name,value)}prepareTransforms(req,requestTransforms,responseTransforms){requestTransforms&&requestTransforms.length>0&&applyRequestTransforms(req,requestTransforms),responseTransforms&&hasResponseTransforms(responseTransforms)&&this.responseTransformsByReq.set(req,responseTransforms)}clearResponseTransforms(req){this.responseTransformsByReq.delete(req)}getProxyHeaders(req,requestId,xfwd){let ip=this.getRequestIp(req),{host}=req.headers,headers={connection:"close","x-real-ip":ip,"x-vercel-deployment-url":host,"x-vercel-forwarded-for":ip,"x-vercel-id":requestId};return xfwd&&(headers["x-forwarded-host"]=host,headers["x-forwarded-proto"]="http",headers["x-forwarded-for"]=ip),headers}getServiceRouteTable(serviceName){if(!this.serviceRoutesTable){this.serviceRoutesTable=new Map;for(let service of this.services||[]){if(!(0,import_build_utils9.isExperimentalServiceV2)(service))continue;let{routes,error:error3}=(0,import_routing_utils3.getTransformedRoutes)({routes:service.routes,rewrites:service.rewrites,redirects:service.redirects,headers:service.headers,cleanUrls:service.cleanUrls,trailingSlash:service.trailingSlash});error3?(output_manager_default.warn(`Invalid routes for service "${service.name}": ${error3.message}`),this.serviceRoutesTable.set(service.name,[])):this.serviceRoutesTable.set(service.name,routes||[])}}return this.serviceRoutesTable.get(serviceName)||[]}async delegateToService(req,res,requestId,matchedRoute,vercelConfig,requestTransforms,responseTransforms){let{debug}=output_manager_default,{service:serviceName,path:destPath}=matchedRoute.destination,origin=this.orchestrator?.getServiceOrigin(serviceName);if(!origin){output_manager_default.error(`Cannot route to service ${cmd(serviceName)}: it is not running.`),await this.sendError(req,res,requestId,"FUNCTION_INVOCATION_FAILED",502);return}let parsed=url3.parse(req.url||"/"),originalPathname=parsed.pathname||"/",lookupPath=originalPathname;if(typeof destPath=="string"&&matchedRoute.src){let keys=[],matcher=(0,import_pcre_to_regexp2.default)(`%${matchedRoute.src}%${this.isCaseSensitive()?"":"i"}`,keys),match=matcher.exec(originalPathname)||matcher.exec(originalPathname.substring(1));lookupPath=match?resolveRouteParameters(destPath,match,keys):destPath}let serviceRoutes=this.getServiceRouteTable(serviceName),proxyHeaders=this.getProxyHeaders(req,requestId,!1),requestTransformsToApply=[...requestTransforms??[]],responseTransformsToApply=responseTransforms,lookupUrl=`${lookupPath}${parsed.search||""}`,rewrittenUrl,externalDestUrl;if(serviceRoutes.length>0){let serviceResult=await devRouter(lookupUrl,req.method,serviceRoutes,this,vercelConfig);serviceResult.requestTransforms&&requestTransformsToApply.push(...serviceResult.requestTransforms),serviceResult.responseTransforms&&(responseTransformsToApply=serviceResult.responseTransforms);let location=serviceResult.headers?.location;if(location&&typeof serviceResult.status=="number"&&serviceResult.status>=300&&serviceResult.status<400){await this.sendRedirect(req,res,requestId,location,serviceResult.status,responseTransformsToApply);return}if(serviceResult.headers)for(let[name,value]of Object.entries(serviceResult.headers))name!=="location"&&res.setHeader(name,value);if(serviceResult.dest){let destParsed=url3.parse(serviceResult.dest),destQuery=parseQueryString(destParsed.search);Object.assign(destQuery,serviceResult.query),destParsed.search=formatQueryString(destQuery);let resolvedDest=url3.format(destParsed);serviceResult.isDestUrl?externalDestUrl=resolvedDest:resolvedDest!==lookupUrl&&(rewrittenUrl=resolvedDest)}}rewrittenUrl!==void 0&&(req.url=rewrittenUrl);for(let[name,value]of Object.entries(proxyHeaders))req.headers[name]=value;return this.prepareTransforms(req,requestTransformsToApply,responseTransformsToApply),this.setResponseHeaders(res,requestId),externalDestUrl?(debug(`Service "${serviceName}" rewrite to external URL: ${externalDestUrl}`),proxyPass(req,res,externalDestUrl,this,requestId)):(debug(`Delegating to service "${serviceName}": ${origin}${req.url}`),proxyPass(req,res,origin,this,requestId,!1))}async triggerBuild(match,requestPath,req,vercelConfig,previousBuildResult,filesChanged,filesRemoved){let functionBuild=this.canonicalizeFunctionBuild(match),cacheKey=functionBuild?null:requestPath,builds=this.inProgressBuilds.get(match)??new Map;if(functionBuild&&[...builds.keys()].some(key=>key!==null)){let pending=[...new Set(builds.values())],promise=pending.length===1?pending[0]:Promise.all(pending).then(()=>{});builds.clear(),builds.set(null,promise)}let buildKey=requestPath===null?match.entrypoint:`${match.entrypoint}-${requestPath}`,buildPromise=builds.get(cacheKey);if(buildPromise){let msg=`De-duping build "${buildKey}"`;req&&(msg+=` for "${req.method} ${req.url}"`),output_manager_default.debug(msg)}else{if(previousBuildResult)for(let[name]of Object.entries(previousBuildResult.output))output_manager_default.debug(`Removing asset "${name}"`),delete match.buildOutput[name];let msg=`Building asset "${buildKey}"`;req&&(msg+=` for "${req.method} ${req.url}"`),output_manager_default.debug(msg),buildPromise=executeBuild(vercelConfig,this,this.files,match,requestPath,!1,filesChanged,filesRemoved),builds.set(cacheKey,buildPromise),this.inProgressBuilds.set(match,builds)}try{await buildPromise,this.canonicalizeFunctionBuild(match)}finally{output_manager_default.debug(`Built asset ${buildKey}`),builds.get(cacheKey)===buildPromise&&builds.delete(cacheKey),builds.size===0&&this.inProgressBuilds.get(match)===builds&&this.inProgressBuilds.delete(match)}}async handleSchedulesProxyRequest(req,res){let pathname=(req.url||"/").split("?")[0];if(!pathname.startsWith(`${DEV_SCHEDULES_PROXY_PREFIX}/`))return!1;this.schedulesSession&&res.setHeader(LOCAL_SCHEDULES_SESSION_HEADER,this.schedulesSession.session.id);let prefix=`${DEV_SCHEDULES_PROXY_PREFIX}/${this.resourceProxyToken}`;return!this.schedulesOrigin||!pathname.startsWith(`${prefix}/`)?(res.writeHead(404),res.end("Not Found")):this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)?!isValidDevResourceHost(this.address.origin,req.headers.host)&&req.headers.host?.toLowerCase()!==this.address.host&&req.headers.host?.toLowerCase()!==`host.docker.internal${this.address.port?`:${this.address.port}`:""}`?(res.writeHead(403),res.end("Forbidden")):await this.handleSchedulesRoute(req,res,pathname.slice(prefix.length)):(res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized")),!0}renderDirectoryListing(_req,res,requestPath,requestId){if(this.projectSettings?.directoryListing===!1)return!1;let prefix=requestPath;prefix.length>0&&!prefix.endsWith("/")&&(prefix+="/");let dirs=new Set,files=Array.from(this.buildMatches.keys()).filter(p=>{let base=basename(p);if(base==="now.json"||base==="vercel.json"||base==="vercel.toml"||base===".nowignore"||base===".vercelignore"||!p.startsWith(prefix))return!1;let rel=relative(prefix,p);if(rel.includes("/")){let dir=rel.split("/")[0];if(dirs.has(dir))return!1;dirs.add(dir)}return!0}).map(p=>{let base=basename(p),ext="",type="file",href,rel=relative(prefix,p);return rel.includes("/")?(type="folder",base=rel.split("/")[0],href=`/${prefix}${base}/`):(ext=extname2(p).substring(1),href=`/${prefix}${base}`),{type,relative:href,ext,title:href,base}});if(files.length===0)return!1;let directory=`/${prefix}`,directoryHtml=(0,import_directory.default)({files,paths:[{name:directory,url:requestPath}],directory});return this.setResponseHeaders(res,requestId),res.setHeader("Content-Type","text/html; charset=utf-8"),res.setHeader("Content-Length",String(Buffer.byteLength(directoryHtml,"utf8"))),res.end(directoryHtml),!0}async hasFilesystem(dest,vercelConfig){return!!await findBuildMatch(this.buildMatches,this.files,dest,this,vercelConfig,!0)}isCaseSensitive(){return this.caseSensitive}async updateEnvValues(values){if(Object.assign(this.envValues,values),await this.getVercelConfigPromise?.catch(()=>{}),this.stopping||!this.envFromCloud)return;let{allEnv,runEnv,buildEnv}=this.envConfigs;Object.assign(allEnv,values),Object.assign(runEnv,values),Object.assign(buildEnv,values),await this.runDevCommand(!0)}runDevCommand(...args){let start=this._runDevCommand(...args);this.devCommandStarts.add(start);let clear=()=>{this.devCommandStarts.delete(start)};return start.then(clear,clear),start}async _runDevCommand(forceRestart=!1,{projectSettings,allEnv}={projectSettings:this.projectSettings,allEnv:this.envConfigs.allEnv},onReady=origin=>{this.devProcessOrigin=origin}){if(this.stopping||this.shouldUseServicesOrchestrator())return;let{cwd}=this,devCommand2=this.getDevCommand(projectSettings);if(devCommand2===this.currentDevCommand&&!forceRestart&&(!devCommand2||this.devProcess&&this.devProcessOrigin))return;this.currentDevCommand=devCommand2,this.devProcessOrigin=void 0;let previous=this.devProcess;if(previous&&(previous.pid&&await treeKill(previous.pid),this.devCommandPort&&previous.exitCode===null&&previous.signalCode===null&&await(0,import_once.default)(previous,"exit"),this.devProcess=void 0),this.devCommandEnv=void 0,this.stopping)return;if(!devCommand2){onReady(void 0);return}output_manager_default.log(`Running Dev Command ${import_chalk2.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`);let port=this.devCommandPort??await(0,import_get_port2.default)();if(this.stopping)return;if(this.devCommandPort&&!await waitForPortToFree(port,previous?DEV_COMMAND_PORT_RELEASE_TIMEOUT:0))throw dev.DEV_COMMAND_PORT_IN_USE({port});if(this.stopping)return;let env=(0,import_build_utils9.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},process.env,allEnv,this.getDevQueueEnv(),getDevSchedulesEnv(this.schedulesOrigin),{PORT:`${port}`,VERCEL_CLI_VERSION:pkg_default.version});Object.assign(env,this.getDevRuntimeCacheEnv(env));let nodeBinPath=(0,import_build_utils9.getNodeBinPaths)({base:this.repoRoot,start:cwd}).join(path4.delimiter);env.PATH=`${nodeBinPath}${path4.delimiter}${env.PATH}`;let command=replaceDevCommandPort(devCommand2,port);injectNextDevWebSocketShimIfNeeded(env,command,projectSettings),output_manager_default.debug(`Starting dev command with parameters: ${JSON.stringify({cwd,command,port})}`),output_manager_default.debug(`Spawning dev command: ${command}`);let proxyPort=new RegExp(port.toString(),"g"),p=(0,import_build_utils9.spawnCommand)(command,{stdio:["inherit","pipe","pipe"],cwd,env});if(this.devProcess=p,this.devCommandEnv={...allEnv},!p.stdout||!p.stderr)throw dev.DEV_INTERNAL_MISSING_CHILD_STDIO();p.stderr.pipe(process.stderr),p.stdout.setEncoding("utf8"),p.stdout.on("data",data=>{process.stdout.write(data.replace(proxyPort,this.address.port))});let devProcessExited=new Promise((_,reject)=>{p.on("error",err=>{output_manager_default.debug(`Dev command errored: ${err}`),reject(err)}),p.on("exit",(code,signal)=>{output_manager_default.debug(`Dev command exited with "${signal||code}"`),reject(new DevCommandExitError(`Dev command \u201C${devCommand2}\u201D exited with code ${signal||code}`,code??1))})});p.on("close",(code,signal)=>{output_manager_default.debug(`Dev command closed with "${signal||code}"`),this.devProcess===p&&(this.devProcessOrigin=void 0)});let devProcessHost=await Promise.race([checkForPort(port,DEV_SERVER_PORT_BIND_TIMEOUT),devProcessExited]);this.stopping||onReady(`http://${devProcessHost}:${port}`)}};function isServiceDestination(route){return!!route&&!(0,import_routing_utils3.isHandler)(route)&&typeof route.destination=="object"&&route.destination!==null&&"service"in route.destination&&typeof route.destination.service=="string"}function proxyPass(req,res,dest,devServer,requestId,ignorePath=!0){devServer.proxy.web(req,res,{target:dest,ignorePath},error3=>{devServer.clearResponseTransforms(req),output_manager_default.debug(`Failed to complete request to ${req.url}: ${error3}`),res.headersSent||devServer.sendError(req,res,requestId,"FUNCTION_INVOCATION_FAILED")})}function serveStaticFile(req,res,cwd,opts){return(0,import_serve_handler.default)(req,res,{public:cwd,cleanUrls:!1,etag:!0,...opts})}function close(server){return new Promise((resolve3,reject)=>{server.close(err=>{err&&(!(0,import_error_utils2.isErrnoException)(err)||err.code!=="ERR_SERVER_NOT_RUNNING")?reject(err):resolve3()})})}function generateRequestId(podId,isInvoke=!1){return`dev1::${isInvoke?"dev1::":""}${[podId,Date.now(),randomBytes2(6).toString("hex")].join("-")}`}function hasProp(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}async function findBuildMatch(matches,files,requestPath,devServer,vercelConfig,isFilesystem=!1){requestPath=requestPath.replace(/^\//,"");let bestIndexMatch;for(let match of matches.values())if(await shouldServe(match,files,requestPath,devServer,vercelConfig,isFilesystem,!!bestIndexMatch))if(isIndex(match.src)){if(extname2(match.src)===".html")return match;bestIndexMatch=match}else return match;return bestIndexMatch||null}async function shouldServe(match,files,requestPath,devServer,vercelConfig,isFilesystem=!1,hasMatched=!1){let{src,config,builderWithPkg:{builder}}=match;if(config?.middleware===!0||config?.scheduleFunction)return!1;let cleanSrc=src.endsWith(".html")?src.slice(0,-5):src,trimmedPath=requestPath.endsWith("/")?requestPath.slice(0,-1):requestPath;if(vercelConfig.cleanUrls&&vercelConfig.trailingSlash&&cleanSrc===trimmedPath)return!0;if(vercelConfig.cleanUrls&&!vercelConfig.trailingSlash&&cleanSrc===requestPath)return!0;if(!vercelConfig.cleanUrls&&vercelConfig.trailingSlash&&src===trimmedPath)return!0;if(typeof builder.shouldServe=="function"){if(await builder.shouldServe({entrypoint:src,files,config:config||{},requestPath,workPath:devServer.cwd,hasMatched}))return!0}else{if(findAsset(match,requestPath,vercelConfig))return!0;if(!isFilesystem&&await findMatchingRoute(match,requestPath,devServer,vercelConfig))return!0}return!1}async function findMatchingRoute(match,requestPath,devServer,vercelConfig){let reqUrl=`/${requestPath}`;for(let buildResult of match.buildResults.values()){if(!Array.isArray(buildResult.routes))continue;let route=await devRouter(reqUrl,void 0,buildResult.routes,devServer,vercelConfig);if(route.found)return route}}function findAsset(match,requestPath,vercelConfig){if(!match.buildOutput)return;let assetKey=requestPath.replace(/\/$/,""),asset2=match.buildOutput[requestPath];if(vercelConfig.trailingSlash&&requestPath.endsWith("/")&&(asset2=match.buildOutput[requestPath.slice(0,-1)]),!asset2){for(let[name,a]of Object.entries(match.buildOutput))if(isIndex(name)&&dirnameWithoutDot(name)===assetKey){asset2=a,assetKey=name;break}}if(asset2)return{asset:asset2,assetKey}}function dirnameWithoutDot(path6){let dir=dirname3(path6);return dir==="."&&(dir=""),dir}function isIndex(path6){let ext=extname2(path6);return basename(path6,ext)==="index"}function minimatches(files,pattern){return files.some(file=>file===pattern||(0,import_minimatch3.default)(file,pattern,{dot:!0}))}function fileChanged(name,changed,removed){changed.add(name),removed.delete(name)}function fileRemoved(name,files,changed,removed){delete files[name],changed.delete(name),removed.add(name)}function needsBlockingBuild(buildMatch){let{builder}=buildMatch.builderWithPkg;return typeof builder.shouldServe!="function"}function hasNewRoutingProperties(vercelConfig){return typeof vercelConfig.cleanUrls!==void 0||typeof vercelConfig.headers!==void 0||typeof vercelConfig.redirects!==void 0||typeof vercelConfig.rewrites!==void 0||typeof vercelConfig.trailingSlash!==void 0}function buildMatchEquals(a,b){return!(!a||!b||a.src!==b.src||a.use!==b.use||!(0,import_fast_deep_equal.default)(a.config||{},b.config||{}))}var import_get_port3=__toESM(require_get_port(),1);import{randomUUID as randomUUID2}from"node:crypto";import{connect as netConnect}from"node:net";function isMessage(arg,schema){return arg!==null&&typeof arg=="object"&&"$typeName"in arg&&typeof arg.$typeName=="string"?schema===void 0?!0:schema.typeName===arg.$typeName:!1}var ScalarType;(function(ScalarType2){ScalarType2[ScalarType2.DOUBLE=1]="DOUBLE",ScalarType2[ScalarType2.FLOAT=2]="FLOAT",ScalarType2[ScalarType2.INT64=3]="INT64",ScalarType2[ScalarType2.UINT64=4]="UINT64",ScalarType2[ScalarType2.INT32=5]="INT32",ScalarType2[ScalarType2.FIXED64=6]="FIXED64",ScalarType2[ScalarType2.FIXED32=7]="FIXED32",ScalarType2[ScalarType2.BOOL=8]="BOOL",ScalarType2[ScalarType2.STRING=9]="STRING",ScalarType2[ScalarType2.BYTES=12]="BYTES",ScalarType2[ScalarType2.UINT32=13]="UINT32",ScalarType2[ScalarType2.SFIXED32=15]="SFIXED32",ScalarType2[ScalarType2.SFIXED64=16]="SFIXED64",ScalarType2[ScalarType2.SINT32=17]="SINT32",ScalarType2[ScalarType2.SINT64=18]="SINT64"})(ScalarType||(ScalarType={}));function varint64read(){let lowBits=0,highBits=0;for(let shift=0;shift<28;shift+=7){let b=this.buf[this.pos++];if(lowBits|=(b&127)<<shift,!(b&128))return this.assertBounds(),[lowBits,highBits]}let middleByte=this.buf[this.pos++];if(lowBits|=(middleByte&15)<<28,highBits=(middleByte&112)>>4,!(middleByte&128))return this.assertBounds(),[lowBits,highBits];for(let shift=3;shift<=31;shift+=7){let b=this.buf[this.pos++];if(highBits|=(b&127)<<shift,!(b&128))return this.assertBounds(),[lowBits,highBits]}throw new Error("invalid varint")}function varint64write(lo,hi,bytes2){for(let i=0;i<28;i=i+7){let shift=lo>>>i,hasNext=!(!(shift>>>7)&&hi==0),byte=(hasNext?shift|128:shift)&255;if(bytes2.push(byte),!hasNext)return}let splitBits=lo>>>28&15|(hi&7)<<4,hasMoreBits=!!(hi>>3);if(bytes2.push((hasMoreBits?splitBits|128:splitBits)&255),!!hasMoreBits){for(let i=3;i<31;i=i+7){let shift=hi>>>i,hasNext=!!(shift>>>7),byte=(hasNext?shift|128:shift)&255;if(bytes2.push(byte),!hasNext)return}bytes2.push(hi>>>31&1)}}var TWO_PWR_32_DBL=4294967296;function int64FromString(dec){let minus=dec[0]==="-";minus&&(dec=dec.slice(1));let base=1e6,lowBits=0,highBits=0;function add1e6digit(begin,end){let digit1e6=Number(dec.slice(begin,end));highBits*=base,lowBits=lowBits*base+digit1e6,lowBits>=TWO_PWR_32_DBL&&(highBits=highBits+(lowBits/TWO_PWR_32_DBL|0),lowBits=lowBits%TWO_PWR_32_DBL)}return add1e6digit(-24,-18),add1e6digit(-18,-12),add1e6digit(-12,-6),add1e6digit(-6),minus?negate(lowBits,highBits):newBits(lowBits,highBits)}function int64ToString(lo,hi){let bits=newBits(lo,hi),negative=bits.hi&2147483648;negative&&(bits=negate(bits.lo,bits.hi));let result=uInt64ToString(bits.lo,bits.hi);return negative?"-"+result:result}function uInt64ToString(lo,hi){if({lo,hi}=toUnsigned(lo,hi),hi<=2097151)return String(TWO_PWR_32_DBL*hi+lo);let low=lo&16777215,mid=(lo>>>24|hi<<8)&16777215,high=hi>>16&65535,digitA=low+mid*6777216+high*6710656,digitB=mid+high*8147497,digitC=high*2,base=1e7;return digitA>=base&&(digitB+=Math.floor(digitA/base),digitA%=base),digitB>=base&&(digitC+=Math.floor(digitB/base),digitB%=base),digitC.toString()+decimalFrom1e7WithLeadingZeros(digitB)+decimalFrom1e7WithLeadingZeros(digitA)}function toUnsigned(lo,hi){return{lo:lo>>>0,hi:hi>>>0}}function newBits(lo,hi){return{lo:lo|0,hi:hi|0}}function negate(lowBits,highBits){return highBits=~highBits,lowBits?lowBits=~lowBits+1:highBits+=1,newBits(lowBits,highBits)}var decimalFrom1e7WithLeadingZeros=digit1e7=>{let partial=String(digit1e7);return"0000000".slice(partial.length)+partial};function varint32write(value,bytes2){if(value>=0){for(;value>127;)bytes2.push(value&127|128),value=value>>>7;bytes2.push(value)}else{for(let i=0;i<9;i++)bytes2.push(value&127|128),value=value>>7;bytes2.push(1)}}function varint32read(){let b=this.buf[this.pos++],result=b&127;if(!(b&128))return this.assertBounds(),result;if(b=this.buf[this.pos++],result|=(b&127)<<7,!(b&128))return this.assertBounds(),result;if(b=this.buf[this.pos++],result|=(b&127)<<14,!(b&128))return this.assertBounds(),result;if(b=this.buf[this.pos++],result|=(b&127)<<21,!(b&128))return this.assertBounds(),result;b=this.buf[this.pos++],result|=(b&15)<<28;for(let readBytes=5;b&128&&readBytes<10;readBytes++)b=this.buf[this.pos++];if(b&128)throw new Error("invalid varint");return this.assertBounds(),result>>>0}var protoInt64=makeInt64Support();function makeInt64Support(){let dv=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof dv.getBigInt64=="function"&&typeof dv.getBigUint64=="function"&&typeof dv.setBigInt64=="function"&&typeof dv.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let MIN=BigInt("-9223372036854775808"),MAX=BigInt("9223372036854775807"),UMIN=BigInt("0"),UMAX=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(value){let bi=typeof value=="bigint"?value:BigInt(value);if(bi>MAX||bi<MIN)throw new Error(`invalid int64: ${value}`);return bi},uParse(value){let bi=typeof value=="bigint"?value:BigInt(value);if(bi>UMAX||bi<UMIN)throw new Error(`invalid uint64: ${value}`);return bi},enc(value){return dv.setBigInt64(0,this.parse(value),!0),{lo:dv.getInt32(0,!0),hi:dv.getInt32(4,!0)}},uEnc(value){return dv.setBigInt64(0,this.uParse(value),!0),{lo:dv.getInt32(0,!0),hi:dv.getInt32(4,!0)}},dec(lo,hi){return dv.setInt32(0,lo,!0),dv.setInt32(4,hi,!0),dv.getBigInt64(0,!0)},uDec(lo,hi){return dv.setInt32(0,lo,!0),dv.setInt32(4,hi,!0),dv.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(value){return typeof value!="string"&&(value=value.toString()),assertInt64String(value),value},uParse(value){return typeof value!="string"&&(value=value.toString()),assertUInt64String(value),value},enc(value){return typeof value!="string"&&(value=value.toString()),assertInt64String(value),int64FromString(value)},uEnc(value){return typeof value!="string"&&(value=value.toString()),assertUInt64String(value),int64FromString(value)},dec(lo,hi){return int64ToString(lo,hi)},uDec(lo,hi){return uInt64ToString(lo,hi)}}}function assertInt64String(value){if(!/^-?[0-9]+$/.test(value))throw new Error("invalid int64: "+value)}function assertUInt64String(value){if(!/^[0-9]+$/.test(value))throw new Error("invalid uint64: "+value)}function scalarZeroValue(type,longAsString){switch(type){case ScalarType.STRING:return"";case ScalarType.BOOL:return!1;case ScalarType.DOUBLE:case ScalarType.FLOAT:return 0;case ScalarType.INT64:case ScalarType.UINT64:case ScalarType.SFIXED64:case ScalarType.FIXED64:case ScalarType.SINT64:return longAsString?"0":protoInt64.zero;case ScalarType.BYTES:return new Uint8Array(0);default:return 0}}function isScalarZeroValue(type,value){switch(type){case ScalarType.BOOL:return value===!1;case ScalarType.STRING:return value==="";case ScalarType.BYTES:return value instanceof Uint8Array&&!value.byteLength;default:return value==0}}var IMPLICIT=2,unsafeLocal=Symbol.for("reflect unsafe local");function unsafeOneofCase(target,oneof){let c=target[oneof.localName].case;return c===void 0?c:oneof.fields.find(f=>f.localName===c)}function unsafeIsSet(target,field){let name=field.localName;if(field.oneof)return target[field.oneof.localName].case===name;if(field.presence!=IMPLICIT)return target[name]!==void 0&&Object.prototype.hasOwnProperty.call(target,name);switch(field.fieldKind){case"list":return target[name].length>0;case"map":return Object.keys(target[name]).length>0;case"scalar":return!isScalarZeroValue(field.scalar,target[name]);case"enum":return target[name]!==field.enum.values[0].number}throw new Error("message field with implicit presence")}function unsafeIsSetExplicit(target,localName){return Object.prototype.hasOwnProperty.call(target,localName)&&target[localName]!==void 0}function unsafeGet(target,field){if(field.oneof){let oneof=target[field.oneof.localName];return oneof.case===field.localName?oneof.value:void 0}return target[field.localName]}function unsafeSet(target,field,value){field.oneof?target[field.oneof.localName]={case:field.localName,value}:target[field.localName]=value}function unsafeClear(target,field){let name=field.localName;if(field.oneof){let oneofLocalName=field.oneof.localName;target[oneofLocalName].case===name&&(target[oneofLocalName]={case:void 0})}else if(field.presence!=IMPLICIT)delete target[name];else switch(field.fieldKind){case"map":target[name]={};break;case"list":target[name]=[];break;case"enum":target[name]=field.enum.values[0].number;break;case"scalar":target[name]=scalarZeroValue(field.scalar,field.longAsString);break}}function isObject(arg){return arg!==null&&typeof arg=="object"&&!Array.isArray(arg)}function isReflectList(arg,field){var _a,_b,_c,_d;if(isObject(arg)&&unsafeLocal in arg&&"add"in arg&&"field"in arg&&typeof arg.field=="function"){if(field!==void 0){let a=field,b=arg.field();return a.listKind==b.listKind&&a.scalar===b.scalar&&((_a=a.message)===null||_a===void 0?void 0:_a.typeName)===((_b=b.message)===null||_b===void 0?void 0:_b.typeName)&&((_c=a.enum)===null||_c===void 0?void 0:_c.typeName)===((_d=b.enum)===null||_d===void 0?void 0:_d.typeName)}return!0}return!1}function isReflectMap(arg,field){var _a,_b,_c,_d;if(isObject(arg)&&unsafeLocal in arg&&"has"in arg&&"field"in arg&&typeof arg.field=="function"){if(field!==void 0){let a=field,b=arg.field();return a.mapKey===b.mapKey&&a.mapKind==b.mapKind&&a.scalar===b.scalar&&((_a=a.message)===null||_a===void 0?void 0:_a.typeName)===((_b=b.message)===null||_b===void 0?void 0:_b.typeName)&&((_c=a.enum)===null||_c===void 0?void 0:_c.typeName)===((_d=b.enum)===null||_d===void 0?void 0:_d.typeName)}return!0}return!1}function isReflectMessage(arg,messageDesc3){return isObject(arg)&&unsafeLocal in arg&&"desc"in arg&&isObject(arg.desc)&&arg.desc.kind==="message"&&(messageDesc3===void 0||arg.desc.typeName==messageDesc3.typeName)}function isWrapper(arg){return isWrapperTypeName(arg.$typeName)}function isWrapperDesc(messageDesc3){let f=messageDesc3.fields[0];return isWrapperTypeName(messageDesc3.typeName)&&f!==void 0&&f.fieldKind=="scalar"&&f.name=="value"&&f.number==1}function hasCustomJsonRepresentation(desc){switch(desc.typeName){case"google.protobuf.Any":case"google.protobuf.Timestamp":case"google.protobuf.Duration":case"google.protobuf.FieldMask":case"google.protobuf.Struct":case"google.protobuf.Value":case"google.protobuf.ListValue":return!0;default:return isWrapperDesc(desc)}}function isWrapperTypeName(name){return name.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(name.substring(16))}var EDITION_PROTO3=999,EDITION_PROTO2=998,IMPLICIT2=2;function create(schema,init){if(isMessage(init,schema))return init;let message=createZeroMessage(schema);return init!==void 0&&initMessage(schema,message,init),message}function initMessage(messageDesc3,message,init){for(let member of messageDesc3.members){let value=init[member.localName];if(value==null)continue;let field;if(member.kind=="oneof"){let oneofField=unsafeOneofCase(init,member);if(!oneofField)continue;field=oneofField,value=unsafeGet(init,oneofField)}else field=member;switch(field.fieldKind){case"message":value=toMessage(field,value);break;case"scalar":value=initScalar(field,value);break;case"list":value=initList(field,value);break;case"map":value=initMap(field,value);break}unsafeSet(message,field,value)}return message}function initScalar(field,value){return field.scalar==ScalarType.BYTES?toU8Arr(value):value}function initMap(field,value){if(isObject(value)){if(field.scalar==ScalarType.BYTES)return convertObjectValues(value,toU8Arr);if(field.mapKind=="message")return convertObjectValues(value,val=>toMessage(field,val))}return value}function initList(field,value){if(Array.isArray(value)){if(field.scalar==ScalarType.BYTES)return value.map(toU8Arr);if(field.listKind=="message")return value.map(item=>toMessage(field,item))}return value}function toMessage(field,value){if(field.fieldKind=="message"&&!field.oneof&&isWrapperDesc(field.message))return initScalar(field.message.fields[0],value);if(isObject(value)){if(field.message.typeName=="google.protobuf.Struct"&&field.parent.typeName!=="google.protobuf.Value")return value;if(!isMessage(value,field.message))return create(field.message,value)}return value}function toU8Arr(value){return Array.isArray(value)?new Uint8Array(value):value}function convertObjectValues(obj,fn){let ret={};for(let entry of Object.entries(obj))ret[entry[0]]=fn(entry[1]);return ret}var tokenZeroMessageField=Symbol(),messagePrototypes=new WeakMap;function createZeroMessage(desc){let msg;if(needsPrototypeChain(desc)){let cached=messagePrototypes.get(desc),prototype,members;if(cached)({prototype,members}=cached);else{prototype={},members=new Set;for(let member of desc.members)member.kind!="oneof"&&(member.fieldKind!="scalar"&&member.fieldKind!="enum"||member.presence!=IMPLICIT2&&(members.add(member),prototype[member.localName]=createZeroField(member)));messagePrototypes.set(desc,{prototype,members})}msg=Object.create(prototype),msg.$typeName=desc.typeName;for(let member of desc.members)members.has(member)||member.kind=="field"&&(member.fieldKind=="message"||(member.fieldKind=="scalar"||member.fieldKind=="enum")&&member.presence!=IMPLICIT2)||(msg[member.localName]=createZeroField(member))}else{msg={$typeName:desc.typeName};for(let member of desc.members)(member.kind=="oneof"||member.presence==IMPLICIT2)&&(msg[member.localName]=createZeroField(member))}return msg}function needsPrototypeChain(desc){switch(desc.file.edition){case EDITION_PROTO3:return!1;case EDITION_PROTO2:return!0;default:return desc.fields.some(f=>f.presence!=IMPLICIT2&&f.fieldKind!="message"&&!f.oneof)}}function createZeroField(field){if(field.kind=="oneof")return{case:void 0};if(field.fieldKind=="list")return[];if(field.fieldKind=="map")return{};if(field.fieldKind=="message")return tokenZeroMessageField;let defaultValue=field.getDefaultValue();return defaultValue!==void 0?field.fieldKind=="scalar"&&field.longAsString?defaultValue.toString():defaultValue:field.fieldKind=="scalar"?scalarZeroValue(field.scalar,field.longAsString):field.enum.values[0].number}var errorNames=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"],FieldError=class extends Error{constructor(fieldOrOneof,message,name="FieldValueInvalidError"){super(message),this.name=name,this.field=()=>fieldOrOneof}};function isFieldError(arg){return arg instanceof Error&&errorNames.includes(arg.name)&&"field"in arg&&typeof arg.field=="function"}var symbol=Symbol.for("@bufbuild/protobuf/text-encoding");function getTextEncoding(){if(globalThis[symbol]==null){let te=new globalThis.TextEncoder,td=new globalThis.TextDecoder,tdStrict;globalThis[symbol]={encodeUtf8(text){return te.encode(text)},decodeUtf8(bytes2,strict){return strict?(tdStrict===void 0&&(tdStrict=new globalThis.TextDecoder("utf-8",{fatal:!0})),tdStrict.decode(bytes2)):td.decode(bytes2)},checkUtf8(text){try{return encodeURIComponent(text),!0}catch{return!1}}}}return globalThis[symbol]}var WireType;(function(WireType2){WireType2[WireType2.Varint=0]="Varint",WireType2[WireType2.Bit64=1]="Bit64",WireType2[WireType2.LengthDelimited=2]="LengthDelimited",WireType2[WireType2.StartGroup=3]="StartGroup",WireType2[WireType2.EndGroup=4]="EndGroup",WireType2[WireType2.Bit32=5]="Bit32"})(WireType||(WireType={}));var FLOAT32_MAX=34028234663852886e22,FLOAT32_MIN=-34028234663852886e22,UINT32_MAX=4294967295,INT32_MAX=2147483647,INT32_MIN=-2147483648,BinaryWriter=class{constructor(encodeUtf8=getTextEncoding().encodeUtf8){this.encodeUtf8=encodeUtf8,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let len=0;for(let i=0;i<this.chunks.length;i++)len+=this.chunks[i].length;let bytes2=new Uint8Array(len),offset=0;for(let i=0;i<this.chunks.length;i++)bytes2.set(this.chunks[i],offset),offset+=this.chunks[i].length;return this.chunks=[],bytes2}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let chunk=this.finish(),prev=this.stack.pop();if(!prev)throw new Error("invalid state, fork stack empty");return this.chunks=prev.chunks,this.buf=prev.buf,this.uint32(chunk.byteLength),this.raw(chunk)}tag(fieldNo,type){return this.uint32((fieldNo<<3|type)>>>0)}raw(chunk){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(chunk),this}uint32(value){for(assertUInt32(value);value>127;)this.buf.push(value&127|128),value=value>>>7;return this.buf.push(value),this}int32(value){return assertInt32(value),varint32write(value,this.buf),this}bool(value){return this.buf.push(value?1:0),this}bytes(value){return this.uint32(value.byteLength),this.raw(value)}string(value){let chunk=this.encodeUtf8(value);return this.uint32(chunk.byteLength),this.raw(chunk)}float(value){assertFloat32(value);let chunk=new Uint8Array(4);return new DataView(chunk.buffer).setFloat32(0,value,!0),this.raw(chunk)}double(value){let chunk=new Uint8Array(8);return new DataView(chunk.buffer).setFloat64(0,value,!0),this.raw(chunk)}fixed32(value){assertUInt32(value);let chunk=new Uint8Array(4);return new DataView(chunk.buffer).setUint32(0,value,!0),this.raw(chunk)}sfixed32(value){assertInt32(value);let chunk=new Uint8Array(4);return new DataView(chunk.buffer).setInt32(0,value,!0),this.raw(chunk)}sint32(value){return assertInt32(value),value=(value<<1^value>>31)>>>0,varint32write(value,this.buf),this}sfixed64(value){let chunk=new Uint8Array(8),view=new DataView(chunk.buffer),tc=protoInt64.enc(value);return view.setInt32(0,tc.lo,!0),view.setInt32(4,tc.hi,!0),this.raw(chunk)}fixed64(value){let chunk=new Uint8Array(8),view=new DataView(chunk.buffer),tc=protoInt64.uEnc(value);return view.setInt32(0,tc.lo,!0),view.setInt32(4,tc.hi,!0),this.raw(chunk)}int64(value){let tc=protoInt64.enc(value);return varint64write(tc.lo,tc.hi,this.buf),this}sint64(value){let tc=protoInt64.enc(value),sign=tc.hi>>31,lo=tc.lo<<1^sign,hi=(tc.hi<<1|tc.lo>>>31)^sign;return varint64write(lo,hi,this.buf),this}uint64(value){let tc=protoInt64.uEnc(value);return varint64write(tc.lo,tc.hi,this.buf),this}},BinaryReader=class{constructor(buf,decodeUtf8=getTextEncoding().decodeUtf8){this.decodeUtf8=decodeUtf8,this.varint64=varint64read,this.uint32=varint32read,this.buf=buf,this.len=buf.length,this.pos=0,this.view=new DataView(buf.buffer,buf.byteOffset,buf.byteLength)}tag(){let start=this.pos,tag=this.uint32(),bytesRead=this.pos-start;if(bytesRead>5||bytesRead==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");let fieldNo=tag>>>3,wireType=tag&7;if(fieldNo<=0||wireType>5)throw new Error("illegal tag: field no "+fieldNo+" wire type "+wireType);return[fieldNo,wireType]}skip(wireType,fieldNo){let start=this.pos;switch(wireType){case WireType.Varint:for(;this.buf[this.pos++]&128;);break;case WireType.Bit64:this.pos+=4;case WireType.Bit32:this.pos+=4;break;case WireType.LengthDelimited:let len=this.uint32();this.pos+=len;break;case WireType.StartGroup:for(;;){let[fn,wt]=this.tag();if(wt===WireType.EndGroup){if(fieldNo!==void 0&&fn!==fieldNo)throw new Error("invalid end group tag");break}this.skip(wt,fn)}break;default:throw new Error("cant skip wire type "+wireType)}return this.assertBounds(),this.buf.subarray(start,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let zze=this.uint32();return zze>>>1^-(zze&1)}int64(){return protoInt64.dec(...this.varint64())}uint64(){return protoInt64.uDec(...this.varint64())}sint64(){let[lo,hi]=this.varint64(),s=-(lo&1);return lo=(lo>>>1|(hi&1)<<31)^s,hi=hi>>>1^s,protoInt64.dec(lo,hi)}bool(){let[lo,hi]=this.varint64();return lo!==0||hi!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return protoInt64.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return protoInt64.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let len=this.uint32(),start=this.pos;return this.pos+=len,this.assertBounds(),this.buf.subarray(start,start+len)}string(strict){return this.decodeUtf8(this.bytes(),strict)}};function assertInt32(arg){if(typeof arg=="string")arg=Number(arg);else if(typeof arg!="number")throw new Error("invalid int32: "+typeof arg);if(!Number.isInteger(arg)||arg>INT32_MAX||arg<INT32_MIN)throw new Error("invalid int32: "+arg)}function assertUInt32(arg){if(typeof arg=="string")arg=Number(arg);else if(typeof arg!="number")throw new Error("invalid uint32: "+typeof arg);if(!Number.isInteger(arg)||arg>UINT32_MAX||arg<0)throw new Error("invalid uint32: "+arg)}function assertFloat32(arg){if(typeof arg=="string"){let o=arg;if(arg=Number(arg),Number.isNaN(arg)&&o!=="NaN")throw new Error("invalid float32: "+o)}else if(typeof arg!="number")throw new Error("invalid float32: "+typeof arg);if(Number.isFinite(arg)&&(arg>FLOAT32_MAX||arg<FLOAT32_MIN))throw new Error("invalid float32: "+arg)}function checkField(field,value){let check=field.fieldKind=="list"?isReflectList(value,field):field.fieldKind=="map"?isReflectMap(value,field):checkSingular(field,value);if(check===!0)return;let reason;switch(field.fieldKind){case"list":reason=`expected ${formatReflectList(field)}, got ${formatVal(value)}`;break;case"map":reason=`expected ${formatReflectMap(field)}, got ${formatVal(value)}`;break;default:reason=reasonSingular(field,value,check)}return new FieldError(field,reason)}function checkListItem(field,index,value){let check=checkSingular(field,value);if(check!==!0)return new FieldError(field,`list item #${index+1}: ${reasonSingular(field,value,check)}`)}function checkMapEntry(field,key,value){let checkKey=checkScalarValue(key,field.mapKey);if(checkKey!==!0)return new FieldError(field,`invalid map key: ${reasonSingular({scalar:field.mapKey},key,checkKey)}`);let checkVal=checkSingular(field,value);if(checkVal!==!0)return new FieldError(field,`map entry ${formatVal(key)}: ${reasonSingular(field,value,checkVal)}`)}function checkSingular(field,value){return field.scalar!==void 0?checkScalarValue(value,field.scalar):field.enum!==void 0?field.enum.open?Number.isInteger(value):field.enum.values.some(v=>v.number===value):isReflectMessage(value,field.message)}function checkScalarValue(value,scalar){switch(scalar){case ScalarType.DOUBLE:return typeof value=="number";case ScalarType.FLOAT:return typeof value!="number"?!1:Number.isNaN(value)||!Number.isFinite(value)?!0:value>FLOAT32_MAX||value<FLOAT32_MIN?`${value.toFixed()} out of range`:!0;case ScalarType.INT32:case ScalarType.SFIXED32:case ScalarType.SINT32:return typeof value!="number"||!Number.isInteger(value)?!1:value>INT32_MAX||value<INT32_MIN?`${value.toFixed()} out of range`:!0;case ScalarType.FIXED32:case ScalarType.UINT32:return typeof value!="number"||!Number.isInteger(value)?!1:value>UINT32_MAX||value<0?`${value.toFixed()} out of range`:!0;case ScalarType.BOOL:return typeof value=="boolean";case ScalarType.STRING:return typeof value!="string"?!1:getTextEncoding().checkUtf8(value)||"invalid UTF8";case ScalarType.BYTES:return value instanceof Uint8Array;case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:if(typeof value=="bigint"||typeof value=="number"||typeof value=="string"&&value.length>0)try{return protoInt64.parse(value),!0}catch{return`${value} out of range`}return!1;case ScalarType.FIXED64:case ScalarType.UINT64:if(typeof value=="bigint"||typeof value=="number"||typeof value=="string"&&value.length>0)try{return protoInt64.uParse(value),!0}catch{return`${value} out of range`}return!1}}function reasonSingular(field,val,details){return details=typeof details=="string"?`: ${details}`:`, got ${formatVal(val)}`,field.scalar!==void 0?`expected ${scalarTypeDescription(field.scalar)}`+details:field.enum!==void 0?`expected ${field.enum.toString()}`+details:`expected ${formatReflectMessage(field.message)}`+details}function formatVal(val){switch(typeof val){case"object":return val===null?"null":val instanceof Uint8Array?`Uint8Array(${val.length})`:Array.isArray(val)?`Array(${val.length})`:isReflectList(val)?formatReflectList(val.field()):isReflectMap(val)?formatReflectMap(val.field()):isReflectMessage(val)?formatReflectMessage(val.desc):isMessage(val)?`message ${val.$typeName}`:"object";case"string":return val.length>30?"string":`"${val.split('"').join('\\"')}"`;case"boolean":return String(val);case"number":return String(val);case"bigint":return String(val)+"n";default:return typeof val}}function formatReflectMessage(desc){return`ReflectMessage (${desc.typeName})`}function formatReflectList(field){switch(field.listKind){case"message":return`ReflectList (${field.message.toString()})`;case"enum":return`ReflectList (${field.enum.toString()})`;case"scalar":return`ReflectList (${ScalarType[field.scalar]})`}}function formatReflectMap(field){switch(field.mapKind){case"message":return`ReflectMap (${ScalarType[field.mapKey]}, ${field.message.toString()})`;case"enum":return`ReflectMap (${ScalarType[field.mapKey]}, ${field.enum.toString()})`;case"scalar":return`ReflectMap (${ScalarType[field.mapKey]}, ${ScalarType[field.scalar]})`}}function scalarTypeDescription(scalar){switch(scalar){case ScalarType.STRING:return"string";case ScalarType.BOOL:return"boolean";case ScalarType.INT64:case ScalarType.SINT64:case ScalarType.SFIXED64:return"bigint (int64)";case ScalarType.UINT64:case ScalarType.FIXED64:return"bigint (uint64)";case ScalarType.BYTES:return"Uint8Array";case ScalarType.DOUBLE:return"number (float64)";case ScalarType.FLOAT:return"number (float32)";case ScalarType.FIXED32:case ScalarType.UINT32:return"number (uint32)";case ScalarType.INT32:case ScalarType.SFIXED32:case ScalarType.SINT32:return"number (int32)"}}function reflect(messageDesc3,message,check=!0){return new ReflectMessageImpl(messageDesc3,message,check)}var messageSortedFields=new WeakMap,ReflectMessageImpl=class{get sortedFields(){let cached=messageSortedFields.get(this.desc);if(cached)return cached;let sortedFields=this.desc.fields.concat().sort((a,b)=>a.number-b.number);return messageSortedFields.set(this.desc,sortedFields),sortedFields}constructor(messageDesc3,message,check=!0){this.lists=new Map,this.maps=new Map,this.check=check,this.desc=messageDesc3,this.message=this[unsafeLocal]=message??create(messageDesc3),this.fields=messageDesc3.fields,this.oneofs=messageDesc3.oneofs,this.members=messageDesc3.members}findNumber(number){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(f=>[f.number,f]))),this._fieldsByNumber.get(number)}oneofCase(oneof){return assertOwn(this.message,oneof),unsafeOneofCase(this.message,oneof)}isSet(field){return assertOwn(this.message,field),unsafeIsSet(this.message,field)}clear(field){assertOwn(this.message,field),unsafeClear(this.message,field)}get(field){assertOwn(this.message,field);let value=unsafeGet(this.message,field);switch(field.fieldKind){case"list":let list=this.lists.get(field);return(!list||list[unsafeLocal]!==value)&&this.lists.set(field,list=new ReflectListImpl(field,value,this.check)),list;case"map":let map=this.maps.get(field);return(!map||map[unsafeLocal]!==value)&&this.maps.set(field,map=new ReflectMapImpl(field,value,this.check)),map;case"message":return messageToReflect(field,value,this.check);case"scalar":return value===void 0?scalarZeroValue(field.scalar,!1):longToReflect(field,value);case"enum":return value??field.enum.values[0].number}}set(field,value){if(assertOwn(this.message,field),this.check){let err=checkField(field,value);if(err)throw err}let local;field.fieldKind=="message"?local=messageToLocal(field,value):isReflectMap(value)||isReflectList(value)?local=value[unsafeLocal]:local=longToLocal(field,value),unsafeSet(this.message,field,local)}getUnknown(){return this.message.$unknown}setUnknown(value){this.message.$unknown=value}};function assertOwn(owner,member){if(member.parent.typeName!==owner.$typeName)throw new FieldError(member,`cannot use ${member.toString()} with message ${owner.$typeName}`,"ForeignFieldError")}var ReflectListImpl=class{field(){return this._field}get size(){return this._arr.length}constructor(field,unsafeInput,check){this._field=field,this._arr=this[unsafeLocal]=unsafeInput,this.check=check}get(index){let item=this._arr[index];return item===void 0?void 0:listItemToReflect(this._field,item,this.check)}set(index,item){if(index<0||index>=this._arr.length)throw new FieldError(this._field,`list item #${index+1}: out of range`);if(this.check){let err=checkListItem(this._field,index,item);if(err)throw err}this._arr[index]=listItemToLocal(this._field,item)}add(item){if(this.check){let err=checkListItem(this._field,this._arr.length,item);if(err)throw err}this._arr.push(listItemToLocal(this._field,item))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(let item of this._arr)yield listItemToReflect(this._field,item,this.check)}*entries(){for(let i=0;i<this._arr.length;i++)yield[i,listItemToReflect(this._field,this._arr[i],this.check)]}};var ReflectMapImpl=class{constructor(field,unsafeInput,check=!0){this.obj=this[unsafeLocal]=unsafeInput??{},this.check=check,this._field=field}field(){return this._field}set(key,value){if(this.check){let err=checkMapEntry(this._field,key,value);if(err)throw err}return this.obj[mapKeyToLocal(key)]=mapValueToLocal(this._field,value),this}delete(key){let k=mapKeyToLocal(key),has=Object.prototype.hasOwnProperty.call(this.obj,k);return has&&delete this.obj[k],has}clear(){for(let key of Object.keys(this.obj))delete this.obj[key]}get(key){let val=this.obj[mapKeyToLocal(key)];return val!==void 0&&(val=mapValueToReflect(this._field,val,this.check)),val}has(key){return Object.prototype.hasOwnProperty.call(this.obj,mapKeyToLocal(key))}*keys(){for(let objKey of Object.keys(this.obj))yield mapKeyToReflect(objKey,this._field.mapKey)}*entries(){for(let objEntry of Object.entries(this.obj))yield[mapKeyToReflect(objEntry[0],this._field.mapKey),mapValueToReflect(this._field,objEntry[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(let val of Object.values(this.obj))yield mapValueToReflect(this._field,val,this.check)}forEach(callbackfn,thisArg){for(let mapEntry of this.entries())callbackfn.call(thisArg,mapEntry[1],mapEntry[0],this)}};function messageToLocal(field,value){return isReflectMessage(value)?isWrapper(value.message)&&!field.oneof&&field.fieldKind=="message"?value.message.value:value.desc.typeName=="google.protobuf.Struct"&&field.parent.typeName!="google.protobuf.Value"?wktStructToLocal(value.message):value.message:value}function messageToReflect(field,value,check){return value!==void 0&&(isWrapperDesc(field.message)&&!field.oneof&&field.fieldKind=="message"?value={$typeName:field.message.typeName,value:longToReflect(field.message.fields[0],value)}:field.message.typeName=="google.protobuf.Struct"&&field.parent.typeName!="google.protobuf.Value"&&isObject(value)&&(value=wktStructToReflect(value))),new ReflectMessageImpl(field.message,value,check)}function listItemToLocal(field,value){return field.listKind=="message"?messageToLocal(field,value):longToLocal(field,value)}function listItemToReflect(field,value,check){return field.listKind=="message"?messageToReflect(field,value,check):longToReflect(field,value)}function mapValueToLocal(field,value){return field.mapKind=="message"?messageToLocal(field,value):longToLocal(field,value)}function mapValueToReflect(field,value,check){return field.mapKind=="message"?messageToReflect(field,value,check):value}function mapKeyToLocal(key){return typeof key=="string"||typeof key=="number"?key:String(key)}function mapKeyToReflect(key,type){switch(type){case ScalarType.STRING:return key;case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.UINT32:case ScalarType.SFIXED32:case ScalarType.SINT32:{let n=Number.parseInt(key);if(Number.isFinite(n))return n;break}case ScalarType.BOOL:switch(key){case"true":return!0;case"false":return!1}break;case ScalarType.UINT64:case ScalarType.FIXED64:try{return protoInt64.uParse(key)}catch{}break;default:try{return protoInt64.parse(key)}catch{}break}return key}function longToReflect(field,value){switch(field.scalar){case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:"longAsString"in field&&field.longAsString&&typeof value=="string"&&(value=protoInt64.parse(value));break;case ScalarType.FIXED64:case ScalarType.UINT64:"longAsString"in field&&field.longAsString&&typeof value=="string"&&(value=protoInt64.uParse(value));break}return value}function longToLocal(field,value){switch(field.scalar){case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:"longAsString"in field&&field.longAsString?value=String(value):(typeof value=="string"||typeof value=="number")&&(value=protoInt64.parse(value));break;case ScalarType.FIXED64:case ScalarType.UINT64:"longAsString"in field&&field.longAsString?value=String(value):(typeof value=="string"||typeof value=="number")&&(value=protoInt64.uParse(value));break}return value}function wktStructToReflect(json){let struct={$typeName:"google.protobuf.Struct",fields:{}};if(isObject(json))for(let[k,v]of Object.entries(json))struct.fields[k]=wktValueToReflect(v);return struct}function wktStructToLocal(val){let json={};for(let[k,v]of Object.entries(val.fields))json[k]=wktValueToLocal(v);return json}function wktValueToLocal(val){switch(val.kind.case){case"structValue":return wktStructToLocal(val.kind.value);case"listValue":return val.kind.value.values.map(wktValueToLocal);case"nullValue":case void 0:return null;default:return val.kind.value}}function wktValueToReflect(json){let value={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof json){case"number":value.kind={case:"numberValue",value:json};break;case"string":value.kind={case:"stringValue",value:json};break;case"boolean":value.kind={case:"boolValue",value:json};break;case"object":if(json===null)value.kind={case:"nullValue",value:0};else if(Array.isArray(json)){let listValue={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(json))for(let e of json)listValue.values.push(wktValueToReflect(e));value.kind={case:"listValue",value:listValue}}else value.kind={case:"structValue",value:wktStructToReflect(json)};break}return value}function base64Decode(base64Str){let table=getDecodeTable(),es=base64Str.length*3/4;base64Str[base64Str.length-2]=="="?es-=2:base64Str[base64Str.length-1]=="="&&(es-=1);let bytes2=new Uint8Array(es),bytePos=0,groupPos=0,b,p=0;for(let i=0;i<base64Str.length;i++){if(b=table[base64Str.charCodeAt(i)],b===void 0)switch(base64Str[i]){case"=":groupPos=0;case`
56
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(groupPos){case 0:p=b,groupPos=1;break;case 1:bytes2[bytePos++]=p<<2|(b&48)>>4,p=b,groupPos=2;break;case 2:bytes2[bytePos++]=(p&15)<<4|(b&60)>>2,p=b,groupPos=3;break;case 3:bytes2[bytePos++]=(p&3)<<6|b,groupPos=0;break}}if(groupPos==1)throw Error("invalid base64 string");return bytes2.subarray(0,bytePos)}function base64Encode(bytes2,encoding="std"){let table=getEncodeTable(encoding),pad=encoding=="std",base64="",groupPos=0,b,p=0;for(let i=0;i<bytes2.length;i++)switch(b=bytes2[i],groupPos){case 0:base64+=table[b>>2],p=(b&3)<<4,groupPos=1;break;case 1:base64+=table[p|b>>4],p=(b&15)<<2,groupPos=2;break;case 2:base64+=table[p|b>>6],base64+=table[b&63],groupPos=0;break}return groupPos&&(base64+=table[p],pad&&(base64+="=",groupPos==1&&(base64+="="))),base64}var encodeTableStd,encodeTableUrl,decodeTable;function getEncodeTable(encoding){return encodeTableStd||(encodeTableStd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),encodeTableUrl=encodeTableStd.slice(0,-2).concat("-","_")),encoding=="url"?encodeTableUrl:encodeTableStd}function getDecodeTable(){if(!decodeTable){decodeTable=[];let encodeTable=getEncodeTable("std");for(let i=0;i<encodeTable.length;i++)decodeTable[encodeTable[i].charCodeAt(0)]=i;decodeTable["-".charCodeAt(0)]=encodeTable.indexOf("+"),decodeTable["_".charCodeAt(0)]=encodeTable.indexOf("/")}return decodeTable}function protoCamelCase(snakeCase){let capNext=!1,b=[];for(let i=0;i<snakeCase.length;i++){let c=snakeCase.charAt(i);switch(c){case"_":capNext=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":b.push(c),capNext=!1;break;default:capNext&&(capNext=!1,c=c.toUpperCase()),b.push(c);break}}return b.join("")}function protoSnakeCase(lowerCamelCase){return lowerCamelCase.replace(/[A-Z]/g,letter=>"_"+letter.toLowerCase())}var reservedObjectProperties=new Set(["constructor","toString","toJSON","valueOf"]);function safeObjectProperty(name){return reservedObjectProperties.has(name)?name+"$":name}function restoreJsonNames(message){for(let f of message.field)unsafeIsSetExplicit(f,"jsonName")||(f.jsonName=protoCamelCase(f.name));message.nestedType.forEach(restoreJsonNames)}function parseTextFormatEnumValue(descEnum,value){let enumValue=descEnum.values.find(v=>v.name===value);if(!enumValue)throw new Error(`cannot parse ${descEnum} default value: ${value}`);return enumValue.number}function parseTextFormatScalarValue(type,value){switch(type){case ScalarType.STRING:return value;case ScalarType.BYTES:{let u=unescapeBytesDefaultValue(value);if(u===!1)throw new Error(`cannot parse ${ScalarType[type]} default value: ${value}`);return u}case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:return protoInt64.parse(value);case ScalarType.UINT64:case ScalarType.FIXED64:return protoInt64.uParse(value);case ScalarType.DOUBLE:case ScalarType.FLOAT:switch(value){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(value)}case ScalarType.BOOL:return value==="true";case ScalarType.INT32:case ScalarType.UINT32:case ScalarType.SINT32:case ScalarType.FIXED32:case ScalarType.SFIXED32:return parseInt(value,10)}}function unescapeBytesDefaultValue(str){let b=[],input={tail:str,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(n){if(this.tail.length>=n){let r=this.tail.substring(0,n);return this.tail=this.tail.substring(n),r}return!1}};for(;input.next();)switch(input.c){case"\\":if(input.next())switch(input.c){case"\\":b.push(input.c.charCodeAt(0));break;case"b":b.push(8);break;case"f":b.push(12);break;case"n":b.push(10);break;case"r":b.push(13);break;case"t":b.push(9);break;case"v":b.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s=input.c,t=input.take(2);if(t===!1)return!1;let n=parseInt(s+t,8);if(Number.isNaN(n))return!1;b.push(n);break}case"x":{let s=input.c,t=input.take(2);if(t===!1)return!1;let n=parseInt(s+t,16);if(Number.isNaN(n))return!1;b.push(n);break}case"u":{let s=input.c,t=input.take(4);if(t===!1)return!1;let n=parseInt(s+t,16);if(Number.isNaN(n))return!1;let chunk=new Uint8Array(4);new DataView(chunk.buffer).setInt32(0,n,!0),b.push(chunk[0],chunk[1],chunk[2],chunk[3]);break}case"U":{let s=input.c,t=input.take(8);if(t===!1)return!1;let tc=protoInt64.uEnc(s+t),chunk=new Uint8Array(8),view=new DataView(chunk.buffer);view.setInt32(0,tc.lo,!0),view.setInt32(4,tc.hi,!0),b.push(chunk[0],chunk[1],chunk[2],chunk[3],chunk[4],chunk[5],chunk[6],chunk[7]);break}}break;default:b.push(input.c.charCodeAt(0))}return new Uint8Array(b)}function*nestedTypes(desc){switch(desc.kind){case"file":for(let message of desc.messages)yield message,yield*nestedTypes(message);yield*desc.enums,yield*desc.services,yield*desc.extensions;break;case"message":for(let message of desc.nestedMessages)yield message,yield*nestedTypes(message);yield*desc.nestedEnums,yield*desc.nestedExtensions;break}}function createFileRegistry(...args){let registry=createBaseRegistry();if(!args.length)return registry;if("$typeName"in args[0]&&args[0].$typeName=="google.protobuf.FileDescriptorSet"){for(let file of args[0].file)addFile(file,registry);return registry}if("$typeName"in args[0]){let recurseDeps=function(file){let deps=[];for(let protoFileName of file.dependency){if(registry.getFile(protoFileName)!=null||seen.has(protoFileName))continue;let dep=resolve3(protoFileName);if(!dep)throw new Error(`Unable to resolve ${protoFileName}, imported by ${file.name}`);"kind"in dep?registry.addFile(dep,!1,!0):(seen.add(dep.name),deps.push(dep))}return deps.concat(...deps.map(recurseDeps))},input=args[0],resolve3=args[1],seen=new Set;for(let file of[input,...recurseDeps(input)].reverse())addFile(file,registry)}else for(let fileReg of args)for(let file of fileReg.files)registry.addFile(file);return registry}function createBaseRegistry(){let types=new Map,extendees=new Map,files=new Map;return{kind:"registry",types,extendees,[Symbol.iterator](){return types.values()},get files(){return files.values()},addFile(file,skipTypes,withDeps){if(files.set(file.proto.name,file),!skipTypes)for(let type of nestedTypes(file))this.add(type);if(withDeps)for(let f of file.dependencies)this.addFile(f,skipTypes,withDeps)},add(desc){if(desc.kind=="extension"){let numberToExt=extendees.get(desc.extendee.typeName);numberToExt||extendees.set(desc.extendee.typeName,numberToExt=new Map),numberToExt.set(desc.number,desc)}types.set(desc.typeName,desc)},get(typeName){return types.get(typeName)},getFile(fileName){return files.get(fileName)},getMessage(typeName){let t=types.get(typeName);return t?.kind=="message"?t:void 0},getEnum(typeName){let t=types.get(typeName);return t?.kind=="enum"?t:void 0},getExtension(typeName){let t=types.get(typeName);return t?.kind=="extension"?t:void 0},getExtensionFor(extendee,no){var _a;return(_a=extendees.get(extendee.typeName))===null||_a===void 0?void 0:_a.get(no)},getService(typeName){let t=types.get(typeName);return t?.kind=="service"?t:void 0}}}var EDITION_PROTO22=998,EDITION_PROTO32=999,EDITION_UNSTABLE=9999,TYPE_STRING=9,TYPE_GROUP=10,TYPE_MESSAGE=11,TYPE_BYTES=12,TYPE_ENUM=14,LABEL_REPEATED=3,LABEL_REQUIRED=2,JS_STRING=1,IDEMPOTENCY_UNKNOWN=0,EXPLICIT=1,IMPLICIT3=2,LEGACY_REQUIRED=3,PACKED=1,DELIMITED=2,OPEN=1,VERIFY=2;var maximumEdition=1001,featureDefaults={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function addFile(proto,reg){var _a,_b;let file={kind:"file",proto,deprecated:(_b=(_a=proto.options)===null||_a===void 0?void 0:_a.deprecated)!==null&&_b!==void 0?_b:!1,edition:getFileEdition(proto),name:proto.name.replace(/\.proto$/,""),dependencies:findFileDependencies(proto,reg),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${proto.name}`}},mapEntriesStore=new Map,mapEntries={get(typeName){return mapEntriesStore.get(typeName)},add(desc){var _a2;assert(((_a2=desc.proto.options)===null||_a2===void 0?void 0:_a2.mapEntry)===!0),mapEntriesStore.set(desc.typeName,desc)}};for(let enumProto of proto.enumType)addEnum(enumProto,file,void 0,reg);for(let messageProto of proto.messageType)addMessage(messageProto,file,void 0,reg,mapEntries);for(let serviceProto of proto.service)addService(serviceProto,file,reg);addExtensions(file,reg);for(let mapEntry of mapEntriesStore.values())addFields(mapEntry,reg,mapEntries);for(let message of file.messages)addFields(message,reg,mapEntries),addExtensions(message,reg);reg.addFile(file,!0)}function addExtensions(desc,reg){switch(desc.kind){case"file":for(let proto of desc.proto.extension){let ext=newField(proto,desc,reg);desc.extensions.push(ext),reg.add(ext)}break;case"message":for(let proto of desc.proto.extension){let ext=newField(proto,desc,reg);desc.nestedExtensions.push(ext),reg.add(ext)}for(let message of desc.nestedMessages)addExtensions(message,reg);break}}function addFields(message,reg,mapEntries){let allOneofs=message.proto.oneofDecl.map(proto=>newOneof(proto,message)),oneofsSeen=new Set;for(let proto of message.proto.field){let oneof=findOneof(proto,allOneofs),field=newField(proto,message,reg,oneof,mapEntries);message.fields.push(field),message.field[field.localName]=field,oneof===void 0?message.members.push(field):(oneof.fields.push(field),oneofsSeen.has(oneof)||(oneofsSeen.add(oneof),message.members.push(oneof)))}for(let oneof of allOneofs.filter(o=>oneofsSeen.has(o)))message.oneofs.push(oneof);for(let child of message.nestedMessages)addFields(child,reg,mapEntries)}function addEnum(proto,file,parent,reg){var _a,_b,_c,_d,_e;let sharedPrefix=findEnumSharedPrefix(proto.name,proto.value),desc={kind:"enum",proto,deprecated:(_b=(_a=proto.options)===null||_a===void 0?void 0:_a.deprecated)!==null&&_b!==void 0?_b:!1,file,parent,open:!0,name:proto.name,typeName:makeTypeName(proto,parent,file),value:{},values:[],sharedPrefix,toString(){return`enum ${this.typeName}`}};desc.open=isEnumOpen(desc),reg.add(desc);for(let p of proto.value){let name=p.name;desc.values.push(desc.value[p.number]={kind:"enum_value",proto:p,deprecated:(_d=(_c=p.options)===null||_c===void 0?void 0:_c.deprecated)!==null&&_d!==void 0?_d:!1,parent:desc,name,localName:safeObjectProperty(sharedPrefix==null?name:name.substring(sharedPrefix.length)),number:p.number,toString(){return`enum value ${desc.typeName}.${name}`}})}((_e=parent?.nestedEnums)!==null&&_e!==void 0?_e:file.enums).push(desc)}function addMessage(proto,file,parent,reg,mapEntries){var _a,_b,_c,_d;let desc={kind:"message",proto,deprecated:(_b=(_a=proto.options)===null||_a===void 0?void 0:_a.deprecated)!==null&&_b!==void 0?_b:!1,file,parent,name:proto.name,typeName:makeTypeName(proto,parent,file),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((_c=proto.options)===null||_c===void 0?void 0:_c.mapEntry)===!0?mapEntries.add(desc):(((_d=parent?.nestedMessages)!==null&&_d!==void 0?_d:file.messages).push(desc),reg.add(desc));for(let enumProto of proto.enumType)addEnum(enumProto,file,desc,reg);for(let messageProto of proto.nestedType)addMessage(messageProto,file,desc,reg,mapEntries)}function addService(proto,file,reg){var _a,_b;let desc={kind:"service",proto,deprecated:(_b=(_a=proto.options)===null||_a===void 0?void 0:_a.deprecated)!==null&&_b!==void 0?_b:!1,file,name:proto.name,typeName:makeTypeName(proto,void 0,file),methods:[],method:{},toString(){return`service ${this.typeName}`}};file.services.push(desc),reg.add(desc);for(let methodProto of proto.method){let method=newMethod(methodProto,desc,reg);desc.methods.push(method),desc.method[method.localName]=method}}function newMethod(proto,parent,reg){var _a,_b,_c,_d;let methodKind;proto.clientStreaming&&proto.serverStreaming?methodKind="bidi_streaming":proto.clientStreaming?methodKind="client_streaming":proto.serverStreaming?methodKind="server_streaming":methodKind="unary";let input=reg.getMessage(trimLeadingDot(proto.inputType)),output=reg.getMessage(trimLeadingDot(proto.outputType));assert(input,`invalid MethodDescriptorProto: input_type ${proto.inputType} not found`),assert(output,`invalid MethodDescriptorProto: output_type ${proto.inputType} not found`);let name=proto.name;return{kind:"rpc",proto,deprecated:(_b=(_a=proto.options)===null||_a===void 0?void 0:_a.deprecated)!==null&&_b!==void 0?_b:!1,parent,name,localName:safeObjectProperty(name.length?safeObjectProperty(name[0].toLowerCase()+name.substring(1)):name),methodKind,input,output,idempotency:(_d=(_c=proto.options)===null||_c===void 0?void 0:_c.idempotencyLevel)!==null&&_d!==void 0?_d:IDEMPOTENCY_UNKNOWN,toString(){return`rpc ${parent.typeName}.${name}`}}}function newOneof(proto,parent){return{kind:"oneof",proto,deprecated:!1,parent,fields:[],name:proto.name,localName:safeObjectProperty(protoCamelCase(proto.name)),toString(){return`oneof ${parent.typeName}.${this.name}`}}}function newField(proto,parentOrFile,reg,oneof,mapEntries){var _a,_b,_c;let isExtension=mapEntries===void 0,field={kind:"field",proto,deprecated:(_b=(_a=proto.options)===null||_a===void 0?void 0:_a.deprecated)!==null&&_b!==void 0?_b:!1,name:proto.name,number:proto.number,scalar:void 0,message:void 0,enum:void 0,presence:getFieldPresence(proto,oneof,isExtension,parentOrFile),utf8Validation:isUtf8Validated(proto,parentOrFile),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(isExtension){let file=parentOrFile.kind=="file"?parentOrFile:parentOrFile.file,parent=parentOrFile.kind=="file"?void 0:parentOrFile,typeName=makeTypeName(proto,parent,file);field.kind="extension",field.file=file,field.parent=parent,field.oneof=void 0,field.typeName=typeName,field.jsonName=`[${typeName}]`,field.toString=()=>`extension ${typeName}`;let extendee=reg.getMessage(trimLeadingDot(proto.extendee));assert(extendee,`invalid FieldDescriptorProto: extendee ${proto.extendee} not found`),field.extendee=extendee}else{let parent=parentOrFile;assert(parent.kind=="message"),field.parent=parent,field.oneof=oneof,field.localName=oneof?protoCamelCase(proto.name):safeObjectProperty(protoCamelCase(proto.name)),field.jsonName=proto.jsonName,field.toString=()=>`field ${parent.typeName}.${proto.name}`}let label=proto.label,type=proto.type,jstype=(_c=proto.options)===null||_c===void 0?void 0:_c.jstype;if(label===LABEL_REPEATED){let mapEntry=type==TYPE_MESSAGE?mapEntries?.get(trimLeadingDot(proto.typeName)):void 0;if(mapEntry){field.fieldKind="map";let{key,value}=findMapEntryFields(mapEntry);return field.mapKey=key.scalar,field.mapKind=value.fieldKind,field.message=value.message,field.delimitedEncoding=!1,field.enum=value.enum,field.scalar=value.scalar,field}switch(field.fieldKind="list",type){case TYPE_MESSAGE:case TYPE_GROUP:field.listKind="message",field.message=reg.getMessage(trimLeadingDot(proto.typeName)),assert(field.message),field.delimitedEncoding=isDelimitedEncoding(proto,parentOrFile);break;case TYPE_ENUM:field.listKind="enum",field.enum=reg.getEnum(trimLeadingDot(proto.typeName)),assert(field.enum);break;default:field.listKind="scalar",field.scalar=type,field.longAsString=jstype==JS_STRING;break}return field.packed=isPackedField(proto,parentOrFile),field}switch(type){case TYPE_MESSAGE:case TYPE_GROUP:field.fieldKind="message",field.message=reg.getMessage(trimLeadingDot(proto.typeName)),assert(field.message,`invalid FieldDescriptorProto: type_name ${proto.typeName} not found`),field.delimitedEncoding=isDelimitedEncoding(proto,parentOrFile),field.getDefaultValue=()=>{};break;case TYPE_ENUM:{let enumeration=reg.getEnum(trimLeadingDot(proto.typeName));assert(enumeration!==void 0,`invalid FieldDescriptorProto: type_name ${proto.typeName} not found`),field.fieldKind="enum",field.enum=reg.getEnum(trimLeadingDot(proto.typeName)),field.getDefaultValue=()=>unsafeIsSetExplicit(proto,"defaultValue")?parseTextFormatEnumValue(enumeration,proto.defaultValue):void 0;break}default:{field.fieldKind="scalar",field.scalar=type,field.longAsString=jstype==JS_STRING,field.getDefaultValue=()=>unsafeIsSetExplicit(proto,"defaultValue")?parseTextFormatScalarValue(type,proto.defaultValue):void 0;break}}return field}function getFileEdition(proto){switch(proto.syntax){case"":case"proto2":return EDITION_PROTO22;case"proto3":return EDITION_PROTO32;case"editions":if(proto.edition===EDITION_UNSTABLE)return maximumEdition;if(proto.edition in featureDefaults)return proto.edition;throw new Error(`${proto.name}: unsupported edition`);default:throw new Error(`${proto.name}: unsupported syntax "${proto.syntax}"`)}}function findFileDependencies(proto,reg){return proto.dependency.map(wantName=>{let dep=reg.getFile(wantName);if(!dep)throw new Error(`Cannot find ${wantName}, imported by ${proto.name}`);return dep})}function findEnumSharedPrefix(enumName,values){let prefix=camelToSnakeCase(enumName)+"_";for(let value of values){if(!value.name.toLowerCase().startsWith(prefix))return;let shortName=value.name.substring(prefix.length);if(shortName.length==0||/^\d/.test(shortName))return}return prefix}function camelToSnakeCase(camel){return(camel.substring(0,1)+camel.substring(1).replace(/[A-Z]/g,c=>"_"+c)).toLowerCase()}function makeTypeName(proto,parent,file){let typeName;return parent?typeName=`${parent.typeName}.${proto.name}`:file.proto.package.length>0?typeName=`${file.proto.package}.${proto.name}`:typeName=`${proto.name}`,typeName}function trimLeadingDot(typeName){return typeName.startsWith(".")?typeName.substring(1):typeName}function findOneof(proto,allOneofs){if(!unsafeIsSetExplicit(proto,"oneofIndex")||proto.proto3Optional)return;let oneof=allOneofs[proto.oneofIndex];return assert(oneof,`invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`),oneof}function getFieldPresence(proto,oneof,isExtension,parent){if(proto.label==LABEL_REQUIRED)return LEGACY_REQUIRED;if(proto.label==LABEL_REPEATED)return IMPLICIT3;if(oneof||proto.proto3Optional||isExtension)return EXPLICIT;let resolved=resolveFeature("fieldPresence",{proto,parent});return resolved==IMPLICIT3&&(proto.type==TYPE_MESSAGE||proto.type==TYPE_GROUP)?EXPLICIT:resolved}function isPackedField(proto,parent){if(proto.label!=LABEL_REPEATED)return!1;switch(proto.type){case TYPE_STRING:case TYPE_BYTES:case TYPE_GROUP:case TYPE_MESSAGE:return!1}let o=proto.options;return o&&unsafeIsSetExplicit(o,"packed")?o.packed:PACKED==resolveFeature("repeatedFieldEncoding",{proto,parent})}function findMapEntryFields(mapEntry){let key=mapEntry.fields.find(f=>f.number===1),value=mapEntry.fields.find(f=>f.number===2);return assert(key&&key.fieldKind=="scalar"&&key.scalar!=ScalarType.BYTES&&key.scalar!=ScalarType.FLOAT&&key.scalar!=ScalarType.DOUBLE&&value&&value.fieldKind!="list"&&value.fieldKind!="map"),{key,value}}function isEnumOpen(desc){var _a;return OPEN==resolveFeature("enumType",{proto:desc.proto,parent:(_a=desc.parent)!==null&&_a!==void 0?_a:desc.file})}function isDelimitedEncoding(proto,parent){return proto.type==TYPE_GROUP?!0:DELIMITED==resolveFeature("messageEncoding",{proto,parent})}function isUtf8Validated(proto,parent){return VERIFY==resolveFeature("utf8Validation",{proto,parent})}function resolveFeature(name,ref){var _a,_b;let featureSet=(_a=ref.proto.options)===null||_a===void 0?void 0:_a.features;if(featureSet){let val=featureSet[name];if(val!=0)return val}if("kind"in ref){if(ref.kind=="message")return resolveFeature(name,(_b=ref.parent)!==null&&_b!==void 0?_b:ref.file);let editionDefaults=featureDefaults[ref.edition];if(!editionDefaults)throw new Error(`feature default for edition ${ref.edition} not found`);return editionDefaults[name]}return resolveFeature(name,ref.parent)}function assert(condition,msg){if(!condition)throw new Error(msg)}function boot(boot2){let root=bootFileDescriptorProto(boot2);return root.messageType.forEach(restoreJsonNames),createFileRegistry(root,()=>{}).getFile(root.name)}function bootFileDescriptorProto(init){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},init),{messageType:init.messageType.map(bootDescriptorProto),enumType:init.enumType.map(bootEnumDescriptorProto)}))}function bootDescriptorProto(init){var _a,_b,_c,_d,_e,_f,_g,_h;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:init.name,field:(_b=(_a=init.field)===null||_a===void 0?void 0:_a.map(bootFieldDescriptorProto))!==null&&_b!==void 0?_b:[],extension:[],nestedType:(_d=(_c=init.nestedType)===null||_c===void 0?void 0:_c.map(bootDescriptorProto))!==null&&_d!==void 0?_d:[],enumType:(_f=(_e=init.enumType)===null||_e===void 0?void 0:_e.map(bootEnumDescriptorProto))!==null&&_f!==void 0?_f:[],extensionRange:(_h=(_g=init.extensionRange)===null||_g===void 0?void 0:_g.map(e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e)))!==null&&_h!==void 0?_h:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function bootFieldDescriptorProto(init){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},init),{options:init.options?bootFieldOptions(init.options):void 0}))}function bootFieldOptions(init){var _a,_b,_c;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},init),{targets:(_a=init.targets)!==null&&_a!==void 0?_a:[],editionDefaults:(_c=(_b=init.editionDefaults)===null||_b===void 0?void 0:_b.map(e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e)))!==null&&_c!==void 0?_c:[],uninterpretedOption:[]}))}function bootEnumDescriptorProto(init){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:init.name,reservedName:[],reservedRange:[],value:init.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))})}function messageDesc(file,path6,...paths){return paths.reduce((acc,cur)=>acc.nestedMessages[cur],file.messages[path6])}function enumDesc(file,path6,...paths){if(paths.length==0)return file.enums[path6];let e=paths.pop();return paths.reduce((acc,cur)=>acc.nestedMessages[cur],file.messages[path6]).nestedEnums[e]}var file_google_protobuf_descriptor=boot({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false",options:{}},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"removal_error",number:5,type:9,label:1}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_UNSTABLE",number:9999},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]});var FileDescriptorProtoSchema=messageDesc(file_google_protobuf_descriptor,1);var ExtensionRangeOptions_VerificationState;(function(ExtensionRangeOptions_VerificationState2){ExtensionRangeOptions_VerificationState2[ExtensionRangeOptions_VerificationState2.DECLARATION=0]="DECLARATION",ExtensionRangeOptions_VerificationState2[ExtensionRangeOptions_VerificationState2.UNVERIFIED=1]="UNVERIFIED"})(ExtensionRangeOptions_VerificationState||(ExtensionRangeOptions_VerificationState={}));var FieldDescriptorProto_Type;(function(FieldDescriptorProto_Type2){FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.DOUBLE=1]="DOUBLE",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.FLOAT=2]="FLOAT",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.INT64=3]="INT64",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.UINT64=4]="UINT64",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.INT32=5]="INT32",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.FIXED64=6]="FIXED64",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.FIXED32=7]="FIXED32",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.BOOL=8]="BOOL",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.STRING=9]="STRING",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.GROUP=10]="GROUP",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.MESSAGE=11]="MESSAGE",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.BYTES=12]="BYTES",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.UINT32=13]="UINT32",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.ENUM=14]="ENUM",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.SFIXED32=15]="SFIXED32",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.SFIXED64=16]="SFIXED64",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.SINT32=17]="SINT32",FieldDescriptorProto_Type2[FieldDescriptorProto_Type2.SINT64=18]="SINT64"})(FieldDescriptorProto_Type||(FieldDescriptorProto_Type={}));var FieldDescriptorProto_Label;(function(FieldDescriptorProto_Label2){FieldDescriptorProto_Label2[FieldDescriptorProto_Label2.OPTIONAL=1]="OPTIONAL",FieldDescriptorProto_Label2[FieldDescriptorProto_Label2.REPEATED=3]="REPEATED",FieldDescriptorProto_Label2[FieldDescriptorProto_Label2.REQUIRED=2]="REQUIRED"})(FieldDescriptorProto_Label||(FieldDescriptorProto_Label={}));var FileOptions_OptimizeMode;(function(FileOptions_OptimizeMode2){FileOptions_OptimizeMode2[FileOptions_OptimizeMode2.SPEED=1]="SPEED",FileOptions_OptimizeMode2[FileOptions_OptimizeMode2.CODE_SIZE=2]="CODE_SIZE",FileOptions_OptimizeMode2[FileOptions_OptimizeMode2.LITE_RUNTIME=3]="LITE_RUNTIME"})(FileOptions_OptimizeMode||(FileOptions_OptimizeMode={}));var FieldOptions_CType;(function(FieldOptions_CType2){FieldOptions_CType2[FieldOptions_CType2.STRING=0]="STRING",FieldOptions_CType2[FieldOptions_CType2.CORD=1]="CORD",FieldOptions_CType2[FieldOptions_CType2.STRING_PIECE=2]="STRING_PIECE"})(FieldOptions_CType||(FieldOptions_CType={}));var FieldOptions_JSType;(function(FieldOptions_JSType2){FieldOptions_JSType2[FieldOptions_JSType2.JS_NORMAL=0]="JS_NORMAL",FieldOptions_JSType2[FieldOptions_JSType2.JS_STRING=1]="JS_STRING",FieldOptions_JSType2[FieldOptions_JSType2.JS_NUMBER=2]="JS_NUMBER"})(FieldOptions_JSType||(FieldOptions_JSType={}));var FieldOptions_OptionRetention;(function(FieldOptions_OptionRetention2){FieldOptions_OptionRetention2[FieldOptions_OptionRetention2.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",FieldOptions_OptionRetention2[FieldOptions_OptionRetention2.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",FieldOptions_OptionRetention2[FieldOptions_OptionRetention2.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(FieldOptions_OptionRetention||(FieldOptions_OptionRetention={}));var FieldOptions_OptionTargetType;(function(FieldOptions_OptionTargetType2){FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(FieldOptions_OptionTargetType||(FieldOptions_OptionTargetType={}));var MethodOptions_IdempotencyLevel;(function(MethodOptions_IdempotencyLevel2){MethodOptions_IdempotencyLevel2[MethodOptions_IdempotencyLevel2.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",MethodOptions_IdempotencyLevel2[MethodOptions_IdempotencyLevel2.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",MethodOptions_IdempotencyLevel2[MethodOptions_IdempotencyLevel2.IDEMPOTENT=2]="IDEMPOTENT"})(MethodOptions_IdempotencyLevel||(MethodOptions_IdempotencyLevel={}));var FeatureSet_VisibilityFeature_DefaultSymbolVisibility;(function(FeatureSet_VisibilityFeature_DefaultSymbolVisibility2){FeatureSet_VisibilityFeature_DefaultSymbolVisibility2[FeatureSet_VisibilityFeature_DefaultSymbolVisibility2.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",FeatureSet_VisibilityFeature_DefaultSymbolVisibility2[FeatureSet_VisibilityFeature_DefaultSymbolVisibility2.EXPORT_ALL=1]="EXPORT_ALL",FeatureSet_VisibilityFeature_DefaultSymbolVisibility2[FeatureSet_VisibilityFeature_DefaultSymbolVisibility2.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",FeatureSet_VisibilityFeature_DefaultSymbolVisibility2[FeatureSet_VisibilityFeature_DefaultSymbolVisibility2.LOCAL_ALL=3]="LOCAL_ALL",FeatureSet_VisibilityFeature_DefaultSymbolVisibility2[FeatureSet_VisibilityFeature_DefaultSymbolVisibility2.STRICT=4]="STRICT"})(FeatureSet_VisibilityFeature_DefaultSymbolVisibility||(FeatureSet_VisibilityFeature_DefaultSymbolVisibility={}));var FeatureSet_FieldPresence;(function(FeatureSet_FieldPresence2){FeatureSet_FieldPresence2[FeatureSet_FieldPresence2.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",FeatureSet_FieldPresence2[FeatureSet_FieldPresence2.EXPLICIT=1]="EXPLICIT",FeatureSet_FieldPresence2[FeatureSet_FieldPresence2.IMPLICIT=2]="IMPLICIT",FeatureSet_FieldPresence2[FeatureSet_FieldPresence2.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(FeatureSet_FieldPresence||(FeatureSet_FieldPresence={}));var FeatureSet_EnumType;(function(FeatureSet_EnumType2){FeatureSet_EnumType2[FeatureSet_EnumType2.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",FeatureSet_EnumType2[FeatureSet_EnumType2.OPEN=1]="OPEN",FeatureSet_EnumType2[FeatureSet_EnumType2.CLOSED=2]="CLOSED"})(FeatureSet_EnumType||(FeatureSet_EnumType={}));var FeatureSet_RepeatedFieldEncoding;(function(FeatureSet_RepeatedFieldEncoding2){FeatureSet_RepeatedFieldEncoding2[FeatureSet_RepeatedFieldEncoding2.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",FeatureSet_RepeatedFieldEncoding2[FeatureSet_RepeatedFieldEncoding2.PACKED=1]="PACKED",FeatureSet_RepeatedFieldEncoding2[FeatureSet_RepeatedFieldEncoding2.EXPANDED=2]="EXPANDED"})(FeatureSet_RepeatedFieldEncoding||(FeatureSet_RepeatedFieldEncoding={}));var FeatureSet_Utf8Validation;(function(FeatureSet_Utf8Validation2){FeatureSet_Utf8Validation2[FeatureSet_Utf8Validation2.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",FeatureSet_Utf8Validation2[FeatureSet_Utf8Validation2.VERIFY=2]="VERIFY",FeatureSet_Utf8Validation2[FeatureSet_Utf8Validation2.NONE=3]="NONE"})(FeatureSet_Utf8Validation||(FeatureSet_Utf8Validation={}));var FeatureSet_MessageEncoding;(function(FeatureSet_MessageEncoding2){FeatureSet_MessageEncoding2[FeatureSet_MessageEncoding2.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",FeatureSet_MessageEncoding2[FeatureSet_MessageEncoding2.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",FeatureSet_MessageEncoding2[FeatureSet_MessageEncoding2.DELIMITED=2]="DELIMITED"})(FeatureSet_MessageEncoding||(FeatureSet_MessageEncoding={}));var FeatureSet_JsonFormat;(function(FeatureSet_JsonFormat2){FeatureSet_JsonFormat2[FeatureSet_JsonFormat2.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",FeatureSet_JsonFormat2[FeatureSet_JsonFormat2.ALLOW=1]="ALLOW",FeatureSet_JsonFormat2[FeatureSet_JsonFormat2.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(FeatureSet_JsonFormat||(FeatureSet_JsonFormat={}));var FeatureSet_EnforceNamingStyle;(function(FeatureSet_EnforceNamingStyle2){FeatureSet_EnforceNamingStyle2[FeatureSet_EnforceNamingStyle2.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",FeatureSet_EnforceNamingStyle2[FeatureSet_EnforceNamingStyle2.STYLE2024=1]="STYLE2024",FeatureSet_EnforceNamingStyle2[FeatureSet_EnforceNamingStyle2.STYLE_LEGACY=2]="STYLE_LEGACY"})(FeatureSet_EnforceNamingStyle||(FeatureSet_EnforceNamingStyle={}));var GeneratedCodeInfo_Annotation_Semantic;(function(GeneratedCodeInfo_Annotation_Semantic2){GeneratedCodeInfo_Annotation_Semantic2[GeneratedCodeInfo_Annotation_Semantic2.NONE=0]="NONE",GeneratedCodeInfo_Annotation_Semantic2[GeneratedCodeInfo_Annotation_Semantic2.SET=1]="SET",GeneratedCodeInfo_Annotation_Semantic2[GeneratedCodeInfo_Annotation_Semantic2.ALIAS=2]="ALIAS"})(GeneratedCodeInfo_Annotation_Semantic||(GeneratedCodeInfo_Annotation_Semantic={}));var Edition;(function(Edition2){Edition2[Edition2.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",Edition2[Edition2.EDITION_LEGACY=900]="EDITION_LEGACY",Edition2[Edition2.EDITION_PROTO2=998]="EDITION_PROTO2",Edition2[Edition2.EDITION_PROTO3=999]="EDITION_PROTO3",Edition2[Edition2.EDITION_2023=1e3]="EDITION_2023",Edition2[Edition2.EDITION_2024=1001]="EDITION_2024",Edition2[Edition2.EDITION_UNSTABLE=9999]="EDITION_UNSTABLE",Edition2[Edition2.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",Edition2[Edition2.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",Edition2[Edition2.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",Edition2[Edition2.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",Edition2[Edition2.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",Edition2[Edition2.EDITION_MAX=2147483647]="EDITION_MAX"})(Edition||(Edition={}));var SymbolVisibility;(function(SymbolVisibility2){SymbolVisibility2[SymbolVisibility2.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",SymbolVisibility2[SymbolVisibility2.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",SymbolVisibility2[SymbolVisibility2.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(SymbolVisibility||(SymbolVisibility={}));var readDefaults={readUnknownFields:!0};function makeReadOptions(options){return options?Object.assign(Object.assign({},readDefaults),options):readDefaults}function fromBinary(schema,bytes2,options){let msg=reflect(schema,void 0,!1);return readMessage(msg,new BinaryReader(bytes2),makeReadOptions(options),!1,bytes2.byteLength),msg.message}function readMessage(message,reader,options,delimited,lengthOrDelimitedFieldNo){var _a;let end=delimited?reader.len:reader.pos+lengthOrDelimitedFieldNo,fieldNo,wireType,unknownFields=(_a=message.getUnknown())!==null&&_a!==void 0?_a:[];for(;reader.pos<end&&([fieldNo,wireType]=reader.tag(),!(delimited&&wireType==WireType.EndGroup));){let field=message.findNumber(fieldNo);if(!field){let data=reader.skip(wireType,fieldNo);options.readUnknownFields&&unknownFields.push({no:fieldNo,wireType,data});continue}readField(message,reader,field,wireType,options)}if(delimited&&(wireType!=WireType.EndGroup||fieldNo!==lengthOrDelimitedFieldNo))throw new Error("invalid end group tag");unknownFields.length>0&&message.setUnknown(unknownFields)}function readField(message,reader,field,wireType,options){var _a;switch(field.fieldKind){case"scalar":message.set(field,readScalar(reader,field.scalar,field.utf8Validation));break;case"enum":let val=readScalar(reader,ScalarType.INT32);if(field.enum.open)message.set(field,val);else if(field.enum.values.some(v=>v.number===val))message.set(field,val);else if(options.readUnknownFields){let bytes2=[];varint32write(val,bytes2);let unknownFields=(_a=message.getUnknown())!==null&&_a!==void 0?_a:[];unknownFields.push({no:field.number,wireType,data:new Uint8Array(bytes2)}),message.setUnknown(unknownFields)}break;case"message":message.set(field,readMessageField(reader,options,field,message.get(field)));break;case"list":readListField(reader,wireType,message.get(field),options);break;case"map":readMapEntry(reader,message.get(field),options);break}}function readMapEntry(reader,map,options){let field=map.field(),key,val,len=reader.uint32(),end=reader.pos+len;for(;reader.pos<end;){let[fieldNo]=reader.tag();switch(fieldNo){case 1:key=readScalar(reader,field.mapKey,field.utf8Validation);break;case 2:switch(field.mapKind){case"scalar":val=readScalar(reader,field.scalar,field.utf8Validation);break;case"enum":val=reader.int32();break;case"message":val=readMessageField(reader,options,field);break}break}}if(key===void 0&&(key=scalarZeroValue(field.mapKey,!1)),val===void 0)switch(field.mapKind){case"scalar":val=scalarZeroValue(field.scalar,!1);break;case"enum":val=field.enum.values[0].number;break;case"message":val=reflect(field.message,void 0,!1);break}map.set(key,val)}function readListField(reader,wireType,list,options){var _a;let field=list.field();if(field.listKind==="message"){list.add(readMessageField(reader,options,field));return}let scalarType=(_a=field.scalar)!==null&&_a!==void 0?_a:ScalarType.INT32;if(!(wireType==WireType.LengthDelimited&&scalarType!=ScalarType.STRING&&scalarType!=ScalarType.BYTES)){list.add(readScalar(reader,scalarType,field.utf8Validation));return}let e=reader.uint32()+reader.pos;for(;reader.pos<e;)list.add(readScalar(reader,scalarType,field.utf8Validation))}function readMessageField(reader,options,field,mergeMessage){let delimited=field.delimitedEncoding,message=mergeMessage??reflect(field.message,void 0,!1);return readMessage(message,reader,options,delimited,delimited?field.number:reader.uint32()),message}function readScalar(reader,type,validateUtf8=!1){switch(type){case ScalarType.STRING:return reader.string(validateUtf8);case ScalarType.BOOL:return reader.bool();case ScalarType.DOUBLE:return reader.double();case ScalarType.FLOAT:return reader.float();case ScalarType.INT32:return reader.int32();case ScalarType.INT64:return reader.int64();case ScalarType.UINT64:return reader.uint64();case ScalarType.FIXED64:return reader.fixed64();case ScalarType.BYTES:return reader.bytes();case ScalarType.FIXED32:return reader.fixed32();case ScalarType.SFIXED32:return reader.sfixed32();case ScalarType.SFIXED64:return reader.sfixed64();case ScalarType.SINT64:return reader.sint64();case ScalarType.UINT32:return reader.uint32();case ScalarType.SINT32:return reader.sint32()}}function fileDesc(b64,imports){var _a;let root=fromBinary(FileDescriptorProtoSchema,base64Decode(b64));return root.messageType.forEach(restoreJsonNames),root.dependency=(_a=imports?.map(f=>f.proto.name))!==null&&_a!==void 0?_a:[],createFileRegistry(root,protoFileName=>imports?.find(f=>f.proto.name===protoFileName)).getFile(root.name)}var file_google_protobuf_any=fileDesc("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),AnySchema=messageDesc(file_google_protobuf_any,0);var LEGACY_REQUIRED2=3,writeDefaults={writeUnknownFields:!0};function makeWriteOptions(options){return options?Object.assign(Object.assign({},writeDefaults),options):writeDefaults}function toBinary(schema,message,options){return writeFields(new BinaryWriter,makeWriteOptions(options),reflect(schema,message)).finish()}function writeFields(writer,opts,msg){var _a;for(let f of msg.sortedFields){if(!msg.isSet(f)){if(f.presence==LEGACY_REQUIRED2)throw new Error(`cannot encode ${f} to binary: required field not set`);continue}writeField(writer,opts,msg,f)}if(opts.writeUnknownFields)for(let{no,wireType,data}of(_a=msg.getUnknown())!==null&&_a!==void 0?_a:[])writer.tag(no,wireType).raw(data);return writer}function writeField(writer,opts,msg,field){var _a;switch(field.fieldKind){case"scalar":case"enum":writeScalar(writer,msg.desc.typeName,field.name,(_a=field.scalar)!==null&&_a!==void 0?_a:ScalarType.INT32,field.number,msg.get(field));break;case"list":writeListField(writer,opts,field,msg.get(field));break;case"message":writeMessageField(writer,opts,field,msg.get(field));break;case"map":for(let[key,val]of msg.get(field))writeMapEntry(writer,opts,field,key,val);break}}function writeScalar(writer,msgName,fieldName,scalarType,fieldNo,value){writeScalarValue(writer.tag(fieldNo,writeTypeOfScalar(scalarType)),msgName,fieldName,scalarType,value)}function writeMessageField(writer,opts,field,message){field.delimitedEncoding?writeFields(writer.tag(field.number,WireType.StartGroup),opts,message).tag(field.number,WireType.EndGroup):writeFields(writer.tag(field.number,WireType.LengthDelimited).fork(),opts,message).join()}function writeListField(writer,opts,field,list){var _a;if(field.listKind=="message"){for(let item of list)writeMessageField(writer,opts,field,item);return}let scalarType=(_a=field.scalar)!==null&&_a!==void 0?_a:ScalarType.INT32;if(field.packed){if(!list.size)return;writer.tag(field.number,WireType.LengthDelimited).fork();for(let item of list)writeScalarValue(writer,field.parent.typeName,field.name,scalarType,item);writer.join();return}for(let item of list)writeScalar(writer,field.parent.typeName,field.name,scalarType,field.number,item)}function writeMapEntry(writer,opts,field,key,value){var _a;switch(writer.tag(field.number,WireType.LengthDelimited).fork(),writeScalar(writer,field.parent.typeName,field.name,field.mapKey,1,key),field.mapKind){case"scalar":case"enum":writeScalar(writer,field.parent.typeName,field.name,(_a=field.scalar)!==null&&_a!==void 0?_a:ScalarType.INT32,2,value);break;case"message":writeFields(writer.tag(2,WireType.LengthDelimited).fork(),opts,value).join();break}writer.join()}function writeScalarValue(writer,msgName,fieldName,type,value){try{switch(type){case ScalarType.STRING:writer.string(value);break;case ScalarType.BOOL:writer.bool(value);break;case ScalarType.DOUBLE:writer.double(value);break;case ScalarType.FLOAT:writer.float(value);break;case ScalarType.INT32:writer.int32(value);break;case ScalarType.INT64:writer.int64(value);break;case ScalarType.UINT64:writer.uint64(value);break;case ScalarType.FIXED64:writer.fixed64(value);break;case ScalarType.BYTES:writer.bytes(value);break;case ScalarType.FIXED32:writer.fixed32(value);break;case ScalarType.SFIXED32:writer.sfixed32(value);break;case ScalarType.SFIXED64:writer.sfixed64(value);break;case ScalarType.SINT64:writer.sint64(value);break;case ScalarType.UINT32:writer.uint32(value);break;case ScalarType.SINT32:writer.sint32(value);break}}catch(e){throw e instanceof Error?new Error(`cannot encode field ${msgName}.${fieldName} to binary: ${e.message}`):e}}function writeTypeOfScalar(type){switch(type){case ScalarType.BYTES:case ScalarType.STRING:return WireType.LengthDelimited;case ScalarType.DOUBLE:case ScalarType.FIXED64:case ScalarType.SFIXED64:return WireType.Bit64;case ScalarType.FIXED32:case ScalarType.SFIXED32:case ScalarType.FLOAT:return WireType.Bit32;default:return WireType.Varint}}function anyPack(schema,message,into){let ret=!1;return into||(into=create(AnySchema),ret=!0),into.value=toBinary(schema,message),into.typeUrl=typeNameToUrl(message.$typeName),ret?into:void 0}function anyIs(any,descOrTypeName){if(any.typeUrl==="")return!1;let want=typeof descOrTypeName=="string"?descOrTypeName:descOrTypeName.typeName,got=typeUrlToName(any.typeUrl);return want===got}function anyUnpack(any,registryOrMessageDesc){if(any.typeUrl==="")return;let desc=registryOrMessageDesc.kind=="message"?registryOrMessageDesc:registryOrMessageDesc.getMessage(typeUrlToName(any.typeUrl));if(!(!desc||!anyIs(any,desc)))return fromBinary(desc,any.value)}function typeNameToUrl(name){return`type.googleapis.com/${name}`}function typeUrlToName(url4){let slash=url4.lastIndexOf("/"),name=slash>=0?url4.substring(slash+1):url4;if(!name.length)throw new Error(`invalid type url: ${url4}`);return name}var file_google_protobuf_struct=fileDesc("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),StructSchema=messageDesc(file_google_protobuf_struct,0),ValueSchema=messageDesc(file_google_protobuf_struct,1),ListValueSchema=messageDesc(file_google_protobuf_struct,2),NullValue;(function(NullValue2){NullValue2[NullValue2.NULL_VALUE=0]="NULL_VALUE"})(NullValue||(NullValue={}));function getExtension(message,extension){assertExtendee(extension,message);let ufs=filterUnknownFields(message.$unknown,extension),[container,field,get]=createExtensionContainer(extension);for(let uf of ufs)readField(container,new BinaryReader(uf.data),field,uf.wireType,{readUnknownFields:!0});return get()}function setExtension(message,extension,value){var _a;assertExtendee(extension,message);let ufs=((_a=message.$unknown)!==null&&_a!==void 0?_a:[]).filter(uf=>uf.no!==extension.number),[container,field]=createExtensionContainer(extension,value),writer=new BinaryWriter;writeField(writer,{writeUnknownFields:!0},container,field);let reader=new BinaryReader(writer.finish());for(;reader.pos<reader.len;){let[no,wireType]=reader.tag(),data=reader.skip(wireType,no);ufs.push({no,wireType,data})}message.$unknown=ufs}function filterUnknownFields(unknownFields,extension){if(unknownFields===void 0)return[];if(extension.fieldKind==="enum"||extension.fieldKind==="scalar"){for(let i=unknownFields.length-1;i>=0;--i)if(unknownFields[i].no==extension.number)return[unknownFields[i]];return[]}return unknownFields.filter(uf=>uf.no===extension.number)}function createExtensionContainer(extension,value){let localName=extension.typeName,field=Object.assign(Object.assign({},extension),{kind:"field",parent:extension.extendee,localName}),desc=Object.assign(Object.assign({},extension.extendee),{fields:[field],members:[field],oneofs:[]}),container=create(desc,value!==void 0?{[localName]:value}:void 0);return[reflect(desc,container),field,()=>{let value2=container[localName];if(value2===void 0){let desc2=extension.message;return isWrapperDesc(desc2)?scalarZeroValue(desc2.fields[0].scalar,desc2.fields[0].longAsString):create(desc2)}return value2}]}function assertExtendee(extension,message){if(extension.extendee.typeName!=message.$typeName)throw new Error(`extension ${extension.typeName} can only be applied to message ${extension.extendee.typeName}`)}var LEGACY_REQUIRED3=3,IMPLICIT4=2,jsonWriteDefaults={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function makeWriteOptions2(options){return options?Object.assign(Object.assign({},jsonWriteDefaults),options):jsonWriteDefaults}function toJson(schema,message,options){return reflectToJson(reflect(schema,message),makeWriteOptions2(options))}function toJsonString(schema,message,options){var _a;let jsonValue=toJson(schema,message,options);return JSON.stringify(jsonValue,null,(_a=options?.prettySpaces)!==null&&_a!==void 0?_a:0)}function reflectToJson(msg,opts){var _a;let wktJson=tryWktToJson(msg,opts);if(wktJson!==void 0)return wktJson;let json={};for(let f of msg.sortedFields){if(!msg.isSet(f)){if(f.presence==LEGACY_REQUIRED3)throw new Error(`cannot encode ${f} to JSON: required field not set`);if(!opts.alwaysEmitImplicit||f.presence!==IMPLICIT4)continue}let jsonValue=fieldToJson(f,msg.get(f),opts);jsonValue!==void 0&&(json[jsonName(f,opts)]=jsonValue)}if(opts.registry){let tagSeen=new Set;for(let{no}of(_a=msg.getUnknown())!==null&&_a!==void 0?_a:[])if(!tagSeen.has(no)){tagSeen.add(no);let extension=opts.registry.getExtensionFor(msg.desc,no);if(!extension)continue;let value=getExtension(msg.message,extension),[container,field]=createExtensionContainer(extension,value),jsonValue=fieldToJson(field,container.get(field),opts);jsonValue!==void 0&&(json[extension.jsonName]=jsonValue)}}return json}function fieldToJson(f,val,opts){switch(f.fieldKind){case"scalar":return scalarToJson(f,val);case"message":return reflectToJson(val,opts);case"enum":return enumToJsonInternal(f.enum,val,opts.enumAsInteger);case"list":return listToJson(val,opts);case"map":return mapToJson(val,opts)}}function mapToJson(map,opts){let f=map.field(),jsonObj={};switch(f.mapKind){case"scalar":for(let[entryKey,entryValue]of map)jsonObj[entryKey]=scalarToJson(f,entryValue);break;case"message":for(let[entryKey,entryValue]of map)jsonObj[entryKey]=reflectToJson(entryValue,opts);break;case"enum":for(let[entryKey,entryValue]of map)jsonObj[entryKey]=enumToJsonInternal(f.enum,entryValue,opts.enumAsInteger);break}return opts.alwaysEmitImplicit||map.size>0?jsonObj:void 0}function listToJson(list,opts){let f=list.field(),jsonArr=[];switch(f.listKind){case"scalar":for(let item of list)jsonArr.push(scalarToJson(f,item));break;case"enum":for(let item of list)jsonArr.push(enumToJsonInternal(f.enum,item,opts.enumAsInteger));break;case"message":for(let item of list)jsonArr.push(reflectToJson(item,opts));break}return opts.alwaysEmitImplicit||jsonArr.length>0?jsonArr:void 0}function enumToJsonInternal(desc,value,enumAsInteger){var _a;if(typeof value!="number")throw new Error(`cannot encode ${desc} to JSON: expected number, got ${formatVal(value)}`);if(desc.typeName=="google.protobuf.NullValue")return null;if(enumAsInteger)return value;let val=desc.value[value];return(_a=val?.name)!==null&&_a!==void 0?_a:value}function scalarToJson(field,value){var _a,_b,_c,_d,_e,_f;switch(field.scalar){case ScalarType.INT32:case ScalarType.SFIXED32:case ScalarType.SINT32:case ScalarType.FIXED32:case ScalarType.UINT32:if(typeof value!="number")throw new Error(`cannot encode ${field} to JSON: ${(_a=checkField(field,value))===null||_a===void 0?void 0:_a.message}`);return value;case ScalarType.FLOAT:case ScalarType.DOUBLE:if(typeof value!="number")throw new Error(`cannot encode ${field} to JSON: ${(_b=checkField(field,value))===null||_b===void 0?void 0:_b.message}`);return Number.isNaN(value)?"NaN":value===Number.POSITIVE_INFINITY?"Infinity":value===Number.NEGATIVE_INFINITY?"-Infinity":value;case ScalarType.STRING:if(typeof value!="string")throw new Error(`cannot encode ${field} to JSON: ${(_c=checkField(field,value))===null||_c===void 0?void 0:_c.message}`);return value;case ScalarType.BOOL:if(typeof value!="boolean")throw new Error(`cannot encode ${field} to JSON: ${(_d=checkField(field,value))===null||_d===void 0?void 0:_d.message}`);return value;case ScalarType.UINT64:case ScalarType.FIXED64:case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:if(typeof value=="bigint"||typeof value=="string"||typeof value=="number"&&Number.isInteger(value))return value.toString();throw new Error(`cannot encode ${field} to JSON: ${(_e=checkField(field,value))===null||_e===void 0?void 0:_e.message}`);case ScalarType.BYTES:if(value instanceof Uint8Array)return base64Encode(value);throw new Error(`cannot encode ${field} to JSON: ${(_f=checkField(field,value))===null||_f===void 0?void 0:_f.message}`)}}function jsonName(f,opts){return opts.useProtoFieldName?f.name:f.jsonName}function tryWktToJson(msg,opts){if(msg.desc.typeName.startsWith("google.protobuf."))switch(msg.desc.typeName){case"google.protobuf.Any":return anyToJson(msg.message,opts);case"google.protobuf.Timestamp":return timestampToJson(msg.message);case"google.protobuf.Duration":return durationToJson(msg.message);case"google.protobuf.FieldMask":return fieldMaskToJson(msg.message);case"google.protobuf.Struct":return structToJson(msg.message);case"google.protobuf.Value":return valueToJson(msg.message);case"google.protobuf.ListValue":return listValueToJson(msg.message);default:if(isWrapperDesc(msg.desc)){let valueField=msg.desc.fields[0];return scalarToJson(valueField,msg.get(valueField))}return}}function anyToJson(val,opts){if(val.typeUrl==="")return{};let{registry}=opts,message,desc;if(registry&&(message=anyUnpack(val,registry),message&&(desc=registry.getMessage(message.$typeName))),!desc||!message)throw new Error(`cannot encode message ${val.$typeName} to JSON: "${val.typeUrl}" is not in the type registry`);let reflected=reflect(desc,message),json=hasCustomJsonRepresentation(desc)?{value:tryWktToJson(reflected,opts)}:reflectToJson(reflected,opts);return json["@type"]=val.typeUrl,json}function durationToJson(val){let seconds=Number(val.seconds),nanos=val.nanos;if(seconds>315576e6||seconds<-315576e6)throw new Error(`cannot encode message ${val.$typeName} to JSON: value out of range`);if(seconds>0&&nanos<0||seconds<0&&nanos>0)throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos sign must match seconds sign`);let text=val.seconds.toString();if(nanos!==0){let nanosStr=Math.abs(nanos).toString();nanosStr="0".repeat(9-nanosStr.length)+nanosStr,nanosStr.substring(3)==="000000"?nanosStr=nanosStr.substring(0,3):nanosStr.substring(6)==="000"&&(nanosStr=nanosStr.substring(0,6)),text+="."+nanosStr,nanos<0&&seconds==0&&(text="-"+text)}return text+"s"}function fieldMaskToJson(val){return val.paths.map(p=>{if(protoSnakeCase(protoCamelCase(p))!==p)throw new Error(`cannot encode message ${val.$typeName} to JSON: lowerCamelCase of path name "${p}" is irreversible`);return protoCamelCase(p)}).join(",")}function structToJson(val){let json={};for(let[k,v]of Object.entries(val.fields))json[k]=valueToJson(v);return json}function valueToJson(val){switch(val.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(val.kind.value))throw new Error(`${val.$typeName} cannot be NaN or Infinity`);return val.kind.value;case"boolValue":return val.kind.value;case"stringValue":return val.kind.value;case"structValue":return structToJson(val.kind.value);case"listValue":return listValueToJson(val.kind.value);default:throw new Error(`${val.$typeName} must have a value`)}}function listValueToJson(val){return val.values.map(valueToJson)}function timestampToJson(val){let ms9=Number(val.seconds)*1e3;if(ms9<Date.parse("0001-01-01T00:00:00Z")||ms9>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${val.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(val.nanos<0)throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be negative`);if(val.nanos>999999999)throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be greater than 99999999`);let z="Z";if(val.nanos>0){let nanosStr=(val.nanos+1e9).toString().substring(1);nanosStr.substring(3)==="000000"?z="."+nanosStr.substring(0,3)+"Z":nanosStr.substring(6)==="000"?z="."+nanosStr.substring(0,6)+"Z":z="."+nanosStr+"Z"}return new Date(ms9).toISOString().replace(".000Z",z)}var jsonReadDefaults={ignoreUnknownFields:!1};function makeReadOptions2(options){return options?Object.assign(Object.assign({},jsonReadDefaults),options):jsonReadDefaults}function fromJsonString(schema,json,options){return fromJson(schema,parseJsonString(json,schema.typeName),options)}function fromJson(schema,json,options){let msg=reflect(schema);try{readMessage2(msg,json,makeReadOptions2(options))}catch(e){throw isFieldError(e)?new Error(`cannot decode ${e.field()} from JSON: ${e.message}`,{cause:e}):e}return msg.message}var messageJsonFields=new WeakMap;function getJsonField(desc,jsonKey){var _a;if(!messageJsonFields.has(desc)){let jsonNames=new Map;for(let field of desc.fields)jsonNames.set(field.name,field).set(field.jsonName,field);messageJsonFields.set(desc,jsonNames)}return(_a=messageJsonFields.get(desc))===null||_a===void 0?void 0:_a.get(jsonKey)}function readMessage2(msg,json,opts){var _a;if(tryWktFromJson(msg,json,opts))return;if(json==null||Array.isArray(json)||typeof json!="object")throw new Error(`cannot decode ${msg.desc} from JSON: ${formatVal(json)}`);let oneofSeen=new Map;for(let[jsonKey,jsonValue]of Object.entries(json)){let field=getJsonField(msg.desc,jsonKey);if(field){if(field.oneof){if(jsonValue===null&&field.fieldKind=="scalar")continue;let seen=oneofSeen.get(field.oneof);if(seen!==void 0)throw new FieldError(field.oneof,`oneof set multiple times by ${seen.name} and ${field.name}`);oneofSeen.set(field.oneof,field)}readField2(msg,field,jsonValue,opts)}else{let extension;if(jsonKey.startsWith("[")&&jsonKey.endsWith("]")&&(extension=(_a=opts.registry)===null||_a===void 0?void 0:_a.getExtension(jsonKey.substring(1,jsonKey.length-1)))&&extension.extendee.typeName===msg.desc.typeName){let[container,field2,get]=createExtensionContainer(extension);readField2(container,field2,jsonValue,opts),setExtension(msg.message,extension,get())}if(!extension&&!opts.ignoreUnknownFields)throw new Error(`cannot decode ${msg.desc} from JSON: key "${jsonKey}" is unknown`)}}}function readField2(msg,field,json,opts){switch(field.fieldKind){case"scalar":readScalarField(msg,field,json);break;case"enum":readEnumField(msg,field,json,opts);break;case"message":readMessageField2(msg,field,json,opts);break;case"list":readListField2(msg.get(field),json,opts);break;case"map":readMapField(msg.get(field),json,opts);break}}function readListOrMapItem(field,json,opts){if(field.scalar&&json!==null)return scalarFromJson(field,json);if(field.message&&!isResetSentinelNullValue(field,json)){let msgValue=reflect(field.message);return readMessage2(msgValue,json,opts),msgValue}if(field.enum&&!isResetSentinelNullValue(field,json))return readEnum(field.enum,json,opts.ignoreUnknownFields);throw new FieldError(field,`${field.fieldKind==="list"?"list item":"map value"} must not be null`)}function readMapField(map,json,opts){if(json===null)return;let field=map.field();if(typeof json!="object"||Array.isArray(json))throw new FieldError(field,"expected object, got "+formatVal(json));for(let[jsonMapKey,jsonMapValue]of Object.entries(json)){let key=mapKeyFromJson(field.mapKey,jsonMapKey),value=readListOrMapItem(field,jsonMapValue,opts);value!==tokenIgnoredUnknownEnum&&map.set(key,value)}}function readListField2(list,json,opts){if(json===null)return;let field=list.field();if(!Array.isArray(json))throw new FieldError(field,"expected Array, got "+formatVal(json));for(let jsonItem of json){let value=readListOrMapItem(field,jsonItem,opts);value!==tokenIgnoredUnknownEnum&&list.add(value)}}function readMessageField2(msg,field,json,opts){if(isResetSentinelNullValue(field,json)){msg.clear(field);return}let msgValue=msg.isSet(field)?msg.get(field):reflect(field.message);readMessage2(msgValue,json,opts),msg.set(field,msgValue)}function readEnumField(msg,field,json,opts){if(isResetSentinelNullValue(field,json)){msg.clear(field);return}let enumValue=readEnum(field.enum,json,opts.ignoreUnknownFields);enumValue!==tokenIgnoredUnknownEnum&&msg.set(field,enumValue)}function readScalarField(msg,field,json){json===null?msg.clear(field):msg.set(field,scalarFromJson(field,json))}function isResetSentinelNullValue(field,json){var _a,_b;return json===null&&((_a=field.message)===null||_a===void 0?void 0:_a.typeName)!="google.protobuf.Value"&&((_b=field.enum)===null||_b===void 0?void 0:_b.typeName)!="google.protobuf.NullValue"}var tokenIgnoredUnknownEnum=Symbol();function readEnum(desc,json,ignoreUnknownFields){if(json===null)return desc.values[0].number;switch(typeof json){case"number":if(Number.isInteger(json))return json;break;case"string":let value=desc.values.find(ev=>ev.name===json);if(value!==void 0)return value.number;if(ignoreUnknownFields)return tokenIgnoredUnknownEnum;break}throw new Error(`cannot decode ${desc} from JSON: ${formatVal(json)}`)}function scalarFromJson(field,json){switch(field.scalar){case ScalarType.DOUBLE:case ScalarType.FLOAT:if(json==="NaN")return NaN;if(json==="Infinity")return Number.POSITIVE_INFINITY;if(json==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof json=="number"){if(Number.isNaN(json))throw new FieldError(field,"unexpected NaN number");if(!Number.isFinite(json))throw new FieldError(field,"unexpected infinite number");break}if(typeof json=="string"){if(json===""||json.trim().length!==json.length)break;let float=Number(json);if(!Number.isFinite(float))break;return float}break;case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.SFIXED32:case ScalarType.SINT32:case ScalarType.UINT32:return int32FromJson(json);case ScalarType.BYTES:if(typeof json=="string"){if(json==="")return new Uint8Array(0);try{return base64Decode(json)}catch(e){let message=e instanceof Error?e.message:String(e);throw new FieldError(field,message)}}break}return json}function mapKeyFromJson(type,jsonString){switch(type){case ScalarType.BOOL:switch(jsonString){case"true":return!0;case"false":return!1}return jsonString;case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.UINT32:case ScalarType.SFIXED32:case ScalarType.SINT32:return int32FromJson(jsonString);default:return jsonString}}function int32FromJson(json){if(typeof json=="string"){if(json===""||json.trim().length!==json.length)return json;let num=Number(json);return Number.isNaN(num)?json:num}return json}function parseJsonString(jsonString,typeName){try{return JSON.parse(jsonString)}catch(e){let message=e instanceof Error?e.message:String(e);throw new Error(`cannot decode message ${typeName} from JSON: ${message}`,{cause:e})}}function tryWktFromJson(msg,jsonValue,opts){if(!msg.desc.typeName.startsWith("google.protobuf."))return!1;switch(msg.desc.typeName){case"google.protobuf.Any":return anyFromJson(msg.message,jsonValue,opts),!0;case"google.protobuf.Timestamp":return timestampFromJson(msg.message,jsonValue),!0;case"google.protobuf.Duration":return durationFromJson(msg.message,jsonValue),!0;case"google.protobuf.FieldMask":return fieldMaskFromJson(msg.message,jsonValue),!0;case"google.protobuf.Struct":return structFromJson(msg.message,jsonValue),!0;case"google.protobuf.Value":return valueFromJson(msg.message,jsonValue),!0;case"google.protobuf.ListValue":return listValueFromJson(msg.message,jsonValue),!0;default:if(isWrapperDesc(msg.desc)){let valueField=msg.desc.fields[0];return jsonValue===null?msg.clear(valueField):msg.set(valueField,scalarFromJson(valueField,jsonValue)),!0}return!1}}function anyFromJson(any,json,opts){var _a;if(json===null||Array.isArray(json)||typeof json!="object")throw new Error(`cannot decode message ${any.$typeName} from JSON: expected object but got ${formatVal(json)}`);if(Object.keys(json).length==0)return;let typeUrl=json["@type"];if(typeof typeUrl!="string"||typeUrl=="")throw new Error(`cannot decode message ${any.$typeName} from JSON: "@type" is empty`);let typeName=typeUrl.includes("/")?typeUrl.substring(typeUrl.lastIndexOf("/")+1):typeUrl;if(!typeName.length)throw new Error(`cannot decode message ${any.$typeName} from JSON: "@type" is invalid`);let desc=(_a=opts.registry)===null||_a===void 0?void 0:_a.getMessage(typeName);if(!desc)throw new Error(`cannot decode message ${any.$typeName} from JSON: ${typeUrl} is not in the type registry`);let msg=reflect(desc);if(hasCustomJsonRepresentation(desc)&&Object.prototype.hasOwnProperty.call(json,"value")){let value=json.value;readMessage2(msg,value,opts)}else{let copy=Object.assign({},json);delete copy["@type"],readMessage2(msg,copy,opts)}anyPack(msg.desc,msg.message,any)}function timestampFromJson(timestamp,json){if(typeof json!="string")throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: ${formatVal(json)}`);let matches=json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!matches)throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);let ms9=Date.parse(matches[1]+"-"+matches[2]+"-"+matches[3]+"T"+matches[4]+":"+matches[5]+":"+matches[6]+(matches[8]?matches[8]:"Z"));if(Number.isNaN(ms9))throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);if(ms9<Date.parse("0001-01-01T00:00:00Z")||ms9>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);timestamp.seconds=protoInt64.parse(ms9/1e3),timestamp.nanos=0,matches[7]&&(timestamp.nanos=parseInt("1"+matches[7]+"0".repeat(9-matches[7].length))-1e9)}function durationFromJson(duration,json){if(typeof json!="string")throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);let match=json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(match===null)throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);let longSeconds=Number(match[1]);if(longSeconds>315576e6||longSeconds<-315576e6)throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);if(duration.seconds=protoInt64.parse(longSeconds),typeof match[2]!="string")return;let nanosStr=match[2]+"0".repeat(9-match[2].length);duration.nanos=parseInt(nanosStr),(longSeconds<0||Object.is(longSeconds,-0))&&(duration.nanos=-duration.nanos)}function fieldMaskFromJson(fieldMask,json){if(typeof json!="string")throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: ${formatVal(json)}`);json!==""&&(fieldMask.paths=json.split(",").map(path6=>{if(path6.includes("_"))throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: path names must be lowerCamelCase`);return protoSnakeCase(path6)}))}function structFromJson(struct,json){if(typeof json!="object"||json==null||Array.isArray(json))throw new Error(`cannot decode message ${struct.$typeName} from JSON ${formatVal(json)}`);for(let[k,v]of Object.entries(json)){let parsedV=create(ValueSchema);valueFromJson(parsedV,v),struct.fields[k]=parsedV}}function valueFromJson(value,json){switch(typeof json){case"number":value.kind={case:"numberValue",value:json};break;case"string":value.kind={case:"stringValue",value:json};break;case"boolean":value.kind={case:"boolValue",value:json};break;case"object":if(json===null)value.kind={case:"nullValue",value:NullValue.NULL_VALUE};else if(Array.isArray(json)){let listValue=create(ListValueSchema);listValueFromJson(listValue,json),value.kind={case:"listValue",value:listValue}}else{let struct=create(StructSchema);structFromJson(struct,json),value.kind={case:"structValue",value:struct}}break;default:throw new Error(`cannot decode message ${value.$typeName} from JSON ${formatVal(json)}`)}return value}function listValueFromJson(listValue,json){if(!Array.isArray(json))throw new Error(`cannot decode message ${listValue.$typeName} from JSON ${formatVal(json)}`);for(let e of json){let value=create(ValueSchema);valueFromJson(value,e),listValue.values.push(value)}}var Code;(function(Code2){Code2[Code2.Canceled=1]="Canceled",Code2[Code2.Unknown=2]="Unknown",Code2[Code2.InvalidArgument=3]="InvalidArgument",Code2[Code2.DeadlineExceeded=4]="DeadlineExceeded",Code2[Code2.NotFound=5]="NotFound",Code2[Code2.AlreadyExists=6]="AlreadyExists",Code2[Code2.PermissionDenied=7]="PermissionDenied",Code2[Code2.ResourceExhausted=8]="ResourceExhausted",Code2[Code2.FailedPrecondition=9]="FailedPrecondition",Code2[Code2.Aborted=10]="Aborted",Code2[Code2.OutOfRange=11]="OutOfRange",Code2[Code2.Unimplemented=12]="Unimplemented",Code2[Code2.Internal=13]="Internal",Code2[Code2.Unavailable=14]="Unavailable",Code2[Code2.DataLoss=15]="DataLoss",Code2[Code2.Unauthenticated=16]="Unauthenticated"})(Code||(Code={}));function codeToString(value){let name=Code[value];return typeof name!="string"?value.toString():name[0].toLowerCase()+name.substring(1).replace(/[A-Z]/g,c=>"_"+c.toLowerCase())}var ConnectError=class _ConnectError extends Error{constructor(message,code=Code.Unknown,metadata,outgoingDetails,cause){super(createMessage(message,code)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=message,this.code=code,this.metadata=new Headers(metadata??{}),this.details=outgoingDetails??[],this.cause=cause}static from(reason,code=Code.Unknown){return reason instanceof _ConnectError?reason:reason instanceof Error?reason.name=="AbortError"?new _ConnectError(reason.message,Code.Canceled):new _ConnectError(reason.message,code,void 0,void 0,reason):new _ConnectError(String(reason),code,void 0,void 0,reason)}static[Symbol.hasInstance](v){return v instanceof Error?Object.getPrototypeOf(v)===_ConnectError.prototype?!0:v.name==="ConnectError"&&"code"in v&&typeof v.code=="number"&&"metadata"in v&&"details"in v&&Array.isArray(v.details)&&"rawMessage"in v&&typeof v.rawMessage=="string"&&"cause"in v:!1}findDetails(typeOrRegistry){let registry=typeOrRegistry.kind==="message"?{getMessage:typeName=>typeName===typeOrRegistry.typeName?typeOrRegistry:void 0}:typeOrRegistry,details=[];for(let data of this.details){if("desc"in data){registry.getMessage(data.desc.typeName)&&details.push(create(data.desc,data.value));continue}let desc=registry.getMessage(data.type);if(desc)try{details.push(fromBinary(desc,data.value))}catch{}}return details}};function createMessage(message,code){return message.length?`[${codeToString(code)}] ${message}`:`[${codeToString(code)}]`}function decodeBinaryHeader(value,desc,options){try{let bytes2=base64Decode(value);return desc?fromBinary(desc,bytes2,options):bytes2}catch(e){throw ConnectError.from(e,Code.DataLoss)}}function makeAnyClient(service,createMethod){let client={};for(let desc of service.methods){let method=createMethod(desc);method!=null&&(client[desc.localName]=method)}return client}var compressedFlag=1;async function envelopeCompress(envelope,compression,compressMinBytes){let{flags,data}=envelope;if((flags&compressedFlag)===compressedFlag)throw new ConnectError("invalid envelope, already compressed",Code.Internal);return compression&&data.byteLength>=compressMinBytes&&(data=await compression.compress(data),flags=flags|compressedFlag),{data,flags}}async function envelopeDecompress(envelope,compression,readMaxBytes){let{flags,data}=envelope;if((flags&compressedFlag)===compressedFlag){if(!compression)throw new ConnectError("received compressed envelope, but do not know how to decompress",Code.Internal);data=await compression.decompress(data,readMaxBytes),flags=flags^compressedFlag}return{data,flags}}function encodeEnvelope(flags,data){let bytes2=new Uint8Array(data.length+5);bytes2.set(data,5);let v=new DataView(bytes2.buffer,bytes2.byteOffset,bytes2.byteLength);return v.setUint8(0,flags),v.setUint32(1,data.length),bytes2}var maxReadMaxBytes=4294967295,maxWriteMaxBytes=maxReadMaxBytes,defaultCompressMinBytes=1024;function validateReadWriteMaxBytes(readMaxBytes,writeMaxBytes,compressMinBytes){if(writeMaxBytes??(writeMaxBytes=maxWriteMaxBytes),readMaxBytes??(readMaxBytes=maxReadMaxBytes),compressMinBytes??(compressMinBytes=defaultCompressMinBytes),writeMaxBytes<1||writeMaxBytes>maxWriteMaxBytes)throw new ConnectError(`writeMaxBytes ${writeMaxBytes} must be >= 1 and <= ${maxWriteMaxBytes}`,Code.Internal);if(readMaxBytes<1||readMaxBytes>maxReadMaxBytes)throw new ConnectError(`readMaxBytes ${readMaxBytes} must be >= 1 and <= ${maxReadMaxBytes}`,Code.Internal);return{readMaxBytes,writeMaxBytes,compressMinBytes}}function assertWriteMaxBytes(writeMaxBytes,bytesWritten){if(bytesWritten>writeMaxBytes)throw new ConnectError(`message size ${bytesWritten} is larger than configured writeMaxBytes ${writeMaxBytes}`,Code.ResourceExhausted)}function assertReadMaxBytes(readMaxBytes,bytesRead,totalSizeKnown=!1){if(bytesRead>readMaxBytes){let message=`message size is larger than configured readMaxBytes ${readMaxBytes}`;throw totalSizeKnown&&(message=`message size ${bytesRead} is larger than configured readMaxBytes ${readMaxBytes}`),new ConnectError(message,Code.ResourceExhausted)}}var __asyncValues=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve3,reject){v=o[n](v),settle(resolve3,reject,v.done,v.value)})}}function settle(resolve3,reject,d,v){Promise.resolve(v).then(function(v2){resolve3({value:v2,done:d})},reject)}},__await=function(v){return this instanceof __await?(this.v=v,this):new __await(v)},__asyncGenerator=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",awaitReturn),i[Symbol.asyncIterator]=function(){return this},i;function awaitReturn(f){return function(v){return Promise.resolve(v).then(f,reject)}}function verb(n,f){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})},f&&(i[n]=f(i[n])))}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}},__asyncDelegator=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:!1}:f?f(v):v}:f}};function pipeTo(source,...rest){let[transforms,sink,opt]=pickTransformsAndSink(rest),iterable=source,abortable;return opt?.propagateDownStreamError===!0&&(iterable=abortable=makeIterableAbortable(iterable)),iterable=pipe(iterable,...transforms,{propagateDownStreamError:!1}),sink(iterable).catch(reason=>abortable?abortable.abort(reason).then(()=>Promise.reject(reason)):Promise.reject(reason))}function pickTransformsAndSink(rest){let opt;typeof rest[rest.length-1]!="function"&&(opt=rest.pop());let sink=rest.pop();return[rest,sink,opt]}function pipe(source,...rest){return __asyncGenerator(this,arguments,function*(){var _a;let[transforms,opt]=pickTransforms(rest),abortable,sourceIt=source[Symbol.asyncIterator](),iterable={[Symbol.asyncIterator](){return sourceIt}};opt?.propagateDownStreamError===!0&&(iterable=abortable=makeIterableAbortable(iterable));for(let t of transforms)iterable=t(iterable);let it=iterable[Symbol.asyncIterator]();try{for(;;){let r=yield __await(it.next());if(r.done===!0)break;if(!abortable){yield yield __await(r.value);continue}try{yield yield __await(r.value)}catch(e){throw yield __await(abortable.abort(e)),e}}}finally{opt?.propagateDownStreamError===!0&&((_a=sourceIt.return)===null||_a===void 0||_a.call(sourceIt).catch(()=>{}))}})}function pickTransforms(rest){let opt;return typeof rest[rest.length-1]!="function"&&(opt=rest.pop()),[rest,opt]}function transformSerializeEnvelope(serialization,endStreamFlag,endSerialization){return endStreamFlag===void 0||endSerialization===void 0?function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_4,_b,_c;try{for(var _d=!0,iterable_4=__asyncValues(iterable),iterable_4_1;iterable_4_1=yield __await(iterable_4.next()),_a=iterable_4_1.done,!_a;_d=!0){_c=iterable_4_1.value,_d=!1;let chunk=_c,data=serialization.serialize(chunk);yield yield __await({flags:0,data})}}catch(e_4_1){e_4={error:e_4_1}}finally{try{!_d&&!_a&&(_b=iterable_4.return)&&(yield __await(_b.call(iterable_4)))}finally{if(e_4)throw e_4.error}}})}:function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_5,_b,_c;try{for(var _d=!0,iterable_5=__asyncValues(iterable),iterable_5_1;iterable_5_1=yield __await(iterable_5.next()),_a=iterable_5_1.done,!_a;_d=!0){_c=iterable_5_1.value,_d=!1;let chunk=_c,data,flags=0;chunk.end?(flags=flags|endStreamFlag,data=endSerialization.serialize(chunk.value)):data=serialization.serialize(chunk.value),yield yield __await({flags,data})}}catch(e_5_1){e_5={error:e_5_1}}finally{try{!_d&&!_a&&(_b=iterable_5.return)&&(yield __await(_b.call(iterable_5)))}finally{if(e_5)throw e_5.error}}})}}function transformParseEnvelope(serialization,endStreamFlag,endSerialization){return endSerialization&&endStreamFlag!==void 0?function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_6,_b,_c;try{for(var _d=!0,iterable_6=__asyncValues(iterable),iterable_6_1;iterable_6_1=yield __await(iterable_6.next()),_a=iterable_6_1.done,!_a;_d=!0){_c=iterable_6_1.value,_d=!1;let{flags,data}=_c;(flags&endStreamFlag)===endStreamFlag?yield yield __await({value:endSerialization.parse(data),end:!0}):yield yield __await({value:serialization.parse(data),end:!1})}}catch(e_6_1){e_6={error:e_6_1}}finally{try{!_d&&!_a&&(_b=iterable_6.return)&&(yield __await(_b.call(iterable_6)))}finally{if(e_6)throw e_6.error}}})}:function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_7,_b,_c;try{for(var _d=!0,iterable_7=__asyncValues(iterable),iterable_7_1;iterable_7_1=yield __await(iterable_7.next()),_a=iterable_7_1.done,!_a;_d=!0){_c=iterable_7_1.value,_d=!1;let{flags,data}=_c;if(endStreamFlag!==void 0&&(flags&endStreamFlag)===endStreamFlag){if(endSerialization===null)throw new ConnectError("unexpected end flag",Code.InvalidArgument);continue}yield yield __await(serialization.parse(data))}}catch(e_7_1){e_7={error:e_7_1}}finally{try{!_d&&!_a&&(_b=iterable_7.return)&&(yield __await(_b.call(iterable_7)))}finally{if(e_7)throw e_7.error}}})}}function transformCompressEnvelope(compression,compressMinBytes){return function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_8,_b,_c;try{for(var _d=!0,iterable_8=__asyncValues(iterable),iterable_8_1;iterable_8_1=yield __await(iterable_8.next()),_a=iterable_8_1.done,!_a;_d=!0)_c=iterable_8_1.value,_d=!1,yield yield __await(yield __await(envelopeCompress(_c,compression,compressMinBytes)))}catch(e_8_1){e_8={error:e_8_1}}finally{try{!_d&&!_a&&(_b=iterable_8.return)&&(yield __await(_b.call(iterable_8)))}finally{if(e_8)throw e_8.error}}})}}function transformDecompressEnvelope(compression,readMaxBytes){return function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_9,_b,_c;try{for(var _d=!0,iterable_9=__asyncValues(iterable),iterable_9_1;iterable_9_1=yield __await(iterable_9.next()),_a=iterable_9_1.done,!_a;_d=!0)_c=iterable_9_1.value,_d=!1,yield yield __await(yield __await(envelopeDecompress(_c,compression,readMaxBytes)))}catch(e_9_1){e_9={error:e_9_1}}finally{try{!_d&&!_a&&(_b=iterable_9.return)&&(yield __await(_b.call(iterable_9)))}finally{if(e_9)throw e_9.error}}})}}function transformJoinEnvelopes(){return function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_10,_b,_c;try{for(var _d=!0,iterable_10=__asyncValues(iterable),iterable_10_1;iterable_10_1=yield __await(iterable_10.next()),_a=iterable_10_1.done,!_a;_d=!0){_c=iterable_10_1.value,_d=!1;let{flags,data}=_c;yield yield __await(encodeEnvelope(flags,data))}}catch(e_10_1){e_10={error:e_10_1}}finally{try{!_d&&!_a&&(_b=iterable_10.return)&&(yield __await(_b.call(iterable_10)))}finally{if(e_10)throw e_10.error}}})}}function transformSplitEnvelope(readMaxBytes){function append(buffer,chunk){let n=new Uint8Array(buffer.byteLength+chunk.byteLength);return n.set(buffer),n.set(chunk,buffer.length),n}function shiftEnvelope(buffer,header){return buffer.byteLength<5+header.length?[void 0,buffer]:[{flags:header.flags,data:buffer.subarray(5,5+header.length)},buffer.subarray(5+header.length)]}function peekHeader(buffer){if(buffer.byteLength<5)return;let view=new DataView(buffer.buffer,buffer.byteOffset,buffer.byteLength),length=view.getUint32(1),flags=view.getUint8(0);return{length,flags}}return function(iterable){return __asyncGenerator(this,arguments,function*(){var _a,e_11,_b,_c;let buffer=new Uint8Array(0);try{for(var _d=!0,iterable_11=__asyncValues(iterable),iterable_11_1;iterable_11_1=yield __await(iterable_11.next()),_a=iterable_11_1.done,!_a;_d=!0)for(_c=iterable_11_1.value,_d=!1,buffer=append(buffer,_c);;){let header=peekHeader(buffer);if(!header)break;assertReadMaxBytes(readMaxBytes,header.length,!0);let env;if([env,buffer]=shiftEnvelope(buffer,header),!env)break;yield yield __await(env)}}catch(e_11_1){e_11={error:e_11_1}}finally{try{!_d&&!_a&&(_b=iterable_11.return)&&(yield __await(_b.call(iterable_11)))}finally{if(e_11)throw e_11.error}}if(buffer.byteLength>0){let header=peekHeader(buffer),message="protocol error: incomplete envelope";throw header&&(message=`protocol error: promised ${header.length} bytes in enveloped message, got ${buffer.byteLength-5} bytes`),new ConnectError(message,Code.InvalidArgument)}})}}function makeIterableAbortable(iterable){let innerCandidate=iterable[Symbol.asyncIterator]();if(innerCandidate.throw===void 0)throw new Error("AsyncIterable does not implement throw");let inner=innerCandidate,aborted,resultPromise,it={next(){return resultPromise=inner.next().finally(()=>{resultPromise=void 0}),resultPromise},throw(e){return inner.throw(e)}};innerCandidate.return!==void 0&&(it=Object.assign(Object.assign({},it),{return(value){return inner.return(value)}}));let used=!1;return{abort(reason){if(aborted)return aborted.state;let f=()=>inner.throw(reason).then(r=>r.done===!0?"completed":"caught",()=>"rethrown");return resultPromise?(aborted={reason,state:resultPromise.then(f,f)},aborted.state):(aborted={reason,state:f()},aborted.state)},[Symbol.asyncIterator](){if(used)throw new Error("AsyncIterable cannot be re-used");return used=!0,it}}}function createAsyncIterable(items){return __asyncGenerator(this,arguments,function*(){yield __await(yield*__asyncDelegator(__asyncValues(items)))})}var __asyncValues2=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve3,reject){v=o[n](v),settle(resolve3,reject,v.done,v.value)})}}function settle(resolve3,reject,d,v){Promise.resolve(v).then(function(v2){resolve3({value:v2,done:d})},reject)}},__await2=function(v){return this instanceof __await2?(this.v=v,this):new __await2(v)},__asyncDelegator2=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await2(o[n](v)),done:!1}:f?f(v):v}:f}},__asyncGenerator2=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",awaitReturn),i[Symbol.asyncIterator]=function(){return this},i;function awaitReturn(f){return function(v){return Promise.resolve(v).then(f,reject)}}function verb(n,f){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})},f&&(i[n]=f(i[n])))}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await2?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}};function createClient(service,transport){return makeAnyClient(service,method=>{switch(method.methodKind){case"unary":return createUnaryFn(transport,method);case"server_streaming":return createServerStreamingFn(transport,method);case"client_streaming":return createClientStreamingFn(transport,method);case"bidi_streaming":return createBiDiStreamingFn(transport,method);default:return null}})}function createUnaryFn(transport,method){return async function(input,options){var _a,_b;let response=await transport.unary(method,options?.signal,options?.timeoutMs,options?.headers,input,options?.contextValues);return(_a=options?.onHeader)===null||_a===void 0||_a.call(options,response.header),(_b=options?.onTrailer)===null||_b===void 0||_b.call(options,response.trailer),response.message}}function createServerStreamingFn(transport,method){return function(input,options){return handleStreamResponse(transport.stream(method,options?.signal,options?.timeoutMs,options?.headers,createAsyncIterable([input]),options?.contextValues),options)}}function createClientStreamingFn(transport,method){return async function(request3,options){var _a,e_1,_b,_c,_d,_e;let response=await transport.stream(method,options?.signal,options?.timeoutMs,options?.headers,request3,options?.contextValues);(_d=options?.onHeader)===null||_d===void 0||_d.call(options,response.header);let singleMessage,count=0;try{for(var _f=!0,_g=__asyncValues2(response.message),_h;_h=await _g.next(),_a=_h.done,!_a;_f=!0)_c=_h.value,_f=!1,singleMessage=_c,count++}catch(e_1_1){e_1={error:e_1_1}}finally{try{!_f&&!_a&&(_b=_g.return)&&await _b.call(_g)}finally{if(e_1)throw e_1.error}}if(!singleMessage)throw new ConnectError("protocol error: missing response message",Code.Unimplemented);if(count>1)throw new ConnectError("protocol error: received extra messages for client streaming method",Code.Unimplemented);return(_e=options?.onTrailer)===null||_e===void 0||_e.call(options,response.trailer),singleMessage}}function createBiDiStreamingFn(transport,method){return function(request3,options){return handleStreamResponse(transport.stream(method,options?.signal,options?.timeoutMs,options?.headers,request3,options?.contextValues),options)}}function handleStreamResponse(stream,options){let it=function(){return __asyncGenerator2(this,arguments,function*(){var _a,_b;let response=yield __await2(stream);(_a=options?.onHeader)===null||_a===void 0||_a.call(options,response.header),yield __await2(yield*__asyncDelegator2(__asyncValues2(response.message))),(_b=options?.onTrailer)===null||_b===void 0||_b.call(options,response.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>it.next()})}}function createLinkedAbortController(...signals){let controller=new AbortController,sa=signals.filter(s=>s!==void 0).concat(controller.signal);for(let signal of sa){if(signal.aborted){onAbort.apply(signal);break}signal.addEventListener("abort",onAbort)}function onAbort(){controller.signal.aborted||controller.abort(getAbortSignalReason(this));for(let signal of sa)signal.removeEventListener("abort",onAbort)}return controller}function createDeadlineSignal(timeoutMs){let controller=new AbortController,listener=()=>{controller.abort(new ConnectError("the operation timed out",Code.DeadlineExceeded))},timeoutId;return timeoutMs!==void 0&&(timeoutMs<=0?listener():timeoutId=setTimeout(listener,timeoutMs)),{signal:controller.signal,cleanup:()=>clearTimeout(timeoutId)}}function getAbortSignalReason(signal){if(!signal.aborted)return;if(signal.reason!==void 0)return signal.reason;let e=new Error("This operation was aborted");return e.name="AbortError",e}function createContextValues(){return{get(key){return key.id in this?this[key.id]:key.defaultValue},set(key,value){return this[key.id]=value,this},delete(key){return delete this[key.id],this}}}var headerContentType="Content-Type",headerEncoding="Grpc-Encoding",headerAcceptEncoding="Grpc-Accept-Encoding",headerTimeout="Grpc-Timeout",headerGrpcStatus="Grpc-Status",headerGrpcMessage="Grpc-Message",headerStatusDetailsBin="Grpc-Status-Details-Bin";var headerUserAgent="User-Agent";function messageDesc2(file,path6,...paths){return paths.reduce((acc,cur)=>acc.nestedMessages[cur],file.messages[path6])}var file_status=fileDesc("CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z",[file_google_protobuf_any]),StatusSchema=messageDesc2(file_status,0);var grpcStatusOk="0";function findTrailerError(headerOrTrailer){var _a;let statusBytes=headerOrTrailer.get(headerStatusDetailsBin);if(statusBytes!=null){let status=decodeBinaryHeader(statusBytes,StatusSchema);if(status.code==0)return;let error3=new ConnectError(status.message,status.code,headerOrTrailer);return error3.details=status.details.map(any=>({type:any.typeUrl.substring(any.typeUrl.lastIndexOf("/")+1),value:any.value})),error3}let grpcStatus=headerOrTrailer.get(headerGrpcStatus);if(grpcStatus!=null){if(grpcStatus===grpcStatusOk)return;let code=parseInt(grpcStatus,10);return code in Code?new ConnectError(decodeURIComponent((_a=headerOrTrailer.get(headerGrpcMessage))!==null&&_a!==void 0?_a:""),code,headerOrTrailer):new ConnectError(`invalid grpc-status: ${grpcStatus}`,Code.Internal,headerOrTrailer)}}function createMethodUrl(baseUrl,method){return baseUrl.toString().replace(/\/?$/,`/${method.parent.typeName}/${method.name}`)}function normalize2(desc,message){return create(desc,message)}function normalizeIterable(desc,input){function transform(result){return result.done===!0?result:{done:result.done,value:normalize2(desc,result.value)}}return{[Symbol.asyncIterator](){let it=input[Symbol.asyncIterator](),res={next:()=>it.next().then(transform)};return it.throw!==void 0&&(res.throw=e=>it.throw(e).then(transform)),it.return!==void 0&&(res.return=v=>it.return(v).then(transform)),res}}}function applyInterceptors(next,interceptors){var _a;return(_a=interceptors?.concat().reverse().reduce((n,i)=>i(n),next))!==null&&_a!==void 0?_a:next}function getJsonOptions(options){var _a;let o=Object.assign({},options);return(_a=o.ignoreUnknownFields)!==null&&_a!==void 0||(o.ignoreUnknownFields=!0),o}function createMethodSerializationLookup(method,binaryOptions,jsonOptions,limitOptions){let inputBinary=limitSerialization(createBinarySerialization(method.input,binaryOptions),limitOptions),inputJson=limitSerialization(createJsonSerialization(method.input,jsonOptions),limitOptions),outputBinary=limitSerialization(createBinarySerialization(method.output,binaryOptions),limitOptions),outputJson=limitSerialization(createJsonSerialization(method.output,jsonOptions),limitOptions);return{getI(useBinaryFormat){return useBinaryFormat?inputBinary:inputJson},getO(useBinaryFormat){return useBinaryFormat?outputBinary:outputJson}}}function limitSerialization(serialization,limitOptions){return{serialize(data){let bytes2=serialization.serialize(data);return assertWriteMaxBytes(limitOptions.writeMaxBytes,bytes2.byteLength),bytes2},parse(data){return assertReadMaxBytes(limitOptions.readMaxBytes,data.byteLength,!0),serialization.parse(data)}}}function createBinarySerialization(desc,options){return{parse(data){try{return fromBinary(desc,data,options)}catch(e){let m=e instanceof Error?e.message:String(e);throw new ConnectError(`parse binary: ${m}`,Code.Internal)}},serialize(data){try{return toBinary(desc,data,options)}catch(e){let m=e instanceof Error?e.message:String(e);throw new ConnectError(`serialize binary: ${m}`,Code.Internal)}}}}function createJsonSerialization(desc,options){var _a,_b;let textEncoder=(_a=options?.textEncoder)!==null&&_a!==void 0?_a:new TextEncoder,textDecoder=(_b=options?.textDecoder)!==null&&_b!==void 0?_b:new TextDecoder,o=getJsonOptions(options);return{parse(data){try{let json=textDecoder.decode(data);return fromJsonString(desc,json,o)}catch(e){throw ConnectError.from(e,Code.InvalidArgument)}},serialize(data){try{let json=toJsonString(desc,data,o);return textEncoder.encode(json)}catch(e){throw ConnectError.from(e,Code.Internal)}}}}var contentTypeRegExp=/^application\/grpc(?:\+(?:(json)(?:; ?charset=utf-?8)?|proto))?$/i,contentTypeProto="application/grpc+proto",contentTypeJson="application/grpc+json";function parseContentType(contentType2){let match=contentType2?.match(contentTypeRegExp);return match?{binary:!match[1]}:void 0}function runUnaryCall(opt){let next=applyInterceptors(opt.next,opt.interceptors),[signal,abort,done]=setupSignal(opt),req=Object.assign(Object.assign({},opt.req),{message:normalize2(opt.req.method.input,opt.req.message),signal});return next(req).then(res=>(done(),res),abort)}function runStreamingCall(opt){let next=applyInterceptors(opt.next,opt.interceptors),[signal,abort,done]=setupSignal(opt),req=Object.assign(Object.assign({},opt.req),{message:normalizeIterable(opt.req.method.input,opt.req.message),signal}),doneCalled=!1;return signal.addEventListener("abort",function(){var _a,_b;let it=opt.req.message[Symbol.asyncIterator]();doneCalled||(_a=it.throw)===null||_a===void 0||_a.call(it,this.reason).catch(()=>{}),(_b=it.return)===null||_b===void 0||_b.call(it).catch(()=>{})}),next(req).then(res=>Object.assign(Object.assign({},res),{message:{[Symbol.asyncIterator](){let it=res.message[Symbol.asyncIterator]();return{next(){return it.next().then(r=>(r.done==!0&&(doneCalled=!0,done()),r),abort)}}}}}),abort)}function setupSignal(opt){let{signal,cleanup}=createDeadlineSignal(opt.timeoutMs),controller=createLinkedAbortController(opt.signal,signal);return[controller.signal,function(reason){let e=ConnectError.from(signal.aborted?getAbortSignalReason(signal):reason);return controller.abort(e),cleanup(),Promise.reject(e)},function(){cleanup(),controller.abort()}]}function validateTrailer(trailer,header){let err=findTrailerError(trailer);if(err)throw header.forEach((value,key)=>{err.metadata.append(key,value)}),err;if(!header.has(headerGrpcStatus)&&!trailer.has(headerGrpcStatus))throw new ConnectError("protocol error: missing status",Code.Internal)}function codeFromHttpStatus(httpStatus){switch(httpStatus){case 400:return Code.Internal;case 401:return Code.Unauthenticated;case 403:return Code.PermissionDenied;case 404:return Code.Unimplemented;case 429:return Code.Unavailable;case 502:return Code.Unavailable;case 503:return Code.Unavailable;case 504:return Code.Unavailable;default:return Code.Unknown}}function requestHeader(useBinaryFormat,timeoutMs,userProvidedHeaders){let result=new Headers(userProvidedHeaders??{});return result.set(headerContentType,useBinaryFormat?contentTypeProto:contentTypeJson),result.has(headerUserAgent)||result.set(headerUserAgent,"connect-es/2.0.2"),timeoutMs!==void 0&&result.set(headerTimeout,`${timeoutMs}m`),result.set("Te","trailers"),result}function requestHeaderWithCompression(useBinaryFormat,timeoutMs,userProvidedHeaders,acceptCompression,sendCompression){let result=requestHeader(useBinaryFormat,timeoutMs,userProvidedHeaders);return sendCompression!=null&&result.set(headerEncoding,sendCompression.name),acceptCompression.length>0&&result.set(headerAcceptEncoding,acceptCompression.map(c=>c.name).join(",")),result}function validateResponse(status,headers){if(status!=200)throw new ConnectError(`HTTP ${status}`,codeFromHttpStatus(status),headers);let mimeType=headers.get(headerContentType);if(parseContentType(mimeType)==null)throw new ConnectError(`unsupported content type ${mimeType}`,Code.Unknown);return{foundStatus:headers.has(headerGrpcStatus),headerError:findTrailerError(headers)}}function validateResponseWithCompression(acceptCompression,status,headers){let{foundStatus,headerError}=validateResponse(status,headers),compression,encoding=headers.get(headerEncoding);if(encoding!==null&&encoding.toLowerCase()!=="identity"&&(compression=acceptCompression.find(c=>c.name===encoding),!compression))throw new ConnectError(`unsupported response encoding "${encoding}"`,Code.Internal,headers);return{foundStatus,compression,headerError}}var __asyncValues3=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve3,reject){v=o[n](v),settle(resolve3,reject,v.done,v.value)})}}function settle(resolve3,reject,d,v){Promise.resolve(v).then(function(v2){resolve3({value:v2,done:d})},reject)}},__await3=function(v){return this instanceof __await3?(this.v=v,this):new __await3(v)},__asyncDelegator3=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await3(o[n](v)),done:!1}:f?f(v):v}:f}},__asyncGenerator3=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",awaitReturn),i[Symbol.asyncIterator]=function(){return this},i;function awaitReturn(f){return function(v){return Promise.resolve(v).then(f,reject)}}function verb(n,f){g[n]&&(i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})},f&&(i[n]=f(i[n])))}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await3?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){f(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}};function createTransport(opt){return{async unary(method,signal,timeoutMs,header,message,contextValues){let serialization=createMethodSerializationLookup(method,opt.binaryOptions,opt.jsonOptions,opt);return timeoutMs=timeoutMs===void 0?opt.defaultTimeoutMs:timeoutMs<=0?void 0:timeoutMs,await runUnaryCall({interceptors:opt.interceptors,signal,timeoutMs,req:{stream:!1,service:method.parent,method,requestMethod:"POST",url:createMethodUrl(opt.baseUrl,method),header:requestHeaderWithCompression(opt.useBinaryFormat,timeoutMs,header,opt.acceptCompression,opt.sendCompression),contextValues:contextValues??createContextValues(),message},next:async req=>{let uRes=await opt.httpClient({url:req.url,method:"POST",header:req.header,signal:req.signal,body:pipe(createAsyncIterable([req.message]),transformSerializeEnvelope(serialization.getI(opt.useBinaryFormat)),transformCompressEnvelope(opt.sendCompression,opt.compressMinBytes),transformJoinEnvelopes(),{propagateDownStreamError:!0})}),{compression,headerError}=validateResponseWithCompression(opt.acceptCompression,uRes.status,uRes.header),message2=await pipeTo(uRes.body,transformSplitEnvelope(opt.readMaxBytes),transformDecompressEnvelope(compression??null,opt.readMaxBytes),transformParseEnvelope(serialization.getO(opt.useBinaryFormat)),async iterable=>{var _a,e_1,_b,_c;let message3;try{for(var _d=!0,iterable_1=__asyncValues3(iterable),iterable_1_1;iterable_1_1=await iterable_1.next(),_a=iterable_1_1.done,!_a;_d=!0){_c=iterable_1_1.value,_d=!1;let chunk=_c;if(message3!==void 0)throw new ConnectError("protocol error: received extra output message for unary method",Code.Unimplemented);message3=chunk}}catch(e_1_1){e_1={error:e_1_1}}finally{try{!_d&&!_a&&(_b=iterable_1.return)&&await _b.call(iterable_1)}finally{if(e_1)throw e_1.error}}return message3},{propagateDownStreamError:!1});if(validateTrailer(uRes.trailer,uRes.header),message2===void 0)throw headerError||new ConnectError("protocol error: missing output message for unary method",uRes.trailer.has(headerGrpcStatus)?Code.Unimplemented:Code.Unknown);if(headerError)throw new ConnectError("protocol error: received output message for unary method with error status",Code.Unknown);return{stream:!1,service:method.parent,method,header:uRes.header,message:message2,trailer:uRes.trailer}}})},async stream(method,signal,timeoutMs,header,input,contextValues){let serialization=createMethodSerializationLookup(method,opt.binaryOptions,opt.jsonOptions,opt);return timeoutMs=timeoutMs===void 0?opt.defaultTimeoutMs:timeoutMs<=0?void 0:timeoutMs,runStreamingCall({interceptors:opt.interceptors,signal,timeoutMs,req:{stream:!0,service:method.parent,method,requestMethod:"POST",url:createMethodUrl(opt.baseUrl,method),header:requestHeaderWithCompression(opt.useBinaryFormat,timeoutMs,header,opt.acceptCompression,opt.sendCompression),contextValues:contextValues??createContextValues(),message:input},next:async req=>{let uRes=await opt.httpClient({url:req.url,method:"POST",header:req.header,signal:req.signal,body:pipe(req.message,transformSerializeEnvelope(serialization.getI(opt.useBinaryFormat)),transformCompressEnvelope(opt.sendCompression,opt.compressMinBytes),transformJoinEnvelopes(),{propagateDownStreamError:!0})}),{compression,foundStatus,headerError}=validateResponseWithCompression(opt.acceptCompression,uRes.status,uRes.header);if(headerError)throw headerError;return Object.assign(Object.assign({},req),{header:uRes.header,trailer:uRes.trailer,message:pipe(uRes.body,transformSplitEnvelope(opt.readMaxBytes),transformDecompressEnvelope(compression??null,opt.readMaxBytes),transformParseEnvelope(serialization.getO(opt.useBinaryFormat)),function(iterable){return __asyncGenerator3(this,arguments,function*(){yield __await3(yield*__asyncDelegator3(__asyncValues3(iterable))),foundStatus||validateTrailer(uRes.trailer,uRes.header)})},{propagateDownStreamError:!0})})}})}}}import*as zlib from"zlib";import{promisify}from"util";function connectErrorFromNodeReason(reason){let code=Code.Internal,chain=unwrapNodeErrorChain(reason).map(getNodeErrorProps);chain.some(p=>p.code=="ERR_STREAM_WRITE_AFTER_END")?code=Code.Aborted:chain.some(p=>p.code=="ERR_STREAM_DESTROYED"||p.code=="ERR_HTTP2_INVALID_STREAM"||p.code=="ECONNRESET")?code=Code.Aborted:chain.some(p=>p.code=="ETIMEDOUT"||p.code=="ENOTFOUND"||p.code=="EAI_AGAIN"||p.code=="ECONNREFUSED")&&(code=Code.Unavailable);let ce=ConnectError.from(reason,code);return ce!==reason&&(ce.cause=reason),ce}function unwrapNodeErrorChain(reason){let chain=[];for(;!(!(reason instanceof Error)||chain.includes(reason)||(chain.push(reason),!("cause"in reason)));)reason=reason.cause;return chain}function getNodeErrorProps(reason){let props={};return reason instanceof Error&&("code"in reason&&typeof reason.code=="string"&&(props.code=reason.code),"syscall"in reason&&typeof reason.syscall=="string"&&(props.syscall=reason.syscall)),props}function connectErrorFromH2ResetCode(rstCode){switch(rstCode){case H2Code.PROTOCOL_ERROR:case H2Code.INTERNAL_ERROR:case H2Code.FLOW_CONTROL_ERROR:case H2Code.SETTINGS_TIMEOUT:case H2Code.FRAME_SIZE_ERROR:case H2Code.COMPRESSION_ERROR:case H2Code.CONNECT_ERROR:return new ConnectError(`http/2 stream closed with error code ${H2Code[rstCode]} (0x${rstCode.toString(16)})`,Code.Internal);case H2Code.REFUSED_STREAM:return new ConnectError(`http/2 stream closed with error code ${H2Code[rstCode]} (0x${rstCode.toString(16)})`,Code.Unavailable);case H2Code.CANCEL:return new ConnectError(`http/2 stream closed with error code ${H2Code[rstCode]} (0x${rstCode.toString(16)})`,Code.Canceled);case H2Code.ENHANCE_YOUR_CALM:return new ConnectError(`http/2 stream closed with error code ${H2Code[rstCode]} (0x${rstCode.toString(16)})`,Code.ResourceExhausted);case H2Code.INADEQUATE_SECURITY:return new ConnectError(`http/2 stream closed with error code ${H2Code[rstCode]} (0x${rstCode.toString(16)})`,Code.PermissionDenied);case H2Code.HTTP_1_1_REQUIRED:return new ConnectError(`http/2 stream closed with error code ${H2Code[rstCode]} (0x${rstCode.toString(16)})`,Code.PermissionDenied);case H2Code.STREAM_CLOSED:default:break}}var H2Code;(function(H2Code2){H2Code2[H2Code2.PROTOCOL_ERROR=1]="PROTOCOL_ERROR",H2Code2[H2Code2.INTERNAL_ERROR=2]="INTERNAL_ERROR",H2Code2[H2Code2.FLOW_CONTROL_ERROR=3]="FLOW_CONTROL_ERROR",H2Code2[H2Code2.SETTINGS_TIMEOUT=4]="SETTINGS_TIMEOUT",H2Code2[H2Code2.STREAM_CLOSED=5]="STREAM_CLOSED",H2Code2[H2Code2.FRAME_SIZE_ERROR=6]="FRAME_SIZE_ERROR",H2Code2[H2Code2.REFUSED_STREAM=7]="REFUSED_STREAM",H2Code2[H2Code2.CANCEL=8]="CANCEL",H2Code2[H2Code2.COMPRESSION_ERROR=9]="COMPRESSION_ERROR",H2Code2[H2Code2.CONNECT_ERROR=10]="CONNECT_ERROR",H2Code2[H2Code2.ENHANCE_YOUR_CALM=11]="ENHANCE_YOUR_CALM",H2Code2[H2Code2.INADEQUATE_SECURITY=12]="INADEQUATE_SECURITY",H2Code2[H2Code2.HTTP_1_1_REQUIRED=13]="HTTP_1_1_REQUIRED"})(H2Code||(H2Code={}));var gzip2=promisify(zlib.gzip),gunzip2=promisify(zlib.gunzip),brotliCompress2=promisify(zlib.brotliCompress),brotliDecompress2=promisify(zlib.brotliDecompress),compressionGzip={name:"gzip",compress(bytes2){return gzip2(bytes2,{})},decompress(bytes2,readMaxBytes){return bytes2.length==0?Promise.resolve(new Uint8Array(0)):wrapZLibErrors(gunzip2(bytes2,{maxOutputLength:readMaxBytes}),readMaxBytes)}},compressionBrotli={name:"br",compress(bytes2){return brotliCompress2(bytes2,{})},decompress(bytes2,readMaxBytes){return bytes2.length==0?Promise.resolve(new Uint8Array(0)):wrapZLibErrors(brotliDecompress2(bytes2,{maxOutputLength:readMaxBytes}),readMaxBytes)}};function wrapZLibErrors(promise,readMaxBytes){return promise.catch(e=>{let props=getNodeErrorProps(e),code=Code.Internal,message="decompression failed";switch(props.code){case"ERR_BUFFER_TOO_LARGE":code=Code.ResourceExhausted,message=`message is larger than configured readMaxBytes ${readMaxBytes} after decompression`;break;case"Z_DATA_ERROR":case"ERR_PADDING_2":code=Code.InvalidArgument;break;default:props.code!==void 0&&props.code.startsWith("ERR__ERROR_FORMAT_")&&(code=Code.InvalidArgument);break}return Promise.reject(new ConnectError(message,code,void 0,void 0,e))})}import*as http3 from"http";import*as https from"https";function nodeHeaderToWebHeader(nodeHeaders){let header=new Headers;for(let[k,v]of Object.entries(nodeHeaders))if(!k.startsWith(":")&&v!==void 0)if(typeof v=="string")header.append(k,v);else if(typeof v=="number")header.append(k,String(v));else for(let e of v)header.append(k,e);return header}function webHeaderToNodeHeaders(headersInit,defaultNodeHeaders){if(headersInit===void 0&&defaultNodeHeaders===void 0)return;let o=Object.create(null);if(defaultNodeHeaders!==void 0)for(let[key,value]of Object.entries(defaultNodeHeaders))Array.isArray(value)?o[key]=value.concat():value!==void 0&&(o[key]=value);if(headersInit!==void 0)if(Array.isArray(headersInit))for(let[key,value]of headersInit)appendWebHeader(o,key,value);else if("forEach"in headersInit)typeof headersInit.forEach=="function"&&headersInit.forEach((value,key)=>{appendWebHeader(o,key,value)});else for(let[key,value]of Object.entries(headersInit))appendWebHeader(o,key,value);return o}function appendWebHeader(o,key,value){key=key.toLowerCase();let existing=o[key];Array.isArray(existing)?existing.push(value):existing===void 0?o[key]=value:o[key]=[existing.toString(),value]}import*as http2 from"http2";var Http2SessionManager=class{state(){return this.s.t=="ready"?this.verifying!==void 0?"verifying":this.s.streamCount()>0?"open":"idle":this.s.t}error(){if(this.s.t=="error")return this.s.reason}constructor(url4,pingOptions,http2SessionOptions){var _a,_b,_c,_d;this.s=closed(),this.shuttingDown=[],this.authority=new URL(url4).origin,this.http2SessionOptions=http2SessionOptions,this.options={pingIntervalMs:(_a=pingOptions?.pingIntervalMs)!==null&&_a!==void 0?_a:Number.POSITIVE_INFINITY,pingTimeoutMs:(_b=pingOptions?.pingTimeoutMs)!==null&&_b!==void 0?_b:1e3*15,pingIdleConnection:(_c=pingOptions?.pingIdleConnection)!==null&&_c!==void 0?_c:!1,idleConnectionTimeoutMs:(_d=pingOptions?.idleConnectionTimeoutMs)!==null&&_d!==void 0?_d:1e3*60*15}}async connect(){try{return(await this.gotoReady()).streamCount()>0?"open":"idle"}catch{return"error"}}async request(method,path6,headers,options){for(;;){let ready2=await this.gotoReady();try{let stream=ready2.conn.request(Object.assign(Object.assign({},headers),{":method":method,":path":path6}),options);return ready2.registerRequest(stream),stream}catch(e){if(ready2.conn.closed||ready2.conn.destroyed)continue;throw e}}}notifyResponseByteRead(stream){this.s.t=="ready"&&this.s.responseByteRead(stream);for(let s of this.shuttingDown)s.responseByteRead(stream)}abort(reason){var _a,_b,_c;let err=reason??new ConnectError("connection aborted",Code.Canceled);(_b=(_a=this.s).abort)===null||_b===void 0||_b.call(_a,err);for(let s of this.shuttingDown)(_c=s.abort)===null||_c===void 0||_c.call(s,err);this.setState(closedOrError(err))}async gotoReady(){for(this.s.t=="ready"?this.s.isShuttingDown()||this.s.conn.closed||this.s.conn.destroyed?this.setState(connect2(this.authority,this.http2SessionOptions)):this.s.requiresVerify()&&await this.verify(this.s):(this.s.t=="closed"||this.s.t=="error")&&this.setState(connect2(this.authority,this.http2SessionOptions));this.s.t!=="ready";){if(this.s.t==="error")throw this.s.reason;this.s.t==="connecting"&&await this.s.conn}return this.s}setState(state){var _a,_b;if((_b=(_a=this.s).onExitState)===null||_b===void 0||_b.call(_a),this.s.t=="ready"&&this.s.isShuttingDown()){let sd=this.s;this.shuttingDown.push(sd),sd.onClose=sd.onError=()=>{let i=this.shuttingDown.indexOf(sd);i!==-1&&this.shuttingDown.splice(i,1)}}switch(state.t){case"connecting":state.conn.then(value=>{this.setState(ready(value,this.options))},reason=>{this.setState(closedOrError(reason))});break;case"ready":state.onClose=()=>this.setState(closed()),state.onError=err=>this.setState(closedOrError(err));break;case"closed":break;case"error":break}this.s=state}verify(stateReady){return this.verifying!==void 0?this.verifying:(this.verifying=stateReady.verify().then(success=>{success||this.setState(connect2(this.authority,this.http2SessionOptions))},reason=>{this.setState(closedOrError(reason))}).finally(()=>{this.verifying=void 0}),this.verifying)}};function closed(){return{t:"closed"}}function error2(reason){return{t:"error",reason}}function closedOrError(reason){return reason instanceof ConnectError&&ConnectError.from(reason).code==Code.Canceled?closed():error2(reason)}function connect2(authority,http2SessionOptions){let resolve3,reject,conn=new Promise((res,rej)=>{resolve3=res,reject=rej}),newConn=http2.connect(authority,http2SessionOptions);newConn.on("connect",onConnect),newConn.on("error",onError);function onConnect(){resolve3?.(newConn),cleanup()}function onError(err){reject?.(connectErrorFromNodeReason(err)),cleanup()}function cleanup(){newConn.off("connect",onConnect),newConn.off("error",onError)}return{t:"connecting",conn,abort(reason){newConn.destroyed||newConn.destroy(void 0,http2.constants.NGHTTP2_CANCEL),reject?.(reason)},onExitState(){cleanup()}}}function ready(conn,options){assertSessionOpen(conn),conn.unref();let lastAliveAt=Date.now(),streamCount=0,pingIntervalId,pingTimeoutId,receivedGoAway=!1,receivedGoAwayEnhanceYourCalmTooManyPings=!1,idleTimeoutId;resetIdleTimeout();let state={t:"ready",conn,streamCount(){return streamCount},requiresVerify(){return Date.now()-lastAliveAt>options.pingIntervalMs},isShuttingDown(){return receivedGoAway},onClose:void 0,onError:void 0,registerRequest(stream){streamCount++,streamCount==1&&(conn.ref(),resetPingInterval(),stopIdleTimeout()),stream.once("response",()=>{lastAliveAt=Date.now(),resetPingInterval()}),stream.once("close",()=>{streamCount--,streamCount==0&&(conn.unref(),resetPingInterval(),resetIdleTimeout())})},responseByteRead(stream){stream.session===conn&&(conn.closed||conn.destroyed||streamCount<=0||(lastAliveAt=Date.now(),resetPingInterval()))},verify(){return conn.ref(),new Promise(resolve3=>{commonPing(()=>{streamCount==0&&conn.unref(),resolve3(!0)}),conn.once("error",()=>resolve3(!1))})},abort(reason){conn.destroyed||(conn.once("error",()=>{}),conn.destroy(reason,http2.constants.NGHTTP2_CANCEL))},onExitState(){state.isShuttingDown()||(cleanup(),this.onError=void 0,this.onClose=void 0)}};function resetPingInterval(){stopPingInterval(),(streamCount>0||options.pingIdleConnection)&&(pingIntervalId=safeSetTimeout(onPingInterval,options.pingIntervalMs))}function stopPingInterval(){clearTimeout(pingIntervalId),clearTimeout(pingTimeoutId)}function onPingInterval(){commonPing(resetPingInterval)}function commonPing(onSuccess){clearTimeout(pingTimeoutId),pingTimeoutId=safeSetTimeout(()=>{conn.destroy(new ConnectError("PING timed out",Code.Unavailable),http2.constants.NGHTTP2_CANCEL)},options.pingTimeoutMs),conn.ping((err,duration)=>{if(clearTimeout(pingTimeoutId),err===null){if(duration>options.pingTimeoutMs){conn.destroy(new ConnectError("PING timed out",Code.Unavailable),http2.constants.NGHTTP2_CANCEL);return}lastAliveAt=Date.now(),onSuccess()}})}function stopIdleTimeout(){clearTimeout(idleTimeoutId)}function resetIdleTimeout(){idleTimeoutId=safeSetTimeout(onIdleTimeout,options.idleConnectionTimeoutMs)}function onIdleTimeout(){conn.close(),onClose()}function onGoaway(errorCode,lastStreamID,opaqueData){receivedGoAway=!0;let tooManyPingsAscii=Buffer.from("too_many_pings","ascii");errorCode===http2.constants.NGHTTP2_ENHANCE_YOUR_CALM&&opaqueData!=null&&opaqueData.equals(tooManyPingsAscii)&&(options.pingIntervalMs=options.pingIntervalMs*2,receivedGoAwayEnhanceYourCalmTooManyPings=!0),errorCode===http2.constants.NGHTTP2_NO_ERROR&&streamCount==0&&conn.destroy(new ConnectError("received GOAWAY without any open streams",Code.Canceled),http2.constants.NGHTTP2_NO_ERROR)}function onClose(){var _a;cleanup(),(_a=state.onClose)===null||_a===void 0||_a.call(state)}function onError(err){var _a,_b;if(cleanup(),receivedGoAwayEnhanceYourCalmTooManyPings){let ce=new ConnectError(`http/2 connection closed with error code ENHANCE_YOUR_CALM (0x${http2.constants.NGHTTP2_ENHANCE_YOUR_CALM.toString(16)}), too_many_pings, doubled the interval`,Code.ResourceExhausted);(_a=state.onError)===null||_a===void 0||_a.call(state,ce)}else(_b=state.onError)===null||_b===void 0||_b.call(state,connectErrorFromNodeReason(err))}function cleanup(){stopPingInterval(),stopIdleTimeout(),conn.off("error",onError),conn.off("close",onClose),conn.off("goaway",onGoaway)}return conn.on("error",onError),conn.on("close",onClose),conn.on("goaway",onGoaway),state}function safeSetTimeout(callback,ms9){if(!(ms9>2147483647))return setTimeout(callback,ms9).unref()}function assertSessionOpen(conn){if(conn.connecting)throw new ConnectError("expected open session, but it is connecting",Code.Internal);if(conn.destroyed)throw new ConnectError("expected open session, but it is destroyed",Code.Internal);if(conn.closed)throw new ConnectError("expected open session, but it is closed",Code.Internal)}function createNodeHttpClient(options){var _a;if(options.httpVersion=="1.1")return createNodeHttp1Client(options.nodeOptions);let sessionProvider=(_a=options.sessionProvider)!==null&&_a!==void 0?_a:url4=>new Http2SessionManager(url4);return createNodeHttp2Client(sessionProvider)}function createNodeHttp1Client(httpOptions){return async function(req){let sentinel=createSentinel(req.signal);return new Promise((resolve3,reject)=>{sentinel.catch(e=>{reject(e)}),h1Request(sentinel,req.url,Object.assign(Object.assign({},httpOptions),{headers:webHeaderToNodeHeaders(req.header,httpOptions?.headers),method:req.method}),request4=>{sinkRequest(req,request4,sentinel),request4.on("response",response=>{var _a;response.on("error",sentinel.reject),sentinel.catch(reason=>response.destroy(connectErrorFromNodeReason(reason)));let trailer=new Headers;resolve3({status:(_a=response.statusCode)!==null&&_a!==void 0?_a:0,header:nodeHeaderToWebHeader(response.headers),body:h1ResponseIterable(sentinel,response,trailer),trailer})})})})}}function createNodeHttp2Client(sessionProvider){return function(req){let sentinel=createSentinel(req.signal),sessionManager=sessionProvider(req.url);return new Promise((resolve3,reject)=>{sentinel.catch(e=>{reject(e)}),h2Request(sentinel,sessionManager,req.url,req.method,webHeaderToNodeHeaders(req.header),{},stream=>{sinkRequest(req,stream,sentinel),stream.on("response",headers=>{var _a;let response={status:(_a=headers[":status"])!==null&&_a!==void 0?_a:0,header:nodeHeaderToWebHeader(headers),body:h2ResponseIterable(sentinel,stream,sessionManager),trailer:h2ResponseTrailer(stream)};resolve3(response)})})})}}function h1Request(sentinel,url4,options,onRequest){let request3;new URL(url4).protocol.startsWith("https")?request3=https.request(url4,options):request3=http3.request(url4,options),sentinel.catch(reason=>request3.destroy(connectErrorFromNodeReason(reason))),request3.flushHeaders(),request3.on("error",sentinel.reject),request3.on("socket",function(socket){function onSocketConnect(){socket.off("connect",onSocketConnect),onRequest(request3)}socket.readyState==="open"?onRequest(request3):socket.on("connect",onSocketConnect)})}function h1ResponseIterable(sentinel,response,trailer){let inner=response[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let r=await sentinel.race(inner.next());return r.done===!0&&(nodeHeaderToWebHeader(response.trailers).forEach((value,key)=>{trailer.set(key,value)}),sentinel.resolve(),await sentinel),r},throw(e){throw sentinel.reject(e),e}}}}}function h2Request(sentinel,sm,url4,method,headers,options,onStream){let requestUrl=new URL(url4);if(requestUrl.origin!==sm.authority){let message=`cannot make a request to ${requestUrl.origin}: the http2 session is connected to ${sm.authority}`;sentinel.reject(new ConnectError(message,Code.Internal));return}sm.request(method,requestUrl.pathname+requestUrl.search,headers,{}).then(stream=>{sentinel.catch(reason=>{if(stream.closed)return;let rstCode=reason instanceof ConnectError&&reason.code==Code.Canceled?H2Code.CANCEL:H2Code.INTERNAL_ERROR;return new Promise(resolve3=>stream.close(rstCode,resolve3))}),stream.on("error",function(e){stream.writableEnded&&unwrapNodeErrorChain(e).map(getNodeErrorProps).some(p=>p.code=="ERR_STREAM_WRITE_AFTER_END")||sentinel.reject(e)}),stream.on("close",function(){let err=connectErrorFromH2ResetCode(stream.rstCode);err&&sentinel.reject(err)}),onStream(stream)},reason=>{sentinel.reject(reason)})}function h2ResponseTrailer(response){let trailer=new Headers;return response.on("trailers",args=>{nodeHeaderToWebHeader(args).forEach((value,key)=>{trailer.set(key,value)})}),trailer}function h2ResponseIterable(sentinel,response,sm){let inner=response[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let r=await sentinel.race(inner.next());return r.done===!0&&(sentinel.resolve(),await sentinel),sm?.notifyResponseByteRead(response),r},throw(e){throw sentinel.reject(e),e}}}}}async function sinkRequest(request3,nodeRequest,sentinel){if(request3.body===void 0){await new Promise(resolve3=>nodeRequest.end(resolve3));return}let it=request3.body[Symbol.asyncIterator]();return new Promise(resolve3=>{writeNext();function writeNext(){sentinel.isRejected()||it.next().then(r=>{if(r.done===!0){nodeRequest.end(resolve3);return}nodeRequest.write(r.value,"binary",function(e){if(e==null){writeNext();return}it.throw!==void 0&&it.throw(connectErrorFromNodeReason(e)).catch(()=>{}),!(nodeRequest.writableEnded&&unwrapNodeErrorChain(e).map(getNodeErrorProps).some(p=>p.code=="ERR_STREAM_WRITE_AFTER_END"))&&sentinel.reject(e)})},e=>{sentinel.reject(e)})}})}function createSentinel(signal){let res,rej,resolved=!1,rejected=!1,p=new Promise((resolve3,reject)=>{res=resolve3,rej=reject}),c={resolve(){!resolved&&!rejected&&(resolved=!0,res?.())},isResolved(){return resolved},reject(reason){!resolved&&!rejected&&(rejected=!0,rej?.(connectErrorFromNodeReason(reason)))},isRejected(){return rejected},async race(promise){let r=await Promise.race([promise,p]);if(r===void 0&&resolved)throw new ConnectError("sentinel completed early",Code.Internal);return r}},s=Object.assign(p,c);function onSignalAbort(){c.reject(getAbortSignalReason(this))}return signal&&(signal.aborted?c.reject(getAbortSignalReason(signal)):signal.addEventListener("abort",onSignalAbort),p.finally(()=>signal.removeEventListener("abort",onSignalAbort)).catch(()=>{})),s}function validateNodeTransportOptions(options){var _a,_b,_c,_d;let httpClient;if(options.httpVersion=="2"){let sessionManager;options.sessionManager?sessionManager=options.sessionManager:sessionManager=new Http2SessionManager(options.baseUrl,{pingIntervalMs:options.pingIntervalMs,pingIdleConnection:options.pingIdleConnection,pingTimeoutMs:options.pingTimeoutMs,idleConnectionTimeoutMs:options.idleConnectionTimeoutMs},options.nodeOptions),httpClient=createNodeHttpClient({httpVersion:"2",sessionProvider:()=>sessionManager})}else httpClient=createNodeHttpClient({httpVersion:"1.1",nodeOptions:options.nodeOptions});return Object.assign(Object.assign(Object.assign({},options),{httpClient,useBinaryFormat:(_a=options.useBinaryFormat)!==null&&_a!==void 0?_a:!0,interceptors:(_b=options.interceptors)!==null&&_b!==void 0?_b:[],sendCompression:(_c=options.sendCompression)!==null&&_c!==void 0?_c:null,acceptCompression:(_d=options.acceptCompression)!==null&&_d!==void 0?_d:[compressionGzip,compressionBrotli]}),validateReadWriteMaxBytes(options.readMaxBytes,options.writeMaxBytes,options.compressMinBytes))}function createGrpcTransport(options){return createTransport(validateNodeTransportOptions(Object.assign(Object.assign({},options),{httpVersion:"2"})))}function serviceDesc(file,path6,...paths){if(paths.length>0)throw new Error;return file.services[path6]}var file_tunnel_v1_tunnel=fileDesc("ChZ0dW5uZWwvdjEvdHVubmVsLnByb3RvEhh2ZXJjZWwuYXBpLmRldl90dW5uZWwudjEimwIKDkNvbm5lY3RSZXF1ZXN0Ei4KBGRhdGEYASABKAsyHi52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuRGF0YUgAEjAKBWNsb3NlGAIgASgLMh8udmVyY2VsLmFwaS5kZXZfdHVubmVsLnYxLkNsb3NlSAASMAoFcmVzZXQYAyABKAsyHy52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuUmVzZXRIABI4CgloZWFydGJlYXQYBCABKAsyIy52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuSGVhcnRiZWF0SAASMgoGd2luZG93GAUgASgLMiAudmVyY2VsLmFwaS5kZXZfdHVubmVsLnYxLldpbmRvd0gAQgcKBWZyYW1lIoYDCg9Db25uZWN0UmVzcG9uc2USLgoEb3BlbhgBIAEoCzIeLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5PcGVuSAASLgoEZGF0YRgCIAEoCzIeLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5EYXRhSAASMAoFY2xvc2UYAyABKAsyHy52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuQ2xvc2VIABIwCgVyZXNldBgEIAEoCzIfLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5SZXNldEgAEjgKCWhlYXJ0YmVhdBgFIAEoCzIjLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5IZWFydGJlYXRIABIyCgZ3aW5kb3cYBiABKAsyIC52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuV2luZG93SAASOAoJcmVjb25uZWN0GAcgASgLMiMudmVyY2VsLmFwaS5kZXZfdHVubmVsLnYxLlJlY29ubmVjdEgAQgcKBWZyYW1lIlsKBE9wZW4SDwoHY29ubl9pZBgBIAEoBBI0Cghwcm90b2NvbBgCIAEoDjIiLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5Qcm90b2NvbBIMCgRwb3J0GAMgASgNIigKBERhdGESDwoHY29ubl9pZBgBIAEoBBIPCgdwYXlsb2FkGAIgASgMIhgKBUNsb3NlEg8KB2Nvbm5faWQYASABKAQiKAoFUmVzZXQSDwoHY29ubl9pZBgBIAEoBBIOCgZyZWFzb24YAiABKAkiKAoGV2luZG93Eg8KB2Nvbm5faWQYASABKAQSDQoFYnl0ZXMYAiABKA0iCwoJSGVhcnRiZWF0IgsKCVJlY29ubmVjdCJhCgtEaWFsUmVxdWVzdBI2CgZ0YXJnZXQYASABKAsyJC52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuRGlhbFRhcmdldEgAEhEKB3BheWxvYWQYAiABKAxIAEIHCgVmcmFtZSJQCgpEaWFsVGFyZ2V0EjQKCHByb3RvY29sGAEgASgOMiIudmVyY2VsLmFwaS5kZXZfdHVubmVsLnYxLlByb3RvY29sEgwKBHBvcnQYAiABKA0iXAoMRGlhbFJlc3BvbnNlEhEKB3BheWxvYWQYASABKAxIABIwCgNlbmQYAiABKAsyIS52ZXJjZWwuYXBpLmRldl90dW5uZWwudjEuRGlhbEVuZEgAQgcKBWZyYW1lIgkKB0RpYWxFbmQqNgoIUHJvdG9jb2wSGAoUUFJPVE9DT0xfVU5TUEVDSUZJRUQQABIQCgxQUk9UT0NPTF9UQ1AQATLOAQoNVHVubmVsU2VydmljZRJiCgdDb25uZWN0EigudmVyY2VsLmFwaS5kZXZfdHVubmVsLnYxLkNvbm5lY3RSZXF1ZXN0GikudmVyY2VsLmFwaS5kZXZfdHVubmVsLnYxLkNvbm5lY3RSZXNwb25zZSgBMAESWQoERGlhbBIlLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5EaWFsUmVxdWVzdBomLnZlcmNlbC5hcGkuZGV2X3R1bm5lbC52MS5EaWFsUmVzcG9uc2UoATABYgZwcm90bzM"),ConnectRequestSchema=messageDesc(file_tunnel_v1_tunnel,0),ConnectResponseSchema=messageDesc(file_tunnel_v1_tunnel,1),OpenSchema=messageDesc(file_tunnel_v1_tunnel,2),DataSchema=messageDesc(file_tunnel_v1_tunnel,3),CloseSchema=messageDesc(file_tunnel_v1_tunnel,4),ResetSchema=messageDesc(file_tunnel_v1_tunnel,5),WindowSchema=messageDesc(file_tunnel_v1_tunnel,6),HeartbeatSchema=messageDesc(file_tunnel_v1_tunnel,7),ReconnectSchema=messageDesc(file_tunnel_v1_tunnel,8),DialRequestSchema=messageDesc(file_tunnel_v1_tunnel,9),DialTargetSchema=messageDesc(file_tunnel_v1_tunnel,10),DialResponseSchema=messageDesc(file_tunnel_v1_tunnel,11),DialEndSchema=messageDesc(file_tunnel_v1_tunnel,12);var ProtocolSchema=enumDesc(file_tunnel_v1_tunnel,0),TunnelService=serviceDesc(file_tunnel_v1_tunnel,0);var TunnelError=class extends Error{constructor(message,options={}){super(message);this.name="TunnelError",this.remote=options.remote,this.inspectorUrl=options.inspectorUrl}};function tunnelErrorRows(err){if(err instanceof TunnelError){let rows=err.remote?[`${err.remote.source}: ${remoteText(err.remote.message)}`]:[];return err.inspectorUrl&&rows.push("","Inspect the deployment:",` ${remoteText(err.inspectorUrl)}`),rows}return err instanceof APIError?[`Vercel API: ${remoteText(err.serverMessage||err.message)}`]:err instanceof ConnectError?[`${err.cause===void 0?"Tunnel service":"Reason"}: ${remoteText(err.rawMessage)}`]:[`Reason: ${remoteText(err instanceof Error?err.message:String(err))}`]}function formatTunnelError(headline,err){return[headline,...tunnelErrorRows(err)].join(`
57
+ `)}var CONN_WINDOW_BYTES=256*1024,MAX_PAYLOAD_BYTES2=64*1024,INSTANCE_HEADER="x-vercel-dev-tunnel-instance",HEARTBEAT_MS=15e3,SILENT_MS=9e4,PING_INTERVAL_MS=1e4,READY_TIMEOUT_MS=3e4,QUIET_RECONNECT_MS=5e3,RETRY_MIN_MS=250,RETRY_MAX_MS=5e3,FATAL=new Map([[Code.FailedPrecondition,"The tunnel service can't serve this tunnel."],[Code.InvalidArgument,"The tunnel service rejected the tunnel's request."],[Code.PermissionDenied,"The tunnel service didn't allow this tunnel."],[Code.Unimplemented,"The tunnel service doesn't support this version of Vercel CLI."]]),TunnelReplacedError=class extends Error{constructor(){super("The tunnel was replaced"),this.name="TunnelReplacedError"}},HEARTBEAT={frame:{case:"heartbeat",value:{}}};function targetPort(target){let{port,protocol}=new URL(target);return Number(port)||(protocol==="https:"?443:80)}var Outbox=class{constructor(){this.frames=[];this.closed=!1;this.wake=()=>{}}push(frame){this.closed||(this.frames.push(create(ConnectRequestSchema,frame)),this.wake())}close(){this.closed=!0,this.wake()}async*[Symbol.asyncIterator](){for(;;){let frame=this.frames.shift();if(frame)yield frame;else{if(this.closed)return;await new Promise(resolve3=>{this.wake=resolve3})}}}},Conn=class{constructor(id,socket,send,forget){this.id=id;this.socket=socket;this.send=send;this.forget=forget;this.sendWindow=CONN_WINDOW_BYTES;this.unsent=[];this.devEnded=!1;this.closeSent=!1;this.closeReceived=!1;this.over=!1;socket.on("data",chunk=>{this.unsent.push(chunk),this.flush()}),socket.on("end",()=>{this.devEnded=!0,this.flush()}),socket.on("error",err=>this.reset(err.message))}data(payload){this.socket.write(payload,err=>{err||this.grant(payload.length)})}close(){this.closeReceived=!0,this.socket.end(),this.finishIfDone()}window(bytes2){this.sendWindow+=bytes2,this.flush()}abandon(){this.end(),this.socket.destroy()}grant(bytes2){this.over||this.send({frame:{case:"window",value:{connId:this.id,bytes:bytes2}}})}flush(){for(;this.unsent.length&&this.sendWindow>0;){let chunk=this.unsent[0],size=Math.min(chunk.length,this.sendWindow,MAX_PAYLOAD_BYTES2),payload=new Uint8Array(chunk.buffer,chunk.byteOffset,size);this.send({frame:{case:"data",value:{connId:this.id,payload}}}),this.sendWindow-=size,size===chunk.length?this.unsent.shift():this.unsent[0]=chunk.subarray(size)}this.unsent.length?this.socket.pause():this.socket.resume(),this.devEnded&&!this.unsent.length&&!this.closeSent&&(this.closeSent=!0,this.send({frame:{case:"close",value:{connId:this.id}}}),this.finishIfDone())}reset(reason){this.over||(this.send({frame:{case:"reset",value:{connId:this.id,reason}}}),this.abandon())}finishIfDone(){this.closeSent&&this.closeReceived&&this.end()}end(){this.over||(this.over=!0,this.forget())}};function connectTunnel(options){let{relayUrl,renewToken,target}=options,host=new URL(target).hostname.replace(/^\[(.*)\]$/,"$1"),port=targetPort(target),client=createClient(TunnelService,createGrpcTransport({baseUrl:relayUrl,pingIntervalMs:PING_INTERVAL_MS})),instance=randomUUID2(),closed2=!1,streams=new Set,settleReady,ready2=new Promise((resolve3,reject)=>{settleReady={resolve:resolve3,reject}});ready2.catch(()=>{});let lastFailure,stopped,wakeRetry=()=>{},stop=err=>{stopped??=err,closed2=!0;for(let stream2 of streams)stream2.abort();wakeRetry(),settleReady?.reject(err),settleReady=void 0},readyTimer=setTimeout(()=>{output_manager_default.warning(["The tunnel hasn't connected yet. Still trying.",`Relay: ${remoteText(relayUrl)}`,...lastFailure?tunnelErrorRows(lastFailure):[]].join(`
58
+ `))},READY_TIMEOUT_MS);readyTimer.unref?.();let liveStreams=0,outage,warned=!1,onLive=()=>{liveStreams+=1,clearTimeout(readyTimer),settleReady?.resolve(),settleReady=void 0,clearTimeout(outage),outage=void 0,warned&&output_manager_default.print(` Tunnel reconnected
59
+ `),warned=!1},onLost=()=>{liveStreams-=1,!(liveStreams>0||closed2)&&(outage??=setTimeout(()=>{warned=!0,output_manager_default.warning("Tunnel connection lost, reconnecting")},QUIET_RECONNECT_MS))},open2=({connId,protocol,port:wanted},send,conns)=>{if(protocol!==1||wanted!==port){send({frame:{case:"reset",value:{connId,reason:`vc dev serves only port ${port}`}}});return}let socket=netConnect({host,port,allowHalfOpen:!0});conns.set(connId,new Conn(connId,socket,send,()=>conns.delete(connId)))},stream=async(token,live,moving)=>{let controller=new AbortController;streams.add(controller);let holding=!1,outbox=new Outbox,send=frame=>outbox.push(frame),conns=new Map,lastHeard=performance.now();send(HEARTBEAT);let heartbeat=setInterval(()=>{performance.now()-lastHeard>SILENT_MS?controller.abort():send(HEARTBEAT)},HEARTBEAT_MS);try{let frames=client.connect(outbox,{headers:{authorization:`Bearer ${token}`,[INSTANCE_HEADER]:instance},signal:controller.signal});for await(let{frame}of frames)switch(lastHeard=performance.now(),frame.case){case"heartbeat":holding||(holding=!0,onLive(),live());break;case"reconnect":moving();break;case"open":open2(frame.value,send,conns);break;case"data":conns.get(frame.value.connId)?.data(frame.value.payload);break;case"close":conns.get(frame.value.connId)?.close();break;case"reset":conns.get(frame.value.connId)?.abandon();break;case"window":conns.get(frame.value.connId)?.window(frame.value.bytes);break;default:break}}finally{clearInterval(heartbeat),outbox.close();for(let conn of[...conns.values()])conn.abandon();streams.delete(controller),holding&&onLost()}},done=(async()=>{let token=options.clientToken,delay=RETRY_MIN_MS,waitingForOther=!1;for(;!closed2;){let moving=()=>{},moved=new Promise(resolve3=>{moving=()=>resolve3("moved")}),ended=stream(token,()=>{delay=RETRY_MIN_MS,waitingForOther=!1},moving).then(()=>{},err=>ConnectError.from(err)),outcome=await Promise.race([ended,moved]);if(closed2)break;if(outcome==="moved")continue;let code=outcome?.code,refused=code===void 0?void 0:FATAL.get(code);if(refused){let message=outcome?.rawMessage;throw new TunnelError(refused,{...message&&{remote:{source:"Tunnel service",message}}})}if(lastFailure=outcome,code===Code.AlreadyExists&&!waitingForOther&&(waitingForOther=!0,output_manager_default.warning("Another `vc dev --tunnel` holds this tunnel. Waiting for it to stop; one that lost its connection lets go within 90s.")),output_manager_default.debug(`Tunnel stream ended (${outcome?.message??"by the service"}), reconnecting in ${delay}ms`),await new Promise(resolve3=>{let timer=setTimeout(resolve3,delay);wakeRetry=()=>{clearTimeout(timer),resolve3()}}),delay=Math.min(delay*2,RETRY_MAX_MS),code===Code.Unauthenticated&&!closed2)try{token=await renewToken()}catch(err){if(err instanceof TunnelReplacedError)throw err;lastFailure=err instanceof Error?err:new Error(String(err))}}if(stopped)throw stopped})().then(()=>clearTimeout(outage),err=>{clearTimeout(outage);let error3=err instanceof Error?err:new Error(String(err));throw stop(error3),error3});return done.catch(()=>{}),{ready:ready2,done,close(){if(!closed2){closed2=!0,clearTimeout(readyTimer);for(let stream2 of streams)stream2.abort();wakeRetry(),settleReady?.reject(new Error("Tunnel closed")),settleReady=void 0}}}}var import_routing_utils4=__toESM(require_dist3(),1);function projectRoutes(config){let{routes,rewrites,redirects,headers,cleanUrls,trailingSlash}=config,transformed=(0,import_routing_utils4.getTransformedRoutes)({routes,rewrites,redirects,headers,cleanUrls,trailingSlash});if(transformed.error)throw transformed.error;return transformed.routes??[]}var RELAY_URL_ENV="DEV_TUNNEL_RELAY_URL",SERVER_TOKEN_ENV="DEV_TUNNEL_SERVER_TOKEN",PORT_ENV="DEV_TUNNEL_PORT",ROUTED_PATH_PARAM="__vc_tunnel_path",ROUTED_HEADER="x-vc-tunnel-routed";import{createHash}from"node:crypto";var MAX_LABEL=63;function tunnelAliasLabel(projectName,username,org){let label=toLabel([projectName,"tunnel",username,org.type==="team"?org.slug:""].filter(Boolean).join("-"));if(label.length<=MAX_LABEL)return label;let hash=createHash("sha256").update(label).digest("hex").slice(0,8);return`${label.slice(0,MAX_LABEL-hash.length-1).replace(/-+$/,"")}-${hash}`}function aliasUnder(label,deploymentUrl){let{hostname}=new URL(deploymentUrl);return`${label}.${hostname.slice(hostname.indexOf(".")+1)}`}function isAliasLabel(value){return value.length<=MAX_LABEL&&/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(value)}function toLabel(value){return value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async function assignAlias(client,org,deploymentId,alias){try{await client.fetch(`/v2/deployments/${encodeURIComponent(deploymentId)}/aliases`,{method:"POST",accountId:org.id,body:{alias}})}catch(err){if(isAPIError(err)&&err.status===409&&await aliasDeployment(client,org,alias)===deploymentId)return;throw err}}async function aliasDeployment(client,org,alias){try{let{deploymentId}=await client.fetch(`/v4/aliases/${encodeURIComponent(alias)}`,{accountId:org.id});return deploymentId??null}catch(err){if(isAPIError(err)&&err.status===404)return;throw err}}var PROXY_META={vcDevTunnel:"proxy"};async function aliasHeldElsewhere(client,org,alias,{userId,ours,leased=!1}){let deploymentId=await aliasDeployment(client,org,alias);if(deploymentId===void 0)return!1;if(deploymentId===null)return!0;if(ours.has(deploymentId))return!1;let deployment;try{deployment=await client.fetch(`/v13/deployments/${encodeURIComponent(deploymentId)}`,{accountId:org.id})}catch(err){if(isAPIError(err)&&err.status===404)return!1;throw err}return!(deployment.meta?.vcDevTunnel===PROXY_META.vcDevTunnel&&(leased||deployment.creator?.uid===userId))}var import_client2=__toESM(require_dist5(),1);import{mkdtemp,mkdir as mkdir2,writeFile as writeFile2}from"node:fs/promises";import{tmpdir}from"node:os";import{dirname as dirname5,join as join7}from"node:path";var import_routing_utils5=__toESM(require_dist3(),1);var asset=id=>readRuntimeAsset(manifest_default[id].source).toString("utf8"),PROXY_DEPENDENCIES={"@bufbuild/protobuf":"2.12.0","@connectrpc/connect":"2.0.2","@connectrpc/connect-node":"2.0.2","@vercel/functions":"^3.9.0",ws:"8.18.0"},PROXY_DEV_DEPENDENCIES={"@types/node":"24.19.1","@types/ws":"8.18.1"};function proxyRoutes(projectRoutes2=[]){return[{src:"^/.*$",transforms:[{type:"request.headers",op:"delete",target:{key:ROUTED_HEADER}}],continue:!0},...(0,import_routing_utils5.appendRoutesToPhase)({routes:projectRoutes2,newRoutes:[{src:"^/.*$",transforms:[{type:"request.headers",op:"set",target:{key:ROUTED_HEADER},args:"1"}],continue:!0},{src:"^/(.*)$",dest:`/api/tunnel?${ROUTED_PATH_PARAM}=/$1`}],phase:"filesystem"})]}function tunnelDeploymentFiles(projectRoutes2=[]){return{"api/tunnel.ts":asset("devTunnelFunction"),"lib/env.ts":asset("devTunnelEnv"),"lib/tunnel_pb.ts":asset("devTunnelProto"),"public/.gitkeep":"","package.json":`${JSON.stringify({name:"vc-dev-tunnel",private:!0,dependencies:PROXY_DEPENDENCIES,devDependencies:PROXY_DEV_DEPENDENCIES},null,2)}
60
+ `,"vercel.json":`${JSON.stringify({framework:null,installCommand:"npm install",buildCommand:null,ignoreCommand:"exit 1",outputDirectory:"public",functions:{"api/tunnel.ts":{maxDuration:300}},routes:proxyRoutes(projectRoutes2)},null,2)}
61
+ `}}var RELEASE_TIMEOUT_MS=2e3;async function reserveAlias(client,org,projectId,alias){try{return await client.fetch("/v1/dev-tunnel/aliases",{method:"POST",accountId:org.id,body:{projectId,alias}}),"reserved"}catch(err){if(isAPIError(err)&&err.status===409)return"held";if(isAPIError(err)&&err.status===404)return"unsupported";throw err}}async function releaseAlias(client,org,projectId,alias){try{await client.fetch(`/v1/dev-tunnel/aliases/${encodeURIComponent(alias)}?projectId=${encodeURIComponent(projectId)}`,{method:"DELETE",accountId:org.id,signal:AbortSignal.timeout(RELEASE_TIMEOUT_MS)})}catch(err){output_manager_default.debug(`Could not release the tunnel's lease on ${alias}: ${err}`)}}import{createHash as createHash2}from"node:crypto";import{mkdir,readFile as readFile2,writeFile}from"node:fs/promises";import{dirname as dirname4,join as join6}from"node:path";function proxyKey(parts){return createHash2("sha256").update(JSON.stringify(parts)).digest("hex")}function proxyRecordPath(orgId,projectId,globalDir=getGlobalPathConfig()){return join6(globalDir,"dev-tunnels",`${orgId}.${projectId}.json`)}var PROXY_MAX_AGE_MS=7*24*60*60*1e3;async function readProxy(path6){try{let proxy=JSON.parse(await readFile2(path6,"utf8"));if(!proxy.key||!proxy.id||!proxy.url)return;let replaces=(Array.isArray(proxy.replaces)?proxy.replaces:[proxy.replaces]).filter(id=>typeof id=="string");return{key:proxy.key,id:proxy.id,url:proxy.url,...replaces.length>0&&{replaces}}}catch{return}}async function isReusable(proxy,key,getDeployment,now=Date.now()){if(proxy.key!==key)return!1;try{let{readyState,createdAt,target}=await getDeployment(proxy.id);return target!=="production"&&readyState==="READY"&&createdAt!==void 0&&now-createdAt<PROXY_MAX_AGE_MS}catch{return!1}}async function rememberProxy(path6,proxy){try{await mkdir(dirname4(path6),{recursive:!0}),await writeFile(path6,`${JSON.stringify(proxy,null,2)}
62
+ `)}catch{}}function proxyDeployer(options){let{client,org,projectId,projectName,rootDirectory,env,signal,alias:tunnelAlias}=options,record=options.record??proxyRecordPath(org.id,projectId),current,currentUrl="",ours=new Set,claimed=!1,deployedBefore=!1,leased,urlOf=async({id,url:url4})=>{if(!tunnelAlias)return url4;let alias=aliasUnder(tunnelAlias.label,url4);try{let lease=tunnelAlias.chosen?await reserveAlias(client,org,projectId,alias):"unsupported";if(lease==="held")throw new TunnelError(`Can't use ${alias} for the tunnel. Another developer's tunnel holds it.`);if(lease==="reserved"&&(leased=alias),await aliasHeldElsewhere(client,org,alias,{userId:tunnelAlias.userId,ours,leased:lease==="reserved"}))throw lease==="reserved"&&(await releaseAlias(client,org,projectId,alias),leased=void 0),new TunnelError(`Can't use ${alias} for the tunnel. It points at another deployment.`);return await assignAlias(client,org,id,alias),claimed=!0,`https://${alias}`}catch(err){if(tunnelAlias.chosen&&!tunnelAlias.resumed&&!claimed)throw leased&&(await releaseAlias(client,org,projectId,leased),leased=void 0),err instanceof TunnelError?err:new TunnelError(`Couldn't use ${alias} for the tunnel.`,{remote:{source:"Vercel API",message:isAPIError(err)?err.serverMessage:err instanceof Error?err.message:String(err)}});return output_manager_default.warning(err instanceof TunnelError?`${err.message} The tunnel's URL changes with each deploy.`:formatTunnelError(`Couldn't point ${alias} at the tunnel's proxy, so its URL changes with each deploy.`,err)),url4}};return Object.assign(async routes=>{let files=tunnelDeploymentFiles(routes),key=proxyKey({files,env,rootDirectory:rootDirectory??null});if(current?.key===key)return currentUrl;let previous=current??await readProxy(record),stale=previous?.replaces??[];previous&&ours.add(previous.id);for(let id2 of stale)ours.add(id2);let moved=()=>!tunnelAlias||currentUrl!==current?.url,replaceAll=async ids=>{let leftover=[...new Set(ids)].filter(old=>old!==current?.id);if(moved())for(let old of leftover)deleteProxy(client,org,old);else current&&leftover.length>0&&(current={...current,replaces:leftover});current&&await rememberProxy(record,current)};if(previous&&await isReusable(previous,key,id2=>client.fetch(`/v13/deployments/${encodeURIComponent(id2)}`,{accountId:org.id})))return current={key:previous.key,id:previous.id,url:previous.url},currentUrl=await urlOf(current),stale.length>0&&await replaceAll(stale),currentUrl;let replaced=previous?[previous.id,...stale]:[];if(signal?.throwIfAborted(),deployedBefore||=await hasDeployment(client,org,projectId),!deployedBefore)throw new TunnelError(`Can't deploy the tunnel proxy. ${projectName} has never been deployed, so its first deployment would be production. Deploy it once with \`vercel deploy\`, then run \`vercel dev --tunnel\` again.`);output_manager_default.print(` Deploying the tunnel proxy
63
+ `);let{id,url:url4}=await deployProxy(client,org,projectName,await materializeDeployment(files,rootDirectory),env,{signal,onCreated:created=>{let replaces=[...new Set(replaced)].filter(id2=>id2!==created.id);return rememberProxy(record,{key,...created,...replaces.length>0&&{replaces}})}});ours.add(id);let replacing=current!==void 0;return current={key,id,url:url4},currentUrl=await urlOf(current),await replaceAll(replaced),replacing&&currentUrl!==url4&&output_manager_default.print(` The tunnel serves the new routes
64
+ `),currentUrl},{async release(){leased&&await releaseAlias(client,org,projectId,leased)}})}async function materializeDeployment(files,rootDirectory){let dir=await mkdtemp(join7(tmpdir(),"vc-dev-tunnel-")),base=rootDirectory?join7(dir,rootDirectory):dir;for(let[relative3,contents]of Object.entries(files)){let file=join7(base,relative3);await mkdir2(dirname5(file),{recursive:!0}),await writeFile2(file,contents)}return dir}async function deployProxy(client,org,projectName,path6,env,{signal,onCreated}={}){let token=client.authConfig.token;if(!token)throw new Error("Missing authentication token");let inspectorUrl,events=(0,import_client2.createDeployment)({teamId:org.type==="team"?org.id:void 0,apiUrl:client.apiUrl,token,userAgent:ua_default,path:path6,projectName,skipAutoDetectionConfirmation:!0,dispatcher:getFetchDispatcher(),debug:output_manager_default.isDebugEnabled()},{name:projectName,env,meta:PROXY_META,projectSettings:{framework:null,buildCommand:null,installCommand:null,outputDirectory:null,devCommand:null}});try{for(;;){let next=await untilAborted(events.next(),signal);if(next.done)break;let event=next.value;if(event.type==="created")inspectorUrl=event.payload.inspectorUrl??void 0,await onCreated?.({id:event.payload.id,url:`https://${event.payload.url}`});else{if(event.type==="ready")return{id:event.payload.id,url:`https://${event.payload.url}`};if(event.type==="canceled")throw new TunnelError("The tunnel proxy deployment was canceled.",{inspectorUrl});if(event.type==="error"){let message=event.payload?.message;throw new TunnelError("Failed to deploy the tunnel proxy.",{...message&&{remote:{source:"Deployment",message}},inspectorUrl})}}}}finally{events.return?.(void 0)}throw new TunnelError("The tunnel proxy deployment never became ready.",{inspectorUrl})}function untilAborted(promise,signal){return signal?(signal.throwIfAborted(),new Promise((resolve3,reject)=>{let onAbort=()=>reject(signal.reason);signal.addEventListener("abort",onAbort,{once:!0}),promise.then(value=>{signal.removeEventListener("abort",onAbort),resolve3(value)},err=>{signal.removeEventListener("abort",onAbort),reject(err)})})):promise}async function hasDeployment(client,org,projectId){let{deployments}=await client.fetch(`/v6/deployments?projectId=${encodeURIComponent(projectId)}&limit=1`,{accountId:org.id});return deployments.length>0}async function deleteProxy(client,org,id){let url4=`/v13/deployments/${encodeURIComponent(id)}`;try{let{target}=await client.fetch(url4,{accountId:org.id});if(target==="production"){output_manager_default.debug(`Keeping the replaced tunnel proxy ${id}: it's production`);return}await client.fetch(url4,{method:"DELETE",accountId:org.id})}catch(err){output_manager_default.debug(`Could not delete the replaced tunnel proxy ${id}: ${err}`)}}function reserveTunnel(client,org,projectId){return client.fetch("/v1/dev-tunnel",{method:"POST",accountId:org.id,body:{projectId}})}async function startTunnel(options){let{client,org,projectId,projectName,rootDirectory,target}=options;output_manager_default.debug("Connecting tunnel");let reservation=await reserveTunnel(client,org,projectId),tunnel=connectTunnel({relayUrl:reservation.relayUrl,clientToken:reservation.clientToken,renewToken:async()=>{let renewed=await reserveTunnel(client,org,projectId);if(renewed.serverToken!==reservation.serverToken||renewed.relayUrl!==reservation.relayUrl)throw new TunnelReplacedError;return renewed.clientToken},target});try{await tunnel.ready;let user=await getUser(client),proxyFor=proxyDeployer({client,org,projectId,projectName,rootDirectory,signal:options.signal,alias:{label:options.aliasLabel??tunnelAliasLabel(projectName,user.username,org),chosen:options.aliasLabel!==void 0,resumed:options.resumed,userId:user.id},env:{[RELAY_URL_ENV]:reservation.relayUrl,[SERVER_TOKEN_ENV]:reservation.serverToken,[PORT_ENV]:String(targetPort(target))}}),url4=await proxyFor(options.routes??[]),deploys=Promise.resolve();return{...tunnel,url:url4,setRoutes:routes=>{let deployed=deploys.then(()=>proxyFor(routes));return deploys=deployed.catch(()=>{}),deployed},release:()=>proxyFor.release()}}catch(err){throw tunnel.close(),err}}import{setTimeout as setTimeout2}from"node:timers/promises";var import_ms7=__toESM(require_ms(),1);import{performance as performance2}from"perf_hooks";var REFRESH_BEFORE_EXPIRY_MILLIS=getMs((0,import_ms7.default)("15m"),process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS),THROTTLE_MILLIS=getMs((0,import_ms7.default)("1m"),process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS);function getMs(defaultValue,overrideValue){if(overrideValue){let result=(0,import_ms7.default)(overrideValue);if(Number.isFinite(result)&&result>0)return result}return defaultValue}async function*refreshOidcToken(signal,client,projectId,envValues,source,throttleMillis){throttleMillis??=THROTTLE_MILLIS;let lastPulledEnvAt=clock(),refreshCount=0;for(;!signal.aborted;){let oidcToken=envValues[VERCEL_OIDC_TOKEN];if(!oidcToken){output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is absent; disabling refreshes`);return}let now=clock(),expiresAfterMillis;try{let{exp}=decodeJwt(oidcToken);expiresAfterMillis=exp!==void 0?exp*1e3-now:void 0}catch{}if(expiresAfterMillis===void 0||!Number.isFinite(expiresAfterMillis)){output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is invalid; disabling refreshes`);return}refreshCount++>0&&expiresAfterMillis>0&&(yield oidcToken);let refreshAfterMillis=Math.max(0,expiresAfterMillis-REFRESH_BEFORE_EXPIRY_MILLIS);now+refreshAfterMillis-lastPulledEnvAt<throttleMillis&&(refreshAfterMillis=throttleMillis);let expiresAfterSecs=Math.abs(Math.round(millisToSecs(expiresAfterMillis))),refreshAfterSecs=Math.round(millisToSecs(refreshAfterMillis));expiresAfterMillis<0?output_manager_default.debug(`${VERCEL_OIDC_TOKEN} expired ${expiresAfterSecs}s ago; refreshing in ${refreshAfterSecs}s`):output_manager_default.debug(`${VERCEL_OIDC_TOKEN} expires in ${expiresAfterSecs}s; refreshing in ${refreshAfterSecs}s`),await setTimeout2(refreshAfterMillis,void 0,{signal});let envValuesOrNull=await pullEnvValuesUntilSuccessful(signal,client,projectId,source,throttleMillis);if(!envValuesOrNull)return;envValues=envValuesOrNull,lastPulledEnvAt=clock()}}async function pullEnvValuesUntilSuccessful(signal,client,projectId,source,millis){for(;!signal.aborted;)try{return(await pullEnvRecords(client,projectId,source)).env}catch{output_manager_default.debug(`Failed to pull environment; trying again in ${Math.round(millisToSecs(millis))}s`),await setTimeout2(millis,void 0,{signal})}return null}function clock(){return performance2.timeOrigin+performance2.now()}function millisToSecs(millis){return millis/1e3}import{join as join8}from"path";import{mkdir as mkdir3,open,unlink,readFile as readFile3}from"fs/promises";import{unlinkSync as unlinkSync2,constants as constants2}from"fs";var DEV_LOCK_FILE="dev.lock";function isProcessRunning(pid){try{return process.kill(pid,0),!0}catch{return!1}}async function tryCreateLockFile(lockPath,content){try{let fd=await open(lockPath,constants2.O_CREAT|constants2.O_EXCL|constants2.O_WRONLY);return await fd.writeFile(content,"utf8"),await fd.close(),!0}catch(err){if(err.code==="EEXIST")return!1;throw err}}async function tryReadLockFile(lockPath){try{let content=await readFile3(lockPath,"utf8");return JSON.parse(content)}catch{return null}}async function acquireDevLock(projectRoot,port){let vercelDir=join8(projectRoot,VERCEL_DIR),lockPath=join8(vercelDir,DEV_LOCK_FILE);await mkdir3(vercelDir,{recursive:!0});let lockData={pid:process.pid,port,startedAt:Date.now(),cwd:projectRoot},lockContent=JSON.stringify(lockData);try{if(await tryCreateLockFile(lockPath,lockContent))return{acquired:!0}}catch(err){output_manager_default.debug(`Failed to create lock file: ${err}`)}let existingLock=await tryReadLockFile(lockPath);if(existingLock){if(isProcessRunning(existingLock.pid))return{acquired:!1,existingLock};output_manager_default.debug(`Removing stale lock from PID ${existingLock.pid}`);try{await unlink(lockPath)}catch(err){output_manager_default.debug(`Failed to remove stale lock file: ${err}`)}try{if(await tryCreateLockFile(lockPath,lockContent))return{acquired:!0}}catch(err){output_manager_default.debug(`Failed to create lock after removing stale: ${err}`)}let newLock=await tryReadLockFile(lockPath);if(newLock)return{acquired:!1,existingLock:newLock}}else output_manager_default.debug("Lock file exists but cannot be read");return{acquired:!1,existingLock:null,reason:`The lock file at \`${lockPath}\` could not be read. If no other \`vercel dev\` is running, remove it and retry.`}}function releaseDevLock(projectRoot){let lockPath=join8(projectRoot,VERCEL_DIR,DEV_LOCK_FILE);try{unlinkSync2(lockPath)}catch(err){output_manager_default.debug(`Failed to release lock: ${err}`)}}function parseResourcePort(value,flag){if(value===void 0)return;if(!/^\d+$/.test(value))throw new Error(`${flag} must be an integer between 0 and 65535`);let port=Number(value);if(!Number.isSafeInteger(port)||port>65535)throw new Error(`${flag} must be an integer between 0 and 65535`);return port}async function dev2(client,opts,args,telemetry,localConfig){let[dir="."]=args,cwd=resolve2(dir),localConfigCwd=cwd,listen2=parseListen(opts["--listen"]||"3000"),queuePort=parseResourcePort(opts["--queue-port"],"--queue-port"),runtimeCachePort=parseResourcePort(opts["--runtime-cache-port"],"--runtime-cache-port"),schedulesPort=parseResourcePort(opts["--schedules-port"],"--schedules-port"),resourcePorts=[["--queue-port",queuePort],["--runtime-cache-port",runtimeCachePort],["--schedules-port",schedulesPort]];for(let[index,[flag,port]]of resourcePorts.entries()){let duplicate=resourcePorts.slice(0,index).find(([,otherPort])=>port!==void 0&&port!==0&&port===otherPort);if(duplicate)throw new Error(`${duplicate[0]} and ${flag} must use different ports`)}cwd=await resolveProjectCwd(cwd);let projectNameOrId=opts["--project"],reportError=createErrorReporter2(code=>telemetry.trackError(code)),link=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client)});if(link.status==="not_linked"&&!process.env.__VERCEL_SKIP_DEV_CMD)if(opts["--local"])output_manager_default.warn(`Running dev server in local mode without a project setup:
65
+ - Environment variables will not be pulled from Vercel
66
+ - Project settings are defined by local configuration
67
+
68
+ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\` or ${getCommandName("link")}.`);else{if(projectNameOrId)return await printProjectNotFoundError(client,projectNameOrId,"dev",link.orgId),1;if(link=await setupAndLink(client,cwd,{autoConfirm:opts["--yes"],link,successEmoji:"link",nonInteractive:client.nonInteractive}),link.status==="not_linked")return 0}if(link.status==="error")return link.reason==="HEADLESS"&&(client.nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain("dev")} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName("dev")} requires confirmation. Use option ${param("--yes")} to confirm.`)),link.exitCode;let projectSettings,envValues={},repoRoot,projectId,orgId;if(link.status==="linked"){let{project,org}=link;if(link.repoRoot)repoRoot=cwd=link.repoRoot;else if(project.rootDirectory){let monorepoRoot=await findRepoRoot(cwd);monorepoRoot&&(repoRoot=cwd=monorepoRoot)}client.config.currentTeam=org.type==="team"?org.id:void 0,projectSettings=project,projectId=project.id,orgId=org.id,project.rootDirectory&&(cwd=join9(cwd,project.rootDirectory)),envValues=(await pullEnvRecords(client,project.id,"vercel-cli:dev")).env}let services,useImplicitServicesEnvInjection=!0,projectConfig=cwd===localConfigCwd||client.localConfigPath?localConfig:await loadVercelConfig(cwd),servicesResult=await tryDetectServices(cwd,projectConfig);!client.localConfigPath&&await promptExperimentalServicesMigration({client,cwd,autoConfirm:!!opts["--yes"],nonInteractive:client.nonInteractive,detectServicesResult:servicesResult})&&(servicesResult=await tryDetectServices(cwd));let foundServices=servicesResult&&servicesResult.services.length>0,daemonNames=(0,import_build_utils10.getDaemonNames)(projectConfig);daemonNames.length>0&&output_manager_default.warn(`${getCommandName("dev")} doesn't run daemons: ${daemonNames.join(", ")}. Run them with Docker.`),servicesResult&&foundServices&&(services=servicesResult.services,displayDetectedServices(services),useImplicitServicesEnvInjection=servicesResult.useImplicitEnvInjection,assertNoBuildpackServices(services));let hasExplicitBuilds=!!localConfig?.builds?.length,hasExplicitFramework=localConfig?.framework!==void 0,hasServicesConfig=!!(localConfig?.services??localConfig?.experimentalServicesV2??localConfig?.experimentalServices);if(link.status==="not_linked"&&!!opts["--local"]&&!foundServices&&!hasServicesConfig&&!hasExplicitBuilds&&!hasExplicitFramework){let detectedFramework=await(0,import_fs_detectors3.detectFramework)({fs:new import_fs_detectors3.LocalFileSystemDetector(cwd),frameworkList:import_frameworks4.frameworkList});detectedFramework&&(output_manager_default.debug(`Detected framework ${detectedFramework} for unlinked local dev`),projectSettings={framework:detectedFramework})}let tunnel;if(opts["--tunnel"]){if(link.status!=="linked")return output_manager_default.fatal(`${getCommandName("dev --tunnel")} requires a linked project. Run ${getCommandName("link")} first.`),1;if(foundServices)return output_manager_default.fatal(`${getCommandName("dev --tunnel")} doesn't support projects with services yet.`),1;let{org,project}=link,protection=await getEnabledProtection(client,{id:project.id,accountId:org.id});if(!protection?.length)return output_manager_default.fatal(protection?`${getCommandName("dev --tunnel")} needs Deployment Protection on ${project.name}'s preview deployments, or anyone with the tunnel's URL could reach your dev server. Turn on Vercel Authentication under Settings \u2192 Deployment Protection.`:`Could not read ${project.name}'s Deployment Protection settings, so ${getCommandName("dev --tunnel")} won't expose your dev server.`),1;tunnel={org,projectId:project.id,projectName:project.name,rootDirectory:project.rootDirectory,...typeof opts["--tunnel"]=="string"&&{aliasLabel:opts["--tunnel"]},port:typeof listen2[0]=="number"?listen2[0]||await(0,import_get_port3.default)():3e3}}let lockAcquired=!1;if(foundServices){let port=typeof listen2[0]=="number"?listen2[0]:0,lockResult=await acquireDevLock(cwd,port);if(!lockResult.acquired){let detail;if(lockResult.existingLock){let{existingLock}=lockResult,startTime=(0,import_ms8.default)(Date.now()-existingLock.startedAt);detail=`Port: ${existingLock.port}
69
+ PID: ${existingLock.pid}
70
+ Started: ${startTime} ago
71
+ Stop it by pressing Ctrl+C in its terminal, or run \`kill ${existingLock.pid}\`.`}else detail=lockResult.reason;return reportError(dev.DEV_LOCK_HELD({detail})),1}lockAcquired=!0}let routes=[],runningTunnel,tunnelUrl,applyRoutes=()=>{runningTunnel?.setRoutes(routes).then(url4=>{url4!==tunnelUrl&&(tunnelUrl=url4,announceTunnel(url4))},err=>output_manager_default.warning(formatTunnelError("Couldn't deploy the tunnel proxy with the new routes. The tunnel keeps the old ones.",err)))},devServer=new DevServer(cwd,{projectSettings,envValues,repoRoot,services,useImplicitServicesEnvInjection,projectId,orgId,queuePort,runtimeCachePort,schedulesPort,...tunnel&&{routing:!1,devCommandPort:tunnel.port,onConfig:config=>{routes=projectRoutes(config),applyRoutes()}},onErrorCode:code=>telemetry.trackError(code)}),controller=new AbortController,timeout=setTimeout(async()=>{if(link.status==="linked")try{let refreshCount=0;for await(let token of refreshOidcToken(controller.signal,client,link.project.id,envValues,"vercel-cli:dev"))output_manager_default.debug(`Refreshing ${import_chalk3.default.green(VERCEL_OIDC_TOKEN)}`),await devServer.updateEnvValues({[VERCEL_OIDC_TOKEN]:token}),telemetry.trackOidcTokenRefresh(++refreshCount)}catch(error3){if(error3 instanceof Error&&error3.name==="AbortError"){output_manager_default.debug("OIDC token refresh was aborted");return}if(error3 instanceof DevCommandExitError){output_manager_default.error(error3.message),await cleanup(error3.exitCode);return}throw error3}}),shutdown=async()=>{clearTimeout(timeout),controller.abort(),lockAcquired&&releaseDevLock(cwd),runningTunnel?.close(),await runningTunnel?.release(),await devServer.stop()},cleanupInProgress=!1,cleanup=async reason=>{if(cleanupInProgress)return;cleanupInProgress=!0,output_manager_default.debug(typeof reason=="number"?`Exiting with code ${reason}, shutting down...`:`Received ${reason}, shutting down...`),await shutdown();let exitCode;if(typeof reason=="number")exitCode=reason;else switch(reason){case"SIGINT":exitCode=130;break;case"SIGTERM":exitCode=143;break;case"SIGHUP":exitCode=129;break;default:exitCode=0}process.exit(exitCode)};if(process.on("SIGTERM",async()=>await cleanup("SIGTERM")),process.on("SIGINT",async()=>await cleanup("SIGINT")),process.on("SIGHUP",async()=>await cleanup("SIGHUP")),!devServer.devCommand){let outputDir=join9(cwd,import_write_build_result.OUTPUT_DIR);await import_fs_extra2.default.pathExists(outputDir)&&(output_manager_default.log(`Removing ${import_write_build_result.OUTPUT_DIR}`),await import_fs_extra2.default.remove(outputDir))}try{await devServer.start(...listen2)}catch(err){throw clearTimeout(timeout),controller.abort(),lockAcquired&&releaseDevLock(cwd),err}if(!tunnel)return;let target=devServer.devCommandOrigin;if(!target)return output_manager_default.fatal(`${getCommandName("dev --tunnel")} requires a Development Command on the project.`),await shutdown(),1;try{let code=await runTunnel(client,tunnel,target,controller.signal,()=>routes,started=>{runningTunnel=started,tunnelUrl=started.url,applyRoutes()});return await shutdown(),code}catch(err){throw await shutdown(),err}}var TUNNEL_RETRY_DELAYS_MS=[1e3,2e3,5e3,1e4,3e4];function wait(ms9,signal){return new Promise(resolve3=>{let done=()=>{clearTimeout(timer),signal.removeEventListener("abort",done),resolve3()},timer=setTimeout(done,ms9);signal.addEventListener("abort",done,{once:!0})})}function announceTunnel(url4){output_manager_default.print(`${import_chalk3.default.green(chars_default.tick)} Tunnel available at ${link_default(url4)}
72
+ `)}async function runTunnel(client,project,target,shuttingDown,routes,onStarted){let started=!1,attempt=0;for(;;){let tunnel;try{tunnel=await startTunnel({client,...project,target,routes:routes(),signal:shuttingDown,resumed:started})}catch(err){if(shuttingDown.aborted)return 0;if(!started){if(!(err instanceof TunnelError))throw err;return output_manager_default.fatal(formatTunnelError(err.message,err)),1}let delay=TUNNEL_RETRY_DELAYS_MS[Math.min(attempt++,TUNNEL_RETRY_DELAYS_MS.length-1)];if(output_manager_default.warning(formatTunnelError(`Couldn't bring the tunnel back.${err instanceof TunnelError?` ${err.message}`:""} Trying again in ${delay/1e3}s.`,err)),await wait(delay,shuttingDown),shuttingDown.aborted)return 0;continue}if(started=!0,attempt=0,shuttingDown.aborted)return tunnel.close(),0;announceTunnel(tunnel.url),onStarted(tunnel);let lost=await tunnel.done.then(()=>{},err=>err);if(lost instanceof TunnelReplacedError){output_manager_default.print(` The tunnel was replaced, so its proxy is deploying again
73
+ `),tunnel.close();continue}return lost===void 0?0:(output_manager_default.fatal(formatTunnelError(`${lost instanceof TunnelError?lost.message:"Lost the tunnel."} Stopped the dev server.`,lost)),1)}}var import_error_utils3=__toESM(require_dist(),1);var DevTelemetryClient=class extends TelemetryClient{trackCliArgumentDir(dir){dir&&this.trackCliArgument({arg:"dir",value:this.redactedValue})}trackCliOptionListen(uri){uri&&this.trackCliOption({option:"listen",value:this.redactedValue})}trackCliOptionPort(port){port&&this.trackCliOption({option:"port",value:this.redactedValue})}trackCliOptionQueuePort(port){port&&this.trackCliOption({option:"queue-port",value:this.redactedValue})}trackCliOptionRuntimeCachePort(port){port&&this.trackCliOption({option:"runtime-cache-port",value:this.redactedValue})}trackCliOptionSchedulesPort(port){port&&this.trackCliOption({option:"schedules-port",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagTunnel(tunnel){tunnel&&this.trackCliFlag("tunnel")}trackCliFlagLocal(local){local&&this.trackCliFlag("local")}trackCliFlagConfirm(confirm){confirm&&this.trackCliFlag("confirm")}trackOidcTokenRefresh(count){super.trackOidcTokenRefresh(count)}trackError(code){code&&code!=="Diagnostic"&&this.trackErrorCode(code)}};var VERCEL_TEAM_SLUG="vercel";function isVercelianFromLoadedTeams(client){return client.teams?.some(team=>team.slug===VERCEL_TEAM_SLUG)===!0}async function isVercelian(client){if(isVercelianFromLoadedTeams(client))return!0;try{return(await getTeams(client)).some(team=>team.slug===VERCEL_TEAM_SLUG)}catch{return!1}}var COMMAND_CONFIG={dev:["dev"]};async function main(client){let{telemetryEventStore}=client,telemetry=new DevTelemetryClient({opts:{store:telemetryEventStore}}),reportError=createErrorReporter2(code=>telemetry.trackError(code));if(process.env.__VERCEL_DEV_RUNNING)return reportError(dev.DEV_RECURSIVE_INVOCATION()),1;process.env.__VERCEL_DEV_RUNNING="1";let parsedArgs=null,flagsSpecification=getFlagsSpecification(devCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error3){return printError(error3),2}if(parsedArgs.args[0]==="develop"&&warnDeprecatedSubcommand(client,"develop","dev"),telemetry.trackCliFlagConfirm(parsedArgs.flags["--confirm"]),telemetry.trackCliFlagLocal(parsedArgs.flags["--local"]),telemetry.trackCliFlagTunnel(parsedArgs.flags["--tunnel"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionPort(parsedArgs.flags["--port"]),telemetry.trackCliOptionListen(parsedArgs.flags["--listen"]),telemetry.trackCliOptionQueuePort(parsedArgs.flags["--queue-port"]),telemetry.trackCliOptionSchedulesPort(parsedArgs.flags["--schedules-port"]),telemetry.trackCliOptionRuntimeCachePort(parsedArgs.flags["--runtime-cache-port"]),telemetry.trackCliOptionProject(parsedArgs.flags["--project"]),parsedArgs.flags["--help"])return telemetry.trackCliFlagHelp("dev"),output_manager_default.print(help(devCommand,{columns:client.stderr.columns})),0;let args=getSubcommand(parsedArgs.args.slice(1),COMMAND_CONFIG).args;if("--confirm"in parsedArgs.flags&&(output_manager_default.warn("`--confirm` is deprecated, please use `--yes` instead"),parsedArgs.flags["--yes"]=parsedArgs.flags["--confirm"]),"--port"in parsedArgs.flags&&(output_manager_default.warn("`--port` is deprecated, please use `--listen` instead"),parsedArgs.flags["--listen"]=parsedArgs.flags["--port"]),parsedArgs.flags["--tunnel"]&&!await isVercelian(client))return output_manager_default.fatal(`${getCommandName("dev --tunnel")} isn't available on this account.`),1;let tunnelLabel=tunnelLabelArg(client.argv.slice(2));if(tunnelLabel!==void 0&&!isAliasLabel(tunnelLabel))return output_manager_default.fatal(`Can't use ${getCommandName(`dev --tunnel=${tunnelLabel}`)}. A tunnel's name is a DNS label.
74
+ Use lowercase letters, digits and hyphens, at most 63, starting and ending with a letter or digit.`),2;let[passedDir]=args;telemetry.trackCliArgumentDir(passedDir);let dir=passedDir||process.cwd(),vercelConfig=await readConfig(dir);if(vercelConfig instanceof Error)return reportError(vercelConfig),1;let hasBuilds=vercelConfig&&"builds"in vercelConfig&&vercelConfig.builds&&vercelConfig.builds.length>0;if(!vercelConfig||!hasBuilds){let pkg=await readJSONFile(path5.join(dir,"package.json"));if(pkg instanceof CantParseJSONFile)return reportError(pkg),1;if(/\b(now|vercel)\b\W+\bdev\b/.test(pkg?.scripts?.dev||""))return reportError(dev.DEV_RECURSIVE_INVOCATION()),1}if(parsedArgs.args.length>2)return output_manager_default.error(`${getCommandName("dev [dir]")} accepts at most one argument`),1;try{return await dev2(client,{...parsedArgs.flags,"--tunnel":tunnelLabel??parsedArgs.flags["--tunnel"]},args,telemetry,vercelConfig)}catch(err){if((err instanceof DevCommandExitError||err instanceof ServiceStartError)&&(reportError(err),process.exit(err instanceof DevCommandExitError?err.exitCode:1)),(0,import_error_utils3.isErrnoException)(err)&&err.code==="ENOTFOUND"){let matches=/getaddrinfo ENOTFOUND (.*)$/.exec(err.message||"");if(matches&&matches[1]){let hostname=matches[1];output_manager_default.error(`The hostname ${highlight(hostname)} could not be resolved. Please verify your internet connectivity and DNS configuration.`)}else reportError(err);return typeof err.stack=="string"&&output_manager_default.debug(err.stack),1}return reportError(err),output_manager_default.debug(stringifyError(err)),1}}function stringifyError(err){if(err instanceof NowError){let errMeta=JSON.stringify(err.meta,null,2).replace(/\\n/g,`
75
+ `);return`${import_chalk4.default.red(err.code)} ${err.message}
76
+ ${errMeta}`}return err.stack}function tunnelLabelArg(argv){let label;for(let arg of argv){if(arg==="--")break;arg.startsWith("--tunnel=")&&(label=arg.slice(9))}return label}export{main as default};
77
+ /*! Bundled license information:
78
+
79
+ http-proxy-node16/lib/http-proxy/passes/web-outgoing.js:
80
+ (*!
81
+ * Array of passes.
82
+ *
83
+ * A `pass` is just a function that is executed on `req, res, options`
84
+ * so that you can easily add new checks while still keeping the base
85
+ * flexible.
86
+ *)
87
+
88
+ http-proxy-node16/lib/http-proxy/passes/web-incoming.js:
89
+ (*!
90
+ * Array of passes.
91
+ *
92
+ * A `pass` is just a function that is executed on `req, res, options`
93
+ * so that you can easily add new checks while still keeping the base
94
+ * flexible.
95
+ *)
96
+
97
+ http-proxy-node16/lib/http-proxy/passes/ws-incoming.js:
98
+ (*!
99
+ * Array of passes.
100
+ *
101
+ * A `pass` is just a function that is executed on `req, socket, options`
102
+ * so that you can easily add new checks while still keeping the base
103
+ * flexible.
104
+ *)
105
+
106
+ http-proxy-node16/index.js:
107
+ (*!
108
+ * Caron dimonio, con occhi di bragia
109
+ * loro accennando, tutte le raccoglie;
110
+ * batte col remo qualunque s’adagia
111
+ *
112
+ * Charon the demon, with the eyes of glede,
113
+ * Beckoning to them, collects them all together,
114
+ * Beats with his oar whoever lags behind
115
+ *
116
+ * Dante - The Divine Comedy (Canto III)
117
+ *)
118
+
119
+ mime-db/index.js:
120
+ (*!
121
+ * mime-db
122
+ * Copyright(c) 2014 Jonathan Ong
123
+ * MIT Licensed
124
+ *)
125
+
126
+ mime-types/index.js:
127
+ (*!
128
+ * mime-types
129
+ * Copyright(c) 2014 Jonathan Ong
130
+ * Copyright(c) 2015 Douglas Christopher Wilson
131
+ * MIT Licensed
132
+ *)
133
+
134
+ content-disposition/index.js:
135
+ (*!
136
+ * content-disposition
137
+ * Copyright(c) 2014 Douglas Christopher Wilson
138
+ * MIT Licensed
139
+ *)
140
+
141
+ range-parser/index.js:
142
+ (*!
143
+ * range-parser
144
+ * Copyright(c) 2012-2014 TJ Holowaychuk
145
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
146
+ * MIT Licensed
147
+ *)
148
+
149
+ escape-html/index.js:
150
+ (*!
151
+ * escape-html
152
+ * Copyright(c) 2012-2013 TJ Holowaychuk
153
+ * Copyright(c) 2015 Andreas Lubbe
154
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
155
+ * MIT Licensed
156
+ *)
157
+ */