hyperframes 0.8.210 → 0.8.212

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 (255) hide show
  1. package/dist/{add-36M7YRR4.js → add-JSM7YBQX.js} +28 -24
  2. package/dist/{agentPromptGenerator-4NJ252MR.js → agentPromptGenerator-NTPYCKOI.js} +30 -1
  3. package/dist/{animatedGifPrep-RZLTC77F.js → animatedGifPrep-XTK7UWXF.js} +11 -10
  4. package/dist/api.js +26 -25
  5. package/dist/{appHistory-OHYU5ZBQ.js → appHistory-BCWH6XYH.js} +3 -3
  6. package/dist/{asset-HRGZ7ZCB.js → asset-SMY2EGPH.js} +11 -5
  7. package/dist/{assetCataloger-LN7RI2IC.js → assetCataloger-CVPWY34W.js} +12 -11
  8. package/dist/{audio-ULOHC2KL.js → audio-Y4OYLTWN.js} +37 -33
  9. package/dist/{auth-K4ZULHQY.js → auth-MDEHZR7R.js} +11 -6
  10. package/dist/{autoUpdate-MUJ4WPP6.js → autoUpdate-3FL6EDPM.js} +12 -5
  11. package/dist/{backgroundChecks-O6JST752.js → backgroundChecks-A6TG2BT3.js} +10 -5
  12. package/dist/backgroundChecksWorker.js +11 -5
  13. package/dist/{batchRender-U742UVOD.js → batchRender-K2PBRRTQ.js} +14 -9
  14. package/dist/{beats-2CSE5WJD.js → beats-RA6XK6J5.js} +25 -21
  15. package/dist/{benchmark-YJB2YKOE.js → benchmark-EHU5O4PP.js} +32 -27
  16. package/dist/{browser-WJ5E7RYS.js → browser-7RUIZT2H.js} +27 -22
  17. package/dist/{bundleWithLocalizedFonts-F5VQMFHZ.js → bundleWithLocalizedFonts-O2U2FYY2.js} +7 -3
  18. package/dist/{capture-6OJDKKEZ.js → capture-77KDKKNK.js} +25 -24
  19. package/dist/{capture-IYV3OS5W.js → capture-JGYBORAG.js} +19 -14
  20. package/dist/{captureCompositionFrame-7357PUMG.js → captureCompositionFrame-DZ7EHPZV.js} +23 -18
  21. package/dist/{catalog-CZBK33QH.js → catalog-CUP3SYAI.js} +43 -39
  22. package/dist/{catch-up-7IJQ7AUR.js → catch-up-ZGUCWH5Q.js} +21 -17
  23. package/dist/{check-ISUFX4DK.js → check-ITGFVBT6.js} +60 -56
  24. package/dist/{checkAudio-GAA2SY5E.js → checkAudio-CTLPD6YT.js} +19 -15
  25. package/dist/{checkBrowser-JRADOMED.js → checkBrowser-G2N4JI6N.js} +52 -48
  26. package/dist/{chunk-J7A73K2B.js → chunk-24F7TOW2.js} +99 -44
  27. package/dist/{chunk-W3V5EOFA.js → chunk-25MKZTRT.js} +1 -1
  28. package/dist/chunk-26AQTUU4.js +1103 -0
  29. package/dist/{chunk-ZTZA4UWZ.js → chunk-2GICKZ3I.js} +4 -1
  30. package/dist/{chunk-U7CZBDMV.js → chunk-2P5DTXUN.js} +1 -1
  31. package/dist/{chunk-7BOGLQFM.js → chunk-2YDIEZSF.js} +4 -4
  32. package/dist/{chunk-UIOZIIB7.js → chunk-32NEJ553.js} +1 -73
  33. package/dist/{chunk-DHTWYTSV.js → chunk-3JQ2YOKL.js} +2 -2
  34. package/dist/{chunk-BKXC5XHB.js → chunk-3YBXKWAF.js} +1 -1
  35. package/dist/{chunk-5IWRGVAX.js → chunk-45JN2GIZ.js} +2 -2
  36. package/dist/chunk-5766TK7Q.js +145 -0
  37. package/dist/{chunk-MMJAHBH2.js → chunk-5SKC4G26.js} +4 -1
  38. package/dist/{chunk-MNNK7RV5.js → chunk-5SWWIT7K.js} +2 -1
  39. package/dist/{chunk-FCIO4WSW.js → chunk-5TQ4AEPF.js} +3 -3
  40. package/dist/{chunk-KCLBO65Y.js → chunk-5YPMCCCA.js} +1 -1
  41. package/dist/{chunk-K2FLNJVB.js → chunk-5ZBMHUY2.js} +5 -1
  42. package/dist/{chunk-NEKKA2DA.js → chunk-64XQS7AP.js} +2 -2
  43. package/dist/chunk-6LDHXB4Z.js +36 -0
  44. package/dist/{chunk-FCXEVKFQ.js → chunk-6SG3RRAQ.js} +4 -4
  45. package/dist/{chunk-JLCAHJUO.js → chunk-6ZLDIMPL.js} +2 -2
  46. package/dist/{chunk-DGECWPTL.js → chunk-7KBS6ZLB.js} +2 -2
  47. package/dist/chunk-7KDQAD2W.js +81 -0
  48. package/dist/{chunk-AZGVCQGO.js → chunk-7Q5TBUC2.js} +2 -2
  49. package/dist/{chunk-JHNBF2HD.js → chunk-7TWX4Y7I.js} +4 -4
  50. package/dist/{chunk-ZRSQNF4A.js → chunk-7W7ANGR4.js} +55 -40
  51. package/dist/{chunk-WOFTAZSZ.js → chunk-7ZAVTGGT.js} +12 -11
  52. package/dist/{chunk-BYZPLQSX.js → chunk-A2WPZE2R.js} +1 -1
  53. package/dist/{chunk-NQ2INEHX.js → chunk-A4ZTSQLW.js} +1 -1
  54. package/dist/{chunk-ERVBXEPZ.js → chunk-AJAXP4HF.js} +10 -6
  55. package/dist/{chunk-PCPMSUW6.js → chunk-BLVHVXRU.js} +3 -3
  56. package/dist/{chunk-5ZJGEQGS.js → chunk-BYRXSKIY.js} +2 -2
  57. package/dist/{chunk-AF3L5JJX.js → chunk-CCLBOLYU.js} +1 -1
  58. package/dist/{chunk-4A27M7CJ.js → chunk-CODPTVC2.js} +1 -1
  59. package/dist/{chunk-VQB7G5BM.js → chunk-CTZJSMGU.js} +1 -1
  60. package/dist/chunk-DL4OD7IA.js +21 -0
  61. package/dist/{chunk-JVBRJMOP.js → chunk-DP5LF7GF.js} +8 -2
  62. package/dist/{chunk-EVTBRL37.js → chunk-DS7ANFBV.js} +5 -5
  63. package/dist/{chunk-35HSGF46.js → chunk-DVVTBVKA.js} +11 -16
  64. package/dist/{chunk-6CSYCFQV.js → chunk-DW35FX4I.js} +1 -1
  65. package/dist/{chunk-WWQJYYAB.js → chunk-DXPC7Z6L.js} +4 -4
  66. package/dist/{chunk-X2T5EOI7.js → chunk-EC77ZBCP.js} +5 -5
  67. package/dist/{chunk-VWG7OQKU.js → chunk-EQGKUPBJ.js} +4 -1
  68. package/dist/{chunk-IMKBZEGT.js → chunk-F5XADOGC.js} +2 -2
  69. package/dist/chunk-FJ646TIT.js +201 -0
  70. package/dist/{chunk-GDZA4ALG.js → chunk-FKFGGAXN.js} +52 -7
  71. package/dist/{chunk-2R5ZKWSV.js → chunk-FLXZ4GZI.js} +1 -1
  72. package/dist/{chunk-FHIBBIEZ.js → chunk-FW6CYA5D.js} +3 -3
  73. package/dist/{chunk-QXUFQSSK.js → chunk-G6HUXX3L.js} +1 -1
  74. package/dist/{chunk-5YHQBCWH.js → chunk-G6OKQMJI.js} +12 -2
  75. package/dist/{chunk-QSFWGZG6.js → chunk-G7VEYUZ2.js} +16 -132
  76. package/dist/{chunk-KGG2PUZN.js → chunk-GQ724553.js} +5 -5
  77. package/dist/{chunk-F7IWJMIO.js → chunk-GVE6I5EL.js} +6 -6
  78. package/dist/{chunk-66LREXGS.js → chunk-HXZNCXQX.js} +1 -1
  79. package/dist/{chunk-WERLJGIC.js → chunk-J3RXEDR2.js} +17 -2
  80. package/dist/{chunk-DKJAK6JW.js → chunk-J7GPSY5N.js} +7 -7
  81. package/dist/{chunk-5PCT5DDF.js → chunk-JZNQQI5M.js} +5 -5
  82. package/dist/{chunk-3PTZ2TD4.js → chunk-KUXOAS4Z.js} +1 -1
  83. package/dist/{chunk-32BLIKEV.js → chunk-KZZWYIEB.js} +3 -3
  84. package/dist/{chunk-AHPGAESX.js → chunk-L72RQ45A.js} +1 -1
  85. package/dist/{chunk-FBIWJ3A4.js → chunk-MJCIAZSK.js} +3 -3
  86. package/dist/{chunk-BW5WYF4N.js → chunk-MX2GMAAW.js} +106 -62
  87. package/dist/{chunk-JLBJRJO6.js → chunk-N3J2MLXC.js} +3 -3
  88. package/dist/{chunk-KGAPL42S.js → chunk-N7XJHZ35.js} +1 -1
  89. package/dist/{chunk-UA3YNZK6.js → chunk-NGSENR4J.js} +16 -6
  90. package/dist/{chunk-QIDN4ML5.js → chunk-NO6F7CLR.js} +1 -1
  91. package/dist/{chunk-EQPXSSNG.js → chunk-NXDKBFEO.js} +15 -15
  92. package/dist/{chunk-I3PNZDKR.js → chunk-OL5E4Y4L.js} +2226 -2081
  93. package/dist/{chunk-XNFDDVJS.js → chunk-ONMTNYGR.js} +4 -1
  94. package/dist/{chunk-P2L7NNHT.js → chunk-ORJY6Z6G.js} +3 -3
  95. package/dist/{chunk-GKNTPIFD.js → chunk-OSCWTA2O.js} +10 -10
  96. package/dist/{chunk-ZA5TNF4R.js → chunk-OWV36OJP.js} +5 -2
  97. package/dist/{chunk-YBY2WVLC.js → chunk-P2VGMOX7.js} +5 -5
  98. package/dist/{chunk-QPX7FJP3.js → chunk-PW7FCVHR.js} +1 -1
  99. package/dist/{chunk-RUW65P3N.js → chunk-Q55JNFDV.js} +3 -3
  100. package/dist/{chunk-GNESG4XA.js → chunk-QUXWS5UG.js} +3 -3
  101. package/dist/{chunk-I4H5JWND.js → chunk-R5B6GXQM.js} +1 -1
  102. package/dist/{chunk-TGFDRZTM.js → chunk-RDZKBIEB.js} +5 -5
  103. package/dist/{chunk-OMLVCHNN.js → chunk-RJILJ4OR.js} +3 -3
  104. package/dist/{chunk-36EOFTVG.js → chunk-RQC4PHO3.js} +1 -1
  105. package/dist/{chunk-RIJHDTM5.js → chunk-S2HWGG5O.js} +1 -1
  106. package/dist/chunk-SJGE5I5F.js +131 -0
  107. package/dist/{chunk-A45HCDG7.js → chunk-SPDSRBIN.js} +31 -5
  108. package/dist/{chunk-HKCIRH26.js → chunk-SXTWQ7CH.js} +5 -5
  109. package/dist/{chunk-K4FVGVA6.js → chunk-T2WJO4XM.js} +1 -1
  110. package/dist/{chunk-EYGWMHXV.js → chunk-T7KNW7PE.js} +4 -4
  111. package/dist/{chunk-DROFHVQD.js → chunk-TPO32Z65.js} +4 -4
  112. package/dist/{chunk-P327BIJR.js → chunk-U46JEU26.js} +1 -1
  113. package/dist/{chunk-HP7BXJFZ.js → chunk-UBUKKTNW.js} +2 -2
  114. package/dist/{chunk-TDEORHFN.js → chunk-UE4CXHMF.js} +7 -7
  115. package/dist/{chunk-BN22WCAF.js → chunk-UULZKCBI.js} +2 -2
  116. package/dist/{chunk-AG566TRI.js → chunk-UXH6E5HC.js} +2 -2
  117. package/dist/{chunk-W4E3ZOWH.js → chunk-V6OSE6VT.js} +2 -2
  118. package/dist/{chunk-DST7GU2Y.js → chunk-VKD23SIO.js} +1 -1
  119. package/dist/{chunk-57QUPSP2.js → chunk-VVDHSRKD.js} +1 -1
  120. package/dist/{chunk-QI5TLQNW.js → chunk-W2VJTKIW.js} +17 -20
  121. package/dist/{chunk-HD4KXG5U.js → chunk-W55BW7KA.js} +15 -14
  122. package/dist/chunk-W5OBRMZ6.js +4870 -0
  123. package/dist/{chunk-ERUQ3S6D.js → chunk-WE42NVH7.js} +6 -1
  124. package/dist/{chunk-QRWTVCGH.js → chunk-WVIH5BBZ.js} +30 -23
  125. package/dist/{chunk-SE2MXV2N.js → chunk-X4SBDDLS.js} +2 -1
  126. package/dist/{chunk-A2H5EJZM.js → chunk-XEWMJWNW.js} +2 -2
  127. package/dist/{chunk-LRE4GDFA.js → chunk-XGXTZNES.js} +4 -4
  128. package/dist/{chunk-YIFEK3UD.js → chunk-XQ26I3PL.js} +1 -1
  129. package/dist/{chunk-UWEGMKKU.js → chunk-Y3U7ECBH.js} +1 -1
  130. package/dist/{chunk-MV3J6ZOP.js → chunk-YACECUHX.js} +9 -9
  131. package/dist/{chunk-MA447PNF.js → chunk-YVT5IU6J.js} +22 -23
  132. package/dist/{chunk-XCIHCPJK.js → chunk-YWRUQ7XZ.js} +3 -2
  133. package/dist/{chunk-XIUHHEBS.js → chunk-YX5ELTKV.js} +3 -3
  134. package/dist/{chunk-P6EXMN5D.js → chunk-ZCHULPJZ.js} +3 -3
  135. package/dist/{chunk-QFXF5GXE.js → chunk-ZCYSQ3NQ.js} +3 -3
  136. package/dist/{chunk-RIAWW4G2.js → chunk-ZE57TSS6.js} +2 -2
  137. package/dist/{clean-NVBEXXIS.js → clean-FBZ7GHRY.js} +39 -35
  138. package/dist/cli.js +161 -80
  139. package/dist/{cloud-3T6HF7DT.js → cloud-VYSWJ7UO.js} +11 -6
  140. package/dist/{cloudrun-TXEEZGJ7.js → cloudrun-U6LI7KLV.js} +39 -30
  141. package/dist/{colors-HKWSZCGK.js → colors-HRL7QSVG.js} +5 -1
  142. package/dist/commands/layout-audit.browser.js +1 -1
  143. package/dist/commands/motion-signature.browser.js +11 -2
  144. package/dist/{compare-Q42Z56P7.js → compare-YR7BMEHJ.js} +63 -61
  145. package/dist/{compiler-IL2PZJFH.js → compiler-6YCAUK7Z.js} +4 -4
  146. package/dist/{component-2IWQZYCZ.js → component-HVSM6FJV.js} +13 -7
  147. package/dist/{compositions-3EZ3GBK2.js → compositions-QTFL2VNL.js} +27 -23
  148. package/dist/{delete-2UBY2JTM.js → delete-2FHCQ72T.js} +28 -20
  149. package/dist/{deploy-QTS2OM2H.js → deploy-6S45QWG6.js} +11 -7
  150. package/dist/{destroy-CGAZIL2C.js → destroy-BQ5R7LUF.js} +8 -4
  151. package/dist/{dist-XF53LCKD.js → dist-B4KLCLZ5.js} +3 -3
  152. package/dist/{dist-73YTUT3W.js → dist-NCI6JOJZ.js} +2 -2
  153. package/dist/{docs-UEWLIP6D.js → docs-6EM6FDNI.js} +12 -6
  154. package/dist/{doctor-FIXMXWE6.js → doctor-4MRS6RED.js} +25 -20
  155. package/dist/{events-7WYSDXTE.js → events-4VBBY7PP.js} +15 -10
  156. package/dist/{events-NTZSSMBR.js → events-FN45HVPM.js} +14 -11
  157. package/dist/{feedback-7SOB5GZC.js → feedback-T67P2CDA.js} +41 -35
  158. package/dist/{ffmpeg-PYY5FSIX.js → ffmpeg-ED7ZK6XH.js} +12 -11
  159. package/dist/{figma-DTWA3G22.js → figma-UXAWKPOY.js} +10 -5
  160. package/dist/fontLocalizeCli.js +16 -14
  161. package/dist/{get-DMGUJPLP.js → get-EFH3PPJA.js} +20 -15
  162. package/dist/{gpuPolicy-KVYO4OU4.js → gpuPolicy-ZADQMXQT.js} +11 -10
  163. package/dist/{grade-compare-NCYPJFLI.js → grade-compare-425BFHSF.js} +65 -60
  164. package/dist/hangReport.js +1 -0
  165. package/dist/{heifImagePrep-F7LFUYGC.js → heifImagePrep-ZJM7N2XY.js} +12 -11
  166. package/dist/{help-I4RRBHCW.js → help-23PPB2BD.js} +16 -8
  167. package/dist/{history-GVBBXZKQ.js → history-CHJV33M5.js} +28 -22
  168. package/dist/hyperframe.manifest.json +1 -1
  169. package/dist/hyperframe.runtime.iife.js +64 -64
  170. package/dist/hyperframes-player.global.js +1 -1
  171. package/dist/{info-UE2PY5AF.js → info-36YPISVA.js} +22 -18
  172. package/dist/{init-4UGFGJQK.js → init-U6EE2EIU.js} +73 -65
  173. package/dist/{inspect-ZRREAUCB.js → inspect-NI2RMUFR.js} +50 -46
  174. package/dist/{installer-ABXPRFIJ.js → installer-K3HIZ5CF.js} +7 -7
  175. package/dist/{keyframes-MFR4TYVR.js → keyframes-I6T2IT6I.js} +20 -16
  176. package/dist/{lambda-E3Z6JCIB.js → lambda-WL64Z2F3.js} +50 -42
  177. package/dist/{layout-IO7T5SSU.js → layout-R2YZ4N6P.js} +50 -46
  178. package/dist/{lint-WYPQK5XA.js → lint-IAAG6Z65.js} +30 -24
  179. package/dist/{lintProject-KCN7MRBN.js → lintProject-EM7Y2ZRB.js} +2 -2
  180. package/dist/{list-7F2LXWOZ.js → list-3O6743DJ.js} +23 -18
  181. package/dist/{live-LAHBXVK2.js → live-WWPFZQ74.js} +33 -7
  182. package/dist/localPage-L5FRBCNP.js +56 -0
  183. package/dist/{login-TTMYCXN2.js → login-27TRFTYB.js} +17 -13
  184. package/dist/{logout-QRSB4CNH.js → logout-C6P6ERZ3.js} +12 -7
  185. package/dist/{manager-OQ5J26ST.js → manager-D6TE4ENP.js} +14 -13
  186. package/dist/{manager-LQXZTUTJ.js → manager-IZIK7BHN.js} +7 -5
  187. package/dist/{media-treatment-ELB6WRA5.js → media-treatment-E3YLZVXC.js} +58 -45
  188. package/dist/{media-use-JBN57JE3.js → media-use-ZRHFRO46.js} +3 -2
  189. package/dist/{models-D2FNIGNZ.js → models-2Q3TGNH5.js} +40 -28
  190. package/dist/{motionShot-53VDDRIC.js → motionShot-XYW2HMVI.js} +27 -22
  191. package/dist/{normalize-audio-QHNCFWR2.js → normalize-audio-D5WNUNDM.js} +42 -28
  192. package/dist/{open-3KMTT3AV.js → open-3KO7UUPC.js} +33 -29
  193. package/dist/{parakeetRunner-T65S6FW3.js → parakeetRunner-WX6L6MW5.js} +20 -19
  194. package/dist/{pipeline-DUVRZGIM.js → pipeline-WYIO4KGN.js} +17 -16
  195. package/dist/{play-27R6RBSK.js → play-ZM3ZUJSZ.js} +53 -52
  196. package/dist/{policies-NWIEUGGW.js → policies-J5BWAZHM.js} +18 -12
  197. package/dist/{preflight-QB6NKBBL.js → preflight-7OMCIXNM.js} +16 -14
  198. package/dist/{present-RHV3FKI5.js → present-E2PLH2GJ.js} +47 -46
  199. package/dist/{preview-IAKIXYLN.js → preview-TVRM75FN.js} +52 -48
  200. package/dist/{producer-F6PHB4M4.js → producer-M5F6KZEF.js} +1 -1
  201. package/dist/{progress-PX3PVAIM.js → progress-X3QFO3FE.js} +9 -5
  202. package/dist/{projectConfig-MPHWYY5D.js → projectConfig-VFKGY3XE.js} +11 -11
  203. package/dist/prompts-VAO7RDKX.js +40 -0
  204. package/dist/{publication-CBAEINEG.js → publication-AF33R7LF.js} +5 -5
  205. package/dist/{publish-4A2A6V7Z.js → publish-Z7HGDQ5R.js} +41 -30
  206. package/dist/{refresh-F7FUCXLX.js → refresh-IYRGLHG5.js} +12 -7
  207. package/dist/{remove-background-3I7RZGVG.js → remove-background-PN3KCBT4.js} +39 -30
  208. package/dist/{render-BSKLHCZ4.js → render-I3HBIJX3.js} +82 -77
  209. package/dist/{render-BGPUHBFC.js → render-IZNPEXMU.js} +17 -12
  210. package/dist/{render-2HYATL32.js → render-SEODWRRR.js} +46 -41
  211. package/dist/{render-batch-JD6C3BDD.js → render-batch-MQSORY55.js} +18 -13
  212. package/dist/renderSetupWorker.js +10 -7
  213. package/dist/{resolver-SQYR7LII.js → resolver-HXE4F2G4.js} +7 -7
  214. package/dist/{sam-FHJ7IL7T.js → sam-QA7JT7IM.js} +2 -1
  215. package/dist/{sherpa-VXD3DAH4.js → sherpa-NPT6S3RP.js} +19 -18
  216. package/dist/sherpaWorker.js +1 -0
  217. package/dist/{sites-Q2S3DZY4.js → sites-MTLVMYJ6.js} +7 -3
  218. package/dist/{skills-B2SHEHWL.js → skills-P3BI55YP.js} +27 -20
  219. package/dist/{skillsUpdateCheck-ST43UUPK.js → skillsUpdateCheck-43Q4ZHWN.js} +10 -5
  220. package/dist/{snapshot-USJYNKDM.js → snapshot-YLT64YQS.js} +93 -71
  221. package/dist/{src-5OX35WPG.js → src-7S7K4QUN.js} +14 -13
  222. package/dist/{src-PX3VIS7K.js → src-OHJ7USRX.js} +20 -9
  223. package/dist/{state-JPNCCXAV.js → state-6QHNNHDA.js} +2 -2
  224. package/dist/{staticProjectServer-ET7H5LMV.js → staticProjectServer-RP3MW2EW.js} +31 -24
  225. package/dist/{status-QVDRHXW2.js → status-SLILCDBZ.js} +21 -12
  226. package/dist/studio/assets/{hyperframes-player-DUpxahTX.js → hyperframes-player-DHfuW7Lt.js} +1 -1
  227. package/dist/studio/assets/{index-CtrcjpbM.js → index-CWgIsKzV.js} +123 -123
  228. package/dist/studio/assets/{index-B4dcZZAm.js → index-CkjUY33q.js} +1 -1
  229. package/dist/studio/index.html +1 -1
  230. package/dist/{studio-api-PLKYSG2X.js → studio-api-BZPZCJL6.js} +17 -15
  231. package/dist/{studioServer-CNUXGRFS.js → studioServer-QLRIXNYM.js} +74 -70
  232. package/dist/{synthesize-RVE7IUOJ.js → synthesize-FQML2LN2.js} +5 -5
  233. package/dist/{system-YD4AW5ZX.js → system-MVRF5UM2.js} +5 -3
  234. package/dist/{telemetry-EJS5PXH2.js → telemetry-NTO4FJFN.js} +13 -8
  235. package/dist/{telemetry-DGDEJLGL.js → telemetry-QOBPRUWF.js} +14 -11
  236. package/dist/templates/blank/index.html +1 -1
  237. package/dist/{timeline-VCQC4TLM.js → timeline-OLQFVWVU.js} +47 -40
  238. package/dist/{tokens-AEOBCDW5.js → tokens-BAHLVGEC.js} +12 -6
  239. package/dist/{transcribe-COFCB3ZB.js → transcribe-3NHUWW4J.js} +45 -39
  240. package/dist/{transcribe-X6O5ZSGQ.js → transcribe-HR6BFDUR.js} +16 -15
  241. package/dist/{tts-AGMCPQXE.js → tts-K5HRN6NQ.js} +26 -17
  242. package/dist/{updateCheck-BW7MDUXZ.js → updateCheck-BGHPCA7J.js} +9 -4
  243. package/dist/{upgrade-QXOGA54H.js → upgrade-NFI6JOME.js} +28 -14
  244. package/dist/{urlDownloader-QB3TBIQ5.js → urlDownloader-P35K74RS.js} +10 -9
  245. package/dist/{usage-HG4WMM7A.js → usage-772JV45U.js} +2 -1
  246. package/dist/{validate-AU2BZ7D7.js → validate-Q57ZCI4Q.js} +42 -38
  247. package/dist/{video-GNNYAL5T.js → video-OO2M2AKD.js} +19 -15
  248. package/dist/warmCheck.js +63 -58
  249. package/dist/warmCheckClient.js +1 -0
  250. package/package.json +1 -1
  251. package/dist/chunk-QRC7IVBC.js +0 -4870
  252. package/dist/chunk-WMQNIQDJ.js +0 -2057
  253. package/dist/chunk-WQ6ZXHFQ.js +0 -133
  254. package/dist/dist-EWXJGN63.js +0 -129
  255. package/dist/localPage-V3HBGM3Z.js +0 -27
