flavor-code 1.4.2 → 1.4.3

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 (81) hide show
  1. package/README.md +53 -1
  2. package/README.zh-CN.md +53 -1
  3. package/dist/agent/loop.d.ts +1 -0
  4. package/dist/{app-4CUS3GEJ.js → app-TVY2HM5L.js} +891 -604
  5. package/dist/apply-WOW3QU5I.js +51 -0
  6. package/dist/broker-cli-X5H46FZV.js +15 -0
  7. package/dist/check-CSKTV4O2.js +16 -0
  8. package/dist/chunk-3563SW4X.js +10513 -0
  9. package/dist/chunk-36IDJRLQ.js +630 -0
  10. package/dist/chunk-3UX2CGDW.js +1955 -0
  11. package/dist/chunk-4TMLXZVZ.js +75 -0
  12. package/dist/{chunk-7YFHRORG.js → chunk-5BDKRA6U.js} +412 -172
  13. package/dist/chunk-6F66UXBI.js +48 -0
  14. package/dist/{chunk-KMBDK4SN.js → chunk-6URQ7FIF.js} +24 -88
  15. package/dist/chunk-7Y64WNBB.js +8930 -0
  16. package/dist/chunk-AA4QNKTF.js +501 -0
  17. package/dist/chunk-BDX777JR.js +11 -0
  18. package/dist/chunk-CVP5OUHD.js +103 -0
  19. package/dist/chunk-EWD7FWTH.js +14547 -0
  20. package/dist/{chunk-N5MXHJKD.js → chunk-GTFP2R5I.js} +1 -1
  21. package/dist/{chunk-W2TIY6JY.js → chunk-IKGT4MDT.js} +2028 -516
  22. package/dist/chunk-IQEEFDEE.js +389 -0
  23. package/dist/chunk-IU3UBETC.js +30 -0
  24. package/dist/chunk-JQM2L2YM.js +1003 -0
  25. package/dist/chunk-KRWWCVXA.js +74 -0
  26. package/dist/chunk-OKHV7CTB.js +482 -0
  27. package/dist/chunk-ONRY3C2L.js +196 -0
  28. package/dist/chunk-PULWAH6E.js +474 -0
  29. package/dist/chunk-PZ5NKRVA.js +85 -0
  30. package/dist/chunk-QACFKPZP.js +43704 -0
  31. package/dist/chunk-RBAZLFKB.js +1022 -0
  32. package/dist/chunk-RV3EXUXM.js +30 -0
  33. package/dist/chunk-TIEOVQW6.js +61 -0
  34. package/dist/chunk-WLZUAVVU.js +15 -0
  35. package/dist/chunk-X442CJJH.js +114 -0
  36. package/dist/chunk-X6U6BO5D.js +2130 -0
  37. package/dist/{chunk-RAYH6K2H.js → chunk-Y7EH4NVO.js} +1 -1
  38. package/dist/{chunk-S32JRDZK.js → chunk-ZKKVSR37.js} +6 -1
  39. package/dist/{claude-ink-VQU3C5UL.js → claude-ink-F554I3GJ.js} +9 -4
  40. package/dist/cli-MAWCV2YR.js +163 -0
  41. package/dist/cli-main.js +3805 -473
  42. package/dist/cli.js +50 -4
  43. package/dist/config/load.d.ts +8 -0
  44. package/dist/config/protected-file.d.ts +2 -0
  45. package/dist/config/schema.d.ts +14 -0
  46. package/dist/context/global-instructions.d.ts +12 -0
  47. package/dist/context/manager.d.ts +4 -0
  48. package/dist/desktop/main.js +4943 -1562
  49. package/dist/desktop/preload.cjs +30 -0
  50. package/dist/desktop-renderer/assets/index-BWklSoOO.css +1 -0
  51. package/dist/desktop-renderer/assets/index-CjC0Ibiq.js +153 -0
  52. package/dist/desktop-renderer/assets/{interactive-terminal-ouQQ3brz.js → interactive-terminal-IjIT3Xoa.js} +1 -1
  53. package/dist/desktop-renderer/index.html +2 -2
  54. package/dist/doctor-SEL32R7M.js +20 -0
  55. package/dist/harness/local.d.ts +1 -0
  56. package/dist/load-RHWXNUCS.js +25 -0
  57. package/dist/log-ATFIPRNU.js +19 -0
  58. package/dist/manager-IYBNNKUP.js +191 -0
  59. package/dist/models/anthropic.d.ts +3 -0
  60. package/dist/node-LOIXT44J.js +879 -0
  61. package/dist/plugin-worker-entry.js +1 -1
  62. package/dist/production-TQROFEPV.js +46 -0
  63. package/dist/production.d.ts +28 -1
  64. package/dist/project-3QXE22TG.js +11 -0
  65. package/dist/react-M6JGXSJZ.js +7 -0
  66. package/dist/recorder-FAGJJH3N.js +11 -0
  67. package/dist/sdk/index.js +30 -8
  68. package/dist/server-2KLKPHPL.js +11 -0
  69. package/dist/session/store.d.ts +1 -0
  70. package/dist/store-MZZERW7K.js +18 -0
  71. package/dist/ui/commands.d.ts +11 -3
  72. package/dist/ui/session.d.ts +2 -1
  73. package/dist/usage-summary-G5FBOJLK.js +13 -0
  74. package/dist/write-stream-CGD57URC.js +77 -0
  75. package/package.json +1 -1
  76. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +649 -1
  77. package/dist/chunk-B23V72YR.js +0 -170
  78. package/dist/chunk-QKND3FX7.js +0 -26103
  79. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +0 -1
  80. package/dist/desktop-renderer/assets/index-CPXrzFgv.js +0 -154
  81. package/dist/load-UPOG3XQR.js +0 -19
@@ -1,16 +1,94 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
3
+ import {
4
+ require_react
5
+ } from "./chunk-PULWAH6E.js";
6
+ import {
7
+ source_default
8
+ } from "./chunk-AA4QNKTF.js";
3
9
  import {
4
- execFileNoThrow,
5
10
  getGraphemeSegmenter,
6
- isEnvTruthy,
11
+ isEnvTruthy
12
+ } from "./chunk-TIEOVQW6.js";
13
+ import {
14
+ execFileNoThrow
15
+ } from "./chunk-IU3UBETC.js";
16
+ import {
17
+ require_semver
18
+ } from "./chunk-3UX2CGDW.js";
19
+ import {
7
20
  logError
8
- } from "./chunk-B23V72YR.js";
21
+ } from "./chunk-KRWWCVXA.js";
9
22
  import {
10
23
  __commonJS,
11
24
  __require,
12
25
  __toESM
13
- } from "./chunk-S32JRDZK.js";
26
+ } from "./chunk-ZKKVSR37.js";
27
+
28
+ // node_modules/react/cjs/react-compiler-runtime.production.js
29
+ var require_react_compiler_runtime_production = __commonJS({
30
+ "node_modules/react/cjs/react-compiler-runtime.production.js"(exports) {
31
+ "use strict";
32
+ var ReactSharedInternals = require_react().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
33
+ exports.c = function(size) {
34
+ return ReactSharedInternals.H.useMemoCache(size);
35
+ };
36
+ }
37
+ });
38
+
39
+ // node_modules/react/compiler-runtime.js
40
+ var require_compiler_runtime = __commonJS({
41
+ "node_modules/react/compiler-runtime.js"(exports, module) {
42
+ "use strict";
43
+ if (true) {
44
+ module.exports = require_react_compiler_runtime_production();
45
+ } else {
46
+ module.exports = null;
47
+ }
48
+ }
49
+ });
50
+
51
+ // node_modules/react/cjs/react-jsx-runtime.production.js
52
+ var require_react_jsx_runtime_production = __commonJS({
53
+ "node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
54
+ "use strict";
55
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
56
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
57
+ function jsxProd(type, config, maybeKey) {
58
+ var key = null;
59
+ void 0 !== maybeKey && (key = "" + maybeKey);
60
+ void 0 !== config.key && (key = "" + config.key);
61
+ if ("key" in config) {
62
+ maybeKey = {};
63
+ for (var propName in config)
64
+ "key" !== propName && (maybeKey[propName] = config[propName]);
65
+ } else maybeKey = config;
66
+ config = maybeKey.ref;
67
+ return {
68
+ $$typeof: REACT_ELEMENT_TYPE,
69
+ type,
70
+ key,
71
+ ref: void 0 !== config ? config : null,
72
+ props: maybeKey
73
+ };
74
+ }
75
+ exports.Fragment = REACT_FRAGMENT_TYPE;
76
+ exports.jsx = jsxProd;
77
+ exports.jsxs = jsxProd;
78
+ }
79
+ });
80
+
81
+ // node_modules/react/jsx-runtime.js
82
+ var require_jsx_runtime = __commonJS({
83
+ "node_modules/react/jsx-runtime.js"(exports, module) {
84
+ "use strict";
85
+ if (true) {
86
+ module.exports = require_react_jsx_runtime_production();
87
+ } else {
88
+ module.exports = null;
89
+ }
90
+ }
91
+ });
14
92
 
15
93
  // node_modules/scheduler/cjs/scheduler.production.js
