@visulima/tui 1.0.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +54 -2444
  3. package/MIGRATION-GUIDE.md +164 -0
  4. package/README.md +15 -12
  5. package/dist/components/box.d.ts +3 -4
  6. package/dist/components/canvas.d.ts +2 -2
  7. package/dist/components/canvas.js +1 -1
  8. package/dist/components/cursor.d.ts +3 -4
  9. package/dist/components/error-boundary.d.ts +16 -0
  10. package/dist/components/error-boundary.js +1 -0
  11. package/dist/components/error-overview.d.ts +8 -0
  12. package/dist/components/error-overview.js +1 -0
  13. package/dist/components/static-render.d.ts +3 -4
  14. package/dist/components/static.d.ts +1 -2
  15. package/dist/components/text.d.ts +1 -2
  16. package/dist/core/index.d.ts +1 -2
  17. package/dist/core/index.js +1 -1
  18. package/dist/ink/canvas/index.d.ts +24 -0
  19. package/dist/ink/canvas/index.js +1 -0
  20. package/dist/ink/hooks/use-app.d.ts +1 -32
  21. package/dist/ink/hooks/use-app.js +1 -1
  22. package/dist/ink/hooks/use-box-metrics.d.ts +3 -4
  23. package/dist/ink/hooks/use-cursor.d.ts +1 -1
  24. package/dist/ink/hooks/use-input.js +2 -2
  25. package/dist/ink/hooks/use-paste.js +1 -1
  26. package/dist/ink/hooks/use-persistent-state.js +2 -2
  27. package/dist/ink/hooks/use-text-selection.d.ts +4 -5
  28. package/dist/ink/hooks/use-window-size.js +1 -1
  29. package/dist/ink/index.d.ts +7 -7
  30. package/dist/ink/index.js +1 -1
  31. package/dist/ink/mouse/use-element-position.d.ts +3 -4
  32. package/dist/ink/mouse/use-on-mouse-click.d.ts +3 -4
  33. package/dist/ink/mouse/use-on-mouse-hover.d.ts +3 -4
  34. package/dist/ink/mouse/use-on-mouse-state.d.ts +3 -4
  35. package/dist/ink/public/cursor.d.ts +47 -0
  36. package/dist/ink/public/cursor.js +1 -0
  37. package/dist/ink/public/dom.d.ts +6 -0
  38. package/dist/ink/public/dom.js +0 -0
  39. package/dist/ink/public/highlighter.d.ts +54 -0
  40. package/dist/ink/public/highlighter.js +1 -0
  41. package/dist/ink/public/input.d.ts +14 -0
  42. package/dist/ink/public/input.js +1 -0
  43. package/dist/ink/public/styles.d.ts +4 -0
  44. package/dist/ink/public/styles.js +0 -0
  45. package/dist/ink/public/utils.d.ts +5 -0
  46. package/dist/ink/public/utils.js +1 -0
  47. package/dist/packem_chunks/devtools.js +1 -1
  48. package/dist/packem_shared/{DevTools-k6uiVzqv.js → DevTools-D9tfChBc.js} +1 -1
  49. package/dist/packem_shared/InputParser-CiBitCva.js +2 -0
  50. package/dist/packem_shared/TuiApp-DjIgv5Sk.js +1 -0
  51. package/dist/packem_shared/app-context-DTm1_XBA.js +1 -0
  52. package/dist/packem_shared/app-context.d-CG88lgkg.d.ts +56 -0
  53. package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
  54. package/dist/packem_shared/{buffer.d-EJkZr8uH.d.ts → buffer.d-j_dP5JyC.d.ts} +29 -1
  55. package/dist/packem_shared/buildCursorOnlySequence-CerkmjWt.js +1 -0
  56. package/dist/packem_shared/{braille-ch3O5D7I.js → createBrailleGrid-BTOQrujS.js} +1 -1
  57. package/dist/packem_shared/createCanvasBuffer-CL6sAM-A.js +1 -0
  58. package/dist/packem_shared/disposeHighlighter-D9OkrhwX.js +1 -0
  59. package/dist/packem_shared/{dom.d-B4kXbaVY.d.ts → dom.d-g-nsYquD.d.ts} +3 -4
  60. package/dist/packem_shared/formatDuration-Bdx4ZgRh.js +1 -0
  61. package/dist/packem_shared/index-Dl9I2_QH.js +75 -0
  62. package/dist/packem_shared/input.d-D-Yxqha8.d.ts +172 -0
  63. package/dist/packem_shared/{input-utils-BSWCb4F_.js → isControlCharacter-uDgBe_32.js} +1 -1
  64. package/dist/packem_shared/{reconciler-CFyBVf7l.js → reconciler-DhUGYWCr.js} +1 -1
  65. package/dist/packem_shared/render-D7aV_hO1.js +24 -0
  66. package/dist/packem_shared/{render-DFZ8NHlG.js → render-DMcWfI6-.js} +1 -1
  67. package/dist/packem_shared/{render.d-CBnYBDk2.d.ts → render.d-BvfwvSCx.d.ts} +20 -2
  68. package/dist/packem_shared/{renderToString-L_bpw4OQ.js → renderToString-DkTmJPaS.js} +1 -1
  69. package/dist/packem_shared/{renderToString-DwXFY8Qh.js → renderToString-DqLFFPvO.js} +1 -1
  70. package/dist/packem_shared/renderToken-DjiQ6dfv.js +1 -0
  71. package/dist/packem_shared/renderTreeToBuffer-BpSD0sBJ.js +2 -0
  72. package/dist/packem_shared/{renderer-k-xShm1P.js → renderer-Cs0KEr1o.js} +4 -4
  73. package/dist/packem_shared/{selection.d-CI3_p8wg.d.ts → selection.d-KWphH--_.d.ts} +1 -1
  74. package/dist/packem_shared/{styles.d-cMo36xQz.d.ts → styles.d-D7iZuNC-.d.ts} +97 -1
  75. package/dist/packem_shared/utils-C8l_3Dzw.js +1 -0
  76. package/dist/react/index.d.ts +1 -2
  77. package/dist/react/index.js +1 -1
  78. package/dist/testing/index.d.ts +5 -5
  79. package/dist/testing/index.js +1 -1
  80. package/index.js +26 -26
  81. package/package.json +49 -384
  82. package/dist/components/accordion.d.ts +0 -59
  83. package/dist/components/accordion.js +0 -1
  84. package/dist/components/alert.d.ts +0 -26
  85. package/dist/components/alert.js +0 -1
  86. package/dist/components/animate-presence.d.ts +0 -18
  87. package/dist/components/animate-presence.js +0 -1
  88. package/dist/components/approval-prompt.d.ts +0 -65
  89. package/dist/components/approval-prompt.js +0 -1
  90. package/dist/components/area-chart.d.ts +0 -66
  91. package/dist/components/area-chart.js +0 -1
  92. package/dist/components/badge.d.ts +0 -22
  93. package/dist/components/badge.js +0 -1
  94. package/dist/components/bar-chart.d.ts +0 -67
  95. package/dist/components/bar-chart.js +0 -1
  96. package/dist/components/big-text.d.ts +0 -81
  97. package/dist/components/big-text.js +0 -1
  98. package/dist/components/blink-dot.d.ts +0 -36
  99. package/dist/components/blink-dot.js +0 -1
  100. package/dist/components/breadcrumb.d.ts +0 -33
  101. package/dist/components/breadcrumb.js +0 -1
  102. package/dist/components/button.d.ts +0 -45
  103. package/dist/components/button.js +0 -1
  104. package/dist/components/calendar.d.ts +0 -72
  105. package/dist/components/calendar.js +0 -1
  106. package/dist/components/card.d.ts +0 -57
  107. package/dist/components/card.js +0 -1
  108. package/dist/components/checkbox.d.ts +0 -48
  109. package/dist/components/checkbox.js +0 -1
  110. package/dist/components/code.d.ts +0 -48
  111. package/dist/components/code.js +0 -2
  112. package/dist/components/collapsible.d.ts +0 -53
  113. package/dist/components/collapsible.js +0 -1
  114. package/dist/components/command-block.d.ts +0 -47
  115. package/dist/components/command-block.js +0 -4
  116. package/dist/components/command-palette.d.ts +0 -82
  117. package/dist/components/command-palette.js +0 -1
  118. package/dist/components/confirm-dialog.d.ts +0 -75
  119. package/dist/components/confirm-dialog.js +0 -1
  120. package/dist/components/confirm-input.d.ts +0 -38
  121. package/dist/components/confirm-input.js +0 -1
  122. package/dist/components/console-overlay.d.ts +0 -54
  123. package/dist/components/console-overlay.js +0 -1
  124. package/dist/components/content-switcher.d.ts +0 -57
  125. package/dist/components/content-switcher.js +0 -1
  126. package/dist/components/controlled-scroll-view.d.ts +0 -61
  127. package/dist/components/controlled-scroll-view.js +0 -1
  128. package/dist/components/date-picker.d.ts +0 -65
  129. package/dist/components/date-picker.js +0 -1
  130. package/dist/components/definition-list.d.ts +0 -44
  131. package/dist/components/definition-list.js +0 -1
  132. package/dist/components/dialog.d.ts +0 -117
  133. package/dist/components/dialog.js +0 -1
  134. package/dist/components/diff-view.d.ts +0 -85
  135. package/dist/components/diff-view.js +0 -1
  136. package/dist/components/divider.d.ts +0 -49
  137. package/dist/components/divider.js +0 -1
  138. package/dist/components/file-picker-entry.d.ts +0 -104
  139. package/dist/components/file-picker-entry.js +0 -1
  140. package/dist/components/form.d.ts +0 -81
  141. package/dist/components/form.js +0 -1
  142. package/dist/components/gauge.d.ts +0 -87
  143. package/dist/components/gauge.js +0 -1
  144. package/dist/components/gradient.d.ts +0 -42
  145. package/dist/components/gradient.js +0 -1
  146. package/dist/components/heading.d.ts +0 -33
  147. package/dist/components/heading.js +0 -1
  148. package/dist/components/heatmap.d.ts +0 -62
  149. package/dist/components/heatmap.js +0 -1
  150. package/dist/components/help.d.ts +0 -52
  151. package/dist/components/help.js +0 -1
  152. package/dist/components/histogram.d.ts +0 -62
  153. package/dist/components/histogram.js +0 -1
  154. package/dist/components/kbd.d.ts +0 -31
  155. package/dist/components/kbd.js +0 -1
  156. package/dist/components/line-chart.d.ts +0 -109
  157. package/dist/components/line-chart.js +0 -1
  158. package/dist/components/link.d.ts +0 -38
  159. package/dist/components/link.js +0 -1
  160. package/dist/components/loading-indicator.d.ts +0 -29
  161. package/dist/components/loading-indicator.js +0 -1
  162. package/dist/components/markdown.d.ts +0 -40
  163. package/dist/components/markdown.js +0 -1
  164. package/dist/components/masked-input.d.ts +0 -50
  165. package/dist/components/masked-input.js +0 -1
  166. package/dist/components/menu.d.ts +0 -78
  167. package/dist/components/menu.js +0 -1
  168. package/dist/components/message-bubble.d.ts +0 -43
  169. package/dist/components/message-bubble.js +0 -1
  170. package/dist/components/model-badge.d.ts +0 -39
  171. package/dist/components/model-badge.js +0 -1
  172. package/dist/components/multi-select.d.ts +0 -65
  173. package/dist/components/multi-select.js +0 -1
  174. package/dist/components/operation-tree.d.ts +0 -49
  175. package/dist/components/operation-tree.js +0 -1
  176. package/dist/components/option-list.d.ts +0 -47
  177. package/dist/components/option-list.js +0 -1
  178. package/dist/components/ordered-list.d.ts +0 -24
  179. package/dist/components/ordered-list.js +0 -1
  180. package/dist/components/paginator.d.ts +0 -69
  181. package/dist/components/paginator.js +0 -1
  182. package/dist/components/paragraph.d.ts +0 -38
  183. package/dist/components/paragraph.js +0 -1
  184. package/dist/components/placeholder.d.ts +0 -55
  185. package/dist/components/placeholder.js +0 -1
  186. package/dist/components/progress-bar.d.ts +0 -56
  187. package/dist/components/progress-bar.js +0 -1
  188. package/dist/components/radio-group.d.ts +0 -74
  189. package/dist/components/radio-group.js +0 -1
  190. package/dist/components/scatter-plot.d.ts +0 -35
  191. package/dist/components/scatter-plot.js +0 -1
  192. package/dist/components/scroll-bar-box.d.ts +0 -37
  193. package/dist/components/scroll-bar-box.js +0 -1
  194. package/dist/components/scroll-bar.d.ts +0 -25
  195. package/dist/components/scroll-bar.js +0 -1
  196. package/dist/components/scroll-list.d.ts +0 -20
  197. package/dist/components/scroll-list.js +0 -1
  198. package/dist/components/scroll-view.d.ts +0 -10
  199. package/dist/components/scroll-view.js +0 -1
  200. package/dist/components/search-input.d.ts +0 -55
  201. package/dist/components/search-input.js +0 -1
  202. package/dist/components/select-input-indicator.d.ts +0 -32
  203. package/dist/components/select-input-indicator.js +0 -1
  204. package/dist/components/select-input-item.d.ts +0 -41
  205. package/dist/components/select-input-item.js +0 -1
  206. package/dist/components/select-input.d.ts +0 -110
  207. package/dist/components/select-input.js +0 -1
  208. package/dist/components/shimmer-text.d.ts +0 -47
  209. package/dist/components/shimmer-text.js +0 -1
  210. package/dist/components/slider.d.ts +0 -103
  211. package/dist/components/slider.js +0 -1
  212. package/dist/components/sparkline.d.ts +0 -35
  213. package/dist/components/sparkline.js +0 -1
  214. package/dist/components/spinner.d.ts +0 -17
  215. package/dist/components/spinner.js +0 -1
  216. package/dist/components/status-line.d.ts +0 -37
  217. package/dist/components/status-line.js +0 -1
  218. package/dist/components/status-message.d.ts +0 -21
  219. package/dist/components/status-message.js +0 -1
  220. package/dist/components/stepper.d.ts +0 -48
  221. package/dist/components/stepper.js +0 -1
  222. package/dist/components/stopwatch.d.ts +0 -49
  223. package/dist/components/stopwatch.js +0 -1
  224. package/dist/components/streaming-text.d.ts +0 -46
  225. package/dist/components/streaming-text.js +0 -1
  226. package/dist/components/switch.d.ts +0 -55
  227. package/dist/components/switch.js +0 -1
  228. package/dist/components/tab.d.ts +0 -19
  229. package/dist/components/tab.js +0 -1
  230. package/dist/components/table.d.ts +0 -119
  231. package/dist/components/table.js +0 -1
  232. package/dist/components/tabs.d.ts +0 -107
  233. package/dist/components/tabs.js +0 -1
  234. package/dist/components/tag.d.ts +0 -35
  235. package/dist/components/tag.js +0 -1
  236. package/dist/components/text-input.d.ts +0 -48
  237. package/dist/components/text-input.js +0 -1
  238. package/dist/components/textarea.d.ts +0 -68
  239. package/dist/components/textarea.js +0 -2
  240. package/dist/components/timer.d.ts +0 -59
  241. package/dist/components/timer.js +0 -1
  242. package/dist/components/toast.d.ts +0 -49
  243. package/dist/components/toast.js +0 -1
  244. package/dist/components/tooltip.d.ts +0 -43
  245. package/dist/components/tooltip.js +0 -1
  246. package/dist/components/transition.d.ts +0 -74
  247. package/dist/components/transition.js +0 -1
  248. package/dist/components/tree-view-entry.d.ts +0 -357
  249. package/dist/components/tree-view-entry.js +0 -1
  250. package/dist/components/unordered-list.d.ts +0 -30
  251. package/dist/components/unordered-list.js +0 -1
  252. package/dist/ink/hooks/use-linked-scroll.d.ts +0 -49
  253. package/dist/ink/hooks/use-linked-scroll.js +0 -1
  254. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +0 -1
  255. package/dist/packem_shared/FilePicker-BLS9nOPz.js +0 -1
  256. package/dist/packem_shared/InputParser-CtwkCbrQ.js +0 -2
  257. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +0 -1
  258. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +0 -1
  259. package/dist/packem_shared/ScrollList-BBAnRsrC.js +0 -1
  260. package/dist/packem_shared/ScrollView-CHAo7Epj.js +0 -1
  261. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +0 -1
  262. package/dist/packem_shared/TreeView-BsvLCsf0.js +0 -1
  263. package/dist/packem_shared/TuiApp-BPL8v1i1.js +0 -1
  264. package/dist/packem_shared/app-context-BVpKlG1z.js +0 -1
  265. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +0 -1
  266. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +0 -12
  267. package/dist/packem_shared/format-time-fjoQHMxD.js +0 -1
  268. package/dist/packem_shared/input.d-CgxV2e8U.d.ts +0 -90
  269. package/dist/packem_shared/line-chart-C7CUrvVs.js +0 -1
  270. package/dist/packem_shared/render-CuQecTAs.js +0 -24
  271. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +0 -2
  272. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +0 -119
  273. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +0 -1
  274. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +0 -1
  275. package/dist/packem_shared/useTreeView-D5ifGwG3.js +0 -1
  276. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +0 -1
  277. package/dist/packem_shared/utils-Bup8lyK8.js +0 -1
  278. package/dist/packem_shared/variant-config-BJqpNo7H.js +0 -1
  279. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +0 -2
