@visulima/vis 4.1.20 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE.md +804 -360
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/config/index.d.ts +21 -0
  6. package/dist/packem_chunks/CONFIG_FILES.js +3 -3
  7. package/dist/packem_chunks/bloom-status.js +1 -1
  8. package/dist/packem_chunks/bloom-sync.js +1 -1
  9. package/dist/packem_chunks/catalog.js +49 -49
  10. package/dist/packem_chunks/cli-exec.js +1 -1
  11. package/dist/packem_chunks/cli-main.js +151 -147
  12. package/dist/packem_chunks/dispatch.js +1 -1
  13. package/dist/packem_chunks/fix.js +8 -8
  14. package/dist/packem_chunks/handler.js +1 -1
  15. package/dist/packem_chunks/handler10.js +3 -3
  16. package/dist/packem_chunks/handler11.js +1 -1
  17. package/dist/packem_chunks/handler12.js +2 -2
  18. package/dist/packem_chunks/handler13.js +1 -1
  19. package/dist/packem_chunks/handler14.js +1 -1
  20. package/dist/packem_chunks/handler15.js +1 -1
  21. package/dist/packem_chunks/handler16.js +1 -1
  22. package/dist/packem_chunks/handler17.js +1 -1
  23. package/dist/packem_chunks/handler18.js +1 -1
  24. package/dist/packem_chunks/handler19.js +1 -1
  25. package/dist/packem_chunks/handler2.js +1 -1
  26. package/dist/packem_chunks/handler20.js +2 -2
  27. package/dist/packem_chunks/handler21.js +1 -1
  28. package/dist/packem_chunks/handler22.js +1 -1
  29. package/dist/packem_chunks/handler23.js +1 -1
  30. package/dist/packem_chunks/handler24.js +1 -1
  31. package/dist/packem_chunks/handler26.js +1 -1
  32. package/dist/packem_chunks/handler27.js +1 -1
  33. package/dist/packem_chunks/handler28.js +1 -1
  34. package/dist/packem_chunks/handler29.js +1 -1
  35. package/dist/packem_chunks/handler3.js +2 -2
  36. package/dist/packem_chunks/handler30.js +1 -1
  37. package/dist/packem_chunks/handler5.js +1 -1
  38. package/dist/packem_chunks/handler51.js +1 -1
  39. package/dist/packem_chunks/handler52.js +3 -3
  40. package/dist/packem_chunks/handler53.js +1 -1
  41. package/dist/packem_chunks/handler54.js +2 -2
  42. package/dist/packem_chunks/handler55.js +1 -1
  43. package/dist/packem_chunks/handler58.js +2 -2
  44. package/dist/packem_chunks/handler59.js +1 -1
  45. package/dist/packem_chunks/handler6.js +1 -1
  46. package/dist/packem_chunks/handler60.js +8 -8
  47. package/dist/packem_chunks/handler61.js +1 -1
  48. package/dist/packem_chunks/handler62.js +16 -16
  49. package/dist/packem_chunks/handler63.js +2 -2
  50. package/dist/packem_chunks/handler64.js +1 -1
  51. package/dist/packem_chunks/handler65.js +3 -3
  52. package/dist/packem_chunks/handler66.js +2 -2
  53. package/dist/packem_chunks/handler67.js +10 -10
  54. package/dist/packem_chunks/handler68.js +2 -2
  55. package/dist/packem_chunks/handler69.js +3 -3
  56. package/dist/packem_chunks/handler7.js +1 -1
  57. package/dist/packem_chunks/handler70.js +3 -3
  58. package/dist/packem_chunks/handler71.js +2 -2
  59. package/dist/packem_chunks/handler72.js +2 -2
  60. package/dist/packem_chunks/handler73.js +2 -2
  61. package/dist/packem_chunks/handler74.js +1 -1
  62. package/dist/packem_chunks/handler75.js +18 -18
  63. package/dist/packem_chunks/handler76.js +3 -3
  64. package/dist/packem_chunks/handler77.js +2 -2
  65. package/dist/packem_chunks/handler78.js +64 -64
  66. package/dist/packem_chunks/handler8.js +1 -1
  67. package/dist/packem_chunks/handler9.js +1 -1
  68. package/dist/packem_chunks/heal-accept.js +1 -1
  69. package/dist/packem_chunks/heal.js +1 -1
  70. package/dist/packem_chunks/help-command.js +7 -7
  71. package/dist/packem_chunks/index5.js +2 -2
  72. package/dist/packem_chunks/index6.js +7 -8
  73. package/dist/packem_chunks/keys-refresh.js +1 -1
  74. package/dist/packem_chunks/lean.js +1 -1
  75. package/dist/packem_chunks/list.js +2 -2
  76. package/dist/packem_chunks/loader.js +1 -1
  77. package/dist/packem_chunks/prune.js +1 -1
  78. package/dist/packem_chunks/status.js +1 -1
  79. package/dist/packem_chunks/sync.js +1 -1
  80. package/dist/packem_chunks/sync2.js +1 -1
  81. package/dist/packem_chunks/tripwire.js +2 -2
  82. package/dist/packem_chunks/ts-loader.js +5 -5
  83. package/dist/packem_chunks/verify-lockfile.js +2 -2
  84. package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +11 -0
  85. package/dist/packem_shared/{advisories-0ScpWAHV.js → advisories-BSpzRIXP.js} +1 -1
  86. package/dist/packem_shared/affected-selection-M7riOi5-.js +1 -0
  87. package/dist/packem_shared/{affected-shas-Dd0P7fGD.js → affected-shas-CAwpSPmP.js} +1 -1
  88. package/dist/packem_shared/{ai-fix-BHyx1F1j.js → ai-fix-BTm1Z5og.js} +1 -1
  89. package/dist/packem_shared/{augment-COAiXSIx.js → augment-CBv1hwMR.js} +1 -1
  90. package/dist/packem_shared/{bin-Bq3tJmvE.js → bin-Cbs_ix6l.js} +1 -1
  91. package/dist/packem_shared/build-scripts-BIgkWVgY.js +1 -0
  92. package/dist/packem_shared/{command-runtime-CiLVo4ED.js → command-runtime-BD-4UmPB.js} +1 -1
  93. package/dist/packem_shared/{cyclonedx-CX2fFvDi.js → cyclonedx-CT1rtKxV.js} +3 -3
  94. package/dist/packem_shared/dependency-scan-W9b2X0a1.js +1 -0
  95. package/dist/packem_shared/{docker-Dy-X_BuM.js → docker-1jgKW5Wd.js} +3 -3
  96. package/dist/packem_shared/failure-log-B91LvYWw.js +2 -0
  97. package/dist/packem_shared/formatBytes-BHAzNIrn-CLYsxlUj.js +4 -0
  98. package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +1 -0
  99. package/dist/packem_shared/{index-DHD8wb6Z.js → index-CVBR-Kit.js} +5 -5
  100. package/dist/packem_shared/{index-Vm90Te96.js → index-Cq-J2MdB.js} +1 -1
  101. package/dist/packem_shared/index-onibYJkv.js +1 -0
  102. package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CSnBISfV.js → isAccessibleSync-DYKTrrvc-K2xhg6sV.js} +1 -1
  103. package/dist/packem_shared/lifecycle-DDJzp-4H.js +2 -0
  104. package/dist/packem_shared/lockfile-Bi1mw9jJ.js +1 -0
  105. package/dist/packem_shared/manifests-D671Sb1T.js +1 -0
  106. package/dist/packem_shared/{min-release-age-ChzTC7_I.js → min-release-age-Da4V046o.js} +7 -7
  107. package/dist/packem_shared/missing-package-json-CMoHdvmj.js +1 -0
  108. package/dist/packem_shared/{native-config-sync-BSzU4qUO.js → native-config-sync-CEB0rWlk.js} +2 -2
  109. package/dist/packem_shared/{osv-bloom-JYIWcH3F.js → osv-bloom-BRacgzs7.js} +1 -1
  110. package/dist/packem_shared/{package-version-DFlytdgJ.js → package-version-C5EPMgRw.js} +2 -2
  111. package/dist/packem_shared/packument-DuEV-qSE.js +1 -0
  112. package/dist/packem_shared/path-CxEa27Rz-pjheKk6v.js +1 -0
  113. package/dist/packem_shared/pm-runner-9L6ocnu2.js +1 -0
  114. package/dist/packem_shared/{project-name-filter-CC5FF49q.js → project-name-filter-zrdrEQbu.js} +1 -1
  115. package/dist/packem_shared/{provenance-BH80RHXx.js → provenance-CFPT_FQA.js} +1 -1
  116. package/dist/packem_shared/readJsonSync-CbryXYxN-BxKjDZnF.js +1 -0
  117. package/dist/packem_shared/registry-keys-C3EsP_s4.js +1 -0
  118. package/dist/packem_shared/{resolve-explicit-DuJ3mbzt.js → resolve-explicit-opfIkxoY.js} +1 -1
  119. package/dist/packem_shared/resolve-runtime-lJ5L9gU4.js +1 -0
  120. package/dist/packem_shared/run-file-DZff6GqY.js +1 -0
  121. package/dist/packem_shared/runtime-check-DAbveBr_.js +1 -0
  122. package/dist/packem_shared/s1ngularity-DTvrfWIM.js +1 -0
  123. package/dist/packem_shared/{scan-progress-DRIGQRMr.js → scan-progress-BGB9hIrD.js} +2 -2
  124. package/dist/packem_shared/{selectors-B7lSFz7l.js → selectors-CjIZ3gy2.js} +1 -1
  125. package/dist/packem_shared/{signatures-BP042BlB.js → signatures-DpqZVmmU.js} +1 -1
  126. package/dist/packem_shared/spinner-BVCEMm3G.js +1 -0
  127. package/dist/packem_shared/{tabs-UDYQ3tqt.js → tabs-Dz6xVpfX.js} +1 -1
  128. package/dist/packem_shared/{target-merge-B4No-LHM.js → target-merge-hsawesT4.js} +1 -1
  129. package/dist/packem_shared/target-options-Bxb0Y5qa.js +1 -0
  130. package/dist/packem_shared/toolchain-887JoquG.js +5 -0
  131. package/dist/packem_shared/typosquats-Xv6dN4sr.js +1 -0
  132. package/dist/packem_shared/verify-BLoaI7En.js +1 -0
  133. package/dist/packem_shared/{vis-update-app-CR21zyht.js → vis-update-app-D9KWJ9Ir.js} +1 -1
  134. package/dist/packem_shared/{vis-user-error-qqqhLoF6.js → vis-user-error-Bdg9NRuJ.js} +15 -15
  135. package/dist/packem_shared/watch-BTZw2Y8Q.js +1 -0
  136. package/dist/packem_shared/watch-loop-Cjh2wlUl.js +11 -0
  137. package/dist/packem_shared/{writeFileSync-DJoHk3Ks-CgQ-VNNT.js → writeFileSync-DJoHk3Ks-O9zOKqeM.js} +1 -1
  138. package/dist/runtime/preload.js +1 -1
  139. package/index.d.ts +204 -204
  140. package/index.js +26 -26
  141. package/package.json +10 -10
  142. package/schemas/vis-config.schema.json +14 -0
  143. package/dist/packem_shared/Table-kgZ-Cd21-DdNsp69H.js +0 -9
  144. package/dist/packem_shared/affected-selection-Bt4qkPUb.js +0 -1
  145. package/dist/packem_shared/build-scripts-pdVmqXRm.js +0 -1
  146. package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +0 -1
  147. package/dist/packem_shared/failure-log-3R522Vb5.js +0 -2
  148. package/dist/packem_shared/formatBytes-BHAzNIrn-XohRrPdt.js +0 -4
  149. package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +0 -1
  150. package/dist/packem_shared/index-Czrll7SU.js +0 -1
  151. package/dist/packem_shared/lifecycle-CAIJbxIa.js +0 -2
  152. package/dist/packem_shared/lockfile-DVFySxTS.js +0 -1
  153. package/dist/packem_shared/manifests-BNSmpPF_.js +0 -1
  154. package/dist/packem_shared/missing-package-json-C0keIt78.js +0 -1
  155. package/dist/packem_shared/packument-DyuhH1Gz.js +0 -1
  156. package/dist/packem_shared/pm-runner-d93_73O6.js +0 -1
  157. package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +0 -1
  158. package/dist/packem_shared/registry-keys-BWHRFWbb.js +0 -1
  159. package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +0 -1
  160. package/dist/packem_shared/run-file-jMngGQhs.js +0 -1
  161. package/dist/packem_shared/runtime-check-BklgEMkC.js +0 -1
  162. package/dist/packem_shared/s1ngularity-BJ5j2vbJ.js +0 -1
  163. package/dist/packem_shared/spinner-BM_0Bj6x.js +0 -1
  164. package/dist/packem_shared/target-options-d_rIrLyq.js +0 -1
  165. package/dist/packem_shared/toolchain-DY11tPCw.js +0 -5
  166. package/dist/packem_shared/typosquats-CSkIFgF5.js +0 -1
  167. package/dist/packem_shared/verify-D8wYvB85.js +0 -1
  168. package/dist/packem_shared/watch-Dswvj6Zp.js +0 -1
  169. package/dist/packem_shared/watch-loop-COWvvSbR.js +0 -11
package/index.js CHANGED
@@ -82,7 +82,7 @@ function requireNative() {
82
82
  const binding = require('@visulima/vis-binding-android-arm64')
83
83
  const bindingPackageVersion = require('@visulima/vis-binding-android-arm64/package.json').version
84
84
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
85
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
86
86
  }
87
87
  return binding