@@ -1,2057 +0,0 @@
1
- import { createRequire as __hf_createRequire } from "node:module";
2
- import { fileURLToPath as __hf_fileURLToPath } from "node:url";
3
- import { dirname as __hf_dirname } from "node:path";
4
- var require = __hf_createRequire(import.meta.url);
5
- var __filename = __hf_fileURLToPath(import.meta.url);
6
- var __dirname = __hf_dirname(__filename);
7
- import {
8
- __commonJS,
9
- __toESM
10
- } from "./chunk-M2WBOQ2Q.js";
11
-
12
- // ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
13
- var require_src = __commonJS({
14
- "../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
15
- "use strict";
16
- var ESC2 = "\x1B";
17
- var CSI2 = `${ESC2}[`;
18
- var beep = "\x07";
19
- var cursor = {
20
- to(x2, y) {
21
- if (!y) return `${CSI2}${x2 + 1}G`;
22
- return `${CSI2}${y + 1};${x2 + 1}H`;
23
- },
24
- move(x2, y) {
25
- let ret = "";
26
- if (x2 < 0) ret += `${CSI2}${-x2}D`;
27
- else if (x2 > 0) ret += `${CSI2}${x2}C`;
28
- if (y < 0) ret += `${CSI2}${-y}A`;
29
- else if (y > 0) ret += `${CSI2}${y}B`;
30
- return ret;
31
- },
32
- up: (count = 1) => `${CSI2}${count}A`,
33
- down: (count = 1) => `${CSI2}${count}B`,
34
- forward: (count = 1) => `${CSI2}${count}C`,
35
- backward: (count = 1) => `${CSI2}${count}D`,
36
- nextLine: (count = 1) => `${CSI2}E`.repeat(count),
37
- prevLine: (count = 1) => `${CSI2}F`.repeat(count),
38
- left: `${CSI2}G`,
39
- hide: `${CSI2}?25l`,
40
- show: `${CSI2}?25h`,
41
- save: `${ESC2}7`,
42
- restore: `${ESC2}8`
43
- };
44
- var scroll = {
45
- up: (count = 1) => `${CSI2}S`.repeat(count),
46
- down: (count = 1) => `${CSI2}T`.repeat(count)
47
- };
48
- var erase = {
49
- screen: `${CSI2}2J`,
50
- up: (count = 1) => `${CSI2}1J`.repeat(count),
51
- down: (count = 1) => `${CSI2}J`.repeat(count),
52
- line: `${CSI2}2K`,
53
- lineEnd: `${CSI2}K`,
54
- lineStart: `${CSI2}1K`,
55
- lines(count) {
56
- let clear = "";
57
- for (let i = 0; i < count; i++)
58
- clear += this.line + (i < count - 1 ? cursor.up() : "");
59
- if (count)
60
- clear += cursor.left;
61
- return clear;
62
- }
63
- };
64
- module.exports = { cursor, scroll, erase, beep };
65
- }
66
- });
67
-
68
- // ../../node_modules/.bun/@clack+core@1.3.0/node_modules/@clack/core/dist/index.mjs
69
- import { styleText as v } from "util";
70
- import { stdout as S, stdin as D } from "process";
71
- import * as b from "readline";
72
- import E from "readline";
73
-
74
- // ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
75
- var getCodePointsLength = /* @__PURE__ */ (() => {
76
- const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
77
- return (input) => {
78
- let surrogatePairsNr = 0;
79
- SURROGATE_PAIR_RE.lastIndex = 0;
80
- while (SURROGATE_PAIR_RE.test(input)) {
81
- surrogatePairsNr += 1;
82
- }
83
- return input.length - surrogatePairsNr;
84
- };
85
- })();
86
- var isFullWidth = (x2) => {
87
- return x2 === 12288 || x2 >= 65281 && x2 <= 65376 || x2 >= 65504 && x2 <= 65510;
88
- };
89
- var isWideNotCJKTNotEmoji = (x2) => {
90
- return x2 === 8987 || x2 === 9001 || x2 >= 12272 && x2 <= 12287 || x2 >= 12289 && x2 <= 12350 || x2 >= 12441 && x2 <= 12543 || x2 >= 12549 && x2 <= 12591 || x2 >= 12593 && x2 <= 12686 || x2 >= 12688 && x2 <= 12771 || x2 >= 12783 && x2 <= 12830 || x2 >= 12832 && x2 <= 12871 || x2 >= 12880 && x2 <= 19903 || x2 >= 65040 && x2 <= 65049 || x2 >= 65072 && x2 <= 65106 || x2 >= 65108 && x2 <= 65126 || x2 >= 65128 && x2 <= 65131 || x2 >= 127488 && x2 <= 127490 || x2 >= 127504 && x2 <= 127547 || x2 >= 127552 && x2 <= 127560 || x2 >= 131072 && x2 <= 196605 || x2 >= 196608 && x2 <= 262141;
91
- };
92
-
93
- // ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
94
- var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
95
- var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
96
- var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
97
- var TAB_RE = /\t{1,1000}/y;
98
- var EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
99
- var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
100
- var MODIFIER_RE = new RegExp("\\p{M}+", "gu");
101
- var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
102
- var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
103
- const LIMIT = truncationOptions.limit ?? Infinity;
104
- const ELLIPSIS = truncationOptions.ellipsis ?? "";
105
- const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
106
- const ANSI_WIDTH = 0;
107
- const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
108
- const TAB_WIDTH = widthOptions.tabWidth ?? 8;
109
- const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
110
- const FULL_WIDTH_WIDTH = 2;
111
- const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
112
- const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
113
- const PARSE_BLOCKS = [
114
- [LATIN_RE, REGULAR_WIDTH],
115
- [ANSI_RE, ANSI_WIDTH],
116
- [CONTROL_RE, CONTROL_WIDTH],
117
- [TAB_RE, TAB_WIDTH],
118
- [EMOJI_RE, EMOJI_WIDTH],
119
- [CJKT_WIDE_RE, WIDE_WIDTH]
120
- ];
121
- let indexPrev = 0;
122
- let index = 0;
123
- let length = input.length;
124
- let lengthExtra = 0;
125
- let truncationEnabled = false;
126
- let truncationIndex = length;
127
- let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
128
- let unmatchedStart = 0;
129
- let unmatchedEnd = 0;
130
- let width = 0;
131
- let widthExtra = 0;
132
- outer: while (true) {
133
- if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
134
- const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
135
- lengthExtra = 0;
136
- for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
137
- const codePoint = char.codePointAt(0) || 0;
138
- if (isFullWidth(codePoint)) {
139
- widthExtra = FULL_WIDTH_WIDTH;
140
- } else if (isWideNotCJKTNotEmoji(codePoint)) {
141
- widthExtra = WIDE_WIDTH;
142
- } else {
143
- widthExtra = REGULAR_WIDTH;
144
- }
145
- if (width + widthExtra > truncationLimit) {
146
- truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
147
- }
148
- if (width + widthExtra > LIMIT) {
149
- truncationEnabled = true;
150
- break outer;
151
- }
152
- lengthExtra += char.length;
153
- width += widthExtra;
154
- }
155
- unmatchedStart = unmatchedEnd = 0;
156
- }
157
- if (index >= length) {
158
- break outer;
159
- }
160
- for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
161
- const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
162
- BLOCK_RE.lastIndex = index;
163
- if (BLOCK_RE.test(input)) {
164
- lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
165
- widthExtra = lengthExtra * BLOCK_WIDTH;
166
- if (width + widthExtra > truncationLimit) {
167
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
168
- }
169
- if (width + widthExtra > LIMIT) {
170
- truncationEnabled = true;
171
- break outer;
172
- }
173
- width += widthExtra;
174
- unmatchedStart = indexPrev;
175
- unmatchedEnd = index;
176
- index = indexPrev = BLOCK_RE.lastIndex;
177
- continue outer;
178
- }
179
- }
180
- index += 1;
181
- }
182
- return {
183
- width: truncationEnabled ? truncationLimit : width,
184
- index: truncationEnabled ? truncationIndex : length,
185
- truncated: truncationEnabled,
186
- ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
187
- };
188
- };
189
- var dist_default = getStringTruncatedWidth;
190
-
191
- // ../../node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
192
- var NO_TRUNCATION2 = {
193
- limit: Infinity,
194
- ellipsis: "",
195
- ellipsisWidth: 0
196
- };
197
- var fastStringWidth = (input, options = {}) => {
198
- return dist_default(input, NO_TRUNCATION2, options).width;
199
- };
200
- var dist_default2 = fastStringWidth;
201
-
202
- // ../../node_modules/.bun/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
203
- var ESC = "\x1B";
204
- var CSI = "\x9B";
205
- var END_CODE = 39;
206
- var ANSI_ESCAPE_BELL = "\x07";
207
- var ANSI_CSI = "[";
208
- var ANSI_OSC = "]";
209
- var ANSI_SGR_TERMINATOR = "m";
210
- var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
211
- var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
212
- var getClosingCode = (openingCode) => {
213
- if (openingCode >= 30 && openingCode <= 37)
214
- return 39;
215
- if (openingCode >= 90 && openingCode <= 97)
216
- return 39;
217
- if (openingCode >= 40 && openingCode <= 47)
218
- return 49;
219
- if (openingCode >= 100 && openingCode <= 107)
220
- return 49;
221
- if (openingCode === 1 || openingCode === 2)
222
- return 22;
223
- if (openingCode === 3)
224
- return 23;
225
- if (openingCode === 4)
226
- return 24;
227
- if (openingCode === 7)
228
- return 27;
229
- if (openingCode === 8)
230
- return 28;
231
- if (openingCode === 9)
232
- return 29;
233
- if (openingCode === 0)
234
- return 0;
235
- return void 0;
236
- };
237
- var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
238
- var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
239
- var wrapWord = (rows, word, columns) => {
240
- const characters = word[Symbol.iterator]();
241
- let isInsideEscape = false;
242
- let isInsideLinkEscape = false;
243
- let lastRow = rows.at(-1);
244
- let visible = lastRow === void 0 ? 0 : dist_default2(lastRow);
245
- let currentCharacter = characters.next();
246
- let nextCharacter = characters.next();
247
- let rawCharacterIndex = 0;
248
- while (!currentCharacter.done) {
249
- const character = currentCharacter.value;
250
- const characterLength = dist_default2(character);
251
- if (visible + characterLength <= columns) {
252
- rows[rows.length - 1] += character;
253
- } else {
254
- rows.push(character);
255
- visible = 0;
256
- }
257
- if (character === ESC || character === CSI) {
258
- isInsideEscape = true;
259
- isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
260
- }
261
- if (isInsideEscape) {
262
- if (isInsideLinkEscape) {
263
- if (character === ANSI_ESCAPE_BELL) {
264
- isInsideEscape = false;
265
- isInsideLinkEscape = false;
266
- }
267
- } else if (character === ANSI_SGR_TERMINATOR) {
268
- isInsideEscape = false;
269
- }
270
- } else {
271
- visible += characterLength;
272
- if (visible === columns && !nextCharacter.done) {
273
- rows.push("");
274
- visible = 0;
275
- }
276
- }
277
- currentCharacter = nextCharacter;
278
- nextCharacter = characters.next();
279
- rawCharacterIndex += character.length;
280
- }
281
- lastRow = rows.at(-1);
282
- if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
283
- rows[rows.length - 2] += rows.pop();
284
- }
285
- };
286
- var stringVisibleTrimSpacesRight = (string) => {
287
- const words = string.split(" ");
288
- let last = words.length;
289
- while (last) {
290
- if (dist_default2(words[last - 1])) {
291
- break;
292
- }
293
- last--;
294
- }
295
- if (last === words.length) {
296
- return string;
297
- }
298
- return words.slice(0, last).join(" ") + words.slice(last).join("");
299
- };
300
- var exec = (string, columns, options = {}) => {
301
- if (options.trim !== false && string.trim() === "") {
302
- return "";
303
- }
304
- let returnValue = "";
305
- let escapeCode;
306
- let escapeUrl;
307
- const words = string.split(" ");
308
- let rows = [""];
309
- let rowLength = 0;
310
- for (let index = 0; index < words.length; index++) {
311
- const word = words[index];
312
- if (options.trim !== false) {
313
- const row = rows.at(-1) ?? "";
314
- const trimmed = row.trimStart();
315
- if (row.length !== trimmed.length) {
316
- rows[rows.length - 1] = trimmed;
317
- rowLength = dist_default2(trimmed);
318
- }
319
- }
320
- if (index !== 0) {
321
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
322
- rows.push("");
323
- rowLength = 0;
324
- }
325
- if (rowLength || options.trim === false) {
326
- rows[rows.length - 1] += " ";
327
- rowLength++;
328
- }
329
- }
330
- const wordLength = dist_default2(word);
331
- if (options.hard && wordLength > columns) {
332
- const remainingColumns = columns - rowLength;
333
- const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
334
- const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
335
- if (breaksStartingNextLine < breaksStartingThisLine) {
336
- rows.push("");
337
- }
338
- wrapWord(rows, word, columns);
339
- rowLength = dist_default2(rows.at(-1) ?? "");
340
- continue;
341
- }
342
- if (rowLength + wordLength > columns && rowLength && wordLength) {
343
- if (options.wordWrap === false && rowLength < columns) {
344
- wrapWord(rows, word, columns);
345
- rowLength = dist_default2(rows.at(-1) ?? "");
346
- continue;
347
- }
348
- rows.push("");
349
- rowLength = 0;
350
- }
351
- if (rowLength + wordLength > columns && options.wordWrap === false) {
352
- wrapWord(rows, word, columns);
353
- rowLength = dist_default2(rows.at(-1) ?? "");
354
- continue;
355
- }
356
- rows[rows.length - 1] += word;
357
- rowLength += wordLength;
358
- }
359
- if (options.trim !== false) {
360
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
361
- }
362
- const preString = rows.join("\n");
363
- let inSurrogate = false;
364
- for (let i = 0; i < preString.length; i++) {
365
- const character = preString[i];
366
- returnValue += character;
367
- if (!inSurrogate) {
368
- inSurrogate = character >= "\uD800" && character <= "\uDBFF";
369
- if (inSurrogate) {
370
- continue;
371
- }
372
- } else {
373
- inSurrogate = false;
374
- }
375
- if (character === ESC || character === CSI) {
376
- GROUP_REGEX.lastIndex = i + 1;
377
- const groupsResult = GROUP_REGEX.exec(preString);
378
- const groups = groupsResult?.groups;
379
- if (groups?.code !== void 0) {
380
- const code = Number.parseFloat(groups.code);
381
- escapeCode = code === END_CODE ? void 0 : code;
382
- } else if (groups?.uri !== void 0) {
383
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
384
- }
385
- }
386
- if (preString[i + 1] === "\n") {
387
- if (escapeUrl) {
388
- returnValue += wrapAnsiHyperlink("");
389
- }
390
- const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
391
- if (escapeCode && closingCode) {
392
- returnValue += wrapAnsiCode(closingCode);
393
- }
394
- } else if (character === "\n") {
395
- if (escapeCode && getClosingCode(escapeCode)) {
396
- returnValue += wrapAnsiCode(escapeCode);
397
- }
398
- if (escapeUrl) {
399
- returnValue += wrapAnsiHyperlink(escapeUrl);
400
- }
401
- }
402
- }
403
- return returnValue;
404
- };
405
- var CRLF_OR_LF = /\r?\n/;
406
- function wrapAnsi(string, columns, options) {
407
- return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
408
- }
409
-
410
- // ../../node_modules/.bun/@clack+core@1.3.0/node_modules/@clack/core/dist/index.mjs
411
- var import_sisteransi = __toESM(require_src(), 1);
412
- import { ReadStream as O } from "tty";
413
- function d(r, t, s) {
414
- if (!s.some((o) => !o.disabled)) return r;
415
- const e2 = r + t, i = Math.max(s.length - 1, 0), n = e2 < 0 ? i : e2 > i ? 0 : e2;
416
- return s[n].disabled ? d(n, t < 0 ? -1 : 1, s) : n;
417
- }
418
- function I(r, t, s, e2) {
419
- const i = e2.split(`
420
- `);
421
- let n = 0, o = r;
422
- for (const a of i) {
423
- if (o <= a.length) break;
424
- o -= a.length + 1, n++;
425
- }
426
- for (n = Math.max(0, Math.min(i.length - 1, n + s)), o = Math.min(o, i[n].length) + t; o < 0 && n > 0; ) n--, o += i[n].length + 1;
427
- for (; o > i[n].length && n < i.length - 1; ) o -= i[n].length + 1, n++;
428
- o = Math.max(0, Math.min(i[n].length, o));
429
- let u = 0;
430
- for (let a = 0; a < n; a++) u += i[a].length + 1;
431
- return u + o;
432
- }
433
- var G = ["up", "down", "left", "right", "space", "enter", "cancel"];
434
- var K = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
435
- var h = { actions: new Set(G), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...K], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
436
- function j(r) {
437
- if (r.aliases !== void 0) {
438
- const t = r.aliases;
439
- for (const s in t) {
440
- if (!Object.hasOwn(t, s)) continue;
441
- const e2 = t[s];
442
- h.actions.has(e2) && (h.aliases.has(s) || h.aliases.set(s, e2));
443
- }
444
- }
445
- if (r.messages !== void 0) {
446
- const t = r.messages;
447
- t.cancel !== void 0 && (h.messages.cancel = t.cancel), t.error !== void 0 && (h.messages.error = t.error);
448
- }
449
- if (r.withGuide !== void 0 && (h.withGuide = r.withGuide !== false), r.date !== void 0) {
450
- const t = r.date;
451
- t.monthNames !== void 0 && (h.date.monthNames = [...t.monthNames]), t.messages !== void 0 && (t.messages.required !== void 0 && (h.date.messages.required = t.messages.required), t.messages.invalidMonth !== void 0 && (h.date.messages.invalidMonth = t.messages.invalidMonth), t.messages.invalidDay !== void 0 && (h.date.messages.invalidDay = t.messages.invalidDay), t.messages.afterMin !== void 0 && (h.date.messages.afterMin = t.messages.afterMin), t.messages.beforeMax !== void 0 && (h.date.messages.beforeMax = t.messages.beforeMax));
452
- }
453
- }
454
- function C(r, t) {
455
- if (typeof r == "string") return h.aliases.get(r) === t;
456
- for (const s of r) if (s !== void 0 && C(s, t)) return true;
457
- return false;
458
- }
459
- function z(r, t) {
460
- if (r === t) return;
461
- const s = r.split(`
462
- `), e2 = t.split(`
463
- `), i = Math.max(s.length, e2.length), n = [];
464
- for (let o = 0; o < i; o++) s[o] !== e2[o] && n.push(o);
465
- return { lines: n, numLinesBefore: s.length, numLinesAfter: e2.length, numLines: i };
466
- }
467
- var Y = globalThis.process.platform.startsWith("win");
468
- var k = /* @__PURE__ */ Symbol("clack:cancel");
469
- function q(r) {
470
- return r === k;
471
- }
472
- function w(r, t) {
473
- const s = r;
474
- s.isTTY && s.setRawMode(t);
475
- }
476
- function R({ input: r = D, output: t = S, overwrite: s = true, hideCursor: e2 = true } = {}) {
477
- const i = b.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
478
- b.emitKeypressEvents(r, i), r instanceof O && r.isTTY && r.setRawMode(true);
479
- const n = (o, { name: u, sequence: a }) => {
480
- const l = String(o);
481
- if (C([l, u, a], "cancel")) {
482
- e2 && t.write(import_sisteransi.cursor.show), process.exit(0);
483
- return;
484
- }
485
- if (!s) return;
486
- const f = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
487
- b.moveCursor(t, f, y, () => {
488
- b.clearLine(t, 1, () => {
489
- r.once("keypress", n);
490
- });
491
- });
492
- };
493
- return e2 && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
494
- r.off("keypress", n), e2 && t.write(import_sisteransi.cursor.show), r instanceof O && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
495
- };
496
- }
497
- var A = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
498
- var L = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
499
- function W(r, t, s, e2 = s, i) {
500
- const n = A(r ?? S);
501
- return wrapAnsi(t, n - s.length, { hard: true, trim: false }).split(`
502
- `).map((o, u) => {
503
- const a = i ? i(o, u) : o;
504
- return `${u === 0 ? e2 : s}${a}`;
505
- }).join(`
506
- `);
507
- }
508
- var p = class {
509
- input;
510
- output;
511
- _abortSignal;
512
- rl;
513
- opts;
514
- _render;
515
- _track = false;
516
- _prevFrame = "";
517
- _subscribers = /* @__PURE__ */ new Map();
518
- _cursor = 0;
519
- state = "initial";
520
- error = "";
521
- value;
522
- userInput = "";
523
- constructor(t, s = true) {
524
- const { input: e2 = D, output: i = S, render: n, signal: o, ...u } = t;
525
- this.opts = u, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = e2, this.output = i;
526
- }
527
- unsubscribe() {
528
- this._subscribers.clear();
529
- }
530
- setSubscriber(t, s) {
531
- const e2 = this._subscribers.get(t) ?? [];
532
- e2.push(s), this._subscribers.set(t, e2);
533
- }
534
- on(t, s) {
535
- this.setSubscriber(t, { cb: s });
536
- }
537
- once(t, s) {
538
- this.setSubscriber(t, { cb: s, once: true });
539
- }
540
- emit(t, ...s) {
541
- const e2 = this._subscribers.get(t) ?? [], i = [];
542
- for (const n of e2) n.cb(...s), n.once && i.push(() => e2.splice(e2.indexOf(n), 1));
543
- for (const n of i) n();
544
- }
545
- prompt() {
546
- return new Promise((t) => {
547
- if (this._abortSignal) {
548
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(k);
549
- this._abortSignal.addEventListener("abort", () => {
550
- this.state = "cancel", this.close();
551
- }, { once: true });
552
- }
553
- this.rl = E.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
554
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
555
- }), this.once("cancel", () => {
556
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
557
- });
558
- });
559
- }
560
- _isActionKey(t, s) {
561
- return t === " ";
562
- }
563
- _shouldSubmit(t, s) {
564
- return true;
565
- }
566
- _setValue(t) {
567
- this.value = t, this.emit("value", this.value);
568
- }
569
- _setUserInput(t, s) {
570
- this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
571
- }
572
- _clearUserInput() {
573
- this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
574
- }
575
- onKeypress(t, s) {
576
- if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
577
- if (this.opts.validate) {
578
- const e2 = this.opts.validate(this.value);
579
- e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", this.rl?.write(this.userInput));
580
- }
581
- this.state !== "error" && (this.state = "submit");
582
- }
583
- C([t, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
584
- }
585
- close() {
586
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
587
- `), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
588
- }
589
- restoreCursor() {
590
- const t = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
591
- `).length - 1;
592
- this.output.write(import_sisteransi.cursor.move(-999, t * -1));
593
- }
594
- render() {
595
- const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
596
- if (t !== this._prevFrame) {
597
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
598
- else {
599
- const s = z(this._prevFrame, t), e2 = L(this.output);
600
- if (this.restoreCursor(), s) {
601
- const i = Math.max(0, s.numLinesAfter - e2), n = Math.max(0, s.numLinesBefore - e2);
602
- let o = s.lines.find((u) => u >= i);
603
- if (o === void 0) {
604
- this._prevFrame = t;
605
- return;
606
- }
607
- if (s.lines.length === 1) {
608
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
609
- const u = t.split(`
610
- `);
611
- this.output.write(u[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, u.length - o - 1));
612
- return;
613
- } else if (s.lines.length > 1) {
614
- if (i < n) o = i;
615
- else {
616
- const a = o - n;
617
- a > 0 && this.output.write(import_sisteransi.cursor.move(0, a));
618
- }
619
- this.output.write(import_sisteransi.erase.down());
620
- const u = t.split(`
621
- `).slice(o);
622
- this.output.write(u.join(`
623
- `)), this._prevFrame = t;
624
- return;
625
- }
626
- }
627
- this.output.write(import_sisteransi.erase.down());
628
- }
629
- this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
630
- }
631
- }
632
- };
633
- function B(r, t) {
634
- if (r === void 0 || t.length === 0) return 0;
635
- const s = t.findIndex((e2) => e2.value === r);
636
- return s !== -1 ? s : 0;
637
- }
638
- function J(r, t) {
639
- return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
640
- }
641
- function H(r, t) {
642
- if (t) return r ? t : t[0];
643
- }
644
- var Q = class extends p {
645
- filteredOptions;
646
- multiple;
647
- isNavigating = false;
648
- selectedValues = [];
649
- focusedValue;
650
- #s = 0;
651
- #r = "";
652
- #t;
653
- #n;
654
- #u;
655
- get cursor() {
656
- return this.#s;
657
- }
658
- get userInputWithCursor() {
659
- if (!this.userInput) return v(["inverse", "hidden"], "_");
660
- if (this._cursor >= this.userInput.length) return `${this.userInput}\u2588`;
661
- const t = this.userInput.slice(0, this._cursor), [s, ...e2] = this.userInput.slice(this._cursor);
662
- return `${t}${v("inverse", s)}${e2.join("")}`;
663
- }
664
- get options() {
665
- return typeof this.#n == "function" ? this.#n() : this.#n;
666
- }
667
- constructor(t) {
668
- super(t), this.#n = t.options, this.#u = t.placeholder;
669
- const s = this.options;
670
- this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J;
671
- let e2;
672
- if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e2 = t.initialValue : e2 = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e2 = [this.options[0].value]), e2) for (const i of e2) {
673
- const n = s.findIndex((o) => o.value === i);
674
- n !== -1 && (this.toggleSelected(i), this.#s = n);
675
- }
676
- this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n) => this.#e(i, n)), this.on("userInput", (i) => this.#i(i));
677
- }
678
- _isActionKey(t, s) {
679
- return t === " " || this.multiple && this.isNavigating && s.name === "space" && t !== void 0 && t !== "";
680
- }
681
- #e(t, s) {
682
- const e2 = s.name === "up", i = s.name === "down", n = s.name === "return", o = this.userInput === "" || this.userInput === " ", u = this.#u, a = this.options, l = u !== void 0 && u !== "" && a.some((f) => !f.disabled && (this.#t ? this.#t(u, f) : true));
683
- if (s.name === "tab" && o && l) {
684
- this.userInput === " " && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
685
- return;
686
- }
687
- e2 || i ? (this.#s = d(this.#s, e2 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== void 0 && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
688
- }
689
- deselectAll() {
690
- this.selectedValues = [];
691
- }
692
- toggleSelected(t) {
693
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s) => s !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
694
- }
695
- #i(t) {
696
- if (t !== this.#r) {
697
- this.#r = t;
698
- const s = this.options;
699
- t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
700
- const e2 = B(this.focusedValue, this.filteredOptions);
701
- this.#s = d(e2, 0, this.filteredOptions);
702
- const i = this.filteredOptions[this.#s];
703
- i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = void 0, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
704
- }
705
- }
706
- };
707
- var X = class extends p {
708
- get cursor() {
709
- return this.value ? 0 : 1;
710
- }
711
- get _value() {
712
- return this.cursor === 0;
713
- }
714
- constructor(t) {
715
- super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
716
- this.value = this._value;
717
- }), this.on("confirm", (s) => {
718
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
719
- }), this.on("cursor", () => {
720
- this.value = !this.value;
721
- });
722
- }
723
- };
724
- var Z = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
725
- function P(r) {
726
- return [...r].map((t) => Z[t]);
727
- }
728
- function tt(r) {
729
- const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2e3, 0, 15)), s = [];
730
- let e2 = "/";
731
- for (const i of t) i.type === "literal" ? e2 = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
732
- return { segments: s, separator: e2 };
733
- }
734
- function U(r) {
735
- return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
736
- }
737
- function x(r) {
738
- return { year: U(r.year), month: U(r.month), day: U(r.day) };
739
- }
740
- function $(r, t) {
741
- return new Date(r || 2001, t || 1, 0).getDate();
742
- }
743
- function F(r) {
744
- const { year: t, month: s, day: e2 } = x(r);
745
- if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e2 || e2 < 1) return;
746
- const i = new Date(Date.UTC(t, s - 1, e2));
747
- if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e2)) return { year: t, month: s, day: e2 };
748
- }
749
- function N(r) {
750
- const t = F(r);
751
- return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : void 0;
752
- }
753
- function st(r, t, s, e2) {
754
- const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e2 ? { year: e2.getUTCFullYear(), month: e2.getUTCMonth() + 1, day: e2.getUTCDate() } : null;
755
- return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : $(t.year, t.month) };
756
- }
757
- var et = class extends p {
758
- #s;
759
- #r;
760
- #t;
761
- #n;
762
- #u;
763
- #e = { segmentIndex: 0, positionInSegment: 0 };
764
- #i = true;
765
- #o = null;
766
- inlineError = "";
767
- get segmentCursor() {
768
- return { ...this.#e };
769
- }
770
- get segmentValues() {
771
- return { ...this.#t };
772
- }
773
- get segments() {
774
- return this.#s;
775
- }
776
- get separator() {
777
- return this.#r;
778
- }
779
- get formattedValue() {
780
- return this.#c(this.#t);
781
- }
782
- #c(t) {
783
- return this.#s.map((s) => t[s.type]).join(this.#r);
784
- }
785
- #a() {
786
- this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? void 0);
787
- }
788
- constructor(t) {
789
- const s = t.format ? { segments: P(t.format), separator: t.separator ?? "/" } : tt(t.locale), e2 = t.separator ?? s.separator, i = t.format ? P(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e2);
790
- super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e2, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
791
- }
792
- #h() {
793
- const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#s.length - 1)), s = this.#s[t];
794
- if (s) return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, s.len - 1)), { segment: s, index: t };
795
- }
796
- #l(t) {
797
- this.inlineError = "", this.#o = null;
798
- const s = this.#h();
799
- s && (this.#e.segmentIndex = Math.max(0, Math.min(this.#s.length - 1, s.index + t)), this.#e.positionInSegment = 0, this.#i = true);
800
- }
801
- #p(t) {
802
- const s = this.#h();
803
- if (!s) return;
804
- const { segment: e2 } = s, i = this.#t[e2.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = st(e2.type, x(this.#t), this.#n, this.#u);
805
- let a;
806
- n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e2.type]: a.toString().padStart(e2.len, "0") }, this.#i = true, this.#o = null, this.#a();
807
- }
808
- #d(t) {
809
- if (t) switch (t) {
810
- case "right":
811
- return this.#l(1);
812
- case "left":
813
- return this.#l(-1);
814
- case "up":
815
- return this.#p(1);
816
- case "down":
817
- return this.#p(-1);
818
- }
819
- }
820
- #f(t, s) {
821
- if (s?.name === "backspace" || s?.sequence === "\x7F" || s?.sequence === "\b" || t === "\x7F" || t === "\b") {
822
- this.inlineError = "";
823
- const e2 = this.#h();
824
- if (!e2) return;
825
- if (!this.#t[e2.segment.type].replace(/_/g, "")) {
826
- this.#l(-1);
827
- return;
828
- }
829
- this.#t[e2.segment.type] = "_".repeat(e2.segment.len), this.#i = true, this.#e.positionInSegment = 0, this.#a();
830
- return;
831
- }
832
- if (s?.name === "tab") {
833
- this.inlineError = "";
834
- const e2 = this.#h();
835
- if (!e2) return;
836
- const i = s.shift ? -1 : 1, n = e2.index + i;
837
- n >= 0 && n < this.#s.length && (this.#e.segmentIndex = n, this.#e.positionInSegment = 0, this.#i = true);
838
- return;
839
- }
840
- if (t && /^[0-9]$/.test(t)) {
841
- const e2 = this.#h();
842
- if (!e2) return;
843
- const { segment: i } = e2, n = !this.#t[i.type].replace(/_/g, "");
844
- if (this.#i && this.#o !== null && !n) {
845
- const m = this.#o + t, g = { ...this.#t, [i.type]: m }, _ = this.#m(g, i);
846
- if (_) {
847
- this.inlineError = _, this.#o = null, this.#i = false;
848
- return;
849
- }
850
- this.inlineError = "", this.#t[i.type] = m, this.#o = null, this.#i = false, this.#a(), e2.index < this.#s.length - 1 && (this.#e.segmentIndex = e2.index + 1, this.#e.positionInSegment = 0, this.#i = true);
851
- return;
852
- }
853
- this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#e.positionInSegment = 0), this.#i = false, this.#o = null;
854
- const o = this.#t[i.type], u = o.indexOf("_"), a = u >= 0 ? u : Math.min(this.#e.positionInSegment, i.len - 1);
855
- if (a < 0 || a >= i.len) return;
856
- let l = o.slice(0, a) + t + o.slice(a + 1), f = false;
857
- if (a === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
858
- const m = Number.parseInt(t, 10);
859
- l = `0${t}`, f = m <= (i.type === "month" ? 1 : 2);
860
- }
861
- if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
862
- const m = { ...this.#t, [i.type]: l }, g = this.#m(m, i);
863
- if (g) {
864
- this.inlineError = g;
865
- return;
866
- }
867
- }
868
- this.inlineError = "", this.#t[i.type] = l;
869
- const y = l.includes("_") ? void 0 : F(this.#t);
870
- if (y) {
871
- const { year: m, month: g } = y, _ = $(m, g);
872
- this.#t = { year: String(Math.max(0, Math.min(9999, m))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
873
- }
874
- this.#a();
875
- const T = l.indexOf("_");
876
- f ? (this.#i = true, this.#o = t) : T >= 0 ? this.#e.positionInSegment = T : u >= 0 && e2.index < this.#s.length - 1 ? (this.#e.segmentIndex = e2.index + 1, this.#e.positionInSegment = 0, this.#i = true) : this.#e.positionInSegment = Math.min(a + 1, i.len - 1);
877
- }
878
- }
879
- #m(t, s) {
880
- const { month: e2, day: i } = x(t);
881
- if (s.type === "month" && (e2 < 0 || e2 > 12)) return h.date.messages.invalidMonth;
882
- if (s.type === "day" && (i < 0 || i > 31)) return h.date.messages.invalidDay(31, "any month");
883
- }
884
- #g(t) {
885
- const { year: s, month: e2, day: i } = x(this.#t);
886
- if (s && e2 && i) {
887
- const n = $(s, e2);
888
- this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
889
- }
890
- this.value = N(this.#t) ?? t.defaultValue ?? void 0;
891
- }
892
- };
893
- var it = class extends p {
894
- options;
895
- cursor = 0;
896
- #s;
897
- getGroupItems(t) {
898
- return this.options.filter((s) => s.group === t);
899
- }
900
- isGroupSelected(t) {
901
- const s = this.getGroupItems(t), e2 = this.value;
902
- return e2 === void 0 ? false : s.every((i) => e2.includes(i.value));
903
- }
904
- toggleValue() {
905
- const t = this.options[this.cursor];
906
- if (this.value === void 0 && (this.value = []), t.group === true) {
907
- const s = t.value, e2 = this.getGroupItems(s);
908
- this.isGroupSelected(s) ? this.value = this.value.filter((i) => e2.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...e2.map((i) => i.value)], this.value = Array.from(new Set(this.value));
909
- } else {
910
- const s = this.value.includes(t.value);
911
- this.value = s ? this.value.filter((e2) => e2 !== t.value) : [...this.value, t.value];
912
- }
913
- }
914
- constructor(t) {
915
- super(t, false);
916
- const { options: s } = t;
917
- this.#s = t.selectableGroups !== false, this.options = Object.entries(s).flatMap(([e2, i]) => [{ value: e2, group: true, label: e2 }, ...i.map((n) => ({ ...n, group: e2 }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e2 }) => e2 === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e2) => {
918
- switch (e2) {
919
- case "left":
920
- case "up": {
921
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
922
- const i = this.options[this.cursor]?.group === true;
923
- !this.#s && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
924
- break;
925
- }
926
- case "down":
927
- case "right": {
928
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
929
- const i = this.options[this.cursor]?.group === true;
930
- !this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
931
- break;
932
- }
933
- case "space":
934
- this.toggleValue();
935
- break;
936
- }
937
- });
938
- }
939
- };
940
- var rt = class extends p {
941
- #s = false;
942
- #r;
943
- focused = "editor";
944
- get userInputWithCursor() {
945
- if (this.state === "submit") return this.userInput;
946
- const t = this.userInput;
947
- if (this.cursor >= t.length) return `${t}\u2588`;
948
- const s = t.slice(0, this.cursor), e2 = t[this.cursor], i = t.slice(this.cursor + 1);
949
- return e2 === `
950
- ` ? `${s}\u2588
951
- ${i}` : `${s}${v("inverse", e2)}${i}`;
952
- }
953
- get cursor() {
954
- return this._cursor;
955
- }
956
- #t(t) {
957
- if (this.userInput.length === 0) {
958
- this._setUserInput(t);
959
- return;
960
- }
961
- this._setUserInput(this.userInput.slice(0, this.cursor) + t + this.userInput.slice(this.cursor));
962
- }
963
- #n(t) {
964
- const s = this.value ?? "";
965
- switch (t) {
966
- case "up":
967
- this._cursor = I(this._cursor, 0, -1, s);
968
- return;
969
- case "down":
970
- this._cursor = I(this._cursor, 0, 1, s);
971
- return;
972
- case "left":
973
- this._cursor = I(this._cursor, -1, 0, s);
974
- return;
975
- case "right":
976
- this._cursor = I(this._cursor, 1, 0, s);
977
- return;
978
- }
979
- }
980
- _shouldSubmit(t, s) {
981
- if (this.#r) return this.focused === "submit" ? true : (this.#t(`
982
- `), this._cursor++, false);
983
- const e2 = this.#s;
984
- return this.#s = true, e2 ? (this.userInput[this.cursor - 1] === `
985
- ` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#t(`
986
- `), this._cursor++, false);
987
- }
988
- constructor(t) {
989
- super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e2) => {
990
- if (e2?.name && h.actions.has(e2.name)) {
991
- this.#n(e2.name);
992
- return;
993
- }
994
- if (s === " " && this.#r) {
995
- this.focused = this.focused === "editor" ? "submit" : "editor";
996
- return;
997
- }
998
- if (e2?.name !== "return") {
999
- if (this.#s = false, e2?.name === "backspace" && this.cursor > 0) {
1000
- this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
1001
- return;
1002
- }
1003
- if (e2?.name === "delete" && this.cursor < this.userInput.length) {
1004
- this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
1005
- return;
1006
- }
1007
- s && (this.#r && this.focused === "submit" && (this.focused = "editor"), this.#t(s ?? ""), this._cursor++);
1008
- }
1009
- }), this.on("userInput", (s) => {
1010
- this._setValue(s);
1011
- }), this.on("finalize", () => {
1012
- this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
1013
- });
1014
- }
1015
- };
1016
- var nt = class extends p {
1017
- options;
1018
- cursor = 0;
1019
- get _value() {
1020
- return this.options[this.cursor].value;
1021
- }
1022
- get _enabledOptions() {
1023
- return this.options.filter((t) => t.disabled !== true);
1024
- }
1025
- toggleAll() {
1026
- const t = this._enabledOptions, s = this.value !== void 0 && this.value.length === t.length;
1027
- this.value = s ? [] : t.map((e2) => e2.value);
1028
- }
1029
- toggleInvert() {
1030
- const t = this.value;
1031
- if (!t) return;
1032
- const s = this._enabledOptions.filter((e2) => !t.includes(e2.value));
1033
- this.value = s.map((e2) => e2.value);
1034
- }
1035
- toggleValue() {
1036
- this.value === void 0 && (this.value = []);
1037
- const t = this.value.includes(this._value);
1038
- this.value = t ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
1039
- }
1040
- constructor(t) {
1041
- super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
1042
- const s = Math.max(this.options.findIndex(({ value: e2 }) => e2 === t.cursorAt), 0);
1043
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.on("key", (e2) => {
1044
- e2 === "a" && this.toggleAll(), e2 === "i" && this.toggleInvert();
1045
- }), this.on("cursor", (e2) => {
1046
- switch (e2) {
1047
- case "left":
1048
- case "up":
1049
- this.cursor = d(this.cursor, -1, this.options);
1050
- break;
1051
- case "down":
1052
- case "right":
1053
- this.cursor = d(this.cursor, 1, this.options);
1054
- break;
1055
- case "space":
1056
- this.toggleValue();
1057
- break;
1058
- }
1059
- });
1060
- }
1061
- };
1062
- var ot = class extends p {
1063
- _mask = "\u2022";
1064
- get cursor() {
1065
- return this._cursor;
1066
- }
1067
- get masked() {
1068
- return this.userInput.replaceAll(/./g, this._mask);
1069
- }
1070
- get userInputWithCursor() {
1071
- if (this.state === "submit" || this.state === "cancel") return this.masked;
1072
- const t = this.userInput;
1073
- if (this.cursor >= t.length) return `${this.masked}${v(["inverse", "hidden"], "_")}`;
1074
- const s = this.masked, e2 = s.slice(0, this.cursor), i = s.slice(this.cursor);
1075
- return `${e2}${v("inverse", i[0])}${i.slice(1)}`;
1076
- }
1077
- clear() {
1078
- this._clearUserInput();
1079
- }
1080
- constructor({ mask: t, ...s }) {
1081
- super(s), this._mask = t ?? "\u2022", this.on("userInput", (e2) => {
1082
- this._setValue(e2);
1083
- });
1084
- }
1085
- };
1086
- var ut = class extends p {
1087
- options;
1088
- cursor = 0;
1089
- get _selectedValue() {
1090
- return this.options[this.cursor];
1091
- }
1092
- changeValue() {
1093
- this.value = this._selectedValue.value;
1094
- }
1095
- constructor(t) {
1096
- super(t, false), this.options = t.options;
1097
- const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e2 = s === -1 ? 0 : s;
1098
- this.cursor = this.options[e2].disabled ? d(e2, 1, this.options) : e2, this.changeValue(), this.on("cursor", (i) => {
1099
- switch (i) {
1100
- case "left":
1101
- case "up":
1102
- this.cursor = d(this.cursor, -1, this.options);
1103
- break;
1104
- case "down":
1105
- case "right":
1106
- this.cursor = d(this.cursor, 1, this.options);
1107
- break;
1108
- }
1109
- this.changeValue();
1110
- });
1111
- }
1112
- };
1113
- var at = class extends p {
1114
- options;
1115
- cursor = 0;
1116
- constructor(t) {
1117
- super(t, false), this.options = t.options;
1118
- const s = t.caseSensitive === true, e2 = this.options.map(({ value: [i] }) => s ? i : i?.toLowerCase());
1119
- this.cursor = Math.max(e2.indexOf(t.initialValue), 0), this.on("key", (i, n) => {
1120
- if (!i) return;
1121
- const o = s && n.shift ? i.toUpperCase() : i;
1122
- if (!e2.includes(o)) return;
1123
- const u = this.options.find(({ value: [a] }) => s ? a === o : a?.toLowerCase() === i);
1124
- u && (this.value = u.value, this.state = "submit", this.emit("submit"));
1125
- });
1126
- }
1127
- };
1128
- var ht = class extends p {
1129
- get userInputWithCursor() {
1130
- if (this.state === "submit") return this.userInput;
1131
- const t = this.userInput;
1132
- if (this.cursor >= t.length) return `${this.userInput}\u2588`;
1133
- const s = t.slice(0, this.cursor), [e2, ...i] = t.slice(this.cursor);
1134
- return `${s}${v("inverse", e2)}${i.join("")}`;
1135
- }
1136
- get cursor() {
1137
- return this._cursor;
1138
- }
1139
- constructor(t) {
1140
- super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (s) => {
1141
- this._setValue(s);
1142
- }), this.on("finalize", () => {
1143
- this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
1144
- });
1145
- }
1146
- };
1147
-
1148
- // ../../node_modules/.bun/@clack+prompts@1.3.0/node_modules/@clack/prompts/dist/index.mjs
1149
- import { styleText as e, stripVTControlCharacters as nt2 } from "util";
1150
- import j2 from "process";
1151
- var import_sisteransi2 = __toESM(require_src(), 1);
1152
- import { existsSync as zt, lstatSync as wt, readdirSync as Qt } from "fs";
1153
- import { dirname as bt, join as Zt } from "path";
1154
- function te() {
1155
- return j2.platform !== "win32" ? j2.env.TERM !== "linux" : !!j2.env.CI || !!j2.env.WT_SESSION || !!j2.env.TERMINUS_SUBLIME || j2.env.ConEmuTask === "{cmd::Cmder}" || j2.env.TERM_PROGRAM === "Terminus-Sublime" || j2.env.TERM_PROGRAM === "vscode" || j2.env.TERM === "xterm-256color" || j2.env.TERM === "alacritty" || j2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1156
- }
1157
- var tt2 = te();
1158
- var at2 = () => process.env.CI === "true";
1159
- var Tt = (t) => t.isTTY === true;
1160
- var w2 = (t, r) => tt2 ? t : r;
1161
- var _t = w2("\u25C6", "*");
1162
- var ot2 = w2("\u25A0", "x");
1163
- var ut2 = w2("\u25B2", "x");
1164
- var F2 = w2("\u25C7", "o");
1165
- var lt = w2("\u250C", "T");
1166
- var $2 = w2("\u2502", "|");
1167
- var E2 = w2("\u2514", "\u2014");
1168
- var It = w2("\u2510", "T");
1169
- var Et = w2("\u2518", "\u2014");
1170
- var z2 = w2("\u25CF", ">");
1171
- var H2 = w2("\u25CB", " ");
1172
- var et2 = w2("\u25FB", "[\u2022]");
1173
- var U2 = w2("\u25FC", "[+]");
1174
- var J2 = w2("\u25FB", "[ ]");
1175
- var Gt = w2("\u25AA", "\u2022");
1176
- var st2 = w2("\u2500", "-");
1177
- var ct = w2("\u256E", "+");
1178
- var xt = w2("\u251C", "+");
1179
- var $t = w2("\u256F", "+");
1180
- var dt = w2("\u2570", "+");
1181
- var Ot = w2("\u256D", "+");
1182
- var ht2 = w2("\u25CF", "\u2022");
1183
- var pt = w2("\u25C6", "*");
1184
- var mt = w2("\u25B2", "!");
1185
- var gt = w2("\u25A0", "x");
1186
- var M = (t) => {
1187
- switch (t) {
1188
- case "initial":
1189
- case "active":
1190
- return e("cyan", _t);
1191
- case "cancel":
1192
- return e("red", ot2);
1193
- case "error":
1194
- return e("yellow", ut2);
1195
- case "submit":
1196
- return e("green", F2);
1197
- }
1198
- };
1199
- var yt = (t) => {
1200
- switch (t) {
1201
- case "initial":
1202
- case "active":
1203
- return e("cyan", $2);
1204
- case "cancel":
1205
- return e("red", $2);
1206
- case "error":
1207
- return e("yellow", $2);
1208
- case "submit":
1209
- return e("green", $2);
1210
- }
1211
- };
1212
- var ee = (t, r, s, i, u) => {
1213
- let n = r, o = 0;
1214
- for (let c2 = s; c2 < i; c2++) {
1215
- const a = t[c2];
1216
- if (n = n - a.length, o++, n <= u) break;
1217
- }
1218
- return { lineCount: n, removals: o };
1219
- };
1220
- var Y2 = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
1221
- const c2 = A(i) - n, a = L(i), l = e("dim", "..."), d2 = Math.max(a - o, 0), y = Math.max(Math.min(u, d2), 5);
1222
- let p2 = 0;
1223
- t >= y - 3 && (p2 = Math.max(Math.min(t - y + 3, r.length - y), 0));
1224
- let m = y < r.length && p2 > 0, g = y < r.length && p2 + y < r.length;
1225
- const S2 = Math.min(p2 + y, r.length), h2 = [];
1226
- let f = 0;
1227
- m && f++, g && f++;
1228
- const v2 = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
1229
- for (let b2 = v2; b2 < T; b2++) {
1230
- const G2 = wrapAnsi(s(r[b2], b2 === t), c2, { hard: true, trim: false }).split(`
1231
- `);
1232
- h2.push(G2), f += G2.length;
1233
- }
1234
- if (f > d2) {
1235
- let b2 = 0, G2 = 0, x2 = f;
1236
- const A2 = t - v2, P2 = (N2, D2) => ee(h2, x2, N2, D2, d2);
1237
- m ? ({ lineCount: x2, removals: b2 } = P2(0, A2), x2 > d2 && ({ lineCount: x2, removals: G2 } = P2(A2 + 1, h2.length))) : ({ lineCount: x2, removals: G2 } = P2(A2 + 1, h2.length), x2 > d2 && ({ lineCount: x2, removals: b2 } = P2(0, A2))), b2 > 0 && (m = true, h2.splice(0, b2)), G2 > 0 && (g = true, h2.splice(h2.length - G2, G2));
1238
- }
1239
- const C2 = [];
1240
- m && C2.push(l);
1241
- for (const b2 of h2) for (const G2 of b2) C2.push(G2);
1242
- return g && C2.push(l), C2;
1243
- };
1244
- function Mt(t) {
1245
- return t.label ?? String(t.value ?? "");
1246
- }
1247
- function Rt(t, r) {
1248
- if (!t) return true;
1249
- const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), u = String(r.value).toLowerCase(), n = t.toLowerCase();
1250
- return s.includes(n) || i.includes(n) || u.includes(n);
1251
- }
1252
- function se(t, r) {
1253
- const s = [];
1254
- for (const i of r) t.includes(i.value) && s.push(i);
1255
- return s;
1256
- }
1257
- var At = (t) => new Q({ options: t.options, initialValue: t.initialValue ? [t.initialValue] : void 0, initialUserInput: t.initialUserInput, placeholder: t.placeholder, filter: t.filter ?? ((r, s) => Rt(r, s)), signal: t.signal, input: t.input, output: t.output, validate: t.validate, render() {
1258
- const r = t.withGuide ?? h.withGuide, s = r ? [`${e("gray", $2)}`, `${M(this.state)} ${t.message}`] : [`${M(this.state)} ${t.message}`], i = this.userInput, u = this.options, n = t.placeholder, o = i === "" && n !== void 0, c2 = (a, l) => {
1259
- const d2 = Mt(a), y = a.hint && a.value === this.focusedValue ? e("dim", ` (${a.hint})`) : "";
1260
- switch (l) {
1261
- case "active":
1262
- return `${e("green", z2)} ${d2}${y}`;
1263
- case "inactive":
1264
- return `${e("dim", H2)} ${e("dim", d2)}`;
1265
- case "disabled":
1266
- return `${e("gray", H2)} ${e(["strikethrough", "gray"], d2)}`;
1267
- }
1268
- };
1269
- switch (this.state) {
1270
- case "submit": {
1271
- const a = se(this.selectedValues, u), l = a.length > 0 ? ` ${e("dim", a.map(Mt).join(", "))}` : "", d2 = r ? e("gray", $2) : "";
1272
- return `${s.join(`
1273
- `)}
1274
- ${d2}${l}`;
1275
- }
1276
- case "cancel": {
1277
- const a = i ? ` ${e(["strikethrough", "dim"], i)}` : "", l = r ? e("gray", $2) : "";
1278
- return `${s.join(`
1279
- `)}
1280
- ${l}${a}`;
1281
- }
1282
- default: {
1283
- const a = this.state === "error" ? "yellow" : "cyan", l = r ? `${e(a, $2)} ` : "", d2 = r ? e(a, E2) : "";
1284
- let y = "";
1285
- if (this.isNavigating || o) {
1286
- const v2 = o ? n : i;
1287
- y = v2 !== "" ? ` ${e("dim", v2)}` : "";
1288
- } else y = ` ${this.userInputWithCursor}`;
1289
- const p2 = this.filteredOptions.length !== u.length ? e("dim", ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "", m = this.filteredOptions.length === 0 && i ? [`${l}${e("yellow", "No matches found")}`] : [], g = this.state === "error" ? [`${l}${e("yellow", this.error)}`] : [];
1290
- r && s.push(`${l.trimEnd()}`), s.push(`${l}${e("dim", "Search:")}${y}${p2}`, ...m, ...g);
1291
- const S2 = [`${e("dim", "\u2191/\u2193")} to select`, `${e("dim", "Enter:")} confirm`, `${e("dim", "Type:")} to search`], h2 = [`${l}${S2.join(" \u2022 ")}`, d2], f = this.filteredOptions.length === 0 ? [] : Y2({ cursor: this.cursor, options: this.filteredOptions, columnPadding: r ? 3 : 0, rowPadding: s.length + h2.length, style: (v2, T) => c2(v2, v2.disabled ? "disabled" : T ? "active" : "inactive"), maxItems: t.maxItems, output: t.output });
1292
- return [...s, ...f.map((v2) => `${l}${v2}`), ...h2].join(`
1293
- `);
1294
- }
1295
- }
1296
- } }).prompt();
1297
- var ie = (t) => {
1298
- const r = (i, u, n, o) => {
1299
- const c2 = n.includes(i.value), a = i.label ?? String(i.value ?? ""), l = i.hint && o !== void 0 && i.value === o ? e("dim", ` (${i.hint})`) : "", d2 = c2 ? e("green", U2) : e("dim", J2);
1300
- return i.disabled ? `${e("gray", J2)} ${e(["strikethrough", "gray"], a)}` : u ? `${d2} ${a}${l}` : `${d2} ${e("dim", a)}`;
1301
- }, s = new Q({ options: t.options, multiple: true, placeholder: t.placeholder, filter: t.filter ?? ((i, u) => Rt(i, u)), validate: () => {
1302
- if (t.required && s.selectedValues.length === 0) return "Please select at least one item";
1303
- }, initialValue: t.initialValues, signal: t.signal, input: t.input, output: t.output, render() {
1304
- const i = t.withGuide ?? h.withGuide, u = `${i ? `${e("gray", $2)}
1305
- ` : ""}${M(this.state)} ${t.message}
1306
- `, n = this.userInput, o = t.placeholder, c2 = n === "" && o !== void 0, a = this.isNavigating || c2 ? e("dim", c2 ? o : n) : this.userInputWithCursor, l = this.options, d2 = this.filteredOptions.length !== l.length ? e("dim", ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
1307
- switch (this.state) {
1308
- case "submit":
1309
- return `${u}${i ? `${e("gray", $2)} ` : ""}${e("dim", `${this.selectedValues.length} items selected`)}`;
1310
- case "cancel":
1311
- return `${u}${i ? `${e("gray", $2)} ` : ""}${e(["strikethrough", "dim"], n)}`;
1312
- default: {
1313
- const y = this.state === "error" ? "yellow" : "cyan", p2 = i ? `${e(y, $2)} ` : "", m = i ? e(y, E2) : "", g = [`${e("dim", "\u2191/\u2193")} to navigate`, `${e("dim", this.isNavigating ? "Space/Tab:" : "Tab:")} select`, `${e("dim", "Enter:")} confirm`, `${e("dim", "Type:")} to search`], S2 = this.filteredOptions.length === 0 && n ? [`${p2}${e("yellow", "No matches found")}`] : [], h2 = this.state === "error" ? [`${p2}${e("yellow", this.error)}`] : [], f = [...`${u}${i ? e(y, $2) : ""}`.split(`
1314
- `), `${p2}${e("dim", "Search:")} ${a}${d2}`, ...S2, ...h2], v2 = [`${p2}${g.join(" \u2022 ")}`, m], T = Y2({ cursor: this.cursor, options: this.filteredOptions, style: (C2, b2) => r(C2, b2, this.selectedValues, this.focusedValue), maxItems: t.maxItems, output: t.output, rowPadding: f.length + v2.length });
1315
- return [...f, ...T.map((C2) => `${p2}${C2}`), ...v2].join(`
1316
- `);
1317
- }
1318
- }
1319
- } });
1320
- return s.prompt();
1321
- };
1322
- var re = [Ot, ct, dt, $t];
1323
- var ne = [lt, It, E2, Et];
1324
- function Pt(t, r, s, i) {
1325
- let u = s, n = s;
1326
- return i === "center" ? u = Math.floor((r - t) / 2) : i === "right" && (u = r - t - s), n = r - u - t, [u, n];
1327
- }
1328
- var ae = (t) => t;
1329
- var oe = (t = "", r = "", s) => {
1330
- const i = s?.output ?? process.stdout, u = A(i), n = 2, o = s?.titlePadding ?? 1, c2 = s?.contentPadding ?? 2, a = s?.width === void 0 || s.width === "auto" ? 1 : Math.min(1, s.width), l = s?.withGuide ?? h.withGuide ? `${$2} ` : "", d2 = s?.formatBorder ?? ae, y = (s?.rounded ? re : ne).map(d2), p2 = d2(st2), m = d2($2), g = dist_default2(l), S2 = dist_default2(r), h2 = u - g;
1331
- let f = Math.floor(u * a) - g;
1332
- if (s?.width === "auto") {
1333
- const P2 = t.split(`
1334
- `);
1335
- let N2 = S2 + o * 2;
1336
- for (const rt2 of P2) {
1337
- const W2 = dist_default2(rt2) + c2 * 2;
1338
- W2 > N2 && (N2 = W2);
1339
- }
1340
- const D2 = N2 + n;
1341
- D2 < f && (f = D2);
1342
- }
1343
- f % 2 !== 0 && (f < h2 ? f++ : f--);
1344
- const v2 = f - n, T = v2 - o * 2, C2 = S2 > T ? `${r.slice(0, T - 3)}...` : r, [b2, G2] = Pt(dist_default2(C2), v2, o, s?.titleAlign), x2 = wrapAnsi(t, v2 - c2 * 2, { hard: true, trim: false });
1345
- i.write(`${l}${y[0]}${p2.repeat(b2)}${C2}${p2.repeat(G2)}${y[1]}
1346
- `);
1347
- const A2 = x2.split(`
1348
- `);
1349
- for (const P2 of A2) {
1350
- const [N2, D2] = Pt(dist_default2(P2), v2, c2, s?.contentAlign);
1351
- i.write(`${l}${m}${" ".repeat(N2)}${P2}${" ".repeat(D2)}${m}
1352
- `);
1353
- }
1354
- i.write(`${l}${y[2]}${p2.repeat(v2)}${y[3]}
1355
- `);
1356
- };
1357
- var ue = (t) => {
1358
- const r = t.active ?? "Yes", s = t.inactive ?? "No";
1359
- return new X({ active: r, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1360
- const i = t.withGuide ?? h.withGuide, u = `${M(this.state)} `, n = i ? `${e("gray", $2)} ` : "", o = W(t.output, t.message, n, u), c2 = `${i ? `${e("gray", $2)}
1361
- ` : ""}${o}
1362
- `, a = this.value ? r : s;
1363
- switch (this.state) {
1364
- case "submit": {
1365
- const l = i ? `${e("gray", $2)} ` : "";
1366
- return `${c2}${l}${e("dim", a)}`;
1367
- }
1368
- case "cancel": {
1369
- const l = i ? `${e("gray", $2)} ` : "";
1370
- return `${c2}${l}${e(["strikethrough", "dim"], a)}${i ? `
1371
- ${e("gray", $2)}` : ""}`;
1372
- }
1373
- default: {
1374
- const l = i ? `${e("cyan", $2)} ` : "", d2 = i ? e("cyan", E2) : "";
1375
- return `${c2}${l}${this.value ? `${e("green", z2)} ${r}` : `${e("dim", H2)} ${e("dim", r)}`}${t.vertical ? i ? `
1376
- ${e("cyan", $2)} ` : `
1377
- ` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", H2)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
1378
- ${d2}
1379
- `;
1380
- }
1381
- }
1382
- } }).prompt();
1383
- };
1384
- var le = (t) => {
1385
- const r = t.validate;
1386
- return new et({ ...t, validate(s) {
1387
- if (s === void 0) return t.defaultValue !== void 0 ? void 0 : r ? r(s) : h.date.messages.required;
1388
- const i = (u) => u.toISOString().slice(0, 10);
1389
- if (t.minDate && i(s) < i(t.minDate)) return h.date.messages.afterMin(t.minDate);
1390
- if (t.maxDate && i(s) > i(t.maxDate)) return h.date.messages.beforeMax(t.maxDate);
1391
- if (r) return r(s);
1392
- }, render() {
1393
- const s = (t?.withGuide ?? h.withGuide) !== false, i = `${`${s ? `${e("gray", $2)}
1394
- ` : ""}${M(this.state)} `}${t.message}
1395
- `, u = this.state !== "initial" ? this.state : "active", n = ce(this, u), o = this.value instanceof Date ? this.formattedValue : "";
1396
- switch (this.state) {
1397
- case "error": {
1398
- const c2 = this.error ? ` ${e("yellow", this.error)}` : "", a = s ? `${e("yellow", $2)} ` : "", l = s ? e("yellow", E2) : "";
1399
- return `${i.trim()}
1400
- ${a}${n}
1401
- ${l}${c2}
1402
- `;
1403
- }
1404
- case "submit": {
1405
- const c2 = o ? ` ${e("dim", o)}` : "", a = s ? e("gray", $2) : "";
1406
- return `${i}${a}${c2}`;
1407
- }
1408
- case "cancel": {
1409
- const c2 = o ? ` ${e(["strikethrough", "dim"], o)}` : "", a = s ? e("gray", $2) : "";
1410
- return `${i}${a}${c2}${o.trim() ? `
1411
- ${a}` : ""}`;
1412
- }
1413
- default: {
1414
- const c2 = s ? `${e("cyan", $2)} ` : "", a = s ? e("cyan", E2) : "", l = s ? `${e("cyan", $2)} ` : "", d2 = this.inlineError ? `
1415
- ${l}${e("yellow", this.inlineError)}` : "";
1416
- return `${i}${c2}${n}${d2}
1417
- ${a}
1418
- `;
1419
- }
1420
- }
1421
- } }).prompt();
1422
- };
1423
- function ce(t, r) {
1424
- const s = t.segmentValues, i = t.segmentCursor;
1425
- if (r === "submit" || r === "cancel") return t.formattedValue;
1426
- const u = e("gray", t.separator);
1427
- return t.segments.map((n, o) => {
1428
- const c2 = o === i.segmentIndex && !["submit", "cancel"].includes(r), a = de[n.type];
1429
- return $e(s[n.type], { isActive: c2, label: a });
1430
- }).join(u);
1431
- }
1432
- function $e(t, r) {
1433
- const s = !t || t.replace(/_/g, "") === "";
1434
- return r.isActive ? e("inverse", s ? r.label : t.replace(/_/g, " ")) : s ? e("dim", r.label) : t.replace(/_/g, e("dim", " "));
1435
- }
1436
- var de = { year: "yyyy", month: "mm", day: "dd" };
1437
- var he = async (t, r) => {
1438
- const s = {}, i = Object.keys(t);
1439
- for (const u of i) {
1440
- const n = t[u], o = await n({ results: s })?.catch((c2) => {
1441
- throw c2;
1442
- });
1443
- if (typeof r?.onCancel == "function" && q(o)) {
1444
- s[u] = "canceled", r.onCancel({ results: s });
1445
- continue;
1446
- }
1447
- s[u] = o;
1448
- }
1449
- return s;
1450
- };
1451
- var pe = (t) => {
1452
- const { selectableGroups: r = true, groupSpacing: s = 0 } = t, i = (n, o, c2 = []) => {
1453
- const a = n.label ?? String(n.value), l = typeof n.group == "string", d2 = l && (c2[c2.indexOf(n) + 1] ?? { group: true }), y = l && d2 && d2.group === true, p2 = l ? r ? `${y ? E2 : $2} ` : " " : "";
1454
- let m = "";
1455
- if (s > 0 && !l) {
1456
- const S2 = `
1457
- ${e("cyan", $2)}`;
1458
- m = `${S2.repeat(s - 1)}${S2} `;
1459
- }
1460
- if (o === "active") return `${m}${e("dim", p2)}${e("cyan", et2)} ${a}${n.hint ? ` ${e("dim", `(${n.hint})`)}` : ""}`;
1461
- if (o === "group-active") return `${m}${p2}${e("cyan", et2)} ${e("dim", a)}`;
1462
- if (o === "group-active-selected") return `${m}${p2}${e("green", U2)} ${e("dim", a)}`;
1463
- if (o === "selected") {
1464
- const S2 = l || r ? e("green", U2) : "";
1465
- return `${m}${e("dim", p2)}${S2} ${e("dim", a)}${n.hint ? ` ${e("dim", `(${n.hint})`)}` : ""}`;
1466
- }
1467
- if (o === "cancelled") return `${e(["strikethrough", "dim"], a)}`;
1468
- if (o === "active-selected") return `${m}${e("dim", p2)}${e("green", U2)} ${a}${n.hint ? ` ${e("dim", `(${n.hint})`)}` : ""}`;
1469
- if (o === "submitted") return `${e("dim", a)}`;
1470
- const g = l || r ? e("dim", J2) : "";
1471
- return `${m}${e("dim", p2)}${g} ${e("dim", a)}`;
1472
- }, u = t.required ?? true;
1473
- return new it({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: u, cursorAt: t.cursorAt, selectableGroups: r, validate(n) {
1474
- if (u && (n === void 0 || n.length === 0)) return `Please select at least one option.
1475
- ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e(["bgWhite", "inverse"], " enter "))} to submit`))}`;
1476
- }, render() {
1477
- const n = t.withGuide ?? h.withGuide, o = `${n ? `${e("gray", $2)}
1478
- ` : ""}${M(this.state)} ${t.message}
1479
- `, c2 = this.value ?? [];
1480
- switch (this.state) {
1481
- case "submit": {
1482
- const a = this.options.filter(({ value: d2 }) => c2.includes(d2)).map((d2) => i(d2, "submitted")), l = a.length === 0 ? "" : ` ${a.join(e("dim", ", "))}`;
1483
- return `${o}${n ? e("gray", $2) : ""}${l}`;
1484
- }
1485
- case "cancel": {
1486
- const a = this.options.filter(({ value: l }) => c2.includes(l)).map((l) => i(l, "cancelled")).join(e("dim", ", "));
1487
- return `${o}${n ? `${e("gray", $2)} ` : ""}${a.trim() ? `${a}${n ? `
1488
- ${e("gray", $2)}` : ""}` : ""}`;
1489
- }
1490
- case "error": {
1491
- const a = this.error.split(`
1492
- `).map((l, d2) => d2 === 0 ? `${n ? `${e("yellow", E2)} ` : ""}${e("yellow", l)}` : ` ${l}`).join(`
1493
- `);
1494
- return `${o}${n ? `${e("yellow", $2)} ` : ""}${this.options.map((l, d2, y) => {
1495
- const p2 = c2.includes(l.value) || l.group === true && this.isGroupSelected(`${l.value}`), m = d2 === this.cursor;
1496
- return !m && typeof l.group == "string" && this.options[this.cursor].value === l.group ? i(l, p2 ? "group-active-selected" : "group-active", y) : m && p2 ? i(l, "active-selected", y) : p2 ? i(l, "selected", y) : i(l, m ? "active" : "inactive", y);
1497
- }).join(`
1498
- ${n ? `${e("yellow", $2)} ` : ""}`)}
1499
- ${a}
1500
- `;
1501
- }
1502
- default: {
1503
- const a = this.options.map((d2, y, p2) => {
1504
- const m = c2.includes(d2.value) || d2.group === true && this.isGroupSelected(`${d2.value}`), g = y === this.cursor, S2 = !g && typeof d2.group == "string" && this.options[this.cursor].value === d2.group;
1505
- let h2 = "";
1506
- return S2 ? h2 = i(d2, m ? "group-active-selected" : "group-active", p2) : g && m ? h2 = i(d2, "active-selected", p2) : m ? h2 = i(d2, "selected", p2) : h2 = i(d2, g ? "active" : "inactive", p2), `${y !== 0 && !h2.startsWith(`
1507
- `) ? " " : ""}${h2}`;
1508
- }).join(`
1509
- ${n ? e("cyan", $2) : ""}`), l = a.startsWith(`
1510
- `) ? "" : " ";
1511
- return `${o}${n ? e("cyan", $2) : ""}${l}${a}
1512
- ${n ? e("cyan", E2) : ""}
1513
- `;
1514
- }
1515
- }
1516
- } }).prompt();
1517
- };
1518
- var R2 = { message: (t = [], { symbol: r = e("gray", $2), secondarySymbol: s = e("gray", $2), output: i = process.stdout, spacing: u = 1, withGuide: n } = {}) => {
1519
- const o = [], c2 = n ?? h.withGuide, a = c2 ? s : "", l = c2 ? `${r} ` : "", d2 = c2 ? `${s} ` : "";
1520
- for (let p2 = 0; p2 < u; p2++) o.push(a);
1521
- const y = Array.isArray(t) ? t : t.split(`
1522
- `);
1523
- if (y.length > 0) {
1524
- const [p2, ...m] = y;
1525
- p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? r : "");
1526
- for (const g of m) g.length > 0 ? o.push(`${d2}${g}`) : o.push(c2 ? s : "");
1527
- }
1528
- i.write(`${o.join(`
1529
- `)}
1530
- `);
1531
- }, info: (t, r) => {
1532
- R2.message(t, { ...r, symbol: e("blue", ht2) });
1533
- }, success: (t, r) => {
1534
- R2.message(t, { ...r, symbol: e("green", pt) });
1535
- }, step: (t, r) => {
1536
- R2.message(t, { ...r, symbol: e("green", F2) });
1537
- }, warn: (t, r) => {
1538
- R2.message(t, { ...r, symbol: e("yellow", mt) });
1539
- }, warning: (t, r) => {
1540
- R2.warn(t, r);
1541
- }, error: (t, r) => {
1542
- R2.message(t, { ...r, symbol: e("red", gt) });
1543
- } };
1544
- var me = (t = "", r) => {
1545
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? h.withGuide ? `${e("gray", E2)} ` : "";
1546
- s.write(`${i}${e("red", t)}
1547
-
1548
- `);
1549
- };
1550
- var ge = (t = "", r) => {
1551
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? h.withGuide ? `${e("gray", lt)} ` : "";
1552
- s.write(`${i}${t}
1553
- `);
1554
- };
1555
- var ye = (t = "", r) => {
1556
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? h.withGuide ? `${e("gray", $2)}
1557
- ${e("gray", E2)} ` : "";
1558
- s.write(`${i}${t}
1559
-
1560
- `);
1561
- };
1562
- var fe = (t) => new rt({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, showSubmit: t.showSubmit, output: t.output, signal: t.signal, input: t.input, render() {
1563
- const r = t?.withGuide ?? h.withGuide, s = `${`${r ? `${e("gray", $2)}
1564
- ` : ""}${M(this.state)} `}${t.message}
1565
- `, i = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "", o = t.showSubmit ? `
1566
- ${e(this.focused === "submit" ? "cyan" : "dim", "[ submit ]")}` : "";
1567
- switch (this.state) {
1568
- case "error": {
1569
- const c2 = `${e("yellow", $2)} `, a = r ? W(t.output, u, c2, void 0) : u, l = e("yellow", E2);
1570
- return `${s}${a}
1571
- ${l} ${e("yellow", this.error)}${o}
1572
- `;
1573
- }
1574
- case "submit": {
1575
- const c2 = `${e("gray", $2)} `, a = r ? W(t.output, n, c2, void 0, (l) => e("dim", l)) : n ? e("dim", n) : "";
1576
- return `${s}${a}`;
1577
- }
1578
- case "cancel": {
1579
- const c2 = `${e("gray", $2)} `, a = r ? W(t.output, n, c2, void 0, (l) => e(["strikethrough", "dim"], l)) : n ? e(["strikethrough", "dim"], n) : "";
1580
- return `${s}${a}`;
1581
- }
1582
- default: {
1583
- const c2 = r ? `${e("cyan", $2)} ` : "", a = r ? e("cyan", E2) : "", l = r ? W(t.output, u, c2) : u;
1584
- return `${s}${l}
1585
- ${a}${o}
1586
- `;
1587
- }
1588
- }
1589
- } }).prompt();
1590
- var Q2 = (t, r) => t.split(`
1591
- `).map((s) => r(s)).join(`
1592
- `);
1593
- var ve = (t) => {
1594
- const r = (i, u) => {
1595
- const n = i.label ?? String(i.value);
1596
- return u === "disabled" ? `${e("gray", J2)} ${Q2(n, (o) => e(["strikethrough", "gray"], o))}${i.hint ? ` ${e("dim", `(${i.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${e("cyan", et2)} ${n}${i.hint ? ` ${e("dim", `(${i.hint})`)}` : ""}` : u === "selected" ? `${e("green", U2)} ${Q2(n, (o) => e("dim", o))}${i.hint ? ` ${e("dim", `(${i.hint})`)}` : ""}` : u === "cancelled" ? `${Q2(n, (o) => e(["strikethrough", "dim"], o))}` : u === "active-selected" ? `${e("green", U2)} ${n}${i.hint ? ` ${e("dim", `(${i.hint})`)}` : ""}` : u === "submitted" ? `${Q2(n, (o) => e("dim", o))}` : `${e("dim", J2)} ${Q2(n, (o) => e("dim", o))}`;
1597
- }, s = t.required ?? true;
1598
- return new nt({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(i) {
1599
- if (s && (i === void 0 || i.length === 0)) return `Please select at least one option.
1600
- ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e("bgWhite", e("inverse", " enter ")))} to submit`))}`;
1601
- }, render() {
1602
- const i = t.withGuide ?? h.withGuide, u = W(t.output, t.message, i ? `${yt(this.state)} ` : "", `${M(this.state)} `), n = `${i ? `${e("gray", $2)}
1603
- ` : ""}${u}
1604
- `, o = this.value ?? [], c2 = (a, l) => {
1605
- if (a.disabled) return r(a, "disabled");
1606
- const d2 = o.includes(a.value);
1607
- return l && d2 ? r(a, "active-selected") : d2 ? r(a, "selected") : r(a, l ? "active" : "inactive");
1608
- };
1609
- switch (this.state) {
1610
- case "submit": {
1611
- const a = this.options.filter(({ value: d2 }) => o.includes(d2)).map((d2) => r(d2, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l = W(t.output, a, i ? `${e("gray", $2)} ` : "");
1612
- return `${n}${l}`;
1613
- }
1614
- case "cancel": {
1615
- const a = this.options.filter(({ value: d2 }) => o.includes(d2)).map((d2) => r(d2, "cancelled")).join(e("dim", ", "));
1616
- if (a.trim() === "") return `${n}${e("gray", $2)}`;
1617
- const l = W(t.output, a, i ? `${e("gray", $2)} ` : "");
1618
- return `${n}${l}${i ? `
1619
- ${e("gray", $2)}` : ""}`;
1620
- }
1621
- case "error": {
1622
- const a = i ? `${e("yellow", $2)} ` : "", l = this.error.split(`
1623
- `).map((p2, m) => m === 0 ? `${i ? `${e("yellow", E2)} ` : ""}${e("yellow", p2)}` : ` ${p2}`).join(`
1624
- `), d2 = n.split(`
1625
- `).length, y = l.split(`
1626
- `).length + 1;
1627
- return `${n}${a}${Y2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: a.length, rowPadding: d2 + y, style: c2 }).join(`
1628
- ${a}`)}
1629
- ${l}
1630
- `;
1631
- }
1632
- default: {
1633
- const a = i ? `${e("cyan", $2)} ` : "", l = n.split(`
1634
- `).length, d2 = i ? 2 : 1;
1635
- return `${n}${a}${Y2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: a.length, rowPadding: l + d2, style: c2 }).join(`
1636
- ${a}`)}
1637
- ${i ? e("cyan", E2) : ""}
1638
- `;
1639
- }
1640
- }
1641
- } }).prompt();
1642
- };
1643
- var we = (t) => e("dim", t);
1644
- var be = (t, r, s) => {
1645
- const i = { hard: true, trim: false }, u = wrapAnsi(t, r, i).split(`
1646
- `), n = u.reduce((a, l) => Math.max(dist_default2(l), a), 0), o = u.map(s).reduce((a, l) => Math.max(dist_default2(l), a), 0), c2 = r - (o - n);
1647
- return wrapAnsi(t, c2, i);
1648
- };
1649
- var Se = (t = "", r = "", s) => {
1650
- const i = s?.output ?? j2.stdout, u = s?.withGuide ?? h.withGuide, n = s?.format ?? we, o = ["", ...be(t, A(i) - 6, n).split(`
1651
- `).map(n), ""], c2 = dist_default2(r), a = Math.max(o.reduce((p2, m) => {
1652
- const g = dist_default2(m);
1653
- return g > p2 ? g : p2;
1654
- }, 0), c2) + 2, l = o.map((p2) => `${e("gray", $2)} ${p2}${" ".repeat(a - dist_default2(p2))}${e("gray", $2)}`).join(`
1655
- `), d2 = u ? `${e("gray", $2)}
1656
- ` : "", y = u ? xt : dt;
1657
- i.write(`${d2}${e("green", F2)} ${e("reset", r)} ${e("gray", st2.repeat(Math.max(a - c2 - 1, 1)) + ct)}
1658
- ${l}
1659
- ${e("gray", y + st2.repeat(a + 2) + $t)}
1660
- `);
1661
- };
1662
- var Ce = (t) => new ot({ validate: t.validate, mask: t.mask ?? Gt, signal: t.signal, input: t.input, output: t.output, render() {
1663
- const r = t.withGuide ?? h.withGuide, s = `${r ? `${e("gray", $2)}
1664
- ` : ""}${M(this.state)} ${t.message}
1665
- `, i = this.userInputWithCursor, u = this.masked;
1666
- switch (this.state) {
1667
- case "error": {
1668
- const n = r ? `${e("yellow", $2)} ` : "", o = r ? `${e("yellow", E2)} ` : "", c2 = u ?? "";
1669
- return t.clearOnError && this.clear(), `${s.trim()}
1670
- ${n}${c2}
1671
- ${o}${e("yellow", this.error)}
1672
- `;
1673
- }
1674
- case "submit": {
1675
- const n = r ? `${e("gray", $2)} ` : "", o = u ? e("dim", u) : "";
1676
- return `${s}${n}${o}`;
1677
- }
1678
- case "cancel": {
1679
- const n = r ? `${e("gray", $2)} ` : "", o = u ? e(["strikethrough", "dim"], u) : "";
1680
- return `${s}${n}${o}${u && r ? `
1681
- ${e("gray", $2)}` : ""}`;
1682
- }
1683
- default: {
1684
- const n = r ? `${e("cyan", $2)} ` : "", o = r ? e("cyan", E2) : "";
1685
- return `${s}${n}${i}
1686
- ${o}
1687
- `;
1688
- }
1689
- }
1690
- } }).prompt();
1691
- var Te = (t) => {
1692
- const r = t.validate;
1693
- return At({ ...t, initialUserInput: t.initialValue ?? t.root ?? process.cwd(), maxItems: 5, validate(s) {
1694
- if (!Array.isArray(s)) {
1695
- if (!s) return "Please select a path";
1696
- if (r) return r(s);
1697
- }
1698
- }, options() {
1699
- const s = this.userInput;
1700
- if (s === "") return [];
1701
- try {
1702
- let i;
1703
- zt(s) ? wt(s).isDirectory() && (!t.directory || s.endsWith("/")) ? i = s : i = bt(s) : i = bt(s);
1704
- const u = s.length > 1 && s.endsWith("/") ? s.slice(0, -1) : s;
1705
- return Qt(i).map((n) => {
1706
- const o = Zt(i, n), c2 = wt(o);
1707
- return { name: n, path: o, isDirectory: c2.isDirectory() };
1708
- }).filter(({ path: n, isDirectory: o }) => n.startsWith(u) && (o || !t.directory)).map((n) => ({ value: n.path }));
1709
- } catch {
1710
- return [];
1711
- }
1712
- } });
1713
- };
1714
- var _e = (t) => e("magenta", t);
1715
- var ft = ({ indicator: t = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: u, frames: n = tt2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: o = tt2 ? 80 : 120, signal: c2, ...a } = {}) => {
1716
- const l = at2();
1717
- let d2, y, p2 = false, m = false, g = "", S2, h2 = performance.now();
1718
- const f = A(s), v2 = a?.styleFrame ?? _e, T = (I2) => {
1719
- const V2 = I2 > 1 ? u ?? h.messages.error : i ?? h.messages.cancel;
1720
- m = I2 === 1, p2 && (W2(V2, I2), m && typeof r == "function" && r());
1721
- }, C2 = () => T(2), b2 = () => T(1), G2 = () => {
1722
- process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b2), process.on("SIGTERM", b2), process.on("exit", T), c2 && c2.addEventListener("abort", b2);
1723
- }, x2 = () => {
1724
- process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b2), process.removeListener("SIGTERM", b2), process.removeListener("exit", T), c2 && c2.removeEventListener("abort", b2);
1725
- }, A2 = () => {
1726
- if (S2 === void 0) return;
1727
- l && s.write(`
1728
- `);
1729
- const I2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
1730
- `);
1731
- I2.length > 1 && s.write(import_sisteransi2.cursor.up(I2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1732
- }, P2 = (I2) => I2.replace(/\.+$/, ""), N2 = (I2) => {
1733
- const V2 = (performance.now() - I2) / 1e3, B2 = Math.floor(V2 / 60), L2 = Math.floor(V2 % 60);
1734
- return B2 > 0 ? `[${B2}m ${L2}s]` : `[${L2}s]`;
1735
- }, D2 = a.withGuide ?? h.withGuide, rt2 = (I2 = "") => {
1736
- p2 = true, d2 = R({ output: s }), g = P2(I2), h2 = performance.now(), D2 && s.write(`${e("gray", $2)}
1737
- `);
1738
- let V2 = 0, B2 = 0;
1739
- G2(), y = setInterval(() => {
1740
- if (l && g === S2) return;
1741
- A2(), S2 = g;
1742
- const L2 = v2(n[V2]);
1743
- let Z2;
1744
- if (l) Z2 = `${L2} ${g}...`;
1745
- else if (t === "timer") Z2 = `${L2} ${g} ${N2(h2)}`;
1746
- else {
1747
- const kt = ".".repeat(Math.floor(B2)).slice(0, 3);
1748
- Z2 = `${L2} ${g}${kt}`;
1749
- }
1750
- const Nt = wrapAnsi(Z2, f, { hard: true, trim: false });
1751
- s.write(Nt), V2 = V2 + 1 < n.length ? V2 + 1 : 0, B2 = B2 < 4 ? B2 + 0.125 : 0;
1752
- }, o);
1753
- }, W2 = (I2 = "", V2 = 0, B2 = false) => {
1754
- if (!p2) return;
1755
- p2 = false, clearInterval(y), A2();
1756
- const L2 = V2 === 0 ? e("green", F2) : V2 === 1 ? e("red", ot2) : e("red", ut2);
1757
- g = I2 ?? g, B2 || (t === "timer" ? s.write(`${L2} ${g} ${N2(h2)}
1758
- `) : s.write(`${L2} ${g}
1759
- `)), x2(), d2();
1760
- };
1761
- return { start: rt2, stop: (I2 = "") => W2(I2, 0), message: (I2 = "") => {
1762
- g = P2(I2 ?? g);
1763
- }, cancel: (I2 = "") => W2(I2, 1), error: (I2 = "") => W2(I2, 2), clear: () => W2("", 0, true), get isCancelled() {
1764
- return m;
1765
- } };
1766
- };
1767
- var Vt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1768
- function Ie({ style: t = "heavy", max: r = 100, size: s = 40, ...i } = {}) {
1769
- const u = ft(i);
1770
- let n = 0, o = "";
1771
- const c2 = Math.max(1, r), a = Math.max(1, s), l = (m) => {
1772
- switch (m) {
1773
- case "initial":
1774
- case "active":
1775
- return (g) => e("magenta", g);
1776
- case "error":
1777
- case "cancel":
1778
- return (g) => e("red", g);
1779
- case "submit":
1780
- return (g) => e("green", g);
1781
- default:
1782
- return (g) => e("magenta", g);
1783
- }
1784
- }, d2 = (m, g) => {
1785
- const S2 = Math.floor(n / c2 * a);
1786
- return `${l(m)(Vt[t].repeat(S2))}${e("dim", Vt[t].repeat(a - S2))} ${g}`;
1787
- }, y = (m = "") => {
1788
- o = m, u.start(d2("initial", m));
1789
- }, p2 = (m = 1, g) => {
1790
- n = Math.min(c2, m + n), u.message(d2("active", g ?? o)), o = g ?? o;
1791
- };
1792
- return { start: y, stop: u.stop, cancel: u.cancel, error: u.error, clear: u.clear, advance: p2, isCancelled: u.isCancelled, message: (m) => p2(0, m) };
1793
- }
1794
- var it2 = (t, r) => t.includes(`
1795
- `) ? t.split(`
1796
- `).map((s) => r(s)).join(`
1797
- `) : r(t);
1798
- var Ee = (t) => {
1799
- const r = (s, i) => {
1800
- const u = s.label ?? String(s.value);
1801
- switch (i) {
1802
- case "disabled":
1803
- return `${e("gray", H2)} ${it2(u, (n) => e("gray", n))}${s.hint ? ` ${e("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1804
- case "selected":
1805
- return `${it2(u, (n) => e("dim", n))}`;
1806
- case "active":
1807
- return `${e("green", z2)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
1808
- case "cancelled":
1809
- return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
1810
- default:
1811
- return `${e("dim", H2)} ${it2(u, (n) => e("dim", n))}`;
1812
- }
1813
- };
1814
- return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1815
- const s = t.withGuide ?? h.withGuide, i = `${M(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, i), o = `${s ? `${e("gray", $2)}
1816
- ` : ""}${n}
1817
- `;
1818
- switch (this.state) {
1819
- case "submit": {
1820
- const c2 = s ? `${e("gray", $2)} ` : "", a = W(t.output, r(this.options[this.cursor], "selected"), c2);
1821
- return `${o}${a}`;
1822
- }
1823
- case "cancel": {
1824
- const c2 = s ? `${e("gray", $2)} ` : "", a = W(t.output, r(this.options[this.cursor], "cancelled"), c2);
1825
- return `${o}${a}${s ? `
1826
- ${e("gray", $2)}` : ""}`;
1827
- }
1828
- default: {
1829
- const c2 = s ? `${e("cyan", $2)} ` : "", a = s ? e("cyan", E2) : "", l = o.split(`
1830
- `).length, d2 = s ? 2 : 1;
1831
- return `${o}${c2}${Y2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c2.length, rowPadding: l + d2, style: (y, p2) => r(y, y.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
1832
- ${c2}`)}
1833
- ${a}
1834
- `;
1835
- }
1836
- }
1837
- } }).prompt();
1838
- };
1839
- var Ge = (t) => {
1840
- const r = (s, i = "inactive") => {
1841
- const u = s.label ?? String(s.value);
1842
- return i === "selected" ? `${e("dim", u)}` : i === "cancelled" ? `${e(["strikethrough", "dim"], u)}` : i === "active" ? `${e(["bgCyan", "gray"], ` ${s.value} `)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}` : `${e(["gray", "bgWhite", "inverse"], ` ${s.value} `)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
1843
- };
1844
- return new at({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, caseSensitive: t.caseSensitive, render() {
1845
- const s = t.withGuide ?? h.withGuide, i = `${s ? `${e("gray", $2)}
1846
- ` : ""}${M(this.state)} ${t.message}
1847
- `;
1848
- switch (this.state) {
1849
- case "submit": {
1850
- const u = s ? `${e("gray", $2)} ` : "", n = this.options.find((c2) => c2.value === this.value) ?? t.options[0], o = W(t.output, r(n, "selected"), u);
1851
- return `${i}${o}`;
1852
- }
1853
- case "cancel": {
1854
- const u = s ? `${e("gray", $2)} ` : "", n = W(t.output, r(this.options[0], "cancelled"), u);
1855
- return `${i}${n}${s ? `
1856
- ${e("gray", $2)}` : ""}`;
1857
- }
1858
- default: {
1859
- const u = s ? `${e("cyan", $2)} ` : "", n = s ? e("cyan", E2) : "", o = this.options.map((c2, a) => W(t.output, r(c2, a === this.cursor ? "active" : "inactive"), u)).join(`
1860
- `);
1861
- return `${i}${o}
1862
- ${n}
1863
- `;
1864
- }
1865
- }
1866
- } }).prompt();
1867
- };
1868
- var jt = `${e("gray", $2)} `;
1869
- var K2 = { message: async (t, { symbol: r = e("gray", $2) } = {}) => {
1870
- process.stdout.write(`${e("gray", $2)}
1871
- ${r} `);
1872
- let s = 3;
1873
- for await (let i of t) {
1874
- i = i.replace(/\n/g, `
1875
- ${jt}`), i.includes(`
1876
- `) && (s = 3 + nt2(i.slice(i.lastIndexOf(`
1877
- `))).length);
1878
- const u = nt2(i).length;
1879
- s + u < process.stdout.columns ? (s += u, process.stdout.write(i)) : (process.stdout.write(`
1880
- ${jt}${i.trimStart()}`), s = 3 + nt2(i.trimStart()).length);
1881
- }
1882
- process.stdout.write(`
1883
- `);
1884
- }, info: (t) => K2.message(t, { symbol: e("blue", ht2) }), success: (t) => K2.message(t, { symbol: e("green", pt) }), step: (t) => K2.message(t, { symbol: e("green", F2) }), warn: (t) => K2.message(t, { symbol: e("yellow", mt) }), warning: (t) => K2.warn(t), error: (t) => K2.message(t, { symbol: e("red", gt) }) };
1885
- var xe = async (t, r) => {
1886
- for (const s of t) {
1887
- if (s.enabled === false) continue;
1888
- const i = ft(r);
1889
- i.start(s.title);
1890
- const u = await s.task(i.message);
1891
- i.stop(u || s.title);
1892
- }
1893
- };
1894
- var Oe = (t) => t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "");
1895
- var Me = (t) => {
1896
- const r = t.output ?? process.stdout, s = A(r), i = e("gray", $2), u = t.spacing ?? 1, n = 3, o = t.retainLog === true, c2 = !at2() && Tt(r);
1897
- r.write(`${i}
1898
- `), r.write(`${e("green", F2)} ${t.title}
1899
- `);
1900
- for (let h2 = 0; h2 < u; h2++) r.write(`${i}
1901
- `);
1902
- const a = [{ value: "", full: "" }];
1903
- let l = false;
1904
- const d2 = (h2) => {
1905
- if (a.length === 0) return;
1906
- let f = 0;
1907
- h2 && (f += u + 2);
1908
- for (const v2 of a) {
1909
- const { value: T, result: C2 } = v2;
1910
- let b2 = C2?.message ?? T;
1911
- if (b2.length === 0) continue;
1912
- C2 === void 0 && v2.header !== void 0 && v2.header !== "" && (b2 += `
1913
- ${v2.header}`);
1914
- const G2 = b2.split(`
1915
- `).reduce((x2, A2) => A2 === "" ? x2 + 1 : x2 + Math.ceil((A2.length + n) / s), 0);
1916
- f += G2;
1917
- }
1918
- f > 0 && (f += 1, r.write(import_sisteransi2.erase.lines(f)));
1919
- }, y = (h2, f, v2) => {
1920
- const T = v2 ? `${h2.full}
1921
- ${h2.value}` : h2.value;
1922
- h2.header !== void 0 && h2.header !== "" && R2.message(h2.header.split(`
1923
- `).map((C2) => e("bold", C2)), { output: r, secondarySymbol: i, symbol: i, spacing: 0 }), R2.message(T.split(`
1924
- `).map((C2) => e("dim", C2)), { output: r, secondarySymbol: i, symbol: i, spacing: f ?? u });
1925
- }, p2 = () => {
1926
- for (const h2 of a) {
1927
- const { header: f, value: v2, full: T } = h2;
1928
- (f === void 0 || f.length === 0) && v2.length === 0 || y(h2, void 0, o === true && T.length > 0);
1929
- }
1930
- }, m = (h2, f, v2) => {
1931
- if (d2(false), (v2?.raw !== true || !l) && h2.value !== "" && (h2.value += `
1932
- `), h2.value += Oe(f), l = v2?.raw === true, t.limit !== void 0) {
1933
- const T = h2.value.split(`
1934
- `), C2 = T.length - t.limit;
1935
- if (C2 > 0) {
1936
- const b2 = T.splice(0, C2);
1937
- o && (h2.full += (h2.full === "" ? "" : `
1938
- `) + b2.join(`
1939
- `));
1940
- }
1941
- h2.value = T.join(`
1942
- `);
1943
- }
1944
- c2 && g();
1945
- }, g = () => {
1946
- for (const h2 of a) h2.result ? h2.result.status === "error" ? R2.error(h2.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : R2.success(h2.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : h2.value !== "" && y(h2, 0);
1947
- }, S2 = (h2, f) => {
1948
- d2(false), h2.result = f, c2 && g();
1949
- };
1950
- return { message(h2, f) {
1951
- m(a[0], h2, f);
1952
- }, group(h2) {
1953
- const f = { header: h2, value: "", full: "" };
1954
- return a.push(f), { message(v2, T) {
1955
- m(f, v2, T);
1956
- }, error(v2) {
1957
- S2(f, { status: "error", message: v2 });
1958
- }, success(v2) {
1959
- S2(f, { status: "success", message: v2 });
1960
- } };
1961
- }, error(h2, f) {
1962
- d2(true), R2.error(h2, { output: r, secondarySymbol: i, spacing: 1 }), f?.showLog !== false && p2(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1963
- }, success(h2, f) {
1964
- d2(true), R2.success(h2, { output: r, secondarySymbol: i, spacing: 1 }), f?.showLog === true && p2(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1965
- } };
1966
- };
1967
- var Re = (t) => new ht({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
1968
- const r = t?.withGuide ?? h.withGuide, s = `${`${r ? `${e("gray", $2)}
1969
- ` : ""}${M(this.state)} `}${t.message}
1970
- `, i = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "";
1971
- switch (this.state) {
1972
- case "error": {
1973
- const o = this.error ? ` ${e("yellow", this.error)}` : "", c2 = r ? `${e("yellow", $2)} ` : "", a = r ? e("yellow", E2) : "";
1974
- return `${s.trim()}
1975
- ${c2}${u}
1976
- ${a}${o}
1977
- `;
1978
- }
1979
- case "submit": {
1980
- const o = n ? ` ${e("dim", n)}` : "", c2 = r ? e("gray", $2) : "";
1981
- return `${s}${c2}${o}`;
1982
- }
1983
- case "cancel": {
1984
- const o = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c2 = r ? e("gray", $2) : "";
1985
- return `${s}${c2}${o}${n.trim() ? `
1986
- ${c2}` : ""}`;
1987
- }
1988
- default: {
1989
- const o = r ? `${e("cyan", $2)} ` : "", c2 = r ? e("cyan", E2) : "";
1990
- return `${s}${o}${u}
1991
- ${c2}
1992
- `;
1993
- }
1994
- }
1995
- } }).prompt();
1996
-
1997
- export {
1998
- h,
1999
- j,
2000
- q,
2001
- tt2 as tt,
2002
- at2 as at,
2003
- Tt,
2004
- w2 as w,
2005
- _t,
2006
- ot2 as ot,
2007
- ut2 as ut,
2008
- F2 as F,
2009
- lt,
2010
- $2 as $,
2011
- E2 as E,
2012
- It,
2013
- Et,
2014
- z2 as z,
2015
- H2 as H,
2016
- et2 as et,
2017
- U2 as U,
2018
- J2 as J,
2019
- Gt,
2020
- st2 as st,
2021
- ct,
2022
- xt,
2023
- $t,
2024
- dt,
2025
- Ot,
2026
- ht2 as ht,
2027
- pt,
2028
- mt,
2029
- gt,
2030
- M,
2031
- yt,
2032
- Y2 as Y,
2033
- At,
2034
- ie,
2035
- oe,
2036
- ue,
2037
- le,
2038
- he,
2039
- pe,
2040
- R2 as R,
2041
- me,
2042
- ge,
2043
- ye,
2044
- fe,
2045
- ve,
2046
- Se,
2047
- Ce,
2048
- Te,
2049
- ft,
2050
- Ie,
2051
- Ee,
2052
- Ge,
2053
- K2 as K,
2054
- xe,
2055
- Me,
2056
- Re
2057
- };