@visulima/tui 1.0.0-alpha.19 → 1.0.0-alpha.20

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 (152) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE.md +370 -107
  3. package/dist/components/accordion.d.ts +1 -1
  4. package/dist/components/approval-prompt.d.ts +1 -1
  5. package/dist/components/area-chart.d.ts +1 -1
  6. package/dist/components/badge.d.ts +1 -1
  7. package/dist/components/bar-chart.d.ts +1 -1
  8. package/dist/components/blink-dot.d.ts +1 -1
  9. package/dist/components/box.d.ts +4 -4
  10. package/dist/components/breadcrumb.d.ts +1 -1
  11. package/dist/components/button.d.ts +1 -1
  12. package/dist/components/calendar.d.ts +1 -1
  13. package/dist/components/canvas.js +1 -1
  14. package/dist/components/card.d.ts +1 -1
  15. package/dist/components/checkbox.d.ts +1 -1
  16. package/dist/components/collapsible.d.ts +1 -1
  17. package/dist/components/command-palette.d.ts +1 -1
  18. package/dist/components/content-switcher.d.ts +1 -1
  19. package/dist/components/controlled-scroll-view.d.ts +4 -4
  20. package/dist/components/cursor.d.ts +13 -4
  21. package/dist/components/cursor.js +1 -1
  22. package/dist/components/date-picker.d.ts +1 -1
  23. package/dist/components/definition-list.d.ts +1 -1
  24. package/dist/components/dialog.d.ts +5 -5
  25. package/dist/components/divider.d.ts +1 -1
  26. package/dist/components/form.d.ts +1 -1
  27. package/dist/components/gauge.d.ts +1 -1
  28. package/dist/components/gradient.d.ts +18 -1
  29. package/dist/components/gradient.js +4 -1
  30. package/dist/components/heading.d.ts +1 -1
  31. package/dist/components/heatmap.d.ts +1 -1
  32. package/dist/components/histogram.d.ts +1 -1
  33. package/dist/components/kbd.d.ts +1 -1
  34. package/dist/components/line-chart.d.ts +1 -1
  35. package/dist/components/link.js +1 -1
  36. package/dist/components/loading-indicator.d.ts +2 -2
  37. package/dist/components/menu.d.ts +1 -1
  38. package/dist/components/message-bubble.d.ts +1 -1
  39. package/dist/components/model-badge.d.ts +1 -1
  40. package/dist/components/multi-select.d.ts +1 -1
  41. package/dist/components/option-list.d.ts +1 -1
  42. package/dist/components/paragraph.d.ts +1 -1
  43. package/dist/components/placeholder.d.ts +1 -1
  44. package/dist/components/progress-bar.d.ts +2 -3
  45. package/dist/components/radio-group.d.ts +1 -1
  46. package/dist/components/scatter-plot.d.ts +1 -1
  47. package/dist/components/scroll-bar-box.d.ts +4 -4
  48. package/dist/components/scroll-bar.d.ts +4 -4
  49. package/dist/components/scroll-list.d.ts +4 -4
  50. package/dist/components/scroll-view.d.ts +4 -4
  51. package/dist/components/search-input.d.ts +1 -1
  52. package/dist/components/select-input-indicator.d.ts +1 -1
  53. package/dist/components/select-input-item.d.ts +1 -1
  54. package/dist/components/select-input.d.ts +1 -1
  55. package/dist/components/shimmer-text.d.ts +1 -1
  56. package/dist/components/slider.d.ts +1 -1
  57. package/dist/components/sparkline.d.ts +1 -1
  58. package/dist/components/spinner.d.ts +1 -1
  59. package/dist/components/spinner.js +1 -1
  60. package/dist/components/static-render.d.ts +4 -4
  61. package/dist/components/static.d.ts +2 -3
  62. package/dist/components/status-line.d.ts +1 -1
  63. package/dist/components/stepper.d.ts +1 -1
  64. package/dist/components/streaming-text.d.ts +1 -1
  65. package/dist/components/switch.d.ts +1 -1
  66. package/dist/components/tabs.d.ts +1 -1
  67. package/dist/components/tag.d.ts +1 -1
  68. package/dist/components/text.d.ts +2 -3
  69. package/dist/components/text.js +1 -1
  70. package/dist/components/tooltip.d.ts +1 -1
  71. package/dist/components/tree-view-entry.d.ts +4 -4
  72. package/dist/core/index.d.ts +1 -2
  73. package/dist/core/index.js +1 -1
  74. package/dist/ink/hooks/use-box-metrics.d.ts +4 -4
  75. package/dist/ink/hooks/use-box-metrics.js +1 -1
  76. package/dist/ink/hooks/use-cursor.d.ts +1 -1
  77. package/dist/ink/hooks/use-input.js +1 -1
  78. package/dist/ink/hooks/use-linked-scroll.d.ts +4 -4
  79. package/dist/ink/hooks/use-paste.js +1 -1
  80. package/dist/ink/hooks/use-text-selection.d.ts +5 -5
  81. package/dist/ink/hooks/use-text-selection.js +1 -1
  82. package/dist/ink/hooks/use-window-size.js +1 -1
  83. package/dist/ink/index.d.ts +7 -8
  84. package/dist/ink/index.js +1 -1
  85. package/dist/packem_shared/{DevTools-ClAYpMVI.js → DevTools-BR7K-5JX.js} +1 -1
  86. package/dist/packem_shared/InputParser-BAqciKJ6.js +2 -0
  87. package/dist/packem_shared/{LayoutNode-B8zej4dm.js → LayoutNode-B0qeT8sl.js} +1 -1
  88. package/dist/packem_shared/{MouseProvider-PnIUKURs.js → MouseProvider-CHU5DuwC.js} +1 -1
  89. package/dist/packem_shared/TuiApp-CxBtziW8.js +1 -0
  90. package/dist/packem_shared/_commonjsHelpers-CHNfUHCT.js +1 -0
  91. package/dist/packem_shared/ansi-parser-C5JuL732.js +1 -0
  92. package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
  93. package/dist/packem_shared/colorize-gy_cY-wC.js +2 -0
  94. package/dist/packem_shared/{comparePoints-YxQfR_zq.js → comparePoints-Dez5FkH9.js} +1 -1
  95. package/dist/packem_shared/constants-D12jy2Zh-RSfxu1eM.js +1 -0
  96. package/dist/packem_shared/createInlineLoop-D0JaKX9A.js +2 -0
  97. package/dist/packem_shared/createScreen-87XLHZq6.js +3 -0
  98. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  99. package/dist/packem_shared/dom-CW6KYzFK.js +8 -0
  100. package/dist/packem_shared/{dom.d-CcFuBd-k.d.ts → dom.d-DgP_exKU.d.ts} +4 -5
  101. package/dist/packem_shared/erase-DKKNxHZ_.js +1 -0
  102. package/dist/packem_shared/get-string-width-CbMPWEJO.js +1 -0
  103. package/dist/packem_shared/{getPathToRoot-D5Hns9Er.js → getPathToRoot-B3q6OlQy.js} +1 -1
  104. package/dist/packem_shared/index-COPEEDn3.js +9 -0
  105. package/dist/packem_shared/index-CqsHHJkn.js +75 -0
  106. package/dist/packem_shared/index.d-Bk52cbgN.d.ts +14 -0
  107. package/dist/packem_shared/index.server.d-eZWyC2Ku.d.ts +5 -0
  108. package/dist/packem_shared/input.d-D-Yxqha8.d.ts +172 -0
  109. package/dist/packem_shared/measure-text-D-jVetsl.js +3 -0
  110. package/dist/packem_shared/mode-BOIU4Roy.js +1 -0
  111. package/dist/packem_shared/parseSgrMouse-DoBY7MKw.js +1 -0
  112. package/dist/packem_shared/reconciler-CGhHgXXG.js +1 -0
  113. package/dist/packem_shared/reconciler-ClRKkLS4.js +1 -0
  114. package/dist/packem_shared/{render-Dh7HMhK1.js → render-BoukeuYD.js} +1 -1
  115. package/dist/packem_shared/render-CBFHzIKj.js +27 -0
  116. package/dist/packem_shared/{render.d-B1kiO3Ca.d.ts → render.d-DarVJBG2.d.ts} +2 -2
  117. package/dist/packem_shared/{renderToString-DVE0cEHt.js → renderToString-Cx3DmmMR.js} +1 -1
  118. package/dist/packem_shared/{renderToString-BbQiRHrd.js → renderToString-nZdqfdWT.js} +1 -1
  119. package/dist/packem_shared/renderTreeToBuffer-LnGZkEUX.js +2 -0
  120. package/dist/packem_shared/renderer-C2ycheBL.js +17 -0
  121. package/dist/packem_shared/{selection.d-DAh7REnW.d.ts → selection.d-WuD_83yQ.d.ts} +1 -1
  122. package/dist/packem_shared/setEnableStyledLineCache-Cke6_ZQt.js +1 -0
  123. package/dist/packem_shared/strip-C6HQYmlg.js +1 -0
  124. package/dist/packem_shared/{styles.d-cMo36xQz.d.ts → styles.d-CLJdt-kg.d.ts} +98 -2
  125. package/dist/packem_shared/text-width-CI9G0a-z.js +2 -0
  126. package/dist/packem_shared/utils-THUhYKG2.js +1 -0
  127. package/dist/packem_shared/{wrapOrTruncateStyledLine-BZ00SM8i.js → wrapOrTruncateStyledLine-kyi6yijx.js} +1 -1
  128. package/dist/react/index.d.ts +1 -2
  129. package/dist/react/index.js +1 -1
  130. package/dist/testing/index.d.ts +5 -6
  131. package/dist/testing/index.js +1 -1
  132. package/index.js +539 -691
  133. package/package.json +11 -27
  134. package/dist/packem_shared/InputParser-B_qZcN3r.js +0 -2
  135. package/dist/packem_shared/TuiApp-BVDXP0Cv.js +0 -1
  136. package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
  137. package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
  138. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
  139. package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
  140. package/dist/packem_shared/cursor-helpers.d-BIvqz0TZ.d.ts +0 -5
  141. package/dist/packem_shared/dom-BG-LS10p.js +0 -1
  142. package/dist/packem_shared/input.d-CgxV2e8U.d.ts +0 -90
  143. package/dist/packem_shared/measure-text-DDjHT1jD.js +0 -3
  144. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
  145. package/dist/packem_shared/reconciler-CUbhOvcr.js +0 -1
  146. package/dist/packem_shared/reconciler-DIfG72R9.js +0 -1
  147. package/dist/packem_shared/render-bdbSzkJo.js +0 -26
  148. package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +0 -2
  149. package/dist/packem_shared/renderer-Cfi6ZyHf.js +0 -17
  150. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +0 -1
  151. package/dist/packem_shared/text-width-BU2eeTWn.js +0 -2
  152. package/dist/packem_shared/utils-CoviI5Vm.js +0 -1