package/dist/ink/index.js CHANGED
@@ -1 +1 @@
1
- import{clearOsc52 as o,isOsc52Supported as r,writeOsc52 as a}from"../packem_shared/clearOsc52-BUpnQOav.js";import{COLOR_BLINDNESS_COMPENSATION as l,COLOR_BLINDNESS_SIMULATION as i,IDENTITY_MATRIX as n,applyColorMatrix as u,hexToRgb as f,rgbToHex as p,transformHexColor as c}from"../packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js";import{g as d,i as x}from"../packem_shared/dom-rphpG0kf.js";import{IMECompositionBuffer as S,isIMEInput as h}from"../packem_shared/IMECompositionBuffer-VhC9HRCv.js";import{kittyFlags as M,kittyModifiers as O}from"../packem_shared/kittyFlags-g8ALyoCU.js";import{processLayout as I}from"../packem_shared/processLayout-I83k6vXE.js";import{c as b,a as C,b as E,g as R,d as N,e as B,f as P,h as H,i as v,j as W,k,l as A,R as _}from"../packem_shared/measure-element-D4M9iSYp.js";import{c as F,a as z,i as q,s as w,b as j,t as Q}from"../packem_shared/measure-text-B7juNq4Y.js";import{default as V}from"../packem_shared/render-CuQecTAs.js";import{default as Y}from"../packem_shared/renderToString-DwXFY8Qh.js";import{default as J,ResizeObserverEntry as K}from"../packem_shared/ResizeObserver-BI9bDy-j.js";import{calculateScroll as $,getScrollHeight as ee,getScrollLeft as te,getScrollTop as oe,getScrollWidth as re}from"../packem_shared/calculateScroll-D4Y_JR4H.js";import{Range as se,Selection as le,applySelectionToStyledLine as ie,comparePoints as ne}from"../packem_shared/Range-BsVYNWtg.js";import{squashTextNodesWithMap as fe}from"../packem_shared/squashTextNodesWithMap-BmUSBPfc.js";import{isTerminalPaletteQuerySupported as ce,queryTerminalPalette as me}from"../packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js";import{wrapOrTruncateStyledLine as xe}from"../packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js";import{default as Se}from"../packem_shared/Fullscreen-BRhuBLBh.js";import{default as Te}from"../packem_shared/MouseProvider-DUqQ3Eaa.js";import{default as Oe}from"../packem_shared/isIntersecting-Bo2npvMR.js";import{default as Ie}from"./mouse/use-mouse-action.js";import{default as be}from"./mouse/use-mouse.js";import{default as Ee}from"./mouse/use-mouse-position.js";import{default as Ne}from"./mouse/use-on-mouse-hover.js";import{default as Pe}from"./mouse/use-on-mouse-state.js";import{d as ve}from"../packem_shared/ansi-parser-DlgLtOYO.js";import{useElementDimensions as ke,useElementPosition as Ae}from"./mouse/use-element-position.js";import{useOnMouseClick as De}from"./mouse/use-on-mouse-click.js";export{l as COLOR_BLINDNESS_COMPENSATION,i as COLOR_BLINDNESS_SIMULATION,Se as Fullscreen,n as IDENTITY_MATRIX,S as IMECompositionBuffer,Te as MouseProvider,se as Range,J as ResizeObserver,K as ResizeObserverEntry,le as Selection,u as applyColorMatrix,ie as applySelectionToStyledLine,$ as calculateScroll,b as calculateScrollbarLayout,C as calculateScrollbarThumb,o as clearOsc52,F as clearStringWidthCache,z as clearStyledLineCache,E as collectSortedFragments,ne as comparePoints,R as getAddedScrollHeight,N as getBoundingBox,B as getHorizontalScrollbarBoundingBox,P as getInnerHeight,H as getInnerWidth,d as getPathToRoot,v as getRelativeLeft,W as getRelativeTop,ee as getScrollHeight,te as getScrollLeft,oe as getScrollTop,re as getScrollWidth,k as getText,A as getVerticalScrollbarBoundingBox,f as hexToRgb,q as inkCharacterWidth,h as isIMEInput,Oe as isIntersecting,x as isNodeSelectable,r as isOsc52Supported,ce as isTerminalPaletteQuerySupported,M as kittyFlags,O as kittyModifiers,_ as measureElement,ve as parseSgrMouse,I as processLayout,me as queryTerminalPalette,V as render,Y as renderToString,p as rgbToHex,w as setEnableStyledLineCache,j as setStringWidthFunction,fe as squashTextNodesWithMap,Q as toStyledLine,c as transformHexColor,ke as useElementDimensions,Ae as useElementPosition,Ie as useMouseAction,be as useMouseContext,Ee as useMousePosition,De as useOnMouseClick,Ne as useOnMouseHover,Pe as useOnMouseState,xe as wrapOrTruncateStyledLine,a as writeOsc52};
1
+ import{clearOsc52 as o,isOsc52Supported as r,writeOsc52 as a}from"../packem_shared/clearOsc52-BUpnQOav.js";import{COLOR_BLINDNESS_COMPENSATION as l,COLOR_BLINDNESS_SIMULATION as i,IDENTITY_MATRIX as n,applyColorMatrix as u,hexToRgb as f,rgbToHex as p,transformHexColor as c}from"../packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js";import{g as d,i as x}from"../packem_shared/dom-rphpG0kf.js";import{IMECompositionBuffer as S,isIMEInput as h}from"../packem_shared/IMECompositionBuffer-VhC9HRCv.js";import{kittyFlags as M,kittyModifiers as O}from"../packem_shared/kittyFlags-g8ALyoCU.js";import{processLayout as I}from"../packem_shared/processLayout-I83k6vXE.js";import{c as b,a as C,b as E,g as R,d as N,e as B,f as P,h as H,i as v,j as W,k,l as A,R as _}from"../packem_shared/measure-element-D4M9iSYp.js";import{c as F,a as z,i as q,s as w,b as j,t as Q}from"../packem_shared/measure-text-B7juNq4Y.js";import{default as V}from"../packem_shared/render-D7aV_hO1.js";import{default as Y}from"../packem_shared/renderToString-DqLFFPvO.js";import{default as J,ResizeObserverEntry as K}from"../packem_shared/ResizeObserver-BI9bDy-j.js";import{calculateScroll as $,getScrollHeight as ee,getScrollLeft as te,getScrollTop as oe,getScrollWidth as re}from"../packem_shared/calculateScroll-D4Y_JR4H.js";import{Range as se,Selection as le,applySelectionToStyledLine as ie,comparePoints as ne}from"../packem_shared/Range-BsVYNWtg.js";import{squashTextNodesWithMap as fe}from"../packem_shared/squashTextNodesWithMap-BmUSBPfc.js";import{isTerminalPaletteQuerySupported as ce,queryTerminalPalette as me}from"../packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js";import{wrapOrTruncateStyledLine as xe}from"../packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js";import{default as Se}from"../packem_shared/Fullscreen-BRhuBLBh.js";import{default as Te}from"../packem_shared/MouseProvider-DUqQ3Eaa.js";import{default as Oe}from"../packem_shared/isIntersecting-Bo2npvMR.js";import{default as Ie}from"./mouse/use-mouse-action.js";import{default as be}from"./mouse/use-mouse.js";import{default as Ee}from"./mouse/use-mouse-position.js";import{default as Ne}from"./mouse/use-on-mouse-hover.js";import{default as Pe}from"./mouse/use-on-mouse-state.js";import{d as ve}from"../packem_shared/ansi-parser-DlgLtOYO.js";import{useElementDimensions as ke,useElementPosition as Ae}from"./mouse/use-element-position.js";import{useOnMouseClick as De}from"./mouse/use-on-mouse-click.js";export{l as COLOR_BLINDNESS_COMPENSATION,i as COLOR_BLINDNESS_SIMULATION,Se as Fullscreen,n as IDENTITY_MATRIX,S as IMECompositionBuffer,Te as MouseProvider,se as Range,J as ResizeObserver,K as ResizeObserverEntry,le as Selection,u as applyColorMatrix,ie as applySelectionToStyledLine,$ as calculateScroll,b as calculateScrollbarLayout,C as calculateScrollbarThumb,o as clearOsc52,F as clearStringWidthCache,z as clearStyledLineCache,E as collectSortedFragments,ne as comparePoints,R as getAddedScrollHeight,N as getBoundingBox,B as getHorizontalScrollbarBoundingBox,P as getInnerHeight,H as getInnerWidth,d as getPathToRoot,v as getRelativeLeft,W as getRelativeTop,ee as getScrollHeight,te as getScrollLeft,oe as getScrollTop,re as getScrollWidth,k as getText,A as getVerticalScrollbarBoundingBox,f as hexToRgb,q as inkCharacterWidth,h as isIMEInput,Oe as isIntersecting,x as isNodeSelectable,r as isOsc52Supported,ce as isTerminalPaletteQuerySupported,M as kittyFlags,O as kittyModifiers,_ as measureElement,ve as parseSgrMouse,I as processLayout,me as queryTerminalPalette,V as render,Y as renderToString,p as rgbToHex,w as setEnableStyledLineCache,j as setStringWidthFunction,fe as squashTextNodesWithMap,Q as toStyledLine,c as transformHexColor,ke as useElementDimensions,Ae as useElementPosition,Ie as useMouseAction,be as useMouseContext,Ee as useMousePosition,De as useOnMouseClick,Ne as useOnMouseHover,Pe as useOnMouseState,xe as wrapOrTruncateStyledLine,a as writeOsc52};
@@ -1,10 +1,9 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-g-nsYquD.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
4
+ import "../public/cursor.js";
5
5
  import '@visulima/colorize';
