@jujulego/jill 3.0.9 → 3.0.10

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.
package/dist/inked.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"jill@3.0.9"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6ac51a05-f5d9-4c77-8c3a-fee33218a89f",e._sentryDebugIdIdentifier="sentry-dbid-6ac51a05-f5d9-4c77-8c3a-fee33218a89f");}catch(e){}}();import { startSpan, metrics } from '@sentry/node';
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"jill@3.0.10"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a306d0f2-95a8-40bb-9d85-07046f9917f4",e._sentryDebugIdIdentifier="sentry-dbid-a306d0f2-95a8-40bb-9d85-07046f9917f4");}catch(e){}}();import { startSpan, metrics } from '@sentry/node';
2
2
  import { PassThrough, Stream } from 'node:stream';
3
3
  import process$1, { env, cwd } from 'node:process';
4
4
  import { g as getDefaultExportFromCjs, d as commonjsGlobal, e as chalk, i as inject$, L as LogGateway, h as observer$, l as logFormat } from './main.js';
@@ -407,7 +407,7 @@ function requireReact_production() {
407
407
  react_production.useTransition = function() {
408
408
  return ReactSharedInternals.H.useTransition();
409
409
  };
410
- react_production.version = "19.2.5";
410
+ react_production.version = "19.2.7";
411
411
  return react_production;
412
412
  }
413
413
 
@@ -3426,7 +3426,9 @@ Logic:
3426
3426
  1. Skip non-printing clusters (Default_Ignorable, Control, pure Mark, lone Surrogates). Tabs are ignored by design.
3427
3427
  2. RGI emoji clusters (\p{RGI_Emoji}) are double-width.
3428
3428
  3. Minimally-qualified/unqualified emoji clusters (ZWJ sequences with 2+ Extended_Pictographic, or keycap sequences) are double-width.
3429
- 4. Otherwise use East Asian Width of the cluster's first visible code point, and add widths for trailing Halfwidth/Fullwidth Forms within the same cluster (e.g., dakuten/handakuten/prolonged sound mark).
3429
+ 4. Hangul jamo collapse each standard modern Hangul L+V or L+V+T syllable piece to width 2.
3430
+ Unmatched repeated leading/vowel/trailing jamo stay additive because that matches how the terminals we target render them.
3431
+ 5. Otherwise use East Asian Width of the cluster's first visible code point, and add widths for trailing Halfwidth/Fullwidth Forms within the same cluster (e.g., dakuten/handakuten/prolonged sound mark).
3430
3432
  */ const segmenter$2 = new Intl.Segmenter();
3431
3433
  // Whole-cluster zero-width
3432
3434
  const zeroWidthClusterRegex = /^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v;