88
88
  } catch (e) {
@@ -98,7 +98,7 @@ function requireNative() {
98
98
  const binding = require('@visulima/vis-binding-android-arm-eabi')
99
99
  const bindingPackageVersion = require('@visulima/vis-binding-android-arm-eabi/package.json').version
100
100
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
101
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
102
102
  }
103
103
  return binding
104
104
  } catch (e) {
@@ -119,7 +119,7 @@ function requireNative() {
119
119
  const binding = require('@visulima/vis-binding-win32-x64-gnu')
120
120
  const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-gnu/package.json').version
121
121
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
122
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
123
123
  }
124
124
  return binding
125
125
  } catch (e) {
@@ -135,7 +135,7 @@ function requireNative() {
135
135
  const binding = require('@visulima/vis-binding-win32-x64-msvc')
136
136
  const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-msvc/package.json').version
137
137
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
138
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
139
139
  }
140
140
  return binding
141
141
  } catch (e) {
@@ -152,7 +152,7 @@ function requireNative() {
152
152
  const binding = require('@visulima/vis-binding-win32-ia32-msvc')
153
153
  const bindingPackageVersion = require('@visulima/vis-binding-win32-ia32-msvc/package.json').version
154
154
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
155
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
156
156
  }
157
157
  return binding
158
158
  } catch (e) {
@@ -168,7 +168,7 @@ function requireNative() {
168
168
  const binding = require('@visulima/vis-binding-win32-arm64-msvc')
169
169
  const bindingPackageVersion = require('@visulima/vis-binding-win32-arm64-msvc/package.json').version
170
170
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
171
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
172
  }
173
173
  return binding
174
174
  } catch (e) {
@@ -187,7 +187,7 @@ function requireNative() {
187
187
  const binding = require('@visulima/vis-binding-darwin-universal')
188
188
  const bindingPackageVersion = require('@visulima/vis-binding-darwin-universal/package.json').version
189
189
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
190
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
191
191
  }
192
192
  return binding
193
193
  } catch (e) {
@@ -203,7 +203,7 @@ function requireNative() {
203
203
  const binding = require('@visulima/vis-binding-darwin-x64')
204
204
  const bindingPackageVersion = require('@visulima/vis-binding-darwin-x64/package.json').version
205
205
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
206
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
207
207
  }
208
208
  return binding
209
209
  } catch (e) {
@@ -219,7 +219,7 @@ function requireNative() {
219
219
  const binding = require('@visulima/vis-binding-darwin-arm64')
220
220
  const bindingPackageVersion = require('@visulima/vis-binding-darwin-arm64/package.json').version
221
221
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
222
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
223
  }
224
224
  return binding
225
225
  } catch (e) {
@@ -239,7 +239,7 @@ function requireNative() {
239
239
  const binding = require('@visulima/vis-binding-freebsd-x64')
240
240
  const bindingPackageVersion = require('@visulima/vis-binding-freebsd-x64/package.json').version
241
241
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
242
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
243
243
  }
244
244
  return binding
245
245
  } catch (e) {
@@ -255,7 +255,7 @@ function requireNative() {
255
255
  const binding = require('@visulima/vis-binding-freebsd-arm64')
256
256
  const bindingPackageVersion = require('@visulima/vis-binding-freebsd-arm64/package.json').version
257
257
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
258
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
259
  }
260
260
  return binding
261
261
  } catch (e) {
@@ -276,7 +276,7 @@ function requireNative() {
276
276
  const binding = require('@visulima/vis-binding-linux-x64-musl')
277
277
  const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-musl/package.json').version
278
278
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
279
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
280
280
  }
281
281
  return binding
282
282
  } catch (e) {
@@ -292,7 +292,7 @@ function requireNative() {
292
292
  const binding = require('@visulima/vis-binding-linux-x64-gnu')
293
293
  const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-gnu/package.json').version
294
294
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
296
296
  }
297
297
  return binding
298
298
  } catch (e) {
@@ -310,7 +310,7 @@ function requireNative() {
310
310
  const binding = require('@visulima/vis-binding-linux-arm64-musl')
311
311
  const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-musl/package.json').version
312
312
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
313
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
314
314
  }
315
315
  return binding
316
316
  } catch (e) {
@@ -326,7 +326,7 @@ function requireNative() {
326
326
  const binding = require('@visulima/vis-binding-linux-arm64-gnu')
327
327
  const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-gnu/package.json').version
328
328
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
329
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
330
330
  }
331
331
  return binding
332
332
  } catch (e) {
@@ -344,7 +344,7 @@ function requireNative() {
344
344
  const binding = require('@visulima/vis-binding-linux-arm-musleabihf')
345
345
  const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-musleabihf/package.json').version
346
346
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
347
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
348
  }
349
349
  return binding
350
350
  } catch (e) {
@@ -360,7 +360,7 @@ function requireNative() {
360
360
  const binding = require('@visulima/vis-binding-linux-arm-gnueabihf')
361
361
  const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-gnueabihf/package.json').version
362
362
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
363
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
364
364
  }
365
365
  return binding
366
366
  } catch (e) {
@@ -378,7 +378,7 @@ function requireNative() {
378
378
  const binding = require('@visulima/vis-binding-linux-loong64-musl')
379
379
  const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-musl/package.json').version
380
380
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
381
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
382
382
  }
383
383
  return binding
384
384
  } catch (e) {
@@ -394,7 +394,7 @@ function requireNative() {
394
394
  const binding = require('@visulima/vis-binding-linux-loong64-gnu')
395
395
  const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-gnu/package.json').version
396
396
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
397
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
398
398
  }
399
399
  return binding
400
400
  } catch (e) {
@@ -412,7 +412,7 @@ function requireNative() {
412
412
  const binding = require('@visulima/vis-binding-linux-riscv64-musl')
413
413
  const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-musl/package.json').version
414
414
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
415
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
416
416
  }
417
417
  return binding
418
418
  } catch (e) {
@@ -428,7 +428,7 @@ function requireNative() {
428
428
  const binding = require('@visulima/vis-binding-linux-riscv64-gnu')
429
429
  const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-gnu/package.json').version
430
430
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
431
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
432
432
  }
433
433
  return binding
434
434
  } catch (e) {
@@ -445,7 +445,7 @@ function requireNative() {
445
445
  const binding = require('@visulima/vis-binding-linux-ppc64-gnu')
446
446
  const bindingPackageVersion = require('@visulima/vis-binding-linux-ppc64-gnu/package.json').version
447
447
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
448
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
449
449
  }
450
450
  return binding
451
451
  } catch (e) {
@@ -461,7 +461,7 @@ function requireNative() {
461
461
  const binding = require('@visulima/vis-binding-linux-s390x-gnu')
462
462
  const bindingPackageVersion = require('@visulima/vis-binding-linux-s390x-gnu/package.json').version
463
463
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
464
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
465
465
  }
466
466
  return binding
467
467
  } catch (e) {
@@ -481,7 +481,7 @@ function requireNative() {
481
481
  const binding = require('@visulima/vis-binding-openharmony-arm64')
482
482
  const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm64/package.json').version
483
483
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
484
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
485
485
  }
486
486
  return binding
487
487
  } catch (e) {
@@ -497,7 +497,7 @@ function requireNative() {
497
497
  const binding = require('@visulima/vis-binding-openharmony-x64')
498
498
  const bindingPackageVersion = require('@visulima/vis-binding-openharmony-x64/package.json').version
499
499
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
500
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
501
501
  }
502
502
  return binding
503
503
  } catch (e) {
@@ -513,7 +513,7 @@ function requireNative() {
513
513
  const binding = require('@visulima/vis-binding-openharmony-arm')
514
514
  const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm/package.json').version
515
515
  if (bindingPackageVersion !== '4.1.19' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
- throw new Error(`Native binding package version mismatch, expected 4.1.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
516
+ throw new Error(`Native binding package version mismatch, expected 4.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
517
517
  }
518
518
  return binding
519
519
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/vis",
3
- "version": "4.1.20",
3
+ "version": "4.2.0",
4
4
  "description": "A monorepo dev toolkit — task runner, remote caching, security scanning, git hooks, and AI agent integrations — powered by @visulima/task-runner",
5
5
  "keywords": [
6
6
  "build",
@@ -119,7 +119,7 @@
119
119
  "@visulima/secret-scanner": "2.0.1",
120
120
  "@visulima/source-map": "3.0.1",
121
121
  "@visulima/tabular": "4.1.0",
122
- "@visulima/task-runner": "1.0.6",
122
+ "@visulima/task-runner": "1.1.0",
123
123
  "@visulima/tui": "4.0.29",
124
124
  "@visulima/tui-kit": "1.0.32",
125
125
  "module-replacements": "^3.1.0",
@@ -148,14 +148,14 @@
148
148
  }
149
149
  },
150
150
  "optionalDependencies": {
151
- "@visulima/vis-binding-darwin-arm64": "4.1.20",
152
- "@visulima/vis-binding-darwin-x64": "4.1.20",
153
- "@visulima/vis-binding-linux-arm64-gnu": "4.1.20",
154
- "@visulima/vis-binding-linux-arm64-musl": "4.1.20",
155
- "@visulima/vis-binding-linux-x64-gnu": "4.1.20",
156
- "@visulima/vis-binding-win32-arm64-msvc": "4.1.20",
157
- "@visulima/vis-binding-win32-x64-msvc": "4.1.20",
158
- "@visulima/vis-binding-linux-x64-musl": "4.1.20"
151
+ "@visulima/vis-binding-darwin-arm64": "4.2.0",
152
+ "@visulima/vis-binding-darwin-x64": "4.2.0",
153
+ "@visulima/vis-binding-linux-arm64-gnu": "4.2.0",
154
+ "@visulima/vis-binding-linux-arm64-musl": "4.2.0",
155
+ "@visulima/vis-binding-linux-x64-gnu": "4.2.0",
156
+ "@visulima/vis-binding-linux-x64-musl": "4.2.0",
157
+ "@visulima/vis-binding-win32-arm64-msvc": "4.2.0",
158
+ "@visulima/vis-binding-win32-x64-msvc": "4.2.0"
159
159
  },
160
160
  "engines": {
161
161
  "node": "^22.14.0 || >=24.10.0"
@@ -5,6 +5,20 @@
5
5
  "description": "Workspace configuration for @visulima/vis. Used by defineConfig() in vis.config.ts. This schema is for non-TypeScript editors; TypeScript users get autocomplete from defineConfig() types.",
6
6
  "type": "object",
7
7
  "properties": {
8
+ "affectedIgnore": {
9
+ "type": "array",
10
+ "items": {
11
+ "type": "string"
12
+ },
13
+ "description": "Workspace-relative glob patterns for changed files outside every project that `vis affected`, `vis run --affected`, `vis ci` and `vis ci ignore` should not count as a change.\n\nBy default a changed file that belongs to no project (a root `tsconfig.json`, `package.json`, …) is a global change and marks every project affected. A changed file matching one of these patterns is skipped instead. The patterns are only checked for files that belong to NO project: a file inside a project root is never filtered, so a broad pattern like `*.md` cannot hide a real package change.\n\nPatterns use `path.matchesGlob` syntax, where `*` does not cross `/`: `*.md` matches `README.md` but not `docs/guide.md`.\n\nDo NOT list paths whose changes really do affect projects, such as bundler-inlined shared source or the root `tsconfig.json`: an edit there would then run nothing.",
14
+ "examples": [
15
+ [
16
+ "api-snapshots/**",
17
+ "plans/**",
18
+ "*.md"
19
+ ]
20
+ ]
21
+ },
8
22
  "ai": {
9
23
  "type": "object",
10
24
  "properties": {
@@ -1,9 +0,0 @@
1
- import{createRequire as ei}from"node:module";let oi;const ni=t=>(oi??=ei(import.meta.url))(t),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ri=t=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[i,e]=D.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return D.getBuiltinModule(t)}return ni(t)},{createRequire:si}=ri("node:module");let hi;const ci=t=>(hi??=si(import.meta.url))(t),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:T,wt=t=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[i,e]=V.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return V.getBuiltinModule(t)}return ci(t)},T=V,{execFileSync:ai}=wt("node:child_process"),Y=wt("node:fs"),li=wt("node:tty"),di=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ui=12288,fi=65510,mi=[12288,12288,65281,65376,65504,65510],wi=8361,pi=65518,gi=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],bi=32,yi=10630,xi=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Wi=4352,Bi=262141,_t=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],K=(t,i)=>{let e=0,o=Math.floor(t.length/2)-1;for(;e<=o;){const s=Math.floor((e+o)/2),h=s*2;if(i<t[h])o=s-1;else if(i>t[h+1])e=s+1;else return!0}return!1},bt=19968,[vi,Ri]=Ci(_t);function Ci(t){let i=t[0],e=t[1];for(let o=0;o<t.length;o+=2){const s=t[o],h=t[o+1];if(bt>=s&&bt<=h)return[s,h];h-s>e-i&&(i=s,e=h)}return[i,e]}const Si=t=>t<161||t>1114109?!1:K(di,t),Ai=t=>t<ui||t>fi?!1:K(mi,t),Ii=t=>t<wi||t>pi?!1:K(gi,t),Mi=t=>t<bi||t>yi?!1:K(xi,t),ki=t=>t>=vi&&t<=Ri?!0:t<Wi||t>Bi?!1:K(_t,t);function ji(t){return Si(t)?"ambiguous":Ai(t)?"fullwidth":Ii(t)?"halfwidth":Mi(t)?"narrow":ki(t)?"wide":"neutral"}function Ei(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Ht(t){return Ei(t),ji(t)}const $t=String.raw,yt=$t`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Ni=()=>new RegExp($t`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${yt}(?:\u200D${yt})*`,"gu"),J=new Set(["\x1B","›"]),pt="\x07",q="]8;;",Li=/[\u200B\uFEFF\u2060-\u2064]/g,ht=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,xt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,Wt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,Z=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ji=Ni(),Bt=new Map,Fi=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Ti=t=>{const i=Fi(t.width);let e=Bt.get(i);return e||(e=new Map,Bt.set(i,e)),e},X=new RegExp(ht.source,"y"),dt=new RegExp(Ji.source,"uy"),Q=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Pt=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",Oi=(t,i)=>{const e=Ti(i),o=Math.floor(t/65536),s=t%65536;let h=e.get(o);if(h||(h=new Map,e.set(o,h)),h.has(s))return h.get(s);let n;switch(Pt(t)){case"control":{n=i.width.control;break}case"latin":{n=i.width.regular;break}case"wide":{n=i.width.wide;break}case"zero":{n=0;break}default:switch(Ht(t)){case"ambiguous":{n=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{n=i.width.fullWidth;break}case"wide":{n=i.width.wide;break}default:n=i.width.regular}}return h.set(s,n),n},_i=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,z=(t,i={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:i.countAnsiEscapeCodes??!1,ellipsis:i.ellipsis??"",ellipsisWidth:i.ellipsisWidth??(i.ellipsis?z(i.ellipsis,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:i.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:i.ambiguousIsNarrow??!1,ansi:i.ansiWidth??0,control:i.controlWidth??0,emoji:i.emojiWidth??2,fullWidth:i.fullWidth??2,halfWidth:i.halfWidth??1,regular:i.regularWidth??1,tab:i.tabWidth??8,wide:i.wideWidth??2}},o=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:s}=t,h=s>1e4;let n=0,r=0,c=s,a=!1;const d=t.includes("\x1B")||t.includes("›");for(;n<s;){if(d&&(t[n]==="\x1B"||t[n]==="›")){if(t.startsWith("\x1B]8;;",n)){const g="\x1B]8;;\x07",u=g.length,b=t.indexOf("\x07",n+5);if(b!==-1){const W=t.indexOf(g,b+1);if(W!==-1){const y=W+u,x=t.slice(b+1,W).replace(ht,""),R=z(x,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,o-r),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),S=R.width;if(R.truncated)a=!0,c=Math.min(c,n);else if(r+S>o&&(c=Math.min(c,n),a=!0,r+S>e.truncation.limit))break;if(r+=S,n=y,a&&r>=e.truncation.limit)break;continue}}}if(X.lastIndex=n,X.test(t)){const g=X.lastIndex-n,u=e.truncation.countAnsiEscapeCodes?g:e.width.ansi;if(r+u>o&&(c=Math.min(c,n),r+u>e.truncation.limit)){a=!0;break}r+=u,n=X.lastIndex;continue}}const f=t.codePointAt(n);if(f===8203||f===65279||f>=8288&&f<=8292){n+=1;continue}if(f===9){if(r+e.width.tab>o&&(c=Math.min(c,n),r+e.width.tab>e.truncation.limit)){a=!0;break}r+=e.width.tab,n+=1;continue}if(Q.lastIndex=n,Q.test(t)){const g=(Q.lastIndex-n)*e.width.regular;if(r+g>o){const u=e.width.regular>0?Math.floor((o-r)/e.width.regular):0;if(c=Math.min(c,n+u),r+g>e.truncation.limit){a=!0;break}}r+=g,n=Q.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(Z.lastIndex=n,Z.test(t))){const g=(Z.lastIndex-n)*e.width.control;if(r+g>o){const u=e.width.control>0?Math.floor((o-r)/e.width.control):0;if(c=Math.min(c,n+u),r+g>e.truncation.limit){a=!0;break}}r+=g,n=Z.lastIndex;continue}if(dt.lastIndex=n,dt.test(t)){if(r+e.width.emoji>o&&(c=Math.min(c,n),r+e.width.emoji>e.truncation.limit)){a=!0;break}r+=e.width.emoji,n=dt.lastIndex;continue}const w=t.codePointAt(n)??0;if(_i(w)){n+=w>65535?2:1;continue}let p;if(h)p=Oi(w,e);else switch(Pt(w)){case"control":{p=e.width.control;break}case"latin":{p=e.width.regular;break}case"wide":{p=e.width.wide;break}case"zero":{p=0;break}default:switch(Ht(w)){case"ambiguous":{p=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{p=e.width.fullWidth;break}case"wide":{p=e.width.wide;break}default:p=e.width.regular}}if(r+p>o&&(c=Math.min(c,n),r+p>e.truncation.limit)){a=!0;break}r+=p,n+=w>65535?2:1}let l=r,m=!1;return a&&e.truncation.limit>=e.truncation.ellipsisWidth&&(l=e.truncation.limit,m=!0),{ellipsed:m,index:a?c:s,truncated:a,width:l}},k=(t,i={})=>z(t,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;class Hi{capacity;cache;constructor(i){this.capacity=i,this.cache=new Map}get(i){if(!this.cache.has(i))return;const e=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,e),e}has(i){return this.cache.has(i)}set(i,e){if(this.cache.has(i))this.cache.delete(i);else if(this.cache.size>=this.capacity){const o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}this.cache.set(i,e)}delete(i){this.cache.delete(i)}clear(){this.cache.clear()}size(){return this.cache.size}}const $i=/^(?:\u001B\[|\u009B)([\d:;]*)m$/,Gt=new Map([[1,22],[2,22],[3,23],[4,24],[5,25],[6,25],[7,27],[8,28],[9,29],[21,24],[53,55]]),Pi=new Set(Gt.values()),Vt=t=>{const i=t.split(";"),e=[];for(let o=0;o<i.length;o+=1){const s=i[o];if(s.includes(":")){e.push([s]);continue}const h=s===""?0:Number.parseInt(s,10);if(h===38||h===48||h===58){const n=i[o+1];let r=0;n==="5"?r=2:n==="2"?r=4:n?.includes(":")&&(r=1),e.push(i.slice(o,o+1+r)),o+=r;continue}e.push([s])}return e},qt=t=>{const i=t[0],e=i.indexOf(":"),o=e===-1?i:i.slice(0,e);return o===""?0:Number.parseInt(o,10)},zt=t=>t===38||t>=30&&t<=37||t>=90&&t<=97,Ut=t=>t===48||t>=40&&t<=47||t>=100&&t<=107,Dt=t=>{const i=Vt(t);if(i.length!==1)return;const e=qt(i[0]);return zt(e)?"foreground":Ut(e)?"background":void 0};class Gi{activeForeground=void 0;activeBackground=void 0;activeUnderlineColor=void 0;activeAttributes=new Map;processEscape(i){const e=$i.exec(i);if(e)for(const o of Vt(e[1])){const s=qt(o);switch(s){case 0:{this.resetAll();break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}case 59:{this.activeUnderlineColor=void 0;break}default:this.applyParameter(s,`\x1B[${o.join(";")}m`)}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,this.activeUnderlineColor,...this.activeAttributes.values()].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const i=[...this.activeAttributes.keys()].toReversed().map(e=>`\x1B[${String(e)}m`);return this.activeUnderlineColor&&i.push("\x1B[59m"),this.activeForeground&&i.push("\x1B[39m"),this.activeBackground&&i.push("\x1B[49m"),i.join("")}resetAll(){this.activeForeground=void 0,this.activeBackground=void 0,this.activeUnderlineColor=void 0,this.activeAttributes.clear()}applyParameter(i,e){if(!((i===38||i===48||i===58)&&!e.includes(";")&&!e.includes(":")))if(zt(i))this.activeForeground=e;else if(Ut(i))this.activeBackground=e;else if(i===58)this.activeUnderlineColor=e;else if(Pi.has(i))this.activeAttributes.delete(i);else{const o=Gt.get(i);o!==void 0&&this.activeAttributes.set(o,e)}}}const vt=new Hi(100),Vi=new Intl.Segmenter("en",{granularity:"grapheme"}),qi=/^[\u0000-\u007F]*$/,zi=new Set(["0","22","23","24","27","28","29","39","49"]),Ui=new Set(["1","3","4","7","8","9"]),Rt=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),tt=t=>Dt(t)==="foreground",it=t=>Dt(t)==="background",Di=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],Ct=(t,i)=>{let e=-1;for(const o of i){const s=t.indexOf(o);s!==-1&&(e===-1||s<e)&&(e=s)}return e},Yi=(t,i)=>{if(!t.includes("\x1B"))return[{after:"",before:"",content:t,visibleLength:k(t,i.width)}];const e=`${JSON.stringify(i.width??void 0)}\0${t}`,o=vt.get(e);if(o)return o;const s=[],h=[];let n=0,r;for(ht.lastIndex=0;(r=ht.exec(t))!==null;){const l=r[0];s.push(t.slice(n,r.index)),h.push(l),n=r.index+l.length}n<t.length&&s.push(t.slice(n));const c=[];for(const l of h){if(l==="\x1B[0m"||l==="\x1B]8;;\x07"){c.push(l);continue}if(l.startsWith("\x1B[")&&l.endsWith("m")){const m=l.slice(2,-1);if(zi.has(m)){c.push(l);continue}}}const a=new Set,d=[];for(const[l,m]of s.entries()){if(l>0&&h[l-1]){const p=h[l-1];if(p==="\x1B[0m")a.clear();else if(p==="\x1B]8;;\x07"){for(const g of a)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){a.delete(g);break}}else if(p.startsWith("\x1B[")&&p.endsWith("m")){const g=p.slice(2,-1);if(g==="39"){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(tt(b)){a.delete(u);break}}}else if(g==="49"){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(it(b)){a.delete(u);break}}}else if(Rt.has(g)){const u=Rt.get(g);for(const b of a)if(b===`\x1B[${u}m`){a.delete(b);break}}else{if(tt(g)){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(tt(b)){a.delete(u);break}}}else if(it(g)){for(const u of a)if(u.startsWith("\x1B[")&&u.endsWith("m")){const b=u.slice(2,-1);if(it(b)){a.delete(u);break}}}else if(Ui.has(g)){const u=`\x1B[${g}m`;a.has(u)&&a.delete(u)}a.add(p)}}else if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){for(const g of a)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){a.delete(g);break}a.add(p)}}if(m==="")continue;let f="";if(a.size>0)if(c.includes("\x1B[0m"))f="\x1B[0m";else{const p=[];let g=!1;for(const y of a)if(y.startsWith("\x1B]8;;")&&!y.endsWith("\x1B]8;;\x07")){g=!0;break}g&&c.includes("\x1B]8;;\x07")&&p.push("\x1B]8;;\x07");let u=!1,b=!1;for(const y of a)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);tt(x)?u=!0:it(x)&&(b=!0)}if(u&&b){const y=Ct(t,["\x1B[3","\x1B[9","\x1B[38;"]),x=Ct(t,["\x1B[4","\x1B[10","\x1B[48;"]);y>=0&&x>=0?y>x?p.push("\x1B[39m","\x1B[49m"):p.push("\x1B[49m","\x1B[39m"):p.push("\x1B[39m","\x1B[49m")}else u&&p.push("\x1B[39m"),b&&p.push("\x1B[49m");u&&b&&t.includes("\x1B[39m")&&t.includes("\x1B[49m")&&(t.indexOf("\x1B[39m")<t.indexOf("\x1B[49m")?(p.length-=2,p.push("\x1B[39m","\x1B[49m")):t.indexOf("\x1B[49m")<t.indexOf("\x1B[39m")&&(p.length-=2,p.push("\x1B[49m","\x1B[39m")));const W=Di.filter(y=>a.has(y.open)).map(y=>({position:t.indexOf(y.open),style:y})).filter(y=>y.position>=0).toSorted((y,x)=>x.position-y.position);for(const y of W){const x=y;c.includes(x.style.close)&&p.push(x.style.close)}f=p.join("")}const w=[...a].join("");d.push({after:f,before:w,content:m,visibleLength:k(m,i.width)})}return vt.set(e,d),d},St=(t,i,e,o)=>{const s=[...o.segmenter.segment(t)],h=[];let n=0,r=!1;for(const c of s){const a=k(c.segment,o.width),d=n,l=n+a;if(!r)if(d<i){n=l;continue}else r=!0;if(d>=e||l>e)break;h.push(c.segment),n=l}return h.join("")},F=(t,i=0,e=Number.MAX_SAFE_INTEGER,o={})=>{const s={segmenter:Vi,...o};if(i>=e||t==="")return"";const h=k(t,s.width);if(i===0&&e>=h)return t;if(i<0||e<0)throw new RangeError("Negative indices aren't supported");if(!t.includes("\x1B"))return qi.test(t)?t.slice(i,e):St(t,i,e,s);if(xt.lastIndex=0,Wt.lastIndex=0,!xt.test(t)&&!Wt.test(t))return t;const n=Yi(t,s);if(n.length===0)return"";let r=0;const c=[];for(const[l,m]of n.entries()){const f=r,w=r+m.visibleLength;if(w>i&&f<e){const p=Math.max(0,i-f),g=Math.min(m.visibleLength,e-f);c.push({end:g,index:l,segment:m,start:p})}r=w}if(c.length===0)return"";const a=[],d=c[0].segment;a.push(d.before);for(let l=0;l<c.length;l++){const{end:m,segment:f,start:w}=c[l];if(w===0&&m===f.visibleLength?a.push(f.content):a.push(St(f.content,w,m,s)),l<c.length-1){const p=c[l+1].segment,g=f.after,u=p.before;g!==u&&(g||u)&&a.push(g,u)}}return a.push(c.at(-1).segment.after),a.join("")},At="…",Ki=3,et=(t,i,e=!1)=>{if(t.charAt(i)===" ")return i;const o=e?1:-1,s=Math.min(Ki,e?t.length-i:i);for(let h=1;h<=s;h++){const n=i+h*o;if(t.charAt(n)===" ")return n}return i},ot=(t,i,e)=>z(t,{...e,ellipsis:"",ellipsisWidth:0,limit:i}).index,nt=(t,i,e)=>k(t.slice(0,i),e),It=(t,i,e={})=>{if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof i!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof i}`);if(t===""||i<=0)return"";const o=t.normalize("NFC"),{ellipsis:s=At,position:h="end",preferTruncationOnSpace:n=!1}=e;let r=e.ellipsisWidth??(s===At?1:void 0);r??=z(s,{...e.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:c}=z(o,{...e.width,ellipsis:s,ellipsisWidth:r});if(c<=i)return o;switch(h){case"end":{if(n){const a=i-r,d=ot(o,a,e.width),l=et(o,d),m=nt(o,l,e.width);return F(o,0,m,{width:e.width})+s}return F(o,0,i-r,{width:e.width})+s}case"middle":{const a=Math.floor(i/2),d=Math.max(0,i-r),l=Math.min(a,d),m=Math.max(0,d-l);if(n){const f=ot(o,l,e.width),w=et(o,f),p=nt(o,w,e.width),g=c-m,u=ot(o,g,e.width),b=et(o,u,!0),W=nt(o,b,e.width);return F(o,0,p,{width:e.width})+s+F(o,W,c,{width:e.width}).trim()}return F(o,0,l,{width:e.width})+s+F(o,c-m,c,{width:e.width})}case"start":{if(n){const a=c-i+r,d=ot(o,a,e.width),l=et(o,d,!0),m=nt(o,l,e.width);return s+F(o,m,c,{width:e.width}).trim()}return s+F(o,c-i+r,c,{width:e.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${h}'`)}},Mt=/(?:\u{1B}\[|\u{9B})[\u{30}-\u{3F}]*[\u{20}-\u{2F}]*[\u{40}-\u{7E}]/uy,lt=(t,i)=>{if(J.has(t[i])){if(t.startsWith(q,i+1)){const e=t.indexOf(pt,i);return e===-1?void 0:t.slice(i,e+1)}return Mt.lastIndex=i,Mt.exec(t)?.[0]}},Zi=(t,i)=>{if(!J.has(t[i]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const e=!0,o=t.slice(i+1,i+1+q.length).join("")===q;return{isInsideEscape:e,isInsideLinkEscape:o}},Xi=t=>{let i=0;for(let e=0;e<t.length;e+=1)t.codePointAt(e)>65535&&(e+=1),i+=1;return i},Qi=(t,i={})=>{let e="",o=!1,s=0,h="",n="",r=!1;const c=[...t],a=[];for(let d=0,l=0;d<c.length;d+=1)a.push(l),l+=c[d].length;for(let d=0;d<c.length;d++){const l=c[d];if(l&&J.has(l)){if(e){const g=i.getWidth?.(e)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:e,width:g};if(r&&(u.isHyperlink=!0,u.hyperlinkUrl=n),i.onSegment?.(u)===!1)return;e=""}o=!0,s=d,h=l;const w=Zi(c,d),{isInsideLinkEscape:p}=w;if(p){let g=d+1;for(n="";g<c.length;){const b=c[g];if(b===pt)break;n+=b,g+=1}n=n.slice(4);const u={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(i.onSegment?.(u)===!1)return;d=g,r=!0,o=!1,h="";continue}if(d+1<c.length&&c[d+1]==="\\"&&r){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(i.onSegment?.(g)===!1)return;r=!1,n="",d+=1,o=!1,h="";continue}}if(o){const w=lt(t,a[s]);o=!1,w===void 0?(h=c.slice(s).join(""),d=c.length):(h=w,d=s+Xi(w)-1);const p={isEscapeSequence:!0,isGrapheme:!1,text:h,width:0};if(i.onSegment?.(p)===!1)return;h="";continue}e+=l;const m=i.getWidth?.(e)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:e,width:m};if(r&&(f.isHyperlink=!0,f.hyperlinkUrl=n),i.onSegment?.(f)===!1)return;e=""}if(e){const d=i.getWidth?.(e)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:e,width:d};r&&(l.isHyperlink=!0,l.hyperlinkUrl=n),i.onSegment?.(l)}if(h){const d={isEscapeSequence:!0,isGrapheme:!1,text:h,width:0};i.onSegment?.(d)}},kt=t=>`${J.values().next().value}${q}${t}${pt}`,te=(t,i,e)=>{let o=e,s=0;for(;s<t.length;){if(!J.has(t[s])){s+=1;continue}const h=lt(t,s);if(h===void 0){s+=1;continue}if(t.startsWith(q,s+1)){const n=h.slice(1+q.length,-1);o=n.length===0?void 0:n}else i.processEscape(h);s+=h.length}return o},ie=t=>{if(t.length===0)return"";if(t.length===1)return t[0];const i=new Gi,e=t.length-1;let o="",s;for(const[h,n]of t.entries())h>0&&(o+=i.getStartEscapesForAllActiveAttributes(),s!==void 0&&(o+=kt(s))),o+=n,s=te(n,i,s),h<e&&(s!==void 0&&(o+=kt("")),o+=i.getEndEscapesForAllActiveAttributes(),o+=`
2
- `);return o},ee=/(?=\s)|(?<=\s)/,oe=new Intl.Segmenter("en",{granularity:"grapheme"}),ne=/[^\u0000-\u02FF]/,gt=/^\s+$/,jt=new Map,re=t=>{const i=jt.get(t);if(i!==void 0)return i;const e=k(t);return jt.set(t,e),e},se=t=>{if(!ne.test(t))return[t];const i=[];let e="";for(const{segment:o}of oe.segment(t)){if(k(o)>1){e!==""&&(i.push(e),e=""),i.push(o);continue}e+=o}return e!==""&&i.push(e),i},Et=t=>t.split(ee).flatMap(i=>i===""||gt.test(i)?[i]:se(i)),Nt="x",he=t=>{let i="",e=0;for(;e<t.length;){const o=J.has(t[e])?lt(t,e):void 0;if(o===void 0){if(J.has(t[e]))return i+Nt.repeat(t.length-e);i+=t[e],e+=1;continue}i+=Nt.repeat(o.length),e+=o.length}return i},Yt=t=>{if(![...J].some(o=>t.includes(o)))return Et(t);const i=[];let e=0;for(const o of Et(he(t)))i.push(t.slice(e,e+o.length)),e+=o.length;return i},_=t=>{const i=t.split(" ");let e=i.length;for(;e>0&&k(i[e-1])===0;)e--;return e===i.length?t:i.slice(0,e).join(" ")+i.slice(e).join("")},Kt=(t,i,e)=>{if(t.length===0)return[""];if(i<=0)return[t];const o=[];let s="",h=0,n=0;for(;n<t.length;){const r=t.codePointAt(n),c=String.fromCodePoint(r),a=c.length;if(J.has(c)){const m=lt(t,n);if(m===void 0){s+=t.slice(n);break}s+=m,n+=m.length;continue}const d=re(c),l=c===" ";if(d===0){s+=c,n+=a;continue}if(h+d>i&&(s&&o.push(s),s="",h=0,l&&e)){for(;n<t.length&&t[n]===" ";)n+=1;continue}if(s+=c,h+=d,h===i&&n+a<t.length&&(o.push(s),s="",h=0,n+a<t.length&&t[n+a]===" "&&e)){for(n+=a;n<t.length&&t[n]===" ";)n+=1;continue}n+=a}return s&&o.push(s),e?o.map(r=>_(r)):o},ce=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const s=[];let h="",n=0;return Qi(o,{getWidth:k,onSegment:r=>{const c=r.text??"";if(r.isEscapeSequence)h+=c;else{const a=c===" ";if(r.width===0)return h+=c,!0;if(n+r.width>i&&(h&&s.push(h),h="",n=0,a))return e||s.push(c),!0;h+=c,n+=r.width}return!0}}),h&&s.push(h),e?s.map(r=>_(r)):s},ae=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const s=Yt(o),h=[];let n="",r=0,c=0;for(;c<s.length;){const a=s[c],d=gt.test(a),l=k(a);if(a.length===0){c+=1;continue}if(e&&d&&r===0){c+=1;continue}if(r+l>i&&r>0){e?h.push(_(n)):h.push(n),n="",r=0;continue}n+=a,r+=l,c+=1}return n&&(e?h.push(_(n)):h.push(n)),h},le=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const s=Yt(o),h=[];let n="",r=0,c=0;for(;c<s.length;){const a=s[c],d=gt.test(a),l=k(a);if(a.length===0){c+=1;continue}if(e&&d&&r===0){c+=1;continue}if(l>i){n&&h.push(e?_(n):n);const m=Kt(a,i,e);if(m.length>0){for(let f=0;f<m.length-1;f+=1)h.push(m[f]);n=m.at(-1),r=k(n)}else n="",r=0;c+=1;continue}if(r+l>i&&r>0&&(h.push(e?_(n):n),n="",r=0,e&&d)){c+=1;continue}n+=a,r+=l,c+=1}return n&&h.push(e?_(n):n),h},rt={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},de=(t,i={})=>{const{removeZeroWidthCharacters:e=!0,trim:o=!0,width:s=80,wrapMode:h=rt.PRESERVE_WORDS}=i;if(o&&t.trim()==="")return"";let n=t.normalize("NFC").replaceAll(`\r
3
- `,`
4
- `);return e&&(n=n.replaceAll(Li,"")),n.split(`
5
- `).map(r=>{if(o&&r.trim()==="")return"";let c;switch(h){case rt.BREAK_AT_CHARACTERS:{c=ce(r,s,o);break}case rt.BREAK_WORDS:{c=le(r,s,o);break}case rt.STRICT_WIDTH:{c=Kt(r,s,o);break}default:c=ae(r,s,o)}return ie(c)}).join(`
6
- `)},Zt=80,Xt=24,ft=(t,i,{shell:e,env:o}={})=>ai(t,i,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:e,env:o}).trim(),st=(t,i)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(i,10)}),Qt=(t,i)=>{const{columns:e,rows:o}=st(t,i);if(!(Number.isNaN(e)||Number.isNaN(o))&&!(e===Zt&&o===Xt))return{columns:e,rows:o}},ue=()=>{if(T.platform!=="linux")return!0;try{const t=Y.readFileSync("/proc/self/stat","utf8"),i=t.lastIndexOf(") ");if(i===-1)return!1;const e=t.slice(i+2).trim().split(/\s+/),o=Number.parseInt(e[2],10),s=Number.parseInt(e[5],10);return Number.isNaN(o)||Number.isNaN(s)||s<=0?!1:o===s}catch{return!1}};function fe(){const{env:t,stdout:i,stderr:e}=T;if(i?.columns&&i?.rows)return st(i.columns,i.rows);if(e?.columns&&e?.rows)return st(e.columns,e.rows);if(t.COLUMNS&&t.LINES)return st(t.COLUMNS,t.LINES);const o={columns:Zt,rows:Xt};return T.platform==="win32"?ut()??o:T.platform==="darwin"?Lt()??ut()??o:Lt()??ut()??me()??o}const Lt=()=>{try{const t=T.platform==="darwin"?Y.constants.O_EVTONLY|Y.constants.O_NONBLOCK:Y.constants.O_NONBLOCK,{columns:i,rows:e}=li.WriteStream(Y.openSync("/dev/tty",t));return{columns:i,rows:e}}catch{}},ut=()=>{try{const t=ft("tput",["cols"],{env:{TERM:"dumb",...T.env}}),i=ft("tput",["lines"],{env:{TERM:"dumb",...T.env}});if(t&&i)return Qt(t,i)}catch{}},me=()=>{try{if(!ue())return;const t=ft("resize",["-u"]).match(/\d+/g);if(t.length===2)return Qt(t[0],t[1])}catch{}},P=(t,i)=>{switch(i){case"bottom":return{body:t.bottomBody,join:t.bottomJoin,left:t.bottomLeft,right:t.bottomRight};case"middle":return{body:t.joinBody,join:t.joinJoin,left:t.joinLeft,right:t.joinRight};case"top":return{body:t.topBody,join:t.topJoin,left:t.topLeft,right:t.topRight};default:throw new Error(`Invalid borderType: ${String(i)}`)}},we=t=>({join:t.bodyJoin,left:t.bodyLeft,right:t.bodyRight}),ct=(t,i,e,o=1)=>{let s=0;for(let h=0;h<e;h+=1)s+=t[i+h]??0;return e>1&&(s+=(e-1)*o),s},mt=(t,i,e,o)=>{let s=i;for(;s>0&&t[s-1]?.[e]===o;)s-=1;let h=i;for(;h<t.length-1&&t[h+1]?.[e]===o;)h+=1;let n;const r=h-s+1;if(r===1)n=!0;else switch(o.vAlign){case"bottom":{n=i===h;break}case"middle":{const c=s+Math.floor(r/2);n=i===c;break}case"top":{n=i===s;break}default:n=i===s}return{firstRow:s,lastRow:h,showContent:n}},pe=(t,i,e,o,s)=>{if(t.length===0)return[];const h=e.showBorders?e.border?.bodyJoin.width??0:0,n=e.showBorders&&(e.border?.joinBody.width??0)>0;let r=t.length-1;for(let d=0;d<t.length;d+=1){const l=t[d];if(l){for(const[m,f]of l.entries())if(f&&s(t,d,m,f)===d){const w=mt(t,d,m,f);r=Math.max(r,w.lastRow)}}}const c=Array.from({length:r+1}).fill(1);for(let d=0;d<t.length;d+=1){const l=t[d];if(l)for(let m=0;m<e.columns;m+=1){const f=l[m];if(f&&s(t,d,m,f)===d&&(f.rowSpan??1)===1){const w=f.colSpan??1,p=ct(i,m,w,h),g=o(f,p).length;c[d]=Math.max(c[d]??1,g)}}}const a=Array.from({length:c.length}).fill(!1);if(e.fixedRowHeights)for(let d=0;d<c.length;d+=1){let l;e.fixedRowHeights[d]!==void 0?l=e.fixedRowHeights[d]:e.fixedRowHeights.length===1&&e.fixedRowHeights[0]!==void 0&&(l=e.fixedRowHeights[0]),l!==void 0&&(c[d]=Math.max(1,l),a[d]=!0)}for(let d=0;d<t.length;d+=1){const l=t[d];if(l)for(let m=0;m<e.columns;m+=1){const f=l[m];if(f&&s(t,d,m,f)===d&&(f.rowSpan??1)>1){const w=f.colSpan??1,p=ct(i,m,w,h),g=o(f,p),u=n?g.length-1:g.length,b=mt(t,d,m,f),{firstRow:W,lastRow:y}=b;let x=0,R=0;for(let v=W;v<=y&&v<c.length;v+=1)x+=c[v]??1,a[v]||(R+=1);const S=u-x;if(S>0)if(R>0){const v=Math.ceil(S/R);let B=0;for(let A=W;A<=y&&A<c.length;A+=1)if(!a[A]){const M=Math.min(v,S-B);if(c[A]=(c[A]??1)+M,B+=M,B>=S)break}}else(e.onWarn??(v=>{console.warn(v)}))(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(f.content)}, Required: ${String(u)}, Allocated: ${String(x)} (fixed).`)}}}return c},G=(t,i,e,o)=>{let s=i;for(;s>0&&t[s-1]?.[e]===o;)s-=1;return s},Jt=t=>{if(typeof t=="string")return{content:t};if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")return{content:String(t)};if(t==null)return{content:"",isEmpty:!0};if(typeof t=="object"&&"content"in t){let{content:i}=t,e=!1;if(typeof i=="number"||typeof i=="bigint"||typeof i=="boolean")i=String(i);else if(i==null)i="",e=!0;else if(typeof i!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`);return e?{...t,content:i,isEmpty:!0}:{...t,content:i}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`)},ge=(t,i,e,o,s)=>{const h=k(t),n=" ".repeat(Math.max(0,o)),r=" ".repeat(Math.max(0,s));if(h===0)return n+" ".repeat(Math.max(0,i))+r;const c=Math.max(0,i-h);switch(e){case"center":{const a=Math.floor(c/2),d=c-a;return n+" ".repeat(a)+t+" ".repeat(d)+r}case"right":return n+" ".repeat(c)+t+r;default:return n+t+" ".repeat(c)+r}},Ft=/\r?\n/,Tt=/\s+/;let Ot;const be=()=>(Ot??=fe().columns,Ot),C=(t,i)=>!t||!i?t:typeof i=="function"?i(t):i.open+t+i.close;class at{#t;#e=[];#o;#r=new WeakMap;#n=new WeakMap;#i=new WeakMap;#s(i){const e=this.#i.get(i);if(e)return e;const o=String(i.content??"").split(Ft);let s=0;for(const n of o)s=Math.max(s,k(n));const h={lines:o,maxLineWidth:s};return this.#i.set(i,h),h}#h(i){const e=this.#t.onWarn;if(e){e(i);return}console.warn(i)}static createGridLayout(){return[]}static calculateImplicitRowCount(i,e){let o=0;for(const s of i)o+=(s.colSpan??1)*(s.rowSpan??1);return Math.max(1,Math.ceil(o/e))}constructor(i){const e={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:i.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let o;Array.isArray(i.fixedRowHeights)?o=i.fixedRowHeights:typeof i.fixedRowHeights=="number"&&(o=[i.fixedRowHeights]),this.#t={...e,...i,columns:i.columns,fixedRowHeights:o,showBorders:i.border!==void 0||(i.showBorders??!1)};const{terminalWidth:s}=this.#t;this.#o=s??be(),this.#t.maxWidth&&(this.#t.maxWidth=Math.min(this.#t.maxWidth,this.#o))}addItem(i){const e=Jt(i);return this.#c(e),this.#e.push(e),this}#c(i){i.width!==void 0&&this.#h("@visulima/tabular: GridItem.width is ignored by Grid (it is only consumed by Table). Use fixedColumnWidths or maxWidth to constrain Grid column widths.")}addItems(i){for(const e of i){const o=Jt(e);this.#c(o),this.#e.push(o)}return this}setColumns(i){return this.#t.columns=i,this}setRows(i){return this.#t.rows=i,this}setBorder(i){return this.#t.border=i,this}setShowBorders(i){return this.#t.showBorders=i,this}setMaxWidth(i){return this.#t.maxWidth=i,this}toString(){const i=at.createGridLayout();if(this.#r=new WeakMap,this.#n=new WeakMap,this.#i=new WeakMap,this.placeItems(i),i.length===0||i[0]?.length===0)return"";let e=this.calculateColumnWidths(i);const o=this.calculateTotalGridWidth(e),s=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o;return o>s&&(e=this.adjustColumnWidthsForTerminal(e,o)),this.renderGrid(i,e)}placeItems(i){let e=0,o=0;const s=this.#t.rows>0?this.#t.rows:Number.POSITIVE_INFINITY,h=this.#t.rows>0?this.#t.rows:at.calculateImplicitRowCount(this.#e,Math.max(1,this.#t.columns));for(let n=0;n<this.#e.length;n+=1){const r=this.#e[n];if(r.isEmpty&&!(r.rowSpan&&r.rowSpan>1)&&!(r.colSpan&&r.colSpan>1)){this.#t.autoFlow==="row"?(o+=1,o>=this.#t.columns&&(o=0,e+=1)):(e+=1,e>=h&&(e=0,o+=1));continue}const c=r.colSpan??1,a=r.rowSpan??1;let d=!1,l=e,m=o,f=0;const w=((this.#t.autoFlow==="column"?Math.max(i.length,h):i.length)+a+5)*this.#t.columns,p=c<=this.#t.columns;for(;p&&!d&&l<s&&f<w;){for(f+=1;l+a>i.length;)i.push(Array.from({length:this.#t.columns}).fill(void 0));if(this.canPlaceItem(i,l,m,c,a))this.placeItem(i,l,m,r),d=!0,this.#t.autoFlow==="row"?(o=m+c,e=l,o>=this.#t.columns&&(o=0,e+=1)):(e=l+a,o=m,e>=h&&(e=0,o+=1));else if(this.#t.autoFlow==="row")m+=1,m>=this.#t.columns&&(m=0,l+=1);else if(l+=1,l>=h&&(l=0,m+=1,m>=this.#t.columns))break}d||(this.#h(`@visulima/tabular: Could not find position for item: ${JSON.stringify(r)} after ${String(f)} attempts. Grid might be too small or layout impossible.`),this.#t.autoFlow==="row"?(o+=1,o>=this.#t.columns&&(o=0,e+=1)):(e+=1,e>=h&&(e=0,o+=1)))}if(this.#t.rows>0){if(i.length>0)for(;i.length<this.#t.rows;)i.push(Array.from({length:this.#t.columns}).fill(void 0))}else for(;i.length>0&&i.at(-1)?.every(n=>n===void 0);)i.pop()}canPlaceItem(i,e,o,s,h,n=!1){if(o+s>this.#t.columns)return!1;for(let r=e;r<e+h;r+=1)if(r<i.length){if(!i[r])return this.#h(`Grid layout unexpectedly missing row ${String(r)} during canPlaceItem check.`),!1;for(let c=o;c<o+s;c+=1)if(i[r]?.[c]!==void 0)return!1}else if(!n)return!1;return!0}computeWrappedContentWidth(i,e,o,s){let h=i;if(s){if(h>20){let n=0;for(const r of e){const c=r.split(Tt);for(const a of c)n=Math.max(n,Math.min(k(a),o))}h=Math.min(h,Math.max(n+4,12))}}else{let n=0;for(const r of e){const c=r.split(Tt);for(const a of c)n=Math.max(n,Math.min(k(a),o))}h=Math.min(h,Math.max(n+12,20))}return h}placeItem(i,e,o,s){const h=s.rowSpan??1,n=s.colSpan??1;for(let r=e;r<e+h;r+=1){for(;r>=i.length;)i.push(Array.from({length:this.#t.columns}).fill(void 0));for(let c=o;c<o+n;c+=1)c<this.#t.columns&&(i[r]||(this.#h(`Logic error: Row ${String(r)} not found in placeItem despite check.`),i[r]=Array.from({length:this.#t.columns}).fill(void 0)),i[r][c]=s)}}calculateTotalGridWidth(i){let e=0;const o=this.#t.showBorders?this.#t.border:void 0;o&&(e+=o.bodyLeft.width,e+=o.bodyRight.width);const s=i.length,h=this.#t.showBorders?o?.bodyJoin.width??0:0,n=this.#t.gap;for(let r=0;r<s;r+=1)e+=i[r]??0,r<s-1&&(e+=n,e+=h);return e}adjustColumnWidthsForTerminal(i,e){const o=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth??0,this.#o):this.#o;if(e<=o)return i;let s=0;const h=i.length,n=this.#t.showBorders?this.#t.border:void 0;if(n&&(s+=n.bodyLeft.width,s+=n.bodyRight.width),h>1){s+=(h-1)*this.#t.gap;const m=n?.bodyJoin.width??0;s+=(h-1)*m}if(s>=o)return Array.from({length:h}).fill(1);const r=o-s,c=i.reduce((m,f)=>m+f,0);if(c===0){const m=Math.floor(r/h);return Array.from({length:h}).fill(m)}const a=i.map(m=>{const f=m/c;return Math.max(1,Math.floor(r*f))});let d=a.reduce((m,f)=>m+f,0)-r;for(;d>0;){let m=-1;for(let f=0;f<a.length;f+=1)(a[f]??0)>1&&(m===-1||(a[f]??0)>(a[m]??0))&&(m=f);if(m===-1)break;a[m]-=1,d-=1}let l=r-a.reduce((m,f)=>m+f,0);if(l>0){const m=a.map((f,w)=>{const p=c>0?(i[w]??0)/c:1/h;return{index:w,remainder:r*p%1}}).toSorted((f,w)=>w.remainder-f.remainder);for(const f of m){if(l<=0)break;const{index:w}=f;a[w]!==void 0&&(a[w]+=1,l-=1)}}return a}calculateBalancedColumnWidths(i){const e=this.calculateMinimumColumnWidthsWithGrowableInfo(i),o=e.widths,{growableColumns:s}=e,h=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o,n=this.#t.showBorders?this.#t.border:void 0;let r=0;if(n&&(r+=n.bodyLeft.width,r+=n.bodyRight.width),this.#t.columns>1){r+=(this.#t.columns-1)*this.#t.gap;const d=n?.bodyJoin.width??0;r+=(this.#t.columns-1)*d}const c=Math.max(0,h-r);if(o.reduce((d,l)=>d+l,0)>0){const d=Math.floor(c/this.#t.columns),l=Array.from({length:this.#t.columns}).fill(d),m=d*this.#t.columns;let f=c-m;for(let u=0;u<l.length&&f>0;u+=1)l[u]=(l[u]??0)+1,f-=1;const w=[];let p=0;for(let u=0;u<this.#t.columns;u+=1){const b=l[u]??0,W=o[u]??0,y=Math.max(b,W);w.push(y),p+=y}if(p>c){const u=c/p,b=w.map(x=>Math.max(3,Math.floor(x*u))),W=b.reduce((x,R)=>x+R,0);let y=c-W;for(let x=0;x<b.length&&y>0;x+=1)b[x]=(b[x]??0)+1,y-=1;return b}let g=c-p;if(g>0){const u=s.length>0?s:w.map((b,W)=>W);for(;g>0&&u.length>0;)for(const b of u){if(g<=0)break;w[b]=(w[b]??0)+1,g-=1}}return w}const a=Math.floor(c/this.#t.columns);return Array.from({length:this.#t.columns}).fill(a)}calculateMinimumColumnWidthsWithGrowableInfo(i){const e=Array.from({length:this.#t.columns}).fill(0),o=[],s=this.#t.paddingLeft+this.#t.paddingRight,h=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let n=0;n<this.#t.columns;n+=1)for(let r=0;r<i.length;r+=1){const c=i[r]?.[n];if(!c||G(i,r,n,c)!==r||n>0&&i[r]?.[n-1]===c)continue;const a=c.colSpan??1,d=c.maxWidth??Number.POSITIVE_INFINITY,{lines:l,maxLineWidth:m}=this.#s(c),f=this.#t.wordWrap&&c.wordWrap!==!1;let w=Math.min(m,d);w=this.computeWrappedContentWidth(w,l,d,f),a===1&&(e[n]=Math.max(e[n]??0,w+s),f&&!o.includes(n)&&o.push(n))}for(let n=0;n<i.length;n+=1)for(let r=0;r<this.#t.columns;r+=1){const c=i[n]?.[r];if(!c||G(i,n,r,c)!==n||r>0&&i[n]?.[r-1]===c)continue;const a=c.colSpan??1;if(a>1){const d=c.maxWidth??Number.POSITIVE_INFINITY,{lines:l,maxLineWidth:m}=this.#s(c),f=this.#t.wordWrap&&c.wordWrap!==!1;let w=Math.min(m,d);w=this.computeWrappedContentWidth(w,l,d,f);const p=(a-1)*h,g=w+s+p;let u=0;for(let W=r;W<r+a;W+=1)u+=e[W]??0;const b=u+p;if(g>b){const W=g-b,y=Math.floor(W/a);let x=0;for(let R=0;R<a&&r+R<this.#t.columns;R+=1){const S=Math.min(y,W-x);if(e[r+R]=(e[r+R]??0)+S,x+=S,x>=W)break}}}}return{growableColumns:o,widths:e}}calculateColumnWidths(i){if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns){const h=this.#t.fixedColumnWidths;if(!h.some(n=>n===void 0||!Number.isFinite(n)))return[...h];if(this.#t.balancedWidths){const n=Array.from({length:h.length}).fill(0),r=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o,c=this.calculateTotalGridWidth(Array.from({length:n.length}).fill(0)),a=Math.max(0,r-c);let d=0;const l=[];for(const[w,p]of h.entries())typeof p=="number"&&Number.isFinite(p)?(n[w]=p,d+=p):l.push(w);let m=Math.max(0,a-d);const f=l.length>0?Math.floor(m/l.length):0;for(const w of l)n[w]=f;m-=f*l.length;for(const w of l){if(m<=0)break;n[w]+=1,m-=1}return n}}if(this.#t.balancedWidths)return this.calculateBalancedColumnWidths(i);const e=Array.from({length:this.#t.columns}).fill(0),o=this.#t.paddingLeft+this.#t.paddingRight,s=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let h=0;h<this.#t.columns;h+=1)for(let n=0;n<i.length;n+=1){const r=i[n]?.[h];if(!r||G(i,n,h,r)!==n||h>0&&i[n]?.[h-1]===r)continue;const c=r.colSpan??1,a=r.maxWidth??Number.POSITIVE_INFINITY,{maxLineWidth:d}=this.#s(r),l=Math.min(d,a);c===1&&(e[h]=Math.max(e[h]??0,l+o))}for(let h=0;h<i.length;h+=1)for(let n=0;n<this.#t.columns;n+=1){const r=i[h]?.[n];if(!r||G(i,h,n,r)!==h||n>0&&i[h]?.[n-1]===r)continue;const c=r.colSpan??1;if(c>1){const a=r.maxWidth??Number.POSITIVE_INFINITY,{lines:d,maxLineWidth:l}=this.#s(r),m=this.#t.wordWrap&&r.wordWrap!==!1;let f=Math.min(l,a);f=this.computeWrappedContentWidth(f,d,a,m);let w=0;for(let b=n;b<n+c;b+=1)w+=e[b]??0;const p=c>1?(c-1)*s:0,g=f+o+p,u=w+p;if(g>u){const b=g-u,W=Math.floor(b/c);let y=0;for(let x=0;x<c&&n+x<this.#t.columns;x+=1){const R=Math.min(W,b-y);if(e[n+x]=(e[n+x]??0)+R,y+=R,y>=b)break}}}}if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns)for(const[h,n]of this.#t.fixedColumnWidths.entries())typeof n=="number"&&Number.isFinite(n)&&(e[h]=n);if(this.#t.maxWidth){const h=this.calculateTotalGridWidth(e);if(h>this.#t.maxWidth)return this.adjustColumnWidthsForTerminal(e,h)}return e}renderVisualRowContent(i,e,o,s,h){const n=i[e];if(!n)return"";const r=this.#t.borderColor??this.#t.foregroundColor??void 0,c=[],a=this.#t.showBorders&&this.#t.border?we(this.#t.border):void 0,d=a&&a.left.width>0?a.left.char:"",l=a&&a.right.width>0?a.right.char:"",m=a&&a.join.width>0?a.join.char:"",f=" ".repeat(this.#t.gap);d&&c.push(C(C(d,r),this.#t.backgroundColor));let w=0;for(;w<this.#t.columns;){const p=n[w]??void 0;let g=1,u;if(p){const b=p.colSpan??1;g=b;const W=G(i,e,w,p),y=this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0,x=ct(s,w,b,y),R=this.alignCellContent(p,x),S=R.length,v=this.getCachedCellVerticalPosition(i,e,w,p);v.firstRow!==W&&this.#h(`Mismatch between findFirstOccurrenceRow (${String(W)}) and determineCellVerticalPosition (${String(v.firstRow)})`);const B=h.slice(W,v.lastRow+1).reduce((I,j)=>I+j,0),A=v.lastRow-v.firstRow+1;let M=o,L=0;const H=this.#t.showBorders&&(this.#t.border?.joinBody.width??0)>0;for(let I=W;I<e;I+=1)I<h.length&&(M+=h[I]??1),H&&I<v.lastRow&&(L+=1);M+=L;const O=p.vAlign??"top";let E;switch(O){case"bottom":{let I=o;for(let N=W;N<e;N+=1)I+=h[N]??1;const j=B-S;E=I>=j?I-j:-1;break}case"middle":{const I=Math.round((B-S)/2);let j=o;for(let N=W;N<e;N+=1)j+=h[N]??1;E=j>=I&&j<I+S?j-I:-1;break}case"top":{E=M;break}default:E=M}const U=E>=0&&E<S;if(u=" ".repeat(Math.max(0,x)),U){let I=!1;O==="middle"&&A%2===0&&E===0&&(I=!0),I||(u=R[E]??u)}p.colSpan&&p.colSpan>1&&(u+=f.repeat(p.colSpan)),p.foregroundColor?u=C(u,p.foregroundColor):this.#t.foregroundColor&&(u=C(u,this.#t.foregroundColor)),p.backgroundColor?u=C(u,p.backgroundColor):this.#t.backgroundColor&&(u=C(u,this.#t.backgroundColor))}else{const b=this.#t.paddingLeft+this.#t.paddingRight,W=Math.max(0,(s[w]??0)-b),y=" ".repeat(this.#t.paddingLeft+W+this.#t.paddingRight);u=C(C(o===0?y:" ".repeat(y.length),this.#t.foregroundColor),this.#t.backgroundColor)}c.push(u),w+g<this.#t.columns&&(c.push(f),this.#t.showBorders&&m&&c.push(C(C(m,r),this.#t.backgroundColor)),this.#t.gap>0&&c.push(f)),w+=g}return l&&c.push(C(C(l,r),this.#t.backgroundColor)),c.join("")}alignCellContent(i,e){const o=this.#r.get(i);if(o?.has(e))return o.get(e);const{paddingLeft:s,paddingRight:h}=this.#t,n=s+h,r=e-n;if(r<=0){const l=[" ".repeat(n+this.#t.gap)];return o?o.set(e,l):this.#r.set(i,new Map([[e,l]])),l}let c;const a=String(i.content??"");if(c=a.includes(`
7
- `)||a.includes("\r")?a.split(Ft):[a],this.#t.wordWrap&&i.wordWrap!==!1){const l=typeof this.#t.wordWrap=="object"?this.#t.wordWrap:{},m=typeof i.wordWrap=="object"?i.wordWrap:l;c=de(a,{...m,width:r}).split(`
8
- `)}if(this.#t.truncate&&i.truncate!==!1){const l=typeof this.#t.truncate=="object"?this.#t.truncate:{},m=typeof i.truncate=="object"?i.truncate:l;c=c.map(f=>It(f,r,m))}else this.#t.truncateOverflow&&(c=c.map(l=>k(l)>r?It(l,r,{}):l));const d=c.map(l=>ge(l,r,i.hAlign??"left",s,h));return o?o.set(e,d):this.#r.set(i,new Map([[e,d]])),d}renderHorizontalBorder(i,e,o,s,h,n=-1){if(!this.#t.showBorders||!this.#t.border)return"";const r=this.#t.border,c=P(r,h),a=c.body.char,d=c.body.width,l=r.bodyJoin.char;if(h!=="middle"&&d===0)return"";let m=c.left.char,f=c.right.char;if(h==="middle"&&n!==-1){const u=i[o]?.[0]??void 0,b=i[n]?.[0]??void 0;u&&b&&u===b&&(m=l);const W=this.#t.columns-1,y=i[o]?.[W]??void 0,x=i[n]?.[W]??void 0;y&&x&&y===x&&(f=l)}const w=[],p=" ".repeat(this.#t.gap);m&&w.push(C(C(m,this.#t.borderColor),this.#t.backgroundColor));let g;for(let u=0;u<this.#t.columns;u+=1){const b=i[o]?.[u]??void 0,W=h==="middle"&&n!==-1?i[n]?.[u]??void 0:void 0;let y,x=!1;if(b&&(u===0||i[o]?.[u-1]!==b)&&(y=b,x=!0),b&&!x)continue;if(!b){const v=s[u]??0;if(g=d>0?a.repeat(v):" ".repeat(v),w.push(C(C(g,this.#t.borderColor),this.#t.backgroundColor)),u<this.#t.columns-1){const B=this.determineJoinChar(h,i,o,n,u,u+1);w.push(p),B.width>0&&w.push(C(C(B.char,this.#t.borderColor),this.#t.backgroundColor))}continue}const R=y?.colSpan??1;if(h==="middle"&&h==="middle"&&W&&b===W&&y){const v=y.vAlign==="middle",{firstRow:B,lastRow:A}=this.getCachedCellVerticalPosition(i,o,u,y),M=A-B+1,L=M%2===0,H=B+Math.ceil(M/2)-1,O=r.bodyJoin.width,E=ct(s,u,R,O),U=this.alignCellContent(y,E),I=U.length;if(v&&L&&o===H)g=C(U[0]??"",this.#t.borderColor);else{let j=0;for(let $=B;$<=o;$+=1)j+=e[$]??1,$<o&&(j+=1);const N=j;if(N>=0&&N<I)g=C(U[N]??"",this.#t.foregroundColor);else{const $=s.slice(u,u+R).reduce((ti,ii)=>ti+ii,0)+(R-1)*(this.#t.gap+this.#t.border.bodyJoin.width);g=C(" ".repeat($),this.#t.borderColor)}}w.push(C(g,this.#t.backgroundColor))}else{const v=[];for(let B=u;B<u+R;B+=1){const A=s[B]??0,M=d>0?a:" ";if(v.push(M.repeat(A+this.#t.gap)),B<u+R-1){const L=this.determineJoinChar(h,i,o,n,B,B+1);L.width>0&&v.push(L.char)}}g=v.join(""),w.push(C(C(g,this.#t.borderColor),this.#t.backgroundColor))}const S=u+R-1;if(S<this.#t.columns-1){const v=this.determineJoinChar(h,i,o,n,S,S+1);v.width>0&&w.push(C(C(v.char,this.#t.borderColor),this.#t.backgroundColor))}u+=R-1}return f&&w.push(C(C(f,this.#t.borderColor),this.#t.backgroundColor)),w.join("")}determineJoinChar(i,e,o,s,h,n=-1){if(!this.#t.showBorders||!this.#t.border)return{char:" ",width:this.#t.gap};const r=this.#t.border;if(i!=="middle"){const x=P(r,i),R=e[o]?.[h]??void 0,S=n===-1?h+1:n,v=e[o]?.[S]??void 0,B=R!==void 0&&v!==void 0&&R===v?x.body:x.join,{char:A,width:M}=B;return{char:A,width:M>0?M:this.#t.gap}}if(s===-1||n===-1)return{char:" ",width:this.#t.gap};const c=r.bodyJoin,a=e[o]?.[h]??void 0,d=e[s]?.[h]??void 0,l=e[o]?.[n]??void 0,m=e[s]?.[n]??void 0,f=a!==void 0&&d!==void 0&&a===d,w=l!==void 0&&m!==void 0&&l===m,p=a!==void 0&&l!==void 0&&a===l,g=d!==void 0&&m!==void 0&&d===m;let u;const b=P(r,"middle");f&&w?u=p?{char:" ",width:c.width}:c:f?u=r.joinLeft:w?u=r.joinRight:p&&g?u=b.body:p?u=r.topJoin:g?u=r.bottomJoin:u=r.joinJoin;const{char:W,width:y}=u;return{char:W,width:y>0?y:this.#t.gap}}renderGrid(i,e){if(i.length===0)return"";const o=[],s=pe(i,e,this.#t,this.alignCellContent.bind(this),G),h=this.#t.showBorders&&this.#t.border?P(this.#t.border,"top"):void 0;h&&h.body.width>0&&o.push(this.renderHorizontalBorder(i,s,0,e,"top"));for(let r=0;r<i.length;r+=1){const c=s[r]??1;for(let d=0;d<c;d+=1)o.push(this.renderVisualRowContent(i,r,d,e,s));const a=this.#t.showBorders&&this.#t.border?P(this.#t.border,"middle"):void 0;if(r<i.length-1&&a&&a.body.width>0){const d=i[r],l=i[r+1];let m=!1;if(d&&l)for(let f=0;f<this.#t.columns;f+=1){const w=d[f],p=l[f];if(w!==p){m=!0;break}}m&&o.push(this.renderHorizontalBorder(i,s,r,e,"middle",r+1))}}const n=this.#t.showBorders&&this.#t.border?P(this.#t.border,"bottom"):void 0;return n&&n.body.width>0&&o.push(this.renderHorizontalBorder(i,s,i.length-1,e,"bottom")),o.join(`
9
- `)}getCachedCellVerticalPosition(i,e,o,s){const h=this.#n.get(s);if(h)return h;const n=mt(i,e,o,s);return this.#n.set(s,n),n}}const ye={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},Ce={bodyJoin:{char:" ",width:1},bodyLeft:{char:" ",width:1},bodyRight:{char:" ",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"-",width:1},bottomLeft:{char:"-",width:1},bottomRight:{char:"-",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"-",width:1},joinLeft:{char:"-",width:1},joinRight:{char:"-",width:1},topBody:{char:"-",width:1},topJoin:{char:"-",width:1},topLeft:{char:"-",width:1},topRight:{char:"-",width:1}},Se={bodyJoin:{char:"║",width:1},bodyLeft:{char:"║",width:1},bodyRight:{char:"║",width:1},bottomBody:{char:"═",width:1},bottomJoin:{char:"╩",width:1},bottomLeft:{char:"╚",width:1},bottomRight:{char:"╝",width:1},joinBody:{char:"═",width:1},joinJoin:{char:"╬",width:1},joinLeft:{char:"╠",width:1},joinRight:{char:"╣",width:1},topBody:{char:"═",width:1},topJoin:{char:"╦",width:1},topLeft:{char:"╔",width:1},topRight:{char:"╗",width:1}},Ae={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"╰",width:1},bottomRight:{char:"╯",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"╭",width:1},topRight:{char:"╮",width:1}},Ie={bodyJoin:{char:"┊",width:1},bodyLeft:{char:"┊",width:1},bodyRight:{char:"┊",width:1},bottomBody:{char:"┈",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"┈",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"┈",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},Me={bodyJoin:{char:"|",width:1},bodyLeft:{char:"|",width:1},bodyRight:{char:"|",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"|",width:1},bottomLeft:{char:"|",width:1},bottomRight:{char:"|",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"|",width:1},joinLeft:{char:"|",width:1},joinRight:{char:"|",width:1},topBody:{char:"-",width:1},topJoin:{char:"|",width:1},topLeft:{char:"|",width:1},topRight:{char:"|",width:1}},ke={bodyJoin:{char:"|",width:1},bodyLeft:{char:"|",width:1},bodyRight:{char:"|",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"+",width:1},bottomLeft:{char:"+",width:1},bottomRight:{char:"+",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"+",width:1},joinLeft:{char:"+",width:1},joinRight:{char:"+",width:1},topBody:{char:"-",width:1},topJoin:{char:"+",width:1},topLeft:{char:"+",width:1},topRight:{char:"+",width:1}},je={bodyJoin:{char:"",width:0},bodyLeft:{char:"",width:0},bodyRight:{char:"",width:0},bottomBody:{char:"",width:0},bottomJoin:{char:"",width:0},bottomLeft:{char:"",width:0},bottomRight:{char:"",width:0},joinBody:{char:"",width:0},joinJoin:{char:"",width:0},joinLeft:{char:"",width:0},joinRight:{char:"",width:0},topBody:{char:"",width:0},topJoin:{char:"",width:0},topLeft:{char:"",width:0},topRight:{char:"",width:0}},Ee={bodyJoin:{char:"█",width:1},bodyLeft:{char:"█",width:1},bodyRight:{char:"█",width:1},bottomBody:{char:"█",width:1},bottomJoin:{char:"█",width:1},bottomLeft:{char:"█",width:1},bottomRight:{char:"█",width:1},joinBody:{char:"█",width:1},joinJoin:{char:"█",width:1},joinLeft:{char:"█",width:1},joinRight:{char:"█",width:1},topBody:{char:"█",width:1},topJoin:{char:"█",width:1},topLeft:{char:"█",width:1},topRight:{char:"█",width:1}},Ne={bodyJoin:{char:"┃",width:1},bodyLeft:{char:"┃",width:1},bodyRight:{char:"┃",width:1},bottomBody:{char:"━",width:1},bottomJoin:{char:"┻",width:1},bottomLeft:{char:"┗",width:1},bottomRight:{char:"┛",width:1},joinBody:{char:"━",width:1},joinJoin:{char:"╋",width:1},joinLeft:{char:"┣",width:1},joinRight:{char:"┫",width:1},topBody:{char:"━",width:1},topJoin:{char:"┳",width:1},topLeft:{char:"┏",width:1},topRight:{char:"┓",width:1}},xe=t=>t.reduce((i,e)=>{if(e===null)return i+1;if(typeof e=="object"&&!Array.isArray(e)){const o=typeof e.colSpan=="number"?e.colSpan:1;return i+(o<=0?1:o)}return i+1},0),We=/[\u0000-\u001F\u007F-\u009F]/gu,Be=t=>t.replaceAll(We,"");class ve{#t;#e=[];#o=[];#r=[];#n=!0;#i=void 0;#s(i){const e=this.#t.onWarn;if(e){e(i);return}console.warn(i)}constructor(i={}){this.#t={...i,showFooter:i.showFooter??!0,showHeader:i.showHeader??!0,style:{border:ye,paddingLeft:1,paddingRight:1,...i.style}}}setHeaders(i){return i.length>0&&!Array.isArray(i[0])?this.#o=[i]:this.#o=i.map(e=>Array.isArray(e)?e:[e]),this.#n=!0,this.#i=void 0,this}setFooter(i){return i.length>0&&!Array.isArray(i[0])?this.#r=[i]:this.#r=i.map(e=>Array.isArray(e)?e:[e]),this.#n=!0,this.#i=void 0,this}addRow(i){if(!Array.isArray(i))throw new TypeError("Row must be an array");return this.#e.push(i),this.#n=!0,this.#i=void 0,this}addRows(...i){for(const e of i)this.addRow(e);return this.#n=!0,this.#i=void 0,this}getRows(){return this.#e.map(i=>[...i])}get rowCount(){return this.#e.length}removeRow(i){if(!Number.isInteger(i)||i<0||i>=this.#e.length)throw new RangeError(`Row index ${String(i)} is out of bounds (0..${String(this.#e.length-1)})`);return this.#e.splice(i,1),this.#n=!0,this.#i=void 0,this}clear(){return this.#e.length=0,this.#n=!0,this.#i=void 0,this}toString(){if(!this.#n&&this.#i!==void 0)return this.#i;const i=this.#t.showHeader?this.#o:[],e=this.#t.showFooter?this.#r:[],o=[...i,...this.#e,...e];if(o.length===0)return this.#i="",this.#n=!1,"";let s=0;for(const f of o){const w=f;Array.isArray(w)?s=Math.max(s,xe(w)):this.#s(`Unexpected non-array element found while calculating columns: ${JSON.stringify(w)}`)}if(s===0)return this.#i="",this.#n=!1,"";let h;Array.isArray(this.#t.columnWidths)?h=this.#t.columnWidths.length>=s?this.#t.columnWidths.slice(0,s):[...this.#t.columnWidths,...Array.from({length:s-this.#t.columnWidths.length}).fill(void 0)]:typeof this.#t.columnWidths=="number"&&(h=Array.from({length:s}).fill(this.#t.columnWidths));let n;const r=o.length;if(Array.isArray(this.#t.rowHeights)?n=this.#t.rowHeights:typeof this.#t.rowHeights=="number"&&(n=Array.from({length:r}).fill(this.#t.rowHeights)),h||o.some(f=>Array.isArray(f)&&f.some(w=>typeof w=="object"&&w!==null&&!Array.isArray(w)&&w.width!==void 0))&&(h=Array.from({length:s}).fill(void 0)),h&&Array.isArray(h)){const f=[...h];for(const w of o){const p=w;let g=0;for(const u of p){let b={};if(typeof u=="object"&&u!==null&&!Array.isArray(u)){const{content:W,href:y,...x}=u;b=x}b.width!==void 0?f[g]=b.width:b.maxWidth!==void 0&&f[g]!==void 0&&(f[g]=Math.min(f[g],b.maxWidth)),g+=b.colSpan??1}}h=f}const c={autoFlow:"row",backgroundColor:this.#t.style?.backgroundColor,balancedWidths:this.#t.balancedWidths??!1,border:this.#t.style?.border,borderColor:this.#t.style?.borderColor,columns:s,fixedColumnWidths:h,fixedRowHeights:n,foregroundColor:this.#t.style?.foregroundColor,gap:this.#t.gap??0,maxWidth:this.#t.maxWidth,onWarn:this.#t.onWarn,paddingLeft:this.#t.style?.paddingLeft,paddingRight:this.#t.style?.paddingRight,terminalWidth:this.#t.terminalWidth,truncate:this.#t.truncate??(h?.every(f=>typeof f=="number")||this.#t.maxWidth!==void 0&&!this.#t.balancedWidths),truncateOverflow:this.#t.truncateOverflow??!0,wordWrap:this.#t.wordWrap??!1},a=new at(c),d=[];if(this.#t.columnDefaults)for(const[f,w]of this.#t.columnDefaults.entries())w&&(d[f]={...w});if(this.#t.colAligns)for(const[f,w]of this.#t.colAligns.entries())w!==void 0&&(d[f]={...d[f],hAlign:d[f]?.hAlign??w});const l=d.length>0,m=[];for(const[f,w]of o.entries()){const p=w;if(!Array.isArray(p)){this.#s(`Skipping non-array row while creating GridItems: ${JSON.stringify(p)}`);continue}const g=this.#t.showHeader?this.#o.length:0,u=this.#e.length,b=this.#t.showHeader&&f<g,W=this.#t.showFooter&&f>=g+u,y=b&&p.length===1&&s>1,x=W&&p.length===1&&s>1;let R=0;for(const S of p){let v=S,B={};if(typeof v=="object"&&v!==null&&!Array.isArray(v)){const{content:H,href:O,...E}=v;v=O?`\x1B]8;;${Be(O)}\x1B\\${String(H)}\x1B]8;;\x1B\\`:H,B=E}const A=l?d[R]:void 0;A&&(B={...B,hAlign:B.hAlign??A.hAlign,maxWidth:B.maxWidth??A.maxWidth,truncate:B.truncate??A.truncate,vAlign:B.vAlign??A.vAlign,wordWrap:B.wordWrap??A.wordWrap}),R+=B.colSpan??1,y&&(B.colSpan=s),x&&(B.colSpan=s);const M=this.#t.transformTabToSpace&&typeof v=="string"?v.replaceAll(" "," ".repeat(this.#t.transformTabToSpace)):v,{maxWidth:L}=B;m.push({backgroundColor:B.backgroundColor,colSpan:B.colSpan,content:M,foregroundColor:B.foregroundColor,hAlign:B.hAlign,maxWidth:L,rowSpan:B.rowSpan,truncate:B.truncate??(L===void 0?void 0:!0),vAlign:B.vAlign,wordWrap:B.wordWrap})}}return a.addItems(m),this.#i=a.toString(),this.#n=!1,this.#i}}const Le=t=>new ve(t);export{Le as N,Ne as R,je as a,Me as c,Ie as d,Ce as h,Ae as i,ve as k,Se as o,ke as r,ye as t,Ee as w};
@@ -1 +0,0 @@
1
- import{createRequire as C}from"node:module";import{getAffectedProjects as S}from"@visulima/task-runner";import{i as W}from"./index-BjdW45xX.js";import{V as j}from"./vis-user-error-qqqhLoF6.js";import{r as A}from"./affected-shas-Dd0P7fGD.js";let T;const $=e=>(T??=C(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,s]=f.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return f.getBuiltinModule(e)}return $(e)},{spawnSync:I}=R("node:child_process"),v=new Set(["deep","direct","none"]),B=e=>{const t=[],s=e.split("\0");for(let n=0;n<s.length;n++){const o=s[n];if(!o||o.length<4)continue;const p=o.slice(0,2),d=o.slice(3);if(d&&t.push(d),p.includes("R")||p.includes("C")){n+=1;const c=s[n];c&&t.push(c)}}return t},P=e=>{const t=I("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!v.has(n))throw new j(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!v.has(o))throw new j(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{projectGraph:p,projects:d,workspaceRoot:c}=t,u=[];let{base:m}=e,{head:r}=e;if(!m||!r){const l=A({defaultBase:s.defaultBase,workspaceRoot:c});m=m||l.base,r=r||l.head,u.push(`Resolved affected refs from ${l.provider} (${l.notes.join("; ")})`)}const k=s.runningInCi??W,h=r==="HEAD"||r==="",b=e.uncommitted??(!k&&h);let a=[];if(b)if(h){const g=(s.readWorkingTreeChanges??P)(c),y=Object.values(d).map(i=>i.root?.replace(/\/$/,"")).filter(i=>!!i&&i!==".");a=g.filter(i=>y.some(_=>i===_||i.startsWith(`${_}/`)));const w=g.length-a.length;a.length>0&&u.push(`including ${a.length} uncommitted working-tree file(s)`),w>0&&u.push(`ignoring ${w} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else u.push(`ignoring --uncommitted: --head=${r} pins the comparison to a commit, not the working tree`);return{...await S({additionalChangedFiles:a,base:m,downstream:n,head:r,projectGraph:p,projects:d,upstream:o,workspaceRoot:c}),notes:u,uncommittedFileCount:a.length}};export{D as s};
@@ -1 +0,0 @@
1
- import{createRequire as W}from"node:module";import{e as h}from"./index-DHD8wb6Z.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as O}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let S;const B=e=>(S??=W(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,n]=_.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return _.getBuiltinModule(e)}return B(e)},{readdirSync:y,statSync:M}=w("node:fs"),P=["preinstall","install","postinstall","prepare"],$=e=>{const s=h(e,"node_modules");if(!g(s))return[];const n=new Map,o=(p,f="")=>{let l;try{l=y(p)}catch{return}for(const r of l){const i=h(p,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&f===""){let u;try{u=y(i)}catch{continue}for(const a of u){const c=h(i,a,"node_modules");g(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=f+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!g(t))continue;const u=O(t),a=u.scripts??{},c=P.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&g(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof u.version=="string"?u.version:void 0});const d=h(i,"node_modules");g(d)&&o(d)}catch{}}};return o(s),[...n.values()]},b=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},k=(e,s,n)=>{for(const[o,p]of Object.entries(s)){if(!p)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:f,version:l}=b(o);if(f===e.name&&(!n||l===void 0||e.version===l))return!0}return!1},q=(e,s,n={})=>{const o=n.pinVersions===!0,p=$(e),f=[],l=[],r=new Map(p.map(t=>[t.name,t]));for(const t of p)k(t,s,o)?l.push(t):f.push(t);const i=[],m=[];for(const[t,u]of Object.entries(s)){if(!u)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(j=>j.startsWith(v))||i.push(t);continue}const{name:a,version:c}=b(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:l,unapproved:f,versionDrift:m}},T=(e,s)=>q(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{q as a,T as s};
@@ -1 +0,0 @@
1
- import{z as d,e as l}from"./index-DHD8wb6Z.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{i as v,j as g}from"../packem_chunks/catalog.js";import{y as D}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";const b={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=t=>{const o=b[t];return o?[...o.aliases??[],o.file].map(e=>({file:e,type:o.type})):[]},h=(t,o)=>{const e=j(o);if(e.length!==0)return e.find(r=>D(l(t,r.file)))??e[e.length-1]},k=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],e=k(l(t,"package.json"));e&&o.push(e);const r=v(t);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return o;const i=g(t,c);for(const s of i){const n=k(l(t,s,"package.json"));n&&o.push(n)}return o},P=(t,o)=>{const e=new Set,r=[],c=new Map;for(const s of o){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const a of n)for(const p of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},O=(t,o,e={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const n=e.includeDev??!0?void 0:P(t,i),a=new Set,p=[];for(const f of i){if(n&&!n.has(f.name))continue;const u=`${f.name}@${f.version}`;a.has(u)||(a.add(u),p.push({isDev:!1,name:f.name,version:f.version}))}return p},I=(t,o)=>{const e=h(t,o);if(!e)return[];let r;try{r=d(l(t,e.file))}catch{return[]}const c=m(r,e.type);if(c.length===0)return[];const i=new Map;for(const n of c)i.has(n.name)||i.set(n.name,new Set),i.get(n.name).add(n.version);const s=[];for(const[n,a]of i)a.size<=1||s.push({name:n,versions:[...a]});return s.sort((n,a)=>n.name.localeCompare(a.name))},M=(t,o)=>{const e=h(t,o);if(!e)return;let r;try{r=d(l(t,e.file))}catch{return}const c=m(r,e.type);if(c.length===0)return;const i=[],s=new Set;for(const n of y(t))for(const a of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(a)for(const[p,f]of Object.entries(a)){const u=`${p}@${f}`;s.has(u)||(s.add(u),i.push({name:p,version:f}))}return{entries:c,roots:i}};export{b as L,M as a,I as f,O as l,h as r};
@@ -1,2 +0,0 @@
1
- import{createRequire as p}from"node:module";import{e as j}from"./index-DHD8wb6Z.js";import{a as F}from"./formatBytes-BHAzNIrn-XohRrPdt.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
2
- `,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},w=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,w as l};
@@ -1,4 +0,0 @@
1
- import{createRequire as st}from"node:module";import{e as f}from"./index-DHD8wb6Z.js";import{y as G}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as ht}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as dt}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let nt;const ot=t=>(nt??=st(import.meta.url))(t),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=t=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[s,e]=x.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return x.getBuiltinModule(t)}return ot(t)},{existsSync:it,readdirSync:z,statSync:rt,rmSync:Y,writeFileSync:at}=R("node:fs"),{spawn:F}=R("node:child_process"),{createHash:ct}=R("node:crypto"),{homedir:lt,platform:ut}=R("node:os"),pt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ft=12288,gt=65510,mt=[12288,12288,65281,65376,65504,65510],wt=8361,bt=65518,yt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],St=32,Et=10630,xt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],$t=4352,Mt=262141,V=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],$=(t,s)=>{let e=0,n=Math.floor(t.length/2)-1;for(;e<=n;){const r=Math.floor((e+n)/2),c=r*2;if(s<t[c])n=r-1;else if(s>t[c+1])e=r+1;else return!0}return!1},D=19968,[Bt,kt]=vt(V);function vt(t){let s=t[0],e=t[1];for(let n=0;n<t.length;n+=2){const r=t[n],c=t[n+1];if(D>=r&&D<=c)return[r,c];c-r>e-s&&(s=r,e=c)}return[s,e]}const Tt=t=>t<161||t>1114109?!1:$(pt,t),It=t=>t<ft||t>gt?!1:$(mt,t),Rt=t=>t<wt||t>bt?!1:$(yt,t),Wt=t=>t<St||t>Et?!1:$(xt,t),_t=t=>t>=Bt&&t<=kt?!0:t<$t||t>Mt?!1:$(V,t);function Ct(t){return Tt(t)?"ambiguous":It(t)?"fullwidth":Rt(t)?"halfwidth":Wt(t)?"narrow":_t(t)?"wide":"neutral"}function Nt(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Z(t){return Nt(t),Ct(t)}const H=String.raw,j=H`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,At=()=>new RegExp(H`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${j}(?:\u200D${j})*`,"gu"),he=new Set(["\x1B","›"]),de="\x07",pe="]8;;",fe=/[\u200B\uFEFF\u2060-\u2064]/g,U=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,ge=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,me=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,v=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,q=At(),we=/[-_./\s]+/g,be=/(\u001B\[[0-9;]*[a-z])/i,ye=new RegExp("\\p{Script=Arabic}","u"),Se=new RegExp("\\p{Script=Bengali}","u"),Ee=new RegExp("\\p{Script=Cyrillic}","u"),xe=new RegExp("\\p{Script=Devanagari}","u"),$e=new RegExp("\\p{Script=Ethiopic}","u"),Me=new RegExp("\\p{Script=Greek}","u"),Be=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),ke=new RegExp("\\p{Script=Gujarati}","u"),ve=new RegExp("\\p{Script=Gurmukhi}","u"),Te=new RegExp("\\p{Script=Hangul}","u"),Ie=new RegExp("\\p{Script=Hebrew}","u"),Re=new RegExp("\\p{Script=Hiragana}","u"),We=new RegExp("\\p{Script=Han}","u"),_e=new RegExp("\\p{Script=Kannada}","u"),Ce=new RegExp("\\p{Script=Katakana}","u"),Ne=new RegExp("\\p{Script=Khmer}","u"),Ae=new RegExp("\\p{Script=Lao}","u"),Fe=new RegExp("\\p{Script=Latin}","u"),De=new RegExp("\\p{Script=Malayalam}","u"),je=new RegExp("\\p{Script=Myanmar}","u"),Oe=new RegExp("\\p{Script=Oriya}","u"),Pe=new RegExp("\\p{Script=Sinhala}","u"),Ke=new RegExp("\\p{Script=Tamil}","u"),Le=new RegExp("\\p{Script=Telugu}","u"),ze=new RegExp("\\p{Script=Thai}","u"),Ye=new RegExp("\\p{Script=Tibetan}","u"),Ge=/[\u02BB\u02BC\u0027]/u,Ve=t=>t.replace(q,""),O=new Map,Ft=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Dt=t=>{const s=Ft(t.width);let e=O.get(s);return e||(e=new Map,O.set(s,e)),e},T=new RegExp(U.source,"y"),_=new RegExp(q.source,"uy"),I=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,J=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",jt=(t,s)=>{const e=Dt(s),n=Math.floor(t/65536),r=t%65536;let c=e.get(n);if(c||(c=new Map,e.set(n,c)),c.has(r))return c.get(r);let o;switch(J(t)){case"control":{o=s.width.control;break}case"latin":{o=s.width.regular;break}case"wide":{o=s.width.wide;break}case"zero":{o=0;break}default:switch(Z(t)){case"ambiguous":{o=s.width.ambiguousIsNarrow?s.width.regular:s.width.wide;break}case"fullwidth":{o=s.width.fullWidth;break}case"wide":{o=s.width.wide;break}default:o=s.width.regular}}return c.set(r,o),o},Ot=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,C=(t,s={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:s.countAnsiEscapeCodes??!1,ellipsis:s.ellipsis??"",ellipsisWidth:s.ellipsisWidth??(s.ellipsis?C(s.ellipsis,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:s.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:s.ambiguousIsNarrow??!1,ansi:s.ansiWidth??0,control:s.controlWidth??0,emoji:s.emojiWidth??2,fullWidth:s.fullWidth??2,halfWidth:s.halfWidth??1,regular:s.regularWidth??1,tab:s.tabWidth??8,wide:s.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:r}=t,c=r>1e4;let o=0,i=0,a=r,l=!1;const p=t.includes("\x1B")||t.includes("›");for(;o<r;){if(p&&(t[o]==="\x1B"||t[o]==="›")){if(t.startsWith("\x1B]8;;",o)){const d="\x1B]8;;\x07",w=d.length,y=t.indexOf("\x07",o+5);if(y!==-1){const S=t.indexOf(d,y+1);if(S!==-1){const B=S+w,W=t.slice(y+1,S).replace(U,""),k=C(W,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-i),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),E=k.width;if(k.truncated)l=!0,a=Math.min(a,o);else if(i+E>n&&(a=Math.min(a,o),l=!0,i+E>e.truncation.limit))break;if(i+=E,o=B,l&&i>=e.truncation.limit)break;continue}}}if(T.lastIndex=o,T.test(t)){const d=T.lastIndex-o,w=e.truncation.countAnsiEscapeCodes?d:e.width.ansi;if(i+w>n&&(a=Math.min(a,o),i+w>e.truncation.limit)){l=!0;break}i+=w,o=T.lastIndex;continue}}const u=t.codePointAt(o);if(u===8203||u===65279||u>=8288&&u<=8292){o+=1;continue}if(u===9){if(i+e.width.tab>n&&(a=Math.min(a,o),i+e.width.tab>e.truncation.limit)){l=!0;break}i+=e.width.tab,o+=1;continue}if(I.lastIndex=o,I.test(t)){const d=(I.lastIndex-o)*e.width.regular;if(i+d>n){const w=e.width.regular>0?Math.floor((n-i)/e.width.regular):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=I.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(v.lastIndex=o,v.test(t))){const d=(v.lastIndex-o)*e.width.control;if(i+d>n){const w=e.width.control>0?Math.floor((n-i)/e.width.control):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=v.lastIndex;continue}if(_.lastIndex=o,_.test(t)){if(i+e.width.emoji>n&&(a=Math.min(a,o),i+e.width.emoji>e.truncation.limit)){l=!0;break}i+=e.width.emoji,o=_.lastIndex;continue}const m=t.codePointAt(o)??0;if(Ot(m)){o+=m>65535?2:1;continue}let h;if(c)h=jt(m,e);else switch(J(m)){case"control":{h=e.width.control;break}case"latin":{h=e.width.regular;break}case"wide":{h=e.width.wide;break}case"zero":{h=0;break}default:switch(Z(m)){case"ambiguous":{h=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{h=e.width.fullWidth;break}case"wide":{h=e.width.wide;break}default:h=e.width.regular}}if(i+h>n&&(a=Math.min(a,o),i+h>e.truncation.limit)){l=!0;break}i+=h,o+=m>65535?2:1}let g=i,b=!1;return l&&e.truncation.limit>=e.truncation.ellipsisWidth&&(g=e.truncation.limit,b=!0),{ellipsed:b,index:l?a:r,truncated:l,width:g}},Ze=(t,s={})=>C(t,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,N=()=>f(lt(),".vis"),Pt=()=>f(N(),"cache"),He=()=>f(N(),"state"),Kt=t=>ct("sha256").update(t).digest("hex").slice(0,12),Ue=t=>f(N(),"workspaces",Kt(t)),Lt=".vis",A=t=>f(t,Lt),qe="node_modules/.cache/vis",Je=t=>f(A(t),"runs"),Xe=t=>f(A(t),"last-summary.json"),Qe=t=>f(A(t),"last-failures"),ts=t=>{const s=ut()==="win32";for(const e of[".task-runner",".task-runner-cache"]){const n=f(t,e);if(it(n))try{const r=s?F("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):F("rm",["-rf",n],{detached:!0,stdio:"ignore"});r.on("error",()=>{}),r.unref()}catch{}}},zt="https://api.socket.dev/v0/purl?alerts=true",M=()=>f(Pt(),"socket-security"),Yt=3600*1e3,X=.4,P=100,Gt=t=>typeof t=="object"&&t!==null&&"id"in t&&"type"in t&&"name"in t&&"version"in t&&"alerts"in t&&"score"in t&&t.type==="npm",Vt=()=>{dt(M())},Q=(t,s)=>`${encodeURIComponent(t)}@${encodeURIComponent(s)}`,Zt=(t,s)=>{const e=Q(t,s),n=f(M(),`${e}.json`);try{const r=ht(n);if(Date.now()-r.createdAt>r.ttlMs){Y(n,{force:!0});return}return r.report}catch{return}},Ht=(t,s,e,n)=>{const r=Q(t,s),c={createdAt:Date.now(),report:e,ttlMs:n};at(f(M(),`${r}.json`),JSON.stringify(c),"utf8")},Ut=t=>{const s=[t.license,t.maintenance,t.quality,t.supplyChain,t.vulnerability];return Number((s.reduce((e,n)=>e+n,0)/s.length).toFixed(2))},qt=async(t,s={})=>{const{apiToken:e,cacheTtlMs:n=Yt,timeoutMs:r=15e3}=s,c=new Map;if(t.length===0||!e)return c;const o=[];for(const l of t){const p=Zt(l.name,l.version);p?c.set(`${l.name}@${l.version}`,p):o.push(l)}if(o.length===0)return c;const i=`Basic ${Buffer.from(`${e}:`).toString("base64")}`;Vt();const a=[];for(let l=0;l<o.length;l+=P)a.push(o.slice(l,l+P));for(const l of a){const p=l.map(u=>({purl:`pkg:npm/${u.name}@${u.version}`})),g=new AbortController,b=setTimeout(()=>{g.abort()},r);try{const u=await fetch(zt,{body:JSON.stringify({components:p}),headers:{Authorization:i,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:g.signal});if(!u.ok)continue;const m=await u.text();Jt(m,l,c,n)}catch{}finally{clearTimeout(b)}}return c},Jt=(t,s,e,n)=>{const r=new Map;for(const o of s)r.set(`${o.name}@${o.version}`,o);const c=t.split(`}
2
- `);for(const o of c){const i=o.trim();if(i)try{const a=JSON.parse(i.endsWith("}")?i:`${i}}`),p=`${a.namespace?`${a.namespace}/`:""}${a.name}`,g=`${p}@${a.version}`;if(!r.has(g))continue;const b=a.score.overall??Ut(a.score),u={alerts:a.alerts,author:a.author,id:a.id,license:a.license,name:a.name,score:{...a.score,overall:b},size:a.size,type:"npm",version:a.version};a.namespace&&(u.namespace=a.namespace),Gt(u)&&(e.set(g,u),Ht(p,a.version,u,n))}catch{}}},Xt=t=>t.namespace?`${t.namespace}/${t.name}`:t.name,es=t=>t>=.8?"excellent":t>=.6?"good":t>=.4?"fair":t>=.2?"poor":"critical",ss=t=>t>=.6?"green":t>=.4?"yellow":"red",ns=t=>{const s=Xt(t),e=`score: ${String(Math.round(t.score.overall*100))}%`,n=t.alerts.length,r=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${s}@${t.version} (${e}, ${r})`},os=(t,s=X)=>{if(t.size===0)return"";let e=0,n=0,r=0,c=0,o=0,i=0;for(const l of t.values()){for(const p of l.alerts)switch(e++,p.severity){case"critical":{n++;break}case"high":{r++;break}case"medium":{c++;break}default:o++}l.score.overall<s&&i++}const a=[`Socket.dev: scanned ${String(t.size)} package${t.size===1?"":"s"}`];if(e>0){const l=[];n>0&&l.push(`${String(n)} critical`),r>0&&l.push(`${String(r)} high`),c>0&&l.push(`${String(c)} medium`),o>0&&l.push(`${String(o)} low`),a.push(` Alerts: ${String(e)} total (${l.join(", ")})`)}else a.push(" No security alerts found.");if(i>0){const l=Math.round(s*100);a.push(` ${String(i)} package${i===1?"":"s"} with low security score (<${String(l)}%)`)}return a.join(`
3
- `)},Qt=()=>{const t=M();if(!G(t))return 0;const s=z(t).filter(e=>e.endsWith(".json"));for(const e of s)Y(f(t,e),{force:!0});return s.length},te=()=>{const t=M();if(!G(t))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const s=z(t).filter(c=>c.endsWith(".json"));let e=0,n,r;for(const c of s){const o=rt(f(t,c));e+=o.size;const{mtimeMs:i}=o;(n===void 0||i<n)&&(n=i),(r===void 0||i>r)&&(r=i)}return{entries:s.length,newestEntry:r,oldestEntry:n,totalSizeBytes:e}},ee=(t,s)=>t?.enabled?{apiToken:t.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:t.cacheTtlMs,minimumScore:s??X,timeoutMs:t.timeoutMs}:void 0,is=(t,s,e,n)=>{if(!e)return;const r=Date.now(),c=i=>{if(i.expiresAt){const a=Date.parse(i.expiresAt);if(!Number.isNaN(a)&&a<r)return!1}return!(n&&i.policies&&!i.policies.includes(n))},o=`${t}@${s}`;if(e[o]&&c(e[o]))return e[o];if(e[t]&&c(e[t]))return e[t];for(const[i,a]of Object.entries(e))if(i.endsWith("*")&&t.startsWith(i.slice(0,-1))&&c(a))return a},rs=(t,s,e,n)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${t}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(e)},`,' policies: ["score"],'," },"].join(`
4
- `),as=(t,s={})=>{const e=ee(t,s.minimumScore);if(e)return{clearCache:Qt,displayName:"Socket.dev",fetchReports:n=>qt(n,e),getCacheStats:te,id:"socket"}},cs=t=>{if(t===void 0)return!1;const s=t.trim().toLowerCase();return s!==""&&s!=="0"&&s!=="false"&&s!=="no"},tt={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},se=[{long:"bits",short:"bit"},{long:"Kilobits",short:"kbit"},{long:"Megabits",short:"Mbit"},{long:"Gigabits",short:"Gbit"},{long:"Terabits",short:"Tbit"},{long:"Petabits",short:"Pbit"},{long:"Exabits",short:"Ebit"},{long:"Zettabits",short:"Zbit"},{long:"Yottabits",short:"Ybit"}],K=new Map,L=(t,s)=>{const e=`${t}\0${JSON.stringify(s)}`;let n=K.get(e);return n===void 0&&(n=new Intl.NumberFormat(t,s),K.set(e,n)),n},ne=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},oe=(t,s,e)=>({maximumFractionDigits:t,minimumFractionDigits:t,...s,...e}),ie=(t,s,e,n)=>{if(t===void 0)return-1;const r=s.findIndex(c=>c.short===t);return r===-1&&n?tt[e].findIndex(c=>c.short===t):r},ls=(t,s)=>{if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Bytesize is not a number.");const{base:e,bits:n,decimals:r,locale:c,long:o,signed:i,unit:a,units:l,...p}={base:2,bits:!1,decimals:0,locale:"en-US",long:!1,signed:!1,units:"metric",...s},g=ne(e),b=n?t*8:t,u=Math.abs(b),m=s?.space??!0?" ":"",h=n?se:tt[l],d=ie(a,h,l,n),w=r<0?void 0:r,y=i?{signDisplay:"exceptZero"}:{};if(b===0){const E=d===-1?0:Math.min(d,h.length-1),et=h[E][o?"long":"short"];return L(c,{...y,...p}).format(0)+m+et}const S=Math.max(0,Math.min(Math.floor(Math.log(u)/Math.log(g)),h.length-1)),B=d===-1?S:d,W=h[B][o?"long":"short"],k=b/g**B;return L(c,oe(w,y,p)).format(k)+m+W};export{ls as $,Ae as A,Ee as B,ve as C,X as D,je as E,Te as F,$e as G,xe as H,Ne as I,ze as J,Be as K,we as L,ke as M,Oe as N,Me as O,_e as P,ts as Q,q as R,ge as S,be as T,Fe as U,Ye as V,Ce as W,me as X,De as Y,Ge as Z,U as _,Qe as a,C as a0,It as a1,_t as a2,fe as a3,he as a4,pe as a5,de as a6,as as a7,os as a8,qe as a9,te as aa,Qt as ab,Xe as ac,N as b,A as c,Je as d,Xt as e,is as f,Pt as g,ns as h,es as i,rs as j,cs as k,He as l,Ut as m,qt as n,Ze as o,Ue as p,Ve as q,We as r,ss as s,Re as t,Ie as u,Ke as v,Se as w,ye as x,Le as y,Pe as z};