6
- import 'cli-boxes';
7
- import "../../packem_shared/styles.d-cMo36xQz.js";
6
+ import "../../packem_shared/styles.d-D7iZuNC-.js";
8
7
  import 'type-fest';
9
8
  declare const getElementPosition: (node: DOMElement | null) => {
10
9
  left: number;
@@ -1,11 +1,10 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-g-nsYquD.js";
3
3
  import { e as MouseButton } from "../../packem_shared/mouse-context.d-BfL9xGk_.js";
4
4
  import 'yoga-layout';
5
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
5
+ import "../public/cursor.js";
6
6
  import '@visulima/colorize';
7
- import 'cli-boxes';
8
- import "../../packem_shared/styles.d-cMo36xQz.js";
7
+ import "../../packem_shared/styles.d-D7iZuNC-.js";
9
8
  import 'type-fest';
10
9
  import 'node:events';
11
10
  type UseOnMouseClickOptions = {
@@ -1,10 +1,9 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-g-nsYquD.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
4
+ import "../public/cursor.js";
5
5
  import '@visulima/colorize';
6
- import 'cli-boxes';
7
- import "../../packem_shared/styles.d-cMo36xQz.js";
6
+ import "../../packem_shared/styles.d-D7iZuNC-.js";
8
7
  import 'type-fest';
9
8
  declare const useOnMouseHover: (ref: RefObject<DOMElement | null>, onChange: (event: boolean) => void) => void;
10
9
  export { useOnMouseHover as default };
@@ -1,10 +1,9 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-g-nsYquD.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
4
+ import "../public/cursor.js";
5
5
  import '@visulima/colorize';
6
- import 'cli-boxes';
7
- import "../../packem_shared/styles.d-cMo36xQz.js";
6
+ import "../../packem_shared/styles.d-D7iZuNC-.js";
8
7
  import 'type-fest';
9
8
  declare const useOnMouseState: (ref: RefObject<DOMElement | null>) => {
10
9
  clicking: boolean;
@@ -0,0 +1,47 @@
1
+ type CursorPosition = {
2
+ x: number;
3
+ y: number;
4
+ };
5
+ /**
6
+ * Declarative cursor shape, mapped to DECSCUSR (`CSI Ps SP q`).
7
+ *
8
+ * `"default"` restores the terminal's user-configured shape (`Ps=0`).
9
+ * Steady variants are non-blinking; `blinking-*` variants opt into blink.
10
+ */
11
+ type CursorShape = "bar" | "blinking-bar" | "blinking-block" | "blinking-underline" | "block" | "default" | "underline";
12
+ /**
13
+ * Build the DECSCUSR escape sequence for a cursor shape.
14
+ */
15
+ declare const buildCursorShapeSequence: (shape: CursorShape) => string;
16
+ /**
17
+ * Compare two cursor positions. Returns true if they differ.
18
+ */
19
+ declare const cursorPositionChanged: (a: CursorPosition | undefined, b: CursorPosition | undefined) => boolean;
20
+ /**
21
+ * Build escape sequence to move cursor from bottom of output to the target position and show it.
22
+ * Assumes cursor is at (col 0, line visibleLineCount) — i.e. just after the last output line.
23
+ */
24
+ declare const buildCursorSuffix: (visibleLineCount: number, cursorPosition: CursorPosition | undefined) => string;
25
+ /**
26
+ * Build escape sequence to move cursor from previousCursorPosition back to the bottom of output.
27
+ * This must be done before eraseLines or any operation that assumes cursor is at the bottom.
28
+ */
29
+ declare const buildReturnToBottom: (previousLineCount: number, previousCursorPosition: CursorPosition | undefined) => string;
30
+ type CursorOnlyInput = {
31
+ cursorPosition: CursorPosition | undefined;
32
+ cursorWasShown: boolean;
33
+ previousCursorPosition: CursorPosition | undefined;
34
+ previousLineCount: number;
35
+ visibleLineCount: number;
36
+ };
37
+ /**
38
+ * Build the escape sequence for cursor-only updates (output unchanged, cursor moved).
39
+ * Hides cursor if it was previously shown, returns to bottom, then repositions.
40
+ */
41
+ declare const buildCursorOnlySequence: (input: CursorOnlyInput) => string;
42
+ /**
43
+ * Build the prefix that hides cursor and returns to bottom before erasing or rewriting.
44
+ * Returns empty string if cursor was not shown.
45
+ */
46
+ declare const buildReturnToBottomPrefix: (cursorWasShown: boolean, previousLineCount: number, previousCursorPosition: CursorPosition | undefined) => string;
47
+ export { type CursorOnlyInput, type CursorPosition, type CursorShape, buildCursorOnlySequence, buildCursorShapeSequence, buildCursorSuffix, buildReturnToBottom, buildReturnToBottomPrefix, cursorPositionChanged };
@@ -0,0 +1 @@
1
+ import{buildCursorOnlySequence as r,buildCursorShapeSequence as e,buildCursorSuffix as i,buildReturnToBottom as t,buildReturnToBottomPrefix as n,cursorPositionChanged as d}from"../../packem_shared/buildCursorOnlySequence-CerkmjWt.js";export{r as buildCursorOnlySequence,e as buildCursorShapeSequence,i as buildCursorSuffix,t as buildReturnToBottom,n as buildReturnToBottomPrefix,d as cursorPositionChanged};
@@ -0,0 +1,6 @@
1
+ export type { C as CursorAnchorRef, a as CursorMarker, D as DOMElement, b as DOMNode, c as DOMNodeAttribute, E as ElementNames, N as NodeNames, S as StickyHeader, T as TextName, d as TextNode } from "../../packem_shared/dom.d-g-nsYquD.js";
2
+ import 'yoga-layout';
3
+ import "./cursor.js";
4
+ import '@visulima/colorize';
5
+ import "../../packem_shared/styles.d-D7iZuNC-.js";
6
+ import 'type-fest';
File without changes
@@ -0,0 +1,54 @@
1
+ import { TokensResult, ThemedToken } from '@shikijs/core';
2
+ import { HighlighterGeneric } from '@shikijs/types';
3
+ import { ReactElement } from 'react';
4
+ type BundledLanguage = '1c' | '1c-query' | 'abap' | 'actionscript-3' | 'ada' | 'adoc' | 'angular-html' | 'angular-ts' | 'apache' | 'apex' | 'apl' | 'applescript' | 'ara' | 'asciidoc' | 'asm' | 'astro' | 'awk' | 'ballerina' | 'bash' | 'bat' | 'batch' | 'be' | 'beancount' | 'berry' | 'bibtex' | 'bicep' | 'bird' | 'bird2' | 'blade' | 'bsl' | 'c' | 'c#' | 'c++' | 'c3' | 'cadence' | 'cairo' | 'cdc' | 'cjs' | 'clarity' | 'clj' | 'clojure' | 'closure-templates' | 'cmake' | 'cmd' | 'cobol' | 'codeowners' | 'codeql' | 'coffee' | 'coffeescript' | 'common-lisp' | 'console' | 'coq' | 'cpp' | 'cql' | 'crystal' | 'cs' | 'csharp' | 'css' | 'csv' | 'cts' | 'cue' | 'cypher' | 'd' | 'dart' | 'dax' | 'desktop' | 'diff' | 'docker' | 'dockerfile' | 'dotenv' | 'dream-maker' | 'edge' | 'elisp' | 'elixir' | 'elm' | 'emacs-lisp' | 'erb' | 'erl' | 'erlang' | 'f' | 'f#' | 'f03' | 'f08' | 'f18' | 'f77' | 'f90' | 'f95' | 'fennel' | 'fish' | 'fluent' | 'for' | 'fortran-fixed-form' | 'fortran-free-form' | 'fs' | 'fsharp' | 'fsl' | 'ftl' | 'gd' | 'gdresource' | 'gdscript' | 'gdshader' | 'genie' | 'gherkin' | 'git-commit' | 'git-rebase' | 'gjs' | 'gleam' | 'glimmer-js' | 'glimmer-ts' | 'glsl' | 'gn' | 'gnuplot' | 'go' | 'gql' | 'graphql' | 'groovy' | 'gts' | 'hack' | 'haml' | 'handlebars' | 'haskell' | 'haxe' | 'hbs' | 'hcl' | 'hjson' | 'hlsl' | 'hs' | 'html' | 'html-derivative' | 'http' | 'hurl' | 'hxml' | 'hy' | 'imba' | 'ini' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'jl' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsonnet' | 'jssm' | 'jsx' | 'julia' | 'just' | 'kdl' | 'kotlin' | 'kql' | 'kt' | 'kts' | 'kusto' | 'latex' | 'lean' | 'lean4' | 'less' | 'liquid' | 'lisp' | 'lit' | 'llvm' | 'log' | 'logo' | 'lua' | 'luau' | 'make' | 'makefile' | 'markdown' | 'marko' | 'matlab' | 'mbt' | 'mbti' | 'md' | 'mdc' | 'mdx' | 'mediawiki' | 'mermaid' | 'mips' | 'mipsasm' | 'mjs' | 'mmd' | 'mojo' | 'moonbit' | 'move' | 'mts' | 'nar' | 'narrat' | 'nextflow' | 'nextflow-groovy' | 'nf' | 'nginx' | 'nim' | 'nix' | 'nu' | 'nushell' | 'objc' | 'objective-c' | 'objective-cpp' | 'ocaml' | 'odin' | 'openscad' | 'pascal' | 'perl' | 'perl6' | 'php' | 'pkl' | 'plsql' | 'po' | 'polar' | 'postcss' | 'pot' | 'potx' | 'powerquery' | 'powershell' | 'prisma' | 'prolog' | 'properties' | 'proto' | 'protobuf' | 'ps' | 'ps1' | 'pug' | 'puppet' | 'purescript' | 'py' | 'python' | 'ql' | 'qml' | 'qmldir' | 'qss' | 'r' | 'racket' | 'raku' | 'razor' | 'rb' | 'reg' | 'regex' | 'regexp' | 'rel' | 'riscv' | 'ron' | 'rosmsg' | 'rs' | 'rst' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scad' | 'scala' | 'scheme' | 'scss' | 'sdbl' | 'sh' | 'shader' | 'shaderlab' | 'shell' | 'shellscript' | 'shellsession' | 'smalltalk' | 'solidity' | 'soy' | 'sparql' | 'spl' | 'splunk' | 'sql' | 'ssh-config' | 'stata' | 'styl' | 'stylus' | 'surql' | 'surrealql' | 'svelte' | 'swift' | 'system-verilog' | 'systemd' | 'talon' | 'talonscript' | 'tasl' | 'tcl' | 'templ' | 'terraform' | 'tex' | 'tf' | 'tfvars' | 'toml' | 'tres' | 'ts' | 'ts-tags' | 'tscn' | 'tsp' | 'tsv' | 'tsx' | 'turtle' | 'twig' | 'typ' | 'typescript' | 'typespec' | 'typst' | 'v' | 'vala' | 'vb' | 'verilog' | 'vhdl' | 'vim' | 'viml' | 'vimscript' | 'vue' | 'vue-html' | 'vue-vine' | 'vy' | 'vyper' | 'wasm' | 'wenyan' | 'wgsl' | 'wiki' | 'wikitext' | 'wit' | 'wl' | 'wolfram' | 'xml' | 'xsl' | 'yaml' | 'yml' | 'zenscript' | 'zig' | 'zsh' | '文言';
5
+ type BundledTheme = 'andromeeda' | 'aurora-x' | 'ayu-dark' | 'ayu-light' | 'ayu-mirage' | 'catppuccin-frappe' | 'catppuccin-latte' | 'catppuccin-macchiato' | 'catppuccin-mocha' | 'dark-plus' | 'dracula' | 'dracula-soft' | 'everforest-dark' | 'everforest-light' | 'github-dark' | 'github-dark-default' | 'github-dark-dimmed' | 'github-dark-high-contrast' | 'github-light' | 'github-light-default' | 'github-light-high-contrast' | 'gruvbox-dark-hard' | 'gruvbox-dark-medium' | 'gruvbox-dark-soft' | 'gruvbox-light-hard' | 'gruvbox-light-medium' | 'gruvbox-light-soft' | 'horizon' | 'horizon-bright' | 'houston' | 'kanagawa-dragon' | 'kanagawa-lotus' | 'kanagawa-wave' | 'laserwave' | 'light-plus' | 'material-theme' | 'material-theme-darker' | 'material-theme-lighter' | 'material-theme-ocean' | 'material-theme-palenight' | 'min-dark' | 'min-light' | 'monokai' | 'night-owl' | 'night-owl-light' | 'nord' | 'one-dark-pro' | 'one-light' | 'plastic' | 'poimandres' | 'red' | 'rose-pine' | 'rose-pine-dawn' | 'rose-pine-moon' | 'slack-dark' | 'slack-ochin' | 'snazzy-light' | 'solarized-dark' | 'solarized-light' | 'synthwave-84' | 'tokyo-night' | 'vesper' | 'vitesse-black' | 'vitesse-dark' | 'vitesse-light';
6
+ type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
7
+ /**
8
+ * Initiate a highlighter instance and load the specified languages and themes.
9
+ * Later it can be used synchronously to highlight code.
10
+ *
11
+ * Importing this function will bundle all languages and themes.
12
+ * @see https://shiki.style/guide/bundles#shiki-bundle-full
13
+ *
14
+ * For granular control over the bundle, check:
15
+ * @see https://shiki.style/guide/bundles#fine-grained-bundle
16
+ */
17
+ /**
18
+ * Get cached tokens or compute and cache them.
19
+ */
20
+ declare const getCachedTokens: (highlighter: Highlighter, code: string, lang: string, theme: string) => TokensResult;
21
+ /**
22
+ * Resolve a language name to a canonical name, handling aliases.
23
+ */
24
+ declare const resolveLanguage: (lang: string) => string;
25
+ /**
26
+ * Check if a language is supported.
27
+ */
28
+ declare const isLanguageSupported: (lang: string) => boolean;
29
+ /**
30
+ * Get or create the singleton Shiki highlighter, optionally loading languages and themes.
31
+ */
32
+ declare const getHighlighter: (languages?: string[], theme?: string) => Promise<Highlighter>;
33
+ /**
34
+ * Dispose the singleton highlighter, freeing resources.
35
+ */
36
+ declare const disposeHighlighter: () => void;
37
+ type TokenRenderOptions = {
38
+ readonly highlightLines?: ReadonlySet<number>;
39
+ readonly showLineNumbers?: boolean;
40
+ readonly startLine?: number;
41
+ };
42
+ /**
43
+ * Render a single ThemedToken as a styled &lt;Text> element.
44
+ */
45
+ declare const renderToken: (token: ThemedToken, key: number) => ReactElement;
46
+ /**
47
+ * Render a single line of tokens as inline React elements (no Box wrapper).
48
+ */
49
+ declare const renderTokenLine: (tokens: ThemedToken[]) => ReactElement;
50
+ /**
51
+ * Convert Shiki token lines to Ink React elements with optional line numbers.
52
+ */
53
+ declare const tokenLinesToElements: (lines: ThemedToken[][], options?: TokenRenderOptions) => ReactElement;
54
+ export { type TokenRenderOptions, disposeHighlighter, getCachedTokens, getHighlighter, isLanguageSupported, renderToken, renderTokenLine, resolveLanguage, tokenLinesToElements };
@@ -0,0 +1 @@
1
+ import{disposeHighlighter as r,getCachedTokens as n,default as g,isLanguageSupported as t,resolveLanguage as i}from"../../packem_shared/disposeHighlighter-D9OkrhwX.js";import{renderToken as a,renderTokenLine as d,tokenLinesToElements as h}from"../../packem_shared/renderToken-DjiQ6dfv.js";export{r as disposeHighlighter,n as getCachedTokens,g as getHighlighter,t as isLanguageSupported,a as renderToken,d as renderTokenLine,i as resolveLanguage,h as tokenLinesToElements};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Check if a character is a C0 control character or DEL.
3
+ */
4
+ declare const isControlCharacter: (input: string) => boolean;
5
+ /**
6
+ * Determine whether the input should be inserted as text.
7
+ * Filters out modifier chords (Ctrl+S, Meta+S, etc.) while allowing
8
+ * AltGr-produced symbols (Ctrl+Meta+@, Ctrl+Meta+€) on international keyboards.
9
+ */
10
+ declare const isInsertableInput: (input: string, key: {
11
+ ctrl: boolean;
12
+ meta: boolean;
13
+ }) => boolean;
14
+ export { isControlCharacter, isInsertableInput };
@@ -0,0 +1 @@
1
+ import{isControlCharacter as e,isInsertableInput as o}from"../../packem_shared/isControlCharacter-uDgBe_32.js";export{e as isControlCharacter,o as isInsertableInput};
@@ -0,0 +1,4 @@
1
+ export type { S as Styles } from "../../packem_shared/styles.d-D7iZuNC-.js";
2
+ import '@visulima/colorize';
3
+ import 'type-fest';
4
+ import 'yoga-layout';
File without changes
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Format a duration in milliseconds to `MM:SS` or `HH:MM:SS` (when hours > 0).
3
+ */
4
+ declare function formatDuration(ms: number): string;
5
+ export { formatDuration };
@@ -0,0 +1 @@
1
+ import{formatDuration as t}from"../../packem_shared/formatDuration-Bdx4ZgRh.js";export{t as formatDuration};
@@ -1,4 +1,4 @@
1
- import n from"react-devtools-core";import r from"ws";const i=async()=>new Promise(t=>{const e=new r("ws://localhost:8097"),o=setTimeout(()=>{e.terminate(),t(!1)},2e3);o.unref(),e.on("open",()=>{clearTimeout(o),e.terminate(),t(!0)}),e.on("error",()=>{clearTimeout(o),e.terminate(),t(!1)})});await i()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
1
+ import n from"react-devtools-core";const s=async()=>new Promise(t=>{const e=new WebSocket("ws://localhost:8097"),o=setTimeout(()=>{e.close(),t(!1)},2e3);o.unref(),e.addEventListener("open",()=>{clearTimeout(o),e.close(),t(!0)}),e.addEventListener("error",()=>{clearTimeout(o),t(!1)})});await s()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
2
2
 
3
3
  $ npx react-devtools
4
4
  `);
@@ -1 +1 @@
1
- import{jsxs as l,jsx as u}from"react/jsx-runtime";import{useState as p,useRef as s,useEffect as h}from"react";import{useWindowSize as x,useTuiContext as w}from"./TuiContext-BNmP0lMY.js";import{_Box as i,_Spacer as S,_Text as D}from"./render-DFZ8NHlG.js";function T(){const{app:r}=w(),[t,c]=p(0),e=s(0),n=s(Date.now()),o=s(null);return h(()=>{const m=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{c(0),e.current=0,n.current=Date.now()},2e3),e.current++;const d=Date.now(),f=d-n.current;f>=500&&(c(Math.round(e.current/f*1e3)),e.current=0,n.current=d)},a=r.onBeforeFlush(()=>{m()});return()=>{a(),o.current&&clearTimeout(o.current)}},[r]),t}const b=({fps:r})=>{const t=r===0?"--":String(r);return u(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:l(D,{dim:!0,children:[t," ","updates/sec"]})})},B=({children:r,enabled:t=!0})=>{const c=T(),{columns:e,rows:n}=x();return l(i,{flexDirection:"column",height:n,width:e,children:[u(i,{flexGrow:1,children:r}),t&&l(i,{flexDirection:"row",flexShrink:0,children:[u(S,{}),u(b,{fps:c})]})]})};export{B as DevTools};
1
+ import{jsxs as l,jsx as u}from"react/jsx-runtime";import{useState as p,useRef as s,useEffect as h}from"react";import{useWindowSize as x,useTuiContext as w}from"./TuiContext-BNmP0lMY.js";import{_Box as i,_Spacer as S,_Text as D}from"./render-DMcWfI6-.js";function T(){const{app:r}=w(),[t,c]=p(0),e=s(0),n=s(Date.now()),o=s(null);return h(()=>{const m=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{c(0),e.current=0,n.current=Date.now()},2e3),e.current++;const d=Date.now(),f=d-n.current;f>=500&&(c(Math.round(e.current/f*1e3)),e.current=0,n.current=d)},a=r.onBeforeFlush(()=>{m()});return()=>{a(),o.current&&clearTimeout(o.current)}},[r]),t}const b=({fps:r})=>{const t=r===0?"--":String(r);return u(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:l(D,{dim:!0,children:[t," ","updates/sec"]})})},B=({children:r,enabled:t=!0})=>{const c=T(),{columns:e,rows:n}=x();return l(i,{flexDirection:"column",height:n,width:e,children:[u(i,{flexGrow:1,children:r}),t&&l(i,{flexDirection:"row",flexShrink:0,children:[u(S,{}),u(b,{fps:c})]})]})};export{B as DevTools};
@@ -0,0 +1,2 @@
1
+ import{l}from"./index-Dl9I2_QH.js";class B extends l.EventEmitter{constructor(t){super(),this.stdin=t}stdin;_boundHandleData=null;_pasteBuffer=null;start(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!0),this.stdin.resume(),this.stdin.setEncoding("utf8"),this._boundHandleData=this.handleData.bind(this),this.stdin.on("data",this._boundHandleData)}stop(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!1),this.stdin.pause(),this._boundHandleData&&(this.stdin.removeListener("data",this._boundHandleData),this._boundHandleData=null)}handleData(t){if(t===""){this.emit("exit");return}if(t.includes("\x1B[200~")||this._pasteBuffer!==null){if(this._pasteBuffer===null?this._pasteBuffer=t.replace("\x1B[200~",""):this._pasteBuffer+=t,this._pasteBuffer.includes("\x1B[201~")){const e=this._pasteBuffer.replace("\x1B[201~","");this._pasteBuffer=null,this.emit("paste",e),this.listenerCount("paste")===0&&this.emit("data",e)}return}if(t.length===1){const e=t.charCodeAt(0);if(e>=1&&e<=26&&e!==3&&e!==9&&e!==10&&e!==13){const s=String.fromCharCode(e+96);this.emit("ctrl",s),this.emit("data",t,{ctrl:!0});return}}if(t==="\x1B[A"){this.emit("keydown","up");return}if(t==="\x1B[B"){this.emit("keydown","down");return}if(t==="\x1B[C"){this.emit("keydown","right");return}if(t==="\x1B[D"){this.emit("keydown","left");return}if(t===" "){this.emit("keydown","tab");return}if(t==="\x1B[Z"){this.emit("keydown","shift-tab");return}if(t==="\x1B"){this.emit("keydown","escape");return}if(t==="\r"||t===`
2
+ `){this.emit("keydown","enter");return}if(t===""){this.emit("keydown","backspace");return}if(t==="\x1B[3~"){this.emit("keydown","delete");return}if(t==="\x1B[5~"){this.emit("keydown","pageUp");return}if(t==="\x1B[6~"){this.emit("keydown","pageDown");return}if(t==="\x1B[H"||t==="\x1B[1~"){this.emit("keydown","home");return}if(t==="\x1B[F"||t==="\x1B[4~"){this.emit("keydown","end");return}if(t.length===2&&t[0]==="\x1B"){this.emit("meta",t[1]),this.emit("data",t,{meta:!0});return}if(t.startsWith("\x1B[<")){const e=t.match(/\u001B\[<(\d+);(\d+);(\d+)(M)/i);if(e){const s=Number.parseInt(e[1]),a=Number.parseInt(e[2])-1,d=Number.parseInt(e[3])-1,r=e[4]==="m",h=(s&4)!==0,u=(s&8)!==0,o=(s&16)!==0,n=s&-29;let i=null;if(n===0&&!r?i="left":n===1&&!r?i="middle":n===2&&!r?i="right":n===64?i="scrollUp":n===65&&(i="scrollDown"),i){const f={button:i,ctrl:o,meta:u,shift:h,x:a,y:d};this.emit("mouse",f),i==="left"&&this.emit("click",{x:a,y:d})}}return}this.emit("data",t)}}export{B as InputParser};
@@ -0,0 +1 @@
1
+ import{createDecMode as h,setMode as n,resetMode as u}from"@visulima/ansi";import{l as f}from"./index-Dl9I2_QH.js";import{Renderer as s,TerminalGuard as o}from"./Renderer-DsskdkUd.js";const i=h(2026),d=n(i),a=u(i);class p extends f.EventEmitter{renderer;terminal=null;backBuffer;width;height;isRunning=!1;stdoutBuffer=[];stderrBuffer=[];constructor(){super(),this.width=process.stdout.columns||80,this.height=process.stdout.rows||24,this.renderer=new s(this.width,this.height),this.backBuffer=new Uint32Array(this.width*this.height*2)}start(){this.isRunning||(this.terminal=new o(!0),this.isRunning=!0)}quit(){this.emit("quit")}stop(){this.isRunning=!1,this.terminal?.leave(),this.terminal=null,this.stdoutBuffer.length>0&&(process.stdout.write(this.stdoutBuffer.join("")),this.stdoutBuffer=[]),this.stderrBuffer.length>0&&(process.stderr.write(this.stderrBuffer.join("")),this.stderrBuffer=[])}writeStdout(t){this.isRunning?this.stdoutBuffer.push(t):process.stdout.write(t)}writeStderr(t){this.isRunning?this.stderrBuffer.push(t):process.stderr.write(t)}getBuffer(){return this.backBuffer}getSize(){return{height:this.height,width:this.width}}resize(t,e){this.width=t,this.height=e,this.renderer=new s(t,e),this.backBuffer=new Uint32Array(t*e*2)}beforeFlushListeners=[];onBeforeFlush(t){return this.beforeFlushListeners.push(t),()=>{this.beforeFlushListeners=this.beforeFlushListeners.filter(e=>e!==t)}}paintNow(t,e){if(this.isRunning){t(this.width,this.height),e(this.backBuffer,this.width,this.height);for(const r of this.beforeFlushListeners)r(this.backBuffer,this.width,this.height);this.renderer.writeRaw(d);try{this.renderer.render(this.backBuffer)}finally{this.renderer.writeRaw(a)}}}}export{p as TuiApp};
@@ -0,0 +1 @@
1
+ import{createContext as e}from"react";const t=e({exit(){},suspendTerminal:(()=>Promise.resolve(void 0)),async waitUntilRenderFlush(){}});t.displayName="InternalAppContext";export{t as e};
@@ -0,0 +1,56 @@
1
+ import 'react';
2
+ /**
3
+ * A handle returned by `suspendTerminal()` when called without a callback.
4
+ * Call `resume()` (or use `await using`, which disposes it) to restore Ink's
5
+ * rendering and input handling.
6
+ */
7
+ type TerminalSuspension = {
8
+ readonly [Symbol.asyncDispose]: () => Promise<void>;
9
+ readonly resume: () => Promise<void>;
10
+ };
11
+ type Props = {
12
+ /**
13
+ * Exit (unmount) the whole Ink app.
14
+ *
15
+ * - `exit()` — resolves `waitUntilExit()` with `undefined`.
16
+ * - `exit(new Error('…'))` — rejects `waitUntilExit()` with the error.
17
+ * - `exit(value)` — resolves `waitUntilExit()` with `value`.
18
+ */
19
+ readonly exit: (errorOrResult?: Error | unknown) => void;
20
+ /**
21
+ * Temporarily hand terminal control to a child process (e.g. an editor,
22
+ * pager, or interactive subprocess), then restore Ink's rendering.
23
+ *
24
+ * - `suspendTerminal(async () => { … })` — runs the callback with the
25
+ * terminal released and auto-resumes when it settles.
26
+ * - `suspendTerminal()` — returns a {@link TerminalSuspension} handle; call
27
+ * `resume()` (or `await using`) to restore.
28
+ */
29
+ readonly suspendTerminal: {
30
+ (callback: () => Promise<void> | void): Promise<undefined>;
31
+ (): Promise<TerminalSuspension>;
32
+ };
33
+ /**
34
+ * Returns a promise that settles after pending render output is flushed to stdout.
35
+ * @example
36
+ * ```jsx
37
+ * import {useEffect} from 'react';
38
+ * import {useApp} from '@visulima/tui/hooks/use-app';
39
+
40
+ const Example = () => {
41
+ const {waitUntilRenderFlush} = useApp();
42
+
43
+ useEffect(() => {
44
+ void (async () => {
45
+ await waitUntilRenderFlush();
46
+ runNextCommand();
47
+ })();
48
+ }, [waitUntilRenderFlush]);
49
+
50
+ return …;
51
+ };
52
+ ```
53
+ */
54
+ readonly waitUntilRenderFlush: () => Promise<void>;
55
+ };
56
+ export { Props as P, TerminalSuspension as T };
@@ -0,0 +1 @@
1
+ var t={topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},o={topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},e={topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},b={topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},i={topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},g={topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},p={topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},f={topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"};const h={single:t,double:o,round:e,bold:b,singleDouble:i,doubleSingle:g,classic:p,arrow:f};export{h as o};
@@ -5,6 +5,11 @@ type CellStyle = {
5
5
  readonly color?: CanvasColor;
6
6
  readonly dim?: boolean;
7
7
  };
8
+ /**
9
+ * Reverse of the encoder. 0 → undefined; any other id returns the original
10
+ * CanvasColor (preserving number vs string distinction).
11
+ */
12
+ type ColorDecoder = (id: number) => CanvasColor;
8
13
  type CanvasContext = {
9
14
  /**
10
15
  * Clear every cell back to space + default style.
@@ -36,4 +41,27 @@ type CanvasContext = {
36
41
  readonly setCell: (x: number, y: number, char: number | string, style?: CellStyle) => void;
37
42
  readonly width: number;
38
43
  };
39
- export { CanvasContext as C, CanvasColor as a, CellStyle as b };
44
+ type CanvasBuffer = {
45
+ readonly bg: Int32Array;
46
+ readonly chars: Uint32Array;
47
+ readonly colorDecoder: ColorDecoder;
48
+ readonly context: CanvasContext;
49
+ readonly dirty: Uint8Array;
50
+ readonly fg: Int32Array;
51
+ readonly height: number;
52
+ readonly styles: Uint32Array;
53
+ readonly width: number;
54
+ };
55
+ /**
56
+ * Allocate a canvas buffer and return a context that mutates it in place.
57
+ * The buffer is typed-array backed; all mutations O(1) per cell with no
58
+ * object allocation.
59
+ */
60
+ declare const createCanvasBuffer: (width: number, height: number) => CanvasBuffer;
61
+ /**
62
+ * Serialize a buffer row into an ANSI string, coalescing adjacent cells that
63
+ * share the same style. Call directly when you need to re-emit rows; row
64
+ * caching lives one level up in Canvas.tsx.
65
+ */
66
+ declare const serializeRow: (buffer: CanvasBuffer, row: number) => string;
67
+ export { CanvasContext as C, CanvasColor as a, CellStyle as b, CanvasBuffer as c, createCanvasBuffer as d, serializeRow as s };
@@ -0,0 +1 @@
1
+ import{setCursorStyle as t,cursorUp as c,cursorTo as u,cursorShow as l,cursorDown as b,cursorHide as i}from"@visulima/ansi";const d={bar:6,"blinking-bar":5,"blinking-block":1,"blinking-underline":3,block:2,default:0,underline:4},S=r=>t(d[r]),a=(r,o)=>r?.x!==o?.x||r?.y!==o?.y,C=(r,o)=>{if(!o)return"";const n=r-o.y;return(n>0?c(n):"")+u(o.x)+l},e=(r,o)=>{if(!o)return"";const n=r-1-o.y;return(n>0?b(n):"")+u(0)},p=r=>{const o=r.cursorWasShown?i:"",n=e(r.previousLineCount,r.previousCursorPosition),s=C(r.visibleLineCount,r.cursorPosition);return o+n+s},x=(r,o,n)=>r?i+e(o,n):"";export{p as buildCursorOnlySequence,S as buildCursorShapeSequence,C as buildCursorSuffix,e as buildReturnToBottom,x as buildReturnToBottomPrefix,a as cursorPositionChanged};
@@ -1 +1 @@
1
- const w=[1,8,2,16,4,32,64,128],A=(l,c)=>{const p=Math.max(0,l*2),x=Math.max(0,c*4),f=new Uint8Array(l*c),s=new Uint8Array(l*c),m=(a,r)=>{if(a<0||r<0||a>=p||r>=x)return;const h=Math.floor(a/2),i=Math.floor(r/4),t=a%2,o=r%4,e=w[o*2+t],n=i*l+h;(f[n]&e)===0&&(f[n]=(f[n]??0)|e,s[n]=1)};return{cellHeight:c,cellWidth:l,clear:()=>{f.fill(0),s.fill(0)},flush:(a,r)=>{for(const[h,i]of f.entries()){if(s[h]===0)continue;const t=h%l,o=Math.floor(h/l),e=10240+i;a.setCell(t,o,e,r)}},pixelHeight:x,pixelWidth:p,plotLine:(a,r,h,i)=>{let t=Math.round(a),o=Math.round(r);const e=Math.round(h),n=Math.round(i),M=Math.abs(e-t),g=t<e?1:-1,u=-Math.abs(n-o),k=o<n?1:-1;let d=M+u;for(;m(t,o),!(t===e&&o===n);){const y=2*d;if(y>=u){if(t===e)break;d+=u,t+=g}if(y<=M){if(o===n)break;d+=M,o+=k}}},plotPoint:m}};export{A as c};
1
+ const w=[1,8,2,16,4,32,64,128],A=(l,c)=>{const p=Math.max(0,l*2),x=Math.max(0,c*4),f=new Uint8Array(l*c),s=new Uint8Array(l*c),m=(a,r)=>{if(a<0||r<0||a>=p||r>=x)return;const h=Math.floor(a/2),i=Math.floor(r/4),t=a%2,o=r%4,e=w[o*2+t],n=i*l+h;(f[n]&e)===0&&(f[n]=(f[n]??0)|e,s[n]=1)};return{cellHeight:c,cellWidth:l,clear:()=>{f.fill(0),s.fill(0)},flush:(a,r)=>{for(const[h,i]of f.entries()){if(s[h]===0)continue;const t=h%l,o=Math.floor(h/l),e=10240+i;a.setCell(t,o,e,r)}},pixelHeight:x,pixelWidth:p,plotLine:(a,r,h,i)=>{let t=Math.round(a),o=Math.round(r);const e=Math.round(h),n=Math.round(i),M=Math.abs(e-t),g=t<e?1:-1,u=-Math.abs(n-o),k=o<n?1:-1;let d=M+u;for(;m(t,o),!(t===e&&o===n);){const y=2*d;if(y>=u){if(t===e)break;d+=u,t+=g}if(y<=M){if(o===n)break;d+=M,o+=k}}},plotPoint:m}};export{A as createBrailleGrid};
@@ -0,0 +1 @@
1
+ import{a as U}from"./colorize-DU4YZkp3.js";const R=Math.trunc(1),k=2,A=32,I=0,T=()=>{const c=new Map,f=[void 0];return{decode:a=>f[a],encode:a=>{if(a===void 0)return I;const g=typeof a=="number"?`n:${a}`:`s:${a}`,u=c.get(g);if(u!==void 0)return u;const m=f.length;return f.push(a),c.set(g,m),m}}},S=[9601,9602,9603,9604,9605,9606,9607,9608],$=[9615,9614,9613,9612,9611,9610,9609,9608],D=9608,_=c=>{if(!c)return 0;let f=0;return c.bold&&(f|=R),c.dim&&(f|=k),f},P=c=>typeof c=="number"?c:c.codePointAt(0)??A,E=(c,f)=>{const a=Math.max(0,c*f),g=new Uint32Array(a),u=new Uint32Array(a),m=new Int32Array(a),x=new Int32Array(a),b=new Uint8Array(f),{decode:y,encode:B}=T();g.fill(A);const M=r=>{r>=0&&r<f&&(b[r]=1)},h=(r,e,i,o)=>{if(r<0||r>=c||e<0||e>=f)return;const t=e*c+r,l=P(i),s=B(o?.color),n=B(o?.background),d=_(o);g[t]===l&&u[t]===d&&m[t]===s&&x[t]===n||(g[t]=l,u[t]=d,m[t]=s,x[t]=n,b[e]=1)};return{bg:x,chars:g,colorDecoder:y,context:{clear:()=>{g.fill(A),u.fill(0),m.fill(0),x.fill(0),b.fill(1)},drawHBar:(r,e,i,o,t)=>{if(i<=0||e<0||e>=f)return;const l=Math.max(0,Math.min(1,o)),s=i*$.length,n=Math.round(l*s),d=Math.floor(n/$.length),v=n%$.length;for(let w=0;w<i;w+=1){const p=r+w;w<d?h(p,e,D,t):w===d&&v>0?h(p,e,$[v-1],t):h(p,e,A,t)}M(e)},drawRect:(r,e,i,o,t,l)=>{if(i<=0||o<=0)return;const s=P(t);for(let n=0;n<o;n+=1){for(let d=0;d<i;d+=1)h(r+d,e+n,s,l);M(e+n)}},drawText:(r,e,i,o)=>{if(e<0||e>=f||i.length===0)return;let t=0;for(const l of i)h(r+t,e,l,o),t+=1;M(e)},drawVBar:(r,e,i,o,t)=>{if(i<=0||r<0||r>=c)return;const l=Math.max(0,Math.min(1,o)),s=i*S.length,n=Math.round(l*s),d=Math.floor(n/S.length),v=n%S.length;for(let w=0;w<i;w+=1){const p=i-w-1,C=e+w;p<d?h(r,C,D,t):p===d&&v>0?h(r,C,S[v-1],t):h(r,C,A,t),M(C)}},height:f,setCell:h,width:c},dirty:b,fg:m,height:f,styles:u,width:c}},H=(c,f)=>{const{bg:a,chars:g,colorDecoder:u,fg:m,styles:x,width:b}=c,y=f*b;let B="",M=0,h=x[y],r=m[y],e=a[y];const i=o=>{let t="";for(let d=M;d<o;d+=1)t+=String.fromCodePoint(g[y+d]);const l=u(r),s=u(e);let n=t;l!==void 0&&(n=U(n,typeof l=="number"?String(l):l,"foreground")),s!==void 0&&(n=U(n,typeof s=="number"?String(s):s,"background")),(h&R)!==0&&(n=`\x1B[1m${n}\x1B[22m`),(h&k)!==0&&(n=`\x1B[2m${n}\x1B[22m`),B+=n};for(let o=1;o<b;o+=1){const t=x[y+o],l=m[y+o],s=a[y+o];(t!==h||l!==r||s!==e)&&(i(o),M=o,h=t,r=l,e=s)}return i(b),B};export{E as createCanvasBuffer,H as serializeRow};
@@ -0,0 +1 @@
1
+ const l={bash:()=>import("@shikijs/langs/bash"),c:()=>import("@shikijs/langs/c"),clojure:()=>import("@shikijs/langs/clojure"),cpp:()=>import("@shikijs/langs/cpp"),csharp:()=>import("@shikijs/langs/csharp"),css:()=>import("@shikijs/langs/css"),dart:()=>import("@shikijs/langs/dart"),diff:()=>import("@shikijs/langs/diff"),dockerfile:()=>import("@shikijs/langs/dockerfile"),elixir:()=>import("@shikijs/langs/elixir"),erlang:()=>import("@shikijs/langs/erlang"),go:()=>import("@shikijs/langs/go"),graphql:()=>import("@shikijs/langs/graphql"),groovy:()=>import("@shikijs/langs/groovy"),haskell:()=>import("@shikijs/langs/haskell"),html:()=>import("@shikijs/langs/html"),java:()=>import("@shikijs/langs/java"),javascript:()=>import("@shikijs/langs/javascript"),json:()=>import("@shikijs/langs/json"),jsonc:()=>import("@shikijs/langs/jsonc"),jsx:()=>import("@shikijs/langs/jsx"),kotlin:()=>import("@shikijs/langs/kotlin"),less:()=>import("@shikijs/langs/less"),lua:()=>import("@shikijs/langs/lua"),makefile:()=>import("@shikijs/langs/makefile"),markdown:()=>import("@shikijs/langs/markdown"),mdx:()=>import("@shikijs/langs/mdx"),nginx:()=>import("@shikijs/langs/nginx"),objc:()=>import("@shikijs/langs/objc"),perl:()=>import("@shikijs/langs/perl"),php:()=>import("@shikijs/langs/php"),powershell:()=>import("@shikijs/langs/powershell"),prisma:()=>import("@shikijs/langs/prisma"),python:()=>import("@shikijs/langs/python"),r:()=>import("@shikijs/langs/r"),ruby:()=>import("@shikijs/langs/ruby"),rust:()=>import("@shikijs/langs/rust"),scala:()=>import("@shikijs/langs/scala"),scss:()=>import("@shikijs/langs/scss"),shell:()=>import("@shikijs/langs/shell"),sql:()=>import("@shikijs/langs/sql"),svelte:()=>import("@shikijs/langs/svelte"),swift:()=>import("@shikijs/langs/swift"),text:()=>Promise.resolve({name:"text",patterns:[],repository:{},scopeName:"source.text"}),toml:()=>import("@shikijs/langs/toml"),tsx:()=>import("@shikijs/langs/tsx"),typescript:()=>import("@shikijs/langs/typescript"),vue:()=>import("@shikijs/langs/vue"),xml:()=>import("@shikijs/langs/xml"),yaml:()=>import("@shikijs/langs/yaml"),zig:()=>import("@shikijs/langs/zig")},d={"c#":"csharp","c++":"cpp",docker:"dockerfile",gql:"graphql",hs:"haskell",js:"javascript",kt:"kotlin",md:"markdown","objective-c":"objc",ps1:"powershell",py:"python",rb:"ruby",rs:"rust",sh:"bash",ts:"typescript",yml:"yaml",zsh:"bash"},g={"catppuccin-frappe":()=>import("@shikijs/themes/catppuccin-frappe"),"catppuccin-latte":()=>import("@shikijs/themes/catppuccin-latte"),"catppuccin-macchiato":()=>import("@shikijs/themes/catppuccin-macchiato"),"catppuccin-mocha":()=>import("@shikijs/themes/catppuccin-mocha"),"dark-plus":()=>import("@shikijs/themes/dark-plus"),dracula:()=>import("@shikijs/themes/dracula"),"github-dark":()=>import("@shikijs/themes/github-dark"),"github-dark-default":()=>import("@shikijs/themes/github-dark-default"),"github-dark-dimmed":()=>import("@shikijs/themes/github-dark-dimmed"),"github-light":()=>import("@shikijs/themes/github-light"),"github-light-default":()=>import("@shikijs/themes/github-light-default"),"light-plus":()=>import("@shikijs/themes/light-plus"),"min-dark":()=>import("@shikijs/themes/min-dark"),"min-light":()=>import("@shikijs/themes/min-light"),monokai:()=>import("@shikijs/themes/monokai"),nord:()=>import("@shikijs/themes/nord"),"one-dark-pro":()=>import("@shikijs/themes/one-dark-pro"),"one-light":()=>import("@shikijs/themes/one-light"),poimandres:()=>import("@shikijs/themes/poimandres"),"rose-pine":()=>import("@shikijs/themes/rose-pine"),"rose-pine-dawn":()=>import("@shikijs/themes/rose-pine-dawn"),"rose-pine-moon":()=>import("@shikijs/themes/rose-pine-moon"),"slack-dark":()=>import("@shikijs/themes/slack-dark"),"slack-ochin":()=>import("@shikijs/themes/slack-ochin"),"solarized-dark":()=>import("@shikijs/themes/solarized-dark"),"solarized-light":()=>import("@shikijs/themes/solarized-light"),"tokyo-night":()=>import("@shikijs/themes/tokyo-night"),"vitesse-dark":()=>import("@shikijs/themes/vitesse-dark"),"vitesse-light":()=>import("@shikijs/themes/vitesse-light")};let a;const m=new Map,c=new Map,u=50,p=new Map,k=(i,t,o)=>`${i.length}:${i}\0${t}\0${o}`,b=(i,t,o,e)=>{const r=k(t,o,e);if(p.has(r)){const s=p.get(r);return p.delete(r),p.set(r,s),s}const n=i.codeToTokens(t,{lang:o,theme:e});if(p.set(r,n),p.size>u){const s=p.keys().next().value;s!==void 0&&p.delete(s)}return n},y=async()=>{const[i,t]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:o}=i,{createJavaScriptRegexEngine:e}=t;return await o({engine:e(),langs:[],themes:[import("@shikijs/themes/github-dark-default")]})},h=i=>{const t=i.toLowerCase();return d[t]??t},v=i=>h(i)in l,w=async(i,t)=>{const o=h(t);if(!(o==="text"||(i.getLoadedLanguages?.()??[]).includes(o))){if(!m.has(o)){const e=(async()=>{try{const r=l[o];r&&await i.loadLanguage(await r())}catch(r){throw m.delete(o),r}})();m.set(o,e)}await m.get(o)}},f=async(i,t)=>{if((i.getLoadedThemes?.()??[]).includes(t))return;const o=g[t];if(o){if(!c.has(t)){const e=(async()=>{try{await i.loadTheme(await o())}catch(r){throw c.delete(t),r}})();c.set(t,e)}await c.get(t)}},x=async(i=[],t)=>{a||(a=y());const o=await a,e=i.map(r=>w(o,r));return t&&t!=="github-dark-default"&&e.push(f(o,t)),await Promise.all(e),o},j=()=>{m.clear(),c.clear(),p.clear(),a&&(a.then(i=>{try{i.dispose?.()}catch{}}).catch(()=>{}),a=void 0)};export{x as default,j as disposeHighlighter,b as getCachedTokens,v as isLanguageSupported,h as resolveLanguage};
@@ -1,8 +1,7 @@
1
1
  import { Node } from 'yoga-layout';
2
- import { C as CursorShape } from "./cursor-helpers.d-BONB9tky.js";
2
+ import { CursorShape } from "../ink/public/cursor.js";
3
3
  import '@visulima/colorize';
4
- import 'cli-boxes';
5
- import { S as Styles } from "./styles.d-cMo36xQz.js";
4
+ import { S as Styles } from "./styles.d-D7iZuNC-.js";
6
5
 
7
6
  /**
8
7
  * Columnar data structure for a single line of styled terminal text.
@@ -446,4 +445,4 @@ declare const getPathToRoot: (node: DOMNode) => DOMNode[];
446
445
  * Ported from jacob314/ink fork (Google LLC, Apache-2.0).
447
446
  */
448
447
  declare const isNodeSelectable: (node: DOMElement) => boolean;
449
- export { DOMElement as D, ResizeObserver as R, StyledLine as S, DOMNode as a, ResizeObserverCallback as b, ResizeObserverEntry as c, ScrollState as d, StickyHeader as e, calculateScroll as f, getPathToRoot as g, getScrollHeight as h, getScrollLeft as i, getScrollTop as j, getScrollWidth as k, isNodeSelectable as l };
448
+ export { CursorAnchorRef as C, DOMElement as D, ElementNames as E, NodeNames as N, ResizeObserver as R, StickyHeader as S, TextName as T, CursorMarker as a, DOMNode as b, DOMNodeAttribute as c, TextNode as d, StyledLine as e, ResizeObserverCallback as f, ResizeObserverEntry as g, ScrollState as h, calculateScroll as i, getPathToRoot as j, getScrollHeight as k, getScrollLeft as l, getScrollTop as m, getScrollWidth as n, isNodeSelectable as o };
@@ -0,0 +1 @@
1
+ function S(o){const t=Math.max(0,Math.floor(o/1e3)),r=Math.floor(t/3600),a=Math.floor(t%3600/60),n=t%60;return r>0?`${String(r).padStart(2,"0")}:${String(a).padStart(2,"0")}:${String(n).padStart(2,"0")}`:`${String(a).padStart(2,"0")}:${String(n).padStart(2,"0")}`}export{S as formatDuration};
@@ -0,0 +1,75 @@
1
+ var lib={},types={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,Object.defineProperty(types,"__esModule",{value:!0})),types}var ee={},taskCollection$1={},taskCollection={},utils$1={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1,Object.defineProperty(utils$1,"__esModule",{value:!0}),utils$1._fast_remove_single=void 0;function a(c,l){l!==-1&&(l===0?c.shift():l===c.length-1?c.length=c.length-1:c.splice(l,1))}return utils$1._fast_remove_single=a,utils$1}var bakeCollection={},hasRequiredBakeCollection;function requireBakeCollection(){return hasRequiredBakeCollection||(hasRequiredBakeCollection=1,(function(exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.bakeCollectionVariadic=exports.bakeCollectionAwait=exports.bakeCollection=exports.BAKED_EMPTY_FUNC=void 0,exports.BAKED_EMPTY_FUNC=(function(){});var FORLOOP_FALLBACK=1500;function generateArgsDefCode(a){var c="";if(a===0)return c;for(var l=0;l<a-1;++l)c+="arg"+String(l)+", ";return c+="arg"+String(a-1),c}function generateBodyPartsCode(a,c){for(var l="",u="",r=0;r<c;++r)l+="var f".concat(r," = collection[").concat(r,`];
2
+ `),u+="f".concat(r,"(").concat(a,`)
3
+ `);return{funcDefCode:l,funcCallCode:u}}function generateBodyPartsVariadicCode(a){for(var c="",l="",u=0;u<a;++u)c+="var f".concat(u," = collection[").concat(u,`];
4
+ `),l+="f".concat(u,`.apply(undefined, arguments)
5
+ `);return{funcDefCode:c,funcCallCode:l}}function bakeCollection(collection,fixedArgsNum){if(collection.length===0)return exports.BAKED_EMPTY_FUNC;if(collection.length===1)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode=`(function(collection) {
6
+ `.concat(funcDefCode,`
7
+ collection = undefined;
8
+ return (function(`).concat(argsDefCode,`) {
9
+ `).concat(funcCallCode,`
10
+ });
11
+ })`)}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);collection.length%10===0?funcFactoryCode=`(function(collection) {
12
+ return (function(`.concat(argsDefCode,`) {
13
+ for (var i = 0; i < collection.length; i += 10) {
14
+ collection[i](`).concat(argsDefCode,`);
15
+ collection[i+1](`).concat(argsDefCode,`);
16
+ collection[i+2](`).concat(argsDefCode,`);
17
+ collection[i+3](`).concat(argsDefCode,`);
18
+ collection[i+4](`).concat(argsDefCode,`);
19
+ collection[i+5](`).concat(argsDefCode,`);
20
+ collection[i+6](`).concat(argsDefCode,`);
21
+ collection[i+7](`).concat(argsDefCode,`);
22
+ collection[i+8](`).concat(argsDefCode,`);
23
+ collection[i+9](`).concat(argsDefCode,`);
24
+ }
25
+ });
26
+ })`):collection.length%4===0?funcFactoryCode=`(function(collection) {
27
+ return (function(`.concat(argsDefCode,`) {
28
+ for (var i = 0; i < collection.length; i += 4) {
29
+ collection[i](`).concat(argsDefCode,`);
30
+ collection[i+1](`).concat(argsDefCode,`);
31
+ collection[i+2](`).concat(argsDefCode,`);
32
+ collection[i+3](`).concat(argsDefCode,`);
33
+ }
34
+ });
35
+ })`):collection.length%3===0?funcFactoryCode=`(function(collection) {
36
+ return (function(`.concat(argsDefCode,`) {
37
+ for (var i = 0; i < collection.length; i += 3) {
38
+ collection[i](`).concat(argsDefCode,`);
39
+ collection[i+1](`).concat(argsDefCode,`);
40
+ collection[i+2](`).concat(argsDefCode,`);
41
+ }
42
+ });
43
+ })`):funcFactoryCode=`(function(collection) {
44
+ return (function(`.concat(argsDefCode,`) {
45
+ for (var i = 0; i < collection.length; ++i) {
46
+ collection[i](`).concat(argsDefCode,`);
47
+ }
48
+ });
49
+ })`)}{var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}}exports.bakeCollection=bakeCollection;function bakeCollectionAwait(collection,fixedArgsNum){if(collection.length===0)return exports.BAKED_EMPTY_FUNC;if(collection.length===1)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode=`(function(collection) {
50
+ `.concat(funcDefCode,`
51
+ collection = undefined;
52
+ return (function(`).concat(argsDefCode,`) {
53
+ return Promise.all([ `).concat(funcCallCode,` ]);
54
+ });
55
+ })`)}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);funcFactoryCode=`(function(collection) {
56
+ return (function(`.concat(argsDefCode,`) {
57
+ var promises = Array(collection.length);
58
+ for (var i = 0; i < collection.length; ++i) {
59
+ promises[i] = collection[i](`).concat(argsDefCode,`);
60
+ }
61
+ return Promise.all(promises);
62
+ });
63
+ })`)}{var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}}exports.bakeCollectionAwait=bakeCollectionAwait;function bakeCollectionVariadic(collection){if(collection.length===0)return exports.BAKED_EMPTY_FUNC;if(collection.length===1)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var _a=generateBodyPartsVariadicCode(collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode=`(function(collection) {
64
+ `.concat(funcDefCode,`
65
+ collection = undefined;
66
+ return (function() {
67
+ `).concat(funcCallCode,`
68
+ });
69
+ })`)}else funcFactoryCode=`(function(collection) {
70
+ return (function() {
71
+ for (var i = 0; i < collection.length; ++i) {
72
+ collection[i].apply(undefined, arguments);
73
+ }
74
+ });
75
+ })`;{var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}}exports.bakeCollectionVariadic=bakeCollectionVariadic})(bakeCollection)),bakeCollection}var hasRequiredTaskCollection$1;function requireTaskCollection$1(){if(hasRequiredTaskCollection$1)return taskCollection;hasRequiredTaskCollection$1=1;var a=taskCollection&&taskCollection.__spreadArray||function(o,g,t){if(t||arguments.length===2)for(var e=0,n=g.length,i;e<n;e++)(i||!(e in g))&&(i||(i=Array.prototype.slice.call(g,0,e)),i[e]=g[e]);return o.concat(i||Array.prototype.slice.call(g))};Object.defineProperty(taskCollection,"__esModule",{value:!0}),taskCollection.TaskCollection=void 0;var c=requireUtils$1(),l=requireBakeCollection();function u(o,g){var t=this.length;if(t>1)if(g){var e;(e=this._tasks).push.apply(e,arguments),this.length+=arguments.length}else this._tasks.push(o),this.length++;else if(g){if(t===1){var n=Array(1+arguments.length);n.push(n),n.push.apply(n,arguments),this._tasks=n}else{var n=Array(arguments.length);n.push.apply(n,arguments),this._tasks=n}this.length+=arguments.length}else t===1?this._tasks=[this._tasks,o]:this._tasks=o,this.length++}function r(o,g){var t=this.length;if(t>1)if(g){var e;(e=this._tasks).push.apply(e,arguments),this.length+=arguments.length}else this._tasks.push(o),this.length++;else if(g){if(t===1){var n=Array(1+arguments.length);n.push(n),n.push.apply(n,arguments),this._tasks=n}else{var n=Array(arguments.length);n.push.apply(n,arguments),this._tasks=n}this.length+=arguments.length}else t===1?this._tasks=[this._tasks,o]:this._tasks=o,this.length++;this.firstEmitBuildStrategy?this.call=m:this.rebuild()}function f(o){this.length!==0&&(this.length===1?this._tasks===o&&(this.length=0):((0,c._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(o)),this._tasks.length===1?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length))}function s(o){if(this.length!==0){if(this.length===1)if(this._tasks===o&&(this.length=0),this.firstEmitBuildStrategy){this.call=l.BAKED_EMPTY_FUNC;return}else{this.rebuild();return}else(0,c._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(o)),this._tasks.length===1?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length;this.firstEmitBuildStrategy?this.call=m:this.rebuild()}}function p(o){for(var g,t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];this.length===0?(this._tasks=t,this.length=1):this.length===1?(t.unshift(this._tasks),this._tasks=t,this.length=this._tasks.length):((g=this._tasks).splice.apply(g,a([o,0],t,!1)),this.length=this._tasks.length)}function E(o){for(var g,t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];this.length===0?(this._tasks=t,this.length=1):this.length===1?(t.unshift(this._tasks),this._tasks=t,this.length=this._tasks.length):((g=this._tasks).splice.apply(g,a([o,0],t,!1)),this.length=this._tasks.length),this.firstEmitBuildStrategy?this.call=m:this.rebuild()}function A(){this.length===0?this.call=l.BAKED_EMPTY_FUNC:this.length===1?this.call=this._tasks:this.call=(0,l.bakeCollection)(this._tasks,this.argsNum)}function O(){this.length===0?this.call=l.BAKED_EMPTY_FUNC:this.length===1?this.call=this._tasks:this.call=(0,l.bakeCollectionAwait)(this._tasks,this.argsNum)}function m(){this.rebuild(),this.call.apply(void 0,arguments)}var C=(function(){function o(g,t,e,n){t===void 0&&(t=!0),e===void 0&&(e=null),n===void 0&&(n=!1),this.awaitTasks=n,this.call=l.BAKED_EMPTY_FUNC,this.argsNum=g,this.firstEmitBuildStrategy=!0,n?this.rebuild=O.bind(this):this.rebuild=A.bind(this),this.setAutoRebuild(t),e?typeof e=="function"?(this._tasks=e,this.length=1):(this._tasks=e,this.length=e.length):(this._tasks=null,this.length=0),t&&this.rebuild()}return o})();taskCollection.TaskCollection=C;function F(){this._tasks=null,this.length=0,this.call=l.BAKED_EMPTY_FUNC}function x(){this._tasks=null,this.length=0,this.call=l.BAKED_EMPTY_FUNC}function q(o){this.argsNum<o&&(this.argsNum=o,this.firstEmitBuildStrategy?this.call=m:this.rebuild())}function B(o){o?(this.push=r.bind(this),this.insert=E.bind(this),this.removeLast=s.bind(this)):(this.push=u.bind(this),this.insert=p.bind(this),this.removeLast=f.bind(this))}function T(){return this.length===0?[]:this.length===1?[this._tasks]:this._tasks}function D(o){o.length===0?(this.length=0,this.call=l.BAKED_EMPTY_FUNC):o.length===1?(this.length=1,this.call=o[0],this._tasks=o[0]):(this.length=o.length,this._tasks=o,this.firstEmitBuildStrategy?this.call=m:this.rebuild())}return C.prototype.fastClear=F,C.prototype.clear=x,C.prototype.growArgsNum=q,C.prototype.setAutoRebuild=B,C.prototype.tasksAsArray=T,C.prototype.setTasks=D,taskCollection}var hasRequiredTaskCollection;function requireTaskCollection(){return hasRequiredTaskCollection||(hasRequiredTaskCollection=1,(function(a){var c=taskCollection$1&&taskCollection$1.__createBinding||(Object.create?(function(u,r,f,s){s===void 0&&(s=f);var p=Object.getOwnPropertyDescriptor(r,f);(!p||("get"in p?!r.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return r[f]}}),Object.defineProperty(u,s,p)}):(function(u,r,f,s){s===void 0&&(s=f),u[s]=r[f]})),l=taskCollection$1&&taskCollection$1.__exportStar||function(u,r){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(r,f)&&c(r,u,f)};Object.defineProperty(a,"__esModule",{value:!0}),l(requireTaskCollection$1(),a)})(taskCollection$1)),taskCollection$1}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,Object.defineProperty(utils,"__esModule",{value:!0}),utils.nullObj=void 0;function a(){var c={};return c.__proto__=null,c}return utils.nullObj=a,utils}var hasRequiredEe;function requireEe(){if(hasRequiredEe)return ee;hasRequiredEe=1;var a=ee&&ee.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var i=0,d=e.length,y;i<d;i++)(y||!(i in e))&&(y||(y=Array.prototype.slice.call(e,0,i)),y[i]=e[i]);return t.concat(y||Array.prototype.slice.call(e))};Object.defineProperty(ee,"__esModule",{value:!0}),ee.EventEmitter=void 0;var c=requireTaskCollection(),l=requireUtils$1(),u=requireUtils();function r(t,e,n,i,d,y){var _=this.events[t];if(_){if(_.length===0)return!1;if(_.argsNum<6)_.call(e,n,i,d,y);else{for(var v=new Array(_.argsNum),h=0,b=v.length;h<b;++h)v[h]=arguments[h+1];_.call.apply(void 0,v)}return!0}return!1}function f(t,e,n,i,d,y){var _=this.events[t],v;if(_!==void 0){if(_.length===0)return!1;if(_.argsNum<6)_.call(e,n,i,d,y);else{v=new Array(_.argsNum);for(var h=0,b=v.length;h<b;++h)v[h]=arguments[h+1];_.call.apply(void 0,v)}}var k=this.onceEvents[t];if(k){if(typeof k=="function")if(this.onceEvents[t]=void 0,arguments.length<6)k(e,n,i,d,y);else{if(v===void 0){v=new Array(arguments.length-1);for(var h=0,b=v.length;h<b;++h)v[h]=arguments[h+1]}k.apply(void 0,v)}else{var L=k;if(this.onceEvents[t]=void 0,arguments.length<6)for(var h=0;h<L.length;++h)L[h](e,n,i,d,y);else{if(v===void 0){v=new Array(arguments.length-1);for(var h=0,b=v.length;h<b;++h)v[h]=arguments[h+1]}for(var h=0;h<L.length;++h)L[h].apply(void 0,v)}}return!0}return _!==void 0}var s=(function(){function t(){this.events=(0,u.nullObj)(),this.onceEvents=(0,u.nullObj)(),this._symbolKeys=new Set,this.maxListeners=1/0}return Object.defineProperty(t.prototype,"_eventsCount",{get:function(){return this.eventNames().length},enumerable:!1,configurable:!0}),t})();ee.EventEmitter=s;function p(t,e){switch(this.emit===r&&(this.emit=f),typeof this.onceEvents[t]){case"undefined":this.onceEvents[t]=e,typeof t=="symbol"&&this._symbolKeys.add(t);break;case"function":this.onceEvents[t]=[this.onceEvents[t],e];break;case"object":this.onceEvents[t].push(e)}return this}function E(t,e,n){if(n===void 0&&(n=e.length),typeof e!="function")throw new TypeError("The listener must be a function");var i=this.events[t];return i?(i.push(e),i.growArgsNum(n),this.maxListeners!==1/0&&this.maxListeners<=i.length&&console.warn('Maximum event listeners for "'.concat(String(t),'" event!'))):(this.events[t]=new c.TaskCollection(n,!0,e,!1),typeof t=="symbol"&&this._symbolKeys.add(t)),this}function A(t,e){var n=this.events[t];n&&n.removeLast(e);var i=this.onceEvents[t];return i&&(typeof i=="function"?this.onceEvents[t]=void 0:typeof i=="object"&&(i.length===1&&i[0]===e?this.onceEvents[t]=void 0:(0,l._fast_remove_single)(i,i.lastIndexOf(e)))),this}function O(t,e,n,i){n===void 0&&(n=this),i===void 0&&(i=e.length),this.boundFuncs||(this.boundFuncs=new Map);var d=e.bind(n);return this.boundFuncs.set(e,d),this.addListener(t,d,i)}function m(t,e){var n,i,d=(n=this.boundFuncs)===null||n===void 0?void 0:n.get(e);return(i=this.boundFuncs)===null||i===void 0||i.delete(e),this.removeListener(t,d)}function C(t){return this.events[t]&&!!this.events[t].length}function F(t,e,n){if(n===void 0&&(n=e.length),typeof e!="function")throw new TypeError("The listener must be a function");var i=this.events[t];return!i||!(i instanceof c.TaskCollection)?(i=this.events[t]=new c.TaskCollection(n,!0,e,!1),typeof t=="symbol"&&this._symbolKeys.add(t)):(i.insert(0,e),i.growArgsNum(n),this.maxListeners!==1/0&&this.maxListeners<=i.length&&console.warn('Maximum event listeners for "'.concat(String(t),'" event!'))),this}function x(t,e){this.emit===r&&(this.emit=f);var n=this.onceEvents[t];return n?typeof n!="object"?(this.onceEvents[t]=[e,n],typeof t=="symbol"&&this._symbolKeys.add(t)):(n.unshift(e),this.maxListeners!==1/0&&this.maxListeners<=n.length&&console.warn('Maximum event listeners for "'.concat(String(t),'" once event!'))):(this.onceEvents[t]=[e],typeof t=="symbol"&&this._symbolKeys.add(t)),this}function q(t){return t===void 0?(this.events=(0,u.nullObj)(),this.onceEvents=(0,u.nullObj)(),this._symbolKeys=new Set):(this.events[t]=void 0,this.onceEvents[t]=void 0,typeof t=="symbol"&&this._symbolKeys.delete(t)),this}function B(t){return this.maxListeners=t,this}function T(){return this.maxListeners}function D(t){return this.emit===r?this.events[t]?this.events[t].tasksAsArray().slice():[]:this.events[t]&&this.onceEvents[t]?a(a([],this.events[t].tasksAsArray(),!0),typeof this.onceEvents[t]=="function"?[this.onceEvents[t]]:this.onceEvents[t],!0):this.events[t]?this.events[t].tasksAsArray():this.onceEvents[t]?typeof this.onceEvents[t]=="function"?[this.onceEvents[t]]:this.onceEvents[t]:[]}function o(){var t=this;if(this.emit===r){var e=Object.keys(this.events);return a(a([],e,!0),Array.from(this._symbolKeys),!0).filter(function(i){return i in t.events&&t.events[i]&&t.events[i].length})}else{var e=Object.keys(this.events).filter(function(d){return t.events[d]&&t.events[d].length}),n=Object.keys(this.onceEvents).filter(function(d){return t.onceEvents[d]&&t.onceEvents[d].length});return a(a(a([],e,!0),n,!0),Array.from(this._symbolKeys).filter(function(d){return d in t.events&&t.events[d]&&t.events[d].length||d in t.onceEvents&&t.onceEvents[d]&&t.onceEvents[d].length}),!0)}}function g(t){return this.emit===r?this.events[t]&&this.events[t].length||0:(this.events[t]&&this.events[t].length||0)+(this.onceEvents[t]&&this.onceEvents[t].length||0)}return s.prototype.emit=r,s.prototype.on=E,s.prototype.once=p,s.prototype.addListener=E,s.prototype.removeListener=A,s.prototype.addListenerBound=O,s.prototype.removeListenerBound=m,s.prototype.hasListeners=C,s.prototype.prependListener=F,s.prototype.prependOnceListener=x,s.prototype.off=A,s.prototype.removeAllListeners=q,s.prototype.setMaxListeners=B,s.prototype.getMaxListeners=T,s.prototype.listeners=D,s.prototype.eventNames=o,s.prototype.listenerCount=g,ee}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,(function(a){var c=lib&&lib.__createBinding||(Object.create?(function(u,r,f,s){s===void 0&&(s=f);var p=Object.getOwnPropertyDescriptor(r,f);(!p||("get"in p?!r.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return r[f]}}),Object.defineProperty(u,s,p)}):(function(u,r,f,s){s===void 0&&(s=f),u[s]=r[f]})),l=lib&&lib.__exportStar||function(u,r){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(r,f)&&c(r,u,f)};Object.defineProperty(a,"__esModule",{value:!0}),l(requireTypes(),a),l(requireEe(),a)})(lib)),lib}var libExports=requireLib();export{libExports as l};