@opentui/core 0.1.73 → 0.1.75

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.
@@ -1666,6 +1666,19 @@ var Yoga = wrapAssembly(await yoga_wasm_base64_esm_default());
1666
1666
  var src_default = Yoga;
1667
1667
 
1668
1668
  // src/lib/border.ts
1669
+ var VALID_BORDER_STYLES = ["single", "double", "rounded", "heavy"];
1670
+ function isValidBorderStyle(value) {
1671
+ return typeof value === "string" && VALID_BORDER_STYLES.includes(value);
1672
+ }
1673
+ function parseBorderStyle(value, fallback = "single") {
1674
+ if (isValidBorderStyle(value)) {
1675
+ return value;
1676
+ }
1677
+ if (value !== undefined && value !== null) {
1678
+ console.warn(`Invalid borderStyle "${value}", falling back to "${fallback}". Valid values are: ${VALID_BORDER_STYLES.join(", ")}`);
1679
+ }
1680
+ return fallback;
1681
+ }
1669
1682
  var BorderChars = {
1670
1683
  single: {
1671
1684
  topLeft: "\u250C",
@@ -2584,6 +2597,11 @@ class RGBA {
2584
2597
  toString() {
2585
2598
  return `rgba(${this.r.toFixed(2)}, ${this.g.toFixed(2)}, ${this.b.toFixed(2)}, ${this.a.toFixed(2)})`;
2586
2599
  }
2600
+ equals(other) {
2601
+ if (!other)
2602
+ return false;
2603
+ return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
2604
+ }
2587
2605
  }
2588
2606
  function hexToRgb(hex) {
2589
2607
  hex = hex.replace(/^#/, "");
@@ -9273,12 +9291,12 @@ function createTerminalPalette(stdin, stdout, writeFn, isLegacyTmux) {
9273
9291
  return new TerminalPalette(stdin, stdout, writeFn, isLegacyTmux);
9274
9292
  }
9275
9293
  // src/zig.ts
9276
- import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr3 } from "bun:ffi";
9294
+ import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr4 } from "bun:ffi";
9277
9295
  import { existsSync as existsSync2 } from "fs";
9278
9296
  import { EventEmitter as EventEmitter5 } from "events";
9279
9297
 
9280
9298
  // src/buffer.ts
9281
- import { toArrayBuffer } from "bun:ffi";
9299
+ import { toArrayBuffer, ptr } from "bun:ffi";
9282
9300
  function packDrawOptions(border2, shouldFill, titleAlignment) {
9283
9301
  let packed = 0;
9284
9302
  if (border2 === true) {
@@ -9341,14 +9359,14 @@ class OptimizedBuffer {
9341
9359
  }
9342
9360
  return this._rawBuffers;
9343
9361
  }
9344
- constructor(lib, ptr, width, height, options) {
9362
+ constructor(lib, ptr2, width, height, options) {
9345
9363
  this.id = options.id || `fb_${OptimizedBuffer.fbIdCounter++}`;
9346
9364
  this.lib = lib;
9347
9365
  this.respectAlpha = options.respectAlpha || false;
9348
9366
  this._width = width;
9349
9367
  this._height = height;
9350
9368
  this._widthMethod = options.widthMethod || "unicode";
9351
- this.bufferPtr = ptr;
9369
+ this.bufferPtr = ptr2;
9352
9370
  }
9353
9371
  static create(width, height, widthMethod, options = {}) {
9354
9372
  const lib = resolveRenderLib();
@@ -9382,6 +9400,43 @@ class OptimizedBuffer {
9382
9400
  const bytesWritten = this.lib.bufferWriteResolvedChars(this.bufferPtr, outputBuffer, addLineBreaks);
9383
9401
  return outputBuffer.slice(0, bytesWritten);
9384
9402
  }
9403
+ getSpanLines() {
9404
+ this.guard();
9405
+ const { char, fg: fg2, bg: bg2, attributes } = this.buffers;
9406
+ const lines = [];
9407
+ for (let y = 0;y < this._height; y++) {
9408
+ const spans = [];
9409
+ let currentSpan = null;
9410
+ for (let x = 0;x < this._width; x++) {
9411
+ const i = y * this._width + x;
9412
+ const cp = char[i];
9413
+ const cellFg = RGBA.fromValues(fg2[i * 4], fg2[i * 4 + 1], fg2[i * 4 + 2], fg2[i * 4 + 3]);
9414
+ const cellBg = RGBA.fromValues(bg2[i * 4], bg2[i * 4 + 1], bg2[i * 4 + 2], bg2[i * 4 + 3]);
9415
+ const cellAttrs = attributes[i] & 255;
9416
+ const cellChar = cp > 0 ? String.fromCodePoint(cp) : " ";
9417
+ if (currentSpan && currentSpan.fg.equals(cellFg) && currentSpan.bg.equals(cellBg) && currentSpan.attributes === cellAttrs) {
9418
+ currentSpan.text += cellChar;
9419
+ currentSpan.width += 1;
9420
+ } else {
9421
+ if (currentSpan) {
9422
+ spans.push(currentSpan);
9423
+ }
9424
+ currentSpan = {
9425
+ text: cellChar,
9426
+ fg: cellFg,
9427
+ bg: cellBg,
9428
+ attributes: cellAttrs,
9429
+ width: 1
9430
+ };
9431
+ }
9432
+ }
9433
+ if (currentSpan) {
9434
+ spans.push(currentSpan);
9435
+ }
9436
+ lines.push({ spans });
9437
+ }
9438
+ return lines;
9439
+ }
9385
9440
  clear(bg2 = RGBA.fromValues(0, 0, 0, 1)) {
9386
9441
  this.guard();
9387
9442
  this.lib.bufferClear(this.bufferPtr, bg2);
@@ -9453,6 +9508,14 @@ class OptimizedBuffer {
9453
9508
  this.guard();
9454
9509
  this.lib.bufferDrawPackedBuffer(this.bufferPtr, dataPtr, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
9455
9510
  }
9511
+ drawGrayscaleBuffer(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
9512
+ this.guard();
9513
+ this.lib.bufferDrawGrayscaleBuffer(this.bufferPtr, posX, posY, ptr(intensities), srcWidth, srcHeight, fg2, bg2);
9514
+ }
9515
+ drawGrayscaleBufferSupersampled(posX, posY, intensities, srcWidth, srcHeight, fg2 = null, bg2 = null) {
9516
+ this.guard();
9517
+ this.lib.bufferDrawGrayscaleBufferSupersampled(this.bufferPtr, posX, posY, ptr(intensities), srcWidth, srcHeight, fg2, bg2);
9518
+ }
9456
9519
  resize(width, height) {
9457
9520
  this.guard();
9458
9521
  if (this._width === width && this._height === height)
@@ -9464,7 +9527,7 @@ class OptimizedBuffer {
9464
9527
  }
9465
9528
  drawBox(options) {
9466
9529
  this.guard();
9467
- const style = options.borderStyle || "single";
9530
+ const style = parseBorderStyle(options.borderStyle, "single");
9468
9531
  const borderChars = options.customBorderChars ?? BorderCharArrays[style];
9469
9532
  const packedOptions = packDrawOptions(options.border, options.shouldFill ?? false, options.titleAlignment || "left");
9470
9533
  this.lib.bufferDrawBox(this.bufferPtr, options.x, options.y, options.width, options.height, borderChars, packedOptions, options.borderColor, options.backgroundColor, options.title ?? null);
@@ -9512,7 +9575,7 @@ class OptimizedBuffer {
9512
9575
  }
9513
9576
 
9514
9577
  // ../../node_modules/.bun/bun-ffi-structs@0.1.2+1fb4c65d43e298b9/node_modules/bun-ffi-structs/index.js
9515
- import { ptr, toArrayBuffer as toArrayBuffer2 } from "bun:ffi";
9578
+ import { ptr as ptr2, toArrayBuffer as toArrayBuffer2 } from "bun:ffi";
9516
9579
  function fatalError(...args) {
9517
9580
  const message = args.join(" ");
9518
9581
  console.error("FATAL ERROR:", message);
@@ -9674,7 +9737,7 @@ function defineStruct(fields, structDefOptions) {
9674
9737
  size = pointerSize;
9675
9738
  align = pointerSize;
9676
9739
  pack = (view, off, val) => {
9677
- const bufPtr = val ? ptr(encoder.encode(val + "\x00")) : null;
9740
+ const bufPtr = val ? ptr2(encoder.encode(val + "\x00")) : null;
9678
9741
  pointerPacker(view, off, bufPtr);
9679
9742
  };
9680
9743
  unpack = (view, off) => {
@@ -9685,7 +9748,7 @@ function defineStruct(fields, structDefOptions) {
9685
9748
  size = pointerSize;
9686
9749
  align = pointerSize;
9687
9750
  pack = (view, off, val) => {
9688
- const bufPtr = val ? ptr(encoder.encode(val)) : null;
9751
+ const bufPtr = val ? ptr2(encoder.encode(val)) : null;
9689
9752
  pointerPacker(view, off, bufPtr);
9690
9753
  };
9691
9754
  unpack = (view, off) => {
@@ -9716,7 +9779,7 @@ function defineStruct(fields, structDefOptions) {
9716
9779
  return;
9717
9780
  }
9718
9781
  const nestedBuf = typeOrStruct.pack(val, options2);
9719
- pointerPacker(view, off, ptr(nestedBuf));
9782
+ pointerPacker(view, off, ptr2(nestedBuf));
9720
9783
  };
9721
9784
  unpack = (view, off) => {
9722
9785
  throw new Error("Not implemented yet");
@@ -9768,7 +9831,7 @@ function defineStruct(fields, structDefOptions) {
9768
9831
  const num = def.to(val[i]);
9769
9832
  bufferView.setUint32(i * arrayElementSize, num, true);
9770
9833
  }
9771
- pointerPacker(view, off, ptr(buffer));
9834
+ pointerPacker(view, off, ptr2(buffer));
9772
9835
  };
9773
9836
  unpack = null;
9774
9837
  needsLengthOf = true;
@@ -9785,7 +9848,7 @@ function defineStruct(fields, structDefOptions) {
9785
9848
  for (let i = 0;i < val.length; i++) {
9786
9849
  def.packInto(val[i], bufferView, i * arrayElementSize, options2);
9787
9850
  }
9788
- pointerPacker(view, off, ptr(buffer));
9851
+ pointerPacker(view, off, ptr2(buffer));
9789
9852
  };
9790
9853
  unpack = (view, off) => {
9791
9854
  throw new Error("Not implemented yet");
@@ -9803,7 +9866,7 @@ function defineStruct(fields, structDefOptions) {
9803
9866
  for (let i = 0;i < val.length; i++) {
9804
9867
  primitivePack(bufferView, i * arrayElementSize, val[i]);
9805
9868
  }
9806
- pointerPacker(view, off, ptr(buffer));
9869
+ pointerPacker(view, off, ptr2(buffer));
9807
9870
  };
9808
9871
  unpack = null;
9809
9872
  needsLengthOf = true;
@@ -9816,7 +9879,7 @@ function defineStruct(fields, structDefOptions) {
9816
9879
  return;
9817
9880
  }
9818
9881
  const packedView = packObjectArray(val);
9819
- pointerPacker(view, off, ptr(packedView.buffer));
9882
+ pointerPacker(view, off, ptr2(packedView.buffer));
9820
9883
  };
9821
9884
  unpack = () => {
9822
9885
  throw new Error("not implemented yet");
@@ -10120,9 +10183,9 @@ function defineStruct(fields, structDefOptions) {
10120
10183
  }
10121
10184
 
10122
10185
  // src/zig-structs.ts
10123
- import { ptr as ptr2, toArrayBuffer as toArrayBuffer3 } from "bun:ffi";
10124
- var rgbaPackTransform = (rgba) => rgba ? ptr2(rgba.buffer) : null;
10125
- var rgbaUnpackTransform = (ptr3) => ptr3 ? RGBA.fromArray(new Float32Array(toArrayBuffer3(ptr3))) : undefined;
10186
+ import { ptr as ptr3, toArrayBuffer as toArrayBuffer3 } from "bun:ffi";
10187
+ var rgbaPackTransform = (rgba) => rgba ? ptr3(rgba.buffer) : null;
10188
+ var rgbaUnpackTransform = (ptr4) => ptr4 ? RGBA.fromArray(new Float32Array(toArrayBuffer3(ptr4))) : undefined;
10126
10189
  var StyledChunkStruct = defineStruct([
10127
10190
  ["text", "char*"],
10128
10191
  ["text_len", "u64", { lengthOf: "text" }],
@@ -10457,6 +10520,14 @@ function getOpenTUILib(libPath) {
10457
10520
  args: ["ptr", "ptr", "usize", "u32", "u32", "u32", "u32"],
10458
10521
  returns: "void"
10459
10522
  },
10523
+ bufferDrawGrayscaleBuffer: {
10524
+ args: ["ptr", "i32", "i32", "ptr", "u32", "u32", "ptr", "ptr"],
10525
+ returns: "void"
10526
+ },
10527
+ bufferDrawGrayscaleBufferSupersampled: {
10528
+ args: ["ptr", "i32", "i32", "ptr", "u32", "u32", "ptr", "ptr"],
10529
+ returns: "void"
10530
+ },
10460
10531
  bufferDrawBox: {
10461
10532
  args: ["ptr", "i32", "i32", "u32", "u32", "ptr", "u32", "ptr", "ptr", "ptr", "u32"],
10462
10533
  returns: "void"
@@ -11022,7 +11093,7 @@ function getOpenTUILib(libPath) {
11022
11093
  returns: "u64"
11023
11094
  },
11024
11095
  editorViewSetLocalSelection: {
11025
- args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool"],
11096
+ args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool", "bool"],
11026
11097
  returns: "bool"
11027
11098
  },
11028
11099
  editorViewUpdateSelection: {
@@ -11030,7 +11101,7 @@ function getOpenTUILib(libPath) {
11030
11101
  returns: "void"
11031
11102
  },
11032
11103
  editorViewUpdateLocalSelection: {
11033
- args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool"],
11104
+ args: ["ptr", "i32", "i32", "i32", "i32", "ptr", "ptr", "bool", "bool"],
11034
11105
  returns: "bool"
11035
11106
  },
11036
11107
  editorViewResetLocalSelection: {
@@ -11441,32 +11512,32 @@ class FFIRenderLib {
11441
11512
  return new OptimizedBuffer(this, bufferPtr, width, height, { id: "current buffer", widthMethod: "unicode" });
11442
11513
  }
11443
11514
  bufferGetCharPtr(buffer) {
11444
- const ptr4 = this.opentui.symbols.bufferGetCharPtr(buffer);
11445
- if (!ptr4) {
11515
+ const ptr5 = this.opentui.symbols.bufferGetCharPtr(buffer);
11516
+ if (!ptr5) {
11446
11517
  throw new Error("Failed to get char pointer");
11447
11518
  }
11448
- return ptr4;
11519
+ return ptr5;
11449
11520
  }
11450
11521
  bufferGetFgPtr(buffer) {
11451
- const ptr4 = this.opentui.symbols.bufferGetFgPtr(buffer);
11452
- if (!ptr4) {
11522
+ const ptr5 = this.opentui.symbols.bufferGetFgPtr(buffer);
11523
+ if (!ptr5) {
11453
11524
  throw new Error("Failed to get fg pointer");
11454
11525
  }
11455
- return ptr4;
11526
+ return ptr5;
11456
11527
  }
11457
11528
  bufferGetBgPtr(buffer) {
11458
- const ptr4 = this.opentui.symbols.bufferGetBgPtr(buffer);
11459
- if (!ptr4) {
11529
+ const ptr5 = this.opentui.symbols.bufferGetBgPtr(buffer);
11530
+ if (!ptr5) {
11460
11531
  throw new Error("Failed to get bg pointer");
11461
11532
  }
11462
- return ptr4;
11533
+ return ptr5;
11463
11534
  }
11464
11535
  bufferGetAttributesPtr(buffer) {
11465
- const ptr4 = this.opentui.symbols.bufferGetAttributesPtr(buffer);
11466
- if (!ptr4) {
11536
+ const ptr5 = this.opentui.symbols.bufferGetAttributesPtr(buffer);
11537
+ if (!ptr5) {
11467
11538
  throw new Error("Failed to get attributes pointer");
11468
11539
  }
11469
- return ptr4;
11540
+ return ptr5;
11470
11541
  }
11471
11542
  bufferGetRespectAlpha(buffer) {
11472
11543
  return this.opentui.symbols.bufferGetRespectAlpha(buffer);
@@ -11527,6 +11598,12 @@ class FFIRenderLib {
11527
11598
  bufferDrawPackedBuffer(buffer, dataPtr, dataLen, posX, posY, terminalWidthCells, terminalHeightCells) {
11528
11599
  this.opentui.symbols.bufferDrawPackedBuffer(buffer, dataPtr, dataLen, posX, posY, terminalWidthCells, terminalHeightCells);
11529
11600
  }
11601
+ bufferDrawGrayscaleBuffer(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, fg2, bg2) {
11602
+ this.opentui.symbols.bufferDrawGrayscaleBuffer(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, fg2?.buffer ?? null, bg2?.buffer ?? null);
11603
+ }
11604
+ bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, fg2, bg2) {
11605
+ this.opentui.symbols.bufferDrawGrayscaleBufferSupersampled(buffer, posX, posY, intensitiesPtr, srcWidth, srcHeight, fg2?.buffer ?? null, bg2?.buffer ?? null);
11606
+ }
11530
11607
  bufferDrawBox(buffer, x, y, width, height, borderChars, packedOptions, borderColor, backgroundColor, title) {
11531
11608
  const titleBytes = title ? this.encoder.encode(title) : null;
11532
11609
  const titleLen = title ? titleBytes.length : 0;
@@ -11566,7 +11643,7 @@ class FFIRenderLib {
11566
11643
  }
11567
11644
  getCursorState(renderer) {
11568
11645
  const cursorBuffer = new ArrayBuffer(CursorStateStruct.size);
11569
- this.opentui.symbols.getCursorState(renderer, ptr3(cursorBuffer));
11646
+ this.opentui.symbols.getCursorState(renderer, ptr4(cursorBuffer));
11570
11647
  const struct = CursorStateStruct.unpack(cursorBuffer);
11571
11648
  const styleMap = {
11572
11649
  0: "block",
@@ -11687,7 +11764,7 @@ class FFIRenderLib {
11687
11764
  const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data;
11688
11765
  if (bytes.length === 0)
11689
11766
  return;
11690
- this.opentui.symbols.writeOut(renderer, ptr3(bytes), bytes.length);
11767
+ this.opentui.symbols.writeOut(renderer, ptr4(bytes), bytes.length);
11691
11768
  }
11692
11769
  createTextBuffer(widthMethod) {
11693
11770
  const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
@@ -11776,7 +11853,7 @@ class FFIRenderLib {
11776
11853
  return chunk;
11777
11854
  });
11778
11855
  const chunksBuffer = StyledChunkStruct.packList(processedChunks);
11779
- this.opentui.symbols.textBufferSetStyledText(buffer, ptr3(chunksBuffer), processedChunks.length);
11856
+ this.opentui.symbols.textBufferSetStyledText(buffer, ptr4(chunksBuffer), processedChunks.length);
11780
11857
  }
11781
11858
  textBufferGetLineCount(buffer) {
11782
11859
  return this.opentui.symbols.textBufferGetLineCount(buffer);
@@ -11787,7 +11864,7 @@ class FFIRenderLib {
11787
11864
  }
11788
11865
  getPlainTextBytes(buffer, maxLength) {
11789
11866
  const outBuffer = new Uint8Array(maxLength);
11790
- const actualLen = this.textBufferGetPlainText(buffer, ptr3(outBuffer), maxLength);
11867
+ const actualLen = this.textBufferGetPlainText(buffer, ptr4(outBuffer), maxLength);
11791
11868
  if (actualLen === 0) {
11792
11869
  return null;
11793
11870
  }
@@ -11795,7 +11872,7 @@ class FFIRenderLib {
11795
11872
  }
11796
11873
  textBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
11797
11874
  const outBuffer = new Uint8Array(maxLength);
11798
- const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, ptr3(outBuffer), maxLength);
11875
+ const actualLen = this.opentui.symbols.textBufferGetTextRange(buffer, startOffset, endOffset, ptr4(outBuffer), maxLength);
11799
11876
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
11800
11877
  if (len === 0) {
11801
11878
  return null;
@@ -11804,7 +11881,7 @@ class FFIRenderLib {
11804
11881
  }
11805
11882
  textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
11806
11883
  const outBuffer = new Uint8Array(maxLength);
11807
- const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, ptr3(outBuffer), maxLength);
11884
+ const actualLen = this.opentui.symbols.textBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, ptr4(outBuffer), maxLength);
11808
11885
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
11809
11886
  if (len === 0) {
11810
11887
  return null;
@@ -11874,7 +11951,7 @@ class FFIRenderLib {
11874
11951
  }
11875
11952
  textBufferViewGetLineInfo(view) {
11876
11953
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
11877
- this.textBufferViewGetLineInfoDirect(view, ptr3(outBuffer));
11954
+ this.textBufferViewGetLineInfoDirect(view, ptr4(outBuffer));
11878
11955
  const struct = LineInfoStruct.unpack(outBuffer);
11879
11956
  return {
11880
11957
  maxLineWidth: struct.maxWidth,
@@ -11886,7 +11963,7 @@ class FFIRenderLib {
11886
11963
  }
11887
11964
  textBufferViewGetLogicalLineInfo(view) {
11888
11965
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
11889
- this.textBufferViewGetLogicalLineInfoDirect(view, ptr3(outBuffer));
11966
+ this.textBufferViewGetLogicalLineInfoDirect(view, ptr4(outBuffer));
11890
11967
  const struct = LineInfoStruct.unpack(outBuffer);
11891
11968
  return {
11892
11969
  maxLineWidth: struct.maxWidth,
@@ -11915,7 +11992,7 @@ class FFIRenderLib {
11915
11992
  }
11916
11993
  textBufferViewGetSelectedTextBytes(view, maxLength) {
11917
11994
  const outBuffer = new Uint8Array(maxLength);
11918
- const actualLen = this.textBufferViewGetSelectedText(view, ptr3(outBuffer), maxLength);
11995
+ const actualLen = this.textBufferViewGetSelectedText(view, ptr4(outBuffer), maxLength);
11919
11996
  if (actualLen === 0) {
11920
11997
  return null;
11921
11998
  }
@@ -11923,7 +12000,7 @@ class FFIRenderLib {
11923
12000
  }
11924
12001
  textBufferViewGetPlainTextBytes(view, maxLength) {
11925
12002
  const outBuffer = new Uint8Array(maxLength);
11926
- const actualLen = this.textBufferViewGetPlainText(view, ptr3(outBuffer), maxLength);
12003
+ const actualLen = this.textBufferViewGetPlainText(view, ptr4(outBuffer), maxLength);
11927
12004
  if (actualLen === 0) {
11928
12005
  return null;
11929
12006
  }
@@ -11940,7 +12017,7 @@ class FFIRenderLib {
11940
12017
  }
11941
12018
  textBufferViewMeasureForDimensions(view, width, height) {
11942
12019
  const resultBuffer = new ArrayBuffer(MeasureResultStruct.size);
11943
- const resultPtr = ptr3(new Uint8Array(resultBuffer));
12020
+ const resultPtr = ptr4(new Uint8Array(resultBuffer));
11944
12021
  const success = this.opentui.symbols.textBufferViewMeasureForDimensions(view, width, height, resultPtr);
11945
12022
  if (!success) {
11946
12023
  return null;
@@ -11950,11 +12027,11 @@ class FFIRenderLib {
11950
12027
  }
11951
12028
  textBufferAddHighlightByCharRange(buffer, highlight) {
11952
12029
  const packedHighlight = HighlightStruct.pack(highlight);
11953
- this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, ptr3(packedHighlight));
12030
+ this.opentui.symbols.textBufferAddHighlightByCharRange(buffer, ptr4(packedHighlight));
11954
12031
  }
11955
12032
  textBufferAddHighlight(buffer, lineIdx, highlight) {
11956
12033
  const packedHighlight = HighlightStruct.pack(highlight);
11957
- this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, ptr3(packedHighlight));
12034
+ this.opentui.symbols.textBufferAddHighlight(buffer, lineIdx, ptr4(packedHighlight));
11958
12035
  }
11959
12036
  textBufferRemoveHighlightsByRef(buffer, hlRef) {
11960
12037
  this.opentui.symbols.textBufferRemoveHighlightsByRef(buffer, hlRef);
@@ -11970,7 +12047,7 @@ class FFIRenderLib {
11970
12047
  }
11971
12048
  textBufferGetLineHighlights(buffer, lineIdx) {
11972
12049
  const outCountBuf = new BigUint64Array(1);
11973
- const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, ptr3(outCountBuf));
12050
+ const nativePtr = this.opentui.symbols.textBufferGetLineHighlightsPtr(buffer, lineIdx, ptr4(outCountBuf));
11974
12051
  if (!nativePtr)
11975
12052
  return [];
11976
12053
  const count = Number(outCountBuf[0]);
@@ -12014,7 +12091,7 @@ class FFIRenderLib {
12014
12091
  const y = new Uint32Array(1);
12015
12092
  const width = new Uint32Array(1);
12016
12093
  const height = new Uint32Array(1);
12017
- this.opentui.symbols.editorViewGetViewport(view, ptr3(x), ptr3(y), ptr3(width), ptr3(height));
12094
+ this.opentui.symbols.editorViewGetViewport(view, ptr4(x), ptr4(y), ptr4(width), ptr4(height));
12018
12095
  return {
12019
12096
  offsetX: x[0],
12020
12097
  offsetY: y[0],
@@ -12044,7 +12121,7 @@ class FFIRenderLib {
12044
12121
  }
12045
12122
  editorViewGetLineInfo(view) {
12046
12123
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
12047
- this.opentui.symbols.editorViewGetLineInfoDirect(view, ptr3(outBuffer));
12124
+ this.opentui.symbols.editorViewGetLineInfoDirect(view, ptr4(outBuffer));
12048
12125
  const struct = LineInfoStruct.unpack(outBuffer);
12049
12126
  return {
12050
12127
  maxLineWidth: struct.maxWidth,
@@ -12056,7 +12133,7 @@ class FFIRenderLib {
12056
12133
  }
12057
12134
  editorViewGetLogicalLineInfo(view) {
12058
12135
  const outBuffer = new ArrayBuffer(LineInfoStruct.size);
12059
- this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, ptr3(outBuffer));
12136
+ this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, ptr4(outBuffer));
12060
12137
  const struct = LineInfoStruct.unpack(outBuffer);
12061
12138
  return {
12062
12139
  maxLineWidth: struct.maxWidth,
@@ -12091,7 +12168,7 @@ class FFIRenderLib {
12091
12168
  }
12092
12169
  editBufferGetText(buffer, maxLength) {
12093
12170
  const outBuffer = new Uint8Array(maxLength);
12094
- const actualLen = this.opentui.symbols.editBufferGetText(buffer, ptr3(outBuffer), maxLength);
12171
+ const actualLen = this.opentui.symbols.editBufferGetText(buffer, ptr4(outBuffer), maxLength);
12095
12172
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12096
12173
  if (len === 0)
12097
12174
  return null;
@@ -12146,7 +12223,7 @@ class FFIRenderLib {
12146
12223
  }
12147
12224
  editBufferGetCursorPosition(buffer) {
12148
12225
  const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
12149
- this.opentui.symbols.editBufferGetCursorPosition(buffer, ptr3(cursorBuffer));
12226
+ this.opentui.symbols.editBufferGetCursorPosition(buffer, ptr4(cursorBuffer));
12150
12227
  return LogicalCursorStruct.unpack(cursorBuffer);
12151
12228
  }
12152
12229
  editBufferGetId(buffer) {
@@ -12164,7 +12241,7 @@ class FFIRenderLib {
12164
12241
  }
12165
12242
  editBufferUndo(buffer, maxLength) {
12166
12243
  const outBuffer = new Uint8Array(maxLength);
12167
- const actualLen = this.opentui.symbols.editBufferUndo(buffer, ptr3(outBuffer), maxLength);
12244
+ const actualLen = this.opentui.symbols.editBufferUndo(buffer, ptr4(outBuffer), maxLength);
12168
12245
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12169
12246
  if (len === 0)
12170
12247
  return null;
@@ -12172,7 +12249,7 @@ class FFIRenderLib {
12172
12249
  }
12173
12250
  editBufferRedo(buffer, maxLength) {
12174
12251
  const outBuffer = new Uint8Array(maxLength);
12175
- const actualLen = this.opentui.symbols.editBufferRedo(buffer, ptr3(outBuffer), maxLength);
12252
+ const actualLen = this.opentui.symbols.editBufferRedo(buffer, ptr4(outBuffer), maxLength);
12176
12253
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12177
12254
  if (len === 0)
12178
12255
  return null;
@@ -12192,22 +12269,22 @@ class FFIRenderLib {
12192
12269
  }
12193
12270
  editBufferGetNextWordBoundary(buffer) {
12194
12271
  const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
12195
- this.opentui.symbols.editBufferGetNextWordBoundary(buffer, ptr3(cursorBuffer));
12272
+ this.opentui.symbols.editBufferGetNextWordBoundary(buffer, ptr4(cursorBuffer));
12196
12273
  return LogicalCursorStruct.unpack(cursorBuffer);
12197
12274
  }
12198
12275
  editBufferGetPrevWordBoundary(buffer) {
12199
12276
  const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
12200
- this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, ptr3(cursorBuffer));
12277
+ this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, ptr4(cursorBuffer));
12201
12278
  return LogicalCursorStruct.unpack(cursorBuffer);
12202
12279
  }
12203
12280
  editBufferGetEOL(buffer) {
12204
12281
  const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
12205
- this.opentui.symbols.editBufferGetEOL(buffer, ptr3(cursorBuffer));
12282
+ this.opentui.symbols.editBufferGetEOL(buffer, ptr4(cursorBuffer));
12206
12283
  return LogicalCursorStruct.unpack(cursorBuffer);
12207
12284
  }
12208
12285
  editBufferOffsetToPosition(buffer, offset) {
12209
12286
  const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
12210
- const success = this.opentui.symbols.editBufferOffsetToPosition(buffer, offset, ptr3(cursorBuffer));
12287
+ const success = this.opentui.symbols.editBufferOffsetToPosition(buffer, offset, ptr4(cursorBuffer));
12211
12288
  if (!success)
12212
12289
  return null;
12213
12290
  return LogicalCursorStruct.unpack(cursorBuffer);
@@ -12220,7 +12297,7 @@ class FFIRenderLib {
12220
12297
  }
12221
12298
  editBufferGetTextRange(buffer, startOffset, endOffset, maxLength) {
12222
12299
  const outBuffer = new Uint8Array(maxLength);
12223
- const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, ptr3(outBuffer), maxLength);
12300
+ const actualLen = this.opentui.symbols.editBufferGetTextRange(buffer, startOffset, endOffset, ptr4(outBuffer), maxLength);
12224
12301
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12225
12302
  if (len === 0)
12226
12303
  return null;
@@ -12228,7 +12305,7 @@ class FFIRenderLib {
12228
12305
  }
12229
12306
  editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, maxLength) {
12230
12307
  const outBuffer = new Uint8Array(maxLength);
12231
- const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, ptr3(outBuffer), maxLength);
12308
+ const actualLen = this.opentui.symbols.editBufferGetTextRangeByCoords(buffer, startRow, startCol, endRow, endCol, ptr4(outBuffer), maxLength);
12232
12309
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12233
12310
  if (len === 0)
12234
12311
  return null;
@@ -12251,27 +12328,27 @@ class FFIRenderLib {
12251
12328
  const end = Number(packedInfo & 0xffff_ffffn);
12252
12329
  return { start, end };
12253
12330
  }
12254
- editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor) {
12331
+ editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
12255
12332
  const bg2 = bgColor ? bgColor.buffer : null;
12256
12333
  const fg2 = fgColor ? fgColor.buffer : null;
12257
- return this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, updateCursor);
12334
+ return this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, updateCursor, followCursor);
12258
12335
  }
12259
12336
  editorViewUpdateSelection(view, end, bgColor, fgColor) {
12260
12337
  const bg2 = bgColor ? bgColor.buffer : null;
12261
12338
  const fg2 = fgColor ? fgColor.buffer : null;
12262
12339
  this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
12263
12340
  }
12264
- editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor) {
12341
+ editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
12265
12342
  const bg2 = bgColor ? bgColor.buffer : null;
12266
12343
  const fg2 = fgColor ? fgColor.buffer : null;
12267
- return this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, updateCursor);
12344
+ return this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, updateCursor, followCursor);
12268
12345
  }
12269
12346
  editorViewResetLocalSelection(view) {
12270
12347
  this.opentui.symbols.editorViewResetLocalSelection(view);
12271
12348
  }
12272
12349
  editorViewGetSelectedTextBytes(view, maxLength) {
12273
12350
  const outBuffer = new Uint8Array(maxLength);
12274
- const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, ptr3(outBuffer), maxLength);
12351
+ const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, ptr4(outBuffer), maxLength);
12275
12352
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12276
12353
  if (len === 0)
12277
12354
  return null;
@@ -12280,12 +12357,12 @@ class FFIRenderLib {
12280
12357
  editorViewGetCursor(view) {
12281
12358
  const row = new Uint32Array(1);
12282
12359
  const col = new Uint32Array(1);
12283
- this.opentui.symbols.editorViewGetCursor(view, ptr3(row), ptr3(col));
12360
+ this.opentui.symbols.editorViewGetCursor(view, ptr4(row), ptr4(col));
12284
12361
  return { row: row[0], col: col[0] };
12285
12362
  }
12286
12363
  editorViewGetText(view, maxLength) {
12287
12364
  const outBuffer = new Uint8Array(maxLength);
12288
- const actualLen = this.opentui.symbols.editorViewGetText(view, ptr3(outBuffer), maxLength);
12365
+ const actualLen = this.opentui.symbols.editorViewGetText(view, ptr4(outBuffer), maxLength);
12289
12366
  const len = typeof actualLen === "bigint" ? Number(actualLen) : actualLen;
12290
12367
  if (len === 0)
12291
12368
  return null;
@@ -12293,7 +12370,7 @@ class FFIRenderLib {
12293
12370
  }
12294
12371
  editorViewGetVisualCursor(view) {
12295
12372
  const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
12296
- this.opentui.symbols.editorViewGetVisualCursor(view, ptr3(cursorBuffer));
12373
+ this.opentui.symbols.editorViewGetVisualCursor(view, ptr4(cursorBuffer));
12297
12374
  return VisualCursorStruct.unpack(cursorBuffer);
12298
12375
  }
12299
12376
  editorViewMoveUpVisual(view) {
@@ -12310,27 +12387,27 @@ class FFIRenderLib {
12310
12387
  }
12311
12388
  editorViewGetNextWordBoundary(view) {
12312
12389
  const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
12313
- this.opentui.symbols.editorViewGetNextWordBoundary(view, ptr3(cursorBuffer));
12390
+ this.opentui.symbols.editorViewGetNextWordBoundary(view, ptr4(cursorBuffer));
12314
12391
  return VisualCursorStruct.unpack(cursorBuffer);
12315
12392
  }
12316
12393
  editorViewGetPrevWordBoundary(view) {
12317
12394
  const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
12318
- this.opentui.symbols.editorViewGetPrevWordBoundary(view, ptr3(cursorBuffer));
12395
+ this.opentui.symbols.editorViewGetPrevWordBoundary(view, ptr4(cursorBuffer));
12319
12396
  return VisualCursorStruct.unpack(cursorBuffer);
12320
12397
  }
12321
12398
  editorViewGetEOL(view) {
12322
12399
  const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
12323
- this.opentui.symbols.editorViewGetEOL(view, ptr3(cursorBuffer));
12400
+ this.opentui.symbols.editorViewGetEOL(view, ptr4(cursorBuffer));
12324
12401
  return VisualCursorStruct.unpack(cursorBuffer);
12325
12402
  }
12326
12403
  editorViewGetVisualSOL(view) {
12327
12404
  const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
12328
- this.opentui.symbols.editorViewGetVisualSOL(view, ptr3(cursorBuffer));
12405
+ this.opentui.symbols.editorViewGetVisualSOL(view, ptr4(cursorBuffer));
12329
12406
  return VisualCursorStruct.unpack(cursorBuffer);
12330
12407
  }
12331
12408
  editorViewGetVisualEOL(view) {
12332
12409
  const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
12333
- this.opentui.symbols.editorViewGetVisualEOL(view, ptr3(cursorBuffer));
12410
+ this.opentui.symbols.editorViewGetVisualEOL(view, ptr4(cursorBuffer));
12334
12411
  return VisualCursorStruct.unpack(cursorBuffer);
12335
12412
  }
12336
12413
  bufferPushScissorRect(buffer, x, y, width, height) {
@@ -12356,7 +12433,7 @@ class FFIRenderLib {
12356
12433
  }
12357
12434
  getTerminalCapabilities(renderer) {
12358
12435
  const capsBuffer = new ArrayBuffer(TerminalCapabilitiesStruct.size);
12359
- this.opentui.symbols.getTerminalCapabilities(renderer, ptr3(capsBuffer));
12436
+ this.opentui.symbols.getTerminalCapabilities(renderer, ptr4(capsBuffer));
12360
12437
  const caps = TerminalCapabilitiesStruct.unpack(capsBuffer);
12361
12438
  return {
12362
12439
  kitty_keyboard: caps.kitty_keyboard,
@@ -12389,7 +12466,7 @@ class FFIRenderLib {
12389
12466
  const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
12390
12467
  const outPtrBuffer = new ArrayBuffer(8);
12391
12468
  const outLenBuffer = new ArrayBuffer(8);
12392
- const success = this.opentui.symbols.encodeUnicode(textBytes, textBytes.length, ptr3(outPtrBuffer), ptr3(outLenBuffer), widthMethodCode);
12469
+ const success = this.opentui.symbols.encodeUnicode(textBytes, textBytes.length, ptr4(outPtrBuffer), ptr4(outLenBuffer), widthMethodCode);
12393
12470
  if (!success) {
12394
12471
  return null;
12395
12472
  }
@@ -12443,7 +12520,7 @@ class FFIRenderLib {
12443
12520
  return;
12444
12521
  }
12445
12522
  const chunksBuffer = StyledChunkStruct.packList(nonEmptyChunks);
12446
- this.opentui.symbols.editorViewSetPlaceholderStyledText(view, ptr3(chunksBuffer), nonEmptyChunks.length);
12523
+ this.opentui.symbols.editorViewSetPlaceholderStyledText(view, ptr4(chunksBuffer), nonEmptyChunks.length);
12447
12524
  }
12448
12525
  editorViewSetTabIndicator(view, indicator) {
12449
12526
  this.opentui.symbols.editorViewSetTabIndicator(view, indicator);
@@ -12498,9 +12575,9 @@ class TextBuffer {
12498
12575
  _textBytes;
12499
12576
  _memId;
12500
12577
  _appendedChunks = [];
12501
- constructor(lib, ptr4) {
12578
+ constructor(lib, ptr5) {
12502
12579
  this.lib = lib;
12503
- this.bufferPtr = ptr4;
12580
+ this.bufferPtr = ptr5;
12504
12581
  }
12505
12582
  static create(widthMethod) {
12506
12583
  const lib = resolveRenderLib();
@@ -13597,7 +13674,16 @@ class Renderable extends BaseRenderable {
13597
13674
  return -1;
13598
13675
  }
13599
13676
  if (!this.renderableMapById.has(anchor.id)) {
13600
- throw new Error("Anchor does not exist");
13677
+ if (true) {
13678
+ console.warn(`Anchor with id ${anchor.id} does not exist within the parent ${this.id}, skipping insertBefore`);
13679
+ }
13680
+ return -1;
13681
+ }
13682
+ if (renderable === anchor || renderable.id === anchor.id) {
13683
+ if (true) {
13684
+ console.warn(`Anchor is the same as the node ${renderable.id} being inserted, skipping insertBefore`);
13685
+ }
13686
+ return -1;
13601
13687
  }
13602
13688
  if (renderable.parent === this) {
13603
13689
  this.yogaNode.removeChild(renderable.getLayoutNode());
@@ -15384,6 +15470,12 @@ registerEnvVar({
15384
15470
  type: "boolean",
15385
15471
  default: false
15386
15472
  });
15473
+ registerEnvVar({
15474
+ name: "OTUI_SHOW_STATS",
15475
+ description: "Show the debug overlay at startup.",
15476
+ type: "boolean",
15477
+ default: false
15478
+ });
15387
15479
  var KITTY_FLAG_DISAMBIGUATE = 1;
15388
15480
  var KITTY_FLAG_EVENT_TYPES = 2;
15389
15481
  var KITTY_FLAG_ALTERNATE_KEYS = 4;
@@ -15573,7 +15665,7 @@ class CliRenderer extends EventEmitter9 {
15573
15665
  frameCallbackTime: 0
15574
15666
  };
15575
15667
  debugOverlay = {
15576
- enabled: false,
15668
+ enabled: env.OTUI_SHOW_STATS,
15577
15669
  corner: 3 /* bottomRight */
15578
15670
  };
15579
15671
  _console;
@@ -15676,8 +15768,8 @@ Captured output:
15676
15768
  this.stdout = stdout;
15677
15769
  this.realStdoutWrite = stdout.write;
15678
15770
  this.lib = lib;
15679
- this._terminalWidth = stdout.columns;
15680
- this._terminalHeight = stdout.rows;
15771
+ this._terminalWidth = stdout.columns ?? width;
15772
+ this._terminalHeight = stdout.rows ?? height;
15681
15773
  this.width = width;
15682
15774
  this.height = height;
15683
15775
  this._useThread = config.useThread === undefined ? false : config.useThread;
@@ -15690,7 +15782,17 @@ Captured output:
15690
15782
  }
15691
15783
  this.rendererPtr = rendererPtr;
15692
15784
  this.exitOnCtrlC = config.exitOnCtrlC === undefined ? true : config.exitOnCtrlC;
15693
- this.exitSignals = config.exitSignals || ["SIGINT", "SIGTERM", "SIGQUIT", "SIGABRT"];
15785
+ this.exitSignals = config.exitSignals || [
15786
+ "SIGINT",
15787
+ "SIGTERM",
15788
+ "SIGQUIT",
15789
+ "SIGABRT",
15790
+ "SIGHUP",
15791
+ "SIGBREAK",
15792
+ "SIGPIPE",
15793
+ "SIGBUS",
15794
+ "SIGFPE"
15795
+ ];
15694
15796
  this.resizeDebounceDelay = config.debounceDelay || 100;
15695
15797
  this.targetFps = config.targetFps || 30;
15696
15798
  this.maxFps = config.maxFps || 60;
@@ -16054,6 +16156,14 @@ Captured output:
16054
16156
  this._terminalIsSetup = true;
16055
16157
  this.lib.setupTerminal(this.rendererPtr, this._useAlternateScreen);
16056
16158
  this._capabilities = this.lib.getTerminalCapabilities(this.rendererPtr);
16159
+ if (this.debugOverlay.enabled) {
16160
+ this.lib.setDebugOverlay(this.rendererPtr, true, this.debugOverlay.corner);
16161
+ if (!this.memorySnapshotInterval) {
16162
+ this.memorySnapshotInterval = 3000;
16163
+ this.startMemorySnapshotTimer();
16164
+ this.automaticMemorySnapshot = true;
16165
+ }
16166
+ }
16057
16167
  this.capabilityTimeoutId = setTimeout(() => {
16058
16168
  this.capabilityTimeoutId = null;
16059
16169
  this.removeInputHandler(this.capabilityHandler);
@@ -16919,7 +17029,7 @@ Captured output:
16919
17029
  }
16920
17030
  }
16921
17031
 
16922
- export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, ANSI, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingKey, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
17032
+ export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_src, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, ANSI, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingKey, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
16923
17033
 
16924
- //# debugId=05C4F9CE87D8078064756E2164756E21
16925
- //# sourceMappingURL=index-93qf6w1k.js.map
17034
+ //# debugId=0B8B9687B31D4D6F64756E2164756E21
17035
+ //# sourceMappingURL=index-s0q9547t.js.map