16
94
  var require_scheduler_production = __commonJS({
@@ -305,7 +383,7 @@ var require_react_reconciler_production = __commonJS({
305
383
  function createFiber(tag, pendingProps, key, mode) {
306
384
  return new FiberNode(tag, pendingProps, key, mode);
307
385
  }
308
- function noop3() {
386
+ function noop2() {
309
387
  }
310
388
  function formatProdErrorMessage(code) {
311
389
  var url = "https://react.dev/errors/" + code;
@@ -539,17 +617,17 @@ var require_react_reconciler_production = __commonJS({
539
617
  return lanes;
540
618
  }
541
619
  }
542
- function getNextLanes(root, wipLanes, rootHasPendingCommit) {
543
- var pendingLanes = root.pendingLanes;
620
+ function getNextLanes(root2, wipLanes, rootHasPendingCommit) {
621
+ var pendingLanes = root2.pendingLanes;
544
622
  if (0 === pendingLanes) return 0;
545
- var nextLanes = 0, suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes;
546
- root = root.warmLanes;
623
+ var nextLanes = 0, suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes;
624
+ root2 = root2.warmLanes;
547
625
  var nonIdlePendingLanes = pendingLanes & 134217727;
548
- 0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
626
+ 0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
549
627
  return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes;
550
628
  }
551
- function checkIfRootIsPrerendering(root, renderLanes2) {
552
- return 0 === (root.pendingLanes & ~(root.suspendedLanes & ~root.pingedLanes) & renderLanes2);
629
+ function checkIfRootIsPrerendering(root2, renderLanes2) {
630
+ return 0 === (root2.pendingLanes & ~(root2.suspendedLanes & ~root2.pingedLanes) & renderLanes2);
553
631
  }
554
632
  function computeExpirationTime(lane, currentTime) {
555
633
  switch (lane) {
@@ -602,21 +680,21 @@ var require_react_reconciler_production = __commonJS({
602
680
  for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
603
681
  return laneMap;
604
682
  }
605
- function markRootUpdated$1(root, updateLane) {
606
- root.pendingLanes |= updateLane;
607
- 268435456 !== updateLane && (root.suspendedLanes = 0, root.pingedLanes = 0, root.warmLanes = 0);
608
- }
609
- function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
610
- var previouslyPendingLanes = root.pendingLanes;
611
- root.pendingLanes = remainingLanes;
612
- root.suspendedLanes = 0;
613
- root.pingedLanes = 0;
614
- root.warmLanes = 0;
615
- root.expiredLanes &= remainingLanes;
616
- root.entangledLanes &= remainingLanes;
617
- root.errorRecoveryDisabledLanes &= remainingLanes;
618
- root.shellSuspendCounter = 0;
619
- var entanglements = root.entanglements, expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates;
683
+ function markRootUpdated$1(root2, updateLane) {
684
+ root2.pendingLanes |= updateLane;
685
+ 268435456 !== updateLane && (root2.suspendedLanes = 0, root2.pingedLanes = 0, root2.warmLanes = 0);
686
+ }
687
+ function markRootFinished(root2, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
688
+ var previouslyPendingLanes = root2.pendingLanes;
689
+ root2.pendingLanes = remainingLanes;
690
+ root2.suspendedLanes = 0;
691
+ root2.pingedLanes = 0;
692
+ root2.warmLanes = 0;
693
+ root2.expiredLanes &= remainingLanes;
694
+ root2.entangledLanes &= remainingLanes;
695
+ root2.errorRecoveryDisabledLanes &= remainingLanes;
696
+ root2.shellSuspendCounter = 0;
697
+ var entanglements = root2.entanglements, expirationTimes = root2.expirationTimes, hiddenUpdates = root2.hiddenUpdates;
620
698
  for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) {
621
699
  var index$5 = 31 - clz32(remainingLanes), lane = 1 << index$5;
622
700
  entanglements[index$5] = 0;
@@ -629,28 +707,28 @@ var require_react_reconciler_production = __commonJS({
629
707
  }
630
708
  remainingLanes &= ~lane;
631
709
  }
632
- 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
633
- 0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root.tag && (root.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
710
+ 0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, 0);
711
+ 0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root2.tag && (root2.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
634
712
  }
635
- function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) {
636
- root.pendingLanes |= spawnedLane;
637
- root.suspendedLanes &= ~spawnedLane;
713
+ function markSpawnedDeferredLane(root2, spawnedLane, entangledLanes) {
714
+ root2.pendingLanes |= spawnedLane;
715
+ root2.suspendedLanes &= ~spawnedLane;
638
716
  var spawnedLaneIndex = 31 - clz32(spawnedLane);
639
- root.entangledLanes |= spawnedLane;
640
- root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 261930;
717
+ root2.entangledLanes |= spawnedLane;
718
+ root2.entanglements[spawnedLaneIndex] = root2.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 261930;
641
719
  }
642
- function markRootEntangled(root, entangledLanes) {
643
- var rootEntangledLanes = root.entangledLanes |= entangledLanes;
644
- for (root = root.entanglements; rootEntangledLanes; ) {
720
+ function markRootEntangled(root2, entangledLanes) {
721
+ var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
722
+ for (root2 = root2.entanglements; rootEntangledLanes; ) {
645
723
  var index$6 = 31 - clz32(rootEntangledLanes), lane = 1 << index$6;
646
- lane & entangledLanes | root[index$6] & entangledLanes && (root[index$6] |= entangledLanes);
724
+ lane & entangledLanes | root2[index$6] & entangledLanes && (root2[index$6] |= entangledLanes);
647
725
  rootEntangledLanes &= ~lane;
648
726
  }
649
727
  }
650
- function getBumpedLaneForHydration(root, renderLanes2) {
728
+ function getBumpedLaneForHydration(root2, renderLanes2) {
651
729
  var renderLane = renderLanes2 & -renderLanes2;
652
730
  renderLane = 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);
653
- return 0 !== (renderLane & (root.suspendedLanes | renderLanes2)) ? 0 : renderLane;
731
+ return 0 !== (renderLane & (root2.suspendedLanes | renderLanes2)) ? 0 : renderLane;
654
732
  }
655
733
  function getBumpedLaneForHydrationByLane(lane) {
656
734
  switch (lane) {
@@ -1152,8 +1230,8 @@ var require_react_reconciler_production = __commonJS({
1152
1230
  }
1153
1231
  function noop$1() {
1154
1232
  }
1155
- function ensureRootIsScheduled(root) {
1156
- root !== lastScheduledRoot && null === root.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root : lastScheduledRoot = lastScheduledRoot.next = root);
1233
+ function ensureRootIsScheduled(root2) {
1234
+ root2 !== lastScheduledRoot && null === root2.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root2 : lastScheduledRoot = lastScheduledRoot.next = root2);
1157
1235
  mightHavePendingSyncWork = true;
1158
1236
  didScheduleMicrotask || (didScheduleMicrotask = true, scheduleImmediateRootScheduleTask());
1159
1237
  }
@@ -1162,25 +1240,25 @@ var require_react_reconciler_production = __commonJS({
1162
1240
  isFlushingWork = true;
1163
1241
  do {
1164
1242
  var didPerformSomeWork = false;
1165
- for (var root = firstScheduledRoot; null !== root; ) {
1243
+ for (var root2 = firstScheduledRoot; null !== root2; ) {
1166
1244
  if (!onlyLegacy)
1167
1245
  if (0 !== syncTransitionLanes) {
1168
- var pendingLanes = root.pendingLanes;
1246
+ var pendingLanes = root2.pendingLanes;
1169
1247
  if (0 === pendingLanes) var JSCompiler_inline_result = 0;
1170
1248
  else {
1171
- var suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes;
1249
+ var suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes;
1172
1250
  JSCompiler_inline_result = (1 << 31 - clz32(42 | syncTransitionLanes) + 1) - 1;
1173
1251
  JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes);
1174
1252
  JSCompiler_inline_result = JSCompiler_inline_result & 201326741 ? JSCompiler_inline_result & 201326741 | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0;
1175
1253
  }
1176
- 0 !== JSCompiler_inline_result && (didPerformSomeWork = true, performSyncWorkOnRoot(root, JSCompiler_inline_result));
1254
+ 0 !== JSCompiler_inline_result && (didPerformSomeWork = true, performSyncWorkOnRoot(root2, JSCompiler_inline_result));
1177
1255
  } else
1178
1256
  JSCompiler_inline_result = workInProgressRootRenderLanes, JSCompiler_inline_result = getNextLanes(
1179
- root,
1180
- root === workInProgressRoot ? JSCompiler_inline_result : 0,
1181
- null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout
1182
- ), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || (didPerformSomeWork = true, performSyncWorkOnRoot(root, JSCompiler_inline_result));
1183
- root = root.next;
1257
+ root2,
1258
+ root2 === workInProgressRoot ? JSCompiler_inline_result : 0,
1259
+ null !== root2.cancelPendingCommit || root2.timeoutHandle !== noTimeout
1260
+ ), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root2, JSCompiler_inline_result) || (didPerformSomeWork = true, performSyncWorkOnRoot(root2, JSCompiler_inline_result));
1261
+ root2 = root2.next;
1184
1262
  }
1185
1263
  } while (didPerformSomeWork);
1186
1264
  isFlushingWork = false;
@@ -1193,39 +1271,39 @@ var require_react_reconciler_production = __commonJS({
1193
1271
  mightHavePendingSyncWork = didScheduleMicrotask = false;
1194
1272
  var syncTransitionLanes = 0;
1195
1273
  0 !== currentEventTransitionLane && shouldAttemptEagerTransition() && (syncTransitionLanes = currentEventTransitionLane);
1196
- for (var currentTime = now(), prev = null, root = firstScheduledRoot; null !== root; ) {
1197
- var next = root.next, nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime);
1274
+ for (var currentTime = now2(), prev = null, root2 = firstScheduledRoot; null !== root2; ) {
1275
+ var next = root2.next, nextLanes = scheduleTaskForRootDuringMicrotask(root2, currentTime);
1198
1276
  if (0 === nextLanes)
1199
- root.next = null, null === prev ? firstScheduledRoot = next : prev.next = next, null === next && (lastScheduledRoot = prev);
1200
- else if (prev = root, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
1277
+ root2.next = null, null === prev ? firstScheduledRoot = next : prev.next = next, null === next && (lastScheduledRoot = prev);
1278
+ else if (prev = root2, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
1201
1279
  mightHavePendingSyncWork = true;
1202
- root = next;
1280
+ root2 = next;
1203
1281
  }
1204
1282
  0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus || flushSyncWorkAcrossRoots_impl(syncTransitionLanes, false);
1205
1283
  0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
1206
1284
  }
1207
- function scheduleTaskForRootDuringMicrotask(root, currentTime) {
1208
- for (var suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, lanes = root.pendingLanes & -62914561; 0 < lanes; ) {
1285
+ function scheduleTaskForRootDuringMicrotask(root2, currentTime) {
1286
+ for (var suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes, expirationTimes = root2.expirationTimes, lanes = root2.pendingLanes & -62914561; 0 < lanes; ) {
1209
1287
  var index$3 = 31 - clz32(lanes), lane = 1 << index$3, expirationTime = expirationTimes[index$3];
1210
1288
  if (-1 === expirationTime) {
1211
1289
  if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
1212
1290
  expirationTimes[index$3] = computeExpirationTime(lane, currentTime);
1213
- } else expirationTime <= currentTime && (root.expiredLanes |= lane);
1291
+ } else expirationTime <= currentTime && (root2.expiredLanes |= lane);
1214
1292
  lanes &= ~lane;
1215
1293
  }
1216
1294
  currentTime = workInProgressRoot;
1217
1295
  suspendedLanes = workInProgressRootRenderLanes;
1218
1296
  suspendedLanes = getNextLanes(
1219
- root,
1220
- root === currentTime ? suspendedLanes : 0,
1221
- null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout
1297
+ root2,
1298
+ root2 === currentTime ? suspendedLanes : 0,
1299
+ null !== root2.cancelPendingCommit || root2.timeoutHandle !== noTimeout
1222
1300
  );
1223
- pingedLanes = root.callbackNode;
1224
- if (0 === suspendedLanes || root === currentTime && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root.cancelPendingCommit)
1225
- return null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes), root.callbackNode = null, root.callbackPriority = 0;
1226
- if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root, suspendedLanes)) {
1301
+ pingedLanes = root2.callbackNode;
1302
+ if (0 === suspendedLanes || root2 === currentTime && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root2.cancelPendingCommit)
1303
+ return null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes), root2.callbackNode = null, root2.callbackPriority = 0;
1304
+ if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root2, suspendedLanes)) {
1227
1305
  currentTime = suspendedLanes & -suspendedLanes;
1228
- if (currentTime === root.callbackPriority) return currentTime;
1306
+ if (currentTime === root2.callbackPriority) return currentTime;
1229
1307
  null !== pingedLanes && cancelCallback$1(pingedLanes);
1230
1308
  switch (lanesToEventPriority(suspendedLanes)) {
1231
1309
  case 2:
@@ -1241,37 +1319,37 @@ var require_react_reconciler_production = __commonJS({
1241
1319
  default:
1242
1320
  suspendedLanes = NormalPriority$1;
1243
1321
  }
1244
- pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root);
1322
+ pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root2);
1245
1323
  suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
1246
- root.callbackPriority = currentTime;
1247
- root.callbackNode = suspendedLanes;
1324
+ root2.callbackPriority = currentTime;
1325
+ root2.callbackNode = suspendedLanes;
1248
1326
  return currentTime;
1249
1327
  }
1250
1328
  null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes);
1251
- root.callbackPriority = 2;
1252
- root.callbackNode = null;
1329
+ root2.callbackPriority = 2;
1330
+ root2.callbackNode = null;
1253
1331
  return 2;
1254
1332
  }
1255
- function performWorkOnRootViaSchedulerTask(root, didTimeout) {
1333
+ function performWorkOnRootViaSchedulerTask(root2, didTimeout) {
1256
1334
  if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus)
1257
- return root.callbackNode = null, root.callbackPriority = 0, null;
1258
- var originalCallbackNode = root.callbackNode;
1259
- if (flushPendingEffects() && root.callbackNode !== originalCallbackNode)
1335
+ return root2.callbackNode = null, root2.callbackPriority = 0, null;
1336
+ var originalCallbackNode = root2.callbackNode;
1337
+ if (flushPendingEffects() && root2.callbackNode !== originalCallbackNode)
1260
1338
  return null;
1261
1339
  var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
1262
1340
  workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
1263
- root,
1264
- root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
1265
- null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout
1341
+ root2,
1342
+ root2 === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
1343
+ null !== root2.cancelPendingCommit || root2.timeoutHandle !== noTimeout
1266
1344
  );
1267
1345
  if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
1268
- performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout);
1269
- scheduleTaskForRootDuringMicrotask(root, now());
1270
- return null != root.callbackNode && root.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root) : null;
1346
+ performWorkOnRoot(root2, workInProgressRootRenderLanes$jscomp$0, didTimeout);
1347
+ scheduleTaskForRootDuringMicrotask(root2, now2());
1348
+ return null != root2.callbackNode && root2.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root2) : null;
1271
1349
  }
1272
- function performSyncWorkOnRoot(root, lanes) {
1350
+ function performSyncWorkOnRoot(root2, lanes) {
1273
1351
  if (flushPendingEffects()) return null;
1274
- performWorkOnRoot(root, lanes, true);
1352
+ performWorkOnRoot(root2, lanes, true);
1275
1353
  }
1276
1354
  function scheduleImmediateRootScheduleTask() {
1277
1355
  supportsMicrotasks ? scheduleMicrotask(function() {
@@ -1365,7 +1443,7 @@ var require_react_reconciler_production = __commonJS({
1365
1443
  if (keysA.length !== keysB.length) return false;
1366
1444
  for (keysB = 0; keysB < keysA.length; keysB++) {
1367
1445
  var currentKey = keysA[keysB];
1368
- if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey]))
1446
+ if (!hasOwnProperty2.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey]))
1369
1447
  return false;
1370
1448
  }
1371
1449
  return true;
@@ -1997,14 +2075,14 @@ var require_react_reconciler_production = __commonJS({
1997
2075
  enqueueUpdate$1(fiber, updateQueue, update, lane);
1998
2076
  return getRootForUpdatedFiber(fiber);
1999
2077
  }
2000
- function entangleTransitions(root, fiber, lane) {
2078
+ function entangleTransitions(root2, fiber, lane) {
2001
2079
  fiber = fiber.updateQueue;
2002
2080
  if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194048))) {
2003
2081
  var queueLanes = fiber.lanes;
2004
- queueLanes &= root.pendingLanes;
2082
+ queueLanes &= root2.pendingLanes;
2005
2083
  lane |= queueLanes;
2006
2084
  fiber.lanes = lane;
2007
- markRootEntangled(root, lane);
2085
+ markRootEntangled(root2, lane);
2008
2086
  }
2009
2087
  }
2010
2088
  function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
@@ -2535,8 +2613,8 @@ var require_react_reconciler_production = __commonJS({
2535
2613
  }
2536
2614
  }
2537
2615
  function forceStoreRerender(fiber) {
2538
- var root = enqueueConcurrentRenderForLane(fiber, 2);
2539
- null !== root && scheduleUpdateOnFiber(root, fiber, 2);
2616
+ var root2 = enqueueConcurrentRenderForLane(fiber, 2);
2617
+ null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2);
2540
2618
  }
2541
2619
  function mountStateImpl(initialState) {
2542
2620
  var hook = mountWorkInProgressHook();
@@ -2986,8 +3064,8 @@ var require_react_reconciler_production = __commonJS({
2986
3064
  case 3:
2987
3065
  var lane = requestUpdateLane();
2988
3066
  fiber = createUpdate(lane);
2989
- var root = enqueueUpdate(provider, fiber, lane);
2990
- null !== root && (scheduleUpdateOnFiber(root, provider, lane), entangleTransitions(root, provider, lane));
3067
+ var root2 = enqueueUpdate(provider, fiber, lane);
3068
+ null !== root2 && (scheduleUpdateOnFiber(root2, provider, lane), entangleTransitions(root2, provider, lane));
2991
3069
  provider = { cache: createCache() };
2992
3070
  fiber.payload = provider;
2993
3071
  return;
@@ -3071,13 +3149,13 @@ var require_react_reconciler_production = __commonJS({
3071
3149
  null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
3072
3150
  queue.pending = update;
3073
3151
  }
3074
- function entangleTransitionUpdate(root, queue, lane) {
3152
+ function entangleTransitionUpdate(root2, queue, lane) {
3075
3153
  if (0 !== (lane & 4194048)) {
3076
3154
  var queueLanes = queue.lanes;
3077
- queueLanes &= root.pendingLanes;
3155
+ queueLanes &= root2.pendingLanes;
3078
3156
  lane |= queueLanes;
3079
3157
  queue.lanes = lane;
3080
- markRootEntangled(root, lane);
3158
+ markRootEntangled(root2, lane);
3081
3159
  }
3082
3160
  }
3083
3161
  function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
@@ -3111,9 +3189,9 @@ var require_react_reconciler_production = __commonJS({
3111
3189
  }
3112
3190
  return newProps;
3113
3191
  }
3114
- function logUncaughtError(root, errorInfo) {
3192
+ function logUncaughtError(root2, errorInfo) {
3115
3193
  try {
3116
- var onUncaughtError = root.onUncaughtError;
3194
+ var onUncaughtError = root2.onUncaughtError;
3117
3195
  onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
3118
3196
  } catch (e) {
3119
3197
  setTimeout(function() {
@@ -3121,9 +3199,9 @@ var require_react_reconciler_production = __commonJS({
3121
3199
  });
3122
3200
  }
3123
3201
  }
3124
- function logCaughtError(root, boundary, errorInfo) {
3202
+ function logCaughtError(root2, boundary, errorInfo) {
3125
3203
  try {
3126
- var onCaughtError = root.onCaughtError;
3204
+ var onCaughtError = root2.onCaughtError;
3127
3205
  onCaughtError(errorInfo.value, {
3128
3206
  componentStack: errorInfo.stack,
3129
3207
  errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
@@ -3134,12 +3212,12 @@ var require_react_reconciler_production = __commonJS({
3134
3212
  });
3135
3213
  }
3136
3214
  }
3137
- function createRootErrorUpdate(root, errorInfo, lane) {
3215
+ function createRootErrorUpdate(root2, errorInfo, lane) {
3138
3216
  lane = createUpdate(lane);
3139
3217
  lane.tag = 3;
3140
3218
  lane.payload = { element: null };
3141
3219
  lane.callback = function() {
3142
- logUncaughtError(root, errorInfo);
3220
+ logUncaughtError(root2, errorInfo);
3143
3221
  };
3144
3222
  return lane;
3145
3223
  }
@@ -3148,7 +3226,7 @@ var require_react_reconciler_production = __commonJS({
3148
3226
  lane.tag = 3;
3149
3227
  return lane;
3150
3228
  }
3151
- function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
3229
+ function initializeClassErrorUpdate(update, root2, fiber, errorInfo) {
3152
3230
  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
3153
3231
  if ("function" === typeof getDerivedStateFromError) {
3154
3232
  var error = errorInfo.value;
@@ -3156,12 +3234,12 @@ var require_react_reconciler_production = __commonJS({
3156
3234
  return getDerivedStateFromError(error);
3157
3235
  };
3158
3236
  update.callback = function() {
3159
- logCaughtError(root, fiber, errorInfo);
3237
+ logCaughtError(root2, fiber, errorInfo);
3160
3238
  };
3161
3239
  }
3162
3240
  var inst = fiber.stateNode;
3163
3241
  null !== inst && "function" === typeof inst.componentDidCatch && (update.callback = function() {
3164
- logCaughtError(root, fiber, errorInfo);
3242
+ logCaughtError(root2, fiber, errorInfo);
3165
3243
  "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this));
3166
3244
  var stack = errorInfo.stack;
3167
3245
  this.componentDidCatch(errorInfo.value, {
@@ -3169,7 +3247,7 @@ var require_react_reconciler_production = __commonJS({
3169
3247
  });
3170
3248
  });
3171
3249
  }
3172
- function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {
3250
+ function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
3173
3251
  sourceFiber.flags |= 32768;
3174
3252
  if (null !== value && "object" === typeof value && "function" === typeof value.then) {
3175
3253
  returnFiber = sourceFiber.alternate;
@@ -3184,32 +3262,32 @@ var require_react_reconciler_production = __commonJS({
3184
3262
  switch (sourceFiber.tag) {
3185
3263
  case 31:
3186
3264
  case 13:
3187
- return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value]) : returnFiber.add(value), attachPingListener(root, value, rootRenderLanes)), false;
3265
+ return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value]) : returnFiber.add(value), attachPingListener(root2, value, rootRenderLanes)), false;
3188
3266
  case 22:
3189
3267
  return sourceFiber.flags |= 65536, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? (returnFiber = {
3190
3268
  transitions: null,
3191
3269
  markerInstances: null,
3192
3270
  retryQueue: /* @__PURE__ */ new Set([value])
3193
- }, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value]) : sourceFiber.add(value)), attachPingListener(root, value, rootRenderLanes)), false;
3271
+ }, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value]) : sourceFiber.add(value)), attachPingListener(root2, value, rootRenderLanes)), false;
3194
3272
  }
3195
3273
  throw Error(formatProdErrorMessage(435, sourceFiber.tag));
3196
3274
  }
3197
- attachPingListener(root, value, rootRenderLanes);
3275
+ attachPingListener(root2, value, rootRenderLanes);
3198
3276
  renderDidSuspendDelayIfPossible();
3199
3277
  return false;
3200
3278
  }
3201
3279
  if (isHydrating)
3202
- return returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && (root = Error(formatProdErrorMessage(422), { cause: value }), queueHydrationError(
3203
- createCapturedValueAtFiber(root, sourceFiber)
3280
+ return returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && (root2 = Error(formatProdErrorMessage(422), { cause: value }), queueHydrationError(
3281
+ createCapturedValueAtFiber(root2, sourceFiber)
3204
3282
  ))) : (value !== HydrationMismatchException && (returnFiber = Error(formatProdErrorMessage(423), {
3205
3283
  cause: value
3206
3284
  }), queueHydrationError(
3207
3285
  createCapturedValueAtFiber(returnFiber, sourceFiber)
3208
- )), root = root.current.alternate, root.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(
3209
- root.stateNode,
3286
+ )), root2 = root2.current.alternate, root2.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root2.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(
3287
+ root2.stateNode,
3210
3288
  value,
3211
3289
  rootRenderLanes
3212
- ), enqueueCapturedUpdate(root, rootRenderLanes), 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2)), false;
3290
+ ), enqueueCapturedUpdate(root2, rootRenderLanes), 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2)), false;
3213
3291
  var wrapperError = Error(formatProdErrorMessage(520), { cause: value });
3214
3292
  wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);
3215
3293
  null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [wrapperError] : workInProgressRootConcurrentErrors.push(wrapperError);
@@ -3220,14 +3298,14 @@ var require_react_reconciler_production = __commonJS({
3220
3298
  do {
3221
3299
  switch (sourceFiber.tag) {
3222
3300
  case 3:
3223
- return sourceFiber.flags |= 65536, root = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root, root = createRootErrorUpdate(sourceFiber.stateNode, value, root), enqueueCapturedUpdate(sourceFiber, root), false;
3301
+ return sourceFiber.flags |= 65536, root2 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root2, root2 = createRootErrorUpdate(sourceFiber.stateNode, value, root2), enqueueCapturedUpdate(sourceFiber, root2), false;
3224
3302
  case 1:
3225
3303
  if (returnFiber = sourceFiber.type, wrapperError = sourceFiber.stateNode, 0 === (sourceFiber.flags & 128) && ("function" === typeof returnFiber.getDerivedStateFromError || null !== wrapperError && "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(
3226
3304
  wrapperError
3227
3305
  ))))
3228
3306
  return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(
3229
3307
  rootRenderLanes,
3230
- root,
3308
+ root2,
3231
3309
  sourceFiber,
3232
3310
  value
3233
3311
  ), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false;
@@ -4854,7 +4932,7 @@ var require_react_reconciler_production = __commonJS({
4854
4932
  }
4855
4933
  current = current.sibling;
4856
4934
  }
4857
- null !== newProps.tail && now() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
4935
+ null !== newProps.tail && now2() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
4858
4936
  }
4859
4937
  else {
4860
4938
  if (!type)
@@ -4862,11 +4940,11 @@ var require_react_reconciler_production = __commonJS({
4862
4940
  if (workInProgress2.flags |= 128, type = true, current = current.updateQueue, workInProgress2.updateQueue = current, scheduleRetryEffect(workInProgress2, current), cutOffTailIfNeeded(newProps, true), null === newProps.tail && "hidden" === newProps.tailMode && !nextResource.alternate && !isHydrating)
4863
4941
  return bubbleProperties(workInProgress2), null;
4864
4942
  } else
4865
- 2 * now() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
4943
+ 2 * now2() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
4866
4944
  newProps.isBackwards ? (nextResource.sibling = workInProgress2.child, workInProgress2.child = nextResource) : (current = newProps.last, null !== current ? current.sibling = nextResource : workInProgress2.child = nextResource, newProps.last = nextResource);
4867
4945
  }
4868
4946
  if (null !== newProps.tail)
4869
- return current = newProps.tail, newProps.rendering = current, newProps.tail = current.sibling, newProps.renderingStartTime = now(), current.sibling = null, renderLanes2 = suspenseStackCursor.current, push(
4947
+ return current = newProps.tail, newProps.rendering = current, newProps.tail = current.sibling, newProps.renderingStartTime = now2(), current.sibling = null, renderLanes2 = suspenseStackCursor.current, push(
4870
4948
  suspenseStackCursor,
4871
4949
  type ? renderLanes2 & 1 | 2 : renderLanes2 & 1
4872
4950
  ), isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount), current;
@@ -5161,19 +5239,19 @@ var require_react_reconciler_production = __commonJS({
5161
5239
  captureCommitPhaseError(finishedWork, finishedWork.return, error);
5162
5240
  }
5163
5241
  }
5164
- function commitBeforeMutationEffects(root, firstChild) {
5165
- prepareForCommit(root.containerInfo);
5242
+ function commitBeforeMutationEffects(root2, firstChild) {
5243
+ prepareForCommit(root2.containerInfo);
5166
5244
  for (nextEffect = firstChild; null !== nextEffect; )
5167
- if (root = nextEffect, firstChild = root.child, 0 !== (root.subtreeFlags & 1028) && null !== firstChild)
5168
- firstChild.return = root, nextEffect = firstChild;
5245
+ if (root2 = nextEffect, firstChild = root2.child, 0 !== (root2.subtreeFlags & 1028) && null !== firstChild)
5246
+ firstChild.return = root2, nextEffect = firstChild;
5169
5247
  else
5170
5248
  for (; null !== nextEffect; ) {
5171
- root = nextEffect;
5172
- var current = root.alternate;
5173
- firstChild = root.flags;
5174
- switch (root.tag) {
5249
+ root2 = nextEffect;
5250
+ var current = root2.alternate;
5251
+ firstChild = root2.flags;
5252
+ switch (root2.tag) {
5175
5253
  case 0:
5176
- if (0 !== (firstChild & 4) && (firstChild = root.updateQueue, firstChild = null !== firstChild ? firstChild.events : null, null !== firstChild))
5254
+ if (0 !== (firstChild & 4) && (firstChild = root2.updateQueue, firstChild = null !== firstChild ? firstChild.events : null, null !== firstChild))
5177
5255
  for (var ii = 0; ii < firstChild.length; ii++) {
5178
5256
  var _eventPayloads$ii = firstChild[ii];
5179
5257
  _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl;
@@ -5185,7 +5263,7 @@ var require_react_reconciler_production = __commonJS({
5185
5263
  case 1:
5186
5264
  if (0 !== (firstChild & 1024) && null !== current) {
5187
5265
  firstChild = void 0;
5188
- ii = root;
5266
+ ii = root2;
5189
5267
  _eventPayloads$ii = current.memoizedProps;
5190
5268
  current = current.memoizedState;
5191
5269
  var instance = ii.stateNode;
@@ -5205,7 +5283,7 @@ var require_react_reconciler_production = __commonJS({
5205
5283
  }
5206
5284
  break;
5207
5285
  case 3:
5208
- 0 !== (firstChild & 1024) && supportsMutation && clearContainer(root.stateNode.containerInfo);
5286
+ 0 !== (firstChild & 1024) && supportsMutation && clearContainer(root2.stateNode.containerInfo);
5209
5287
  break;
5210
5288
  case 5:
5211
5289
  case 26:
@@ -5218,13 +5296,13 @@ var require_react_reconciler_production = __commonJS({
5218
5296
  if (0 !== (firstChild & 1024))
5219
5297
  throw Error(formatProdErrorMessage(163));
5220
5298
  }
5221
- firstChild = root.sibling;
5299
+ firstChild = root2.sibling;
5222
5300
  if (null !== firstChild) {
5223
- firstChild.return = root.return;
5301
+ firstChild.return = root2.return;
5224
5302
  nextEffect = firstChild;
5225
5303
  break;
5226
5304
  }
5227
- nextEffect = root.return;
5305
+ nextEffect = root2.return;
5228
5306
  }
5229
5307
  }
5230
5308
  function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
@@ -5558,7 +5636,7 @@ var require_react_reconciler_production = __commonJS({
5558
5636
  var deletions = parentFiber.deletions;
5559
5637
  if (null !== deletions)
5560
5638
  for (var i = 0; i < deletions.length; i++) {
5561
- var childToDelete = deletions[i], root = root$jscomp$0, returnFiber = parentFiber;
5639
+ var childToDelete = deletions[i], root2 = root$jscomp$0, returnFiber = parentFiber;
5562
5640
  if (supportsMutation) {
5563
5641
  var parent = returnFiber;
5564
5642
  a: for (; null !== parent; ) {
@@ -5585,31 +5663,31 @@ var require_react_reconciler_production = __commonJS({
5585
5663
  parent = parent.return;
5586
5664
  }
5587
5665
  if (null === hostParent) throw Error(formatProdErrorMessage(160));
5588
- commitDeletionEffectsOnFiber(root, returnFiber, childToDelete);
5666
+ commitDeletionEffectsOnFiber(root2, returnFiber, childToDelete);
5589
5667
  hostParent = null;
5590
5668
  hostParentIsContainer = false;
5591
- } else commitDeletionEffectsOnFiber(root, returnFiber, childToDelete);
5592
- root = childToDelete.alternate;
5593
- null !== root && (root.return = null);
5669
+ } else commitDeletionEffectsOnFiber(root2, returnFiber, childToDelete);
5670
+ root2 = childToDelete.alternate;
5671
+ null !== root2 && (root2.return = null);
5594
5672
  childToDelete.return = null;
5595
5673
  }
5596
5674
  if (parentFiber.subtreeFlags & 13886)
5597
5675
  for (parentFiber = parentFiber.child; null !== parentFiber; )
5598
5676
  commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling;
5599
5677
  }
5600
- function commitMutationEffectsOnFiber(finishedWork, root) {
5678
+ function commitMutationEffectsOnFiber(finishedWork, root2) {
5601
5679
  var current = finishedWork.alternate, flags = finishedWork.flags;
5602
5680
  switch (finishedWork.tag) {
5603
5681
  case 0:
5604
5682
  case 11:
5605
5683
  case 14:
5606
5684
  case 15:
5607
- recursivelyTraverseMutationEffects(root, finishedWork);
5685
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5608
5686
  commitReconciliationEffects(finishedWork);
5609
5687
  flags & 4 && (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork), commitHookEffectListUnmount(5, finishedWork, finishedWork.return));
5610
5688
  break;
5611
5689
  case 1:
5612
- recursivelyTraverseMutationEffects(root, finishedWork);
5690
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5613
5691
  commitReconciliationEffects(finishedWork);
5614
5692
  flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
5615
5693
  flags & 64 && offscreenSubtreeIsHidden && (finishedWork = finishedWork.updateQueue, null !== finishedWork && (flags = finishedWork.callbacks, null !== flags && (current = finishedWork.shared.hiddenCallbacks, finishedWork.shared.hiddenCallbacks = null === current ? flags : current.concat(flags))));
@@ -5617,7 +5695,7 @@ var require_react_reconciler_production = __commonJS({
5617
5695
  case 26:
5618
5696
  if (supportsResources) {
5619
5697
  var hoistableRoot = currentHoistableRoot;
5620
- recursivelyTraverseMutationEffects(root, finishedWork);
5698
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5621
5699
  commitReconciliationEffects(finishedWork);
5622
5700
  flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
5623
5701
  if (flags & 4) {
@@ -5654,7 +5732,7 @@ var require_react_reconciler_production = __commonJS({
5654
5732
  }
5655
5733
  case 27:
5656
5734
  if (supportsSingletons) {
5657
- recursivelyTraverseMutationEffects(root, finishedWork);
5735
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5658
5736
  commitReconciliationEffects(finishedWork);
5659
5737
  flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
5660
5738
  null !== current && flags & 4 && commitHostUpdate(
@@ -5665,7 +5743,7 @@ var require_react_reconciler_production = __commonJS({
5665
5743
  break;
5666
5744
  }
5667
5745
  case 5:
5668
- recursivelyTraverseMutationEffects(root, finishedWork);
5746
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5669
5747
  commitReconciliationEffects(finishedWork);
5670
5748
  flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
5671
5749
  if (supportsMutation) {
@@ -5687,7 +5765,7 @@ var require_react_reconciler_production = __commonJS({
5687
5765
  supportsPersistence && null !== finishedWork.alternate && (finishedWork.alternate.stateNode = finishedWork.stateNode);
5688
5766
  break;
5689
5767
  case 6:
5690
- recursivelyTraverseMutationEffects(root, finishedWork);
5768
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5691
5769
  commitReconciliationEffects(finishedWork);
5692
5770
  if (flags & 4 && supportsMutation) {
5693
5771
  if (null === finishedWork.stateNode)
@@ -5703,18 +5781,18 @@ var require_react_reconciler_production = __commonJS({
5703
5781
  }
5704
5782
  break;
5705
5783
  case 3:
5706
- supportsResources ? (prepareToCommitHoistables(), hoistableRoot = currentHoistableRoot, currentHoistableRoot = getHoistableRoot(root.containerInfo), recursivelyTraverseMutationEffects(root, finishedWork), currentHoistableRoot = hoistableRoot) : recursivelyTraverseMutationEffects(root, finishedWork);
5784
+ supportsResources ? (prepareToCommitHoistables(), hoistableRoot = currentHoistableRoot, currentHoistableRoot = getHoistableRoot(root2.containerInfo), recursivelyTraverseMutationEffects(root2, finishedWork), currentHoistableRoot = hoistableRoot) : recursivelyTraverseMutationEffects(root2, finishedWork);
5707
5785
  commitReconciliationEffects(finishedWork);
5708
5786
  if (flags & 4) {
5709
5787
  if (supportsMutation && supportsHydration && null !== current && current.memoizedState.isDehydrated)
5710
5788
  try {
5711
- commitHydratedContainer(root.containerInfo);
5789
+ commitHydratedContainer(root2.containerInfo);
5712
5790
  } catch (error) {
5713
5791
  captureCommitPhaseError(finishedWork, finishedWork.return, error);
5714
5792
  }
5715
5793
  if (supportsPersistence) {
5716
- flags = root.containerInfo;
5717
- current = root.pendingChildren;
5794
+ flags = root2.containerInfo;
5795
+ current = root2.pendingChildren;
5718
5796
  try {
5719
5797
  replaceContainerChildren(flags, current);
5720
5798
  } catch (error) {
@@ -5727,7 +5805,7 @@ var require_react_reconciler_production = __commonJS({
5727
5805
  case 4:
5728
5806
  supportsResources ? (current = currentHoistableRoot, currentHoistableRoot = getHoistableRoot(
5729
5807
  finishedWork.stateNode.containerInfo
5730
- ), recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork), currentHoistableRoot = current) : (recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork));
5808
+ ), recursivelyTraverseMutationEffects(root2, finishedWork), commitReconciliationEffects(finishedWork), currentHoistableRoot = current) : (recursivelyTraverseMutationEffects(root2, finishedWork), commitReconciliationEffects(finishedWork));
5731
5809
  flags & 4 && supportsPersistence && commitHostPortalContainerChildren(
5732
5810
  finishedWork.stateNode,
5733
5811
  finishedWork,
@@ -5735,18 +5813,18 @@ var require_react_reconciler_production = __commonJS({
5735
5813
  );
5736
5814
  break;
5737
5815
  case 12:
5738
- recursivelyTraverseMutationEffects(root, finishedWork);
5816
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5739
5817
  commitReconciliationEffects(finishedWork);
5740
5818
  break;
5741
5819
  case 31:
5742
- recursivelyTraverseMutationEffects(root, finishedWork);
5820
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5743
5821
  commitReconciliationEffects(finishedWork);
5744
5822
  flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
5745
5823
  break;
5746
5824
  case 13:
5747
- recursivelyTraverseMutationEffects(root, finishedWork);
5825
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5748
5826
  commitReconciliationEffects(finishedWork);
5749
- finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current && null !== current.memoizedState) && (globalMostRecentFallbackTime = now());
5827
+ finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current && null !== current.memoizedState) && (globalMostRecentFallbackTime = now2());
5750
5828
  flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
5751
5829
  break;
5752
5830
  case 22:
@@ -5754,16 +5832,16 @@ var require_react_reconciler_production = __commonJS({
5754
5832
  var wasHidden = null !== current && null !== current.memoizedState, prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
5755
5833
  offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot;
5756
5834
  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
5757
- recursivelyTraverseMutationEffects(root, finishedWork);
5835
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5758
5836
  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
5759
5837
  offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
5760
5838
  commitReconciliationEffects(finishedWork);
5761
- if (flags & 8192 && (root = finishedWork.stateNode, root._visibility = hoistableRoot ? root._visibility & -2 : root._visibility | 1, hoistableRoot && (null === current || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), supportsMutation)) {
5839
+ if (flags & 8192 && (root2 = finishedWork.stateNode, root2._visibility = hoistableRoot ? root2._visibility & -2 : root2._visibility | 1, hoistableRoot && (null === current || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), supportsMutation)) {
5762
5840
  a: if (current = null, supportsMutation)
5763
- for (root = finishedWork; ; ) {
5764
- if (5 === root.tag || supportsResources && 26 === root.tag) {
5841
+ for (root2 = finishedWork; ; ) {
5842
+ if (5 === root2.tag || supportsResources && 26 === root2.tag) {
5765
5843
  if (null === current) {
5766
- wasHidden = current = root;
5844
+ wasHidden = current = root2;
5767
5845
  try {
5768
5846
  newResource = wasHidden.stateNode, hoistableRoot ? hideInstance(newResource) : unhideInstance(
5769
5847
  wasHidden.stateNode,
@@ -5773,9 +5851,9 @@ var require_react_reconciler_production = __commonJS({
5773
5851
  captureCommitPhaseError(wasHidden, wasHidden.return, error);
5774
5852
  }
5775
5853
  }
5776
- } else if (6 === root.tag) {
5854
+ } else if (6 === root2.tag) {
5777
5855
  if (null === current) {
5778
- wasHidden = root;
5856
+ wasHidden = root2;
5779
5857
  try {
5780
5858
  var instance = wasHidden.stateNode;
5781
5859
  hoistableRoot ? hideTextInstance(instance) : unhideTextInstance(instance, wasHidden.memoizedProps);
@@ -5783,9 +5861,9 @@ var require_react_reconciler_production = __commonJS({
5783
5861
  captureCommitPhaseError(wasHidden, wasHidden.return, error);
5784
5862
  }
5785
5863
  }
5786
- } else if (18 === root.tag) {
5864
+ } else if (18 === root2.tag) {
5787
5865
  if (null === current) {
5788
- wasHidden = root;
5866
+ wasHidden = root2;
5789
5867
  try {
5790
5868
  var instance$jscomp$0 = wasHidden.stateNode;
5791
5869
  hoistableRoot ? hideDehydratedBoundary(instance$jscomp$0) : unhideDehydratedBoundary(wasHidden.stateNode);
@@ -5793,27 +5871,27 @@ var require_react_reconciler_production = __commonJS({
5793
5871
  captureCommitPhaseError(wasHidden, wasHidden.return, error);
5794
5872
  }
5795
5873
  }
5796
- } else if ((22 !== root.tag && 23 !== root.tag || null === root.memoizedState || root === finishedWork) && null !== root.child) {
5797
- root.child.return = root;
5798
- root = root.child;
5874
+ } else if ((22 !== root2.tag && 23 !== root2.tag || null === root2.memoizedState || root2 === finishedWork) && null !== root2.child) {
5875
+ root2.child.return = root2;
5876
+ root2 = root2.child;
5799
5877
  continue;
5800
5878
  }
5801
- if (root === finishedWork) break a;
5802
- for (; null === root.sibling; ) {
5803
- if (null === root.return || root.return === finishedWork)
5879
+ if (root2 === finishedWork) break a;
5880
+ for (; null === root2.sibling; ) {
5881
+ if (null === root2.return || root2.return === finishedWork)
5804
5882
  break a;
5805
- current === root && (current = null);
5806
- root = root.return;
5883
+ current === root2 && (current = null);
5884
+ root2 = root2.return;
5807
5885
  }
5808
- current === root && (current = null);
5809
- root.sibling.return = root.return;
5810
- root = root.sibling;
5886
+ current === root2 && (current = null);
5887
+ root2.sibling.return = root2.return;
5888
+ root2 = root2.sibling;
5811
5889
  }
5812
5890
  }
5813
5891
  flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (current = flags.retryQueue, null !== current && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current))));
5814
5892
  break;
5815
5893
  case 19:
5816
- recursivelyTraverseMutationEffects(root, finishedWork);
5894
+ recursivelyTraverseMutationEffects(root2, finishedWork);
5817
5895
  commitReconciliationEffects(finishedWork);
5818
5896
  flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
5819
5897
  break;
@@ -5822,7 +5900,7 @@ var require_react_reconciler_production = __commonJS({
5822
5900
  case 21:
5823
5901
  break;
5824
5902
  default:
5825
- recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork);
5903
+ recursivelyTraverseMutationEffects(root2, finishedWork), commitReconciliationEffects(finishedWork);
5826
5904
  }
5827
5905
  }
5828
5906
  function commitReconciliationEffects(finishedWork) {
@@ -5880,10 +5958,10 @@ var require_react_reconciler_production = __commonJS({
5880
5958
  parentFiber = parentFiber.sibling;
5881
5959
  }
5882
5960
  }
5883
- function recursivelyTraverseLayoutEffects(root, parentFiber) {
5961
+ function recursivelyTraverseLayoutEffects(root2, parentFiber) {
5884
5962
  if (parentFiber.subtreeFlags & 8772)
5885
5963
  for (parentFiber = parentFiber.child; null !== parentFiber; )
5886
- commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
5964
+ commitLayoutEffectOnFiber(root2, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
5887
5965
  }
5888
5966
  function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
5889
5967
  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
@@ -6038,11 +6116,11 @@ var require_react_reconciler_production = __commonJS({
6038
6116
  finishedWork = finishedWork.memoizedState.cache;
6039
6117
  finishedWork !== current && (finishedWork.refCount++, null != current && releaseCache(current));
6040
6118
  }
6041
- function recursivelyTraversePassiveMountEffects(root, parentFiber, committedLanes, committedTransitions) {
6119
+ function recursivelyTraversePassiveMountEffects(root2, parentFiber, committedLanes, committedTransitions) {
6042
6120
  if (parentFiber.subtreeFlags & 10256)
6043
6121
  for (parentFiber = parentFiber.child; null !== parentFiber; )
6044
6122
  commitPassiveMountOnFiber(
6045
- root,
6123
+ root2,
6046
6124
  parentFiber,
6047
6125
  committedLanes,
6048
6126
  committedTransitions
@@ -6524,18 +6602,18 @@ var require_react_reconciler_production = __commonJS({
6524
6602
  throw Error(formatProdErrorMessage(365));
6525
6603
  }
6526
6604
  }
6527
- function findPaths(root, selectors) {
6605
+ function findPaths(root2, selectors) {
6528
6606
  var matchingFibers = [];
6529
- root = [root, 0];
6530
- for (var index = 0; index < root.length; ) {
6531
- var fiber = root[index++], tag = fiber.tag, selectorIndex = root[index++], selector = selectors[selectorIndex];
6607
+ root2 = [root2, 0];
6608
+ for (var index = 0; index < root2.length; ) {
6609
+ var fiber = root2[index++], tag = fiber.tag, selectorIndex = root2[index++], selector = selectors[selectorIndex];
6532
6610
  if (5 !== tag && 26 !== tag && 27 !== tag || !isHiddenSubtree(fiber)) {
6533
6611
  for (; null != selector && matchSelector(fiber, selector); )
6534
6612
  selectorIndex++, selector = selectors[selectorIndex];
6535
6613
  if (selectorIndex === selectors.length) matchingFibers.push(fiber);
6536
6614
  else
6537
6615
  for (fiber = fiber.child; null !== fiber; )
6538
- root.push(fiber, selectorIndex), fiber = fiber.sibling;
6616
+ root2.push(fiber, selectorIndex), fiber = fiber.sibling;
6539
6617
  }
6540
6618
  }
6541
6619
  return matchingFibers;
@@ -6571,22 +6649,22 @@ var require_react_reconciler_production = __commonJS({
6571
6649
  null !== lane && (lane.flags |= 32);
6572
6650
  return workInProgressDeferredLane;
6573
6651
  }
6574
- function scheduleUpdateOnFiber(root, fiber, lane) {
6575
- if (root === workInProgressRoot && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root.cancelPendingCommit)
6576
- prepareFreshStack(root, 0), markRootSuspended(
6577
- root,
6652
+ function scheduleUpdateOnFiber(root2, fiber, lane) {
6653
+ if (root2 === workInProgressRoot && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root2.cancelPendingCommit)
6654
+ prepareFreshStack(root2, 0), markRootSuspended(
6655
+ root2,
6578
6656
  workInProgressRootRenderLanes,
6579
6657
  workInProgressDeferredLane,
6580
6658
  false
6581
6659
  );
6582
- markRootUpdated$1(root, lane);
6583
- if (0 === (executionContext & 2) || root !== workInProgressRoot)
6584
- root === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended(
6585
- root,
6660
+ markRootUpdated$1(root2, lane);
6661
+ if (0 === (executionContext & 2) || root2 !== workInProgressRoot)
6662
+ root2 === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended(
6663
+ root2,
6586
6664
  workInProgressRootRenderLanes,
6587
6665
  workInProgressDeferredLane,
6588
6666
  false
6589
- )), ensureRootIsScheduled(root);
6667
+ )), ensureRootIsScheduled(root2);
6590
6668
  }
6591
6669
  function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
6592
6670
  if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
@@ -6611,18 +6689,18 @@ var require_react_reconciler_production = __commonJS({
6611
6689
  if (0 !== JSCompiler_inline_result) {
6612
6690
  lanes = JSCompiler_inline_result;
6613
6691
  a: {
6614
- var root = root$jscomp$0;
6692
+ var root2 = root$jscomp$0;
6615
6693
  exitStatus = workInProgressRootConcurrentErrors;
6616
- var wasRootDehydrated = supportsHydration && root.current.memoizedState.isDehydrated;
6617
- wasRootDehydrated && (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256);
6694
+ var wasRootDehydrated = supportsHydration && root2.current.memoizedState.isDehydrated;
6695
+ wasRootDehydrated && (prepareFreshStack(root2, JSCompiler_inline_result).flags |= 256);
6618
6696
  JSCompiler_inline_result = renderRootSync(
6619
- root,
6697
+ root2,
6620
6698
  JSCompiler_inline_result,
6621
6699
  false
6622
6700
  );
6623
6701
  if (2 !== JSCompiler_inline_result) {
6624
6702
  if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) {
6625
- root.errorRecoveryDisabledLanes |= renderWasConcurrent;
6703
+ root2.errorRecoveryDisabledLanes |= renderWasConcurrent;
6626
6704
  workInProgressRootInterleavedUpdatedLanes |= renderWasConcurrent;
6627
6705
  exitStatus = 4;
6628
6706
  break a;
@@ -6671,7 +6749,7 @@ var require_react_reconciler_production = __commonJS({
6671
6749
  default:
6672
6750
  throw Error(formatProdErrorMessage(329));
6673
6751
  }
6674
- if ((lanes & 62914560) === lanes && (exitStatus = globalMostRecentFallbackTime + 300 - now(), 10 < exitStatus)) {
6752
+ if ((lanes & 62914560) === lanes && (exitStatus = globalMostRecentFallbackTime + 300 - now2(), 10 < exitStatus)) {
6675
6753
  markRootSuspended(
6676
6754
  shouldTimeSlice,
6677
6755
  lanes,
@@ -6724,8 +6802,8 @@ var require_react_reconciler_production = __commonJS({
6724
6802
  } while (1);
6725
6803
  ensureRootIsScheduled(root$jscomp$0);
6726
6804
  }
6727
- function commitRootWhenReady(root, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
6728
- root.timeoutHandle = noTimeout;
6805
+ function commitRootWhenReady(root2, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
6806
+ root2.timeoutHandle = noTimeout;
6729
6807
  suspendedCommitReason = finishedWork.subtreeFlags;
6730
6808
  if (suspendedCommitReason & 8192 || 16785408 === (suspendedCommitReason & 16785408)) {
6731
6809
  suspendedCommitReason = startSuspendingCommit();
@@ -6734,17 +6812,17 @@ var require_react_reconciler_production = __commonJS({
6734
6812
  lanes,
6735
6813
  suspendedCommitReason
6736
6814
  );
6737
- var timeoutOffset = (lanes & 62914560) === lanes ? globalMostRecentFallbackTime - now() : (lanes & 4194048) === lanes ? globalMostRecentTransitionTime - now() : 0;
6815
+ var timeoutOffset = (lanes & 62914560) === lanes ? globalMostRecentFallbackTime - now2() : (lanes & 4194048) === lanes ? globalMostRecentTransitionTime - now2() : 0;
6738
6816
  timeoutOffset = waitForCommitToBeReady(
6739
6817
  suspendedCommitReason,
6740
6818
  timeoutOffset
6741
6819
  );
6742
6820
  if (null !== timeoutOffset) {
6743
6821
  pendingEffectsLanes = lanes;
6744
- root.cancelPendingCommit = timeoutOffset(
6822
+ root2.cancelPendingCommit = timeoutOffset(
6745
6823
  commitRoot.bind(
6746
6824
  null,
6747
- root,
6825
+ root2,
6748
6826
  finishedWork,
6749
6827
  lanes,
6750
6828
  recoverableErrors,
@@ -6760,12 +6838,12 @@ var require_react_reconciler_production = __commonJS({
6760
6838
  completedRenderEndTime
6761
6839
  )
6762
6840
  );
6763
- markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings);
6841
+ markRootSuspended(root2, lanes, spawnedLane, !didSkipSuspendedSiblings);
6764
6842
  return;
6765
6843
  }
6766
6844
  }
6767
6845
  commitRoot(
6768
- root,
6846
+ root2,
6769
6847
  finishedWork,
6770
6848
  lanes,
6771
6849
  recoverableErrors,
@@ -6804,19 +6882,19 @@ var require_react_reconciler_production = __commonJS({
6804
6882
  }
6805
6883
  return true;
6806
6884
  }
6807
- function markRootSuspended(root, suspendedLanes, spawnedLane, didAttemptEntireTree) {
6885
+ function markRootSuspended(root2, suspendedLanes, spawnedLane, didAttemptEntireTree) {
6808
6886
  suspendedLanes &= ~workInProgressRootPingedLanes;
6809
6887
  suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
6810
- root.suspendedLanes |= suspendedLanes;
6811
- root.pingedLanes &= ~suspendedLanes;
6812
- didAttemptEntireTree && (root.warmLanes |= suspendedLanes);
6813
- didAttemptEntireTree = root.expirationTimes;
6888
+ root2.suspendedLanes |= suspendedLanes;
6889
+ root2.pingedLanes &= ~suspendedLanes;
6890
+ didAttemptEntireTree && (root2.warmLanes |= suspendedLanes);
6891
+ didAttemptEntireTree = root2.expirationTimes;
6814
6892
  for (var lanes = suspendedLanes; 0 < lanes; ) {
6815
6893
  var index$4 = 31 - clz32(lanes), lane = 1 << index$4;
6816
6894
  didAttemptEntireTree[index$4] = -1;
6817
6895
  lanes &= ~lane;
6818
6896
  }
6819
- 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes);
6897
+ 0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, suspendedLanes);
6820
6898
  }
6821
6899
  function flushSyncWork() {
6822
6900
  return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0, false), false) : true;
@@ -6832,44 +6910,44 @@ var require_react_reconciler_production = __commonJS({
6832
6910
  workInProgress = null;
6833
6911
  }
6834
6912
  }
6835
- function prepareFreshStack(root, lanes) {
6836
- var timeoutHandle = root.timeoutHandle;
6837
- timeoutHandle !== noTimeout && (root.timeoutHandle = noTimeout, cancelTimeout(timeoutHandle));
6838
- timeoutHandle = root.cancelPendingCommit;
6839
- null !== timeoutHandle && (root.cancelPendingCommit = null, timeoutHandle());
6913
+ function prepareFreshStack(root2, lanes) {
6914
+ var timeoutHandle = root2.timeoutHandle;
6915
+ timeoutHandle !== noTimeout && (root2.timeoutHandle = noTimeout, cancelTimeout(timeoutHandle));
6916
+ timeoutHandle = root2.cancelPendingCommit;
6917
+ null !== timeoutHandle && (root2.cancelPendingCommit = null, timeoutHandle());
6840
6918
  pendingEffectsLanes = 0;
6841
6919
  resetWorkInProgressStack();
6842
- workInProgressRoot = root;
6843
- workInProgress = timeoutHandle = createWorkInProgress(root.current, null);
6920
+ workInProgressRoot = root2;
6921
+ workInProgress = timeoutHandle = createWorkInProgress(root2.current, null);
6844
6922
  workInProgressRootRenderLanes = lanes;
6845
6923
  workInProgressSuspendedReason = 0;
6846
6924
  workInProgressThrownValue = null;
6847
6925
  workInProgressRootDidSkipSuspendedSiblings = false;
6848
- workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes);
6926
+ workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root2, lanes);
6849
6927
  workInProgressRootDidAttachPingListener = false;
6850
6928
  workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = workInProgressRootExitStatus = 0;
6851
6929
  workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null;
6852
6930
  workInProgressRootDidIncludeRecursiveRenderUpdate = false;
6853
6931
  0 !== (lanes & 8) && (lanes |= lanes & 32);
6854
- var allEntangledLanes = root.entangledLanes;
6932
+ var allEntangledLanes = root2.entangledLanes;
6855
6933
  if (0 !== allEntangledLanes)
6856
- for (root = root.entanglements, allEntangledLanes &= lanes; 0 < allEntangledLanes; ) {
6934
+ for (root2 = root2.entanglements, allEntangledLanes &= lanes; 0 < allEntangledLanes; ) {
6857
6935
  var index$2 = 31 - clz32(allEntangledLanes), lane = 1 << index$2;
6858
- lanes |= root[index$2];
6936
+ lanes |= root2[index$2];
6859
6937
  allEntangledLanes &= ~lane;
6860
6938
  }
6861
6939
  entangledRenderLanes = lanes;
6862
6940
  finishQueueingConcurrentUpdates();
6863
6941
  return timeoutHandle;
6864
6942
  }
6865
- function handleThrow(root, thrownValue) {
6943
+ function handleThrow(root2, thrownValue) {
6866
6944
  currentlyRenderingFiber = null;
6867
6945
  ReactSharedInternals.H = ContextOnlyDispatcher;
6868
6946
  thrownValue === SuspenseException || thrownValue === SuspenseActionException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 3) : thrownValue === SuspenseyCommitException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 4) : workInProgressSuspendedReason = thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && "object" === typeof thrownValue && "function" === typeof thrownValue.then ? 6 : 1;
6869
6947
  workInProgressThrownValue = thrownValue;
6870
6948
  null === workInProgress && (workInProgressRootExitStatus = 1, logUncaughtError(
6871
- root,
6872
- createCapturedValueAtFiber(thrownValue, root.current)
6949
+ root2,
6950
+ createCapturedValueAtFiber(thrownValue, root2.current)
6873
6951
  ));
6874
6952
  }
6875
6953
  function shouldRemainOnPreviousScreen() {
@@ -6896,12 +6974,12 @@ var require_react_reconciler_production = __commonJS({
6896
6974
  false
6897
6975
  );
6898
6976
  }
6899
- function renderRootSync(root, lanes, shouldYieldForPrerendering) {
6977
+ function renderRootSync(root2, lanes, shouldYieldForPrerendering) {
6900
6978
  var prevExecutionContext = executionContext;
6901
6979
  executionContext |= 2;
6902
6980
  var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
6903
- if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes)
6904
- workInProgressTransitions = null, prepareFreshStack(root, lanes);
6981
+ if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes)
6982
+ workInProgressTransitions = null, prepareFreshStack(root2, lanes);
6905
6983
  lanes = false;
6906
6984
  var exitStatus = workInProgressRootExitStatus;
6907
6985
  a: do
@@ -6921,24 +6999,24 @@ var require_react_reconciler_production = __commonJS({
6921
6999
  var reason = workInProgressSuspendedReason;
6922
7000
  workInProgressSuspendedReason = 0;
6923
7001
  workInProgressThrownValue = null;
6924
- throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason);
7002
+ throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
6925
7003
  if (shouldYieldForPrerendering && workInProgressRootIsPrerendering) {
6926
7004
  exitStatus = 0;
6927
7005
  break a;
6928
7006
  }
6929
7007
  break;
6930
7008
  default:
6931
- reason = workInProgressSuspendedReason, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason);
7009
+ reason = workInProgressSuspendedReason, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
6932
7010
  }
6933
7011
  }
6934
7012
  workLoopSync();
6935
7013
  exitStatus = workInProgressRootExitStatus;
6936
7014
  break;
6937
7015
  } catch (thrownValue$152) {
6938
- handleThrow(root, thrownValue$152);
7016
+ handleThrow(root2, thrownValue$152);
6939
7017
  }
6940
7018
  while (1);
6941
- lanes && root.shellSuspendCounter++;
7019
+ lanes && root2.shellSuspendCounter++;
6942
7020
  lastContextDependency = currentlyRenderingFiber$1 = null;
6943
7021
  executionContext = prevExecutionContext;
6944
7022
  ReactSharedInternals.H = prevDispatcher;
@@ -6949,12 +7027,12 @@ var require_react_reconciler_production = __commonJS({
6949
7027
  function workLoopSync() {
6950
7028
  for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
6951
7029
  }
6952
- function renderRootConcurrent(root, lanes) {
7030
+ function renderRootConcurrent(root2, lanes) {
6953
7031
  var prevExecutionContext = executionContext;
6954
7032
  executionContext |= 2;
6955
7033
  var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
6956
- workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes ? (workInProgressTransitions = null, workInProgressRootRenderTargetTime = now() + 500, prepareFreshStack(root, lanes)) : workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
6957
- root,
7034
+ workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes ? (workInProgressTransitions = null, workInProgressRootRenderTargetTime = now2() + 500, prepareFreshStack(root2, lanes)) : workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
7035
+ root2,
6958
7036
  lanes
6959
7037
  );
6960
7038
  a: do
@@ -6966,7 +7044,7 @@ var require_react_reconciler_production = __commonJS({
6966
7044
  case 1:
6967
7045
  workInProgressSuspendedReason = 0;
6968
7046
  workInProgressThrownValue = null;
6969
- throwAndUnwindWorkLoop(root, lanes, thrownValue, 1);
7047
+ throwAndUnwindWorkLoop(root2, lanes, thrownValue, 1);
6970
7048
  break;
6971
7049
  case 2:
6972
7050
  case 9:
@@ -6977,8 +7055,8 @@ var require_react_reconciler_production = __commonJS({
6977
7055
  break;
6978
7056
  }
6979
7057
  lanes = function() {
6980
- 2 !== workInProgressSuspendedReason && 9 !== workInProgressSuspendedReason || workInProgressRoot !== root || (workInProgressSuspendedReason = 7);
6981
- ensureRootIsScheduled(root);
7058
+ 2 !== workInProgressSuspendedReason && 9 !== workInProgressSuspendedReason || workInProgressRoot !== root2 || (workInProgressSuspendedReason = 7);
7059
+ ensureRootIsScheduled(root2);
6982
7060
  };
6983
7061
  thrownValue.then(lanes, lanes);
6984
7062
  break a;
@@ -6989,7 +7067,7 @@ var require_react_reconciler_production = __commonJS({
6989
7067
  workInProgressSuspendedReason = 5;
6990
7068
  break a;
6991
7069
  case 7:
6992
- isThenableResolved(thrownValue) ? (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root, lanes, thrownValue, 7));
7070
+ isThenableResolved(thrownValue) ? (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, lanes, thrownValue, 7));
6993
7071
  break;
6994
7072
  case 5:
6995
7073
  var resource = null;
@@ -7013,12 +7091,12 @@ var require_react_reconciler_production = __commonJS({
7013
7091
  }
7014
7092
  workInProgressSuspendedReason = 0;
7015
7093
  workInProgressThrownValue = null;
7016
- throwAndUnwindWorkLoop(root, lanes, thrownValue, 5);
7094
+ throwAndUnwindWorkLoop(root2, lanes, thrownValue, 5);
7017
7095
  break;
7018
7096
  case 6:
7019
7097
  workInProgressSuspendedReason = 0;
7020
7098
  workInProgressThrownValue = null;
7021
- throwAndUnwindWorkLoop(root, lanes, thrownValue, 6);
7099
+ throwAndUnwindWorkLoop(root2, lanes, thrownValue, 6);
7022
7100
  break;
7023
7101
  case 8:
7024
7102
  resetWorkInProgressStack();
@@ -7031,7 +7109,7 @@ var require_react_reconciler_production = __commonJS({
7031
7109
  workLoopConcurrentByScheduler();
7032
7110
  break;
7033
7111
  } catch (thrownValue$154) {
7034
- handleThrow(root, thrownValue$154);
7112
+ handleThrow(root2, thrownValue$154);
7035
7113
  }
7036
7114
  while (1);
7037
7115
  lastContextDependency = currentlyRenderingFiber$1 = null;
@@ -7090,7 +7168,7 @@ var require_react_reconciler_production = __commonJS({
7090
7168
  unitOfWork.memoizedProps = unitOfWork.pendingProps;
7091
7169
  null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
7092
7170
  }
7093
- function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, suspendedReason) {
7171
+ function throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, suspendedReason) {
7094
7172
  lastContextDependency = currentlyRenderingFiber$1 = null;
7095
7173
  resetHooksOnUnwind(unitOfWork);
7096
7174
  thenableState$1 = null;
@@ -7098,7 +7176,7 @@ var require_react_reconciler_production = __commonJS({
7098
7176
  var returnFiber = unitOfWork.return;
7099
7177
  try {
7100
7178
  if (throwException(
7101
- root,
7179
+ root2,
7102
7180
  returnFiber,
7103
7181
  unitOfWork,
7104
7182
  thrownValue,
@@ -7106,8 +7184,8 @@ var require_react_reconciler_production = __commonJS({
7106
7184
  )) {
7107
7185
  workInProgressRootExitStatus = 1;
7108
7186
  logUncaughtError(
7109
- root,
7110
- createCapturedValueAtFiber(thrownValue, root.current)
7187
+ root2,
7188
+ createCapturedValueAtFiber(thrownValue, root2.current)
7111
7189
  );
7112
7190
  workInProgress = null;
7113
7191
  return;
@@ -7116,19 +7194,19 @@ var require_react_reconciler_production = __commonJS({
7116
7194
  if (null !== returnFiber) throw workInProgress = returnFiber, error;
7117
7195
  workInProgressRootExitStatus = 1;
7118
7196
  logUncaughtError(
7119
- root,
7120
- createCapturedValueAtFiber(thrownValue, root.current)
7197
+ root2,
7198
+ createCapturedValueAtFiber(thrownValue, root2.current)
7121
7199
  );
7122
7200
  workInProgress = null;
7123
7201
  return;
7124
7202
  }
7125
7203
  if (unitOfWork.flags & 32768) {
7126
- if (isHydrating || 1 === suspendedReason) root = true;
7204
+ if (isHydrating || 1 === suspendedReason) root2 = true;
7127
7205
  else if (workInProgressRootIsPrerendering || 0 !== (workInProgressRootRenderLanes & 536870912))
7128
- root = false;
7129
- else if (workInProgressRootDidSkipSuspendedSiblings = root = true, 2 === suspendedReason || 9 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
7206
+ root2 = false;
7207
+ else if (workInProgressRootDidSkipSuspendedSiblings = root2 = true, 2 === suspendedReason || 9 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
7130
7208
  suspendedReason = suspenseHandlerStackCursor.current, null !== suspendedReason && 13 === suspendedReason.tag && (suspendedReason.flags |= 16384);
7131
- unwindUnitOfWork(unitOfWork, root);
7209
+ unwindUnitOfWork(unitOfWork, root2);
7132
7210
  } else completeUnitOfWork(unitOfWork);
7133
7211
  }
7134
7212
  function completeUnitOfWork(unitOfWork) {
@@ -7179,36 +7257,36 @@ var require_react_reconciler_production = __commonJS({
7179
7257
  workInProgressRootExitStatus = 6;
7180
7258
  workInProgress = null;
7181
7259
  }
7182
- function commitRoot(root, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes) {
7183
- root.cancelPendingCommit = null;
7260
+ function commitRoot(root2, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes) {
7261
+ root2.cancelPendingCommit = null;
7184
7262
  do
7185
7263
  flushPendingEffects();
7186
7264
  while (0 !== pendingEffectsStatus);
7187
7265
  if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
7188
7266
  if (null !== finishedWork) {
7189
- if (finishedWork === root.current)
7267
+ if (finishedWork === root2.current)
7190
7268
  throw Error(formatProdErrorMessage(177));
7191
7269
  didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
7192
7270
  didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
7193
7271
  markRootFinished(
7194
- root,
7272
+ root2,
7195
7273
  lanes,
7196
7274
  didIncludeRenderPhaseUpdate,
7197
7275
  spawnedLane,
7198
7276
  updatedLanes,
7199
7277
  suspendedRetryLanes
7200
7278
  );
7201
- root === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
7279
+ root2 === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
7202
7280
  pendingFinishedWork = finishedWork;
7203
- pendingEffectsRoot = root;
7281
+ pendingEffectsRoot = root2;
7204
7282
  pendingEffectsLanes = lanes;
7205
7283
  pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
7206
7284
  pendingPassiveTransitions = transitions;
7207
7285
  pendingRecoverableErrors = recoverableErrors;
7208
- 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root.callbackNode = null, root.callbackPriority = 0, scheduleCallback(NormalPriority$1, function() {
7286
+ 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root2.callbackNode = null, root2.callbackPriority = 0, scheduleCallback(NormalPriority$1, function() {
7209
7287
  flushPassiveEffects();
7210
7288
  return null;
7211
- })) : (root.callbackNode = null, root.callbackPriority = 0);
7289
+ })) : (root2.callbackNode = null, root2.callbackPriority = 0);
7212
7290
  recoverableErrors = 0 !== (finishedWork.flags & 13878);
7213
7291
  if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
7214
7292
  recoverableErrors = ReactSharedInternals.T;
@@ -7218,7 +7296,7 @@ var require_react_reconciler_production = __commonJS({
7218
7296
  spawnedLane = executionContext;
7219
7297
  executionContext |= 4;
7220
7298
  try {
7221
- commitBeforeMutationEffects(root, finishedWork, lanes);
7299
+ commitBeforeMutationEffects(root2, finishedWork, lanes);
7222
7300
  } finally {
7223
7301
  executionContext = spawnedLane, setCurrentUpdatePriority(transitions), ReactSharedInternals.T = recoverableErrors;
7224
7302
  }
@@ -7232,7 +7310,7 @@ var require_react_reconciler_production = __commonJS({
7232
7310
  function flushMutationEffects() {
7233
7311
  if (1 === pendingEffectsStatus) {
7234
7312
  pendingEffectsStatus = 0;
7235
- var root = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
7313
+ var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
7236
7314
  if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
7237
7315
  rootMutationHasEffect = ReactSharedInternals.T;
7238
7316
  ReactSharedInternals.T = null;
@@ -7241,19 +7319,19 @@ var require_react_reconciler_production = __commonJS({
7241
7319
  var prevExecutionContext = executionContext;
7242
7320
  executionContext |= 4;
7243
7321
  try {
7244
- commitMutationEffectsOnFiber(finishedWork, root), resetAfterCommit(root.containerInfo);
7322
+ commitMutationEffectsOnFiber(finishedWork, root2), resetAfterCommit(root2.containerInfo);
7245
7323
  } finally {
7246
7324
  executionContext = prevExecutionContext, setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = rootMutationHasEffect;
7247
7325
  }
7248
7326
  }
7249
- root.current = finishedWork;
7327
+ root2.current = finishedWork;
7250
7328
  pendingEffectsStatus = 2;
7251
7329
  }
7252
7330
  }
7253
7331
  function flushLayoutEffects() {
7254
7332
  if (2 === pendingEffectsStatus) {
7255
7333
  pendingEffectsStatus = 0;
7256
- var root = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
7334
+ var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
7257
7335
  if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
7258
7336
  rootHasLayoutEffect = ReactSharedInternals.T;
7259
7337
  ReactSharedInternals.T = null;
@@ -7262,7 +7340,7 @@ var require_react_reconciler_production = __commonJS({
7262
7340
  var prevExecutionContext = executionContext;
7263
7341
  executionContext |= 4;
7264
7342
  try {
7265
- commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork);
7343
+ commitLayoutEffectOnFiber(root2, finishedWork.alternate, finishedWork);
7266
7344
  } finally {
7267
7345
  executionContext = prevExecutionContext, setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = rootHasLayoutEffect;
7268
7346
  }
@@ -7274,9 +7352,9 @@ var require_react_reconciler_production = __commonJS({
7274
7352
  if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) {
7275
7353
  pendingEffectsStatus = 0;
7276
7354
  requestPaint();
7277
- var root = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors;
7278
- 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? pendingEffectsStatus = 5 : (pendingEffectsStatus = 0, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(root, root.pendingLanes));
7279
- var remainingLanes = root.pendingLanes;
7355
+ var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors;
7356
+ 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? pendingEffectsStatus = 5 : (pendingEffectsStatus = 0, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(root2, root2.pendingLanes));
7357
+ var remainingLanes = root2.pendingLanes;
7280
7358
  0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
7281
7359
  lanesToEventPriority(lanes);
7282
7360
  finishedWork = finishedWork.stateNode;
@@ -7296,7 +7374,7 @@ var require_react_reconciler_production = __commonJS({
7296
7374
  setCurrentUpdatePriority(2);
7297
7375
  ReactSharedInternals.T = null;
7298
7376
  try {
7299
- for (var onRecoverableError = root.onRecoverableError, i = 0; i < recoverableErrors.length; i++) {
7377
+ for (var onRecoverableError = root2.onRecoverableError, i = 0; i < recoverableErrors.length; i++) {
7300
7378
  var recoverableError = recoverableErrors[i];
7301
7379
  onRecoverableError(recoverableError.value, {
7302
7380
  componentStack: recoverableError.stack
@@ -7307,15 +7385,15 @@ var require_react_reconciler_production = __commonJS({
7307
7385
  }
7308
7386
  }
7309
7387
  0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
7310
- ensureRootIsScheduled(root);
7311
- remainingLanes = root.pendingLanes;
7312
- 0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root) : nestedUpdateCount = 0;
7388
+ ensureRootIsScheduled(root2);
7389
+ remainingLanes = root2.pendingLanes;
7390
+ 0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) ? root2 === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root2) : nestedUpdateCount = 0;
7313
7391
  supportsHydration && flushHydrationEvents();
7314
7392
  flushSyncWorkAcrossRoots_impl(0, false);
7315
7393
  }
7316
7394
  }
7317
- function releaseRootPooledCache(root, remainingLanes) {
7318
- 0 === (root.pooledCacheLanes &= remainingLanes) && (remainingLanes = root.pooledCache, null != remainingLanes && (root.pooledCache = null, releaseCache(remainingLanes)));
7395
+ function releaseRootPooledCache(root2, remainingLanes) {
7396
+ 0 === (root2.pooledCacheLanes &= remainingLanes) && (remainingLanes = root2.pooledCache, null != remainingLanes && (root2.pooledCache = null, releaseCache(remainingLanes)));
7319
7397
  }
7320
7398
  function flushPendingEffects() {
7321
7399
  flushMutationEffects();
@@ -7325,7 +7403,7 @@ var require_react_reconciler_production = __commonJS({
7325
7403
  }
7326
7404
  function flushPassiveEffects() {
7327
7405
  if (5 !== pendingEffectsStatus) return false;
7328
- var root = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
7406
+ var root2 = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
7329
7407
  pendingEffectsRemainingLanes = 0;
7330
7408
  var renderPriority = lanesToEventPriority(pendingEffectsLanes), priority = 32 > renderPriority ? 32 : renderPriority;
7331
7409
  renderPriority = ReactSharedInternals.T;
@@ -7359,7 +7437,7 @@ var require_react_reconciler_production = __commonJS({
7359
7437
  }
7360
7438
  return true;
7361
7439
  } finally {
7362
- setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = renderPriority, releaseRootPooledCache(root, remainingLanes);
7440
+ setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = renderPriority, releaseRootPooledCache(root2, remainingLanes);
7363
7441
  }
7364
7442
  }
7365
7443
  function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
@@ -7398,23 +7476,23 @@ var require_react_reconciler_production = __commonJS({
7398
7476
  nearestMountedAncestor = nearestMountedAncestor.return;
7399
7477
  }
7400
7478
  }
7401
- function attachPingListener(root, wakeable, lanes) {
7402
- var pingCache = root.pingCache;
7479
+ function attachPingListener(root2, wakeable, lanes) {
7480
+ var pingCache = root2.pingCache;
7403
7481
  if (null === pingCache) {
7404
- pingCache = root.pingCache = new PossiblyWeakMap();
7482
+ pingCache = root2.pingCache = new PossiblyWeakMap();
7405
7483
  var threadIDs = /* @__PURE__ */ new Set();
7406
7484
  pingCache.set(wakeable, threadIDs);
7407
7485
  } else
7408
7486
  threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = /* @__PURE__ */ new Set(), pingCache.set(wakeable, threadIDs));
7409
- threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), root = pingSuspendedRoot.bind(null, root, wakeable, lanes), wakeable.then(root, root));
7487
+ threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), root2 = pingSuspendedRoot.bind(null, root2, wakeable, lanes), wakeable.then(root2, root2));
7410
7488
  }
7411
- function pingSuspendedRoot(root, wakeable, pingedLanes) {
7412
- var pingCache = root.pingCache;
7489
+ function pingSuspendedRoot(root2, wakeable, pingedLanes) {
7490
+ var pingCache = root2.pingCache;
7413
7491
  null !== pingCache && pingCache.delete(wakeable);
7414
- root.pingedLanes |= root.suspendedLanes & pingedLanes;
7415
- root.warmLanes &= ~pingedLanes;
7416
- workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
7417
- ensureRootIsScheduled(root);
7492
+ root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
7493
+ root2.warmLanes &= ~pingedLanes;
7494
+ workInProgressRoot === root2 && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && 300 > now2() - globalMostRecentFallbackTime ? 0 === (executionContext & 2) && prepareFreshStack(root2, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
7495
+ ensureRootIsScheduled(root2);
7418
7496
  }
7419
7497
  function retryTimedOutBoundary(boundaryFiber, retryLane) {
7420
7498
  0 === retryLane && (retryLane = claimNextRetryLane());
@@ -7689,7 +7767,7 @@ var require_react_reconciler_production = __commonJS({
7689
7767
  }
7690
7768
  var exports2 = {};
7691
7769
  "use strict";
7692
- var React6 = __require("react"), Scheduler = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
7770
+ var React6 = require_react(), Scheduler = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
7693
7771
  /* @__PURE__ */ Symbol.for("react.scope");
7694
7772
  var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
7695
7773
  /* @__PURE__ */ Symbol.for("react.legacy_hidden");
@@ -7746,7 +7824,7 @@ var require_react_reconciler_production = __commonJS({
7746
7824
  $$$config.diffHydratedPropsForDevWarnings;
7747
7825
  $$$config.diffHydratedTextForDevWarnings;
7748
7826
  $$$config.describeHydratableInstanceForDevWarnings;
7749
- var validateHydratableInstance = $$$config.validateHydratableInstance, validateHydratableTextInstance = $$$config.validateHydratableTextInstance, supportsResources = $$$config.supportsResources, isHostHoistableType = $$$config.isHostHoistableType, getHoistableRoot = $$$config.getHoistableRoot, getResource = $$$config.getResource, acquireResource = $$$config.acquireResource, releaseResource = $$$config.releaseResource, hydrateHoistable = $$$config.hydrateHoistable, mountHoistable = $$$config.mountHoistable, unmountHoistable = $$$config.unmountHoistable, createHoistableInstance = $$$config.createHoistableInstance, prepareToCommitHoistables = $$$config.prepareToCommitHoistables, mayResourceSuspendCommit = $$$config.mayResourceSuspendCommit, preloadResource = $$$config.preloadResource, suspendResource = $$$config.suspendResource, supportsSingletons = $$$config.supportsSingletons, resolveSingletonInstance = $$$config.resolveSingletonInstance, acquireSingletonInstance = $$$config.acquireSingletonInstance, releaseSingletonInstance = $$$config.releaseSingletonInstance, isHostSingletonType = $$$config.isHostSingletonType, isSingletonScope = $$$config.isSingletonScope, valueStack = [], index$jscomp$0 = -1, emptyContextObject = {}, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now = Scheduler.unstable_now, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, IdlePriority = Scheduler.unstable_IdlePriority, log = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, objectIs = "function" === typeof Object.is ? Object.is : is, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
7827
+ var validateHydratableInstance = $$$config.validateHydratableInstance, validateHydratableTextInstance = $$$config.validateHydratableTextInstance, supportsResources = $$$config.supportsResources, isHostHoistableType = $$$config.isHostHoistableType, getHoistableRoot = $$$config.getHoistableRoot, getResource = $$$config.getResource, acquireResource = $$$config.acquireResource, releaseResource = $$$config.releaseResource, hydrateHoistable = $$$config.hydrateHoistable, mountHoistable = $$$config.mountHoistable, unmountHoistable = $$$config.unmountHoistable, createHoistableInstance = $$$config.createHoistableInstance, prepareToCommitHoistables = $$$config.prepareToCommitHoistables, mayResourceSuspendCommit = $$$config.mayResourceSuspendCommit, preloadResource = $$$config.preloadResource, suspendResource = $$$config.suspendResource, supportsSingletons = $$$config.supportsSingletons, resolveSingletonInstance = $$$config.resolveSingletonInstance, acquireSingletonInstance = $$$config.acquireSingletonInstance, releaseSingletonInstance = $$$config.releaseSingletonInstance, isHostSingletonType = $$$config.isHostSingletonType, isSingletonScope = $$$config.isSingletonScope, valueStack = [], index$jscomp$0 = -1, emptyContextObject = {}, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now2 = Scheduler.unstable_now, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, IdlePriority = Scheduler.unstable_IdlePriority, log = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, objectIs = "function" === typeof Object.is ? Object.is : is, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
7750
7828
  if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
7751
7829
  var event = new window.ErrorEvent("error", {
7752
7830
  bubbles: true,
@@ -7760,7 +7838,7 @@ var require_react_reconciler_production = __commonJS({
7760
7838
  return;
7761
7839
  }
7762
7840
  console.error(error);
7763
- }, hasOwnProperty = Object.prototype.hasOwnProperty, prefix, suffix, reentry = false, CapturedStacks = /* @__PURE__ */ new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "", contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage(519)), valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null, AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
7841
+ }, hasOwnProperty2 = Object.prototype.hasOwnProperty, prefix, suffix, reentry = false, CapturedStacks = /* @__PURE__ */ new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "", contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage(519)), valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null, AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
7764
7842
  var listeners = [], signal = this.signal = {
7765
7843
  aborted: false,
7766
7844
  addEventListener: function(type, listener) {
@@ -7782,7 +7860,7 @@ var require_react_reconciler_production = __commonJS({
7782
7860
  _threadCount: 0
7783
7861
  }, firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = false, mightHavePendingSyncWork = false, isFlushingWork = false, currentEventTransitionLane = 0, currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null, prevOnStartTransitionFinish = ReactSharedInternals.S;
7784
7862
  ReactSharedInternals.S = function(transition, returnValue) {
7785
- globalMostRecentTransitionTime = now();
7863
+ globalMostRecentTransitionTime = now2();
7786
7864
  "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && entangleAsyncAction(transition, returnValue);
7787
7865
  null !== prevOnStartTransitionFinish && prevOnStartTransitionFinish(transition, returnValue);
7788
7866
  };
@@ -8147,8 +8225,8 @@ var require_react_reconciler_production = __commonJS({
8147
8225
  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;
8148
8226
  exports2.attemptContinuousHydration = function(fiber) {
8149
8227
  if (13 === fiber.tag || 31 === fiber.tag) {
8150
- var root = enqueueConcurrentRenderForLane(fiber, 67108864);
8151
- null !== root && scheduleUpdateOnFiber(root, fiber, 67108864);
8228
+ var root2 = enqueueConcurrentRenderForLane(fiber, 67108864);
8229
+ null !== root2 && scheduleUpdateOnFiber(root2, fiber, 67108864);
8152
8230
  markRetryLaneIfNotHydrated(fiber, 67108864);
8153
8231
  }
8154
8232
  };
@@ -8156,8 +8234,8 @@ var require_react_reconciler_production = __commonJS({
8156
8234
  if (13 === fiber.tag || 31 === fiber.tag) {
8157
8235
  var lane = requestUpdateLane();
8158
8236
  lane = getBumpedLaneForHydrationByLane(lane);
8159
- var root = enqueueConcurrentRenderForLane(fiber, lane);
8160
- null !== root && scheduleUpdateOnFiber(root, fiber, lane);
8237
+ var root2 = enqueueConcurrentRenderForLane(fiber, lane);
8238
+ null !== root2 && scheduleUpdateOnFiber(root2, fiber, lane);
8161
8239
  markRetryLaneIfNotHydrated(fiber, lane);
8162
8240
  }
8163
8241
  };
@@ -8175,7 +8253,7 @@ var require_react_reconciler_production = __commonJS({
8175
8253
  lanes &= ~lane;
8176
8254
  }
8177
8255
  ensureRootIsScheduled(fiber);
8178
- 0 === (executionContext & 6) && (workInProgressRootRenderTargetTime = now() + 500, flushSyncWorkAcrossRoots_impl(0, false));
8256
+ 0 === (executionContext & 6) && (workInProgressRootRenderTargetTime = now2() + 500, flushSyncWorkAcrossRoots_impl(0, false));
8179
8257
  }
8180
8258
  }
8181
8259
  break;
@@ -8278,7 +8356,7 @@ var require_react_reconciler_production = __commonJS({
8278
8356
  try {
8279
8357
  return setCurrentUpdatePriority(2), ReactSharedInternals.T = null, fn(a, b, c, d);
8280
8358
  } finally {
8281
- setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition, 0 === executionContext && (workInProgressRootRenderTargetTime = now() + 500);
8359
+ setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition, 0 === executionContext && (workInProgressRootRenderTargetTime = now2() + 500);
8282
8360
  }
8283
8361
  };
8284
8362
  exports2.findAllNodes = findAllNodes;
@@ -8433,7 +8511,7 @@ var require_react_reconciler_production = __commonJS({
8433
8511
  queue,
8434
8512
  pendingState,
8435
8513
  NotPendingTransition,
8436
- null === action ? noop3 : function() {
8514
+ null === action ? noop2 : function() {
8437
8515
  var stateHook = ensureFormComponentIsStateful(formFiber);
8438
8516
  null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);
8439
8517
  dispatchSetStateInternal(
@@ -8514,6 +8592,140 @@ var require_constants = __commonJS({
8514
8592
  }
8515
8593
  });
8516
8594
 
8595
+ // node_modules/lodash.debounce/index.js
8596
+ var require_lodash = __commonJS({
8597
+ "node_modules/lodash.debounce/index.js"(exports, module) {
8598
+ "use strict";
8599
+ var FUNC_ERROR_TEXT3 = "Expected a function";
8600
+ var NAN2 = 0 / 0;
8601
+ var symbolTag2 = "[object Symbol]";
8602
+ var reTrim = /^\s+|\s+$/g;
8603
+ var reIsBadHex2 = /^[-+]0x[0-9a-f]+$/i;
8604
+ var reIsBinary2 = /^0b[01]+$/i;
8605
+ var reIsOctal2 = /^0o[0-7]+$/i;
8606
+ var freeParseInt2 = parseInt;
8607
+ var freeGlobal2 = typeof global == "object" && global && global.Object === Object && global;
8608
+ var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
8609
+ var root2 = freeGlobal2 || freeSelf2 || Function("return this")();
8610
+ var objectProto3 = Object.prototype;
8611
+ var objectToString2 = objectProto3.toString;
8612
+ var nativeMax2 = Math.max;
8613
+ var nativeMin2 = Math.min;
8614
+ var now2 = function() {
8615
+ return root2.Date.now();
8616
+ };
8617
+ function debounce3(func, wait, options) {
8618
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
8619
+ if (typeof func != "function") {
8620
+ throw new TypeError(FUNC_ERROR_TEXT3);
8621
+ }
8622
+ wait = toNumber2(wait) || 0;
8623
+ if (isObject2(options)) {
8624
+ leading = !!options.leading;
8625
+ maxing = "maxWait" in options;
8626
+ maxWait = maxing ? nativeMax2(toNumber2(options.maxWait) || 0, wait) : maxWait;
8627
+ trailing = "trailing" in options ? !!options.trailing : trailing;
8628
+ }
8629
+ function invokeFunc(time) {
8630
+ var args = lastArgs, thisArg = lastThis;
8631
+ lastArgs = lastThis = void 0;
8632
+ lastInvokeTime = time;
8633
+ result = func.apply(thisArg, args);
8634
+ return result;
8635
+ }
8636
+ function leadingEdge2(time) {
8637
+ lastInvokeTime = time;
8638
+ timerId = setTimeout(timerExpired, wait);
8639
+ return leading ? invokeFunc(time) : result;
8640
+ }
8641
+ function remainingWait(time) {
8642
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result2 = wait - timeSinceLastCall;
8643
+ return maxing ? nativeMin2(result2, maxWait - timeSinceLastInvoke) : result2;
8644
+ }
8645
+ function shouldInvoke(time) {
8646
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
8647
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
8648
+ }
8649
+ function timerExpired() {
8650
+ var time = now2();
8651
+ if (shouldInvoke(time)) {
8652
+ return trailingEdge2(time);
8653
+ }
8654
+ timerId = setTimeout(timerExpired, remainingWait(time));
8655
+ }
8656
+ function trailingEdge2(time) {
8657
+ timerId = void 0;
8658
+ if (trailing && lastArgs) {
8659
+ return invokeFunc(time);
8660
+ }
8661
+ lastArgs = lastThis = void 0;
8662
+ return result;
8663
+ }
8664
+ function cancel() {
8665
+ if (timerId !== void 0) {
8666
+ clearTimeout(timerId);
8667
+ }
8668
+ lastInvokeTime = 0;
8669
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
8670
+ }
8671
+ function flush() {
8672
+ return timerId === void 0 ? result : trailingEdge2(now2());
8673
+ }
8674
+ function debounced() {
8675
+ var time = now2(), isInvoking = shouldInvoke(time);
8676
+ lastArgs = arguments;
8677
+ lastThis = this;
8678
+ lastCallTime = time;
8679
+ if (isInvoking) {
8680
+ if (timerId === void 0) {
8681
+ return leadingEdge2(lastCallTime);
8682
+ }
8683
+ if (maxing) {
8684
+ timerId = setTimeout(timerExpired, wait);
8685
+ return invokeFunc(lastCallTime);
8686
+ }
8687
+ }
8688
+ if (timerId === void 0) {
8689
+ timerId = setTimeout(timerExpired, wait);
8690
+ }
8691
+ return result;
8692
+ }
8693
+ debounced.cancel = cancel;
8694
+ debounced.flush = flush;
8695
+ return debounced;
8696
+ }
8697
+ function isObject2(value) {
8698
+ var type = typeof value;
8699
+ return !!value && (type == "object" || type == "function");
8700
+ }
8701
+ function isObjectLike2(value) {
8702
+ return !!value && typeof value == "object";
8703
+ }
8704
+ function isSymbol2(value) {
8705
+ return typeof value == "symbol" || isObjectLike2(value) && objectToString2.call(value) == symbolTag2;
8706
+ }
8707
+ function toNumber2(value) {
8708
+ if (typeof value == "number") {
8709
+ return value;
8710
+ }
8711
+ if (isSymbol2(value)) {
8712
+ return NAN2;
8713
+ }
8714
+ if (isObject2(value)) {
8715
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
8716
+ value = isObject2(other) ? other + "" : other;
8717
+ }
8718
+ if (typeof value != "string") {
8719
+ return value === 0 ? value : +value;
8720
+ }
8721
+ value = value.replace(reTrim, "");
8722
+ var isBinary = reIsBinary2.test(value);
8723
+ return isBinary || reIsOctal2.test(value) ? freeParseInt2(value.slice(2), isBinary ? 2 : 8) : reIsBadHex2.test(value) ? NAN2 : +value;
8724
+ }
8725
+ module.exports = debounce3;
8726
+ }
8727
+ });
8728
+
8517
8729
  // node_modules/escape-string-regexp/index.js
8518
8730
  var require_escape_string_regexp = __commonJS({
8519
8731
  "node_modules/escape-string-regexp/index.js"(exports, module) {
@@ -8782,10 +8994,10 @@ var require_stack_utils = __commonJS({
8782
8994
  });
8783
8995
 
8784
8996
  // src/claude-ink/index.ts
8785
- import { useMemo as useMemo3 } from "react";
8997
+ var import_react16 = __toESM(require_react(), 1);
8786
8998
 
8787
8999
  // src/claude-ink/components/Box.tsx
8788
- import { c as _c } from "react/compiler-runtime";
9000
+ var import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
8789
9001
 
8790
9002
  // src/utils/debug.ts
8791
9003
  function logForDebugging(_message) {
@@ -8801,9 +9013,9 @@ function ifNotInteger(value, name) {
8801
9013
  }
8802
9014
 
8803
9015
  // src/claude-ink/components/Box.tsx
8804
- import { jsx } from "react/jsx-runtime";
9016
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
8805
9017
  function Box(t0) {
8806
- const $ = _c(42);
9018
+ const $ = (0, import_compiler_runtime.c)(42);
8807
9019
  let autoFocus;
8808
9020
  let children;
8809
9021
  let flexDirection;
@@ -8943,7 +9155,7 @@ function Box(t0) {
8943
9155
  }
8944
9156
  let t4;
8945
9157
  if ($[27] !== autoFocus || $[28] !== children || $[29] !== onBlur || $[30] !== onBlurCapture || $[31] !== onClick || $[32] !== onFocus || $[33] !== onFocusCapture || $[34] !== onKeyDown || $[35] !== onKeyDownCapture || $[36] !== onMouseEnter || $[37] !== onMouseLeave || $[38] !== ref || $[39] !== t3 || $[40] !== tabIndex) {
8946
- t4 = /* @__PURE__ */ jsx("ink-box", { ref, tabIndex, autoFocus, onClick, onFocus, onFocusCapture, onBlur, onBlurCapture, onMouseEnter, onMouseLeave, onKeyDown, onKeyDownCapture, style: t3, children });
9158
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ink-box", { ref, tabIndex, autoFocus, onClick, onFocus, onFocusCapture, onBlur, onBlurCapture, onMouseEnter, onMouseLeave, onKeyDown, onKeyDownCapture, style: t3, children });
8947
9159
  $[27] = autoFocus;
8948
9160
  $[28] = children;
8949
9161
  $[29] = onBlur;
@@ -8967,8 +9179,8 @@ function Box(t0) {
8967
9179
  var Box_default = Box;
8968
9180
 
8969
9181
  // src/claude-ink/components/Text.tsx
8970
- import { c as _c2 } from "react/compiler-runtime";
8971
- import { jsx as jsx2 } from "react/jsx-runtime";
9182
+ var import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
9183
+ var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
8972
9184
  var memoizedStylesForWrap = {
8973
9185
  wrap: {
8974
9186
  flexGrow: 0,
@@ -9020,7 +9232,7 @@ var memoizedStylesForWrap = {
9020
9232
  }
9021
9233
  };
9022
9234
  function Text(t0) {
9023
- const $ = _c2(29);
9235
+ const $ = (0, import_compiler_runtime2.c)(29);
9024
9236
  const {
9025
9237
  color,
9026
9238
  backgroundColor,
@@ -9149,7 +9361,7 @@ function Text(t0) {
9149
9361
  const t15 = memoizedStylesForWrap[wrap];
9150
9362
  let t16;
9151
9363
  if ($[25] !== children || $[26] !== t15 || $[27] !== textStyles) {
9152
- t16 = /* @__PURE__ */ jsx2("ink-text", { style: t15, textStyles, children });
9364
+ t16 = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ink-text", { style: t15, textStyles, children });
9153
9365
  $[25] = children;
9154
9366
  $[26] = t15;
9155
9367
  $[27] = textStyles;
@@ -9161,7 +9373,7 @@ function Text(t0) {
9161
9373
  }
9162
9374
 
9163
9375
  // src/claude-ink/components/ScrollBox.tsx
9164
- import { useImperativeHandle, useRef, useState } from "react";
9376
+ var import_react = __toESM(require_react(), 1);
9165
9377
 
9166
9378
  // src/bootstrap/state.ts
9167
9379
  var lastInteraction = Date.now();
@@ -10038,7 +10250,7 @@ function layoutNode(node, availableWidth, availableHeight, widthMode, heightMode
10038
10250
  layout.height = node._lOutH;
10039
10251
  return;
10040
10252
  }
10041
- if (node._cN > 0 && (sameGen || !node.isDirty_)) {
10253
+ if (node._cN > 0 && (sameGen || !node.isDirty_) && (!performLayout || node.children.length === 0)) {
10042
10254
  const cIn = node._cIn;
10043
10255
  for (let i = 0; i < node._cN; i++) {
10044
10256
  const o = i * 8;
@@ -11327,8 +11539,10 @@ function createLayoutNode() {
11327
11539
  return createYogaLayoutNode();
11328
11540
  }
11329
11541
 
11330
- // src/claude-ink/stringWidth.ts
11331
- import emojiRegex from "emoji-regex";
11542
+ // node_modules/emoji-regex/index.mjs
11543
+ var emoji_regex_default = () => {
11544
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
11545
+ };
11332
11546
 
11333
11547
  // node_modules/get-east-asian-width/lookup-data.js
11334
11548
  var ambiguousMinimalCodePoint = 161;
@@ -11436,7 +11650,7 @@ function stripAnsi(string) {
11436
11650
  }
11437
11651
 
11438
11652
  // src/claude-ink/stringWidth.ts
11439
- var EMOJI_REGEX = emojiRegex();
11653
+ var EMOJI_REGEX = emoji_regex_default();
11440
11654
  function stringWidthJavaScript(str) {
11441
11655
  if (typeof str !== "string" || str.length === 0) {
11442
11656
  return 0;
@@ -13273,9 +13487,9 @@ var clearYogaNodeReferences = (node) => {
13273
13487
  }
13274
13488
  node.yogaNode = void 0;
13275
13489
  };
13276
- function findOwnerChainAtRow(root, y) {
13490
+ function findOwnerChainAtRow(root2, y) {
13277
13491
  let best = [];
13278
- walk(root, 0);
13492
+ walk(root2, 0);
13279
13493
  return best;
13280
13494
  function walk(node, offsetY) {
13281
13495
  const yoga = node.yogaNode;
@@ -13586,12 +13800,12 @@ var FocusManager = class {
13586
13800
  * Handles both the exact node and any focused descendant within
13587
13801
  * the removed subtree. Dispatches blur and restores focus from stack.
13588
13802
  */
13589
- handleNodeRemoved(node, root) {
13803
+ handleNodeRemoved(node, root2) {
13590
13804
  this.focusStack = this.focusStack.filter(
13591
- (n) => n !== node && isInTree(n, root)
13805
+ (n) => n !== node && isInTree(n, root2)
13592
13806
  );
13593
13807
  if (!this.activeElement) return;
13594
- if (this.activeElement !== node && isInTree(this.activeElement, root)) {
13808
+ if (this.activeElement !== node && isInTree(this.activeElement, root2)) {
13595
13809
  return;
13596
13810
  }
13597
13811
  const removed = this.activeElement;
@@ -13599,7 +13813,7 @@ var FocusManager = class {
13599
13813
  this.dispatchFocusEvent(removed, new FocusEvent("blur", null));
13600
13814
  while (this.focusStack.length > 0) {
13601
13815
  const candidate = this.focusStack.pop();
13602
- if (isInTree(candidate, root)) {
13816
+ if (isInTree(candidate, root2)) {
13603
13817
  this.activeElement = candidate;
13604
13818
  this.dispatchFocusEvent(candidate, new FocusEvent("focus", removed));
13605
13819
  return;
@@ -13620,15 +13834,15 @@ var FocusManager = class {
13620
13834
  disable() {
13621
13835
  this.enabled = false;
13622
13836
  }
13623
- focusNext(root) {
13624
- this.moveFocus(1, root);
13837
+ focusNext(root2) {
13838
+ this.moveFocus(1, root2);
13625
13839
  }
13626
- focusPrevious(root) {
13627
- this.moveFocus(-1, root);
13840
+ focusPrevious(root2) {
13841
+ this.moveFocus(-1, root2);
13628
13842
  }
13629
- moveFocus(direction, root) {
13843
+ moveFocus(direction, root2) {
13630
13844
  if (!this.enabled) return;
13631
- const tabbable = collectTabbable(root);
13845
+ const tabbable = collectTabbable(root2);
13632
13846
  if (tabbable.length === 0) return;
13633
13847
  const currentIndex = this.activeElement ? tabbable.indexOf(this.activeElement) : -1;
13634
13848
  const nextIndex = currentIndex === -1 ? direction === 1 ? 0 : tabbable.length - 1 : (currentIndex + direction + tabbable.length) % tabbable.length;
@@ -13638,9 +13852,9 @@ var FocusManager = class {
13638
13852
  }
13639
13853
  }
13640
13854
  };
13641
- function collectTabbable(root) {
13855
+ function collectTabbable(root2) {
13642
13856
  const result = [];
13643
- walkTree(root, result);
13857
+ walkTree(root2, result);
13644
13858
  return result;
13645
13859
  }
13646
13860
  function walkTree(node, result) {
@@ -13654,10 +13868,10 @@ function walkTree(node, result) {
13654
13868
  }
13655
13869
  }
13656
13870
  }
13657
- function isInTree(node, root) {
13871
+ function isInTree(node, root2) {
13658
13872
  let current = node;
13659
13873
  while (current) {
13660
- if (current === root) return true;
13874
+ if (current === root2) return true;
13661
13875
  current = current.parentNode;
13662
13876
  }
13663
13877
  return false;
@@ -14098,29 +14312,29 @@ var reconciler = (0, import_react_reconciler.default)({
14098
14312
  _lastCommitMs = _commitStart > 0 ? performance.now() - _commitStart : 0;
14099
14313
  _commitStart = 0;
14100
14314
  if (COMMIT_LOG) {
14101
- const now = performance.now();
14315
+ const now2 = performance.now();
14102
14316
  _commits++;
14103
- const gap = _lastCommitAt > 0 ? now - _lastCommitAt : 0;
14317
+ const gap = _lastCommitAt > 0 ? now2 - _lastCommitAt : 0;
14104
14318
  if (gap > _maxGapMs) _maxGapMs = gap;
14105
- _lastCommitAt = now;
14106
- const reconcileMs = _prepareAt > 0 ? now - _prepareAt : 0;
14319
+ _lastCommitAt = now2;
14320
+ const reconcileMs = _prepareAt > 0 ? now2 - _prepareAt : 0;
14107
14321
  if (gap > 30 || reconcileMs > 20 || _createCount > 50) {
14108
14322
  appendFileSync(
14109
14323
  COMMIT_LOG,
14110
- `${now.toFixed(1)} gap=${gap.toFixed(1)}ms reconcile=${reconcileMs.toFixed(1)}ms creates=${_createCount}
14324
+ `${now2.toFixed(1)} gap=${gap.toFixed(1)}ms reconcile=${reconcileMs.toFixed(1)}ms creates=${_createCount}
14111
14325
  `
14112
14326
  );
14113
14327
  }
14114
14328
  _createCount = 0;
14115
- if (now - _lastLog > 1e3) {
14329
+ if (now2 - _lastLog > 1e3) {
14116
14330
  appendFileSync(
14117
14331
  COMMIT_LOG,
14118
- `${now.toFixed(1)} commits=${_commits}/s maxGap=${_maxGapMs.toFixed(1)}ms
14332
+ `${now2.toFixed(1)} commits=${_commits}/s maxGap=${_maxGapMs.toFixed(1)}ms
14119
14333
  `
14120
14334
  );
14121
14335
  _commits = 0;
14122
14336
  _maxGapMs = 0;
14123
- _lastLog = now;
14337
+ _lastLog = now2;
14124
14338
  }
14125
14339
  }
14126
14340
  const _t0 = COMMIT_LOG ? performance.now() : 0;
@@ -14278,8 +14492,8 @@ var reconciler = (0, import_react_reconciler.default)({
14278
14492
  removeChildNode(node, removeNode);
14279
14493
  cleanupYogaNode(removeNode);
14280
14494
  if (removeNode.nodeName !== "#text") {
14281
- const root = getRootNode(node);
14282
- root.focusManager.handleNodeRemoved(removeNode, root);
14495
+ const root2 = getRootNode(node);
14496
+ root2.focusManager.handleNodeRemoved(removeNode, root2);
14283
14497
  }
14284
14498
  },
14285
14499
  // React 19 required methods
@@ -14327,17 +14541,17 @@ dispatcher.discreteUpdates = reconciler.discreteUpdates.bind(reconciler);
14327
14541
  var reconciler_default = reconciler;
14328
14542
 
14329
14543
  // src/claude-ink/components/ScrollBox.tsx
14330
- import { jsx as jsx3 } from "react/jsx-runtime";
14544
+ var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
14331
14545
  function ScrollBox({
14332
14546
  children,
14333
14547
  ref,
14334
14548
  stickyScroll,
14335
14549
  ...style
14336
14550
  }) {
14337
- const domRef = useRef(null);
14338
- const [, forceRender] = useState(0);
14339
- const listenersRef = useRef(/* @__PURE__ */ new Set());
14340
- const renderQueuedRef = useRef(false);
14551
+ const domRef = (0, import_react.useRef)(null);
14552
+ const [, forceRender] = (0, import_react.useState)(0);
14553
+ const listenersRef = (0, import_react.useRef)(/* @__PURE__ */ new Set());
14554
+ const renderQueuedRef = (0, import_react.useRef)(false);
14341
14555
  const notify = () => {
14342
14556
  for (const l of listenersRef.current) l();
14343
14557
  };
@@ -14353,7 +14567,7 @@ function ScrollBox({
14353
14567
  scheduleRenderFrom(el);
14354
14568
  });
14355
14569
  }
14356
- useImperativeHandle(
14570
+ (0, import_react.useImperativeHandle)(
14357
14571
  ref,
14358
14572
  () => ({
14359
14573
  scrollTo(y) {
@@ -14434,7 +14648,7 @@ function ScrollBox({
14434
14648
  // eslint-disable-next-line react-hooks/exhaustive-deps
14435
14649
  []
14436
14650
  );
14437
- return /* @__PURE__ */ jsx3("ink-box", { ref: (el) => {
14651
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ink-box", { ref: (el) => {
14438
14652
  domRef.current = el;
14439
14653
  if (el) el.scrollTop ??= 0;
14440
14654
  }, style: {
@@ -14447,13 +14661,13 @@ function ScrollBox({
14447
14661
  overflowY: "scroll"
14448
14662
  }, ...stickyScroll ? {
14449
14663
  stickyScroll: true
14450
- } : {}, children: /* @__PURE__ */ jsx3(Box_default, { flexDirection: "column", flexGrow: 1, flexShrink: 0, width: "100%", children }) });
14664
+ } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { flexDirection: "column", flexGrow: 1, flexShrink: 0, width: "100%", children }) });
14451
14665
  }
14452
14666
  var ScrollBox_default = ScrollBox;
14453
14667
 
14454
14668
  // src/claude-ink/components/AlternateScreen.tsx
14455
- import { c as _c3 } from "react/compiler-runtime";
14456
- import { useContext as useContext2, useInsertionEffect } from "react";
14669
+ var import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
14670
+ var import_react4 = __toESM(require_react(), 1);
14457
14671
 
14458
14672
  // src/claude-ink/instances.ts
14459
14673
  var instances = /* @__PURE__ */ new Map();
@@ -14492,10 +14706,10 @@ var ENABLE_MOUSE_TRACKING = decset(DEC.MOUSE_NORMAL) + decset(DEC.MOUSE_BUTTON)
14492
14706
  var DISABLE_MOUSE_TRACKING = decreset(DEC.MOUSE_SGR) + decreset(DEC.MOUSE_ANY) + decreset(DEC.MOUSE_BUTTON) + decreset(DEC.MOUSE_NORMAL);
14493
14707
 
14494
14708
  // src/claude-ink/useTerminalNotification.ts
14495
- import { createContext, useCallback, useContext, useMemo } from "react";
14709
+ var import_react2 = __toESM(require_react(), 1);
14496
14710
 
14497
14711
  // src/claude-ink/terminal.ts
14498
- import { coerce } from "semver";
14712
+ var import_semver = __toESM(require_semver(), 1);
14499
14713
 
14500
14714
  // src/utils/env.ts
14501
14715
  function terminalName() {
@@ -14736,15 +14950,16 @@ function isXtermJs() {
14736
14950
  return xtversionName?.startsWith("xterm.js") ?? false;
14737
14951
  }
14738
14952
  var EXTENDED_KEYS_TERMINALS = [
14739
- "iTerm.app",
14953
+ // env.terminal is normalized to lowercase in utils/env.ts.
14954
+ "iterm.app",
14740
14955
  "kitty",
14741
- "WezTerm",
14956
+ "wezterm",
14742
14957
  "ghostty",
14743
14958
  "tmux",
14744
14959
  "windows-terminal"
14745
14960
  ];
14746
- function supportsExtendedKeys() {
14747
- return EXTENDED_KEYS_TERMINALS.includes(env.terminal ?? "");
14961
+ function supportsExtendedKeys(terminal = env.terminal) {
14962
+ return EXTENDED_KEYS_TERMINALS.includes(terminal?.toLowerCase() ?? "");
14748
14963
  }
14749
14964
  var SYNC_OUTPUT_SUPPORTED = isSynchronizedOutputSupported();
14750
14965
  function writeDiffToTerminal(terminal, diff2, skipSyncMarkers = false) {
@@ -14794,24 +15009,24 @@ function writeDiffToTerminal(terminal, diff2, skipSyncMarkers = false) {
14794
15009
  }
14795
15010
 
14796
15011
  // src/claude-ink/useTerminalNotification.ts
14797
- var TerminalWriteContext = createContext(null);
15012
+ var TerminalWriteContext = (0, import_react2.createContext)(null);
14798
15013
  var TerminalWriteProvider = TerminalWriteContext.Provider;
14799
15014
 
14800
15015
  // src/claude-ink/components/TerminalSizeContext.tsx
14801
- import { createContext as createContext2 } from "react";
14802
- var TerminalSizeContext = createContext2(null);
15016
+ var import_react3 = __toESM(require_react(), 1);
15017
+ var TerminalSizeContext = (0, import_react3.createContext)(null);
14803
15018
 
14804
15019
  // src/claude-ink/components/AlternateScreen.tsx
14805
- import { jsx as jsx4 } from "react/jsx-runtime";
15020
+ var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
14806
15021
  function AlternateScreen(t0) {
14807
- const $ = _c3(7);
15022
+ const $ = (0, import_compiler_runtime3.c)(7);
14808
15023
  const {
14809
15024
  children,
14810
15025
  mouseTracking: t1
14811
15026
  } = t0;
14812
15027
  const mouseTracking = t1 === void 0 ? true : t1;
14813
- const size = useContext2(TerminalSizeContext);
14814
- const writeRaw = useContext2(TerminalWriteContext);
15028
+ const size = (0, import_react4.useContext)(TerminalSizeContext);
15029
+ const writeRaw = (0, import_react4.useContext)(TerminalWriteContext);
14815
15030
  let t2;
14816
15031
  let t3;
14817
15032
  if ($[0] !== mouseTracking || $[1] !== writeRaw) {
@@ -14837,11 +15052,11 @@ function AlternateScreen(t0) {
14837
15052
  t2 = $[2];
14838
15053
  t3 = $[3];
14839
15054
  }
14840
- useInsertionEffect(t2, t3);
15055
+ (0, import_react4.useInsertionEffect)(t2, t3);
14841
15056
  const t4 = size?.rows ?? 24;
14842
15057
  let t5;
14843
15058
  if ($[4] !== children || $[5] !== t4) {
14844
- t5 = /* @__PURE__ */ jsx4(Box_default, { flexDirection: "column", height: t4, width: "100%", flexShrink: 0, children });
15059
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { flexDirection: "column", height: t4, width: "100%", flexShrink: 0, children });
14845
15060
  $[4] = children;
14846
15061
  $[5] = t4;
14847
15062
  $[6] = t5;
@@ -14852,11 +15067,11 @@ function AlternateScreen(t0) {
14852
15067
  }
14853
15068
 
14854
15069
  // src/claude-ink/hooks/use-app.ts
14855
- import { useContext as useContext3 } from "react";
15070
+ var import_react6 = __toESM(require_react(), 1);
14856
15071
 
14857
15072
  // src/claude-ink/components/AppContext.ts
14858
- import { createContext as createContext3 } from "react";
14859
- var AppContext = createContext3({
15073
+ var import_react5 = __toESM(require_react(), 1);
15074
+ var AppContext = (0, import_react5.createContext)({
14860
15075
  exit() {
14861
15076
  }
14862
15077
  });
@@ -14864,18 +15079,34 @@ AppContext.displayName = "InternalAppContext";
14864
15079
  var AppContext_default = AppContext;
14865
15080
 
14866
15081
  // src/claude-ink/hooks/use-app.ts
14867
- var useApp = () => useContext3(AppContext_default);
15082
+ var useApp = () => (0, import_react6.useContext)(AppContext_default);
14868
15083
  var use_app_default = useApp;
14869
15084
 
14870
15085
  // src/claude-ink/hooks/use-input.ts
14871
- import { useEffect, useLayoutEffect } from "react";
14872
- import { useEventCallback } from "usehooks-ts";
15086
+ var import_react10 = __toESM(require_react(), 1);
15087
+
15088
+ // node_modules/usehooks-ts/dist/index.js
15089
+ var import_react7 = __toESM(require_react(), 1);
15090
+ var import_lodash = __toESM(require_lodash(), 1);
15091
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react7.useLayoutEffect : import_react7.useEffect;
15092
+ function useEventCallback(fn) {
15093
+ const ref = (0, import_react7.useRef)(() => {
15094
+ throw new Error("Cannot call an event handler while rendering.");
15095
+ });
15096
+ useIsomorphicLayoutEffect(() => {
15097
+ ref.current = fn;
15098
+ }, [fn]);
15099
+ return (0, import_react7.useCallback)((...args) => {
15100
+ var _a;
15101
+ return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
15102
+ }, [ref]);
15103
+ }
14873
15104
 
14874
15105
  // src/claude-ink/hooks/use-stdin.ts
14875
- import { useContext as useContext4 } from "react";
15106
+ var import_react9 = __toESM(require_react(), 1);
14876
15107
 
14877
15108
  // src/claude-ink/components/StdinContext.ts
14878
- import { createContext as createContext4 } from "react";
15109
+ var import_react8 = __toESM(require_react(), 1);
14879
15110
 
14880
15111
  // src/claude-ink/events/emitter.ts
14881
15112
  import { EventEmitter as NodeEventEmitter } from "events";
@@ -14904,7 +15135,7 @@ var EventEmitter = class extends NodeEventEmitter {
14904
15135
  };
14905
15136
 
14906
15137
  // src/claude-ink/components/StdinContext.ts
14907
- var StdinContext = createContext4({
15138
+ var StdinContext = (0, import_react8.createContext)({
14908
15139
  stdin: process.stdin,
14909
15140
  internal_eventEmitter: new EventEmitter(),
14910
15141
  setRawMode() {
@@ -14917,13 +15148,13 @@ StdinContext.displayName = "InternalStdinContext";
14917
15148
  var StdinContext_default = StdinContext;
14918
15149
 
14919
15150
  // src/claude-ink/hooks/use-stdin.ts
14920
- var useStdin = () => useContext4(StdinContext_default);
15151
+ var useStdin = () => (0, import_react9.useContext)(StdinContext_default);
14921
15152
  var use_stdin_default = useStdin;
14922
15153
 
14923
15154
  // src/claude-ink/hooks/use-input.ts
14924
15155
  var useInput = (inputHandler, options = {}) => {
14925
15156
  const { setRawMode, internal_exitOnCtrlC, internal_eventEmitter } = use_stdin_default();
14926
- useLayoutEffect(() => {
15157
+ (0, import_react10.useLayoutEffect)(() => {
14927
15158
  if (options.isActive === false) {
14928
15159
  return;
14929
15160
  }
@@ -14941,7 +15172,7 @@ var useInput = (inputHandler, options = {}) => {
14941
15172
  inputHandler(input, key, event);
14942
15173
  }
14943
15174
  });
14944
- useEffect(() => {
15175
+ (0, import_react10.useEffect)(() => {
14945
15176
  internal_eventEmitter?.on("input", handleData);
14946
15177
  return () => {
14947
15178
  internal_eventEmitter?.removeListener("input", handleData);
@@ -14963,7 +15194,7 @@ var getAllProperties = (object) => {
14963
15194
  } while ((object = Reflect.getPrototypeOf(object)) && object !== Object.prototype);
14964
15195
  return properties;
14965
15196
  };
14966
- function autoBind(self, { include, exclude } = {}) {
15197
+ function autoBind(self2, { include, exclude } = {}) {
14967
15198
  const filter = (key) => {
14968
15199
  const match = (pattern) => typeof pattern === "string" ? key === pattern : pattern.test(key);
14969
15200
  if (include) {
@@ -14974,39 +15205,527 @@ function autoBind(self, { include, exclude } = {}) {
14974
15205
  }
14975
15206
  return true;
14976
15207
  };
14977
- for (const [object, key] of getAllProperties(self.constructor.prototype)) {
15208
+ for (const [object, key] of getAllProperties(self2.constructor.prototype)) {
14978
15209
  if (key === "constructor" || !filter(key)) {
14979
15210
  continue;
14980
15211
  }
14981
15212
  const descriptor = Reflect.getOwnPropertyDescriptor(object, key);
14982
15213
  if (descriptor && typeof descriptor.value === "function") {
14983
- self[key] = self[key].bind(self);
15214
+ self2[key] = self2[key].bind(self2);
14984
15215
  }
14985
15216
  }
14986
- return self;
15217
+ return self2;
14987
15218
  }
14988
15219
 
14989
15220
  // src/claude-ink/ink.tsx
14990
- var import_constants4 = __toESM(require_constants(), 1);
14991
15221
  import { closeSync, constants as fsConstants, openSync, readSync, writeSync } from "fs";
14992
- import noop2 from "lodash-es/noop.js";
14993
- import throttle from "lodash-es/throttle.js";
14994
- import { onExit } from "signal-exit";
15222
+
15223
+ // node_modules/lodash-es/noop.js
15224
+ function noop() {
15225
+ }
15226
+ var noop_default = noop;
15227
+
15228
+ // node_modules/lodash-es/isObject.js
15229
+ function isObject(value) {
15230
+ var type = typeof value;
15231
+ return value != null && (type == "object" || type == "function");
15232
+ }
15233
+ var isObject_default = isObject;
15234
+
15235
+ // node_modules/lodash-es/_freeGlobal.js
15236
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
15237
+ var freeGlobal_default = freeGlobal;
15238
+
15239
+ // node_modules/lodash-es/_root.js
15240
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
15241
+ var root = freeGlobal_default || freeSelf || Function("return this")();
15242
+ var root_default = root;
15243
+
15244
+ // node_modules/lodash-es/now.js
15245
+ var now = function() {
15246
+ return root_default.Date.now();
15247
+ };
15248
+ var now_default = now;
15249
+
15250
+ // node_modules/lodash-es/_trimmedEndIndex.js
15251
+ var reWhitespace = /\s/;
15252
+ function trimmedEndIndex(string) {
15253
+ var index = string.length;
15254
+ while (index-- && reWhitespace.test(string.charAt(index))) {
15255
+ }
15256
+ return index;
15257
+ }
15258
+ var trimmedEndIndex_default = trimmedEndIndex;
15259
+
15260
+ // node_modules/lodash-es/_baseTrim.js
15261
+ var reTrimStart = /^\s+/;
15262
+ function baseTrim(string) {
15263
+ return string ? string.slice(0, trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
15264
+ }
15265
+ var baseTrim_default = baseTrim;
15266
+
15267
+ // node_modules/lodash-es/_Symbol.js
15268
+ var Symbol2 = root_default.Symbol;
15269
+ var Symbol_default = Symbol2;
15270
+
15271
+ // node_modules/lodash-es/_getRawTag.js
15272
+ var objectProto = Object.prototype;
15273
+ var hasOwnProperty = objectProto.hasOwnProperty;
15274
+ var nativeObjectToString = objectProto.toString;
15275
+ var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
15276
+ function getRawTag(value) {
15277
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
15278
+ try {
15279
+ value[symToStringTag] = void 0;
15280
+ var unmasked = true;
15281
+ } catch (e) {
15282
+ }
15283
+ var result = nativeObjectToString.call(value);
15284
+ if (unmasked) {
15285
+ if (isOwn) {
15286
+ value[symToStringTag] = tag;
15287
+ } else {
15288
+ delete value[symToStringTag];
15289
+ }
15290
+ }
15291
+ return result;
15292
+ }
15293
+ var getRawTag_default = getRawTag;
15294
+
15295
+ // node_modules/lodash-es/_objectToString.js
15296
+ var objectProto2 = Object.prototype;
15297
+ var nativeObjectToString2 = objectProto2.toString;
15298
+ function objectToString(value) {
15299
+ return nativeObjectToString2.call(value);
15300
+ }
15301
+ var objectToString_default = objectToString;
15302
+
15303
+ // node_modules/lodash-es/_baseGetTag.js
15304
+ var nullTag = "[object Null]";
15305
+ var undefinedTag = "[object Undefined]";
15306
+ var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
15307
+ function baseGetTag(value) {
15308
+ if (value == null) {
15309
+ return value === void 0 ? undefinedTag : nullTag;
15310
+ }
15311
+ return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
15312
+ }
15313
+ var baseGetTag_default = baseGetTag;
15314
+
15315
+ // node_modules/lodash-es/isObjectLike.js
15316
+ function isObjectLike(value) {
15317
+ return value != null && typeof value == "object";
15318
+ }
15319
+ var isObjectLike_default = isObjectLike;
15320
+
15321
+ // node_modules/lodash-es/isSymbol.js
15322
+ var symbolTag = "[object Symbol]";
15323
+ function isSymbol(value) {
15324
+ return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
15325
+ }
15326
+ var isSymbol_default = isSymbol;
15327
+
15328
+ // node_modules/lodash-es/toNumber.js
15329
+ var NAN = 0 / 0;
15330
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
15331
+ var reIsBinary = /^0b[01]+$/i;
15332
+ var reIsOctal = /^0o[0-7]+$/i;
15333
+ var freeParseInt = parseInt;
15334
+ function toNumber(value) {
15335
+ if (typeof value == "number") {
15336
+ return value;
15337
+ }
15338
+ if (isSymbol_default(value)) {
15339
+ return NAN;
15340
+ }
15341
+ if (isObject_default(value)) {
15342
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
15343
+ value = isObject_default(other) ? other + "" : other;
15344
+ }
15345
+ if (typeof value != "string") {
15346
+ return value === 0 ? value : +value;
15347
+ }
15348
+ value = baseTrim_default(value);
15349
+ var isBinary = reIsBinary.test(value);
15350
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
15351
+ }
15352
+ var toNumber_default = toNumber;
15353
+
15354
+ // node_modules/lodash-es/debounce.js
15355
+ var FUNC_ERROR_TEXT = "Expected a function";
15356
+ var nativeMax = Math.max;
15357
+ var nativeMin = Math.min;
15358
+ function debounce2(func, wait, options) {
15359
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
15360
+ if (typeof func != "function") {
15361
+ throw new TypeError(FUNC_ERROR_TEXT);
15362
+ }
15363
+ wait = toNumber_default(wait) || 0;
15364
+ if (isObject_default(options)) {
15365
+ leading = !!options.leading;
15366
+ maxing = "maxWait" in options;
15367
+ maxWait = maxing ? nativeMax(toNumber_default(options.maxWait) || 0, wait) : maxWait;
15368
+ trailing = "trailing" in options ? !!options.trailing : trailing;
15369
+ }
15370
+ function invokeFunc(time) {
15371
+ var args = lastArgs, thisArg = lastThis;
15372
+ lastArgs = lastThis = void 0;
15373
+ lastInvokeTime = time;
15374
+ result = func.apply(thisArg, args);
15375
+ return result;
15376
+ }
15377
+ function leadingEdge2(time) {
15378
+ lastInvokeTime = time;
15379
+ timerId = setTimeout(timerExpired, wait);
15380
+ return leading ? invokeFunc(time) : result;
15381
+ }
15382
+ function remainingWait(time) {
15383
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
15384
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
15385
+ }
15386
+ function shouldInvoke(time) {
15387
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
15388
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
15389
+ }
15390
+ function timerExpired() {
15391
+ var time = now_default();
15392
+ if (shouldInvoke(time)) {
15393
+ return trailingEdge2(time);
15394
+ }
15395
+ timerId = setTimeout(timerExpired, remainingWait(time));
15396
+ }
15397
+ function trailingEdge2(time) {
15398
+ timerId = void 0;
15399
+ if (trailing && lastArgs) {
15400
+ return invokeFunc(time);
15401
+ }
15402
+ lastArgs = lastThis = void 0;
15403
+ return result;
15404
+ }
15405
+ function cancel() {
15406
+ if (timerId !== void 0) {
15407
+ clearTimeout(timerId);
15408
+ }
15409
+ lastInvokeTime = 0;
15410
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
15411
+ }
15412
+ function flush() {
15413
+ return timerId === void 0 ? result : trailingEdge2(now_default());
15414
+ }
15415
+ function debounced() {
15416
+ var time = now_default(), isInvoking = shouldInvoke(time);
15417
+ lastArgs = arguments;
15418
+ lastThis = this;
15419
+ lastCallTime = time;
15420
+ if (isInvoking) {
15421
+ if (timerId === void 0) {
15422
+ return leadingEdge2(lastCallTime);
15423
+ }
15424
+ if (maxing) {
15425
+ clearTimeout(timerId);
15426
+ timerId = setTimeout(timerExpired, wait);
15427
+ return invokeFunc(lastCallTime);
15428
+ }
15429
+ }
15430
+ if (timerId === void 0) {
15431
+ timerId = setTimeout(timerExpired, wait);
15432
+ }
15433
+ return result;
15434
+ }
15435
+ debounced.cancel = cancel;
15436
+ debounced.flush = flush;
15437
+ return debounced;
15438
+ }
15439
+ var debounce_default = debounce2;
15440
+
15441
+ // node_modules/lodash-es/throttle.js
15442
+ var FUNC_ERROR_TEXT2 = "Expected a function";
15443
+ function throttle(func, wait, options) {
15444
+ var leading = true, trailing = true;
15445
+ if (typeof func != "function") {
15446
+ throw new TypeError(FUNC_ERROR_TEXT2);
15447
+ }
15448
+ if (isObject_default(options)) {
15449
+ leading = "leading" in options ? !!options.leading : leading;
15450
+ trailing = "trailing" in options ? !!options.trailing : trailing;
15451
+ }
15452
+ return debounce_default(func, wait, {
15453
+ "leading": leading,
15454
+ "maxWait": wait,
15455
+ "trailing": trailing
15456
+ });
15457
+ }
15458
+ var throttle_default = throttle;
15459
+
15460
+ // src/claude-ink/ink.tsx
15461
+ var import_constants4 = __toESM(require_constants(), 1);
15462
+
15463
+ // node_modules/signal-exit/dist/mjs/signals.js
15464
+ var signals = [];
15465
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
15466
+ if (process.platform !== "win32") {
15467
+ signals.push(
15468
+ "SIGALRM",
15469
+ "SIGABRT",
15470
+ "SIGVTALRM",
15471
+ "SIGXCPU",
15472
+ "SIGXFSZ",
15473
+ "SIGUSR2",
15474
+ "SIGTRAP",
15475
+ "SIGSYS",
15476
+ "SIGQUIT",
15477
+ "SIGIOT"
15478
+ // should detect profiler and enable/disable accordingly.
15479
+ // see #21
15480
+ // 'SIGPROF'
15481
+ );
15482
+ }
15483
+ if (process.platform === "linux") {
15484
+ signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
15485
+ }
15486
+
15487
+ // node_modules/signal-exit/dist/mjs/index.js
15488
+ var processOk = (process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
15489
+ var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
15490
+ var global2 = globalThis;
15491
+ var ObjectDefineProperty = Object.defineProperty.bind(Object);
15492
+ var Emitter = class {
15493
+ emitted = {
15494
+ afterExit: false,
15495
+ exit: false
15496
+ };
15497
+ listeners = {
15498
+ afterExit: [],
15499
+ exit: []
15500
+ };
15501
+ count = 0;
15502
+ id = Math.random();
15503
+ constructor() {
15504
+ if (global2[kExitEmitter]) {
15505
+ return global2[kExitEmitter];
15506
+ }
15507
+ ObjectDefineProperty(global2, kExitEmitter, {
15508
+ value: this,
15509
+ writable: false,
15510
+ enumerable: false,
15511
+ configurable: false
15512
+ });
15513
+ }
15514
+ on(ev, fn) {
15515
+ this.listeners[ev].push(fn);
15516
+ }
15517
+ removeListener(ev, fn) {
15518
+ const list = this.listeners[ev];
15519
+ const i = list.indexOf(fn);
15520
+ if (i === -1) {
15521
+ return;
15522
+ }
15523
+ if (i === 0 && list.length === 1) {
15524
+ list.length = 0;
15525
+ } else {
15526
+ list.splice(i, 1);
15527
+ }
15528
+ }
15529
+ emit(ev, code, signal) {
15530
+ if (this.emitted[ev]) {
15531
+ return false;
15532
+ }
15533
+ this.emitted[ev] = true;
15534
+ let ret = false;
15535
+ for (const fn of this.listeners[ev]) {
15536
+ ret = fn(code, signal) === true || ret;
15537
+ }
15538
+ if (ev === "exit") {
15539
+ ret = this.emit("afterExit", code, signal) || ret;
15540
+ }
15541
+ return ret;
15542
+ }
15543
+ };
15544
+ var SignalExitBase = class {
15545
+ };
15546
+ var signalExitWrap = (handler) => {
15547
+ return {
15548
+ onExit(cb, opts) {
15549
+ return handler.onExit(cb, opts);
15550
+ },
15551
+ load() {
15552
+ return handler.load();
15553
+ },
15554
+ unload() {
15555
+ return handler.unload();
15556
+ }
15557
+ };
15558
+ };
15559
+ var SignalExitFallback = class extends SignalExitBase {
15560
+ onExit() {
15561
+ return () => {
15562
+ };
15563
+ }
15564
+ load() {
15565
+ }
15566
+ unload() {
15567
+ }
15568
+ };
15569
+ var SignalExit = class extends SignalExitBase {
15570
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
15571
+ // so use a supported signal instead
15572
+ /* c8 ignore start */
15573
+ #hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
15574
+ /* c8 ignore stop */
15575
+ #emitter = new Emitter();
15576
+ #process;
15577
+ #originalProcessEmit;
15578
+ #originalProcessReallyExit;
15579
+ #sigListeners = {};
15580
+ #loaded = false;
15581
+ constructor(process3) {
15582
+ super();
15583
+ this.#process = process3;
15584
+ this.#sigListeners = {};
15585
+ for (const sig of signals) {
15586
+ this.#sigListeners[sig] = () => {
15587
+ const listeners = this.#process.listeners(sig);
15588
+ let { count } = this.#emitter;
15589
+ const p = process3;
15590
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
15591
+ count += p.__signal_exit_emitter__.count;
15592
+ }
15593
+ if (listeners.length === count) {
15594
+ this.unload();
15595
+ const ret = this.#emitter.emit("exit", null, sig);
15596
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
15597
+ if (!ret)
15598
+ process3.kill(process3.pid, s);
15599
+ }
15600
+ };
15601
+ }
15602
+ this.#originalProcessReallyExit = process3.reallyExit;
15603
+ this.#originalProcessEmit = process3.emit;
15604
+ }
15605
+ onExit(cb, opts) {
15606
+ if (!processOk(this.#process)) {
15607
+ return () => {
15608
+ };
15609
+ }
15610
+ if (this.#loaded === false) {
15611
+ this.load();
15612
+ }
15613
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
15614
+ this.#emitter.on(ev, cb);
15615
+ return () => {
15616
+ this.#emitter.removeListener(ev, cb);
15617
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
15618
+ this.unload();
15619
+ }
15620
+ };
15621
+ }
15622
+ load() {
15623
+ if (this.#loaded) {
15624
+ return;
15625
+ }
15626
+ this.#loaded = true;
15627
+ this.#emitter.count += 1;
15628
+ for (const sig of signals) {
15629
+ try {
15630
+ const fn = this.#sigListeners[sig];
15631
+ if (fn)
15632
+ this.#process.on(sig, fn);
15633
+ } catch (_) {
15634
+ }
15635
+ }
15636
+ this.#process.emit = (ev, ...a) => {
15637
+ return this.#processEmit(ev, ...a);
15638
+ };
15639
+ this.#process.reallyExit = (code) => {
15640
+ return this.#processReallyExit(code);
15641
+ };
15642
+ }
15643
+ unload() {
15644
+ if (!this.#loaded) {
15645
+ return;
15646
+ }
15647
+ this.#loaded = false;
15648
+ signals.forEach((sig) => {
15649
+ const listener = this.#sigListeners[sig];
15650
+ if (!listener) {
15651
+ throw new Error("Listener not defined for signal: " + sig);
15652
+ }
15653
+ try {
15654
+ this.#process.removeListener(sig, listener);
15655
+ } catch (_) {
15656
+ }
15657
+ });
15658
+ this.#process.emit = this.#originalProcessEmit;
15659
+ this.#process.reallyExit = this.#originalProcessReallyExit;
15660
+ this.#emitter.count -= 1;
15661
+ }
15662
+ #processReallyExit(code) {
15663
+ if (!processOk(this.#process)) {
15664
+ return 0;
15665
+ }
15666
+ this.#process.exitCode = code || 0;
15667
+ this.#emitter.emit("exit", this.#process.exitCode, null);
15668
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
15669
+ }
15670
+ #processEmit(ev, ...args) {
15671
+ const og = this.#originalProcessEmit;
15672
+ if (ev === "exit" && processOk(this.#process)) {
15673
+ if (typeof args[0] === "number") {
15674
+ this.#process.exitCode = args[0];
15675
+ }
15676
+ const ret = og.call(this.#process, ev, ...args);
15677
+ this.#emitter.emit("exit", this.#process.exitCode, null);
15678
+ return ret;
15679
+ } else {
15680
+ return og.call(this.#process, ev, ...args);
15681
+ }
15682
+ }
15683
+ };
15684
+ var process2 = globalThis.process;
15685
+ var {
15686
+ /**
15687
+ * Called when the process is exiting, whether via signal, explicit
15688
+ * exit, or running out of stuff to do.
15689
+ *
15690
+ * If the global process object is not suitable for instrumentation,
15691
+ * then this will be a no-op.
15692
+ *
15693
+ * Returns a function that may be used to unload signal-exit.
15694
+ */
15695
+ onExit,
15696
+ /**
15697
+ * Load the listeners. Likely you never need to call this, unless
15698
+ * doing a rather deep integration with signal-exit functionality.
15699
+ * Mostly exposed for the benefit of testing.
15700
+ *
15701
+ * @internal
15702
+ */
15703
+ load,
15704
+ /**
15705
+ * Unload the listeners. Likely you never need to call this, unless
15706
+ * doing a rather deep integration with signal-exit functionality.
15707
+ * Mostly exposed for the benefit of testing.
15708
+ *
15709
+ * @internal
15710
+ */
15711
+ unload
15712
+ } = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback());
15713
+
15714
+ // src/claude-ink/ink.tsx
14995
15715
  import { format } from "util";
14996
15716
 
14997
15717
  // src/claude-ink/colorize.ts
14998
- import chalk from "chalk";
14999
15718
  function boostChalkLevelForXtermJs() {
15000
- if (process.env.TERM_PROGRAM === "vscode" && chalk.level === 2) {
15001
- chalk.level = 3;
15719
+ if (process.env.TERM_PROGRAM === "vscode" && source_default.level === 2) {
15720
+ source_default.level = 3;
15002
15721
  return true;
15003
15722
  }
15004
15723
  return false;
15005
15724
  }
15006
15725
  function clampChalkLevelForTmux() {
15007
15726
  if (process.env.CLAUDE_CODE_TMUX_TRUECOLOR) return false;
15008
- if (process.env.TMUX && chalk.level > 2) {
15009
- chalk.level = 2;
15727
+ if (process.env.TMUX && source_default.level > 2) {
15728
+ source_default.level = 2;
15010
15729
  return true;
15011
15730
  }
15012
15731
  return false;
@@ -15023,41 +15742,41 @@ var colorize = (str, color, type) => {
15023
15742
  const value = color.substring("ansi:".length);
15024
15743
  switch (value) {
15025
15744
  case "black":
15026
- return type === "foreground" ? chalk.black(str) : chalk.bgBlack(str);
15745
+ return type === "foreground" ? source_default.black(str) : source_default.bgBlack(str);
15027
15746
  case "red":
15028
- return type === "foreground" ? chalk.red(str) : chalk.bgRed(str);
15747
+ return type === "foreground" ? source_default.red(str) : source_default.bgRed(str);
15029
15748
  case "green":
15030
- return type === "foreground" ? chalk.green(str) : chalk.bgGreen(str);
15749
+ return type === "foreground" ? source_default.green(str) : source_default.bgGreen(str);
15031
15750
  case "yellow":
15032
- return type === "foreground" ? chalk.yellow(str) : chalk.bgYellow(str);
15751
+ return type === "foreground" ? source_default.yellow(str) : source_default.bgYellow(str);
15033
15752
  case "blue":
15034
- return type === "foreground" ? chalk.blue(str) : chalk.bgBlue(str);
15753
+ return type === "foreground" ? source_default.blue(str) : source_default.bgBlue(str);
15035
15754
  case "magenta":
15036
- return type === "foreground" ? chalk.magenta(str) : chalk.bgMagenta(str);
15755
+ return type === "foreground" ? source_default.magenta(str) : source_default.bgMagenta(str);
15037
15756
  case "cyan":
15038
- return type === "foreground" ? chalk.cyan(str) : chalk.bgCyan(str);
15757
+ return type === "foreground" ? source_default.cyan(str) : source_default.bgCyan(str);
15039
15758
  case "white":
15040
- return type === "foreground" ? chalk.white(str) : chalk.bgWhite(str);
15759
+ return type === "foreground" ? source_default.white(str) : source_default.bgWhite(str);
15041
15760
  case "blackBright":
15042
- return type === "foreground" ? chalk.blackBright(str) : chalk.bgBlackBright(str);
15761
+ return type === "foreground" ? source_default.blackBright(str) : source_default.bgBlackBright(str);
15043
15762
  case "redBright":
15044
- return type === "foreground" ? chalk.redBright(str) : chalk.bgRedBright(str);
15763
+ return type === "foreground" ? source_default.redBright(str) : source_default.bgRedBright(str);
15045
15764
  case "greenBright":
15046
- return type === "foreground" ? chalk.greenBright(str) : chalk.bgGreenBright(str);
15765
+ return type === "foreground" ? source_default.greenBright(str) : source_default.bgGreenBright(str);
15047
15766
  case "yellowBright":
15048
- return type === "foreground" ? chalk.yellowBright(str) : chalk.bgYellowBright(str);
15767
+ return type === "foreground" ? source_default.yellowBright(str) : source_default.bgYellowBright(str);
15049
15768
  case "blueBright":
15050
- return type === "foreground" ? chalk.blueBright(str) : chalk.bgBlueBright(str);
15769
+ return type === "foreground" ? source_default.blueBright(str) : source_default.bgBlueBright(str);
15051
15770
  case "magentaBright":
15052
- return type === "foreground" ? chalk.magentaBright(str) : chalk.bgMagentaBright(str);
15771
+ return type === "foreground" ? source_default.magentaBright(str) : source_default.bgMagentaBright(str);
15053
15772
  case "cyanBright":
15054
- return type === "foreground" ? chalk.cyanBright(str) : chalk.bgCyanBright(str);
15773
+ return type === "foreground" ? source_default.cyanBright(str) : source_default.bgCyanBright(str);
15055
15774
  case "whiteBright":
15056
- return type === "foreground" ? chalk.whiteBright(str) : chalk.bgWhiteBright(str);
15775
+ return type === "foreground" ? source_default.whiteBright(str) : source_default.bgWhiteBright(str);
15057
15776
  }
15058
15777
  }
15059
15778
  if (color.startsWith("#")) {
15060
- return type === "foreground" ? chalk.hex(color)(str) : chalk.bgHex(color)(str);
15779
+ return type === "foreground" ? source_default.hex(color)(str) : source_default.bgHex(color)(str);
15061
15780
  }
15062
15781
  if (color.startsWith("ansi256")) {
15063
15782
  const matches = ANSI_REGEX.exec(color);
@@ -15065,7 +15784,7 @@ var colorize = (str, color, type) => {
15065
15784
  return str;
15066
15785
  }
15067
15786
  const value = Number(matches[1]);
15068
- return type === "foreground" ? chalk.ansi256(value)(str) : chalk.bgAnsi256(value)(str);
15787
+ return type === "foreground" ? source_default.ansi256(value)(str) : source_default.bgAnsi256(value)(str);
15069
15788
  }
15070
15789
  if (color.startsWith("rgb")) {
15071
15790
  const matches = RGB_REGEX.exec(color);
@@ -15075,29 +15794,29 @@ var colorize = (str, color, type) => {
15075
15794
  const firstValue = Number(matches[1]);
15076
15795
  const secondValue = Number(matches[2]);
15077
15796
  const thirdValue = Number(matches[3]);
15078
- return type === "foreground" ? chalk.rgb(firstValue, secondValue, thirdValue)(str) : chalk.bgRgb(firstValue, secondValue, thirdValue)(str);
15797
+ return type === "foreground" ? source_default.rgb(firstValue, secondValue, thirdValue)(str) : source_default.bgRgb(firstValue, secondValue, thirdValue)(str);
15079
15798
  }
15080
15799
  return str;
15081
15800
  };
15082
15801
  function applyTextStyles(text, styles3) {
15083
15802
  let result = text;
15084
15803
  if (styles3.inverse) {
15085
- result = chalk.inverse(result);
15804
+ result = source_default.inverse(result);
15086
15805
  }
15087
15806
  if (styles3.strikethrough) {
15088
- result = chalk.strikethrough(result);
15807
+ result = source_default.strikethrough(result);
15089
15808
  }
15090
15809
  if (styles3.underline) {
15091
- result = chalk.underline(result);
15810
+ result = source_default.underline(result);
15092
15811
  }
15093
15812
  if (styles3.italic) {
15094
- result = chalk.italic(result);
15813
+ result = source_default.italic(result);
15095
15814
  }
15096
15815
  if (styles3.bold) {
15097
- result = chalk.bold(result);
15816
+ result = source_default.bold(result);
15098
15817
  }
15099
15818
  if (styles3.dim) {
15100
- result = chalk.dim(result);
15819
+ result = source_default.dim(result);
15101
15820
  }
15102
15821
  if (styles3.color) {
15103
15822
  result = colorize(result, styles3.color, "foreground");
@@ -15115,7 +15834,7 @@ function applyColor(text, color) {
15115
15834
  }
15116
15835
 
15117
15836
  // src/claude-ink/components/App.tsx
15118
- import { PureComponent } from "react";
15837
+ var import_react15 = __toESM(require_react(), 1);
15119
15838
 
15120
15839
  // src/utils/earlyInput.ts
15121
15840
  function stopCapturingEarlyInput() {
@@ -17135,31 +17854,31 @@ var TerminalQuerier = class {
17135
17854
  };
17136
17855
 
17137
17856
  // src/claude-ink/components/ClockContext.tsx
17138
- import { c as _c5 } from "react/compiler-runtime";
17139
- import { createContext as createContext6, useEffect as useEffect2, useState as useState2 } from "react";
17857
+ var import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
17858
+ var import_react13 = __toESM(require_react(), 1);
17140
17859
 
17141
17860
  // src/claude-ink/constants.ts
17142
17861
  var FRAME_INTERVAL_MS = 16;
17143
17862
 
17144
17863
  // src/claude-ink/hooks/use-terminal-focus.ts
17145
- import { useContext as useContext5 } from "react";
17864
+ var import_react12 = __toESM(require_react(), 1);
17146
17865
 
17147
17866
  // src/claude-ink/components/TerminalFocusContext.tsx
17148
- import { c as _c4 } from "react/compiler-runtime";
17149
- import { createContext as createContext5, useSyncExternalStore } from "react";
17150
- import { jsx as jsx5 } from "react/jsx-runtime";
17151
- var TerminalFocusContext = createContext5({
17867
+ var import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
17868
+ var import_react11 = __toESM(require_react(), 1);
17869
+ var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
17870
+ var TerminalFocusContext = (0, import_react11.createContext)({
17152
17871
  isTerminalFocused: true,
17153
17872
  terminalFocusState: "unknown"
17154
17873
  });
17155
17874
  TerminalFocusContext.displayName = "TerminalFocusContext";
17156
17875
  function TerminalFocusProvider(t0) {
17157
- const $ = _c4(6);
17876
+ const $ = (0, import_compiler_runtime4.c)(6);
17158
17877
  const {
17159
17878
  children
17160
17879
  } = t0;
17161
- const isTerminalFocused = useSyncExternalStore(subscribeTerminalFocus, getTerminalFocused);
17162
- const terminalFocusState = useSyncExternalStore(subscribeTerminalFocus, getTerminalFocusState);
17880
+ const isTerminalFocused = (0, import_react11.useSyncExternalStore)(subscribeTerminalFocus, getTerminalFocused);
17881
+ const terminalFocusState = (0, import_react11.useSyncExternalStore)(subscribeTerminalFocus, getTerminalFocusState);
17163
17882
  let t1;
17164
17883
  if ($[0] !== isTerminalFocused || $[1] !== terminalFocusState) {
17165
17884
  t1 = {
@@ -17175,7 +17894,7 @@ function TerminalFocusProvider(t0) {
17175
17894
  const value = t1;
17176
17895
  let t2;
17177
17896
  if ($[3] !== children || $[4] !== value) {
17178
- t2 = /* @__PURE__ */ jsx5(TerminalFocusContext.Provider, { value, children });
17897
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TerminalFocusContext.Provider, { value, children });
17179
17898
  $[3] = children;
17180
17899
  $[4] = value;
17181
17900
  $[5] = t2;
@@ -17188,12 +17907,12 @@ var TerminalFocusContext_default = TerminalFocusContext;
17188
17907
 
17189
17908
  // src/claude-ink/hooks/use-terminal-focus.ts
17190
17909
  function useTerminalFocus() {
17191
- const { isTerminalFocused } = useContext5(TerminalFocusContext_default);
17910
+ const { isTerminalFocused } = (0, import_react12.useContext)(TerminalFocusContext_default);
17192
17911
  return isTerminalFocused;
17193
17912
  }
17194
17913
 
17195
17914
  // src/claude-ink/components/ClockContext.tsx
17196
- import { jsx as jsx6 } from "react/jsx-runtime";
17915
+ var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
17197
17916
  function createClock(tickIntervalMs) {
17198
17917
  const subscribers2 = /* @__PURE__ */ new Map();
17199
17918
  let interval = null;
@@ -17247,14 +17966,14 @@ function createClock(tickIntervalMs) {
17247
17966
  }
17248
17967
  };
17249
17968
  }
17250
- var ClockContext = createContext6(null);
17969
+ var ClockContext = (0, import_react13.createContext)(null);
17251
17970
  var BLURRED_TICK_INTERVAL_MS = FRAME_INTERVAL_MS * 2;
17252
17971
  function ClockProvider(t0) {
17253
- const $ = _c5(7);
17972
+ const $ = (0, import_compiler_runtime5.c)(7);
17254
17973
  const {
17255
17974
  children
17256
17975
  } = t0;
17257
- const [clock] = useState2(_temp);
17976
+ const [clock] = (0, import_react13.useState)(_temp);
17258
17977
  const focused = useTerminalFocus();
17259
17978
  let t1;
17260
17979
  let t2;
@@ -17271,10 +17990,10 @@ function ClockProvider(t0) {
17271
17990
  t1 = $[2];
17272
17991
  t2 = $[3];
17273
17992
  }
17274
- useEffect2(t1, t2);
17993
+ (0, import_react13.useEffect)(t1, t2);
17275
17994
  let t3;
17276
17995
  if ($[4] !== children || $[5] !== clock) {
17277
- t3 = /* @__PURE__ */ jsx6(ClockContext.Provider, { value: clock, children });
17996
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ClockContext.Provider, { value: clock, children });
17278
17997
  $[4] = children;
17279
17998
  $[5] = clock;
17280
17999
  $[6] = t3;
@@ -17288,8 +18007,8 @@ function _temp() {
17288
18007
  }
17289
18008
 
17290
18009
  // src/claude-ink/components/CursorDeclarationContext.ts
17291
- import { createContext as createContext7 } from "react";
17292
- var CursorDeclarationContext = createContext7(
18010
+ var import_react14 = __toESM(require_react(), 1);
18011
+ var CursorDeclarationContext = (0, import_react14.createContext)(
17293
18012
  () => {
17294
18013
  }
17295
18014
  );
@@ -17330,7 +18049,7 @@ var dist_default2 = codeExcerpt;
17330
18049
  // src/claude-ink/components/ErrorOverview.tsx
17331
18050
  var import_stack_utils = __toESM(require_stack_utils(), 1);
17332
18051
  import { readFileSync } from "fs";
17333
- import { jsx as jsx7, jsxs } from "react/jsx-runtime";
18052
+ var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
17334
18053
  var cleanupPath = (path) => {
17335
18054
  return path?.replace(`file://${process.cwd()}/`, "");
17336
18055
  };
@@ -17363,47 +18082,47 @@ function ErrorOverview({
17363
18082
  } catch {
17364
18083
  }
17365
18084
  }
17366
- return /* @__PURE__ */ jsxs(Box_default, { flexDirection: "column", padding: 1, children: [
17367
- /* @__PURE__ */ jsxs(Box_default, { children: [
17368
- /* @__PURE__ */ jsxs(Text, { backgroundColor: "ansi:red", color: "ansi:white", children: [
18085
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { flexDirection: "column", padding: 1, children: [
18086
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { children: [
18087
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { backgroundColor: "ansi:red", color: "ansi:white", children: [
17369
18088
  " ",
17370
18089
  "ERROR",
17371
18090
  " "
17372
18091
  ] }),
17373
- /* @__PURE__ */ jsxs(Text, { children: [
18092
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { children: [
17374
18093
  " ",
17375
18094
  error.message
17376
18095
  ] })
17377
18096
  ] }),
17378
- origin && filePath && /* @__PURE__ */ jsx7(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsxs(Text, { dim: true, children: [
18097
+ origin && filePath && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { dim: true, children: [
17379
18098
  filePath,
17380
18099
  ":",
17381
18100
  origin.line,
17382
18101
  ":",
17383
18102
  origin.column
17384
18103
  ] }) }),
17385
- origin && excerpt && /* @__PURE__ */ jsx7(Box_default, { marginTop: 1, flexDirection: "column", children: excerpt.map(({
18104
+ origin && excerpt && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: excerpt.map(({
17386
18105
  line: line_0,
17387
18106
  value
17388
- }) => /* @__PURE__ */ jsxs(Box_default, { children: [
17389
- /* @__PURE__ */ jsx7(Box_default, { width: lineWidth2 + 1, children: /* @__PURE__ */ jsxs(Text, { dim: line_0 !== origin.line, backgroundColor: line_0 === origin.line ? "ansi:red" : void 0, color: line_0 === origin.line ? "ansi:white" : void 0, children: [
18107
+ }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { children: [
18108
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { width: lineWidth2 + 1, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { dim: line_0 !== origin.line, backgroundColor: line_0 === origin.line ? "ansi:red" : void 0, color: line_0 === origin.line ? "ansi:white" : void 0, children: [
17390
18109
  String(line_0).padStart(lineWidth2, " "),
17391
18110
  ":"
17392
18111
  ] }) }),
17393
- /* @__PURE__ */ jsx7(Text, { backgroundColor: line_0 === origin.line ? "ansi:red" : void 0, color: line_0 === origin.line ? "ansi:white" : void 0, children: " " + value }, line_0)
18112
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { backgroundColor: line_0 === origin.line ? "ansi:red" : void 0, color: line_0 === origin.line ? "ansi:white" : void 0, children: " " + value }, line_0)
17394
18113
  ] }, line_0)) }),
17395
- error.stack && /* @__PURE__ */ jsx7(Box_default, { marginTop: 1, flexDirection: "column", children: error.stack.split("\n").slice(1).map((line_1) => {
18114
+ error.stack && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box_default, { marginTop: 1, flexDirection: "column", children: error.stack.split("\n").slice(1).map((line_1) => {
17396
18115
  const parsedLine = getStackUtils().parseLine(line_1);
17397
18116
  if (!parsedLine) {
17398
- return /* @__PURE__ */ jsxs(Box_default, { children: [
17399
- /* @__PURE__ */ jsx7(Text, { dim: true, children: "- " }),
17400
- /* @__PURE__ */ jsx7(Text, { bold: true, children: line_1 })
18117
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { children: [
18118
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { dim: true, children: "- " }),
18119
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { bold: true, children: line_1 })
17401
18120
  ] }, line_1);
17402
18121
  }
17403
- return /* @__PURE__ */ jsxs(Box_default, { children: [
17404
- /* @__PURE__ */ jsx7(Text, { dim: true, children: "- " }),
17405
- /* @__PURE__ */ jsx7(Text, { bold: true, children: parsedLine.function }),
17406
- /* @__PURE__ */ jsxs(Text, { dim: true, children: [
18122
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Box_default, { children: [
18123
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { dim: true, children: "- " }),
18124
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { bold: true, children: parsedLine.function }),
18125
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text, { dim: true, children: [
17407
18126
  " ",
17408
18127
  "(",
17409
18128
  cleanupPath(parsedLine.file) ?? "",
@@ -17419,12 +18138,12 @@ function ErrorOverview({
17419
18138
  }
17420
18139
 
17421
18140
  // src/claude-ink/components/App.tsx
17422
- import { jsx as jsx8 } from "react/jsx-runtime";
18141
+ var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
17423
18142
  var SUPPORTS_SUSPEND = process.platform !== "win32";
17424
18143
  var STDIN_RESUME_GAP_MS = 5e3;
17425
18144
  var MULTI_CLICK_TIMEOUT_MS = 500;
17426
18145
  var MULTI_CLICK_DISTANCE = 1;
17427
- var App = class extends PureComponent {
18146
+ var App = class extends import_react15.PureComponent {
17428
18147
  static displayName = "InternalApp";
17429
18148
  static getDerivedStateFromError(error) {
17430
18149
  return {
@@ -17480,20 +18199,20 @@ var App = class extends PureComponent {
17480
18199
  return this.props.stdin.isTTY;
17481
18200
  }
17482
18201
  render() {
17483
- return /* @__PURE__ */ jsx8(TerminalSizeContext.Provider, { value: {
18202
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TerminalSizeContext.Provider, { value: {
17484
18203
  columns: this.props.terminalColumns,
17485
18204
  rows: this.props.terminalRows
17486
- }, children: /* @__PURE__ */ jsx8(AppContext_default.Provider, { value: {
18205
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AppContext_default.Provider, { value: {
17487
18206
  exit: this.handleExit
17488
- }, children: /* @__PURE__ */ jsx8(StdinContext_default.Provider, { value: {
18207
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StdinContext_default.Provider, { value: {
17489
18208
  stdin: this.props.stdin,
17490
18209
  setRawMode: this.handleSetRawMode,
17491
18210
  isRawModeSupported: this.isRawModeSupported(),
17492
18211
  internal_exitOnCtrlC: this.props.exitOnCtrlC,
17493
18212
  internal_eventEmitter: this.internal_eventEmitter,
17494
18213
  internal_querier: this.querier
17495
- }, children: /* @__PURE__ */ jsx8(TerminalFocusProvider, { children: /* @__PURE__ */ jsx8(ClockProvider, { children: /* @__PURE__ */ jsx8(CursorDeclarationContext_default.Provider, { value: this.props.onCursorDeclaration ?? (() => {
17496
- }), children: this.state.error ? /* @__PURE__ */ jsx8(ErrorOverview, { error: this.state.error }) : this.props.children }) }) }) }) }) });
18214
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TerminalFocusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ClockProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CursorDeclarationContext_default.Provider, { value: this.props.onCursorDeclaration ?? (() => {
18215
+ }), children: this.state.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ErrorOverview, { error: this.state.error }) : this.props.children }) }) }) }) }) });
17497
18216
  }
17498
18217
  componentDidMount() {
17499
18218
  if (this.props.stdout.isTTY && !isEnvTruthy(process.env.CLAUDE_CODE_ACCESSIBILITY)) {
@@ -17612,11 +18331,11 @@ var App = class extends PureComponent {
17612
18331
  }
17613
18332
  };
17614
18333
  handleReadable = () => {
17615
- const now = Date.now();
17616
- if (now - this.lastStdinTime > STDIN_RESUME_GAP_MS) {
18334
+ const now2 = Date.now();
18335
+ if (now2 - this.lastStdinTime > STDIN_RESUME_GAP_MS) {
17617
18336
  this.props.onStdinResume?.();
17618
18337
  }
17619
- this.lastStdinTime = now;
18338
+ this.lastStdinTime = now2;
17620
18339
  try {
17621
18340
  let chunk;
17622
18341
  while ((chunk = this.props.stdin.read()) !== null) {
@@ -17753,10 +18472,10 @@ function handleMouseEvent(app, m) {
17753
18472
  finishSelection(sel);
17754
18473
  app.props.onSelectionChange();
17755
18474
  }
17756
- const now = Date.now();
17757
- const nearLast = now - app.lastClickTime < MULTI_CLICK_TIMEOUT_MS && Math.abs(col - app.lastClickCol) <= MULTI_CLICK_DISTANCE && Math.abs(row - app.lastClickRow) <= MULTI_CLICK_DISTANCE;
18475
+ const now2 = Date.now();
18476
+ const nearLast = now2 - app.lastClickTime < MULTI_CLICK_TIMEOUT_MS && Math.abs(col - app.lastClickCol) <= MULTI_CLICK_DISTANCE && Math.abs(row - app.lastClickRow) <= MULTI_CLICK_DISTANCE;
17758
18477
  app.clickCount = nearLast ? app.clickCount + 1 : 1;
17759
- app.lastClickTime = now;
18478
+ app.lastClickTime = now2;
17760
18479
  app.lastClickCol = col;
17761
18480
  app.lastClickRow = row;
17762
18481
  if (app.clickCount >= 2) {
@@ -17880,14 +18599,14 @@ function hitTest(node, col, row) {
17880
18599
  }
17881
18600
  return node;
17882
18601
  }
17883
- function dispatchClick(root, col, row, cellIsBlank = false) {
17884
- let target = hitTest(root, col, row) ?? void 0;
18602
+ function dispatchClick(root2, col, row, cellIsBlank = false) {
18603
+ let target = hitTest(root2, col, row) ?? void 0;
17885
18604
  if (!target) return false;
17886
- if (root.focusManager) {
18605
+ if (root2.focusManager) {
17887
18606
  let focusTarget = target;
17888
18607
  while (focusTarget) {
17889
18608
  if (typeof focusTarget.attributes["tabIndex"] === "number") {
17890
- root.focusManager.handleClickFocus(focusTarget);
18609
+ root2.focusManager.handleClickFocus(focusTarget);
17891
18610
  break;
17892
18611
  }
17893
18612
  focusTarget = focusTarget.parentNode;
@@ -17911,9 +18630,9 @@ function dispatchClick(root, col, row, cellIsBlank = false) {
17911
18630
  }
17912
18631
  return handled;
17913
18632
  }
17914
- function dispatchHover(root, col, row, hovered) {
18633
+ function dispatchHover(root2, col, row, hovered) {
17915
18634
  const next = /* @__PURE__ */ new Set();
17916
- let node = hitTest(root, col, row) ?? void 0;
18635
+ let node = hitTest(root2, col, row) ?? void 0;
17917
18636
  while (node) {
17918
18637
  const h = node._eventHandlers;
17919
18638
  if (h?.onMouseEnter || h?.onMouseLeave) next.add(node);
@@ -17922,10 +18641,7 @@ function dispatchHover(root, col, row, hovered) {
17922
18641
  for (const old of hovered) {
17923
18642
  if (!next.has(old)) {
17924
18643
  hovered.delete(old);
17925
- if (old.parentNode) {
17926
- ;
17927
- old._eventHandlers?.onMouseLeave?.();
17928
- }
18644
+ old._eventHandlers?.onMouseLeave?.();
17929
18645
  }
17930
18646
  }
17931
18647
  for (const n of next) {
@@ -18016,7 +18732,7 @@ var LogUpdate = class {
18016
18732
  const startTime = performance.now();
18017
18733
  const stylePool = this.options.stylePool;
18018
18734
  if (next.viewport.height < prev.viewport.height || prev.viewport.width !== 0 && next.viewport.width !== prev.viewport.width) {
18019
- return fullResetSequence_CAUSES_FLICKER(next, "resize", stylePool);
18735
+ return fullResetSequence_CAUSES_FLICKER(next, "resize", stylePool, altScreen);
18020
18736
  }
18021
18737
  let scrollPatch = [];
18022
18738
  if (altScreen && next.scrollHint && decstbmSafe) {
@@ -18040,7 +18756,7 @@ var LogUpdate = class {
18040
18756
  logForDebugging(
18041
18757
  `Full reset (shrink->below): prevHeight=${prev.screen.height}, nextHeight=${next.screen.height}, viewport=${prev.viewport.height}`
18042
18758
  );
18043
- return fullResetSequence_CAUSES_FLICKER(next, "offscreen", stylePool);
18759
+ return fullResetSequence_CAUSES_FLICKER(next, "offscreen", stylePool, altScreen);
18044
18760
  }
18045
18761
  if (prev.screen.height >= prev.viewport.height && prev.screen.height > 0 && cursorAtBottom && !isGrowing) {
18046
18762
  const viewportY2 = prev.screen.height - prev.viewport.height;
@@ -18055,7 +18771,7 @@ var LogUpdate = class {
18055
18771
  if (scrollbackChangeY >= 0) {
18056
18772
  const prevLine = readLine(prev.screen, scrollbackChangeY);
18057
18773
  const nextLine = readLine(next.screen, scrollbackChangeY);
18058
- return fullResetSequence_CAUSES_FLICKER(next, "offscreen", stylePool, {
18774
+ return fullResetSequence_CAUSES_FLICKER(next, "offscreen", stylePool, altScreen, {
18059
18775
  triggerY: scrollbackChangeY,
18060
18776
  prevLine,
18061
18777
  nextLine
@@ -18072,7 +18788,8 @@ var LogUpdate = class {
18072
18788
  return fullResetSequence_CAUSES_FLICKER(
18073
18789
  next,
18074
18790
  "offscreen",
18075
- this.options.stylePool
18791
+ this.options.stylePool,
18792
+ altScreen
18076
18793
  );
18077
18794
  }
18078
18795
  screen.txn((prev2) => [
@@ -18137,7 +18854,7 @@ var LogUpdate = class {
18137
18854
  }
18138
18855
  });
18139
18856
  if (needsFullReset) {
18140
- return fullResetSequence_CAUSES_FLICKER(next, "offscreen", stylePool, {
18857
+ return fullResetSequence_CAUSES_FLICKER(next, "offscreen", stylePool, altScreen, {
18141
18858
  triggerY: resetTriggerY,
18142
18859
  prevLine: readLine(prev.screen, resetTriggerY),
18143
18860
  nextLine: readLine(next.screen, resetTriggerY)
@@ -18160,7 +18877,8 @@ var LogUpdate = class {
18160
18877
  next,
18161
18878
  prev.screen.height,
18162
18879
  next.screen.height,
18163
- stylePool
18880
+ stylePool,
18881
+ !altScreen
18164
18882
  );
18165
18883
  }
18166
18884
  if (altScreen) {
@@ -18218,22 +18936,24 @@ function readLine(screen, y) {
18218
18936
  }
18219
18937
  return line.trimEnd();
18220
18938
  }
18221
- function fullResetSequence_CAUSES_FLICKER(frame, reason, stylePool, debug) {
18939
+ function fullResetSequence_CAUSES_FLICKER(frame, reason, stylePool, altScreen, debug) {
18222
18940
  const screen = new VirtualScreen({ x: 0, y: 0 }, frame.viewport.width);
18223
- renderFrame(screen, frame, stylePool);
18941
+ renderFrame(screen, frame, stylePool, !altScreen);
18224
18942
  return [{ type: "clearTerminal", reason, debug }, ...screen.diff];
18225
18943
  }
18226
- function renderFrame(screen, frame, stylePool) {
18227
- renderFrameSlice(screen, frame, 0, frame.screen.height, stylePool);
18944
+ function renderFrame(screen, frame, stylePool, allowScroll) {
18945
+ renderFrameSlice(screen, frame, 0, frame.screen.height, stylePool, allowScroll);
18228
18946
  }
18229
- function renderFrameSlice(screen, frame, startY, endY, stylePool) {
18947
+ function renderFrameSlice(screen, frame, startY, endY, stylePool, allowScroll = true) {
18230
18948
  let currentStyleId = stylePool.none;
18231
18949
  let currentHyperlink = void 0;
18232
18950
  let lastRenderedStyleId = -1;
18233
18951
  const { width: screenWidth, cells, charPool, hyperlinkPool } = frame.screen;
18234
18952
  let index = startY * screenWidth;
18235
18953
  for (let y = startY; y < endY; y += 1) {
18236
- if (screen.cursor.y < y) {
18954
+ if (!allowScroll) {
18955
+ moveCursorTo(screen, 0, y);
18956
+ } else if (screen.cursor.y < y) {
18237
18957
  const rowsToAdvance = y - screen.cursor.y;
18238
18958
  screen.txn((prev) => {
18239
18959
  const patches = new Array(1 + rowsToAdvance);
@@ -18280,7 +19000,9 @@ function renderFrameSlice(screen, frame, startY, endY, stylePool) {
18280
19000
  currentHyperlink,
18281
19001
  void 0
18282
19002
  );
18283
- screen.txn((prev) => [[CARRIAGE_RETURN, NEWLINE], { dx: -prev.x, dy: 1 }]);
19003
+ if (allowScroll) {
19004
+ screen.txn((prev) => [[CARRIAGE_RETURN, NEWLINE], { dx: -prev.x, dy: 1 }]);
19005
+ }
18284
19006
  }
18285
19007
  transitionStyle(screen.diff, stylePool, currentStyleId, stylePool.none);
18286
19008
  transitionHyperlink(screen.diff, currentHyperlink, void 0);
@@ -18422,8 +19144,774 @@ function optimize(diff2) {
18422
19144
  return result;
18423
19145
  }
18424
19146
 
19147
+ // node_modules/bidi-js/dist/bidi.mjs
19148
+ function bidiFactory() {
19149
+ var bidi = (function(exports) {
19150
+ var DATA = {
19151
+ "R": "13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",
19152
+ "EN": "1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",
19153
+ "ES": "17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",
19154
+ "ET": "z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",
19155
+ "AN": "16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",
19156
+ "CS": "18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",
19157
+ "B": "a,3,f+2,2v,690",
19158
+ "S": "9,2,k",
19159
+ "WS": "c,k,4f4,1vk+a,u,1j,335",
19160
+ "ON": "x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",
19161
+ "BN": "0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",
19162
+ "NSM": "lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",
19163
+ "AL": "16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",
19164
+ "LRO": "6ct",
19165
+ "RLO": "6cu",
19166
+ "LRE": "6cq",
19167
+ "RLE": "6cr",
19168
+ "PDF": "6cs",
19169
+ "LRI": "6ee",
19170
+ "RLI": "6ef",
19171
+ "FSI": "6eg",
19172
+ "PDI": "6eh"
19173
+ };
19174
+ var TYPES = {};
19175
+ var TYPES_TO_NAMES = {};
19176
+ TYPES.L = 1;
19177
+ TYPES_TO_NAMES[1] = "L";
19178
+ Object.keys(DATA).forEach(function(type, i) {
19179
+ TYPES[type] = 1 << i + 1;
19180
+ TYPES_TO_NAMES[TYPES[type]] = type;
19181
+ });
19182
+ Object.freeze(TYPES);
19183
+ var ISOLATE_INIT_TYPES = TYPES.LRI | TYPES.RLI | TYPES.FSI;
19184
+ var STRONG_TYPES = TYPES.L | TYPES.R | TYPES.AL;
19185
+ var NEUTRAL_ISOLATE_TYPES = TYPES.B | TYPES.S | TYPES.WS | TYPES.ON | TYPES.FSI | TYPES.LRI | TYPES.RLI | TYPES.PDI;
19186
+ var BN_LIKE_TYPES = TYPES.BN | TYPES.RLE | TYPES.LRE | TYPES.RLO | TYPES.LRO | TYPES.PDF;
19187
+ var TRAILING_TYPES = TYPES.S | TYPES.WS | TYPES.B | ISOLATE_INIT_TYPES | TYPES.PDI | BN_LIKE_TYPES;
19188
+ var map = null;
19189
+ function parseData() {
19190
+ if (!map) {
19191
+ map = /* @__PURE__ */ new Map();
19192
+ var loop = function(type2) {
19193
+ if (DATA.hasOwnProperty(type2)) {
19194
+ var lastCode = 0;
19195
+ DATA[type2].split(",").forEach(function(range) {
19196
+ var ref = range.split("+");
19197
+ var skip = ref[0];
19198
+ var step = ref[1];
19199
+ skip = parseInt(skip, 36);
19200
+ step = step ? parseInt(step, 36) : 0;
19201
+ map.set(lastCode += skip, TYPES[type2]);
19202
+ for (var i = 0; i < step; i++) {
19203
+ map.set(++lastCode, TYPES[type2]);
19204
+ }
19205
+ });
19206
+ }
19207
+ };
19208
+ for (var type in DATA) loop(type);
19209
+ }
19210
+ }
19211
+ function getBidiCharType(char) {
19212
+ parseData();
19213
+ return map.get(char.codePointAt(0)) || TYPES.L;
19214
+ }
19215
+ function getBidiCharTypeName(char) {
19216
+ return TYPES_TO_NAMES[getBidiCharType(char)];
19217
+ }
19218
+ var data$1 = {
19219
+ "pairs": "14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",
19220
+ "canonical": "6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"
19221
+ };
19222
+ function parseCharacterMap(encodedString, includeReverse) {
19223
+ var radix = 36;
19224
+ var lastCode = 0;
19225
+ var map2 = /* @__PURE__ */ new Map();
19226
+ var reverseMap = includeReverse && /* @__PURE__ */ new Map();
19227
+ var prevPair;
19228
+ encodedString.split(",").forEach(function visit(entry) {
19229
+ if (entry.indexOf("+") !== -1) {
19230
+ for (var i = +entry; i--; ) {
19231
+ visit(prevPair);
19232
+ }
19233
+ } else {
19234
+ prevPair = entry;
19235
+ var ref = entry.split(">");
19236
+ var a = ref[0];
19237
+ var b = ref[1];
19238
+ a = String.fromCodePoint(lastCode += parseInt(a, radix));
19239
+ b = String.fromCodePoint(lastCode += parseInt(b, radix));
19240
+ map2.set(a, b);
19241
+ includeReverse && reverseMap.set(b, a);
19242
+ }
19243
+ });
19244
+ return { map: map2, reverseMap };
19245
+ }
19246
+ var openToClose, closeToOpen, canonical;
19247
+ function parse$1() {
19248
+ if (!openToClose) {
19249
+ var ref = parseCharacterMap(data$1.pairs, true);
19250
+ var map2 = ref.map;
19251
+ var reverseMap = ref.reverseMap;
19252
+ openToClose = map2;
19253
+ closeToOpen = reverseMap;
19254
+ canonical = parseCharacterMap(data$1.canonical, false).map;
19255
+ }
19256
+ }
19257
+ function openingToClosingBracket(char) {
19258
+ parse$1();
19259
+ return openToClose.get(char) || null;
19260
+ }
19261
+ function closingToOpeningBracket(char) {
19262
+ parse$1();
19263
+ return closeToOpen.get(char) || null;
19264
+ }
19265
+ function getCanonicalBracket(char) {
19266
+ parse$1();
19267
+ return canonical.get(char) || null;
19268
+ }
19269
+ var TYPE_L = TYPES.L;
19270
+ var TYPE_R = TYPES.R;
19271
+ var TYPE_EN = TYPES.EN;
19272
+ var TYPE_ES = TYPES.ES;
19273
+ var TYPE_ET = TYPES.ET;
19274
+ var TYPE_AN = TYPES.AN;
19275
+ var TYPE_CS = TYPES.CS;
19276
+ var TYPE_B = TYPES.B;
19277
+ var TYPE_S = TYPES.S;
19278
+ var TYPE_ON = TYPES.ON;
19279
+ var TYPE_BN = TYPES.BN;
19280
+ var TYPE_NSM = TYPES.NSM;
19281
+ var TYPE_AL = TYPES.AL;
19282
+ var TYPE_LRO = TYPES.LRO;
19283
+ var TYPE_RLO = TYPES.RLO;
19284
+ var TYPE_LRE = TYPES.LRE;
19285
+ var TYPE_RLE = TYPES.RLE;
19286
+ var TYPE_PDF = TYPES.PDF;
19287
+ var TYPE_LRI = TYPES.LRI;
19288
+ var TYPE_RLI = TYPES.RLI;
19289
+ var TYPE_FSI = TYPES.FSI;
19290
+ var TYPE_PDI = TYPES.PDI;
19291
+ function getEmbeddingLevels(string, baseDirection) {
19292
+ var MAX_DEPTH = 125;
19293
+ var charTypes = new Uint32Array(string.length);
19294
+ for (var i = 0; i < string.length; i++) {
19295
+ charTypes[i] = getBidiCharType(string[i]);
19296
+ }
19297
+ var charTypeCounts = /* @__PURE__ */ new Map();
19298
+ function changeCharType(i2, type2) {
19299
+ var oldType = charTypes[i2];
19300
+ charTypes[i2] = type2;
19301
+ charTypeCounts.set(oldType, charTypeCounts.get(oldType) - 1);
19302
+ if (oldType & NEUTRAL_ISOLATE_TYPES) {
19303
+ charTypeCounts.set(NEUTRAL_ISOLATE_TYPES, charTypeCounts.get(NEUTRAL_ISOLATE_TYPES) - 1);
19304
+ }
19305
+ charTypeCounts.set(type2, (charTypeCounts.get(type2) || 0) + 1);
19306
+ if (type2 & NEUTRAL_ISOLATE_TYPES) {
19307
+ charTypeCounts.set(NEUTRAL_ISOLATE_TYPES, (charTypeCounts.get(NEUTRAL_ISOLATE_TYPES) || 0) + 1);
19308
+ }
19309
+ }
19310
+ var embedLevels = new Uint8Array(string.length);
19311
+ var isolationPairs = /* @__PURE__ */ new Map();
19312
+ var paragraphs = [];
19313
+ var paragraph = null;
19314
+ for (var i$1 = 0; i$1 < string.length; i$1++) {
19315
+ if (!paragraph) {
19316
+ paragraphs.push(paragraph = {
19317
+ start: i$1,
19318
+ end: string.length - 1,
19319
+ // 3.3.1 P2-P3: Determine the paragraph level
19320
+ level: baseDirection === "rtl" ? 1 : baseDirection === "ltr" ? 0 : determineAutoEmbedLevel(i$1, false)
19321
+ });
19322
+ }
19323
+ if (charTypes[i$1] & TYPE_B) {
19324
+ paragraph.end = i$1;
19325
+ paragraph = null;
19326
+ }
19327
+ }
19328
+ var FORMATTING_TYPES = TYPE_RLE | TYPE_LRE | TYPE_RLO | TYPE_LRO | ISOLATE_INIT_TYPES | TYPE_PDI | TYPE_PDF | TYPE_B;
19329
+ var nextEven = function(n) {
19330
+ return n + (n & 1 ? 1 : 2);
19331
+ };
19332
+ var nextOdd = function(n) {
19333
+ return n + (n & 1 ? 2 : 1);
19334
+ };
19335
+ for (var paraIdx = 0; paraIdx < paragraphs.length; paraIdx++) {
19336
+ paragraph = paragraphs[paraIdx];
19337
+ var statusStack = [{
19338
+ _level: paragraph.level,
19339
+ _override: 0,
19340
+ //0=neutral, 1=L, 2=R
19341
+ _isolate: 0
19342
+ //bool
19343
+ }];
19344
+ var stackTop = void 0;
19345
+ var overflowIsolateCount = 0;
19346
+ var overflowEmbeddingCount = 0;
19347
+ var validIsolateCount = 0;
19348
+ charTypeCounts.clear();
19349
+ for (var i$2 = paragraph.start; i$2 <= paragraph.end; i$2++) {
19350
+ var charType = charTypes[i$2];
19351
+ stackTop = statusStack[statusStack.length - 1];
19352
+ charTypeCounts.set(charType, (charTypeCounts.get(charType) || 0) + 1);
19353
+ if (charType & NEUTRAL_ISOLATE_TYPES) {
19354
+ charTypeCounts.set(NEUTRAL_ISOLATE_TYPES, (charTypeCounts.get(NEUTRAL_ISOLATE_TYPES) || 0) + 1);
19355
+ }
19356
+ if (charType & FORMATTING_TYPES) {
19357
+ if (charType & (TYPE_RLE | TYPE_LRE)) {
19358
+ embedLevels[i$2] = stackTop._level;
19359
+ var level = (charType === TYPE_RLE ? nextOdd : nextEven)(stackTop._level);
19360
+ if (level <= MAX_DEPTH && !overflowIsolateCount && !overflowEmbeddingCount) {
19361
+ statusStack.push({
19362
+ _level: level,
19363
+ _override: 0,
19364
+ _isolate: 0
19365
+ });
19366
+ } else if (!overflowIsolateCount) {
19367
+ overflowEmbeddingCount++;
19368
+ }
19369
+ } else if (charType & (TYPE_RLO | TYPE_LRO)) {
19370
+ embedLevels[i$2] = stackTop._level;
19371
+ var level$1 = (charType === TYPE_RLO ? nextOdd : nextEven)(stackTop._level);
19372
+ if (level$1 <= MAX_DEPTH && !overflowIsolateCount && !overflowEmbeddingCount) {
19373
+ statusStack.push({
19374
+ _level: level$1,
19375
+ _override: charType & TYPE_RLO ? TYPE_R : TYPE_L,
19376
+ _isolate: 0
19377
+ });
19378
+ } else if (!overflowIsolateCount) {
19379
+ overflowEmbeddingCount++;
19380
+ }
19381
+ } else if (charType & ISOLATE_INIT_TYPES) {
19382
+ if (charType & TYPE_FSI) {
19383
+ charType = determineAutoEmbedLevel(i$2 + 1, true) === 1 ? TYPE_RLI : TYPE_LRI;
19384
+ }
19385
+ embedLevels[i$2] = stackTop._level;
19386
+ if (stackTop._override) {
19387
+ changeCharType(i$2, stackTop._override);
19388
+ }
19389
+ var level$2 = (charType === TYPE_RLI ? nextOdd : nextEven)(stackTop._level);
19390
+ if (level$2 <= MAX_DEPTH && overflowIsolateCount === 0 && overflowEmbeddingCount === 0) {
19391
+ validIsolateCount++;
19392
+ statusStack.push({
19393
+ _level: level$2,
19394
+ _override: 0,
19395
+ _isolate: 1,
19396
+ _isolInitIndex: i$2
19397
+ });
19398
+ } else {
19399
+ overflowIsolateCount++;
19400
+ }
19401
+ } else if (charType & TYPE_PDI) {
19402
+ if (overflowIsolateCount > 0) {
19403
+ overflowIsolateCount--;
19404
+ } else if (validIsolateCount > 0) {
19405
+ overflowEmbeddingCount = 0;
19406
+ while (!statusStack[statusStack.length - 1]._isolate) {
19407
+ statusStack.pop();
19408
+ }
19409
+ var isolInitIndex = statusStack[statusStack.length - 1]._isolInitIndex;
19410
+ if (isolInitIndex != null) {
19411
+ isolationPairs.set(isolInitIndex, i$2);
19412
+ isolationPairs.set(i$2, isolInitIndex);
19413
+ }
19414
+ statusStack.pop();
19415
+ validIsolateCount--;
19416
+ }
19417
+ stackTop = statusStack[statusStack.length - 1];
19418
+ embedLevels[i$2] = stackTop._level;
19419
+ if (stackTop._override) {
19420
+ changeCharType(i$2, stackTop._override);
19421
+ }
19422
+ } else if (charType & TYPE_PDF) {
19423
+ if (overflowIsolateCount === 0) {
19424
+ if (overflowEmbeddingCount > 0) {
19425
+ overflowEmbeddingCount--;
19426
+ } else if (!stackTop._isolate && statusStack.length > 1) {
19427
+ statusStack.pop();
19428
+ stackTop = statusStack[statusStack.length - 1];
19429
+ }
19430
+ }
19431
+ embedLevels[i$2] = stackTop._level;
19432
+ } else if (charType & TYPE_B) {
19433
+ embedLevels[i$2] = paragraph.level;
19434
+ }
19435
+ } else {
19436
+ embedLevels[i$2] = stackTop._level;
19437
+ if (stackTop._override && charType !== TYPE_BN) {
19438
+ changeCharType(i$2, stackTop._override);
19439
+ }
19440
+ }
19441
+ }
19442
+ var levelRuns = [];
19443
+ var currentRun = null;
19444
+ for (var i$3 = paragraph.start; i$3 <= paragraph.end; i$3++) {
19445
+ var charType$1 = charTypes[i$3];
19446
+ if (!(charType$1 & BN_LIKE_TYPES)) {
19447
+ var lvl = embedLevels[i$3];
19448
+ var isIsolInit = charType$1 & ISOLATE_INIT_TYPES;
19449
+ var isPDI = charType$1 === TYPE_PDI;
19450
+ if (currentRun && lvl === currentRun._level) {
19451
+ currentRun._end = i$3;
19452
+ currentRun._endsWithIsolInit = isIsolInit;
19453
+ } else {
19454
+ levelRuns.push(currentRun = {
19455
+ _start: i$3,
19456
+ _end: i$3,
19457
+ _level: lvl,
19458
+ _startsWithPDI: isPDI,
19459
+ _endsWithIsolInit: isIsolInit
19460
+ });
19461
+ }
19462
+ }
19463
+ }
19464
+ var isolatingRunSeqs = [];
19465
+ for (var runIdx = 0; runIdx < levelRuns.length; runIdx++) {
19466
+ var run = levelRuns[runIdx];
19467
+ if (!run._startsWithPDI || run._startsWithPDI && !isolationPairs.has(run._start)) {
19468
+ var seqRuns = [currentRun = run];
19469
+ for (var pdiIndex = void 0; currentRun && currentRun._endsWithIsolInit && (pdiIndex = isolationPairs.get(currentRun._end)) != null; ) {
19470
+ for (var i$4 = runIdx + 1; i$4 < levelRuns.length; i$4++) {
19471
+ if (levelRuns[i$4]._start === pdiIndex) {
19472
+ seqRuns.push(currentRun = levelRuns[i$4]);
19473
+ break;
19474
+ }
19475
+ }
19476
+ }
19477
+ var seqIndices = [];
19478
+ for (var i$5 = 0; i$5 < seqRuns.length; i$5++) {
19479
+ var run$1 = seqRuns[i$5];
19480
+ for (var j = run$1._start; j <= run$1._end; j++) {
19481
+ seqIndices.push(j);
19482
+ }
19483
+ }
19484
+ var firstLevel = embedLevels[seqIndices[0]];
19485
+ var prevLevel = paragraph.level;
19486
+ for (var i$6 = seqIndices[0] - 1; i$6 >= 0; i$6--) {
19487
+ if (!(charTypes[i$6] & BN_LIKE_TYPES)) {
19488
+ prevLevel = embedLevels[i$6];
19489
+ break;
19490
+ }
19491
+ }
19492
+ var lastIndex = seqIndices[seqIndices.length - 1];
19493
+ var lastLevel = embedLevels[lastIndex];
19494
+ var nextLevel = paragraph.level;
19495
+ if (!(charTypes[lastIndex] & ISOLATE_INIT_TYPES)) {
19496
+ for (var i$7 = lastIndex + 1; i$7 <= paragraph.end; i$7++) {
19497
+ if (!(charTypes[i$7] & BN_LIKE_TYPES)) {
19498
+ nextLevel = embedLevels[i$7];
19499
+ break;
19500
+ }
19501
+ }
19502
+ }
19503
+ isolatingRunSeqs.push({
19504
+ _seqIndices: seqIndices,
19505
+ _sosType: Math.max(prevLevel, firstLevel) % 2 ? TYPE_R : TYPE_L,
19506
+ _eosType: Math.max(nextLevel, lastLevel) % 2 ? TYPE_R : TYPE_L
19507
+ });
19508
+ }
19509
+ }
19510
+ for (var seqIdx = 0; seqIdx < isolatingRunSeqs.length; seqIdx++) {
19511
+ var ref = isolatingRunSeqs[seqIdx];
19512
+ var seqIndices$1 = ref._seqIndices;
19513
+ var sosType = ref._sosType;
19514
+ var eosType = ref._eosType;
19515
+ var embedDirection = embedLevels[seqIndices$1[0]] & 1 ? TYPE_R : TYPE_L;
19516
+ if (charTypeCounts.get(TYPE_NSM)) {
19517
+ for (var si = 0; si < seqIndices$1.length; si++) {
19518
+ var i$8 = seqIndices$1[si];
19519
+ if (charTypes[i$8] & TYPE_NSM) {
19520
+ var prevType = sosType;
19521
+ for (var sj = si - 1; sj >= 0; sj--) {
19522
+ if (!(charTypes[seqIndices$1[sj]] & BN_LIKE_TYPES)) {
19523
+ prevType = charTypes[seqIndices$1[sj]];
19524
+ break;
19525
+ }
19526
+ }
19527
+ changeCharType(i$8, prevType & (ISOLATE_INIT_TYPES | TYPE_PDI) ? TYPE_ON : prevType);
19528
+ }
19529
+ }
19530
+ }
19531
+ if (charTypeCounts.get(TYPE_EN)) {
19532
+ for (var si$1 = 0; si$1 < seqIndices$1.length; si$1++) {
19533
+ var i$9 = seqIndices$1[si$1];
19534
+ if (charTypes[i$9] & TYPE_EN) {
19535
+ for (var sj$1 = si$1 - 1; sj$1 >= -1; sj$1--) {
19536
+ var prevCharType = sj$1 === -1 ? sosType : charTypes[seqIndices$1[sj$1]];
19537
+ if (prevCharType & STRONG_TYPES) {
19538
+ if (prevCharType === TYPE_AL) {
19539
+ changeCharType(i$9, TYPE_AN);
19540
+ }
19541
+ break;
19542
+ }
19543
+ }
19544
+ }
19545
+ }
19546
+ }
19547
+ if (charTypeCounts.get(TYPE_AL)) {
19548
+ for (var si$2 = 0; si$2 < seqIndices$1.length; si$2++) {
19549
+ var i$10 = seqIndices$1[si$2];
19550
+ if (charTypes[i$10] & TYPE_AL) {
19551
+ changeCharType(i$10, TYPE_R);
19552
+ }
19553
+ }
19554
+ }
19555
+ if (charTypeCounts.get(TYPE_ES) || charTypeCounts.get(TYPE_CS)) {
19556
+ for (var si$3 = 1; si$3 < seqIndices$1.length - 1; si$3++) {
19557
+ var i$11 = seqIndices$1[si$3];
19558
+ if (charTypes[i$11] & (TYPE_ES | TYPE_CS)) {
19559
+ var prevType$1 = 0, nextType = 0;
19560
+ for (var sj$2 = si$3 - 1; sj$2 >= 0; sj$2--) {
19561
+ prevType$1 = charTypes[seqIndices$1[sj$2]];
19562
+ if (!(prevType$1 & BN_LIKE_TYPES)) {
19563
+ break;
19564
+ }
19565
+ }
19566
+ for (var sj$3 = si$3 + 1; sj$3 < seqIndices$1.length; sj$3++) {
19567
+ nextType = charTypes[seqIndices$1[sj$3]];
19568
+ if (!(nextType & BN_LIKE_TYPES)) {
19569
+ break;
19570
+ }
19571
+ }
19572
+ if (prevType$1 === nextType && (charTypes[i$11] === TYPE_ES ? prevType$1 === TYPE_EN : prevType$1 & (TYPE_EN | TYPE_AN))) {
19573
+ changeCharType(i$11, prevType$1);
19574
+ }
19575
+ }
19576
+ }
19577
+ }
19578
+ if (charTypeCounts.get(TYPE_EN)) {
19579
+ for (var si$4 = 0; si$4 < seqIndices$1.length; si$4++) {
19580
+ var i$12 = seqIndices$1[si$4];
19581
+ if (charTypes[i$12] & TYPE_EN) {
19582
+ for (var sj$4 = si$4 - 1; sj$4 >= 0 && charTypes[seqIndices$1[sj$4]] & (TYPE_ET | BN_LIKE_TYPES); sj$4--) {
19583
+ changeCharType(seqIndices$1[sj$4], TYPE_EN);
19584
+ }
19585
+ for (si$4++; si$4 < seqIndices$1.length && charTypes[seqIndices$1[si$4]] & (TYPE_ET | BN_LIKE_TYPES | TYPE_EN); si$4++) {
19586
+ if (charTypes[seqIndices$1[si$4]] !== TYPE_EN) {
19587
+ changeCharType(seqIndices$1[si$4], TYPE_EN);
19588
+ }
19589
+ }
19590
+ }
19591
+ }
19592
+ }
19593
+ if (charTypeCounts.get(TYPE_ET) || charTypeCounts.get(TYPE_ES) || charTypeCounts.get(TYPE_CS)) {
19594
+ for (var si$5 = 0; si$5 < seqIndices$1.length; si$5++) {
19595
+ var i$13 = seqIndices$1[si$5];
19596
+ if (charTypes[i$13] & (TYPE_ET | TYPE_ES | TYPE_CS)) {
19597
+ changeCharType(i$13, TYPE_ON);
19598
+ for (var sj$5 = si$5 - 1; sj$5 >= 0 && charTypes[seqIndices$1[sj$5]] & BN_LIKE_TYPES; sj$5--) {
19599
+ changeCharType(seqIndices$1[sj$5], TYPE_ON);
19600
+ }
19601
+ for (var sj$6 = si$5 + 1; sj$6 < seqIndices$1.length && charTypes[seqIndices$1[sj$6]] & BN_LIKE_TYPES; sj$6++) {
19602
+ changeCharType(seqIndices$1[sj$6], TYPE_ON);
19603
+ }
19604
+ }
19605
+ }
19606
+ }
19607
+ if (charTypeCounts.get(TYPE_EN)) {
19608
+ for (var si$6 = 0, prevStrongType = sosType; si$6 < seqIndices$1.length; si$6++) {
19609
+ var i$14 = seqIndices$1[si$6];
19610
+ var type = charTypes[i$14];
19611
+ if (type & TYPE_EN) {
19612
+ if (prevStrongType === TYPE_L) {
19613
+ changeCharType(i$14, TYPE_L);
19614
+ }
19615
+ } else if (type & STRONG_TYPES) {
19616
+ prevStrongType = type;
19617
+ }
19618
+ }
19619
+ }
19620
+ if (charTypeCounts.get(NEUTRAL_ISOLATE_TYPES)) {
19621
+ var R_TYPES_FOR_N_STEPS = TYPE_R | TYPE_EN | TYPE_AN;
19622
+ var STRONG_TYPES_FOR_N_STEPS = R_TYPES_FOR_N_STEPS | TYPE_L;
19623
+ var bracketPairs = [];
19624
+ {
19625
+ var openerStack = [];
19626
+ for (var si$7 = 0; si$7 < seqIndices$1.length; si$7++) {
19627
+ if (charTypes[seqIndices$1[si$7]] & NEUTRAL_ISOLATE_TYPES) {
19628
+ var char = string[seqIndices$1[si$7]];
19629
+ var oppositeBracket = void 0;
19630
+ if (openingToClosingBracket(char) !== null) {
19631
+ if (openerStack.length < 63) {
19632
+ openerStack.push({ char, seqIndex: si$7 });
19633
+ } else {
19634
+ break;
19635
+ }
19636
+ } else if ((oppositeBracket = closingToOpeningBracket(char)) !== null) {
19637
+ for (var stackIdx = openerStack.length - 1; stackIdx >= 0; stackIdx--) {
19638
+ var stackChar = openerStack[stackIdx].char;
19639
+ if (stackChar === oppositeBracket || stackChar === closingToOpeningBracket(getCanonicalBracket(char)) || openingToClosingBracket(getCanonicalBracket(stackChar)) === char) {
19640
+ bracketPairs.push([openerStack[stackIdx].seqIndex, si$7]);
19641
+ openerStack.length = stackIdx;
19642
+ break;
19643
+ }
19644
+ }
19645
+ }
19646
+ }
19647
+ }
19648
+ bracketPairs.sort(function(a, b) {
19649
+ return a[0] - b[0];
19650
+ });
19651
+ }
19652
+ for (var pairIdx = 0; pairIdx < bracketPairs.length; pairIdx++) {
19653
+ var ref$1 = bracketPairs[pairIdx];
19654
+ var openSeqIdx = ref$1[0];
19655
+ var closeSeqIdx = ref$1[1];
19656
+ var foundStrongType = false;
19657
+ var useStrongType = 0;
19658
+ for (var si$8 = openSeqIdx + 1; si$8 < closeSeqIdx; si$8++) {
19659
+ var i$15 = seqIndices$1[si$8];
19660
+ if (charTypes[i$15] & STRONG_TYPES_FOR_N_STEPS) {
19661
+ foundStrongType = true;
19662
+ var lr = charTypes[i$15] & R_TYPES_FOR_N_STEPS ? TYPE_R : TYPE_L;
19663
+ if (lr === embedDirection) {
19664
+ useStrongType = lr;
19665
+ break;
19666
+ }
19667
+ }
19668
+ }
19669
+ if (foundStrongType && !useStrongType) {
19670
+ useStrongType = sosType;
19671
+ for (var si$9 = openSeqIdx - 1; si$9 >= 0; si$9--) {
19672
+ var i$16 = seqIndices$1[si$9];
19673
+ if (charTypes[i$16] & STRONG_TYPES_FOR_N_STEPS) {
19674
+ var lr$1 = charTypes[i$16] & R_TYPES_FOR_N_STEPS ? TYPE_R : TYPE_L;
19675
+ if (lr$1 !== embedDirection) {
19676
+ useStrongType = lr$1;
19677
+ } else {
19678
+ useStrongType = embedDirection;
19679
+ }
19680
+ break;
19681
+ }
19682
+ }
19683
+ }
19684
+ if (useStrongType) {
19685
+ charTypes[seqIndices$1[openSeqIdx]] = charTypes[seqIndices$1[closeSeqIdx]] = useStrongType;
19686
+ if (useStrongType !== embedDirection) {
19687
+ for (var si$10 = openSeqIdx + 1; si$10 < seqIndices$1.length; si$10++) {
19688
+ if (!(charTypes[seqIndices$1[si$10]] & BN_LIKE_TYPES)) {
19689
+ if (getBidiCharType(string[seqIndices$1[si$10]]) & TYPE_NSM) {
19690
+ charTypes[seqIndices$1[si$10]] = useStrongType;
19691
+ }
19692
+ break;
19693
+ }
19694
+ }
19695
+ }
19696
+ if (useStrongType !== embedDirection) {
19697
+ for (var si$11 = closeSeqIdx + 1; si$11 < seqIndices$1.length; si$11++) {
19698
+ if (!(charTypes[seqIndices$1[si$11]] & BN_LIKE_TYPES)) {
19699
+ if (getBidiCharType(string[seqIndices$1[si$11]]) & TYPE_NSM) {
19700
+ charTypes[seqIndices$1[si$11]] = useStrongType;
19701
+ }
19702
+ break;
19703
+ }
19704
+ }
19705
+ }
19706
+ }
19707
+ }
19708
+ for (var si$12 = 0; si$12 < seqIndices$1.length; si$12++) {
19709
+ if (charTypes[seqIndices$1[si$12]] & NEUTRAL_ISOLATE_TYPES) {
19710
+ var niRunStart = si$12, niRunEnd = si$12;
19711
+ var prevType$2 = sosType;
19712
+ for (var si2 = si$12 - 1; si2 >= 0; si2--) {
19713
+ if (charTypes[seqIndices$1[si2]] & BN_LIKE_TYPES) {
19714
+ niRunStart = si2;
19715
+ } else {
19716
+ prevType$2 = charTypes[seqIndices$1[si2]] & R_TYPES_FOR_N_STEPS ? TYPE_R : TYPE_L;
19717
+ break;
19718
+ }
19719
+ }
19720
+ var nextType$1 = eosType;
19721
+ for (var si2$1 = si$12 + 1; si2$1 < seqIndices$1.length; si2$1++) {
19722
+ if (charTypes[seqIndices$1[si2$1]] & (NEUTRAL_ISOLATE_TYPES | BN_LIKE_TYPES)) {
19723
+ niRunEnd = si2$1;
19724
+ } else {
19725
+ nextType$1 = charTypes[seqIndices$1[si2$1]] & R_TYPES_FOR_N_STEPS ? TYPE_R : TYPE_L;
19726
+ break;
19727
+ }
19728
+ }
19729
+ for (var sj$7 = niRunStart; sj$7 <= niRunEnd; sj$7++) {
19730
+ charTypes[seqIndices$1[sj$7]] = prevType$2 === nextType$1 ? prevType$2 : embedDirection;
19731
+ }
19732
+ si$12 = niRunEnd;
19733
+ }
19734
+ }
19735
+ }
19736
+ }
19737
+ for (var i$17 = paragraph.start; i$17 <= paragraph.end; i$17++) {
19738
+ var level$3 = embedLevels[i$17];
19739
+ var type$1 = charTypes[i$17];
19740
+ if (level$3 & 1) {
19741
+ if (type$1 & (TYPE_L | TYPE_EN | TYPE_AN)) {
19742
+ embedLevels[i$17]++;
19743
+ }
19744
+ } else {
19745
+ if (type$1 & TYPE_R) {
19746
+ embedLevels[i$17]++;
19747
+ } else if (type$1 & (TYPE_AN | TYPE_EN)) {
19748
+ embedLevels[i$17] += 2;
19749
+ }
19750
+ }
19751
+ if (type$1 & BN_LIKE_TYPES) {
19752
+ embedLevels[i$17] = i$17 === 0 ? paragraph.level : embedLevels[i$17 - 1];
19753
+ }
19754
+ if (i$17 === paragraph.end || getBidiCharType(string[i$17]) & (TYPE_S | TYPE_B)) {
19755
+ for (var j$1 = i$17; j$1 >= 0 && getBidiCharType(string[j$1]) & TRAILING_TYPES; j$1--) {
19756
+ embedLevels[j$1] = paragraph.level;
19757
+ }
19758
+ }
19759
+ }
19760
+ }
19761
+ return {
19762
+ levels: embedLevels,
19763
+ paragraphs
19764
+ };
19765
+ function determineAutoEmbedLevel(start, isFSI) {
19766
+ for (var i2 = start; i2 < string.length; i2++) {
19767
+ var charType2 = charTypes[i2];
19768
+ if (charType2 & (TYPE_R | TYPE_AL)) {
19769
+ return 1;
19770
+ }
19771
+ if (charType2 & (TYPE_B | TYPE_L) || isFSI && charType2 === TYPE_PDI) {
19772
+ return 0;
19773
+ }
19774
+ if (charType2 & ISOLATE_INIT_TYPES) {
19775
+ var pdi = indexOfMatchingPDI(i2);
19776
+ i2 = pdi === -1 ? string.length : pdi;
19777
+ }
19778
+ }
19779
+ return 0;
19780
+ }
19781
+ function indexOfMatchingPDI(isolateStart) {
19782
+ var isolationLevel = 1;
19783
+ for (var i2 = isolateStart + 1; i2 < string.length; i2++) {
19784
+ var charType2 = charTypes[i2];
19785
+ if (charType2 & TYPE_B) {
19786
+ break;
19787
+ }
19788
+ if (charType2 & TYPE_PDI) {
19789
+ if (--isolationLevel === 0) {
19790
+ return i2;
19791
+ }
19792
+ } else if (charType2 & ISOLATE_INIT_TYPES) {
19793
+ isolationLevel++;
19794
+ }
19795
+ }
19796
+ return -1;
19797
+ }
19798
+ }
19799
+ var data = "14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1";
19800
+ var mirrorMap;
19801
+ function parse() {
19802
+ if (!mirrorMap) {
19803
+ var ref = parseCharacterMap(data, true);
19804
+ var map2 = ref.map;
19805
+ var reverseMap = ref.reverseMap;
19806
+ reverseMap.forEach(function(value, key) {
19807
+ map2.set(key, value);
19808
+ });
19809
+ mirrorMap = map2;
19810
+ }
19811
+ }
19812
+ function getMirroredCharacter(char) {
19813
+ parse();
19814
+ return mirrorMap.get(char) || null;
19815
+ }
19816
+ function getMirroredCharactersMap(string, embeddingLevels, start, end) {
19817
+ var strLen = string.length;
19818
+ start = Math.max(0, start == null ? 0 : +start);
19819
+ end = Math.min(strLen - 1, end == null ? strLen - 1 : +end);
19820
+ var map2 = /* @__PURE__ */ new Map();
19821
+ for (var i = start; i <= end; i++) {
19822
+ if (embeddingLevels[i] & 1) {
19823
+ var mirror = getMirroredCharacter(string[i]);
19824
+ if (mirror !== null) {
19825
+ map2.set(i, mirror);
19826
+ }
19827
+ }
19828
+ }
19829
+ return map2;
19830
+ }
19831
+ function getReorderSegments(string, embeddingLevelsResult, start, end) {
19832
+ var strLen = string.length;
19833
+ start = Math.max(0, start == null ? 0 : +start);
19834
+ end = Math.min(strLen - 1, end == null ? strLen - 1 : +end);
19835
+ var segments = [];
19836
+ embeddingLevelsResult.paragraphs.forEach(function(paragraph) {
19837
+ var lineStart = Math.max(start, paragraph.start);
19838
+ var lineEnd = Math.min(end, paragraph.end);
19839
+ if (lineStart < lineEnd) {
19840
+ var lineLevels = embeddingLevelsResult.levels.slice(lineStart, lineEnd + 1);
19841
+ for (var i = lineEnd; i >= lineStart && getBidiCharType(string[i]) & TRAILING_TYPES; i--) {
19842
+ lineLevels[i] = paragraph.level;
19843
+ }
19844
+ var maxLevel = paragraph.level;
19845
+ var minOddLevel = Infinity;
19846
+ for (var i$1 = 0; i$1 < lineLevels.length; i$1++) {
19847
+ var level = lineLevels[i$1];
19848
+ if (level > maxLevel) {
19849
+ maxLevel = level;
19850
+ }
19851
+ if (level < minOddLevel) {
19852
+ minOddLevel = level | 1;
19853
+ }
19854
+ }
19855
+ for (var lvl = maxLevel; lvl >= minOddLevel; lvl--) {
19856
+ for (var i$2 = 0; i$2 < lineLevels.length; i$2++) {
19857
+ if (lineLevels[i$2] >= lvl) {
19858
+ var segStart = i$2;
19859
+ while (i$2 + 1 < lineLevels.length && lineLevels[i$2 + 1] >= lvl) {
19860
+ i$2++;
19861
+ }
19862
+ if (i$2 > segStart) {
19863
+ segments.push([segStart + lineStart, i$2 + lineStart]);
19864
+ }
19865
+ }
19866
+ }
19867
+ }
19868
+ }
19869
+ });
19870
+ return segments;
19871
+ }
19872
+ function getReorderedString(string, embedLevelsResult, start, end) {
19873
+ var indices = getReorderedIndices(string, embedLevelsResult, start, end);
19874
+ var chars = [].concat(string);
19875
+ indices.forEach(function(charIndex, i) {
19876
+ chars[i] = (embedLevelsResult.levels[charIndex] & 1 ? getMirroredCharacter(string[charIndex]) : null) || string[charIndex];
19877
+ });
19878
+ return chars.join("");
19879
+ }
19880
+ function getReorderedIndices(string, embedLevelsResult, start, end) {
19881
+ var segments = getReorderSegments(string, embedLevelsResult, start, end);
19882
+ var indices = [];
19883
+ for (var i = 0; i < string.length; i++) {
19884
+ indices[i] = i;
19885
+ }
19886
+ segments.forEach(function(ref) {
19887
+ var start2 = ref[0];
19888
+ var end2 = ref[1];
19889
+ var slice = indices.slice(start2, end2 + 1);
19890
+ for (var i2 = slice.length; i2--; ) {
19891
+ indices[end2 - i2] = slice[i2];
19892
+ }
19893
+ });
19894
+ return indices;
19895
+ }
19896
+ exports.closingToOpeningBracket = closingToOpeningBracket;
19897
+ exports.getBidiCharType = getBidiCharType;
19898
+ exports.getBidiCharTypeName = getBidiCharTypeName;
19899
+ exports.getCanonicalBracket = getCanonicalBracket;
19900
+ exports.getEmbeddingLevels = getEmbeddingLevels;
19901
+ exports.getMirroredCharacter = getMirroredCharacter;
19902
+ exports.getMirroredCharactersMap = getMirroredCharactersMap;
19903
+ exports.getReorderSegments = getReorderSegments;
19904
+ exports.getReorderedIndices = getReorderedIndices;
19905
+ exports.getReorderedString = getReorderedString;
19906
+ exports.openingToClosingBracket = openingToClosingBracket;
19907
+ Object.defineProperty(exports, "__esModule", { value: true });
19908
+ return exports;
19909
+ })({});
19910
+ return bidi;
19911
+ }
19912
+ var bidi_default = bidiFactory;
19913
+
18425
19914
  // src/claude-ink/bidi.ts
18426
- import bidiFactory from "bidi-js";
18427
19915
  var bidiInstance;
18428
19916
  var needsSoftwareBidi;
18429
19917
  function needsBidi() {
@@ -18435,7 +19923,7 @@ function needsBidi() {
18435
19923
  }
18436
19924
  function getBidi() {
18437
19925
  if (!bidiInstance) {
18438
- bidiInstance = bidiFactory();
19926
+ bidiInstance = bidi_default();
18439
19927
  }
18440
19928
  return bidiInstance;
18441
19929
  }
@@ -18969,9 +20457,6 @@ var getMaxWidth = (yogaNode) => {
18969
20457
  };
18970
20458
  var get_max_width_default = getMaxWidth;
18971
20459
 
18972
- // src/claude-ink/render-border.ts
18973
- import chalk2 from "chalk";
18974
-
18975
20460
  // node_modules/cli-boxes/boxes.json
18976
20461
  var boxes_default = {
18977
20462
  single: {
@@ -19095,7 +20580,7 @@ function embedTextInBorder(borderLine, text, align, offset = 0, borderChar) {
19095
20580
  function styleBorderLine(line, color, dim) {
19096
20581
  let styled = applyColor(line, color);
19097
20582
  if (dim) {
19098
- styled = chalk2.dim(styled);
20583
+ styled = source_default.dim(styled);
19099
20584
  }
19100
20585
  return styled;
19101
20586
  }
@@ -19150,13 +20635,13 @@ var renderBorder = (x, y, node, output) => {
19150
20635
  verticalBorderHeight
19151
20636
  );
19152
20637
  if (dimLeftBorderColor) {
19153
- leftBorder = chalk2.dim(leftBorder);
20638
+ leftBorder = source_default.dim(leftBorder);
19154
20639
  }
19155
20640
  let rightBorder = (applyColor(box.right, rightBorderColor) + "\n").repeat(
19156
20641
  verticalBorderHeight
19157
20642
  );
19158
20643
  if (dimRightBorderColor) {
19159
- rightBorder = chalk2.dim(rightBorder);
20644
+ rightBorder = source_default.dim(rightBorder);
19160
20645
  }
19161
20646
  const bottomBorderLine = showBottomBorder ? (showLeftBorder ? box.bottomLeft : "") + box.bottom.repeat(contentWidth) + (showRightBorder ? box.bottomRight : "") : "";
19162
20647
  let bottomBorder;
@@ -19947,7 +21432,6 @@ var render_node_to_output_default = renderNodeToOutput;
19947
21432
 
19948
21433
  // src/claude-ink/render-to-screen.ts
19949
21434
  var import_constants3 = __toESM(require_constants(), 1);
19950
- import noop from "lodash-es/noop.js";
19951
21435
  var timing = { reconcile: 0, yoga: 0, paint: 0, scan: 0, calls: 0 };
19952
21436
  function scanPositions(screen, query) {
19953
21437
  const lq = query.toLowerCase();
@@ -20138,7 +21622,7 @@ function applySearchHighlight(screen, query, stylePool) {
20138
21622
  }
20139
21623
 
20140
21624
  // src/claude-ink/ink.tsx
20141
- import { jsx as jsx9 } from "react/jsx-runtime";
21625
+ var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
20142
21626
  var ALT_SCREEN_ANCHOR_CURSOR = Object.freeze({
20143
21627
  x: 0,
20144
21628
  y: 0,
@@ -20183,7 +21667,7 @@ var Ink = class {
20183
21667
  stylePool: this.stylePool
20184
21668
  });
20185
21669
  const deferredRender = () => queueMicrotask(this.onRender);
20186
- this.scheduleRender = throttle(deferredRender, FRAME_INTERVAL_MS, {
21670
+ this.scheduleRender = throttle_default(deferredRender, FRAME_INTERVAL_MS, {
20187
21671
  leading: true,
20188
21672
  trailing: true
20189
21673
  });
@@ -20229,13 +21713,13 @@ var Ink = class {
20229
21713
  false,
20230
21714
  null,
20231
21715
  "id",
20232
- noop2,
21716
+ noop_default,
20233
21717
  // onUncaughtError
20234
- noop2,
21718
+ noop_default,
20235
21719
  // onCaughtError
20236
- noop2,
21720
+ noop_default,
20237
21721
  // onRecoverableError
20238
- noop2
21722
+ noop_default
20239
21723
  // onDefaultTransitionIndicator
20240
21724
  );
20241
21725
  if (false) {
@@ -20355,8 +21839,9 @@ var Ink = class {
20355
21839
  // blank→paint flicker). useVirtualScroll's height scaling already bounds
20356
21840
  // the per-resize cost; synchronous handling keeps dimensions consistent.
20357
21841
  handleResize = () => {
20358
- const cols = this.options.stdout.columns || 80;
20359
- const rows = this.options.stdout.rows || 24;
21842
+ const cols = this.options.stdout.columns ?? 80;
21843
+ const rows = this.options.stdout.rows ?? 24;
21844
+ if (cols < 1 || rows < 1) return;
20360
21845
  if (cols === this.terminalColumns && rows === this.terminalRows) return;
20361
21846
  this.terminalColumns = cols;
20362
21847
  this.terminalRows = rows;
@@ -20370,7 +21855,8 @@ var Ink = class {
20370
21855
  }
20371
21856
  if (this.currentNode !== null) {
20372
21857
  this.render(this.currentNode);
20373
- if (this.rootNode.yogaNode?.getComputedWidth() !== this.terminalColumns) {
21858
+ const layout = this.rootNode.yogaNode;
21859
+ if (layout?.getComputedWidth() !== cols || this.altScreenActive && layout?.getComputedHeight() !== rows) {
20374
21860
  this.rootNode.onComputeLayout?.();
20375
21861
  this.onRender();
20376
21862
  }
@@ -20435,14 +21921,17 @@ var Ink = class {
20435
21921
  if (this.isUnmounted || this.isPaused) {
20436
21922
  return;
20437
21923
  }
21924
+ if (this.options.stdout.isTTY && ((this.options.stdout.columns ?? 80) < 1 || (this.options.stdout.rows ?? 24) < 1)) {
21925
+ return;
21926
+ }
20438
21927
  if (this.drainTimer !== null) {
20439
21928
  clearTimeout(this.drainTimer);
20440
21929
  this.drainTimer = null;
20441
21930
  }
20442
21931
  flushInteractionTime();
20443
21932
  const renderStart = performance.now();
20444
- const terminalWidth = this.options.stdout.columns || 80;
20445
- const terminalRows = this.options.stdout.rows || 24;
21933
+ const terminalWidth = this.terminalColumns;
21934
+ const terminalRows = this.terminalRows;
20446
21935
  const frame = this.renderer({
20447
21936
  frontFrame: this.frontFrame,
20448
21937
  backFrame: this.backFrame,
@@ -21216,8 +22705,8 @@ var Ink = class {
21216
22705
  };
21217
22706
  render(node) {
21218
22707
  this.currentNode = node;
21219
- const tree = /* @__PURE__ */ jsx9(App, { stdin: this.options.stdin, stdout: this.options.stdout, stderr: this.options.stderr, exitOnCtrlC: this.options.exitOnCtrlC, onExit: this.unmount, terminalColumns: this.terminalColumns, terminalRows: this.terminalRows, selection: this.selection, onSelectionChange: this.notifySelectionChange, onClickAt: this.dispatchClick, onHoverAt: this.dispatchHover, getHyperlinkAt: this.getHyperlinkAt, onOpenHyperlink: this.openHyperlink, onMultiClick: this.handleMultiClick, onSelectionDrag: this.handleSelectionDrag, onStdinResume: this.reassertTerminalModes, onCursorDeclaration: this.setCursorDeclaration, dispatchKeyboardEvent: this.dispatchKeyboardEvent, children: /* @__PURE__ */ jsx9(TerminalWriteProvider, { value: this.writeRaw, children: node }) });
21220
- reconciler_default.updateContainerSync(tree, this.container, null, noop2);
22708
+ const tree = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(App, { stdin: this.options.stdin, stdout: this.options.stdout, stderr: this.options.stderr, exitOnCtrlC: this.options.exitOnCtrlC, onExit: this.unmount, terminalColumns: this.terminalColumns, terminalRows: this.terminalRows, selection: this.selection, onSelectionChange: this.notifySelectionChange, onClickAt: this.dispatchClick, onHoverAt: this.dispatchHover, getHyperlinkAt: this.getHyperlinkAt, onOpenHyperlink: this.openHyperlink, onMultiClick: this.handleMultiClick, onSelectionDrag: this.handleSelectionDrag, onStdinResume: this.reassertTerminalModes, onCursorDeclaration: this.setCursorDeclaration, dispatchKeyboardEvent: this.dispatchKeyboardEvent, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TerminalWriteProvider, { value: this.writeRaw, children: node }) });
22709
+ reconciler_default.updateContainerSync(tree, this.container, null, noop_default);
21221
22710
  reconciler_default.flushSyncWork();
21222
22711
  }
21223
22712
  unmount(error) {
@@ -21253,7 +22742,7 @@ var Ink = class {
21253
22742
  clearTimeout(this.drainTimer);
21254
22743
  this.drainTimer = null;
21255
22744
  }
21256
- reconciler_default.updateContainerSync(null, this.container, null, noop2);
22745
+ reconciler_default.updateContainerSync(null, this.container, null, noop_default);
21257
22746
  reconciler_default.flushSyncWork();
21258
22747
  instances_default.delete(this.options.stdout);
21259
22748
  this.rootNode.yogaNode?.free();
@@ -21429,7 +22918,7 @@ var wrappedRender = async (node, options) => {
21429
22918
  );
21430
22919
  return instance;
21431
22920
  };
21432
- var root_default = wrappedRender;
22921
+ var root_default2 = wrappedRender;
21433
22922
  var getOptions = (stdout = {}) => {
21434
22923
  if (stdout instanceof Stream) {
21435
22924
  return {
@@ -21450,10 +22939,11 @@ var getInstance = (stdout, createInstance) => {
21450
22939
 
21451
22940
  // src/claude-ink/index.ts
21452
22941
  function useStdout() {
21453
- return useMemo3(() => ({ stdout: process.stdout }), []);
22942
+ return (0, import_react16.useMemo)(() => ({ stdout: process.stdout }), []);
21454
22943
  }
21455
22944
 
21456
22945
  export {
22946
+ require_jsx_runtime,
21457
22947
  Box_default,
21458
22948
  Text,
21459
22949
  stripAnsi,
@@ -21471,11 +22961,33 @@ export {
21471
22961
  shiftAnchor,
21472
22962
  ClockContext,
21473
22963
  renderSync,
21474
- root_default,
22964
+ root_default2 as root_default,
21475
22965
  useStdout
21476
22966
  };
21477
22967
  /*! Bundled license information:
21478
22968
 
22969
+ react/cjs/react-compiler-runtime.production.js:
22970
+ (**
22971
+ * @license React
22972
+ * react-compiler-runtime.production.js
22973
+ *
22974
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22975
+ *
22976
+ * This source code is licensed under the MIT license found in the
22977
+ * LICENSE file in the root directory of this source tree.
22978
+ *)
22979
+
22980
+ react/cjs/react-jsx-runtime.production.js:
22981
+ (**
22982
+ * @license React
22983
+ * react-jsx-runtime.production.js
22984
+ *
22985
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22986
+ *
22987
+ * This source code is licensed under the MIT license found in the
22988
+ * LICENSE file in the root directory of this source tree.
22989
+ *)
22990
+
21479
22991
  scheduler/cjs/scheduler.production.js:
21480
22992
  (**
21481
22993
  * @license React