@@ -3458,13 +3460,63 @@ function baseVisible(segment) {
3458
3460
  function isZeroWidthCluster(segment) {
3459
3461
  return zeroWidthClusterRegex.test(segment);
3460
3462
  }
3461
- function trailingHalfwidthWidth(segment, eastAsianWidthOptions) {
3462
- let extra = 0;
3463
- if (segment.length > 1) {
3464
- for (const char of segment.slice(1)){
3465
- if (char >= '\uFF00' && char <= '\uFFEF') {
3466
- extra += eastAsianWidth(char.codePointAt(0), eastAsianWidthOptions);
3463
+ function isHangulLeadingJamo(codePoint) {
3464
+ return codePoint >= 0x1100 && codePoint <= 0x115F || codePoint >= 0xA960 && codePoint <= 0xA97C;
3465
+ }
3466
+ function isHangulVowelJamo(codePoint) {
3467
+ return codePoint >= 0x1160 && codePoint <= 0x11A7 || codePoint >= 0xD7B0 && codePoint <= 0xD7C6;
3468
+ }
3469
+ function isHangulTrailingJamo(codePoint) {
3470
+ return codePoint >= 0x11A8 && codePoint <= 0x11FF || codePoint >= 0xD7CB && codePoint <= 0xD7FB;
3471
+ }
3472
+ function isHangulJamo(codePoint) {
3473
+ return isHangulLeadingJamo(codePoint) || isHangulVowelJamo(codePoint) || isHangulTrailingJamo(codePoint);
3474
+ }
3475
+ function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
3476
+ const codePoints = [];
3477
+ for (const character of visibleSegment){
3478
+ if (zeroWidthClusterRegex.test(character)) {
3479
+ continue;
3480
+ }
3481
+ codePoints.push(character.codePointAt(0));
3482
+ }
3483
+ if (codePoints.length === 0) {
3484
+ return undefined;
3485
+ }
3486
+ let width = 0;
3487
+ for(let index = 0; index < codePoints.length; index++){
3488
+ const codePoint = codePoints[index];
3489
+ if (!isHangulJamo(codePoint)) {
3490
+ if (width === 0) {
3491
+ return undefined;
3492
+ }
3493
+ // Mixed cluster (e.g., L + precomposed syllable): use EAW for non-jamo remainder
3494
+ for(let remaining = index; remaining < codePoints.length; remaining++){
3495
+ width += eastAsianWidth(codePoints[remaining], eastAsianWidthOptions);
3467
3496
  }
3497
+ return width;
3498
+ }
3499
+ // Modern Hangul L+V(+T) shapes as one syllable block. Unmatched jamo stay additive:
3500
+ // U+1100 U+1100 U+1161 => U+1100 + (U+1100 U+1161) => 2 + 2.
3501
+ if (isHangulLeadingJamo(codePoint) && isHangulVowelJamo(codePoints[index + 1])) {
3502
+ width += 2;
3503
+ index += isHangulTrailingJamo(codePoints[index + 2]) ? 2 : 1;
3504
+ continue;
3505
+ }
3506
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
3507
+ }
3508
+ return width;
3509
+ }
3510
+ function trailingHalfwidthWidth(visibleSegment, eastAsianWidthOptions) {
3511
+ let extra = 0;
3512
+ let first = true;
3513
+ for (const character of visibleSegment){
3514
+ if (first) {
3515
+ first = false;
3516
+ continue;
3517
+ }
3518
+ if (character >= '\uFF00' && character <= '\uFFEF') {
3519
+ extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
3468
3520
  }
3469
3521
  }
3470
3522
  return extra;
@@ -3500,11 +3552,17 @@ function stringWidth(input, options = {}) {
3500
3552
  width += 2;
3501
3553
  continue;
3502
3554
  }
3555
+ const visibleSegment = baseVisible(segment);
3556
+ const hangulWidth = hangulClusterWidth(visibleSegment, eastAsianWidthOptions);
3557
+ if (hangulWidth !== undefined) {
3558
+ width += hangulWidth;
3559
+ continue;
3560
+ }
3503
3561
  // Everything else: EAW of the cluster’s first visible scalar
3504
- const codePoint = baseVisible(segment).codePointAt(0);
3562
+ const codePoint = visibleSegment.codePointAt(0);
3505
3563
  width += eastAsianWidth(codePoint, eastAsianWidthOptions);
3506
3564
  // Add width for trailing Halfwidth and Fullwidth Forms (e.g., ゙, ゚, ー)
3507
- width += trailingHalfwidthWidth(segment, eastAsianWidthOptions);
3565
+ width += trailingHalfwidthWidth(visibleSegment, eastAsianWidthOptions);
3508
3566
  }
3509
3567
  return width;
3510
3568
  }
@@ -4383,7 +4441,7 @@ var hasRequiredScheduler_production;
4383
4441
  function requireScheduler_production() {
4384
4442
  if (hasRequiredScheduler_production) return scheduler_production;
4385
4443
  hasRequiredScheduler_production = 1;
4386
- (function(exports$1) {
4444
+ (function(exports) {
4387
4445
  function push(heap, node) {
4388
4446
  var index = heap.length;
4389
4447
  heap.push(node);
@@ -4414,15 +4472,15 @@ function requireScheduler_production() {
4414
4472
  var diff = a.sortIndex - b.sortIndex;
4415
4473
  return 0 !== diff ? diff : a.id - b.id;
4416
4474
  }
4417
- exports$1.unstable_now = void 0;
4475
+ exports.unstable_now = void 0;
4418
4476
  if ("object" === typeof performance && "function" === typeof performance.now) {
4419
4477
  var localPerformance = performance;
4420
- exports$1.unstable_now = function() {
4478
+ exports.unstable_now = function() {
4421
4479
  return localPerformance.now();
4422
4480
  };
4423
4481
  } else {
4424
4482
  var localDate = Date, initialTime = localDate.now();
4425
- exports$1.unstable_now = function() {
4483
+ exports.unstable_now = function() {
4426
4484
  return localDate.now() - initialTime;
4427
4485
  };
4428
4486
  }
@@ -4446,12 +4504,12 @@ function requireScheduler_production() {
4446
4504
  }
4447
4505
  var isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1;
4448
4506
  function shouldYieldToHost() {
4449
- return needsPaint ? true : exports$1.unstable_now() - startTime < frameInterval ? false : true;
4507
+ return needsPaint ? true : exports.unstable_now() - startTime < frameInterval ? false : true;
4450
4508
  }
4451
4509
  function performWorkUntilDeadline() {
4452
4510
  needsPaint = false;
4453
4511
  if (isMessageLoopRunning) {
4454
- var currentTime = exports$1.unstable_now();
4512
+ var currentTime = exports.unstable_now();
4455
4513
  startTime = currentTime;
4456
4514
  var hasMoreWork = true;
4457
4515
  try {
@@ -4469,7 +4527,7 @@ function requireScheduler_production() {
4469
4527
  currentTask.callback = null;
4470
4528
  currentPriorityLevel = currentTask.priorityLevel;
4471
4529
  var continuationCallback = callback(currentTask.expirationTime <= currentTime);
4472
- currentTime = exports$1.unstable_now();
4530
+ currentTime = exports.unstable_now();
4473
4531
  if ("function" === typeof continuationCallback) {
4474
4532
  currentTask.callback = continuationCallback;
4475
4533
  advanceTimers(currentTime);
@@ -4514,25 +4572,25 @@ function requireScheduler_production() {
4514
4572
  };
4515
4573
  function requestHostTimeout(callback, ms) {
4516
4574
  taskTimeoutID = localSetTimeout(function() {
4517
- callback(exports$1.unstable_now());
4575
+ callback(exports.unstable_now());
4518
4576
  }, ms);
4519
4577
  }
4520
- exports$1.unstable_IdlePriority = 5;
4521
- exports$1.unstable_ImmediatePriority = 1;
4522
- exports$1.unstable_LowPriority = 4;
4523
- exports$1.unstable_NormalPriority = 3;
4524
- exports$1.unstable_Profiling = null;
4525
- exports$1.unstable_UserBlockingPriority = 2;
4526
- exports$1.unstable_cancelCallback = function(task) {
4578
+ exports.unstable_IdlePriority = 5;
4579
+ exports.unstable_ImmediatePriority = 1;
4580
+ exports.unstable_LowPriority = 4;
4581
+ exports.unstable_NormalPriority = 3;
4582
+ exports.unstable_Profiling = null;
4583
+ exports.unstable_UserBlockingPriority = 2;
4584
+ exports.unstable_cancelCallback = function(task) {
4527
4585
  task.callback = null;
4528
4586
  };
4529
- exports$1.unstable_forceFrameRate = function(fps) {
4587
+ exports.unstable_forceFrameRate = function(fps) {
4530
4588
  0 > fps || 125 < fps ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5;
4531
4589
  };
4532
- exports$1.unstable_getCurrentPriorityLevel = function() {
4590
+ exports.unstable_getCurrentPriorityLevel = function() {
4533
4591
  return currentPriorityLevel;
4534
4592
  };
4535
- exports$1.unstable_next = function(eventHandler) {
4593
+ exports.unstable_next = function(eventHandler) {
4536
4594
  switch(currentPriorityLevel){
4537
4595
  case 1:
4538
4596
  case 2:
@@ -4550,10 +4608,10 @@ function requireScheduler_production() {
4550
4608
  currentPriorityLevel = previousPriorityLevel;
4551
4609
  }
4552
4610
  };
4553
- exports$1.unstable_requestPaint = function() {
4611
+ exports.unstable_requestPaint = function() {
4554
4612
  needsPaint = true;
4555
4613
  };
4556
- exports$1.unstable_runWithPriority = function(priorityLevel, eventHandler) {
4614
+ exports.unstable_runWithPriority = function(priorityLevel, eventHandler) {
4557
4615
  switch(priorityLevel){
4558
4616
  case 1:
4559
4617
  case 2:
@@ -4572,8 +4630,8 @@ function requireScheduler_production() {
4572
4630
  currentPriorityLevel = previousPriorityLevel;
4573
4631
  }
4574
4632
  };
4575
- exports$1.unstable_scheduleCallback = function(priorityLevel, callback, options) {
4576
- var currentTime = exports$1.unstable_now();
4633
+ exports.unstable_scheduleCallback = function(priorityLevel, callback, options) {
4634
+ var currentTime = exports.unstable_now();
4577
4635
  "object" === typeof options && null !== options ? (options = options.delay, options = "number" === typeof options && 0 < options ? currentTime + options : currentTime) : options = currentTime;
4578
4636
  switch(priorityLevel){
4579
4637
  case 1:
@@ -4603,8 +4661,8 @@ function requireScheduler_production() {
4603
4661
  options > currentTime ? (priorityLevel.sortIndex = options, push(timerQueue, priorityLevel), null === peek(taskQueue) && priorityLevel === peek(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options - currentTime))) : (priorityLevel.sortIndex = timeout, push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline())));
4604
4662
  return priorityLevel;
4605
4663
  };
4606
- exports$1.unstable_shouldYield = shouldYieldToHost;
4607
- exports$1.unstable_wrapCallback = function(callback) {
4664
+ exports.unstable_shouldYield = shouldYieldToHost;
4665
+ exports.unstable_wrapCallback = function(callback) {
4608
4666
  var parentPriorityLevel = currentPriorityLevel;
4609
4667
  return function() {
4610
4668
  var previousPriorityLevel = currentPriorityLevel;
@@ -10383,7 +10441,7 @@ function requireReactReconciler_production() {
10383
10441
  markRetryLaneImpl(fiber, retryLane);
10384
10442
  (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
10385
10443
  }
10386
- var exports$1 = {};
10444
+ var exports = {};
10387
10445
  var React = requireReact(), Scheduler = requireScheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
10388
10446
  var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
10389
10447
  var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
@@ -10813,14 +10871,14 @@ function requireReactReconciler_production() {
10813
10871
  TEXT_TYPE = symbolFor("selector.text");
10814
10872
  }
10815
10873
  var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, workInProgressRootDidSkipSuspendedSiblings = false, workInProgressRootIsPrerendering = false, workInProgressRootDidAttachPingListener = false, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, workInProgressRootSkippedLanes = 0, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = false, globalMostRecentFallbackTime = 0, globalMostRecentTransitionTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, pendingEffectsStatus = 0, pendingEffectsRoot = null, pendingFinishedWork = null, pendingEffectsLanes = 0, pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, pendingRecoverableErrors = null, nestedUpdateCount = 0, rootWithNestedUpdates = null;
10816
- exports$1.attemptContinuousHydration = function(fiber) {
10874
+ exports.attemptContinuousHydration = function(fiber) {
10817
10875
  if (13 === fiber.tag || 31 === fiber.tag) {
10818
10876
  var root = enqueueConcurrentRenderForLane(fiber, 67108864);
10819
10877
  null !== root && scheduleUpdateOnFiber(root, fiber, 67108864);
10820
10878
  markRetryLaneIfNotHydrated(fiber, 67108864);
10821
10879
  }
10822
10880
  };
10823
- exports$1.attemptHydrationAtCurrentPriority = function(fiber) {
10881
+ exports.attemptHydrationAtCurrentPriority = function(fiber) {
10824
10882
  if (13 === fiber.tag || 31 === fiber.tag) {
10825
10883
  var lane = requestUpdateLane();
10826
10884
  lane = getBumpedLaneForHydrationByLane(lane);
@@ -10829,7 +10887,7 @@ function requireReactReconciler_production() {
10829
10887
  markRetryLaneIfNotHydrated(fiber, lane);
10830
10888
  }
10831
10889
  };
10832
- exports$1.attemptSynchronousHydration = function(fiber) {
10890
+ exports.attemptSynchronousHydration = function(fiber) {
10833
10891
  switch(fiber.tag){
10834
10892
  case 3:
10835
10893
  fiber = fiber.stateNode;
@@ -10852,25 +10910,25 @@ function requireReactReconciler_production() {
10852
10910
  lanes = enqueueConcurrentRenderForLane(fiber, 2), null !== lanes && scheduleUpdateOnFiber(lanes, fiber, 2), flushSyncWork(), markRetryLaneIfNotHydrated(fiber, 2);
10853
10911
  }
10854
10912
  };
10855
- exports$1.batchedUpdates = function(fn, a) {
10913
+ exports.batchedUpdates = function(fn, a) {
10856
10914
  return fn(a);
10857
10915
  };
10858
- exports$1.createComponentSelector = function(component) {
10916
+ exports.createComponentSelector = function(component) {
10859
10917
  return {
10860
10918
  $$typeof: COMPONENT_TYPE,
10861
10919
  value: component
10862
10920
  };
10863
10921
  };
10864
- exports$1.createContainer = function(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator) {
10922
+ exports.createContainer = function(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator) {
10865
10923
  return createFiberRoot(containerInfo, tag, false, null, hydrationCallbacks, isStrictMode, identifierPrefix, null, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator);
10866
10924
  };
10867
- exports$1.createHasPseudoClassSelector = function(selectors) {
10925
+ exports.createHasPseudoClassSelector = function(selectors) {
10868
10926
  return {
10869
10927
  $$typeof: HAS_PSEUDO_CLASS_TYPE,
10870
10928
  value: selectors
10871
10929
  };
10872
10930
  };
10873
- exports$1.createHydrationContainer = function(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator, transitionCallbacks, formState) {
10931
+ exports.createHydrationContainer = function(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator, transitionCallbacks, formState) {
10874
10932
  initialChildren = createFiberRoot(containerInfo, tag, true, initialChildren, hydrationCallbacks, isStrictMode, identifierPrefix, formState, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator);
10875
10933
  initialChildren.context = getContextForSubtree(null);
10876
10934
  containerInfo = initialChildren.current;
@@ -10885,7 +10943,7 @@ function requireReactReconciler_production() {
10885
10943
  ensureRootIsScheduled(initialChildren);
10886
10944
  return initialChildren;
10887
10945
  };
10888
- exports$1.createPortal = function(children, containerInfo, implementation) {
10946
+ exports.createPortal = function(children, containerInfo, implementation) {
10889
10947
  var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
10890
10948
  return {
10891
10949
  $$typeof: REACT_PORTAL_TYPE,
@@ -10895,34 +10953,34 @@ function requireReactReconciler_production() {
10895
10953
  implementation: implementation
10896
10954
  };
10897
10955
  };
10898
- exports$1.createRoleSelector = function(role) {
10956
+ exports.createRoleSelector = function(role) {
10899
10957
  return {
10900
10958
  $$typeof: ROLE_TYPE,
10901
10959
  value: role
10902
10960
  };
10903
10961
  };
10904
- exports$1.createTestNameSelector = function(id) {
10962
+ exports.createTestNameSelector = function(id) {
10905
10963
  return {
10906
10964
  $$typeof: TEST_NAME_TYPE,
10907
10965
  value: id
10908
10966
  };
10909
10967
  };
10910
- exports$1.createTextSelector = function(text) {
10968
+ exports.createTextSelector = function(text) {
10911
10969
  return {
10912
10970
  $$typeof: TEXT_TYPE,
10913
10971
  value: text
10914
10972
  };
10915
10973
  };
10916
- exports$1.defaultOnCaughtError = function(error) {
10974
+ exports.defaultOnCaughtError = function(error) {
10917
10975
  console.error(error);
10918
10976
  };
10919
- exports$1.defaultOnRecoverableError = function(error) {
10977
+ exports.defaultOnRecoverableError = function(error) {
10920
10978
  reportGlobalError(error);
10921
10979
  };
10922
- exports$1.defaultOnUncaughtError = function(error) {
10980
+ exports.defaultOnUncaughtError = function(error) {
10923
10981
  reportGlobalError(error);
10924
10982
  };
10925
- exports$1.deferredUpdates = function(fn) {
10983
+ exports.deferredUpdates = function(fn) {
10926
10984
  var prevTransition = ReactSharedInternals.T, previousPriority = getCurrentUpdatePriority();
10927
10985
  try {
10928
10986
  return setCurrentUpdatePriority(32), ReactSharedInternals.T = null, fn();
@@ -10930,7 +10988,7 @@ function requireReactReconciler_production() {
10930
10988
  setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition;
10931
10989
  }
10932
10990
  };
10933
- exports$1.discreteUpdates = function(fn, a, b, c, d) {
10991
+ exports.discreteUpdates = function(fn, a, b, c, d) {
10934
10992
  var prevTransition = ReactSharedInternals.T, previousPriority = getCurrentUpdatePriority();
10935
10993
  try {
10936
10994
  return setCurrentUpdatePriority(2), ReactSharedInternals.T = null, fn(a, b, c, d);
@@ -10938,8 +10996,8 @@ function requireReactReconciler_production() {
10938
10996
  setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition, 0 === executionContext && (workInProgressRootRenderTargetTime = now() + 500);
10939
10997
  }
10940
10998
  };
10941
- exports$1.findAllNodes = findAllNodes;
10942
- exports$1.findBoundingRects = function(hostRoot, selectors) {
10999
+ exports.findAllNodes = findAllNodes;
11000
+ exports.findBoundingRects = function(hostRoot, selectors) {
10943
11001
  if (!supportsTestSelectors) throw Error(formatProdErrorMessage(363));
10944
11002
  selectors = findAllNodes(hostRoot, selectors);
10945
11003
  hostRoot = [];
@@ -10966,17 +11024,17 @@ function requireReactReconciler_production() {
10966
11024
  }
10967
11025
  return hostRoot;
10968
11026
  };
10969
- exports$1.findHostInstance = findHostInstance;
10970
- exports$1.findHostInstanceWithNoPortals = function(fiber) {
11027
+ exports.findHostInstance = findHostInstance;
11028
+ exports.findHostInstanceWithNoPortals = function(fiber) {
10971
11029
  fiber = findCurrentFiberUsingSlowPath(fiber);
10972
11030
  fiber = null !== fiber ? findCurrentHostFiberWithNoPortalsImpl(fiber) : null;
10973
11031
  return null === fiber ? null : getPublicInstance(fiber.stateNode);
10974
11032
  };
10975
- exports$1.findHostInstanceWithWarning = function(component) {
11033
+ exports.findHostInstanceWithWarning = function(component) {
10976
11034
  return findHostInstance(component);
10977
11035
  };
10978
- exports$1.flushPassiveEffects = flushPendingEffects;
10979
- exports$1.flushSyncFromReconciler = function(fn) {
11036
+ exports.flushPassiveEffects = flushPendingEffects;
11037
+ exports.flushSyncFromReconciler = function(fn) {
10980
11038
  var prevExecutionContext = executionContext;
10981
11039
  executionContext |= 1;
10982
11040
  var prevTransition = ReactSharedInternals.T, previousPriority = getCurrentUpdatePriority();
@@ -10986,8 +11044,8 @@ function requireReactReconciler_production() {
10986
11044
  setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition, executionContext = prevExecutionContext, 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(0);
10987
11045
  }
10988
11046
  };
10989
- exports$1.flushSyncWork = flushSyncWork;
10990
- exports$1.focusWithin = function(hostRoot, selectors) {
11047
+ exports.flushSyncWork = flushSyncWork;
11048
+ exports.focusWithin = function(hostRoot, selectors) {
10991
11049
  if (!supportsTestSelectors) throw Error(formatProdErrorMessage(363));
10992
11050
  hostRoot = findFiberRootForHostRoot(hostRoot);
10993
11051
  selectors = findPaths(hostRoot, selectors);
@@ -11001,7 +11059,7 @@ function requireReactReconciler_production() {
11001
11059
  }
11002
11060
  return false;
11003
11061
  };
11004
- exports$1.getFindAllNodesFailureDescription = function(hostRoot, selectors) {
11062
+ exports.getFindAllNodesFailureDescription = function(hostRoot, selectors) {
11005
11063
  if (!supportsTestSelectors) throw Error(formatProdErrorMessage(363));
11006
11064
  var maxSelectorIndex = 0, matchedNames = [];
11007
11065
  hostRoot = [
@@ -11020,7 +11078,7 @@ function requireReactReconciler_production() {
11020
11078
  }
11021
11079
  return null;
11022
11080
  };
11023
- exports$1.getPublicRootInstance = function(container) {
11081
+ exports.getPublicRootInstance = function(container) {
11024
11082
  container = container.current;
11025
11083
  if (!container.child) return null;
11026
11084
  switch(container.child.tag){
@@ -11031,7 +11089,7 @@ function requireReactReconciler_production() {
11031
11089
  return container.child.stateNode;
11032
11090
  }
11033
11091
  };
11034
- exports$1.injectIntoDevTools = function() {
11092
+ exports.injectIntoDevTools = function() {
11035
11093
  var internals = {
11036
11094
  bundleType: 0,
11037
11095
  version: rendererVersion,
@@ -11053,10 +11111,10 @@ function requireReactReconciler_production() {
11053
11111
  }
11054
11112
  return internals;
11055
11113
  };
11056
- exports$1.isAlreadyRendering = function() {
11114
+ exports.isAlreadyRendering = function() {
11057
11115
  return 0 !== (executionContext & 6);
11058
11116
  };
11059
- exports$1.observeVisibleRects = function(hostRoot, selectors, callback, options) {
11117
+ exports.observeVisibleRects = function(hostRoot, selectors, callback, options) {
11060
11118
  if (!supportsTestSelectors) throw Error(formatProdErrorMessage(363));
11061
11119
  hostRoot = findAllNodes(hostRoot, selectors);
11062
11120
  var disconnect = setupIntersectionObserver(hostRoot, callback, options).disconnect;
@@ -11066,13 +11124,13 @@ function requireReactReconciler_production() {
11066
11124
  }
11067
11125
  };
11068
11126
  };
11069
- exports$1.shouldError = function() {
11127
+ exports.shouldError = function() {
11070
11128
  return null;
11071
11129
  };
11072
- exports$1.shouldSuspend = function() {
11130
+ exports.shouldSuspend = function() {
11073
11131
  return false;
11074
11132
  };
11075
- exports$1.startHostTransition = function(formFiber, pendingState, action, formData) {
11133
+ exports.startHostTransition = function(formFiber, pendingState, action, formData) {
11076
11134
  if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
11077
11135
  var queue = ensureFormComponentIsStateful(formFiber).queue;
11078
11136
  startTransition(formFiber, queue, pendingState, NotPendingTransition, null === action ? noop : function() {
@@ -11082,16 +11140,16 @@ function requireReactReconciler_production() {
11082
11140
  return action(formData);
11083
11141
  });
11084
11142
  };
11085
- exports$1.updateContainer = function(element, container, parentComponent, callback) {
11143
+ exports.updateContainer = function(element, container, parentComponent, callback) {
11086
11144
  var current = container.current, lane = requestUpdateLane();
11087
11145
  updateContainerImpl(current, lane, element, container, parentComponent, callback);
11088
11146
  return lane;
11089
11147
  };
11090
- exports$1.updateContainerSync = function(element, container, parentComponent, callback) {
11148
+ exports.updateContainerSync = function(element, container, parentComponent, callback) {
11091
11149
  updateContainerImpl(container.current, 2, element, container, parentComponent, callback);
11092
11150
  return 2;
11093
11151
  };
11094
- return exports$1;
11152
+ return exports;
11095
11153
  };
11096
11154
  module.exports.default = module.exports;
11097
11155
  Object.defineProperty(module.exports, "__esModule", {
@@ -13109,6 +13167,14 @@ var reconciler = createReconciler({
13109
13167
  rootNode.onComputeLayout();
13110
13168
  }
13111
13169
  emitLayoutListeners(rootNode);
13170
+ /*
13171
+ Fire `onStaticChange` BEFORE `onImmediateRender` so ink resets accumulated static output before the new instance emits. Without this, items from a replaced/removed <Static> stay in `fullStaticOutput` and get replayed on rewrites.
13172
+ */ if (rootNode.staticNode !== rootNode.previousStaticNode) {
13173
+ rootNode.previousStaticNode = rootNode.staticNode;
13174
+ if (typeof rootNode.onStaticChange === 'function') {
13175
+ rootNode.onStaticChange();
13176
+ }
13177
+ }
13112
13178
  // Since renders are throttled at the instance level and <Static> component children
13113
13179
  // are rendered only once and then get deleted, we need an escape hatch to
13114
13180
  // trigger an immediate render to ensure <Static> children are written to output before they get erased
@@ -13220,7 +13286,8 @@ var reconciler = createReconciler({
13220
13286
  removeChildFromContainer (node, removeNode) {
13221
13287
  removeChildNode(node, removeNode);
13222
13288
  cleanupYogaNode(removeNode.yogaNode);
13223
- if (removeNode.internal_static && currentRootNode) {
13289
+ // Only clear staticNode if it still points at the removed node. On key-driven remounts, `createInstance` already registered the new node before this removal fires.
13290
+ if (removeNode.internal_static && currentRootNode?.staticNode === removeNode) {
13224
13291
  currentRootNode.staticNode = undefined;
13225
13292
  }
13226
13293
  },
@@ -13260,7 +13327,8 @@ var reconciler = createReconciler({
13260
13327
  removeChild (node, removeNode) {
13261
13328
  removeChildNode(node, removeNode);
13262
13329
  cleanupYogaNode(removeNode.yogaNode);
13263
- if (removeNode.internal_static && currentRootNode) {
13330
+ // Same guard as removeChildFromContainer: only clear if this is still the active static node.
13331
+ if (removeNode.internal_static && currentRootNode?.staticNode === removeNode) {
13264
13332
  currentRootNode.staticNode = undefined;
13265
13333
  }
13266
13334
  },
@@ -14897,11 +14965,13 @@ const createInputParser = ()=>{
14897
14965
 
14898
14966
  /**
14899
14967
  `AppContext` is a React context that exposes lifecycle methods for the app.
14900
- */ // eslint-disable-next-line @typescript-eslint/naming-convention
14901
- const AppContext = /*#__PURE__*/ reactExports.createContext({
14902
- exit () {},
14968
+ */ // Keep the default value typed so `useApp()` preserves the public `exit(errorOrResult?)` signature.
14969
+ const defaultValue = {
14970
+ exit (_errorOrResult) {},
14903
14971
  async waitUntilRenderFlush () {}
14904
- });
14972
+ };
14973
+ // eslint-disable-next-line @typescript-eslint/naming-convention
14974
+ const AppContext = /*#__PURE__*/ reactExports.createContext(defaultValue);
14905
14975
  AppContext.displayName = 'InternalAppContext';
14906
14976
 
14907
14977
  /**
@@ -15392,6 +15462,7 @@ function ErrorOverview({ error }) {
15392
15462
  const filePath = cleanupPath(origin?.file);
15393
15463
  let excerpt;
15394
15464
  let lineWidth = 0;
15465
+ const stackLineCounts = new Map();
15395
15466
  if (filePath && origin?.line && fs.existsSync(filePath)) {
15396
15467
  const sourceCode = fs.readFileSync(filePath, 'utf8');
15397
15468
  excerpt = codeExcerpt(sourceCode, origin.line);
@@ -15432,10 +15503,15 @@ function ErrorOverview({ error }) {
15432
15503
  flexDirection: "column"
15433
15504
  }, error.stack.split('\n').slice(1).map((line)=>{
15434
15505
  const parsedLine = stackUtils.parseLine(line);
15435
- // If the line from the stack cannot be parsed, we print out the unparsed line.
15436
- if (!parsedLine) {
15506
+ const lineCount = stackLineCounts.get(line) ?? 0;
15507
+ stackLineCounts.set(line, lineCount + 1);
15508
+ const key = `${line}-${lineCount}`;
15509
+ // If the line from the stack cannot be parsed, or parsed into an incomplete
15510
+ // frame without source location data (for example, "at native"), we print
15511
+ // out the unparsed line.
15512
+ if (!parsedLine?.file || !parsedLine.line || !parsedLine.column) {
15437
15513
  return /*#__PURE__*/ React.createElement(Box, {
15438
- key: line
15514
+ key: key
15439
15515
  }, /*#__PURE__*/ React.createElement(Text, {
15440
15516
  dimColor: true
15441
15517
  }, "- "), /*#__PURE__*/ React.createElement(Text, {
@@ -15444,7 +15520,7 @@ function ErrorOverview({ error }) {
15444
15520
  }, line, "\\t", ' '));
15445
15521
  }
15446
15522
  return /*#__PURE__*/ React.createElement(Box, {
15447
- key: line
15523
+ key: key
15448
15524
  }, /*#__PURE__*/ React.createElement(Text, {
15449
15525
  dimColor: true
15450
15526
  }, "- "), /*#__PURE__*/ React.createElement(Text, {
@@ -15502,6 +15578,7 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
15502
15578
  // Count how many components enabled raw mode to avoid disabling
15503
15579
  // raw mode until all components don't need it anymore
15504
15580
  const rawModeEnabledCount = reactExports.useRef(0);
15581
+ const pendingDisableRawModeRef = reactExports.useRef(false);
15505
15582
  // Count how many components enabled bracketed paste mode
15506
15583
  const bracketedPasteModeEnabledCount = reactExports.useRef(0);
15507
15584
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -15605,20 +15682,26 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
15605
15682
  }, [
15606
15683
  stdin
15607
15684
  ]);
15685
+ const clearInputState = reactExports.useCallback(()=>{
15686
+ inputParserRef.current.reset();
15687
+ clearPendingInputFlush();
15688
+ detachReadableListener();
15689
+ }, [
15690
+ clearPendingInputFlush,
15691
+ detachReadableListener
15692
+ ]);
15608
15693
  const disableRawMode = reactExports.useCallback(()=>{
15694
+ pendingDisableRawModeRef.current = false;
15609
15695
  stdin.setRawMode(false);
15610
- detachReadableListener();
15611
15696
  stdin.unref();
15612
15697
  rawModeEnabledCount.current = 0;
15613
- inputParserRef.current.reset();
15614
- clearPendingInputFlush();
15698
+ clearInputState();
15615
15699
  }, [
15616
15700
  stdin,
15617
- detachReadableListener,
15618
- clearPendingInputFlush
15701
+ clearInputState
15619
15702
  ]);
15620
15703
  const handleExit = reactExports.useCallback((errorOrResult)=>{
15621
- if (isRawModeSupported && rawModeEnabledCount.current > 0) {
15704
+ if (isRawModeSupported && (rawModeEnabledCount.current > 0 || pendingDisableRawModeRef.current)) {
15622
15705
  disableRawMode();
15623
15706
  }
15624
15707
  onExit(errorOrResult);
@@ -15635,12 +15718,13 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
15635
15718
  return;
15636
15719
  }
15637
15720
  // Reset focus when there's an active focused component on Esc
15638
- if (input === escape) {
15721
+ if (input === escape && isFocusEnabled) {
15639
15722
  setActiveFocusId(undefined);
15640
15723
  }
15641
15724
  }, [
15642
15725
  exitOnCtrlC,
15643
- handleExit
15726
+ handleExit,
15727
+ isFocusEnabled
15644
15728
  ]);
15645
15729
  const emitInput = reactExports.useCallback((input)=>{
15646
15730
  handleInput(input);
@@ -15691,6 +15775,17 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
15691
15775
  clearPendingInputFlush,
15692
15776
  schedulePendingInputFlush
15693
15777
  ]);
15778
+ const attachReadableListener = reactExports.useCallback(()=>{
15779
+ if (readableListenerRef.current) {
15780
+ return;
15781
+ }
15782
+ // Store the listener reference to avoid stale closure when removing
15783
+ readableListenerRef.current = handleReadable;
15784
+ stdin.addListener('readable', handleReadable);
15785
+ }, [
15786
+ stdin,
15787
+ handleReadable
15788
+ ]);
15694
15789
  const handleSetRawMode = reactExports.useCallback((isEnabled)=>{
15695
15790
  if (!isRawModeSupported) {
15696
15791
  if (stdin === process$1.stdin) {
@@ -15701,28 +15796,42 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
15701
15796
  }
15702
15797
  stdin.setEncoding('utf8');
15703
15798
  if (isEnabled) {
15704
- // Ensure raw mode is enabled only once
15705
15799
  if (rawModeEnabledCount.current === 0) {
15706
- stdin.ref();
15707
- stdin.setRawMode(true);
15708
- // Store the listener reference to avoid stale closure when removing
15709
- readableListenerRef.current = handleReadable;
15710
- stdin.addListener('readable', handleReadable);
15800
+ // A same-render component swap may have detached input handling while
15801
+ // leaving terminal raw mode enabled until the queued disable runs.
15802
+ const isRawModeAlreadyEnabled = pendingDisableRawModeRef.current;
15803
+ pendingDisableRawModeRef.current = false;
15804
+ if (!isRawModeAlreadyEnabled) {
15805
+ stdin.ref();
15806
+ stdin.setRawMode(true);
15807
+ }
15808
+ attachReadableListener();
15711
15809
  }
15712
15810
  rawModeEnabledCount.current++;
15713
15811
  return;
15714
15812
  }
15715
- // Disable raw mode only when no components left that are using it
15716
15813
  if (rawModeEnabledCount.current === 0) {
15717
15814
  return;
15718
15815
  }
15719
15816
  if (--rawModeEnabledCount.current === 0) {
15720
- disableRawMode();
15817
+ // Stop owning input immediately so pending parser state cannot leak into
15818
+ // a replacement `useInput` component mounted in the same React update.
15819
+ clearInputState();
15820
+ // Defer only the terminal raw-mode teardown so a same-render replacement
15821
+ // can keep the process ref and raw mode active without a disable/enable cycle.
15822
+ pendingDisableRawModeRef.current = true;
15823
+ queueMicrotask(()=>{
15824
+ if (!pendingDisableRawModeRef.current) {
15825
+ return;
15826
+ }
15827
+ disableRawMode();
15828
+ });
15721
15829
  }
15722
15830
  }, [
15723
15831
  isRawModeSupported,
15724
15832
  stdin,
15725
- handleReadable,
15833
+ attachReadableListener,
15834
+ clearInputState,
15726
15835
  disableRawMode
15727
15836
  ]);
15728
15837
  const handleSetBracketedPasteMode = reactExports.useCallback((isEnabled)=>{
@@ -15900,7 +16009,7 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
15900
16009
  if (interactive && canWriteToStdout) {
15901
16010
  cliCursor.show(stdout);
15902
16011
  }
15903
- if (isRawModeSupported && rawModeEnabledCount.current > 0) {
16012
+ if (isRawModeSupported && (rawModeEnabledCount.current > 0 || pendingDisableRawModeRef.current)) {
15904
16013
  disableRawMode();
15905
16014
  }
15906
16015
  if (bracketedPasteModeEnabledCount.current > 0) {
@@ -16209,6 +16318,7 @@ class Ink {
16209
16318
  this.throttledOnRender = throttled;
16210
16319
  }
16211
16320
  this.rootNode.onImmediateRender = this.onRender;
16321
+ this.rootNode.onStaticChange = this.handleStaticChange;
16212
16322
  this.log = logUpdate.create(options.stdout, {
16213
16323
  incremental: options.incrementalRendering
16214
16324
  });
@@ -16276,6 +16386,7 @@ class Ink {
16276
16386
  this.lastOutputToRender = '';
16277
16387
  }
16278
16388
  this.calculateLayout();
16389
+ emitLayoutListeners(this.rootNode);
16279
16390
  this.onRender();
16280
16391
  this.lastTerminalWidth = currentWidth;
16281
16392
  };
@@ -16311,6 +16422,10 @@ class Ink {
16311
16422
  this.rootNode.yogaNode.setWidth(terminalWidth);
16312
16423
  this.rootNode.yogaNode.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
16313
16424
  };
16425
+ // Resets `fullStaticOutput` when the <Static> identity changes so stale items from a previous instance are not replayed on future rewrites.
16426
+ handleStaticChange = ()=>{
16427
+ this.fullStaticOutput = '';
16428
+ };
16314
16429
  onRender = ()=>{
16315
16430
  this.hasPendingThrottledRender = false;
16316
16431
  if (this.isUnmounted) {