@@ -1 +1 @@
1
- var N=Object.defineProperty;var g=(n,t)=>N(n,"name",{value:t,configurable:!0});import{g as m}from"./dom-BG-LS10p.js";import{t as O}from"./measure-text-DDjHT1jD.js";import{squashTextNodesWithMap as S}from"./squashTextNodesWithMap-DCdi3SZ2.js";var v=Object.defineProperty,l=g((n,t)=>v(n,"name",{value:t,configurable:!0}),"f");const x=l(n=>{if(n.nodeName==="#text"){const r=O(n.nodeValue);return{charOffsetMap:new Map([[n,{end:r.length,start:0}]]),styledLine:r}}const t=new Map,e=S(n,t,{current:0}),s=O(e);return t.set(n,{end:s.length,start:0}),{charOffsetMap:t,styledLine:s}},"getPlainTextFromDomNode"),y=l((n,t)=>{if(!n.startContainer||!n.endContainer)return;const e=l((i,h)=>{const o=t.get(i);if(!o)return;if(i.nodeName==="#text")return o.start+h;const d=i;if(h>=d.childNodes.length)return o.end;const a=d.childNodes[h],u=t.get(a);if(u)return u.start;for(let f=h-1;f>=0;f--){const c=d.childNodes[f],C=t.get(c);if(C)return C.end}return o.start},"getOffset"),s=e(n.startContainer,n.startOffset),r=e(n.endContainer,n.endOffset);if(!(s===void 0||r===void 0))return{end:r,start:s}},"getRangeCharacterOffsets"),p=l((n,t,e,s)=>{if(n===e)return t===s?0:t<s?-1:1;const r=m(n),i=m(e);let h,o=0;for(;o<r.length&&o<i.length&&r[o]===i[o];)h=r[o],o++;if(!h)return 0;if(o===r.length){const c=i[o],C=n.childNodes.indexOf(c);return t<=C?-1:1}if(o===i.length){const c=r[o];return e.childNodes.indexOf(c)<s?-1:1}const d=r[o],a=i[o],u=h.childNodes.indexOf(d),f=h.childNodes.indexOf(a);return u<f?-1:1},"comparePoints");class A{static{g(this,"Range")}static{l(this,"Range")}startContainer=void 0;startOffset=0;endContainer=void 0;endOffset=0;collapsed=!0;commonAncestorContainer=void 0;setStart(t,e){this.startContainer=t,this.startOffset=e,this.updateCollapsed(),this.updateCommonAncestor()}setEnd(t,e){this.endContainer=t,this.endOffset=e,this.updateCollapsed(),this.updateCommonAncestor()}collapse(t){t?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset),this.collapsed=!0,this.updateCommonAncestor()}selectNode(t){if(!t.parentNode)throw new Error("Node has no parent");const e=t.parentNode.childNodes.indexOf(t);this.setStart(t.parentNode,e),this.setEnd(t.parentNode,e+1)}selectNodeContents(t){this.setStart(t,0),t.nodeName==="#text"?this.setEnd(t,t.nodeValue.length):this.setEnd(t,t.childNodes.length)}toString(){if(this.collapsed||!this.startContainer||!this.endContainer||!this.commonAncestorContainer)return"";const{charOffsetMap:t,styledLine:e}=x(this.commonAncestorContainer),s=y(this,t);if(!s)return"";const r=e.slice(s.start,s.end);return r.getTextRange(0,r.length)}updateCollapsed(){this.collapsed=this.startContainer===this.endContainer&&this.startOffset===this.endOffset}updateCommonAncestor(){if(!this.startContainer||!this.endContainer){this.commonAncestorContainer=void 0;return}if(this.startContainer===this.endContainer){this.commonAncestorContainer=this.startContainer;return}const t=m(this.startContainer),e=m(this.endContainer);let s;for(let r=0;r<Math.min(t.length,e.length)&&t[r]===e[r];r++)s=t[r];this.commonAncestorContainer=s}}class L{static{g(this,"Selection")}static{l(this,"Selection")}anchorNode=void 0;anchorOffset=0;focusNode=void 0;focusOffset=0;isCollapsed=!0;rangeCount=0;ranges=[];listeners=new Set;onChange(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}toString(){return this.ranges.map(t=>t.toString()).join("")}getRangeAt(t){return this.ranges[t]}addRange(t){this.ranges.includes(t)||(this.ranges.push(t),this.rangeCount=this.ranges.length,this.rangeCount===1&&(this.anchorNode=t.startContainer,this.anchorOffset=t.startOffset,this.focusNode=t.endContainer,this.focusOffset=t.endOffset,this.isCollapsed=t.collapsed),this.notifyChange())}removeRange(t){const e=this.ranges.indexOf(t);e!==-1&&(this.ranges.splice(e,1),this.rangeCount=this.ranges.length,this.rangeCount===0&&this.clearState(),this.notifyChange())}removeAllRanges(){this.ranges=[],this.rangeCount=0,this.clearState(),this.notifyChange()}collapse(t,e){this.removeAllRanges();const s=new A;s.setStart(t,e),s.setEnd(t,e),this.addRange(s)}containsNode(t,e=!1){if(!t.parentNode)return!1;const s=t.parentNode,r=s.childNodes.indexOf(t),i=s,h=r,o=s,d=r+1;return this.ranges.some(a=>{if(!a.startContainer||!a.endContainer)return!1;const u=p(a.startContainer,a.startOffset,i,h),f=p(a.endContainer,a.endOffset,o,d);if(e){const c=p(a.startContainer,a.startOffset,o,d),C=p(a.endContainer,a.endOffset,i,h);return c<0&&C>0}return u<=0&&f>=0})}clearState(){this.anchorNode=void 0,this.anchorOffset=0,this.focusNode=void 0,this.focusOffset=0,this.isCollapsed=!0}notifyChange(){for(const t of this.listeners)t()}}const T=l((n,t)=>{if(n.length===0||t.start>=t.end)return n;const e=n.clone(),s=Math.max(0,t.start),r=Math.min(n.length,t.end);for(let i=s;i<r;i++)e.setInverted(i,!0);return e},"applySelectionToStyledLine");export{A as Range,L as Selection,T as applySelectionToStyledLine,p as comparePoints};
1
+ var N=Object.defineProperty;var g=(n,t)=>N(n,"name",{value:t,configurable:!0});import{g as m}from"./dom-CW6KYzFK.js";import{t as O}from"./measure-text-D-jVetsl.js";import{squashTextNodesWithMap as S}from"./squashTextNodesWithMap-DCdi3SZ2.js";var v=Object.defineProperty,l=g((n,t)=>v(n,"name",{value:t,configurable:!0}),"f");const x=l(n=>{if(n.nodeName==="#text"){const r=O(n.nodeValue);return{charOffsetMap:new Map([[n,{end:r.length,start:0}]]),styledLine:r}}const t=new Map,e=S(n,t,{current:0}),s=O(e);return t.set(n,{end:s.length,start:0}),{charOffsetMap:t,styledLine:s}},"getPlainTextFromDomNode"),y=l((n,t)=>{if(!n.startContainer||!n.endContainer)return;const e=l((i,h)=>{const o=t.get(i);if(!o)return;if(i.nodeName==="#text")return o.start+h;const d=i;if(h>=d.childNodes.length)return o.end;const a=d.childNodes[h],u=t.get(a);if(u)return u.start;for(let f=h-1;f>=0;f--){const c=d.childNodes[f],C=t.get(c);if(C)return C.end}return o.start},"getOffset"),s=e(n.startContainer,n.startOffset),r=e(n.endContainer,n.endOffset);if(!(s===void 0||r===void 0))return{end:r,start:s}},"getRangeCharacterOffsets"),p=l((n,t,e,s)=>{if(n===e)return t===s?0:t<s?-1:1;const r=m(n),i=m(e);let h,o=0;for(;o<r.length&&o<i.length&&r[o]===i[o];)h=r[o],o++;if(!h)return 0;if(o===r.length){const c=i[o],C=n.childNodes.indexOf(c);return t<=C?-1:1}if(o===i.length){const c=r[o];return e.childNodes.indexOf(c)<s?-1:1}const d=r[o],a=i[o],u=h.childNodes.indexOf(d),f=h.childNodes.indexOf(a);return u<f?-1:1},"comparePoints");class A{static{g(this,"Range")}static{l(this,"Range")}startContainer=void 0;startOffset=0;endContainer=void 0;endOffset=0;collapsed=!0;commonAncestorContainer=void 0;setStart(t,e){this.startContainer=t,this.startOffset=e,this.updateCollapsed(),this.updateCommonAncestor()}setEnd(t,e){this.endContainer=t,this.endOffset=e,this.updateCollapsed(),this.updateCommonAncestor()}collapse(t){t?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset),this.collapsed=!0,this.updateCommonAncestor()}selectNode(t){if(!t.parentNode)throw new Error("Node has no parent");const e=t.parentNode.childNodes.indexOf(t);this.setStart(t.parentNode,e),this.setEnd(t.parentNode,e+1)}selectNodeContents(t){this.setStart(t,0),t.nodeName==="#text"?this.setEnd(t,t.nodeValue.length):this.setEnd(t,t.childNodes.length)}toString(){if(this.collapsed||!this.startContainer||!this.endContainer||!this.commonAncestorContainer)return"";const{charOffsetMap:t,styledLine:e}=x(this.commonAncestorContainer),s=y(this,t);if(!s)return"";const r=e.slice(s.start,s.end);return r.getTextRange(0,r.length)}updateCollapsed(){this.collapsed=this.startContainer===this.endContainer&&this.startOffset===this.endOffset}updateCommonAncestor(){if(!this.startContainer||!this.endContainer){this.commonAncestorContainer=void 0;return}if(this.startContainer===this.endContainer){this.commonAncestorContainer=this.startContainer;return}const t=m(this.startContainer),e=m(this.endContainer);let s;for(let r=0;r<Math.min(t.length,e.length)&&t[r]===e[r];r++)s=t[r];this.commonAncestorContainer=s}}class L{static{g(this,"Selection")}static{l(this,"Selection")}anchorNode=void 0;anchorOffset=0;focusNode=void 0;focusOffset=0;isCollapsed=!0;rangeCount=0;ranges=[];listeners=new Set;onChange(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}toString(){return this.ranges.map(t=>t.toString()).join("")}getRangeAt(t){return this.ranges[t]}addRange(t){this.ranges.includes(t)||(this.ranges.push(t),this.rangeCount=this.ranges.length,this.rangeCount===1&&(this.anchorNode=t.startContainer,this.anchorOffset=t.startOffset,this.focusNode=t.endContainer,this.focusOffset=t.endOffset,this.isCollapsed=t.collapsed),this.notifyChange())}removeRange(t){const e=this.ranges.indexOf(t);e!==-1&&(this.ranges.splice(e,1),this.rangeCount=this.ranges.length,this.rangeCount===0&&this.clearState(),this.notifyChange())}removeAllRanges(){this.ranges=[],this.rangeCount=0,this.clearState(),this.notifyChange()}collapse(t,e){this.removeAllRanges();const s=new A;s.setStart(t,e),s.setEnd(t,e),this.addRange(s)}containsNode(t,e=!1){if(!t.parentNode)return!1;const s=t.parentNode,r=s.childNodes.indexOf(t),i=s,h=r,o=s,d=r+1;return this.ranges.some(a=>{if(!a.startContainer||!a.endContainer)return!1;const u=p(a.startContainer,a.startOffset,i,h),f=p(a.endContainer,a.endOffset,o,d);if(e){const c=p(a.startContainer,a.startOffset,o,d),C=p(a.endContainer,a.endOffset,i,h);return c<0&&C>0}return u<=0&&f>=0})}clearState(){this.anchorNode=void 0,this.anchorOffset=0,this.focusNode=void 0,this.focusOffset=0,this.isCollapsed=!0}notifyChange(){for(const t of this.listeners)t()}}const T=l((n,t)=>{if(n.length===0||t.start>=t.end)return n;const e=n.clone(),s=Math.max(0,t.start),r=Math.min(n.length,t.end);for(let i=s;i<r;i++)e.setInverted(i,!0);return e},"applySelectionToStyledLine");export{A as Range,L as Selection,T as applySelectionToStyledLine,p as comparePoints};
@@ -0,0 +1 @@
1
+ const x="\x1B",B="\x1B[",o="\x1B]",s="\x07",t=";";export{s as B,B as a,t as o,o as s,x};
@@ -0,0 +1,2 @@
1
+ var N=Object.defineProperty;var n=(i,r)=>N(i,"name",{value:r,configurable:!0});import{N as O,H as P,P as S,T as Y,G as m,E as A,z as L}from"./erase-DKKNxHZ_.js";import{o as U,h as y,g as M,e as $}from"./mode-BOIU4Roy.js";import{terminalSize as j,Renderer as k}from"./Renderer-DJXooAsp.js";var B=Object.defineProperty,o=n((i,r)=>B(i,"name",{value:r,configurable:!0}),"r");const g=U(2026),D=y(g),H=M(g),q=y($),C=M($);function F(i,r={}){const h=r.rows??10,x=r.fps??60,z=r.onExit??"preserve";let l=null,a=null,p=null,f=80,s=10,E=0,c=1;function e(t){a.writeRaw(t)}n(e,"e"),o(e,"write");function d(){p.fill(0),i(p,f,s,E++),e(D);try{a.render(p)}finally{e(H)}}n(d,"u"),o(d,"tick");function w(t){c=t-s,e(O(s)+P),a.setRowOffset(c),d(),l=setInterval(()=>{d()},Math.round(1e3/x))}n(w,"E$1"),o(w,"startRendering");function I(){const t=j();f=t.cols;const G=t.rows;s=Math.min(h,G),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8"),a=new k(f,s),p=new Uint32Array(f*s*2),e(S),e(q),e(`
2
+ `.repeat(s)),e(Y),process.on("SIGINT",u);let v="";const R=o(b=>{v+=b;const T=v.match(/\u001B\[(\d+);(\d+)R/);T&&(process.stdin.off("data",R),w(Number.parseInt(T[1],10)))},"onData");process.stdin.on("data",R)}n(I,"P$1"),o(I,"start");function u(){if(l&&(clearInterval(l),l=null),a){if(z==="destroy"){for(let t=0;t<s;t++)e(m(c+1+t,1)+A);e(m(c+1,1))}else e(m(c+s+1,1));e(C),e(L)}process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdin.pause(),process.exit(0)}return n(u,"f"),o(u,"stop"),{start:I,stop:u}}n(F,"createInlineLoop");o(F,"createInlineLoop");export{F as createInlineLoop};
@@ -0,0 +1,3 @@
1
+ var u=Object.defineProperty;var n=(t,r)=>u(t,"name",{value:r,configurable:!0});import{s}from"./strip-C6HQYmlg.js";var c=Object.defineProperty,i=n((t,r)=>c(t,"name",{value:r,configurable:!0}),"e");const m=i((t,r)=>{const a=i(e=>e===void 0?"":s(e),"clean");return{contains(e){return this.text().includes(e)},frames(){return r.map(e=>s(e))},line(e){return this.text().split(`
2
+ `)[e]??""},lines(){return this.text().split(`
3
+ `).filter(e=>e.trim()!=="")},matches(e){return e.test(this.text())},rawFrames(){return[...r]},rawText(){return t()??""},text(){return a(t())}}},"createScreen");export{m as createScreen};
@@ -0,0 +1,12 @@
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
+ export { CursorShape as C, CursorPosition as a };
@@ -0,0 +1,8 @@
1
+ var he=Object.defineProperty;var b=(e,t)=>he(e,"name",{value:t,configurable:!0});import fe from"yoga-layout";import{e as V}from"./measure-text-D-jVetsl.js";import pe from"./squashTextNodesWithMap-DCdi3SZ2.js";import{o as B,k as G,G as q,h as K,N as P,m as me,l as E,i as D,d as H,F as ge,b as xe,s as L,t as ve,a as ye}from"./get-string-width-CbMPWEJO.js";var Be=Object.defineProperty,ee=b((e,t)=>Be(e,"name",{value:t,configurable:!0}),"i"),Ne=Object.defineProperty,te=ee((e,t)=>Ne(e,"name",{value:t,configurable:!0}),"r"),be=Object.defineProperty,we=te((e,t)=>be(e,"name",{value:t,configurable:!0}),"c");class ke{static{b(this,"l")}static{ee(this,"y")}static{te(this,"s")}static{we(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(i=>i!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,i){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(s=>s!==t);else if(this.cache.size>=this.capacity){const s=this.keyOrder.shift();s!==void 0&&this.cache.delete(s)}this.cache.set(t,i),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(i=>i!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}}var Se=Object.defineProperty,Ae=b((e,t)=>Se(e,"name",{value:t,configurable:!0}),"S$1"),Ee=Object.defineProperty,$e=Ae((e,t)=>Ee(e,"name",{value:t,configurable:!0}),"w"),We=Object.defineProperty,$=$e((e,t)=>We(e,"name",{value:t,configurable:!0}),"y");const z=new ke(100),Oe=new Intl.Segmenter("en",{granularity:"grapheme"}),Re=/^[\u0000-\u007F]*$/,Te=new Set(["0","22","23","24","27","28","29","39","49"]),Ce=new Set(["1","3","4","7","8","9"]),U=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),W=$(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),O=$(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Fe=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],Y=$((e,t)=>{let i=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(i===-1||o<i)&&(i=o)}return i},"findFirstPositionOfAny"),_e=$((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:B(e,t.width)}];const i=z.get(e);if(i)return i;const s=[],o=[];let n=0,a;for(K.lastIndex=0;(a=K.exec(e))!==null;){const c=a[0];s.push(e.slice(n,a.index)),o.push(c),n=a.index+c.length}n<e.length&&s.push(e.slice(n));const l=[];for(const c of o){if(c==="\x1B[0m"||c==="\x1B]8;;\x07"){l.push(c);continue}if(c.startsWith("\x1B[")&&c.endsWith("m")){const u=c.slice(2,-1);if(Te.has(u)){l.push(c);continue}}}const r=new Set,d=[];for(const[c,u]of s.entries()){if(c>0&&o[c-1]){const p=o[c-1];if(p==="\x1B[0m")r.clear();else if(p==="\x1B]8;;\x07"){for(const f of r)if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){r.delete(f);break}}else if(p.startsWith("\x1B[")&&p.endsWith("m")){const f=p.slice(2,-1);if(f==="39"){for(const h of r)if(h.startsWith("\x1B[")&&h.endsWith("m")){const g=h.slice(2,-1);if(W(g)){r.delete(h);break}}}else if(f==="49"){for(const h of r)if(h.startsWith("\x1B[")&&h.endsWith("m")){const g=h.slice(2,-1);if(O(g)){r.delete(h);break}}}else if(U.has(f)){const h=U.get(f);for(const g of r)if(g===`\x1B[${h}m`){r.delete(g);break}}else{if(W(f)){for(const h of r)if(h.startsWith("\x1B[")&&h.endsWith("m")){const g=h.slice(2,-1);if(W(g)){r.delete(h);break}}}else if(O(f)){for(const h of r)if(h.startsWith("\x1B[")&&h.endsWith("m")){const g=h.slice(2,-1);if(O(g)){r.delete(h);break}}}else if(Ce.has(f)){const h=`\x1B[${f}m`;r.has(h)&&r.delete(h)}r.add(p)}}else if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){for(const f of r)if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){r.delete(f);break}r.add(p)}}if(u==="")continue;let m="";if(r.size>0)if(l.includes("\x1B[0m"))m="\x1B[0m";else{const p=[];let f=!1;for(const v of r)if(v.startsWith("\x1B]8;;")&&!v.endsWith("\x1B]8;;\x07")){f=!0;break}f&&l.includes("\x1B]8;;\x07")&&p.push("\x1B]8;;\x07");let h=!1,g=!1;for(const v of r)if(v.startsWith("\x1B[")&&v.endsWith("m")){const N=v.slice(2,-1);W(N)?h=!0:O(N)&&(g=!0)}if(h&&g){const v=Y(e,["\x1B[3","\x1B[9","\x1B[38;"]),N=Y(e,["\x1B[4","\x1B[10","\x1B[48;"]);v>=0&&N>=0?v>N?p.push("\x1B[39m","\x1B[49m"):p.push("\x1B[49m","\x1B[39m"):p.push("\x1B[39m","\x1B[49m")}else h&&p.push("\x1B[39m"),g&&p.push("\x1B[49m");h&&g&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(p.length-=2,p.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(p.length-=2,p.push("\x1B[49m","\x1B[39m")));const j=Fe.filter(v=>r.has(v.open)).map(v=>({position:e.indexOf(v.open),style:v})).filter(v=>v.position>=0).toSorted((v,N)=>N.position-v.position);for(const v of j){const N=v;l.includes(N.style.close)&&p.push(N.style.close)}m=p.join("")}const x=[...r].join("");d.push({after:m,before:x,content:u,visibleLength:B(u,{fullWidth:1,wideWidth:1})})}return z.set(e,d),d},"processIntoStyledSegments"),je=$((e,t,i,s)=>{const o=[...s.segmenter.segment(e)],n=[];let a=0,l=!1;for(const r of o){const d=B(r.segment,s.width),c=a,u=a+d;if(!l)if(c<t){a=u;continue}else l=!0;if(c>=i||u>i)break;n.push(r.segment),a=u}return n.join("")},"fastSlice"),w=$((e,t=0,i=Number.MAX_SAFE_INTEGER,s={})=>{const o={segmenter:Oe,...s};if(t>=i||e==="")return"";const n=B(e,o.width);if(t===0&&i>=n)return e;if(t<0||i<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Re.test(e)?e.slice(t,i):je(e,t,i,o);if(G.lastIndex=0,q.lastIndex=0,!G.test(e)&&!q.test(e))return e;const a=_e(e,o);if(a.length===0)return"";let l=0;const r=[];for(const[u,m]of a.entries()){const x=l,p=l+m.visibleLength;if(p>t&&x<i){const f=Math.max(0,t-x),h=Math.min(m.visibleLength,i-x);r.push({end:h,index:u,segment:m,start:f})}l=p}if(r.length===0)return"";const d=[],c=r[0].segment;d.push(c.before);for(let u=0;u<r.length;u++){const{end:m,segment:x,start:p}=r[u];if(p===0&&m===x.visibleLength)d.push(x.content);else{const f=[...o.segmenter.segment(x.content)];d.push(f.slice(p,m).map(h=>h.segment).join(""))}if(u<r.length-1){const f=r[u+1].segment,h=x.after,g=f.before;h!==g&&(h||g)&&d.push(h,g)}}return d.push(r.at(-1).segment.after),d.join("")},"slice");var Ie=Object.defineProperty,Pe=b((e,t)=>Ie(e,"name",{value:t,configurable:!0}),"x"),Le=Object.defineProperty,De=Pe((e,t)=>Le(e,"name",{value:t,configurable:!0}),"T"),He=Object.defineProperty,_=De((e,t)=>He(e,"name",{value:t,configurable:!0}),"f");const X="…",Me=3,R=_((e,t,i=!1)=>{if(e.charAt(t)===" ")return t;const s=i?1:-1,o=Math.min(Me,i?e.length-t:t);for(let n=1;n<=o;n++){const a=t+n*s;if(e.charAt(a)===" ")return a}return t},"findNearestSpace"),T=_((e,t,i)=>P(e,{...i,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),C=_((e,t,i)=>B(e.slice(0,t),i),"indexToWidth"),Ve=_((e,t,i={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const s=e.normalize("NFC"),{ellipsis:o=X,position:n="end",preferTruncationOnSpace:a=!1}=i;let l=i.ellipsisWidth??o===X?1:void 0;l??=P(o,{...i.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:r}=P(s,{...i.width,ellipsis:o,ellipsisWidth:l});if(r<=t)return s;switch(n){case"end":{if(a){const d=t-l,c=T(s,d,i.width),u=R(s,c),m=C(s,u,i.width);return w(s,0,m,{width:i.width})+o}return w(s,0,t-l,{width:i.width})+o}case"middle":{const d=Math.floor(t/2),c=Math.max(0,t-l),u=Math.min(d,c),m=Math.max(0,c-u);if(a){const x=T(s,u,i.width),p=R(s,x),f=C(s,p,i.width),h=r-m,g=T(s,h,i.width),j=R(s,g,!0),v=C(s,j,i.width);return w(s,0,f,{width:i.width})+o+w(s,v,r,{width:i.width}).trim()}return w(s,0,u,{width:i.width})+o+w(s,r-m,r,{width:i.width})}case"start":{if(a){const d=r-t+l,c=T(s,d,i.width),u=R(s,c,!0),m=C(s,u,i.width);return o+w(s,m,r,{width:i.width}).trim()}return o+w(s,r-t+l,r,{width:i.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${n}'`)}},"truncate");var Ge=Object.defineProperty,ie=b((e,t)=>Ge(e,"name",{value:t,configurable:!0}),"b"),qe=Object.defineProperty,A=ie((e,t)=>qe(e,"name",{value:t,configurable:!0}),"d"),Ke=Object.defineProperty,ze=A((e,t)=>Ke(e,"name",{value:t,configurable:!0}),"a");const Ue=/\x1B\[(\d+)m/;let se=class{static{b(this,"T")}static{ie(this,"T")}static{A(this,"d")}static{ze(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const i=Ue.exec(t);if(!i)return;const s=Number.parseInt(i[1],10);switch(s){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=t;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(s)){const o={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];o&&(this.activeFormatting=this.activeFormatting.filter(n=>!n.includes(o)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const i={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(s=>{const o=i[s];o&&t.push(o)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var Ye=Object.defineProperty,re=A((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"o");const ne=re((e,t)=>{if(!E.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const i=!0,s=e.slice(t+1,t+1+L.length).join("")===L;return{isInsideEscape:i,isInsideLinkEscape:s}},"checkEscapeSequence"),Xe=re((e,t={})=>{const i=new se;let s="",o=!1,n="",a="",l=!1;const r=[...e];for(let d=0;d<r.length;d++){const c=r[d];if(c&&E.has(c)){if(s){const f=t.getWidth?.(s)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:s,width:f};if(l&&(h.isHyperlink=!0,h.hyperlinkUrl=a),t.onSegment?.(h,i)===!1)return;s=""}o=!0,n=c;const x=ne(r,d),{isInsideLinkEscape:p}=x;if(p){let f=d+1;for(a="";f<r.length;){const g=r[f];if(g===D)break;a+=g,f+=1}a=a.slice(4);const h={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(h,i)===!1)return;d=f,l=!0,o=!1,n="";continue}if(d+1<r.length&&r[d+1]==="\\"&&l){const f={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(f,i)===!1)return;l=!1,a="",d+=1,o=!1,n="";continue}}if(o){if(n!==c&&(n+=c),c===H){o=!1,i.processEscape(n);const x={isEscapeSequence:!0,isGrapheme:!1,text:n,width:0};if(t.onSegment?.(x,i)===!1)return;n=""}continue}s+=c;const u=t.getWidth?.(s)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};if(l&&(m.isHyperlink=!0,m.hyperlinkUrl=a),t.onSegment?.(m,i)===!1)return;s=""}if(s){const d=t.getWidth?.(s)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:s,width:d};l&&(c.isHyperlink=!0,c.hyperlinkUrl=a),t.onSegment?.(c,i)}if(n){const d={isEscapeSequence:!0,isGrapheme:!1,text:n,width:0};t.onSegment?.(d,i)}},"processAnsiString");var Ze=Object.defineProperty,Je=A((e,t)=>Ze(e,"name",{value:t,configurable:!0}),"t$1");const Z=Je(e=>`${E.values().next().value}${ve}${String(e)}${H}`,"wrapAnsiCode");var Qe=Object.defineProperty,et=A((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"s");const J=et(e=>`${E.values().next().value}${L}${e}${D}`,"wrapAnsiHyperlink");var tt=Object.defineProperty,it=A((e,t)=>tt(e,"name",{value:t,configurable:!0}),"l");const st=it(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",i,s;const o=e.join(`
2
+ `),n=[...o];let a=0;for(const[l,r]of n.entries()){if(t+=r,E.has(r)){const c=ge.exec(o.slice(a))?.groups??{};if(c.code!==void 0){const u=Number.parseFloat(c.code);i=u===ye?void 0:u}else c.uri!==void 0&&(s=c.uri.length===0?void 0:c.uri)}const d=xe.get(Number(i));n[l+1]===`
3
+ `?(s&&(t+=J("")),i&&d&&(t+=Z(d))):r===`
4
+ `&&(i&&d&&(t+=Z(i)),s&&(t+=J(s))),a+=r.length}return t},"preserveAnsi");var rt=Object.defineProperty,k=A((e,t)=>rt(e,"name",{value:t,configurable:!0}),"f");const oe=/(?=\s)|(?<=\s)/,ae=/^\s+$/,I=k(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),S=k(e=>{const t=e.split(" ");let i=t.length;for(;i>0&&B(t[i-1])===0;)i--;return i===t.length?e:t.slice(0,i).join(" ")+t.slice(i).join("")},"stringVisibleTrimSpacesRight"),ce=k((e,t,i)=>{if(e.length===0)return[""];if(t<=0)return[e];const s=[],o=new se;let n="",a=0,l=!1,r=!1,d="",c=0;for(;c<e.length;){const u=e[c];if(E.has(u)){l=!0,d=u,n+=u,r=ne([...e],c).isInsideLinkEscape,c+=1;continue}if(l){d+=u,n+=u,r?u===D&&(l=r=!1):u===H&&(l=!1,o.processEscape(d)),c+=1;continue}const m=B(u),x=u===" ";if(m===0){n+=u,c+=1;continue}if(a+m>t&&(n&&s.push(n+o.getEndEscapesForAllActiveAttributes()),n=o.getStartEscapesForAllActiveAttributes(),a=B(n),x&&i)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(n+=u,a+=m,a===t&&c<e.length-1&&(s.push(n+o.getEndEscapesForAllActiveAttributes()),n=o.getStartEscapesForAllActiveAttributes(),a=B(n),c+1<e.length&&e[c+1]===" "&&i)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;continue}c+=1}return n&&s.push(n+o.getEndEscapesForAllActiveAttributes()),i?s.map(u=>S(u)):s},"wrapWithBreakAtWidth"),nt=k((e,t,i)=>{if(e.length===0)return[];const s=i?e.trim():e;if(s.length===0)return[];const o=[];let n="",a=0;return Xe(s,{getWidth:B,onSegment:k((l,r)=>{const d=l.text??"";if(l.isEscapeSequence)n+=d;else{const c=d===" ";if(l.width===0)return n+=d,!0;if(a+l.width>t&&(n&&o.push(n),n=r.getStartEscapesForAllActiveAttributes(),a=0,c))return i||o.push(r.getStartEscapesForAllActiveAttributes()+d),!0;n+=d,a+=l.width}return!0},"onSegment")}),n&&o.push(n),i?o.map(l=>S(l)):o},"wrapCharByChar"),ot=k((e,t,i)=>{if(e.length===0)return[];const s=i?e.trim():e;if(s.length===0)return[];const o=s.split(oe),n=[];let a="",l=0,r=0;for(;r<o.length;){const d=o[r],c=ae.test(d),u=B(d);if(d.length===0){r+=1;continue}if(i&&c&&l===0){r+=1;continue}if(l+u>t&&l>0){i?n.push(S(a)):n.push(a),a="",l=0;continue}a+=d,l+=u,r+=1}return a&&(i?n.push(S(a)):n.push(a)),n},"wrapWithWordBoundaries"),at=k((e,t,i)=>{if(e.length===0)return[];const s=i?e.trim():e;if(s.length===0)return[];const o=s.split(oe),n=[];let a="",l=0,r=0;for(;r<o.length;){const d=o[r],c=ae.test(d),u=B(d);if(d.length===0){r+=1;continue}if(i&&c&&l===0){r+=1;continue}if(u>t){a&&n.push(I(i?S(a):a));const m=ce(d,t,i);if(m.length>0){for(let x=0;x<m.length-1;x+=1)n.push(m[x]);a=m.at(-1),l=B(a)}else a="",l=0;r+=1;continue}if(l+u>t&&l>0&&(n.push(I(i?S(a):a)),a="",l=0,i&&c)){r+=1;continue}a+=d,l+=u,r+=1}return a&&n.push(I(i?S(a):a)),n},"wrapAndBreakWords"),F={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},ct=k((e,t={})=>{const{removeZeroWidthCharacters:i=!0,trim:s=!0,width:o=80,wrapMode:n=F.PRESERVE_WORDS}=t;if(s&&e.trim()==="")return"";let a=e.normalize("NFC").replaceAll(`\r
5
+ `,`
6
+ `);return i&&(a=a.replaceAll(me,"")),a.split(`
7
+ `).map(l=>{if(s&&l.trim()==="")return"";let r;switch(n){case F.BREAK_AT_CHARACTERS:{r=nt(l,o,s);break}case F.BREAK_WORDS:{r=at(l,o,s);break}case F.STRICT_WIDTH:{r=ce(l,o,s);break}default:r=ot(l,o,s)}return st(r)}).join(`
8
+ `)},"wordWrap");var lt=Object.defineProperty,dt=b((e,t)=>lt(e,"name",{value:t,configurable:!0}),"R");const Q={},ut={hard:"STRICT_WIDTH",wrap:"BREAK_WORDS","wrap-anywhere":"BREAK_AT_CHARACTERS","wrap-preserve-words":"PRESERVE_WORDS","wrap-strict":"STRICT_WIDTH"},ht=dt((e,t,i)=>{const s=e+String(t)+String(i),o=Q[s];if(o)return o;let n=e;const a=ut[i];if(a)n=ct(e,{trim:!1,width:t,wrapMode:a}).replace(/\n$/,"");else if(i.startsWith("truncate")){let l="end";i==="truncate-middle"&&(l="middle"),i==="truncate-start"&&(l="start"),n=Ve(e,t,{position:l})}return Q[s]=n,n},"wrapText");var ft=Object.defineProperty,y=b((e,t)=>ft(e,"name",{value:t,configurable:!0}),"n");let pt=0;const wt=y(e=>{const t={attributes:{},childNodes:[],internal_accessibility:{},internal_id:pt++,nodeName:e,parentNode:void 0,style:{},yogaNode:e==="ink-virtual-text"||e==="ink-cursor"?void 0:fe.Node.create()};return e==="ink-text"&&t.yogaNode?.setMeasureFunc(mt.bind(null,t)),t},"createNode"),M=y(e=>{ue(e.nodeName==="ink-static-render"&&e.cachedRender?e.parentNode:e)},"markNodeAndParentIfStaticAsDirty"),kt=y((e,t)=>{t.parentNode&&le(t.parentNode,t),t.parentNode=e,e.childNodes.push(t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,e.yogaNode.getChildCount()),M(e)},"appendChildNode"),St=y((e,t,i)=>{t.parentNode&&le(t.parentNode,t),t.parentNode=e;const s=e.childNodes.indexOf(i);if(s===-1)e.childNodes.push(t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,e.yogaNode.getChildCount());else if(e.childNodes.splice(s,0,t),t.yogaNode){const o=e.childNodes.slice(0,s).filter(n=>!!n.yogaNode).length;e.yogaNode?.insertChild(t.yogaNode,o)}M(e)},"insertBeforeNode"),le=y((e,t)=>{if(t.yogaNode){const s=t.yogaNode.getParent();s&&s.removeChild(t.yogaNode)}t.parentNode=void 0;const i=e.childNodes.indexOf(t);i!==-1&&e.childNodes.splice(i,1),M(e)},"removeChildNode"),At=y((e,t,i)=>{if(t==="internal_accessibility"){e.internal_accessibility=i;return}e.attributes[t]=i},"setAttribute"),Et=y((e,t)=>{e.style=t??{}},"setStyle"),$t=y(e=>{const t={nodeName:"#text",nodeValue:e,parentNode:void 0,style:{},yogaNode:void 0};return gt(t,e),t},"createTextNode"),mt=y(function(e,t){const i=e.nodeName==="#text"?e.nodeValue:pe(e),s=V(i);if(s.width<=t||s.width>=1&&t>0&&t<1)return s;const o=e.style?.textWrap??"wrap",n=ht(i,Math.floor(t),o);return V(n)},"measureTextNode"),de=y(e=>{if(e?.parentNode)return e.yogaNode??de(e.parentNode)},"findClosestYogaNode"),ue=y(e=>{(e?.nodeName==="#text"||e?.nodeName==="ink-text"||e?.nodeName==="ink-virtual-text")&&de(e)?.markDirty();let t=e;for(;t;){if((t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&(t.internal_textCache=void 0),"childNodes"in t){if(t!==e&&t.nodeName==="ink-static-render"&&t.cachedRender)break;t.cachedRender=void 0}t=t.parentNode}},"markNodeAsDirty"),gt=y((e,t)=>{typeof t!="string"&&(t=String(t)),e.nodeValue=t,ue(e)},"setTextNodeValue"),Wt=y((e,t)=>e.nodeName!=="ink-root"?()=>{}:(e.internal_layoutListeners??=new Set,e.internal_layoutListeners.add(t),()=>{e.internal_layoutListeners?.delete(t)}),"addLayoutListener"),Ot=y(e=>{if(!(e.nodeName!=="ink-root"||!e.internal_layoutListeners))for(const t of e.internal_layoutListeners)t()},"emitLayoutListeners"),Rt=y((e,t)=>{if(e.cachedRender=t,e.yogaNode){for(e.yogaNode.setWidth(t.width),e.yogaNode.setHeight(t.height);e.yogaNode.getChildCount()>0;)e.yogaNode.removeChild(e.yogaNode.getChild(0));e.isYogaTreeDetached=!0}},"setCachedRender"),Tt=y(e=>{const t=[];let i=e;for(;i;)t.unshift(i),i=i.parentNode;return t},"getPathToRoot"),Ct=y(e=>{let t=e;for(;t;){const{userSelect:i}=t.style;if(i==="none")return!1;if(i==="text"||i==="all")return!0;t=t.parentNode}return!0},"isNodeSelectable");export{ht as T,Wt as a,St as b,wt as c,kt as d,Ot as e,$t as f,Tt as g,Et as h,Ct as i,At as j,ct as k,Rt as l,ue as m,le as r,gt as s};
@@ -1,8 +1,6 @@
1
1
  import { Node } from 'yoga-layout';
2
- import '@visulima/colorize';
3
- import 'cli-boxes';
4
- import 'type-fest';
5
- import { S as Styles } from "./styles.d-cMo36xQz.js";
2
+ import { C as CursorShape } from "./cursor-helpers.d-BONB9tky.js";
3
+ import { S as Styles } from "./styles.d-CLJdt-kg.js";
6
4
  type StyleSpan = {
7
5
  bgColor?: string;
8
6
  fgColor?: string;
@@ -258,6 +256,7 @@ type CursorAnchorRef = {
258
256
  type CursorMarker = {
259
257
  anchorRef?: CursorAnchorRef;
260
258
  inline?: boolean;
259
+ shape?: CursorShape;
261
260
  x: number;
262
261
  y: number;
263
262
  };
@@ -410,4 +409,4 @@ declare const getPathToRoot: (node: DOMNode) => DOMNode[];
410
409
  * Ported from jacob314/ink fork (Google LLC, Apache-2.0).
411
410
  */
412
411
  declare const isNodeSelectable: (node: DOMElement) => boolean;
413
- export { DOMNode as D, ResizeObserver as R, StyledLine as S, DOMElement 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 };
412
+ 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 };
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var c=(r,e)=>l(r,"name",{value:e,configurable:!0});import{a as n,o as s}from"./constants-D12jy2Zh-RSfxu1eM.js";var g=Object.defineProperty,u=c((r,e)=>g(r,"name",{value:e,configurable:!0}),"t"),S=Object.defineProperty,d=u((r,e)=>S(r,"name",{value:e,configurable:!0}),"t");const b=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,v=/^(?:msys|cygwin)$/,H=!b&&(process.platform==="win32"||v.test(process.env.OSTYPE));var B=Object.defineProperty,t=d((r,e)=>B(r,"name",{value:e,configurable:!0}),"n");const U=`${n}6n`,f=t((r=1)=>`${n}${String(r)}D`,"cursorBackward"),C=t((r=1)=>`${n}${String(r)}B`,"cursorDown");t((r=1)=>`${n}${String(r)}C`,"cursorForward");const F=`${n}?25l`,y=`${n}G`;t((r=1)=>f(r),"cursorLeft");const T=t((r=1)=>`${n}${String(r)}G`,"cursorHorizontalAbsolute");t((r,e)=>{let o="";return r<0?o+=`${n}${String(-r)}D`:r>0&&(o+=`${n}${String(r)}C`),e<0?o+=`${n}${String(-e)}A`:e>0&&(o+=`${n}${String(e)}B`),o},"cursorMove");const z=t((r=1)=>`${n}${String(r)}E`,"cursorNextLine");t((r=1)=>`${n}${String(r)}F`,"cursorPreviousLine");const G=`${n}?25h`,x=t((r,e)=>e===void 0?T(r+1):`${n}${String(e+1)}${s}${String(r+1)}H`,"cursorTo"),I=t((r,e)=>e===void 0?`${n}${String(r)}H`:`${n}${String(r)}${s}${String(e)}H`,"cursorPosition");t((r=1)=>`${n}${String(r)}I`,"cursorHorizontalForwardTab");t((r=1)=>`${n}${String(r)}Z`,"cursorBackwardTab");t((r=1)=>`${n}${String(r)}X`,"eraseCharacter");t((r=1)=>`${n}${String(r)}d`,"cursorVerticalAbsolute");const p=t((r=1)=>`${n}${String(r)}A`,"cursorUp");var k=(r=>(r[r.Default=0]="Default",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.SteadyBlock=2]="SteadyBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.SteadyUnderline=4]="SteadyUnderline",r[r.BlinkingBar=5]="BlinkingBar",r[r.SteadyBar=6]="SteadyBar",r))(k||{});const N=t(r=>`${n}${String(r)} q`,"setCursorStyle");var E=Object.defineProperty,m=c((r,e)=>E(r,"name",{value:e,configurable:!0}),"o"),w=Object.defineProperty,P=m((r,e)=>w(r,"name",{value:e,configurable:!0}),"s"),j=Object.defineProperty,$=P((r,e)=>j(r,"name",{value:e,configurable:!0}),"o"),L=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireScreen=2]="EntireScreen",r[r.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",r))(L||{});const i=$(r=>{const e=r>=0&&r<=3?r:0;return`${n}${e===0?"":String(e)}J`},"eraseDisplay");var O=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireLine=2]="EntireLine",r))(O||{});const a=$(r=>{const e=r>=0&&r<=2?r:0;return`${n}${e===0?"":String(e)}K`},"eraseInLine");i(0);const h=a(2),V=a(0);a(1);const q=$(r=>{if(r<=0)return"";let e="";for(let o=0;o<r;o+=1)e+=h,o<r-1&&(e+=p());return e+=y,e},"eraseLines");i(2);i(1);i(3);export{h as E,x as F,I as G,y as H,p as N,F as P,U as T,N as V,a,H as b,L as c,q as d,z as e,V as f,C as h,O as l,i as r,G as z};
@@ -0,0 +1 @@
1
+ var X=Object.defineProperty;var h=(e,i)=>X(e,"name",{value:i,configurable:!0});var e1=Object.defineProperty,C=h((e,i)=>e1(e,"name",{value:i,configurable:!0}),"u$1"),i1=Object.defineProperty,y=C((e,i)=>i1(e,"name",{value:i,configurable:!0}),"l");const r1=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],t1=12288,n1=65510,a1=[12288,12288,65281,65376,65504,65510],u1=8361,l1=65518,o1=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],d1=32,s1=10630,c1=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],h1=4352,f1=262141,q=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var w1=Object.defineProperty,b1=y((e,i)=>w1(e,"name",{value:i,configurable:!0}),"r$1");const p=b1((e,i)=>{let r=0,a=Math.floor(e.length/2)-1;for(;r<=a;){const u=Math.floor((r+a)/2),l=u*2;if(i<e[l])a=u-1;else if(i>e[l+1])r=u+1;else return!0}return!1},"isInRange");var g1=Object.defineProperty,b=y((e,i)=>g1(e,"name",{value:i,configurable:!0}),"r");const _=19968,[m1,p1]=E(q);function E(e){let i=e[0],r=e[1];for(let a=0;a<e.length;a+=2){const u=e[a],l=e[a+1];if(_>=u&&_<=l)return[u,l];l-u>r-i&&(i=u,r=l)}return[i,r]}h(E,"c$1");C(E,"f");y(E,"k");b(E,"findWideFastPathRange");const D=b(e=>e<161||e>1114109?!1:p(r1,e),"isAmbiguous"),G=b(e=>e<t1||e>n1?!1:p(a1,e),"isFullWidth"),$1=b(e=>e<u1||e>l1?!1:p(o1,e),"isHalfWidth"),W1=b(e=>e<d1||e>s1?!1:p(c1,e),"isNarrow"),Z=b(e=>e>=m1&&e<=p1?!0:e<h1||e>f1?!1:p(q,e),"isWide");function O(e){return D(e)?"ambiguous":G(e)?"fullwidth":$1(e)?"halfwidth":W1(e)?"narrow":Z(e)?"wide":"neutral"}h(O,"g$3");C(O,"S");y(O,"getCategory");b(O,"getCategory");var v1=Object.defineProperty,P=h((e,i)=>v1(e,"name",{value:i,configurable:!0}),"i$2"),I1=Object.defineProperty,k=P((e,i)=>I1(e,"name",{value:i,configurable:!0}),"a"),x1=Object.defineProperty,S=k((e,i)=>x1(e,"name",{value:i,configurable:!0}),"e");function $(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}h($,"s$1");P($,"s");k($,"r");S($,"validate");function W(e){return $(e),O(e)}h(W,"r$2");P(W,"p");k(W,"eastAsianWidthType");S(W,"eastAsianWidthType");function T(e,{ambiguousAsWide:i=!1}={}){return $(e),G(e)||Z(e)||i&&D(e)?2:1}h(T,"o$2");P(T,"W");k(T,"eastAsianWidth");S(T,"eastAsianWidth");var j1=Object.defineProperty,y1=h((e,i)=>j1(e,"name",{value:i,configurable:!0}),"p$1"),E1=Object.defineProperty,J=y1((e,i)=>E1(e,"name",{value:i,configurable:!0}),"e"),O1=Object.defineProperty,P1=J((e,i)=>O1(e,"name",{value:i,configurable:!0}),"E");const K=String.raw,H=K`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,k1=P1(()=>new RegExp(K`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${H}(?:\u200D${H})*`,"gu"),"default");var F1=Object.defineProperty,B1=J((e,i)=>F1(e,"name",{value:i,configurable:!0}),"p");const K1=new Set(["\x1B","›"]),M1="\x07",N1="[",L1="m",A1="]8;;",Q1=39,U1=/[\u200B\uFEFF\u2060-\u2064]/g,X1=new RegExp(`(?:\\${N1}(?<code>\\d+)m|\\${A1}(?<uri>.*)${M1})`),e2=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),m=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,i2=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,r2=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,v=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,x=k1();B1(e=>e.replace(x,""),"stripEmoji");var C1=Object.defineProperty,S1=h((e,i)=>C1(e,"name",{value:i,configurable:!0}),"E"),T1=Object.defineProperty,R1=S1((e,i)=>T1(e,"name",{value:i,configurable:!0}),"A"),z1=Object.defineProperty,F=R1((e,i)=>z1(e,"name",{value:i,configurable:!0}),"d");const Y=new Map,I=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,j=F(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),V1=F((e,i)=>{const r=Math.floor(e/65536),a=e%65536;let u=Y.get(r);if(u||(u=new Map,Y.set(r,u)),u.has(a))return u.get(a);let l;if(j(e)==="latin")l=i.width.regular;else if(j(e)==="control")l=i.width.control;else if(j(e)==="wide")l=i.width.wide;else switch(W(e)){case"ambiguous":{l=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{l=i.width.fullWidth;break}case"wide":{l=i.width.wide;break}default:l=i.width.regular}return u.set(a,l),l},"getCachedCharWidth"),_1=F(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),A=F((e,i={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:i.countAnsiEscapeCodes??!1,ellipsis:i.ellipsis??"",ellipsisWidth:i.ellipsisWidth??(i.ellipsis?A(i.ellipsis,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:i.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:i.ambiguousIsNarrow??!1,ansi:i.ansiWidth??0,control:i.controlWidth??0,emoji:i.emojiWidth??2,fullWidth:i.fullWidth??2,halfWidth:i.halfWidth??1,regular:i.regularWidth??1,tab:i.tabWidth??8,wide:i.wideWidth??2}},a=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:u}=e,l=u>1e4;let t=0,n=0,o=u,d=!1;const L=e.includes("\x1B")||e.includes("›");for(;t<u;){if(L&&(e[t]==="\x1B"||e[t]==="›")){if(e.startsWith("\x1B]8;;",t)){const c="\x1B]8;;\x07",w=c.length,B=e.indexOf("\x07",t+5);if(B!==-1){const M=e.indexOf(c,B+1);if(M!==-1){const Q=M+w,U=e.slice(B+1,M).replace(m,""),V=A(U,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,a-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),N=V.width;if(V.truncated)d=!0,o=Math.min(o,t);else if(n+N>a&&(o=Math.min(o,t),d=!0,n+N>r.truncation.limit))break;if(n+=N,t=Q,d&&n>=r.truncation.limit)break;continue}}}if(m.lastIndex=t,m.test(e)){const c=m.lastIndex-t,w=r.truncation.countAnsiEscapeCodes?c:r.width.ansi;if(n+w>a&&(o=Math.min(o,t),n+w>r.truncation.limit)){d=!0;break}n+=w,t=m.lastIndex;continue}}const f=e.codePointAt(t);if(f===8203||f===65279||f>=8288&&f<=8292){t+=1;continue}if(f===9){if(n+r.width.tab>a&&(o=Math.min(o,t),n+r.width.tab>r.truncation.limit)){d=!0;break}n+=r.width.tab,t+=1;continue}if(I.lastIndex=t,I.test(e)){const c=(I.lastIndex-t)*r.width.regular;if(n+c>a){const w=Math.floor((a-n)/r.width.regular);if(o=Math.min(o,t+w),n+c>r.truncation.limit){d=!0;break}}n+=c,t=I.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(v.lastIndex=t,v.test(e))){const c=(v.lastIndex-t)*r.width.control;if(n+c>a&&(o=Math.min(o,t+Math.floor((a-n)/r.width.control)),n+c>r.truncation.limit)){d=!0;break}n+=c,t=v.lastIndex;continue}if(x.lastIndex=t,x.test(e)){if(n+r.width.emoji>a&&(o=Math.min(o,t),n+r.width.emoji>r.truncation.limit)){d=!0;break}n+=r.width.emoji,t=x.lastIndex;continue}const g=e.codePointAt(t)??0;if(_1(g)){t+=g>65535?2:1;continue}let s;if(l)s=V1(g,r);else switch(j(g)){case"control":{s=r.width.control;break}case"latin":{s=r.width.regular;break}case"wide":{s=r.width.wide;break}case"zero":{s=0;break}default:switch(W(g)){case"ambiguous":{s=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{s=r.width.fullWidth;break}case"wide":{s=r.width.wide;break}default:s=r.width.regular}}if(n+s>a&&(o=Math.min(o,t),n+s>r.truncation.limit)){d=!0;break}n+=s,t+=g>65535?2:1}let R=n,z=!1;return d&&r.truncation.limit>=r.truncation.ellipsisWidth&&(R=r.truncation.limit,z=!0),{ellipsed:z,index:d?o:u,truncated:d,width:R}},"getStringTruncatedWidth");var H1=Object.defineProperty,Y1=h((e,i)=>H1(e,"name",{value:i,configurable:!0}),"i"),q1=Object.defineProperty,D1=Y1((e,i)=>q1(e,"name",{value:i,configurable:!0}),"e"),G1=Object.defineProperty,Z1=D1((e,i)=>G1(e,"name",{value:i,configurable:!0}),"r");const t2=Z1((e,i={})=>A(e,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");export{X1 as F,r2 as G,A as N,Q1 as a,e2 as b,Z as c,L1 as d,m as h,M1 as i,i2 as k,K1 as l,U1 as m,t2 as o,A1 as s,N1 as t,G as v};
@@ -1 +1 @@
1
- import"yoga-layout";import"./measure-text-DDjHT1jD.js";import"./squashTextNodesWithMap-DCdi3SZ2.js";import{a as r,d,c as i,f as m,e as N,g as l,b as p,i as c,m as h,r as n,j as u,k as y,h as L,s as b}from"./dom-BG-LS10p.js";export{r as addLayoutListener,d as appendChildNode,i as createNode,m as createTextNode,N as emitLayoutListeners,l as getPathToRoot,p as insertBeforeNode,c as isNodeSelectable,h as markNodeAsDirty,n as removeChildNode,u as setAttribute,y as setCachedRender,L as setStyle,b as setTextNodeValue};
1
+ import"yoga-layout";import"./measure-text-D-jVetsl.js";import"./squashTextNodesWithMap-DCdi3SZ2.js";import{a as r,d,c as i,f as m,e as N,g as l,b as p,i as c,m as h,r as n,j as u,l as y,h as L,s as b}from"./dom-CW6KYzFK.js";export{r as addLayoutListener,d as appendChildNode,i as createNode,m as createTextNode,N as emitLayoutListeners,l as getPathToRoot,p as insertBeforeNode,c as isNodeSelectable,h as markNodeAsDirty,n as removeChildNode,u as setAttribute,y as setCachedRender,L as setStyle,b as setTextNodeValue};
@@ -0,0 +1,9 @@
1
+ var V=Object.defineProperty;var i=(t,q)=>V(t,"name",{value:q,configurable:!0});import"./_commonjsHelpers-CHNfUHCT.js";var M={},O;function X(){return O||(O=1,(function(t){var q=Object.defineProperty,o=i((e,n)=>q(e,"name",{value:n,configurable:!0}),"l");/**
2
+ * @license React
3
+ * scheduler.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */function w(e,n){var r=e.length;e.push(n);e:for(;0<r;){var l=r-1>>>1,a=e[l];if(0<k(a,n))e[l]=n,e[r]=a,r=l;else break e}}i(w,"push"),o(w,"push");function c(e){return e.length===0?null:e[0]}i(c,"peek"),o(c,"peek");function h(e){if(e.length===0)return null;var n=e[0],r=e.pop();if(r!==n){e[0]=r;e:for(var l=0,a=e.length,C=a>>>1;l<C;){var S=2*(l+1)-1,L=e[S],m=S+1,W=e[m];if(0>k(L,r))m<a&&0>k(W,L)?(e[l]=W,e[m]=r,l=m):(e[l]=L,e[S]=r,l=S);else if(m<a&&0>k(W,r))e[l]=W,e[m]=r,l=m;else break e}}return n}i(h,"pop"),o(h,"pop");function k(e,n){var r=e.sortIndex-n.sortIndex;return r!==0?r:e.id-n.id}if(i(k,"compare"),o(k,"compare"),t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var A=performance;t.unstable_now=function(){return A.now()}}else{var j=Date,G=j.now();t.unstable_now=function(){return j.now()-G}}var f=[],d=[],J=1,s=null,u=3,D=!1,y=!1,p=!1,U=!1,Y=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function T(e){for(var n=c(d);n!==null;){if(n.callback===null)h(d);else if(n.startTime<=e)h(d),n.sortIndex=n.expirationTime,w(f,n);else break;n=c(d)}}i(T,"advanceTimers"),o(T,"advanceTimers");function g(e){if(p=!1,T(e),!y)if(c(f)!==null)y=!0,b||(b=!0,v());else{var n=c(d);n!==null&&I(g,n.startTime-e)}}i(g,"handleTimeout"),o(g,"handleTimeout");var b=!1,_=-1,B=5,E=-1;function H(){return U?!0:!(t.unstable_now()-E<B)}i(H,"shouldYieldToHost"),o(H,"shouldYieldToHost");function P(){if(U=!1,b){var e=t.unstable_now();E=e;var n=!0;try{e:{y=!1,p&&(p=!1,F(_),_=-1),D=!0;var r=u;try{n:{for(T(e),s=c(f);s!==null&&!(s.expirationTime>e&&H());){var l=s.callback;if(typeof l=="function"){s.callback=null,u=s.priorityLevel;var a=l(s.expirationTime<=e);if(e=t.unstable_now(),typeof a=="function"){s.callback=a,T(e),n=!0;break n}s===c(f)&&h(f),T(e)}else h(f);s=c(f)}if(s!==null)n=!0;else{var C=c(d);C!==null&&I(g,C.startTime-e),n=!1}}break e}finally{s=null,u=r,D=!1}n=void 0}}finally{n?v():b=!1}}}i(P,"performWorkUntilDeadline"),o(P,"performWorkUntilDeadline");var v;if(typeof Q=="function")v=o(function(){Q(P)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var N=new MessageChannel,K=N.port2;N.port1.onmessage=P,v=o(function(){K.postMessage(null)},"schedulePerformWorkUntilDeadline")}else v=o(function(){Y(P,0)},"schedulePerformWorkUntilDeadline");function I(e,n){_=Y(function(){e(t.unstable_now())},n)}i(I,"requestHostTimeout"),o(I,"requestHostTimeout"),t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return u},t.unstable_next=function(e){switch(u){case 1:case 2:case 3:var n=3;break;default:n=u}var r=u;u=n;try{return e()}finally{u=r}},t.unstable_requestPaint=function(){U=!0},t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=u;u=e;try{return n()}finally{u=r}},t.unstable_scheduleCallback=function(e,n,r){var l=t.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?l+r:l):r=l,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return a=r+a,e={id:J++,callback:n,priorityLevel:e,startTime:r,expirationTime:a,sortIndex:-1},r>l?(e.sortIndex=r,w(d,e),c(f)===null&&e===c(d)&&(p?(F(_),_=-1):p=!0,I(g,r-l))):(e.sortIndex=a,w(f,e),y||D||(y=!0,b||(b=!0,v()))),e},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(e){var n=u;return function(){var r=u;u=n;try{return e.apply(this,arguments)}finally{u=r}}}})(M)),M}i(X,"requireScheduler_production");var R,z;function Z(){return z||(z=1,R=X()),R}i(Z,"requireScheduler");var ee=Z();export{ee as s};
@@ -0,0 +1,75 @@
1
+ var M=Object.defineProperty;var o=(p,r)=>M(p,"name",{value:r,configurable:!0});import"./_commonjsHelpers-CHNfUHCT.js";var lib={},types={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,Object.defineProperty(types,"__esModule",{value:!0})),types}o(requireTypes,"requireTypes");var ee={},taskCollection$1={},taskCollection={},utils$1={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;var p=Object.defineProperty,r=o((u,f)=>p(u,"name",{value:f,configurable:!0}),"s");Object.defineProperty(utils$1,"__esModule",{value:!0}),utils$1._fast_remove_single=void 0;function d(u,f){f!==-1&&(f===0?u.shift():f===u.length-1?u.length=u.length-1:u.splice(f,1))}return o(d,"_fast_remove_single"),r(d,"_fast_remove_single"),utils$1._fast_remove_single=d,utils$1}o(requireUtils$1,"requireUtils$1");var bakeCollection={},hasRequiredBakeCollection;function requireBakeCollection(){return hasRequiredBakeCollection||(hasRequiredBakeCollection=1,(function(exports$1){var i=Object.defineProperty,t=o((p,r)=>i(p,"name",{value:r,configurable:!0}),"t");Object.defineProperty(exports$1,"__esModule",{value:!0}),exports$1.bakeCollectionVariadic=exports$1.bakeCollectionAwait=exports$1.bakeCollection=exports$1.BAKED_EMPTY_FUNC=void 0,exports$1.BAKED_EMPTY_FUNC=(function(){});var FORLOOP_FALLBACK=1500;function generateArgsDefCode(p){var r="";if(p===0)return r;for(var d=0;d<p-1;++d)r+="arg"+String(d)+", ";return r+="arg"+String(p-1),r}o(generateArgsDefCode,"generateArgsDefCode"),t(generateArgsDefCode,"generateArgsDefCode");function generateBodyPartsCode(p,r){for(var d="",u="",f=0;f<r;++f)d+="var f".concat(f," = collection[").concat(f,`];
2
+ `),u+="f".concat(f,"(").concat(p,`)
3
+ `);return{funcDefCode:d,funcCallCode:u}}o(generateBodyPartsCode,"generateBodyPartsCode"),t(generateBodyPartsCode,"generateBodyPartsCode");function generateBodyPartsVariadicCode(p){for(var r="",d="",u=0;u<p;++u)r+="var f".concat(u," = collection[").concat(u,`];
4
+ `),d+="f".concat(u,`.apply(undefined, arguments)
5
+ `);return{funcDefCode:r,funcCallCode:d}}o(generateBodyPartsVariadicCode,"generateBodyPartsVariadicCode"),t(generateBodyPartsVariadicCode,"generateBodyPartsVariadicCode");function bakeCollection(collection,fixedArgsNum){if(collection.length===0)return exports$1.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)}}o(bakeCollection,"bakeCollection"),t(bakeCollection,"bakeCollection"),exports$1.bakeCollection=bakeCollection;function bakeCollectionAwait(collection,fixedArgsNum){if(collection.length===0)return exports$1.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)}}o(bakeCollectionAwait,"bakeCollectionAwait"),t(bakeCollectionAwait,"bakeCollectionAwait"),exports$1.bakeCollectionAwait=bakeCollectionAwait;function bakeCollectionVariadic(collection){if(collection.length===0)return exports$1.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)}}o(bakeCollectionVariadic,"bakeCollectionVariadic"),t(bakeCollectionVariadic,"bakeCollectionVariadic"),exports$1.bakeCollectionVariadic=bakeCollectionVariadic})(bakeCollection)),bakeCollection}o(requireBakeCollection,"requireBakeCollection");var hasRequiredTaskCollection$1;function requireTaskCollection$1(){if(hasRequiredTaskCollection$1)return taskCollection;hasRequiredTaskCollection$1=1;var p=Object.defineProperty,r=o((a,b)=>p(a,"name",{value:b,configurable:!0}),"l"),d=taskCollection&&taskCollection.__spreadArray||function(a,b,e){if(e||arguments.length===2)for(var n=0,s=b.length,l;n<s;n++)(l||!(n in b))&&(l||(l=Array.prototype.slice.call(b,0,n)),l[n]=b[n]);return a.concat(l||Array.prototype.slice.call(b))};Object.defineProperty(taskCollection,"__esModule",{value:!0}),taskCollection.TaskCollection=void 0;var u=requireUtils$1(),f=requireBakeCollection();function _(a,b){var e=this.length;if(e>1)if(b){var n;(n=this._tasks).push.apply(n,arguments),this.length+=arguments.length}else this._tasks.push(a),this.length++;else if(b){if(e===1){var s=Array(1+arguments.length);s.push(s),s.push.apply(s,arguments),this._tasks=s}else{var s=Array(arguments.length);s.push.apply(s,arguments),this._tasks=s}this.length+=arguments.length}else e===1?this._tasks=[this._tasks,a]:this._tasks=a,this.length++}o(_,"push_norebuild"),r(_,"push_norebuild");function h(a,b){var e=this.length;if(e>1)if(b){var n;(n=this._tasks).push.apply(n,arguments),this.length+=arguments.length}else this._tasks.push(a),this.length++;else if(b){if(e===1){var s=Array(1+arguments.length);s.push(s),s.push.apply(s,arguments),this._tasks=s}else{var s=Array(arguments.length);s.push.apply(s,arguments),this._tasks=s}this.length+=arguments.length}else e===1?this._tasks=[this._tasks,a]:this._tasks=a,this.length++;this.firstEmitBuildStrategy?this.call=L:this.rebuild()}o(h,"push_rebuild"),r(h,"push_rebuild");function g(a){this.length!==0&&(this.length===1?this._tasks===a&&(this.length=0):((0,u._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(a)),this._tasks.length===1?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length))}o(g,"removeLast_norebuild"),r(g,"removeLast_norebuild");function c(a){if(this.length!==0){if(this.length===1)if(this._tasks===a&&(this.length=0),this.firstEmitBuildStrategy){this.call=f.BAKED_EMPTY_FUNC;return}else{this.rebuild();return}else(0,u._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(a)),this._tasks.length===1?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length;this.firstEmitBuildStrategy?this.call=L:this.rebuild()}}o(c,"removeLast_rebuild"),r(c,"removeLast_rebuild");function C(a){for(var b,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.length===0?(this._tasks=e,this.length=1):this.length===1?(e.unshift(this._tasks),this._tasks=e,this.length=this._tasks.length):((b=this._tasks).splice.apply(b,d([a,0],e,!1)),this.length=this._tasks.length)}o(C,"insert_norebuild"),r(C,"insert_norebuild");function P(a){for(var b,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.length===0?(this._tasks=e,this.length=1):this.length===1?(e.unshift(this._tasks),this._tasks=e,this.length=this._tasks.length):((b=this._tasks).splice.apply(b,d([a,0],e,!1)),this.length=this._tasks.length),this.firstEmitBuildStrategy?this.call=L:this.rebuild()}o(P,"insert_rebuild"),r(P,"insert_rebuild");function B(){this.length===0?this.call=f.BAKED_EMPTY_FUNC:this.length===1?this.call=this._tasks:this.call=(0,f.bakeCollection)(this._tasks,this.argsNum)}o(B,"rebuild_noawait"),r(B,"rebuild_noawait");function F(){this.length===0?this.call=f.BAKED_EMPTY_FUNC:this.length===1?this.call=this._tasks:this.call=(0,f.bakeCollectionAwait)(this._tasks,this.argsNum)}o(F,"rebuild_await"),r(F,"rebuild_await");function L(){this.rebuild(),this.call.apply(void 0,arguments)}o(L,"rebuild_on_first_call"),r(L,"rebuild_on_first_call");var E=(function(){function a(b,e,n,s){e===void 0&&(e=!0),n===void 0&&(n=null),s===void 0&&(s=!1),this.awaitTasks=s,this.call=f.BAKED_EMPTY_FUNC,this.argsNum=b,this.firstEmitBuildStrategy=!0,s?this.rebuild=F.bind(this):this.rebuild=B.bind(this),this.setAutoRebuild(e),n?typeof n=="function"?(this._tasks=n,this.length=1):(this._tasks=n,this.length=n.length):(this._tasks=null,this.length=0),e&&this.rebuild()}return o(a,"t"),r(a,"TaskCollection"),a})();taskCollection.TaskCollection=E;function x(){this._tasks=null,this.length=0,this.call=f.BAKED_EMPTY_FUNC}o(x,"fastClear"),r(x,"fastClear");function T(){this._tasks=null,this.length=0,this.call=f.BAKED_EMPTY_FUNC}o(T,"clear"),r(T,"clear");function q(a){this.argsNum<a&&(this.argsNum=a,this.firstEmitBuildStrategy?this.call=L:this.rebuild())}o(q,"growArgsNum"),r(q,"growArgsNum");function w(a){a?(this.push=h.bind(this),this.insert=P.bind(this),this.removeLast=c.bind(this)):(this.push=_.bind(this),this.insert=C.bind(this),this.removeLast=g.bind(this))}o(w,"setAutoRebuild"),r(w,"setAutoRebuild");function D(){return this.length===0?[]:this.length===1?[this._tasks]:this._tasks}o(D,"tasksAsArray"),r(D,"tasksAsArray");function j(a){a.length===0?(this.length=0,this.call=f.BAKED_EMPTY_FUNC):a.length===1?(this.length=1,this.call=a[0],this._tasks=a[0]):(this.length=a.length,this._tasks=a,this.firstEmitBuildStrategy?this.call=L:this.rebuild())}return o(j,"setTasks"),r(j,"setTasks"),E.prototype.fastClear=x,E.prototype.clear=T,E.prototype.growArgsNum=q,E.prototype.setAutoRebuild=w,E.prototype.tasksAsArray=D,E.prototype.setTasks=j,taskCollection}o(requireTaskCollection$1,"requireTaskCollection$1");var hasRequiredTaskCollection;function requireTaskCollection(){return hasRequiredTaskCollection||(hasRequiredTaskCollection=1,(function(p){var r=Object.defineProperty,d=o((_,h)=>r(_,"name",{value:h,configurable:!0}),"o"),u=taskCollection$1&&taskCollection$1.__createBinding||(Object.create?(function(_,h,g,c){c===void 0&&(c=g);var C=Object.getOwnPropertyDescriptor(h,g);(!C||("get"in C?!h.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:d(function(){return h[g]},"get")}),Object.defineProperty(_,c,C)}):(function(_,h,g,c){c===void 0&&(c=g),_[c]=h[g]})),f=taskCollection$1&&taskCollection$1.__exportStar||function(_,h){for(var g in _)g!=="default"&&!Object.prototype.hasOwnProperty.call(h,g)&&u(h,_,g)};Object.defineProperty(p,"__esModule",{value:!0}),f(requireTaskCollection$1(),p)})(taskCollection$1)),taskCollection$1}o(requireTaskCollection,"requireTaskCollection");var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var p=Object.defineProperty,r=o((u,f)=>p(u,"name",{value:f,configurable:!0}),"r");Object.defineProperty(utils,"__esModule",{value:!0}),utils.nullObj=void 0;function d(){var u={};return u.__proto__=null,u}return o(d,"nullObj"),r(d,"nullObj"),utils.nullObj=d,utils}o(requireUtils,"requireUtils");var hasRequiredEe;function requireEe(){if(hasRequiredEe)return ee;hasRequiredEe=1;var p=Object.defineProperty,r=o((e,n)=>p(e,"name",{value:n,configurable:!0}),"o"),d=ee&&ee.__spreadArray||function(e,n,s){if(s||arguments.length===2)for(var l=0,y=n.length,A;l<y;l++)(A||!(l in n))&&(A||(A=Array.prototype.slice.call(n,0,l)),A[l]=n[l]);return e.concat(A||Array.prototype.slice.call(n))};Object.defineProperty(ee,"__esModule",{value:!0}),ee.EventEmitter=void 0;var u=requireTaskCollection(),f=requireUtils$1(),_=requireUtils();function h(e,n,s,l,y,A){var k=this.events[e];if(k){if(k.length===0)return!1;if(k.argsNum<6)k.call(n,s,l,y,A);else{for(var m=new Array(k.argsNum),v=0,O=m.length;v<O;++v)m[v]=arguments[v+1];k.call.apply(void 0,m)}return!0}return!1}o(h,"emit"),r(h,"emit");function g(e,n,s,l,y,A){var k=this.events[e],m;if(k!==void 0){if(k.length===0)return!1;if(k.argsNum<6)k.call(n,s,l,y,A);else{m=new Array(k.argsNum);for(var v=0,O=m.length;v<O;++v)m[v]=arguments[v+1];k.call.apply(void 0,m)}}var N=this.onceEvents[e];if(N){if(typeof N=="function")if(this.onceEvents[e]=void 0,arguments.length<6)N(n,s,l,y,A);else{if(m===void 0){m=new Array(arguments.length-1);for(var v=0,O=m.length;v<O;++v)m[v]=arguments[v+1]}N.apply(void 0,m)}else{var $=N;if(this.onceEvents[e]=void 0,arguments.length<6)for(var v=0;v<$.length;++v)$[v](n,s,l,y,A);else{if(m===void 0){m=new Array(arguments.length-1);for(var v=0,O=m.length;v<O;++v)m[v]=arguments[v+1]}for(var v=0;v<$.length;++v)$[v].apply(void 0,m)}}return!0}return k!==void 0}o(g,"emitHasOnce"),r(g,"emitHasOnce");var c=(function(){function e(){this.events=(0,_.nullObj)(),this.onceEvents=(0,_.nullObj)(),this._symbolKeys=new Set,this.maxListeners=1/0}return o(e,"e"),r(e,"EventEmitter"),Object.defineProperty(e.prototype,"_eventsCount",{get:r(function(){return this.eventNames().length},"get"),enumerable:!1,configurable:!0}),e})();ee.EventEmitter=c;function C(e,n){switch(this.emit===h&&(this.emit=g),typeof this.onceEvents[e]){case"undefined":this.onceEvents[e]=n,typeof e=="symbol"&&this._symbolKeys.add(e);break;case"function":this.onceEvents[e]=[this.onceEvents[e],n];break;case"object":this.onceEvents[e].push(n)}return this}o(C,"once"),r(C,"once");function P(e,n,s){if(s===void 0&&(s=n.length),typeof n!="function")throw new TypeError("The listener must be a function");var l=this.events[e];return l?(l.push(n),l.growArgsNum(s),this.maxListeners!==1/0&&this.maxListeners<=l.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))):(this.events[e]=new u.TaskCollection(s,!0,n,!1),typeof e=="symbol"&&this._symbolKeys.add(e)),this}o(P,"addListener"),r(P,"addListener");function B(e,n){var s=this.events[e];s&&s.removeLast(n);var l=this.onceEvents[e];return l&&(typeof l=="function"?this.onceEvents[e]=void 0:typeof l=="object"&&(l.length===1&&l[0]===n?this.onceEvents[e]=void 0:(0,f._fast_remove_single)(l,l.lastIndexOf(n)))),this}o(B,"removeListener"),r(B,"removeListener");function F(e,n,s,l){s===void 0&&(s=this),l===void 0&&(l=n.length),this.boundFuncs||(this.boundFuncs=new Map);var y=n.bind(s);return this.boundFuncs.set(n,y),this.addListener(e,y,l)}o(F,"addListenerBound"),r(F,"addListenerBound");function L(e,n){var s,l,y=(s=this.boundFuncs)===null||s===void 0?void 0:s.get(n);return(l=this.boundFuncs)===null||l===void 0||l.delete(n),this.removeListener(e,y)}o(L,"removeListenerBound"),r(L,"removeListenerBound");function E(e){return this.events[e]&&!!this.events[e].length}o(E,"hasListeners"),r(E,"hasListeners");function x(e,n,s){if(s===void 0&&(s=n.length),typeof n!="function")throw new TypeError("The listener must be a function");var l=this.events[e];return!l||!(l instanceof u.TaskCollection)?(l=this.events[e]=new u.TaskCollection(s,!0,n,!1),typeof e=="symbol"&&this._symbolKeys.add(e)):(l.insert(0,n),l.growArgsNum(s),this.maxListeners!==1/0&&this.maxListeners<=l.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))),this}o(x,"prependListener"),r(x,"prependListener");function T(e,n){this.emit===h&&(this.emit=g);var s=this.onceEvents[e];return s?typeof s!="object"?(this.onceEvents[e]=[n,s],typeof e=="symbol"&&this._symbolKeys.add(e)):(s.unshift(n),this.maxListeners!==1/0&&this.maxListeners<=s.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" once event!'))):(this.onceEvents[e]=[n],typeof e=="symbol"&&this._symbolKeys.add(e)),this}o(T,"prependOnceListener"),r(T,"prependOnceListener");function q(e){return e===void 0?(this.events=(0,_.nullObj)(),this.onceEvents=(0,_.nullObj)(),this._symbolKeys=new Set):(this.events[e]=void 0,this.onceEvents[e]=void 0,typeof e=="symbol"&&this._symbolKeys.delete(e)),this}o(q,"removeAllListeners"),r(q,"removeAllListeners");function w(e){return this.maxListeners=e,this}o(w,"setMaxListeners"),r(w,"setMaxListeners");function D(){return this.maxListeners}o(D,"getMaxListeners"),r(D,"getMaxListeners");function j(e){return this.emit===h?this.events[e]?this.events[e].tasksAsArray().slice():[]:this.events[e]&&this.onceEvents[e]?d(d([],this.events[e].tasksAsArray(),!0),typeof this.onceEvents[e]=="function"?[this.onceEvents[e]]:this.onceEvents[e],!0):this.events[e]?this.events[e].tasksAsArray():this.onceEvents[e]?typeof this.onceEvents[e]=="function"?[this.onceEvents[e]]:this.onceEvents[e]:[]}o(j,"listeners"),r(j,"listeners");function a(){var e=this;if(this.emit===h){var n=Object.keys(this.events);return d(d([],n,!0),Array.from(this._symbolKeys),!0).filter(function(l){return l in e.events&&e.events[l]&&e.events[l].length})}else{var n=Object.keys(this.events).filter(function(y){return e.events[y]&&e.events[y].length}),s=Object.keys(this.onceEvents).filter(function(y){return e.onceEvents[y]&&e.onceEvents[y].length});return d(d(d([],n,!0),s,!0),Array.from(this._symbolKeys).filter(function(y){return y in e.events&&e.events[y]&&e.events[y].length||y in e.onceEvents&&e.onceEvents[y]&&e.onceEvents[y].length}),!0)}}o(a,"eventNames"),r(a,"eventNames");function b(e){return this.emit===h?this.events[e]&&this.events[e].length||0:(this.events[e]&&this.events[e].length||0)+(this.onceEvents[e]&&this.onceEvents[e].length||0)}return o(b,"listenerCount"),r(b,"listenerCount"),c.prototype.emit=h,c.prototype.on=P,c.prototype.once=C,c.prototype.addListener=P,c.prototype.removeListener=B,c.prototype.addListenerBound=F,c.prototype.removeListenerBound=L,c.prototype.hasListeners=E,c.prototype.prependListener=x,c.prototype.prependOnceListener=T,c.prototype.off=B,c.prototype.removeAllListeners=q,c.prototype.setMaxListeners=w,c.prototype.getMaxListeners=D,c.prototype.listeners=j,c.prototype.eventNames=a,c.prototype.listenerCount=b,ee}o(requireEe,"requireEe");var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,(function(p){var r=Object.defineProperty,d=o((_,h)=>r(_,"name",{value:h,configurable:!0}),"o"),u=lib&&lib.__createBinding||(Object.create?(function(_,h,g,c){c===void 0&&(c=g);var C=Object.getOwnPropertyDescriptor(h,g);(!C||("get"in C?!h.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:d(function(){return h[g]},"get")}),Object.defineProperty(_,c,C)}):(function(_,h,g,c){c===void 0&&(c=g),_[c]=h[g]})),f=lib&&lib.__exportStar||function(_,h){for(var g in _)g!=="default"&&!Object.prototype.hasOwnProperty.call(h,g)&&u(h,_,g)};Object.defineProperty(p,"__esModule",{value:!0}),f(requireTypes(),p),f(requireEe(),p)})(lib)),lib}o(requireLib,"requireLib");var libExports=requireLib();export{libExports as l};
@@ -0,0 +1,14 @@
1
+ // TODO: Load the spinner names from the JSON file.
2
+ type SpinnerName$1 = 'dots' | 'dots2' | 'dots3' | 'dots4' | 'dots5' | 'dots6' | 'dots7' | 'dots8' | 'dots9' | 'dots10' | 'dots11' | 'dots12' | 'dots13' | 'dots14' | 'dots8Bit' | 'dotsCircle' | 'sand' | 'line' | 'line2' | 'rollingLine' | 'pipe' | 'simpleDots' | 'simpleDotsScrolling' | 'star' | 'star2' | 'flip' | 'hamburger' | 'growVertical' | 'growHorizontal' | 'balloon' | 'balloon2' | 'noise' | 'bounce' | 'boxBounce' | 'boxBounce2' | 'binary' | 'triangle' | 'arc' | 'circle' | 'squareCorners' | 'circleQuarters' | 'circleHalves' | 'squish' | 'toggle' | 'toggle2' | 'toggle3' | 'toggle4' | 'toggle5' | 'toggle6' | 'toggle7' | 'toggle8' | 'toggle9' | 'toggle10' | 'toggle11' | 'toggle12' | 'toggle13' | 'arrow' | 'arrow2' | 'arrow3' | 'bouncingBar' | 'bouncingBall' | 'smiley' | 'monkey' | 'hearts' | 'clock' | 'earth' | 'material' | 'moon' | 'runner' | 'pong' | 'shark' | 'dqpb' | 'weather' | 'christmas' | 'grenade' | 'point' | 'layer' | 'betaWave' | 'fingerDance' | 'fistBump' | 'soccerHeader' | 'mindblown' | 'speaker' | 'orangePulse' | 'bluePulse' | 'orangeBluePulse' | 'timeTravel' | 'aesthetic' | 'dwarfFortress';
3
+ /**
4
+ * Names of custom spinners from Rattles and unicode-animations.
5
+ */
6
+ type CustomSpinnerName = "breathe" | "cascade" | "checkerboard" | "columns" | "diagSwipe" | "dna" | "doubleArrow" | "fillSweep" | "helix" | "infinity" | "orbit" | "pulse" | "rain" | "scan" | "scanline" | "snake" | "sparkle" | "wave" | "waveRows";
7
+ /**
8
+ * Union of all available spinner names.
9
+ */
10
+ type SpinnerName = SpinnerName$1 | CustomSpinnerName;
11
+ /**
12
+ * Represents a single frame-based spinner animation.
13
+ */
14
+ export { SpinnerName as S };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Base ANSI Colors
3
+ */
4
+ type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright";
5
+ export { AnsiColors as A };
@@ -0,0 +1,172 @@
1
+ type Listener = (...args: any[]) => Promise<any> | void;
2
+ type DefaultEventMap = { [event in (string | symbol)]: Listener } & {
3
+ /**
4
+ * __proto__ key not allowed due to implementation
5
+ * add prefix, if you want to use this keyword
6
+ */
7
+ __proto__?: never;
8
+ };
9
+ interface IEventEmitter<EventMap extends DefaultEventMap = DefaultEventMap> {
10
+ emit<EventKey extends keyof EventMap>(event: EventKey, ...args: Parameters<EventMap[EventKey]>): boolean;
11
+ on<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
12
+ once<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
13
+ addListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
14
+ removeListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
15
+ prependListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
16
+ prependOnceListener<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
17
+ off<EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]): this;
18
+ removeAllListeners<EventKey extends keyof EventMap = string>(event?: EventKey): this;
19
+ setMaxListeners(n: number): this;
20
+ getMaxListeners(): number;
21
+ listeners<EventKey extends keyof EventMap = string>(event: EventKey): EventMap[EventKey][];
22
+ rawListeners<EventKey extends keyof EventMap = string>(event: EventKey): EventMap[EventKey][];
23
+ eventNames(): Array<string | symbol>;
24
+ listenerCount<EventKey extends keyof EventMap = string>(type: EventKey): number;
25
+ }
26
+ type ArgsNum<T extends (...args: any[]) => any> = T extends ((...args: infer K) => any) ? K["length"] : never;
27
+ declare class TaskCollection<Func extends (...args: any) => void, AwaitTasks extends true | false = false> {
28
+ readonly awaitTasks: AwaitTasks;
29
+ constructor(argsNum: ArgsNum<Func>, autoRebuild?: boolean, initialTasks?: (Func[]) | Func | null, awaitTasks?: AwaitTasks);
30
+ /** DO NOT CHANGE DIRECTLY */
31
+ _tasks: (Func[]) | Func | null;
32
+ /** cached */
33
+ length: number;
34
+ /** auto rebuild on first emit call; otherwise autorebuild on every change */
35
+ firstEmitBuildStrategy: boolean;
36
+ readonly argsNum: ArgsNum<Func>;
37
+ autoRebuild: boolean;
38
+ readonly growArgsNum: typeof growArgsNum;
39
+ setAutoRebuild: typeof setAutoRebuild;
40
+ call: (...args: Parameters<Func>) => (AwaitTasks extends true ? Promise<void> : void);
41
+ rebuild: () => void;
42
+ push: (...func: Func[]) => void;
43
+ /** remove last matched task from tasks */
44
+ removeLast: (func: Func) => void;
45
+ insert: (index: number, ...func: Func[]) => void;
46
+ setTasks: (tasks: Func[]) => void;
47
+ tasksAsArray: () => Func[];
48
+ /** this autorebuilds */
49
+ readonly clear: typeof clear;
50
+ /** this autorebuilds */
51
+ readonly fastClear: typeof fastClear;
52
+ }
53
+ declare function fastClear<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>): void;
54
+ declare function clear<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>): void;
55
+ declare function growArgsNum<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>, argsNum: number): void;
56
+ declare function setAutoRebuild<Func extends (...args: any) => void, AwaitTasks extends true | false = false>(this: TaskCollection<Func, AwaitTasks>, newVal: boolean): void;
57
+ /** Implemented event emitter */
58
+ declare class EventEmitter<EventMap extends DefaultEventMap = DefaultEventMap> implements IEventEmitter<EventMap> {
59
+ events: { [eventName in keyof EventMap]?: TaskCollection<EventMap[eventName]> };
60
+ onceEvents: { [eventName in keyof EventMap]?: (EventMap[eventName][]) | EventMap[eventName] };
61
+ boundFuncs: undefined | Map<Function, Function>;
62
+ _symbolKeys: Set<symbol>;
63
+ maxListeners: number;
64
+ get _eventsCount(): number;
65
+ emit: <EventKey extends keyof EventMap>(event: EventKey, ...args: Parameters<EventMap[EventKey]>) => boolean;
66
+ on: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
67
+ once: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
68
+ addListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey], argsNum?: ArgsNum<EventMap[EventKey]>) => this;
69
+ removeListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
70
+ hasListeners: <EventKey extends keyof EventMap = string>(event: EventKey) => boolean;
71
+ prependListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
72
+ prependOnceListener: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
73
+ off: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
74
+ removeAllListeners: <EventKey extends keyof EventMap = string>(event?: EventKey) => this;
75
+ setMaxListeners: (n: number) => this;
76
+ getMaxListeners: () => number;
77
+ listeners: <EventKey extends keyof EventMap = string>(event: EventKey) => EventMap[EventKey][];
78
+ rawListeners: <EventKey extends keyof EventMap = string>(event: EventKey) => EventMap[EventKey][];
79
+ eventNames: () => Array<string | symbol>;
80
+ listenerCount: <EventKey extends keyof EventMap = string>(type: EventKey) => number;
81
+ addListenerBound: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey], bindTo?: any, argsNum?: ArgsNum<EventMap[EventKey]>) => this;
82
+ removeListenerBound: <EventKey extends keyof EventMap = string>(event: EventKey, listener: EventMap[EventKey]) => this;
83
+ }
84
+ declare class TuiApp extends EventEmitter {
85
+ private renderer;
86
+ private terminal;
87
+ private backBuffer;
88
+ private width;
89
+ private height;
90
+ private isRunning;
91
+ private stdoutBuffer;
92
+ private stderrBuffer;
93
+ constructor();
94
+ /** Enters raw mode + alternate screen. Does NOT start any render loop. */
95
+ start(): void;
96
+ /** Request a clean exit — restores terminal, stops input, exits the process. */
97
+ quit(): void;
98
+ /** Exits raw mode + alternate screen, then flushes any buffered stdout/stderr. */
99
+ stop(): void;
100
+ /**
101
+ * Buffer a write to stdout. While the alternate screen is active, writing
102
+ * directly would corrupt the TUI. Buffered output is flushed on stop().
103
+ */
104
+ writeStdout(text: string): void;
105
+ /**
106
+ * Buffer a write to stderr. While the alternate screen is active, writing
107
+ * directly would corrupt the TUI. Buffered output is flushed on stop().
108
+ */
109
+ writeStderr(text: string): void;
110
+ /** Returns the shared Uint32Array back-buffer (width * height * 2 u32 cells). */
111
+ getBuffer(): Uint32Array;
112
+ /** Returns current terminal dimensions. */
113
+ getSize(): {
114
+ height: number;
115
+ width: number;
116
+ };
117
+ /** Update terminal dimensions (called on SIGWINCH). */
118
+ resize(width: number, height: number): void;
119
+ /**
120
+ * Callbacks fired on every frame after React paints the buffer but before
121
+ * the Rust diff engine flushes to stdout. Use for direct buffer painting
122
+ * that needs to overlay React output (animated graphs, overlays, FPS counters).
123
+ * Multiple listeners are supported — they fire in registration order.
124
+ */
125
+ private beforeFlushListeners;
126
+ onBeforeFlush(function_: (buffer: Uint32Array, width: number, height: number) => void): () => void;
127
+ /**
128
+ * Layout + paint synchronously. Called from the render loop on every dirty frame,
129
+ * and directly on resize for immediate response.
130
+ */
131
+ paintNow(calculateLayout: (w: number, h: number) => void, renderToBuffer: (buf: Uint32Array, w: number, h: number) => void): void;
132
+ }
133
+ interface InlineOptions {
134
+ /** Frames per second. Default: 60 */
135
+ fps?: number;
136
+ /**
137
+ * What to do with the rendered content when the loop stops.
138
+ * - 'preserve' (default) — content stays in terminal scrollback
139
+ * - 'destroy' — content is cleared, terminal looks untouched
140
+ */
141
+ onExit?: "preserve" | "destroy";
142
+ /** Number of terminal rows to reserve. Default: 10 */
143
+ rows?: number;
144
+ }
145
+ type InlinePaintFn = (buf: Uint32Array, cols: number, rows: number, frame: number) => void;
146
+ interface InlineLoop {
147
+ start: () => void;
148
+ stop: () => void;
149
+ }
150
+ /**
151
+ * Create an inline render loop. Renders `rows` lines immediately below the
152
+ * current cursor position (no alternate screen).
153
+ */
154
+ declare function createInlineLoop(paint: InlinePaintFn, options?: InlineOptions): InlineLoop;
155
+ interface MouseEvent {
156
+ button: "left" | "right" | "middle" | "scrollUp" | "scrollDown";
157
+ ctrl: boolean;
158
+ meta: boolean;
159
+ shift: boolean;
160
+ x: number;
161
+ y: number;
162
+ }
163
+ declare class InputParser extends EventEmitter {
164
+ private stdin;
165
+ private _boundHandleData;
166
+ private _pasteBuffer;
167
+ constructor(stdin: NodeJS.ReadStream);
168
+ start(): void;
169
+ stop(): void;
170
+ private handleData;
171
+ }
172
+ export { InlineLoop as I, MouseEvent as M, TuiApp as T, InlineOptions as a, InlinePaintFn as b, InputParser as c, createInlineLoop as d };
@@ -0,0 +1,3 @@
1
+ var X=Object.defineProperty;var k=(n,t)=>X(n,"name",{value:t,configurable:!0});import{v as Y,c as Z,o as tt}from"./get-string-width-CbMPWEJO.js";import{t as et}from"./ansi-tokenizer-DqX9nJuk.js";var st=Object.defineProperty,at=k((n,t)=>st(n,"name",{value:t,configurable:!0}),"r$2"),nt=Object.defineProperty,rt=at((n,t)=>nt(n,"name",{value:t,configurable:!0}),"a"),it=Object.defineProperty,ht=rt((n,t)=>it(n,"name",{value:t,configurable:!0}),"i");const lt=ht(n=>Number.isInteger(n)?Y(n)||Z(n):!1,"isFullwidthCodePoint");var ot=Object.defineProperty,ct=k((n,t)=>ot(n,"name",{value:t,configurable:!0}),"r$1");let H=class{static{k(this,"h")}static{ct(this,"DataLimitedLruMap")}map;maxDataSize;maxKeys;currentDataSize=0;constructor(t,e){this.map=new Map,this.maxKeys=t,this.maxDataSize=e}get size(){return this.map.size}clear(){this.map.clear(),this.currentDataSize=0}get(t){if(!this.map.has(t))return;const e=this.map.get(t);return this.map.delete(t),this.map.set(t,e),e}set(t,e){const s=t.length;if(!(s>this.maxDataSize)){for(this.map.has(t)&&(this.map.delete(t),this.currentDataSize-=s);this.currentDataSize+s>this.maxDataSize&&this.map.size>0;){const a=this.map.keys().next().value;if(a===void 0)break;this.map.delete(a),this.currentDataSize-=a.length}for(;this.map.size>=this.maxKeys;){const a=this.map.keys().next().value;if(a===void 0)break;this.map.delete(a),this.currentDataSize-=a.length}this.map.set(t,e),this.currentDataSize+=s}}};const gt=1,ft=2,E=4,K=8,R=16,M=32,V=64,S=128;var ut=Object.defineProperty,dt=k((n,t)=>ut(n,"name",{value:t,configurable:!0}),"x");const p=1073741823,x=1073741824;class d{static{k(this,"StyledLine")}static{dt(this,"StyledLine")}length=0;static emptyCache=new Map;text;charData;spans;_cachedTrimmedLength;static empty(t){if(t<=0)return new d;const e=d.emptyCache.get(t);if(e)return e.clone();const s=new d;s.length=t,s.text=" ".repeat(t),s.charData=Array.from({length:t});for(let a=0;a<t;a++)s.charData[a]=a;return s.spans=[{formatFlags:0,length:t}],s._cachedTrimmedLength=0,Object.freeze(s.spans[0]),Object.freeze(s.spans),Object.freeze(s),d.emptyCache.set(t,s),s.clone()}getValue(t){if(this.text===void 0||t<0||t>=this.length)return"";const e=this.charData[t]&p,s=t+1<this.length?this.charData[t+1]&p:this.text.length;return this.text.slice(e,s)}getTextRange(t,e){if(this.text===void 0||t<0||e>this.length||t>=e)return"";const s=this.charData[t]&p,a=e<this.length?this.charData[e]&p:this.text.length;return this.text.slice(s,a)}getSpan(t){if(this.spans===void 0||t<0||t>=this.length)return;let e=0;for(const s of this.spans){if(t<e+s.length)return s;e+=s.length}}getFullWidth(t){return this.charData===void 0||t<0||t>=this.length?!1:(this.charData[t]&x)!==0}hasStyles(t){const e=this.getSpan(t);return e?(e.formatFlags&~S)!==0||e.fgColor!==void 0||e.bgColor!==void 0||e.link!==void 0:!1}getFormatFlags(t){let e=this.getSpan(t)?.formatFlags??0;return this.getFullWidth(t)&&(e|=S),e}getFgColor(t){return this.getSpan(t)?.fgColor}getBgColor(t){return this.getSpan(t)?.bgColor}getLink(t){return this.getSpan(t)?.link}setInverted(t,e){this._cachedTrimmedLength=void 0,this.updateSpanAt(t,s=>{e?s.formatFlags|=M:s.formatFlags&=~M})}setBackgroundColor(t,e){this._cachedTrimmedLength=void 0,this.updateSpanAt(t,s=>{s.bgColor=e})}setForegroundColor(t,e){this._cachedTrimmedLength=void 0,this.updateSpanAt(t,s=>{s.fgColor=e})}setChar(t,e,s,a,r,h){if(t<0||t>=this.length)return;this._cachedTrimmedLength=void 0,this.ensureInitialized();const i=(s&S)!==0,o=s&~S,l=this.charData[t]&p,c=t+1<this.length?this.charData[t+1]&p:this.text.length,m=c-l,b=e.length;if(this.text=this.text.slice(0,l)+e+this.text.slice(c),m!==b){const f=b-m;for(let v=t+1;v<this.length;v++){const T=this.charData[v],w=T&p,L=T&x;this.charData[v]=w+f|L}}if(this.charData[t]=l|(i?x:0),this.trySetStyleAtIndex(t,o,a,r,h))return;this.splitSpansAt(t),this.splitSpansAt(t+1);let u=0;for(let f=0;f<this.spans.length;f++){const v=this.spans[f];if(u===t&&v.length===1){this.spans[f]={bgColor:r,fgColor:a,formatFlags:o,length:1,link:h};break}u+=v.length}this.mergeSpans()}setCharFast(t,e,s,a,r,h){if(t<0||t>=this.length)return;this._cachedTrimmedLength=void 0,this.ensureInitialized();const i=(s&S)!==0,o=s&~S,l=this.charData[t]&p,c=t+1<this.length?this.charData[t+1]&p:this.text.length,m=c-l;if(e.length===m)e!==this.text.slice(l,c)&&(this.text=this.text.slice(0,l)+e+this.text.slice(c)),this.charData[t]=l|(i?x:0);else{if(this.text=this.text.slice(0,l)+e+this.text.slice(c),m!==e.length){const u=e.length-m;for(let f=t+1;f<this.length;f++){const v=this.charData[f];this.charData[f]=(v&p)+u|v&x}}this.charData[t]=l|(i?x:0)}if(this.trySetStyleAtIndex(t,o,a,r,h))return;this.splitSpansAt(t),this.splitSpansAt(t+1);let b=0;for(let u=0;u<this.spans.length;u++){const f=this.spans[u];if(b===t&&f.length===1){this.spans[u]={bgColor:r,fgColor:a,formatFlags:o,length:1,link:h};break}b+=f.length}this.mergeSpans()}writeFrom(t,e,s=0,a){const r=a??e.length-s;if(r<=0||t>=this.length)return;this._cachedTrimmedLength=void 0,this.ensureInitialized();const h=Math.min(r,this.length-t,e.length-s),i=this.charData[t]&p,o=t+h<this.length?this.charData[t+h]&p:this.text.length;let l="";for(let g=0;g<h;g++)l+=e.getValue(s+g);const c=o-i,m=l.length-c;this.text=this.text.slice(0,i)+l+this.text.slice(o);let b=i;for(let g=0;g<h;g++){const D=e.getFullWidth(s+g);this.charData[t+g]=b|(D?x:0),b+=e.getValue(s+g).length}if(m!==0)for(let g=t+h;g<this.length;g++){const D=this.charData[g];this.charData[g]=(D&p)+m|D&x}this.splitSpansAt(t),this.splitSpansAt(t+h);const u=[];let f=0;for(const g of e.getSpans()){const D=f+g.length,P=Math.max(s,f),j=Math.min(s+h,D);if(P<j&&u.push({...g,length:j-P}),f=D,f>=s+h)break}let v=0,T=0;for(let g=0;g<this.spans.length;g++){if(T===t){v=g;break}T+=this.spans[g].length}let w=0,L=0;for(let g=v;g<this.spans.length&&L<h;g++)L+=this.spans[g].length,w++;this.spans.splice(v,w,...u),this.mergeSpans()}pushChar(t,e,s,a,r){this._cachedTrimmedLength=void 0,this.ensureInitialized();const h=(e&S)!==0,i=e&~S,o=this.text.length;this.text=(this.text??"")+t,this.charData.push(o|(h?x:0));const l=this.spans.at(-1);l?.formatFlags===i&&l.fgColor===s&&l.bgColor===a&&l.link===r?l.length++:this.spans.push({bgColor:a,fgColor:s,formatFlags:i,length:1,link:r}),this.length++}clone(){if(this.charData===void 0)return new d;const t=new d;return t.length=this.length,t.text=this.text,t.charData=[...this.charData],t.spans=this.spans.map(e=>({...e})),t._cachedTrimmedLength=this._cachedTrimmedLength,t}slice(t,e){if(this.charData===void 0)return new d;const s=Math.max(0,t),a=e===void 0?this.length:Math.min(this.length,e);if(s>=a)return new d;if(s===0&&a===this.length)return this.clone();const r=new d;r.length=a-s,r.charData=Array.from({length:r.length});const h=this.charData[s]&p,i=a<this.length?this.charData[a]&p:this.text.length;r.text=this.text.slice(h,i);for(let c=0;c<r.length;c++){const m=this.charData[s+c],b=m&p,u=m&x;r.charData[c]=b-h|u}const o=[];let l=0;for(const c of this.spans){const m=l,b=l+c.length,u=Math.max(s,m),f=Math.min(a,b);if(u<f&&o.push({...c,length:f-u}),l+=c.length,l>=a)break}return r.spans=o,r.mergeSpans(),r}combine(...t){if(t.length===0)return this.clone();const e=[this,...t].filter(i=>i.length>0);if(e.length===0)return new d;if(e.length===1)return e[0].clone();let s=0;for(const i of e)s+=i.length;const a=new d;a.length=s,a.text=e.map(i=>i.getText()).join(""),a.charData=Array.from({length:s});let r=0,h=0;for(const i of e){const o=i.charData,l=i.getText();if(o)for(let c=0;c<i.length;c++){const m=o[c],b=m&p,u=m&x;a.charData[r+c]=h+b|u}else for(let c=0;c<i.length;c++)a.charData[r+c]=h+c;r+=i.length,h+=l.length}return a.spans=e.flatMap(i=>i.getSpans().map(o=>({...o}))),a.mergeSpans(),a}getTrimmedLength(){if(this._cachedTrimmedLength!==void 0)return this._cachedTrimmedLength;if(this.length===0)return this._cachedTrimmedLength=0,0;if(this.text===void 0||this.charData===void 0)return this._cachedTrimmedLength=0,0;let t=this.length-1;if(this.spans)for(let e=this.spans.length-1;e>=0;e--){const s=this.spans[e];if((s.formatFlags&~S)!==0||s.fgColor!==void 0||s.bgColor!==void 0||s.link!==void 0)return this._cachedTrimmedLength=t+1,this._cachedTrimmedLength;for(let a=0;a<s.length;a++){const r=this.charData[t]&p;if((t+1<this.length?this.charData[t+1]&p:this.text.length)-r!==1||this.text[r]!==" ")return this._cachedTrimmedLength=t+1,this._cachedTrimmedLength;t--}}return this._cachedTrimmedLength=0,0}trimEnd(){const t=this.getTrimmedLength();return t===this.length?this:t===0?new d:this.slice(0,t)}equals(t){if(this.length!==t.length)return!1;if(this.length===0)return!0;if(this.getText()!==t.getText())return!1;const e=this.getSpans(),s=t.getSpans();if(e.length!==s.length)return!1;for(const[h,i]of e.entries()){const o=i,l=s[h];if(o.length!==l.length||o.formatFlags!==l.formatFlags||o.fgColor!==l.fgColor||o.bgColor!==l.bgColor||o.link!==l.link)return!1}const a=this.charData,r=t.charData;if(a&&r){for(let h=0;h<this.length;h++)if(a[h]!==r[h])return!1}return!0}getText(){return this.text??""}getSpans(){return this.spans??[]}getValues(){return Array.from({length:this.length},(t,e)=>this.getValue(e))}*[Symbol.iterator](){if(this.length===0)return;let t=0,e=0;const s=this.getSpans();for(let a=0;a<this.length;a++){const r=s[t],h=r?r.formatFlags:0,i=this.getFullWidth(a);yield{bgColor:r?.bgColor,fgColor:r?.fgColor,formatFlags:h|(i?S:0),fullWidth:i,hasStyles:(h&~S)!==0||r?.fgColor!==void 0||r?.bgColor!==void 0||r?.link!==void 0,link:r?.link,value:this.getValue(a)},r&&(e++,e>=r.length&&(t++,e=0))}}updateSpanAt(t,e){if(t<0||t>=this.length)return;this.ensureInitialized(),this.splitSpansAt(t),this.splitSpansAt(t+1);let s=0;for(const a of this.spans){if(s===t&&a.length===1){e(a);break}s+=a.length}this.mergeSpans()}ensureWidth(t){if(t<=this.length)return;this.ensureInitialized();const e=this.length,s=t-e,a=this.text.length;for(let h=0;h<s;h++)this.charData.push(a);this.length=t;const r=this.spans.at(-1);r?.formatFlags===0&&r.fgColor===void 0&&r.bgColor===void 0&&r.link===void 0?r.length+=s:this.spans.push({formatFlags:0,length:s})}ensureInitialized(){if(this.charData===void 0&&(this.text="",this.charData=Array.from({length:this.length}),this.spans=this.length>0?[{formatFlags:0,length:this.length}]:[],this.length>0&&this.text.length===0)){this.text=" ".repeat(this.length);for(let t=0;t<this.length;t++)this.charData[t]=t}}splitSpansAt(t){if(this.spans===void 0||t<=0||t>=this.length)return;let e=0;for(let s=0;s<this.spans.length;s++){const a=this.spans[s];if(t>e&&t<e+a.length){const r=t-e,h=a.length-r;this.spans.splice(s,1,{...a,length:r},{...a,length:h});return}e+=a.length}}trySetStyleAtIndex(t,e,s,a,r){if(!this.spans)return!1;let h=0,i=-1,o;for(let l=0;l<this.spans.length;l++){const c=this.spans[l];if(h<=t&&h+c.length>t){i=l,o=c;break}h+=c.length}if(!o)return!1;if(o.formatFlags===e&&o.fgColor===s&&o.bgColor===a&&o.link===r)return!0;if(t===h&&i>0){const l=this.spans[i-1];if(l.formatFlags===e&&l.fgColor===s&&l.bgColor===a&&l.link===r)return l.length+=1,o.length===1?this.spans.splice(i,1):o.length-=1,!0}if(t===h+o.length-1&&i<this.spans.length-1){const l=this.spans[i+1];if(l.formatFlags===e&&l.fgColor===s&&l.bgColor===a&&l.link===r)return l.length+=1,o.length===1?this.spans.splice(i,1):o.length-=1,!0}return!1}mergeSpans(){if(this.spans===void 0)return;const t=[];for(const e of this.spans){if(e.length===0)continue;const s=t.at(-1);s?.formatFlags===e.formatFlags&&s.fgColor===e.fgColor&&s.bgColor===e.bgColor&&s.link===e.link?s.length+=e.length:t.push({...e})}this.spans=t}}var mt=Object.defineProperty,$=k((n,t)=>mt(n,"name",{value:t,configurable:!0}),"u$1");const G={black:0,blue:4,cyan:6,gray:8,green:2,grey:8,magenta:5,red:1,white:7,yellow:3},U={blackBright:8,blueBright:12,cyanBright:14,greenBright:10,magentaBright:13,redBright:9,whiteBright:15,yellowBright:11},q=/^ansi256\(\s?(\d+)\s?\)$/,J=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,Et=$(n=>{const t=G[n];if(t!==void 0)return t;const e=U[n];if(e!==void 0)return e;const s=q.exec(n);if(s)return Number(s[1])&255;if(n.startsWith("#")&&n.length===7){const r=Number.parseInt(n.slice(1,3),16),h=Number.parseInt(n.slice(3,5),16),i=Number.parseInt(n.slice(5,7),16);return 16+36*Math.round(r/51)+6*Math.round(h/51)+Math.round(i/51)}const a=J.exec(n);return a?16+36*Math.round(Number(a[1])/51)+6*Math.round(Number(a[2])/51)+Math.round(Number(a[3])/51):255},"colorToAnsi256"),pt=$((n,t)=>{const e=t?30:40,s=G[n];if(s!==void 0)return[e+s];const a=U[n];if(a!==void 0)return[e+60+(a-8)];if(n.startsWith("#")&&n.length===7){const i=Number.parseInt(n.slice(1,3),16),o=Number.parseInt(n.slice(3,5),16),l=Number.parseInt(n.slice(5,7),16);return[t?38:48,2,i,o,l]}const r=q.exec(n);if(r)return[t?38:48,5,Number(r[1])];const h=J.exec(n);return h?[t?38:48,2,Number(h[1]),Number(h[2]),Number(h[3])]:[]},"colorToSgrParams");$((n,t)=>{const e=pt(n,t);if(e.length!==0)return`\x1B[${e.join(";")}m`},"colorToAnsiCode");const A=$(n=>{const t=["black","red","green","yellow","blue","magenta","cyan","white"];return n>=0&&n<=7?t[n]:`ansi256(${n})`},"ansi256ToColorName");var bt=Object.defineProperty,y=k((n,t)=>bt(n,"name",{value:t,configurable:!0}),"u");const O=y(()=>({bgColor:void 0,fgColor:void 0,formatFlags:0,link:void 0}),"createSgrState"),vt=y((n,t)=>{if(t.length===0)return O();const e=(t.includes(":")?t.replaceAll(":",";"):t).split(";").filter(o=>o.length>0).map(Number);let{bgColor:s,fgColor:a,formatFlags:r,link:h}=n,i=0;for(;i<e.length;){const o=e[i];switch(o){case 0:{r=0,a=void 0,s=void 0,h=void 0;break}case 1:{r|=gt;break}case 2:{r|=ft;break}case 3:{r|=E;break}case 4:{r|=K;break}case 7:{r|=M;break}case 8:{r|=V;break}case 9:{r|=R;break}case 22:{r&=-4;break}case 23:{r&=~E;break}case 24:{r&=~K;break}case 27:{r&=~M;break}case 28:{r&=~V;break}case 29:{r&=~R;break}case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:{a=A(o-30);break}case 38:{e[i+1]===5&&e[i+2]!==void 0?(a=A(e[i+2]),i+=2):e[i+1]===2&&i+4<e.length&&(a=`rgb(${e[i+2]}, ${e[i+3]}, ${e[i+4]})`,i+=4);break}case 39:{a=void 0;break}case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:{s=A(o-40);break}case 48:{e[i+1]===5&&e[i+2]!==void 0?(s=A(e[i+2]),i+=2):e[i+1]===2&&i+4<e.length&&(s=`rgb(${e[i+2]}, ${e[i+3]}, ${e[i+4]})`,i+=4);break}case 49:{s=void 0;break}case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:{a=`ansi256(${o-90+8})`;break}case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:{s=`ansi256(${o-100+8})`;break}}i++}return{bgColor:s,fgColor:a,formatFlags:r,link:h}},"applySgrParams"),I=127462,z=127487,St=127995,xt=127999,Ct=8205,kt=917504,Dt=917631,yt=new RegExp("\\p{Mark}","u"),Tt=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Ft=y((n,t)=>!!(lt(t)||n.includes("️")||t>=I&&t<=z),"isFullwidthGrapheme"),wt=/(?:\u001B\]|\u009D)8;([^;]*);(.*?)(?:\u001B\\|\u0007|\u009C)/,Lt=y(n=>{const t=wt.exec(n);return!t?.[2]||t[2].length===0?void 0:n.endsWith("\x1B\\")?`ST:${t[2]}`:t[2]},"parseOscHyperlink"),Q=y((n,t,e)=>{const s=Tt.segment(n),a=[];for(const{segment:r}of s)a.push(r);for(let r=0;r<a.length;r++){let h=a[r];if(h===" "){for(let l=0;l<4;l++)t.pushChar(" ",e.formatFlags,e.fgColor,e.bgColor,e.link);continue}if(h==="\b")continue;const i=h.codePointAt(0);if(!i)continue;if(i>=I&&i<=z&&r+1<a.length){const l=a[r+1],c=l.codePointAt(0);c&&c>=I&&c<=z&&(h+=l,r++)}else for(;r+1<a.length;){const l=a[r+1],c=l.codePointAt(0);if(!c)break;const m=yt.test(String.fromCodePoint(c)),b=c>=St&&c<=xt,u=c===Ct,f=c>=kt&&c<=Dt;if(!m&&!b&&!u&&!f)break;h+=l,r++,u&&r+1<a.length&&(h+=a[r+1],r++)}const o=Ft(h,i)?e.formatFlags|S:e.formatFlags;t.pushChar(h,o,e.fgColor,e.bgColor,e.link)}},"processTextToken"),At=y(n=>{if(n.length===0)return new d;const t=et(n),e=new d;let s=O();for(const a of t)switch(a.type){case"csi":{a.finalCharacter==="m"&&(s=vt(s,a.parameterString));break}case"osc":{const r=Lt(a.value);r!==void 0?s={...s,link:r}:a.value.includes("8;")&&(s={...s,link:void 0});break}case"text":{Q(a.value,e,s);break}}return e},"textToStyledLine"),Mt=/^[\u0020-\u007E]*$/,Kt=y(n=>{if(n.length===0)return new d;const t=new d;if(Mt.test(n)){for(const e of n)t.pushChar(e,0);return t}return Q(n,t,O()),t},"plainTextToStyledLine");var $t=Object.defineProperty,C=k((n,t)=>$t(n,"name",{value:t,configurable:!0}),"r");const N=new H(1e4,1e6),B=new Map,F=new H(1e4,1e6);let W=!0,_=tt;const Rt=C(n=>{W=n,n||F.clear()},"setEnableStyledLineCache"),Vt=C(()=>{F.clear()},"clearStyledLineCache"),Ht=C(n=>{_=n,It()},"setStringWidthFunction"),It=C(()=>{N.clear(),B.clear(),F.clear()},"clearStringWidthCache"),zt=C(n=>{if(n.length===1){const s=n.codePointAt(0);if(s!==void 0&&s>=32&&s<127)return 1}const t=B.get(n);if(t!==void 0)return t;let e;try{e=_(n)}catch{e=1}return B.set(n,e),e},"inkCharacterWidth"),Nt=C(n=>{try{return _(n)}catch{return 1}},"safeGetStringWidth"),Gt=C(n=>{if(n.length===0)return{height:0,width:0};const t=N.get(n);if(t)return t;const e=n.split(`
2
+ `),s=Math.max(...e.map(r=>Nt(r))),a={height:e.length,width:s};return N.set(n,a),a},"measureText"),Ut=C(n=>{if(W){const e=F.get(n);if(e!==void 0)return e}const t=At(n);return W&&F.set(n,t),t},"toStyledLine"),Bt=C(n=>{let t=0;for(let e=0;e<n.length;e++)t+=zt(n.getValue(e));return t},"styledLineWidth"),Wt=C(n=>{if(n.length===0)return[new d];const t=[];let e=0;for(let s=0;s<n.length;s++)n.getValue(s)===`
3
+ `&&(t.push(s>e?n.slice(e,s):new d),e=s+1);return t.push(e<n.length?n.slice(e):new d),t},"splitStyledLineByNewline"),qt=C(n=>{if(n.length===0)return{height:0,width:0};const t=Wt(n);let e=0;for(const s of t)e=Math.max(e,Bt(s));return{height:t.length,width:e}},"measureStyledLine");export{gt as B,ft as D,S as F,V as H,E as I,d as S,K as U,Vt as a,Ht as b,It as c,Bt as d,Gt as e,M as f,R as g,pt as h,zt as i,Et as j,At as k,lt as l,qt as m,Wt as n,Kt as p,Rt as s,Ut as t};
@@ -0,0 +1 @@
1
+ var $=Object.defineProperty;var d=(e,o)=>$(e,"name",{value:o,configurable:!0});import{a}from"./constants-D12jy2Zh-RSfxu1eM.js";var f=Object.defineProperty,u=d((e,o)=>f(e,"name",{value:o,configurable:!0}),"i"),p=Object.defineProperty,M=u((e,o)=>p(e,"name",{value:o,configurable:!0}),"u"),S=Object.defineProperty,r=M((e,o)=>S(e,"name",{value:o,configurable:!0}),"s");class y{static{d(this,"j")}static{u(this,"h")}static{M(this,"g")}static{r(this,"AnsiModeImpl")}code;isDecMode=!1;constructor(o){this.code=o}}class R{static{d(this,"X")}static{u(this,"g")}static{M(this,"u")}static{r(this,"DecModeImpl")}code;isDecMode=!0;constructor(o){this.code=o}}const m=r((e,...o)=>{if(o.length===0)return"";const i=e?"l":"h";if(o.length===1){const n=o[0];let h=a;return n.isDecMode&&(h+="?"),h+String(n.code)+i}const c=o.filter(n=>!n.isDecMode).map(n=>n.code),g=o.filter(n=>n.isDecMode).map(n=>n.code);let l="";return c.length>0&&(l+=`${a}${c.join(";")}${i}`),g.length>0&&(l+=`${a}?${g.join(";")}${i}`),l},"generateModeSequence");var D=(e=>(e[e.NotRecognized=0]="NotRecognized",e[e.Set=1]="Set",e[e.Reset=2]="Reset",e[e.PermanentlySet=3]="PermanentlySet",e[e.PermanentlyReset=4]="PermanentlyReset",e))(D||{});r(e=>e===0,"isModeNotRecognized");r(e=>e===1||e===3,"isModeSet");r(e=>e===2||e===4,"isModeReset");r(e=>e===3,"isModePermanentlySet");r(e=>e===4,"isModePermanentlyReset");const s=r(e=>new y(e),"createAnsiMode"),t=r(e=>new R(e),"createDecMode"),b=r((...e)=>m(!1,...e),"setMode"),j=r((...e)=>m(!0,...e),"resetMode");r(e=>{let o=a;return e.isDecMode&&(o+="?"),`${o}${String(e.code)}$p`},"requestMode");r((e,o)=>{let i=o;(o<0||o>4)&&(i=0);let c=a;return e.isDecMode&&(c+="?"),`${c}${String(e.code)};${String(i)}$y`},"reportMode");s(2);s(4);s(8);s(12);s(20);t(1);t(6);t(7);t(9);t(25);t(66);t(67);t(69);t(1e3);t(1001);t(1002);t(1003);t(1004);t(1005);t(1006);t(1015);t(1016);t(1035);t(1047);t(1048);t(1049);const z=t(2004);t(2026);t(2027);t(9001);t(2031);t(2048);export{z as e,j as g,b as h,t as o};
@@ -0,0 +1 @@
1
+ import{a as e}from"./ansi-parser-C5JuL732.js";export{e as parseSgrMouse};